session 4a

75
Session 4a

Upload: lisbet

Post on 25-Feb-2016

80 views

Category:

Documents


1 download

DESCRIPTION

Session 4a. Overview. More Network Models Assignment Model (Contract Bidding) “Big Cost” trick Project Management (House Building) More binary / integer tricks Critical Path / Slack Time Excel trick: Conditional Formatting Cost Crashing Changing an objective to a constraint - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Session 4a

Session 4a

Page 2: Session 4a

Decision Models -- Prof. Juran

2

OverviewMore Network Models

– Assignment Model (Contract Bidding)• “Big Cost” trick

– Project Management (House Building)• More binary / integer tricks• Critical Path / Slack Time• Excel trick: Conditional Formatting• Cost Crashing

– Changing an objective to a constraint– Issues with Integers– Location Analysis (Hospital Location)

Page 3: Session 4a

Decision Models -- Prof. Juran

3

Contract Bidding ExampleA company is taking bids on four construction jobs. Three contractors have placed bids on the jobs. Their bids (in thousands of dollars) are given in the table below. (A dash indicates that the contractor did not bid on the given job.) Contractor 1 can do only one job, but contractors 2 and 3 can each do up to two jobs.

Job 1 Job 2 Job 3 Job 4 Contractor 1 50 46 42 40 Contractor 2 51 48 44 — Contractor 3 — 47 45 45

Page 4: Session 4a

Decision Models -- Prof. Juran

4

Formulation Decision VariablesWhich contractor gets which job(s).ObjectiveMinimize the total cost of the four jobs.ConstraintsContractor 1 can do no more than one job.Contractors 2 and 3 can do no more than two jobs each.Contractor 2 can’t do job 4.Contractor 3 can’t do job 1.Every job needs one contractor.

Page 5: Session 4a

Decision Models -- Prof. Juran

5

Formulation Decision VariablesDefine Xij to be a binary variable representing the assignment of contractor i to job j. If contractor i ends up doing job j, then Xij = 1. If contractor i does not end up with job j, then Xij = 0.

Define Cij to be the cost; i.e. the amount bid by contractor i for job j.

ObjectiveMinimize Z =

3

1

4

1i jijijCX

Page 6: Session 4a

Decision Models -- Prof. Juran

6

Formulation Constraints for all j.

for i = 1.

for i = 2, 3.

13

1

iijX

14

1

jijX

24

1

jijX

01,34,2 XX

Page 7: Session 4a

Decision Models -- Prof. Juran

7

Solution Methodology123456789101112131415

A B C D E F G HJob 1 Job 2 Job 3 Job 4

Contractor 1 50 46 42 40Contractor 2 51 48 44 10000Contractor 3 10000 47 45 45

Assignment of contractors to jobsJob 1 Job 2 Job 3 Job 4 Total Max

Contractor 1 0 0 0 0 0 <= 1Contractor 2 0 0 0 0 0 <= 2Contractor 3 0 0 0 0 0 <= 2Total 0 0 0 0

= = = =Required 1 1 1 1

Total cost ($1000s) 0=SUMPRODUCT(B2:E4,B8:E10)

=SUM(E8:E10)

=SUM(B8:E8)

Page 8: Session 4a

Decision Models -- Prof. Juran

8

Solution MethodologyNotice the very large values in cells B4 and E3. These specific values (10,000) aren’t important; the main thing is to assign these particular contractor-job combinations costs so large that they will never be in any optimal solution.

Page 9: Session 4a

Decision Models -- Prof. Juran

9

Solution Methodology

Page 10: Session 4a

Decision Models -- Prof. Juran

10

Optimal Solution123456789101112131415

A B C D E F G HJob 1 Job 2 Job 3 Job 4

Contractor 1 50 46 42 40Contractor 2 51 48 44 10000Contractor 3 10000 47 45 45

Assignment of contractors to jobsJob 1 Job 2 Job 3 Job 4 Total Max

Contractor 1 0 0 0 1 1 <= 1Contractor 2 1 0 1 0 2 <= 2Contractor 3 0 1 0 0 1 <= 2Total 1 1 1 1

= = = =Required 1 1 1 1

Total cost ($1000s) 182

Page 11: Session 4a

Decision Models -- Prof. Juran

11

Conclusions

The optimal solution is to award Job 4 to Contractor 1, Jobs 1 and 3 to Contractor 2, and Job 2 to Contractor 3. The total cost is $182,000.

Page 12: Session 4a

Decision Models -- Prof. Juran

12

Sensitivity Analysis1. What is the “cost” of restricting

Contractor 1 to only one job?2. How much more can Contractor 1 bid

for Job 4 and still get the job?

Page 13: Session 4a

Decision Models -- Prof. Juran

13

1234567891011121314151617181920212223242526272829

A B C D E F G HMicrosoft Excel 15.0 Sensitivity Report

Variable CellsFinal Reduced Objective Allowable Allowable

Cell Name Value Cost Coefficient Increase Decrease$B$8 Contractor 1 Job 1 0 1 50 1E+30 1$C$8 Contractor 1 Job 2 0 1 46 1E+30 1$D$8 Contractor 1 Job 3 0 0 42 1 3$E$8 Contractor 1 Job 4 1 0 40 3 1E+30$B$9 Contractor 2 Job 1 1 0 51 1 1E+30$C$9 Contractor 2 Job 2 0 1 48 1E+30 1$D$9 Contractor 2 Job 3 1 0 44 1 1$E$9 Contractor 2 Job 4 0 9958 10000 1E+30 9958$B$10 Contractor 3 Job 1 0 9949 10000 1E+30 9949$C$10 Contractor 3 Job 2 1 0 47 1 1E+30$D$10 Contractor 3 Job 3 0 1 45 1E+30 1$E$10 Contractor 3 Job 4 0 3 45 1E+30 3

ConstraintsFinal Shadow Constraint Allowable Allowable

Cell Name Value Price R.H. Side Increase Decrease$B$11 Total Job 1 1 51 1 0 1$C$11 Total Job 2 1 47 1 1 1$D$11 Total Job 3 1 44 1 0 1$E$11 Total Job 4 1 42 1 0 1$F$8 Contractor 1 Total 1 -2 1 1 0$F$9 Contractor 2 Total 2 0 2 1E+30 0$F$10 Contractor 3 Total 1 0 2 1E+30 1

Page 14: Session 4a

Decision Models -- Prof. Juran

14

ConclusionsThe sensitivity report indicates a shadow price of –2 (cell E29).

(Allowing Contractor 1 to perform one additional job would reduce the total cost by 2,000.)

The allowable increase in the bid for Job 4 by Contractor 1 is 3. (He could have bid any amount up to $43,000 and still have won that job.)

Page 15: Session 4a

Decision Models -- Prof. Juran

15

Con. 3Con. 2Con. 1

Network Representation

Job 3Job 2 Job 4Job 1

Page 16: Session 4a

Decision Models -- Prof. Juran

16

Optimal Solution

Con. 1

Job 3

Con. 2 Con. 3

Job 2 Job 4Job 1

4047

4451

Page 17: Session 4a

Decision Models -- Prof. Juran

17

House-Building ExampleActivity Description Predecessors Duration (days)

Activity A Build foundation — 5 Activity B Build walls and ceilings A 8 Activity C Build roof B 10 Activity D Do electrical wiring B 5 Activity E Put in windows B 4 Activity F Put on siding E 6 Activity G Paint house C, F 3

Page 18: Session 4a

Decision Models -- Prof. Juran

18

Managerial Problem Definition

Find the critical path and the minimum number of days needed to build the house.

Page 19: Session 4a

Decision Models -- Prof. Juran

19

Network Representation1

0Start

43

2

A5

B8

C10

E4

D5

G3

F6

5End

Page 20: Session 4a

Decision Models -- Prof. Juran

20

FormulationDecision VariablesWe are trying to decide when to begin and end each of the activities.ObjectiveMinimize the total time to complete the project.ConstraintsEach activity has a fixed duration.There are precedence relationships among the activities.We cannot go backwards in time.

Page 21: Session 4a

Decision Models -- Prof. Juran

21

FormulationDecision VariablesDefine the nodes to be discrete events. In other words, they occur at one exact point in time. Our decision variables will be these points in time.Define ti to be the time at which node i occurs, and at which time all activities preceding node i have been completed.Define t0 to be zero.

ObjectiveMinimize t5.

Page 22: Session 4a

Decision Models -- Prof. Juran

22

FormulationConstraintsThere is really one basic type of constraint. For each activity x, let the time of its starting node be represented by tjx and the time of its ending node be represented by tkx. Let the duration of activity x be represented as dx.

For every activity x,

For every node i,

xjxkx dtt

0it

Page 23: Session 4a

Decision Models -- Prof. Juran

23

Solution Methodology123456789101112131415161718

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

1

t0 t1 t2 t3 t4 t50 1 1 1 1 1

t0 t1 t2 t3 t4 t5A -1 1 0 0 0 0 1 >= 5B 0 -1 1 0 0 0 0 >= 8C 0 0 -1 0 1 0 0 >= 10D 0 0 -1 0 0 1 0 >= 5E 0 0 -1 1 0 0 0 >= 4F 0 0 0 -1 1 0 0 >= 6G 0 0 0 0 -1 1 0 >= 3

1

0Start

43

2

A5

B8

C10

E4

D5

G3

F6

5End

Page 24: Session 4a

Decision Models -- Prof. Juran

24

Solution MethodologyThe matrix of zeros, ones, and negative ones (B12:G18) is a means for setting up the constraints.

The sumproduct functions in H12:H18 calculate the elapsed time between relevant pairs of nodes, corresponding to the various activities.

The duration times of the activities are in J12:J18.

Page 25: Session 4a

Decision Models -- Prof. Juran

25

Page 26: Session 4a

Decision Models -- Prof. Juran

26

Optimal Solution123456789101112131415161718

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

26

t0 t1 t2 t3 t4 t50 5 13 17 23 26

t0 t1 t2 t3 t4 t5A -1 1 0 0 0 0 5 >= 5B 0 -1 1 0 0 0 8 >= 8C 0 0 -1 0 1 0 10 >= 10D 0 0 -1 0 0 1 13 >= 5E 0 0 -1 1 0 0 4 >= 4F 0 0 0 -1 1 0 6 >= 6G 0 0 0 0 -1 1 3 >= 3

1

0Start

43

2

A5

B8

C10

E4

D5

G3

F6

5End

Page 27: Session 4a

Decision Models -- Prof. Juran

27

Conclusions

The project will take 26 days to complete.

The only activity that is not critical is the electrical wiring.

Page 28: Session 4a

Decision Models -- Prof. Juran

28

CPM JargonAny activity for which

is said to have slack time, the amount of time by which that activity could be delayed without affecting the overall completion time of the whole project. In this example, only activity D has any slack time (13 – 5 = 8 units of slack time).

xjxkx dtt

Page 29: Session 4a

Decision Models -- Prof. Juran

29

CPM Jargon

Any activity x for which

is defined to be a “critical” activity, with zero slack time.

xjxkx dtt

Page 30: Session 4a

Decision Models -- Prof. Juran

30

CPM JargonEvery network of this type has at least one critical path, consisting of a set of critical activities. In this example, there are two critical paths: A-B-C-G and A-B-E-F-G.

1

0Start

43

2

A5

B8

C10

E4

D5

G3

F6

5End

Page 31: Session 4a

Decision Models -- Prof. Juran

31

Excel Tricks: Conditional Formatting1

23456789101112131415161718

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

26

t0 t1 t2 t3 t4 t50 5 13 17 23 26

t0 t1 t2 t3 t4 t5A -1 1 0 0 0 0 5 >= 5B 0 -1 1 0 0 0 8 >= 8C 0 0 -1 0 1 0 10 >= 10D 0 0 -1 0 0 1 13 >= 5E 0 0 -1 1 0 0 4 >= 4F 0 0 0 -1 1 0 6 >= 6G 0 0 0 0 -1 1 3 >= 3

1

0Start

43

2

A5

B8

C10

E4

D5

G3

F6

5End

Page 32: Session 4a

Decision Models -- Prof. Juran

32

Critical Activities: Using the Solver Answer Report

ConstraintsCell Name Cell Value Formula Status Slack

$H$12 A 5 $H$12>=$J$12 Binding 0$H$13 B 8 $H$13>=$J$13 Binding 0$H$14 C 10 $H$14>=$J$14 Binding 0$H$15 D 13 $H$15>=$J$15 Not Binding 8$H$16 E 4 $H$16>=$J$16 Binding 0$H$17 F 6 $H$17>=$J$17 Binding 0$H$18 G 3 $H$18>=$J$18 Binding 0

Page 33: Session 4a

Decision Models -- Prof. Juran

33

House-Building Example, Continued

Suppose that by hiring additional workers, the duration of each activity can be reduced. Use LP to find the strategy that minimizes the cost of completing the project within 20 days.

Page 34: Session 4a

Decision Models -- Prof. Juran

34

Crashing Parameters

Activity Cost per Day to

Reduce Duration Maximum Possible Reduction (Days)

Build foundation $30 2 Walls and ceilings $15 3 Build roof $20 1 Electrical wiring $40 2 Put in windows $20 2 Put on siding $30 3 Paint house $40 1

Page 35: Session 4a

Decision Models -- Prof. Juran

35

Managerial Problem Definition

Find a way to build the house in 20 days.

Page 36: Session 4a

Decision Models -- Prof. Juran

36

FormulationDecision VariablesNow the problem is not only when to schedule the activities, but also which activities to accelerate. (In CPM jargon, accelerating an activity at an additional cost is called “crashing”.)

ObjectiveMinimize the total cost of crashing.

Page 37: Session 4a

Decision Models -- Prof. Juran

37

FormulationConstraintsThe project must be finished in 20 days.Each activity has a maximum amount of crash time.Each activity has a “basic” duration. (These durations were considered to have been fixed in Part a; now they can be reduced.)There are precedence relationships among the activities.We cannot go backwards in time.

Page 38: Session 4a

Decision Models -- Prof. Juran

38

FormulationDecision VariablesDefine the number of days that activity x is crashed to be Rx.

For each activity there is a maximum number of crash days Rmax, x

Define the crash cost per day for activity x to be Cx 

ObjectiveMinimize Z =

7

1xxxCR

Page 39: Session 4a

Decision Models -- Prof. Juran

39

FormulationConstraints

For every activity x,

For every activity x,

For every node i,

xxjxkx Rdtt

xx RR max,

0it

Page 40: Session 4a

Decision Models -- Prof. Juran

40

Solution Methodology123456789101112131415161718

A B C D E F G H I J K L M N O

30

t0 t1 t2 t3 t4 t50 1 1 1 1 1

20 <-- Max Completion Time

t0 t1 t2 t3 t4 t5 Improved Duration Basic Duration Crash Time Max Crash Cost/TimeA -1 1 0 0 0 0 1 >= 4 5 1 2 30$ B 0 -1 1 0 0 0 0 >= 8 8 0 3 15$ C 0 0 -1 0 1 0 0 >= 10 10 0 1 20$ D 0 0 -1 0 0 1 0 >= 5 5 0 2 40$ E 0 0 -1 1 0 0 0 >= 4 4 0 2 20$ F 0 0 0 -1 1 0 0 >= 6 6 0 3 30$ G 0 0 0 0 -1 1 0 >= 3 3 0 1 40$

1

0Start

43

2

A5

B8

C10

E4

D5

G3

F6

5End

Page 41: Session 4a

Decision Models -- Prof. Juran

41

Solution MethodologyG3 now contains a formula to calculate the total crash cost. The new decision variables (how long to crash each activity x, represented by Rx) are in M12:M18.

G8 contains the required completion time, and we will constrain the value in G6 to be less than or equal to G8.

The range J12:J18 calculates the revised duration of each activity, taking into account how much time is saved by crashing.

Page 42: Session 4a

Decision Models -- Prof. Juran

42

Solution Methodology

Page 43: Session 4a

Decision Models -- Prof. Juran

43

Optimal Solution123456789101112131415161718

A B C D E F G H I J K L M N O

145

t0 t1 t2 t3 t4 t50 3 8 11 17 20

20 <-- Max Completion Time

t0 t1 t2 t3 t4 t5 Improved Duration Basic Duration Crash Time Max Crash Cost/TimeA -1 1 0 0 0 0 3 >= 3 5 2 2 30$ B 0 -1 1 0 0 0 5 >= 5 8 3 3 15$ C 0 0 -1 0 1 0 9 >= 9 10 1 1 20$ D 0 0 -1 0 0 1 12 >= 5 5 0 2 40$ E 0 0 -1 1 0 0 3 >= 3 4 1 2 20$ F 0 0 0 -1 1 0 6 >= 6 6 0 3 30$ G 0 0 0 0 -1 1 3 >= 3 3 0 1 40$

1

0Start

43

2

A5

B8

C10

E4

D5

G3

F6

5End

Page 44: Session 4a

Decision Models -- Prof. Juran

44

ConclusionsIt is feasible to complete the project in 20 days, at a cost of $145.

1

0Start

43

2

A3

B5

C9

E3

D5

G3

F6

5End

Page 45: Session 4a

Decision Models -- Prof. Juran

45

ConclusionsBasic Duration Crash Time Improved Duration Cost/Time Cost

A 5 2 3 30$ 60$ B 8 3 5 15$ 45$ C 10 1 9 20$ 20$ D 5 0 5 40$ -$ E 4 1 3 20$ 20$ F 6 0 6 30$ -$ G 3 0 3 40$ -$

145$

Page 46: Session 4a

Decision Models -- Prof. Juran

46

An Alternative SolutionBasic Duration Crash Time Improved Duration Cost/Time Cost

A 5 2 3 30$ 60$ B 8 3 5 15$ 45$ C 10 0 10 20$ -$ D 5 0 5 40$ -$ E 4 0 4 20$ -$ F 6 0 6 30$ -$ G 3 1 2 40$ 40$

145$

Page 47: Session 4a

Decision Models -- Prof. Juran

47

Excel Tricks: VLOOKUP

Looks for a specific value in the left column of a table and finds the row where that value appears, then returns the value corresponding to another specified column in that row.

Page 48: Session 4a

Decision Models -- Prof. Juran

48

12345678910111213141516171819202122232425262728293031

A B C D E F G H I JSchool CostNYU 31,746$

School Accept % Enroll % GMAT GPA Cost Minority pct Non-U.S. pct Female % SalaryStanford 8.8% 78.4% 718 3.58 31,002$ 24.6% 30.9% 38.7% 124,740$ Harvard 11.6% 87.3% 703 3.58 30,050$ 18.6% 37.2% 34.2% 121,979$ Penn 15.5% 70.2% 703 3.57 31,218$ 19.0% 43.1% 29.3% 121,200$ MIT 18.1% 69.9% 703 3.50 31,200$ 19.0% 35.5% 26.5% 118,381$ Northwestern 16.6% 61.8% 700 3.45 30,255$ 17.5% 30.8% 27.5% 114,664$ Duke 20.1% 52.8% 690 3.43 30,323$ 20.6% 32.7% 34.8% 115,444$ Chicago 28.4% 59.7% 695 3.33 30,596$ 18.2% 33.2% 23.6% 115,331$ Columbia 13.5% 68.7% 705 3.40 31,912$ 19.3% 26.5% 36.5% 117,989$ Dartmouth 18.8% 53.3% 690 3.40 30,250$ 17.2% 29.9% 27.6% 121,692$ Berkeley 14.5% 50.3% 688 3.43 21,242$ 19.4% 30.2% 30.4% 111,321$ Michigan 19.6% 58.5% 676 3.34 30,686$ 20.5% 31.2% 27.6% 117,498$ Virginia 16.6% 51.0% 681 3.40 27,283$ 15.1% 30.1% 29.1% 112,706$ NYU 22.3% 48.2% 689 3.40 31,746$ 19.0% 30.2% 34.1% 112,900$ Yale 20.0% 56.7% 686 3.50 29,055$ 17.3% 38.9% 27.5% 112,514$ UCLA 17.4% 48.5% 691 3.60 22,490$ 21.6% 24.0% 28.6% 103,364$ Cornell 25.8% 51.2% 669 3.32 30,455$ 22.6% 25.6% 27.1% 116,588$ North Carolina 23.8% 44.2% 674 3.30 25,525$ 16.2% 30.4% 30.6% 109,420$ Carnegie-Mellon 28.2% 60.1% 652 3.25 28,452$ 21.3% 38.3% 26.8% 111,211$ Texas 30.0% 52.4% 680 3.34 21,200$ 12.3% 26.7% 22.7% 106,859$ USC 29.0% 43.4% 670 3.30 30,082$ 32.3% 23.8% 28.7% 95,213$ Indiana 24.7% 49.8% 651 3.35 20,696$ 14.3% 34.5% 20.7% 99,732$ Emory 31.5% 46.7% 651 3.30 28,012$ 10.7% 29.9% 23.4% 104,417$ Rochester 32.7% 42.2% 637 3.33 28,620$ 10.3% 54.2% 25.2% 103,466$ Georgetown 20.8% 46.2% 662 3.35 28,440$ 10.8% 38.7% 28.1% 99,528$ Michigan State 22.3% 55.0% 641 3.36 16,955$ 13.6% 37.9% 25.2% 88,746$ Ohio State 29.0% 41.4% 645 3.38 22,151$ 15.5% 29.2% 36.7% 99,598$ Minnesota 34.4% 40.6% 645 3.33 20,352$ 8.6% 29.1% 27.9% 91,140$

=VLOOKUP(A2,A5:J31,6,0)

Page 49: Session 4a

Decision Models -- Prof. Juran

49

Integer Programs• We have seen models where the

decision variables had to be integers, but we didn’t have to impose a Solver constraint to make that happen (a special attribute of some transportation models)

• In general, you do need to impose a Solver constraint to force an integer solution

• No more Simplex algorithm!• Binary = Special case of integer

Page 50: Session 4a

Decision Models -- Prof. Juran

50

Difficulties with Integer Programs

• Linear approximations are not necessarily feasible or optimal

• Integer optimal solutions require much more complicated algorithms

• Integer algorithms do not yield a sensitivity report

Page 51: Session 4a

Decision Models -- Prof. Juran

51

Maximize z = YX 1121 Subject to: YX 47 13

X, Y 0 Linear Program

0

1

2

3

4

0 1 2 3 4

Optimal SolutionX1=1.857, X2=0

Page 52: Session 4a

Decision Models -- Prof. Juran

52

Optimal linear-programming solution: X = 1.857, Y = 0Rounded to X = 2, Y = 0 is infeasibleRounded to X = 1, Y = 0 is not optimalOptimal integer-programming solution: X = 0, Y = 3

Integer Program

0

1

2

3

4

0 1 2 3 4

Optimal SolutionX1=0, X2=3

Page 53: Session 4a

Decision Models -- Prof. Juran

53

Hospital Location ExampleA county is going to build two hospitals. There are nine cities in which the hospitals can be built. The number of hospital visits per year made by people in each city and the x-y coordinates of each city are listed in the table below. The county's goal is to minimize the total distance that patients must travel to hospitals. Where should it locate the hospitals?

Page 54: Session 4a

Decision Models -- Prof. Juran

54

Hospital Location ExampleCity x y Hospital visits per Year

1. Kimsbury 0 0 3000 2. Jozefacki Junction 10 3 4000 3. Sapras Falls 12 15 5000 4. Lowthersburg 14 13 6000 5. Leesville 16 9 4000 6. Sanjay Beach 18 6 3000 7. Patel Point 8 12 2000 8. Rothsboro 6 10 4000 9. Nikolova City 4 8 1200

Page 55: Session 4a

Decision Models -- Prof. Juran

55

Hospital Location ExampleCounty Map

0

2

4

6

8

10

12

14

16

0 2 4 6 8 10 12 14 16 18 20

X

Y

1. Kimsbury 2. Jozefacki Junction

9. Nikolova City

8. Rothsboro7. Patel Point

3. Sapras Falls

6. Sanjay Beach

5. Leesville

4. Lowthersburg

Page 56: Session 4a

Decision Models -- Prof. Juran

56

Managerial Problem Definition

Decision VariablesWe need to decide whether or not to build a hospital in each of nine cities.We also need to decide how many visits there will be from each city to each hospital.ObjectiveWe want to minimize the total distance traveled to the hospital by all county residents.

Page 57: Session 4a

Decision Models -- Prof. Juran

57

Managerial Problem DefinitionConstraintsThe cities can’t be moved.Exactly two hospitals will be built.All of the planned hospital visits must be accounted for and included in the total distance calculation.No hospital visits are allowed to a city that has no hospital.

Page 58: Session 4a

Decision Models -- Prof. Juran

58

Network Representation

98

7

6

5

4

3

2

1

Page 59: Session 4a

Decision Models -- Prof. Juran

59

Network Representation

98

7

6

5

4

3

2

1 One Hospital

Page 60: Session 4a

Decision Models -- Prof. Juran

60

FormulationDecision Variables Define Vij to be the number of visits from people in city i to the hospital in city j. Define Xj to be a binary variable. If a hospital is built in city j, then Xj = 1; otherwise, Xj = 0. These Vij and Xj are the decision variables. There are 81 + 9 = 90 decision variables here. Objective Define Dij to be the distance from city i to city j.

Minimize Z = iji j

ijDV

9

1

9

1

Page 61: Session 4a

Decision Models -- Prof. Juran

61

Formulation

Page 62: Session 4a

Decision Models -- Prof. Juran

62

Solution Methodology12345678910111213141516171819202122232425262728

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

1 2 3 4 5 6 7 8 9 Sum Required Total miles (x 1000)1 1 1 1 1 1 1 1 1 9 = 2 0.00

Vij to City coordinates1 2 3 4 5 6 7 8 9 Sum Ri x y

1 3.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 3 = 3 1 0 02 0.0 4.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 4 = 4 2 10 33 0.0 0.0 5.0 0.0 0.0 0.0 0.0 0.0 0.0 5 = 5 3 12 154 0.0 0.0 0.0 6.0 0.0 0.0 0.0 0.0 0.0 6 = 6 4 14 13

from 5 0.0 0.0 0.0 0.0 4.0 0.0 0.0 0.0 0.0 4 = 4 5 16 96 0.0 0.0 0.0 0.0 0.0 3.0 0.0 0.0 0.0 3 = 3 6 18 67 0.0 0.0 0.0 0.0 0.0 0.0 2.0 0.0 0.0 2 = 2 7 8 128 0.0 0.0 0.0 0.0 0.0 0.0 0.0 4.0 0.0 4 = 4 8 6 109 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.2 1.2 = 1.2 9 4 8

3.0 4.0 5.0 6.0 4.0 3.0 2.0 4.0 1.2Logical upper bounds <= <= <= <= <= <= <= <= <= Distances 1 2 3 4 5 6 7 8 9

32.2 32.2 32.2 32.2 32.2 32.2 32.2 32.2 32.2 1 0.0 10.4 19.2 19.1 18.4 19.0 14.4 11.7 8.92 10.4 0.0 12.2 10.8 8.5 8.5 9.2 8.1 7.83 19.2 12.2 0.0 2.8 7.2 10.8 5.0 7.8 10.64 19.1 10.8 2.8 0.0 4.5 8.1 6.1 8.5 11.25 18.4 8.5 7.2 4.5 0.0 3.6 8.5 10.0 12.06 19.0 8.5 10.8 8.1 3.6 0.0 11.7 12.6 14.17 14.4 9.2 5.0 6.1 8.5 11.7 0.0 2.8 5.78 11.7 8.1 7.8 8.5 10.0 12.6 2.8 0.0 2.89 8.9 7.8 10.6 11.2 12.0 14.1 5.7 2.8 0.0

=SUM($N$7:$N$15)*C3

=SUMPRODUCT(C7:K15,N18:V26)

=SUM(C10:K10)

=SUM(K7:K15)

=SQRT((VLOOKUP($M22,$P$6:$R$15,2)-VLOOKUP(O$17,$P$6:$R$15,2))^2+(VLOOKUP($M22,$P$6:$R$15,3)-VLOOKUP(O$17,$P$6:$R$15,3))^2)

Page 63: Session 4a

Decision Models -- Prof. Juran

63

Solution MethodologyThe 9 Xj decision variables are in the range C3:K3.The 81 Vij decision variables are in the range C7:K15.The objective function is in cell P3.The matrix in the range N18:V26 calculates the distance between each pair of cities using a long and ugly Excel function based on the famous Pythagorean theorem.Cell N3 is used to keep track of constraint (1).Cells L7:L15 and N7:N15 are used to keep track of constraint (2).Cells C16:K16 and C18:K18 are used to keep track of constraint (3).

Page 64: Session 4a

Decision Models -- Prof. Juran

64

Page 65: Session 4a

Decision Models -- Prof. Juran

65

Optimal Solution123456789

1011121314151617181920212223242526

A B C D E F G H I J K L M N O P Q RXj

1 2 3 4 5 6 7 8 9 Sum Required Total miles (x 1000)0 0 0 1 0 0 0 1 0 2 = 2 132.50

Vij to City coordinates1 2 3 4 5 6 7 8 9 Sum Ri x y

1 0.0 0.0 0.0 0.0 0.0 0.0 0.0 3.0 0.0 3 = 3 1 0 02 0.0 0.0 0.0 0.0 0.0 0.0 0.0 4.0 0.0 4 = 4 2 10 33 0.0 0.0 0.0 5.0 0.0 0.0 0.0 0.0 0.0 5 = 5 3 12 154 0.0 0.0 0.0 6.0 0.0 0.0 0.0 0.0 0.0 6 = 6 4 14 13

from 5 0.0 0.0 0.0 4.0 0.0 0.0 0.0 0.0 0.0 4 = 4 5 16 96 0.0 0.0 0.0 3.0 0.0 0.0 0.0 0.0 0.0 3 = 3 6 18 67 0.0 0.0 0.0 0.0 0.0 0.0 0.0 2.0 0.0 2 = 2 7 8 128 0.0 0.0 0.0 0.0 0.0 0.0 0.0 4.0 0.0 4 = 4 8 6 109 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.2 0.0 1.2 = 1.2 9 4 8

0.0 0.0 0.0 18.0 0.0 0.0 0.0 14.2 0.0Logical upper bounds <= <= <= <= <= <= <= <= <= Distances 1 2 3 4 5

0.0 0.0 0.0 32.2 0.0 0.0 0.0 32.2 0.0 1 0.0 10.4 19.2 19.1 18.42 10.4 0.0 12.2 10.8 8.53 19.2 12.2 0.0 2.8 7.24 19.1 10.8 2.8 0.0 4.55 18.4 8.5 7.2 4.5 0.06 19.0 8.5 10.8 8.1 3.67 14.4 9.2 5.0 6.1 8.58 11.7 8.1 7.8 8.5 10.09 8.9 7.8 10.6 11.2 12.0

Page 66: Session 4a

Decision Models -- Prof. Juran

66

Optimal SolutionIf the county wants to build two hospitals, then the optimal locations are in City 4 (Lowthersburg) and City 8 (Rothsboro). The total miles traveled would be 132,500.

Page 67: Session 4a

Decision Models -- Prof. Juran

67

Network Representation

98

7

6

5

4

3

2

1 Two Hospitals

Page 68: Session 4a

Decision Models -- Prof. Juran

68

Network Representation

98

7

6

5

4

3

2

1 Three Hospitals

Page 69: Session 4a

Decision Models -- Prof. Juran

69

Network Representation

98

7

6

5

4

3

2

1 Four Hospitals

Page 70: Session 4a

Decision Models -- Prof. Juran

70

Network Representation

98

7

6

5

4

3

2

1 Five Hospitals

Page 71: Session 4a

Decision Models -- Prof. Juran

71

Network Representation

98

7

6

5

4

3

2

1 Six Hospitals

Page 72: Session 4a

Decision Models -- Prof. Juran

72

Network Representation

98

7

6

5

4

3

2

1 Seven Hospitals

Page 73: Session 4a

Decision Models -- Prof. Juran

73

Network Representation

98

7

6

5

4

3

2

1 Eight Hospitals

Page 74: Session 4a

Decision Models -- Prof. Juran

74

Network Representation

98

7

6

5

4

3

2

1 Nine Hospitals

Page 75: Session 4a

Decision Models -- Prof. Juran

75

SummaryMore Network Models

– Assignment Model (Contract Bidding)• “Big Cost” trick

– Project Management (House Building)• More binary / integer tricks• Critical Path / Slack Time• Excel trick: Conditional Formatting• Cost Crashing

– Changing an objective to a constraint– Issues with Integers– Location Analysis (Hospital Location)