02 Assignment Print
02 Assignment Print
Assignment Transportation Intro to Modeling/Excel How the Solver Works Sensitivity Analysis
15.057 Spring 03 Vande Vate 1
Objective
Mini Course on Networks
Introduction to modeling
In Excel and AMPL
Assignment Model
Autopower Europe
Manufactures UPS for major installations Four manufacturing plants
Leipzig, Germany Nancy, France Liege, Belgium Tilburg, The Netherlands
Autopower, Europe
Netherlands
Tilburg Liege
*
Germany
*
Belgium
Leipzig
France
Miles
0 50 100
Nancy
Assignment Problem
Whos to visit whom?
VPs expertise and plants needs Available time and travel requirements Language abilities ...
The Challenge
Estimate costs (Done - Thoughts?) One VP to each plant One plant for each VP Minimize cost of assignments
01AssignmentModel.xls
Estimated Assignment Costs Leipzig Nancy Liege Tilburg 1 2 3 4 24 10 21 11 14 22 10 15 15 17 20 19 11 19 14 13 Leipzig 1 Assignme nts Nancy Liege 2 3 Tilburg 4
VP Finance (F) Marketing (M) Operations (O) Personnel (P) VPs Assigned
Plants Assigned 0 0 0 0 0
0 Leipzig 1 0 0 0 0 0
0 Tilburg 4
VP Finance (F) Marketing (M) Operations (O) Personnel (P) Total Cost
0 0 0 0 0
Total Cost 0 0 0 0 0
A Challenge
Find best assignments
The Constraints
Each VP assigned to one plant
$F$15 $F$16 $F$17 $F$18 = = = = 1 1 1 1
Shortcut $F$15:$F$18 = 1
Shortcut $B$19:$E$19 = 1
15.057 Spring 03 Vande Vate 10
Whats Missing
11
Additional Constraints...
Non-negativity
The variables cannot be negative Handled separately
Integrality
The variables should have integral values We can ignore these because this is a network model!!!
12
Model Components
Set Target Cell: Objective $F$28
The value we want to minimize/maximize
Excel Model
14
Options
15
Limits
Max time: Limits the time allowed for the solution process in seconds Iterations:Limits the number of interim calculations. (More details to come)
16
Precision
Controls the precision of solutions. Is 1/3 <= 0.3333? 0.333333?
17
Quality of Solutions
Tolerance: For integer problems. Later Convergence: For non-linear problems. Later
18
Options:
Assume Linear Model Assume Non-negative
Solve
15.057 Spring 03 Vande Vate 19
20
Estimated Assignment Costs Leipzig Nancy Liege Tilburg 1 2 3 4 24 10 21 11 14 22 10 15 15 17 20 19 19 24 15 10 11 19 14 13 Leipzig 1 0 0 0 0 0 0 Leipzig 1 Assignments Nancy Liege 2 3 0 0 0 0 0 0 Tilburg 4 0 0 0 0 0 0 0 0 0 0 0 0
VP Finance (F) Marketing (M) Operations (O) IT (I) Personnel (P) VPs Assigned
Plants Assigned 0 0 0 0 0
VP Finance (F) Marketing (M) Operations (O) IT (I) Personnel (P) Total Cost
21
Influence of Optimization
Changes focus of negotiation about assignments from emotion and personal preferences to estimation of cost
22
Motor Distribution
Netherlands 500
Antwerp
Belgium
700
Tilburg 500
Germany
*
400
Liege
Leipzig
200
Nancy 900
23
Miles
0 50 100
Transportation Costs
From Origin Amsterdam Antwerp The Hague Leipzig 120 61 102.5 To Destination Nancy Liege 130 41 40 100 90 122 Tilburg 59.5 110 42
Minimize the transportation costs involved in moving the motors from the harbors to the plants
15.057 Spring 03 Vande Vate 24
A Transportation Model
Autopower Transportation Model
Unit Cost Leipzig From/To Amsterdam $ 120.0 Antwerp $ 61.0 The Hague $ 102.5 Shipments From/To Amsterdam Antwerp The Hague Total Required Total Cost From/To Amsterdam Antwerp The Hague Total Nancy $ 130.0 $ 40.0 $ 90.0 Liege $ 41.0 $ 100.0 $ 122.0 Tilburg $ 59.5 $ 110.0 $ 42.0
Leipzig 400
Nancy 900
Liege 200
$ $ $ $
Leipzig -
$ $ $ $
Nancy -
$ $ $ $
Liege -
$ $ $ $
Tilburg -
Total $ $ $ $
Challenge
Find a best answer
26
28
Demand Constraints
Leipzig: C12 => C13 Nancy: D12 => D13 Liege: E12 => E13 Tilburg: F12 => F13
15.057 Spring 03 Vande Vate
The Model
30
Whats Missing?
31
Options
32
33
* *
A Basic Feasible solution: This choice of variables admits one and only one answer and the answer is non-negative
Germany
*
Leipzig
400
Nancy
900
34
Miles
0 50 100
500
*
Tilburg 500
Germany 400
*
Belgium
200
Liege
*
Leipzig
400
200
100
800
*
Nancy
900
Miles
0 50 100
35
500
*
Tilburg 500
Germany 400
*
Belgium
200
Liege
*
Leipzig
400
200
100
800
*
Nancy
900
Miles
0 50 100
36
Mathematically*
z are the basic variables y are the non-basic variables Write the constraints as Ax = Bz + Ny = b Fix the non-basic variables to y* The unique solution for the basic variables
x = B-1(b Ny*)
B must be invertible and so square Question: We have 7 constraints (3 ports, 4 plants) and only 6 basic variables. How so?
* For those who care to know
15.057 Spring 03 Vande Vate 37
500
*
Tilburg 500
Germany 400
*
Belgium
200
Liege
*
Leipzig
400
200
100
800
*
Nancy
900
Miles
0 50 100
38
Basic Feasible Solution because it is basic AND the basic variables satisfy the bounds ( 0)
500
*
Tilburg 500
Germany 400
*
Belgium
200
Liege
*
Leipzig
400
200
100
800
*
Nancy
900
Miles
0 50 100
39
Simple Improvement
Netherlands
Tilburg Liege
*
Germany
*
Belgium
Leipzig
Nancy
Miles
0 50 100
40
Conserving Flow
Amsterdam
*
500 800
*
The Hague
Tilburg
700
500
Antwerp
200 Liege
Nancy
41
Conserving Flow
Costs $122 $ 40 $162 Saves $100 $ 90 $190 Net $28
Amsterdam
*
500 800
*
The Hague
Tilburg
500
Antwerp
$122
*
$100
200 Liege
Nancy
42
The Hague
Tilburg
700 0
*
500
200 Liege
800 100
*
Net $28
Nancy
New Answer
Costs $122 $ 40 $162 Saves $100 $ 90 $190 Net $28
Amsterdam
*
500 800
*
The Hague
Tilburg
500
Antwerp
200
*
200 Liege
600 300
15.057 Spring 03 Vande Vate
*
Nancy
44
Tilburg
*
Germany
*
Belgium
Leipzig
Liege
Nancy
Miles
0 50 100
45
500
800
Antwerp
700
300
200 600
*
400
Leipzig
400
Nancy
Miles
0 50 100
900
15.057 Spring 03 Vande Vate 46
Amsterdam
* *
300
*
Germany
Tilburg 500
200
100
200
*
700
Liege 200
Leipzig
400
Nancy
900
Miles
0 50 100
47
Summary
Solver
Finds a basic feasible solution
Satisfies all the constraints Using these variables there is just one answer
Repeats
15.057 Spring 03 Vande Vate 48
Sensitivity Analysis
How would the answer change if the data were a little different? Why is this important? Intuitive understanding
49
Price Sensitivity
Amsterdam The Hague
*
Antwerp
Tilburg Liege
Leipzig
Nancy
15.057 Spring 03 Vande Vate
Price Sensitivity
Amsterdam The Hague $42
*
Antwerp
$110
Tilburg Liege
$40
$90
Nancy
Try It!
Autopower Transportation Model
Unit Cost Leipzig Nancy Liege Tilburg From/To Amsterdam $ 120.0 $ 130.0 $ 41.0 $ 59.5 Antwerp $ 61.0 $ 40.0 $ 100.0 $ 110.0 The Hague $ 102.5 $ 90.0 $ 122.0 $ 42.0 Shipments From/To Amsterdam Antwerp The Hague Total Required Total Cost From/To Amsterdam Antwerp The Hague Total
Leipzig 400
Nancy 900
Liege 200
$ $ $ $
Leipzig -
$ $ $ $
Nancy -
$ $ $ $
Liege -
$ $ $ $
Tilburg -
Total $ $ $ $
52
53
Antwerp
Tilburg Liege
Leipzig
If the unit cost from Amsterdam to Liege increases by $10 does the Nancy answer change?
54
Antwerp
$100 $40
Liege
$90
If the unit cost from Amsterdam to Liege increases by $10 does the Nancy answer change?
55
Antwerp
Tilburg Liege
Leipzig
Why only these two?
Nancy
15.057 Spring 03 Vande Vate 56
57
Resource Sensitivity
How would the objective value change if we had more of a resource Tells us the marginal value of that resource If the optimal solution doesnt use all of the resource, then
58
Resource Sensitivity
Amsterdam 500 The Hague 700
Antwerp 800
Infeasible
Supply
Amsterdam 500 Antwerp 700 The Hague 800 Total 2,000
Demand
Leipzig Nancy Liege Tilburg Total 400+1 900 200 500 2,000+1
15.057 Spring 03 Vande Vate 60
Resource Sensitivity
Amsterdam 500 The Hague 700
Antwerp 800
What would Liege 200 happen to cost if we moved supply for 1 engine from Nancy Amsterdam to 900 Antwerp?
61
Resource Sensitivity
Amsterdam -1 The Hague
$120
Tilburg
$102.5 Leipzig
Antwerp
+1 $40
Whats the value of Liege supply in Antwerp $90 relative to supply in Amsterdam?
Nancy
15.057 Spring 03 Vande Vate 62
63
A Special Feature
We can eliminate any one of the constraints in this problem without changing the answers! Why?
64
Redundant Constraint
Supply
Amsterdam 500 Antwerp 700 The Hague 800 Total 2,000
Demand
Leipzig Nancy Liege Tilburg Total 400 900 200 500 2,000
That means...
We can arbitrarily set the (relative) value of one constraint to 0. (the one we throw away) Set the shadow price or marginal value of supply in Amsterdam to 0, then the shadow price of supply in Antwerp is -$67.5. Why negative? If we had extra supply, where would we want it? Amsterdam or Antwerp?
66
Internally Consistent
Given the Shadow Prices
Constraint Shadow Price Amsterdam Antwerp -67.5 The Hague -17.5 Leipzig 120 Nancy 107.5 Liege 41 Tilburg 59.5
Example: Antwerp-Tilburg Reduced Cost = Cost - Origin - Dest. 118 = 110 - (-67.5) - 59.5 = 110 + 8
Edge Amsterdam Leipzig Amsterdam Nancy Amsterdam Liege Amsterdam Tilburg Antwerp Leipzig Antwerp Nancy Antwerp Liege Antwerp Tilburg The Hague Leipzig The Hague Nancy The Hague Liege Value Reduced Cost 300 22.5 200 8.5 700 126.5 118.0 100 200 98.5 Cost 120.0 130.0 41.0 59.5 61.0 40.0 100.0 110.0 102.5 90.0 122.0
67
Summary
Solver can tell us at what price a non-basic (inactive) variable will be attractive through the Reduced Cost. Solver can tell us how changes in the price of a basic variable affect the solution Solver can tell us the value of a resource via the Shadow Price or Marginal Value
68
69
Allowable Increase 0 1E+30 98.49999999 1E+30 1E+30 8.499999988 1E+30 1E+30 8.499999988 22.49999998 1E+30 0
Allowable Decrease 17.5 22.49999998 41 0 8.499999988 1E+30 126.5 118 0 8.499999988 98.49999999 59.5
70
71
Value
If our proposal comes up non-basic, reduced cost tells us how much harder we have to work to make it attractive. If we are unsure of prices, price sensitivity can tell us whether it is worth refining our estimates of the values Marginal values can help us target investments in capacity
15.057 Spring 03 Vande Vate 72
Caveats
Sensitivity Analysis is pretty nerdy stuff Technical difficulties Only meaningful for changes to a single value Only meaningful for small changes Doesnt work for Integer Programming Can always just change the values and re-solve, but...
15.057 Spring 03 Vande Vate 73
Bad Example
Autopower Transportation Model
Unit Cost Leipzig From/To Amsterdam $ 120.0 Antwerp $ The Hague $ 120.0 Shipments From/To Amsterdam Antwerp The Hague Total Required Nancy Liege $ 120.0 $ 120.0 $ $ $ $ 120.0 Tilburg $ $ 120.0 $ 120.0
$ $ $ $
Nancy -
Liege $ $ $ $ -
Tilburg $ $ $ $ -
Total $ $ $ $
74
Sensitivity
Moving one unit from Liege to Tilburg should save $120
Constraints Cell $C$12 $D$12 $E$12 $F$12 $G$9 $G$10 $G$11 Name Total Leipzig Total Nancy Total Liege Total Tilburg Amsterdam Total Antwerp Total The Hague Total Final Shadow Constraint Allowable Allowable Value Price R.H. Side Increase Decrease 400 120 400 0 0 900 120 900 0 0 200 120 200 0 0 500 500 0 500 500 500 1E+30 0 700 (120) 700 0 0 800 (120) 800 0 0
Try It!
Autopower Transportation Model
Unit Cost Leipzig From/To Amsterdam $ 120.0 Antwerp $ The Hague $ 120.0 Shipments From/To Amsterdam Antwerp The Hague Total Required Nancy Liege $ 120.0 $ 120.0 $ $ $ $ 120.0 Tilburg $ $ 120.0 $ 120.0
$ $ $ $
Nancy -
Liege $ $ $ $ -
Tilburg $ $ $ $ -
Total $ $ $ $
76
Thursday
Spreadsheet Models
03ShortestPathModel.xls 04TransshipmentModel.xls 05SingaporeElectricGeneratorModel.xls
Download the free student version of the AMPL/CPLEX 8.0 System from www.ampl.com
http://www.ampl.com/cm/cs/what/ampl/DOWNLOADS/cplex71.html#new
Access Database
TransportationData.mdb
15.057 Spring 03 Vande Vate 77