Session 3b

30
Session 3b

description

Session 3b. Overview. More Network Flow Models Assignment Model Traveling Salesman Model. Professor Scheduling Example. Three professors must be assigned to teach six sections of finance. Each professor must teach two sections of finance. - PowerPoint PPT Presentation

Transcript of Session 3b

Page 1: Session 3b

Session 3b

Page 2: Session 3b

Decision Models -- Prof. Juran

2

Overview• More Network Flow Models

– Assignment Model– Traveling Salesman Model

Page 3: Session 3b

Decision Models -- Prof. Juran

3

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.

Page 4: Session 3b

Decision Models -- Prof. Juran

4

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

Page 5: Session 3b

Decision Models -- Prof. Juran

5

Managerial Problem Definition

Determine an assignment of professors to sections that maximizes the total satisfaction of the professors.

Page 6: Session 3b

Decision Models -- Prof. Juran

6

FormulationDecision VariablesWe 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.ObjectiveMaximize total satisfaction.ConstraintsAll classes need to be covered by exactly 1 professor.Each professor needs to be assigned to exactly 2 classes.

Page 7: Session 3b

Decision Models -- Prof. Juran

7

FormulationDecision VariablesDefine 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.

ObjectiveMaximize Z =

3

1

6

1i jijijCX

Page 8: Session 3b

Decision Models -- Prof. Juran

8

FormulationConstraints

13

1

i

ijX for all j

26

1

j

ijX for all i

Page 9: Session 3b

Decision Models -- Prof. Juran

9

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.

Page 10: Session 3b

Decision Models -- Prof. Juran

10

FormulationThese 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. That’s OK, because the two constraints together force exactly one professor per class, and two classes per professor.

Page 11: Session 3b

Decision Models -- Prof. Juran

11

FormulationIt 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.

Page 12: Session 3b

Decision Models -- Prof. Juran

12

Solution Methodology123456789

10111213141516

A B C D E F G H I JPreferences

9AM 10AM 11AM 1PM 2PM 3PMProf 1 8 7 6 5 7 6Prof 2 9 9 8 8 4 4Prof 3 7 6 5 6 9 5

Assignments9AM 10AM 11AM 1PM 2PM 3PM Sum Required

Prof 1 0 0 0 0 0 0 0 = 2Prof 2 0 0 0 0 0 0 0 = 2Prof 3 0 0 0 0 0 0 0 = 2Sum 0 0 0 0 0 0

= = = = = =Required 1 1 1 1 1 1

Total satisfaction 0

Page 13: Session 3b

Decision Models -- Prof. Juran

13

Page 14: Session 3b

Decision Models -- Prof. Juran

14

Optimal Solution123456789

10111213141516

A B C D E F G H I JPreferences

9AM 10AM 11AM 1PM 2PM 3PMProf 1 8 7 6 5 7 6Prof 2 9 9 8 8 4 4Prof 3 7 6 5 6 9 5

Assignments9AM 10AM 11AM 1PM 2PM 3PM Sum Required

Prof 1 1 0 0 0 0 1 2 = 2Prof 2 0 1 1 0 0 0 2 = 2Prof 3 0 0 0 1 1 0 2 = 2Sum 1 1 1 1 1 1

= = = = = =Required 1 1 1 1 1 1

Total satisfaction 46

Page 15: Session 3b

Decision Models -- Prof. Juran

15

Optimal SolutionIn 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.

Page 16: Session 3b

Decision Models -- Prof. Juran

16

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).

Page 17: Session 3b

Decision Models -- Prof. Juran

17

Network Representation

3:00

Prof 1 Prof 2 Prof 3

2:001:0011:0010:009:00

Page 18: Session 3b

Decision Models -- Prof. Juran

18

Optimal Solution

3:00

Prof 1 Prof 2 Prof 3

2:001:0011:0010:009:00

89 8

6 96

Page 19: Session 3b

Decision Models -- Prof. Juran

19

Traveling Salesman ProblemOne 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?

Page 20: Session 3b

Decision Models -- Prof. Juran

20

FormulationDecision 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

Page 21: Session 3b

Decision Models -- Prof. Juran

21

1234567891011121314151617181920212223242526272829303132333435

A B C D E F G H I J K L M N O P QTotal Distance 0

Madrid Paris London Dublin Rome Brussells Amsterdam Berlin Stockholm Helsinki Vienna Athens LisbonMadrid 1 0 0 0 0 0 0 0 0 0 0 0 0 1 1Paris 0 1 0 0 0 0 0 0 0 0 0 0 0 1 1London 0 0 1 0 0 0 0 0 0 0 0 0 0 1 1Dublin 0 0 0 1 0 0 0 0 0 0 0 0 0 1 1Rome 0 0 0 0 1 0 0 0 0 0 0 0 0 1 1Brussells 0 0 0 0 0 1 0 0 0 0 0 0 0 1 1Amsterdam 0 0 0 0 0 0 1 0 0 0 0 0 0 1 1Berlin 0 0 0 0 0 0 0 1 0 0 0 0 0 1 1Stockholm 0 0 0 0 0 0 0 0 1 0 0 0 0 1 1Helsinki 0 0 0 0 0 0 0 0 0 1 0 0 0 1 1Vienna 0 0 0 0 0 0 0 0 0 0 1 0 0 1 1Athens 0 0 0 0 0 0 0 0 0 0 0 1 0 1 1Lisbon 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1

1 1 1 1 1 1 1 1 1 1 1 1 1

1 1 1 1 1 1 1 1 1 1 1 1 1

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

Page 22: Session 3b

Decision Models -- Prof. Juran

22

1

Page 23: Session 3b

Decision Models -- Prof. Juran

23

Trouble!Each source city is own destination.

We’ll use the old “big cost” trick:

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

Page 24: Session 3b

Decision Models -- Prof. Juran

24

2

Page 25: Session 3b

Decision Models -- Prof. Juran

25

More Trouble!Small loops – called “sub-tours”.

We need to add special constraints for each subtour:

Example in column S: B16 + N4 < = 1

123456789

10111213141516171819

A B C D E F G H I J K L M N O P Q R S T U VTotal Distance 13107

Madrid Paris London Dublin Rome Brussells Amsterdam Berlin Stockholm Helsinki Vienna Athens Lisbon Madrid London Stockholm BerlinMadrid 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 Lisbon Dublin Helsinki ViennaParis 1 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 0London 0 0 0 1 0 0 0 0 0 0 0 0 0 1 1Dublin 0 0 0 0 0 1 0 0 0 0 0 0 0 1 1 1 1 1 1Rome 0 0 0 0 0 0 0 0 0 0 0 1 0 1 1Brussells 0 0 0 0 0 0 1 0 0 0 0 0 0 1 1Amsterdam 0 0 1 0 0 0 0 0 0 0 0 0 0 1 1Berlin 0 0 0 0 0 0 0 0 1 0 0 0 0 1 1Stockholm 0 0 0 0 0 0 0 0 0 1 0 0 0 1 1Helsinki 0 0 0 0 0 0 0 1 0 0 0 0 0 1 1Vienna 0 0 0 0 1 0 0 0 0 0 0 0 0 1 1Athens 0 0 0 0 0 0 0 0 0 0 1 0 0 1 1Lisbon 0 1 0 0 0 0 0 0 0 0 0 0 0 1 1

1 1 1 1 1 1 1 1 1 1 1 1 1

1 1 1 1 1 1 1 1 1 1 1 1 1

Page 26: Session 3b

Decision Models -- Prof. Juran

26

3

Page 27: Session 3b

Decision Models -- Prof. Juran

27

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.

Page 28: Session 3b

Decision Models -- Prof. Juran

28

4

Page 29: Session 3b

Decision Models -- Prof. Juran

29

5

Page 30: Session 3b

Decision Models -- Prof. Juran

30

Summary• More Network Flow Models

– Assignment Model– Traveling Salesman Model