You are on page 1of 30

Session 3b

Overview

More Network Flow Models


Assignment Model
Traveling Salesman Model

Decision Models -- Prof. Juran 2


Professor Scheduling Example
Three professors must be assigned to teach
six sections of finance.
Each professor must teach two sections of
finance.
Each professor has ranked the six time
periods during which finance is taught.
A rating of 10 means that the professor wants
to teach at that time, and a ranking of 1
means that he or she does not want to teach at
that time.
Decision Models -- Prof. Juran 3
Professor Preferences

9 A.M. 10 A.M. 11 A.M. 1 P.M. 2 P.M. 3 P.M.


Professor 1 8 7 6 5 7 6
Professor 2 9 9 8 8 4 4
Professor 3 7 6 5 6 9 5

Decision Models -- Prof. Juran 4


Managerial Problem Definition

Determine an assignment of professors to


sections that maximizes the total
satisfaction of the professors.

Decision Models -- Prof. Juran 5


Formulation
Decision Variables
We need to identify who is teaching which class. In
other words, we need to make one-to-one links between
the classes to be taught and the available professors.
Objective
Maximize total satisfaction.
Constraints
All classes need to be covered by exactly 1 professor.
Each professor needs to be assigned to exactly 2 classes.

Decision Models -- Prof. Juran 6


Formulation
Decision Variables
Define Xij to be a binary variable representing the
assignment of professor i to class j. If professor i ends
up teaching class j, then Xij = 1. If professor i does not
end up teaching class j, then Xij = 0.

Define Cij to be the preference of professor i for class j.

Objective 3 6

Maximize Z = X C
i 1 j 1
ij ij

Decision Models -- Prof. Juran 7


Formulation

Constraints

X
i 1
ij 1 for all j
6

X
j 1
ij 2 for all i

Decision Models -- Prof. Juran 8


Formulation
The objective function uses the nice attributes of
binary variables to create an overall measure of
professorial delight.
If a professor is assigned to a class for which he/she
has a preference score of 6, for example, then the six
gets multiplied by a one (6 x 1 = 6) and gets added into
the overall objective score.
If the professor is not assigned to that class, then the
six gets multiplied by a zero (6 x 0 = 0) and has no
effect on the overall objective.

Decision Models -- Prof. Juran 9


Formulation
These constraints are not exactly like the English
versions; in particular they are not as strict.
For example, the first constraint seems to imply that
more than one professor could feasibly be assigned to
a class. The second constraint implies that a professor
could feasibly be assigned to fewer than two classes.
Thats OK, because the two constraints together force
exactly one professor per class, and two classes per
professor.

Decision Models -- Prof. Juran 10


Formulation
It is not necessary to constrain the decision
variables to be binary; the optimal linear
solution will automatically have zeros and
ones for the decision variables.

Decision Models -- Prof. Juran 11


Solution Methodology
A B C D E F G H I J
1 Preferences
2 9AM 10AM 11AM 1PM 2PM 3PM
3 Prof 1 8 7 6 5 7 6
4 Prof 2 9 9 8 8 4 4
5 Prof 3 7 6 5 6 9 5
6
7 Assignments
8 9AM 10AM 11AM 1PM 2PM 3PM Sum Required
9 Prof 1 0 0 0 0 0 0 0 = 2
10 Prof 2 0 0 0 0 0 0 0 = 2
11 Prof 3 0 0 0 0 0 0 0 = 2
12 Sum 0 0 0 0 0 0
13 = = = = = =
14 Required 1 1 1 1 1 1
15
16 Total satisfaction 0

Decision Models -- Prof. Juran 12


Decision Models -- Prof. Juran 13
Optimal Solution
A B C D E F G H I J
1 Preferences
2 9AM 10AM 11AM 1PM 2PM 3PM
3 Prof 1 8 7 6 5 7 6
4 Prof 2 9 9 8 8 4 4
5 Prof 3 7 6 5 6 9 5
6
7 Assignments
8 9AM 10AM 11AM 1PM 2PM 3PM Sum Required
9 Prof 1 1 0 0 0 0 1 2 = 2
10 Prof 2 0 1 1 0 0 0 2 = 2
11 Prof 3 0 0 0 1 1 0 2 = 2
12 Sum 1 1 1 1 1 1
13 = = = = = =
14 Required 1 1 1 1 1 1
15
16 Total satisfaction 46

Decision Models -- Prof. Juran 14


Optimal Solution
In the optimal solution, professor 1
teaches at 9:00 and 3:00, professor 2
teaches at 10:00 and 11:00, and
professor 3 teaches at 1:00 and 2:00.

The maximum overall preference score


is 46.

Decision Models -- Prof. Juran 15


This problem is an example of an entire
category of classic operations research
models called network flow problems, so
called because they can be represented as
networks of nodes (balls) and arcs
(arrows).

Decision Models -- Prof. Juran 16


Network Representation

Prof 1 Prof 2 Prof 3

9:00 10:00 11:00 1:00 2:00 3:00

Decision Models -- Prof. Juran 17


Optimal Solution

Prof 1 Prof 2 Prof 3

8 6 6 9
9 8

9:00 10:00 11:00 1:00 2:00 3:00

Decision Models -- Prof. Juran 18


Traveling Salesman Problem
One of the classic problems in optimization is to find the minimum-
distance path between a set of points. For example, what is the shortest
route that connects all of these 13 European cities?

Decision Models -- Prof. Juran 19


Formulation
Decision Variables: Binary decisions from each
source city to each destination city

Objective: Minimize total distance traveled


(sumproduct of binary variables times distances)

Constraints: Each city must be the source exactly


one time and the destination exactly one time

Decision Models -- Prof. Juran 20


A B C D E F G H I J K L M N O P Q
1 Total Distance 0
2
3 Madrid Paris London Dublin Rome Brussells Amsterdam Berlin Stockholm Helsinki Vienna Athens Lisbon
4 Madrid 1 0 0 0 0 0 0 0 0 0 0 0 0 1 1
5 Paris 0 1 0 0 0 0 0 0 0 0 0 0 0 1 1
6 London 0 0 1 0 0 0 0 0 0 0 0 0 0 1 1
7 Dublin 0 0 0 1 0 0 0 0 0 0 0 0 0 1 1
8 Rome 0 0 0 0 1 0 0 0 0 0 0 0 0 1 1
9 Brussells 0 0 0 0 0 1 0 0 0 0 0 0 0 1 1
10 Amsterdam 0 0 0 0 0 0 1 0 0 0 0 0 0 1 1
11 Berlin 0 0 0 0 0 0 0 1 0 0 0 0 0 1 1
12 Stockholm 0 0 0 0 0 0 0 0 1 0 0 0 0 1 1
13 Helsinki 0 0 0 0 0 0 0 0 0 1 0 0 0 1 1
14 Vienna 0 0 0 0 0 0 0 0 0 0 1 0 0 1 1
15 Athens 0 0 0 0 0 0 0 0 0 0 0 1 0 1 1
16 Lisbon 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1
17 1 1 1 1 1 1 1 1 1 1 1 1 1
18
19 1 1 1 1 1 1 1 1 1 1 1 1 1
20
21
22 Madrid Paris London Dublin Rome Brussells Amsterdam Berlin Stockholm Helsinki Vienna Athens Lisbon
23 Madrid 0 1260 1725 2259 2086 1556 1735 2360 3163 3523 2444 4029 644
24 Paris 1260 0 465 999 1437 296 475 1100 1903 2263 581 3058 1792
25 London 1725 465 0 534 1902 374 344 996 1771 2131 1506 3399 2257
26 Dublin 2259 999 534 0 2436 908 878 1530 2305 2665 2040 3933 2791
27 Rome 2086 1437 1902 2436 0 1545 1764 1529 2642 3003 1251 1417 2730
28 Brussells 1556 296 374 908 1545 0 198 789 1592 1952 1132 3025 2098
29 Amsterdam 1735 475 344 878 1764 198 0 685 1427 1860 1177 3070 2267
30 Berlin 2360 1100 996 1530 1529 789 685 0 1070 1430 657 2556 2892
31 Stockholm 3163 1903 1771 2305 2642 1592 1427 1070 0 360 1727 2626 3695
32 Helsinki 3523 2263 2131 2665 3003 1952 1860 1430 360 0 1787 3416 4055
33 Vienna 2444 581 1506 2040 1251 1132 1177 657 1727 1787 0 1899 2996
34 Athens 4029 3058 3399 3933 1417 3025 3070 2556 2626 3416 1899 0 4673
35 Lisbon 644 1792 2257 2791 2730 2098 2267 2892 3695 4055 2996 4673 0

Decision Models -- Prof. Juran 21


1

Decision Models -- Prof. Juran 22


Trouble!
Each source city is own destination.

Well use the old big cost trick:

Madrid Paris London Dublin Rome Brussells Amsterdam Berlin Stockholm Helsinki Vienna Athens Lisbon
Madrid 10000 1260 1725 2259 2086 1556 1735 2360 3163 3523 2444 4029 644
Paris 1260 10000 465 999 1437 296 475 1100 1903 2263 581 3058 1792
London 1725 465 10000 534 1902 374 344 996 1771 2131 1506 3399 2257
Dublin 2259 999 534 10000 2436 908 878 1530 2305 2665 2040 3933 2791
Rome 2086 1437 1902 2436 10000 1545 1764 1529 2642 3003 1251 1417 2730
Brussells 1556 296 374 908 1545 10000 198 789 1592 1952 1132 3025 2098
Amsterdam 1735 475 344 878 1764 198 10000 685 1427 1860 1177 3070 2267
Berlin 2360 1100 996 1530 1529 789 685 10000 1070 1430 657 2556 2892
Stockholm 3163 1903 1771 2305 2642 1592 1427 1070 10000 360 1727 2626 3695
Helsinki 3523 2263 2131 2665 3003 1952 1860 1430 360 10000 1787 3416 4055
Vienna 2444 581 1506 2040 1251 1132 1177 657 1727 1787 10000 1899 2996
Athens 4029 3058 3399 3933 1417 3025 3070 2556 2626 3416 1899 10000 4673
Lisbon 644 1792 2257 2791 2730 2098 2267 2892 3695 4055 2996 4673 10000

Decision Models -- Prof. Juran 23


2

Decision Models -- Prof. Juran 24


More Trouble!
Small loops called sub-tours.

We need to add special constraints for each subtour:


A B C D E F G H I J K L M N O P Q R S T U V
1 Total Distance 13107
2
3 Madrid Paris London Dublin Rome Brussells Amsterdam Berlin Stockholm Helsinki Vienna Athens Lisbon Madrid London Stockholm Berlin
4 Madrid 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 Lisbon Dublin Helsinki Vienna
5 Paris 1 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 0
6 London 0 0 0 1 0 0 0 0 0 0 0 0 0 1 1
7 Dublin 0 0 0 0 0 1 0 0 0 0 0 0 0 1 1 1 1 1 1
8 Rome 0 0 0 0 0 0 0 0 0 0 0 1 0 1 1
9 Brussells 0 0 0 0 0 0 1 0 0 0 0 0 0 1 1
10 Amsterdam 0 0 1 0 0 0 0 0 0 0 0 0 0 1 1
11 Berlin 0 0 0 0 0 0 0 0 1 0 0 0 0 1 1
12 Stockholm 0 0 0 0 0 0 0 0 0 1 0 0 0 1 1
13 Helsinki 0 0 0 0 0 0 0 1 0 0 0 0 0 1 1
14 Vienna 0 0 0 0 1 0 0 0 0 0 0 0 0 1 1
15 Athens 0 0 0 0 0 0 0 0 0 0 1 0 0 1 1
16 Lisbon 0 1 0 0 0 0 0 0 0 0 0 0 0 1 1
17 1 1 1 1 1 1 1 1 1 1 1 1 1
18
19 1 1 1 1 1 1 1 1 1 1 1 1 1

Example in column S: B16 + N4 < = 1

Decision Models -- Prof. Juran 25


3

Decision Models -- Prof. Juran 26


Sub-tours keep cropping up, and we need to add
constraints for each of them.

This procedure continues until a single tour encompasses


all cities.

Decision Models -- Prof. Juran 27


4

Decision Models -- Prof. Juran 28


5

Decision Models -- Prof. Juran 29


Summary

More Network Flow Models


Assignment Model
Traveling Salesman Model

Decision Models -- Prof. Juran 30

You might also like