Path: blob/main/Lessons/Lesson 02 - LP2/Self_Assess_Solns.ipynb
870 views
Lesson 02 - Self-Assessment Solutions
Self Assessment: Investment Allocation
Self Assessment: A Holiday Factory
Self Assessment: Supply and Demand Problem
Let be the set of factories and let be the set of customers.
Decision Variables: let be the number of units shipped from factory to customer
Constants:
is the shipping cost per unit between factory and customer
is the number of units demanded by customer
is the number of units supplied by factory
Objective Function: minimize
Constraints:
Supply:
Demand:
Nonnegativity: for each
Self Assessment: Positive Shadow Price
Answer: True
Self Assessment: Allowable Range (Objective Coef)
Answer: True
Self Assessment: Changing Parameters
Answer: False
Self Assessment: Graphical Exploration of Sensitivity
(a) Optimal occurs when and .
(b) Shadow price . The new optimal is with coordinates and .
(c) The allowable range for resource 2 is .
The lower bound is 10, as shown here.
The upper bound is 15, as shown here.
(d) The allowable range for the unit profit of activity 2 is .
The lower bound is 4, as shown here.
The upper bound is 6, as shown here.
Self-Assessment: Solve and Perform Sensitivity
(c) See the code in the following cells and the associated output.
(b) From the column labeled "Marginal" in the top table of the GLPK sensitivity report below, the shadow prices are 0.667 for resource 1 and 1 for resource 2.
GLPSOL--GLPK LP/MIP Solver 5.0
Parameter(s) specified in the command line:
-m model.lp --lp --ranges sensit.sen
Reading problem data from 'model.lp'...
2 rows, 4 columns, 8 non-zeros
31 lines were read
GLPK Simplex Optimizer 5.0
2 rows, 4 columns, 8 non-zeros
Preprocessing...
2 rows, 4 columns, 8 non-zeros
Scaling...
A: min|aij| = 1.000e+00 max|aij| = 3.000e+00 ratio = 3.000e+00
Problem data seem to be well scaled
Constructing initial basis...
Size of triangular part is 2
* 0: obj = -0.000000000e+00 inf = 0.000e+00 (3)
* 2: obj = 5.200000000e+01 inf = 0.000e+00 (0)
OPTIMAL LP SOLUTION FOUND
Time used: 0.0 secs
Memory used: 0.0 Mb (39693 bytes)
Write sensitivity analysis report to 'sensit.sen'...
Shadow Prices
Resource 1: 0.66667
Resource 2: 1.00000
Allowable Range for Right Hand Side of Constraints
Resource 1: -108 to 36
Resource 2: 24 to
Allowable Range Objective Function Coefficients
Coefficient 1: 4.63636 to
Coefficient 2: to 4.3333
Coefficient 3: -2.33333 to 1.66667
Coefficient 4: to 3.66667
Self-Assessment: Formulate, Solve, and Perform Sensitivity #1
(a) See the code and output for the cell below. The maximum profit is $3500, obtained when 2000 toys and 1000 subassemlies are produced per day.
(f) From the "Obj coef range" in the bottom table of the GLPK sensitivty report, the allowable range of the unit profit for toys is $2.50 to $5 whereas that for subassemblies is -$3 to -$1.50.
GLPSOL--GLPK LP/MIP Solver 5.0
Parameter(s) specified in the command line:
-m model.lp --lp --ranges sensit.sen
Reading problem data from 'model.lp'...
2 rows, 2 columns, 4 non-zeros
23 lines were read
GLPK Simplex Optimizer 5.0
2 rows, 2 columns, 4 non-zeros
Preprocessing...
2 rows, 2 columns, 4 non-zeros
Scaling...
A: min|aij| = 1.000e+00 max|aij| = 2.000e+00 ratio = 2.000e+00
Problem data seem to be well scaled
Constructing initial basis...
Size of triangular part is 2
* 0: obj = -0.000000000e+00 inf = 0.000e+00 (1)
* 2: obj = 3.500000000e+03 inf = 0.000e+00 (0)
OPTIMAL LP SOLUTION FOUND
Time used: 0.0 secs
Memory used: 0.0 Mb (39693 bytes)
Write sensitivity analysis report to 'sensit.sen'...
Self-Assessment: Formulate, Solve, and Perform Sensitivity #2
(a) This is pretty simple. Add an extra constraint that . The maximum profit is still $3500, obtained when 2000 toys and 1000 subassemlies are produced per day. See the code cell below.
See cells befow for parts b and f.
(b) Run the model with RHS of coefficient 1 at 3001 rather than 3000. The shadow price for subassembly A is $0.50, which is the maximum premium that the company should be willing to pay. See the code in the next cell.
(f) As shown in the sensitivity report, the shadow price is $0.50 for subassembly A and $2 for subassembly B. According to the activity range, the allowable range for the right-hand side of the subassembly A constraint is 2,000 to 3,500. The allowable range for the right-hand side of the subassembly B constraint is 500 to 1,500.
GLPSOL--GLPK LP/MIP Solver 5.0
Parameter(s) specified in the command line:
-m model.lp --lp --ranges sensit.sen
Reading problem data from 'model.lp'...
3 rows, 2 columns, 5 non-zeros
27 lines were read
GLPK Simplex Optimizer 5.0
3 rows, 2 columns, 5 non-zeros
Preprocessing...
2 rows, 2 columns, 4 non-zeros
Scaling...
A: min|aij| = 1.000e+00 max|aij| = 2.000e+00 ratio = 2.000e+00
Problem data seem to be well scaled
Constructing initial basis...
Size of triangular part is 2
* 0: obj = -0.000000000e+00 inf = 0.000e+00 (1)
* 2: obj = 3.500500000e+03 inf = 0.000e+00 (0)
OPTIMAL LP SOLUTION FOUND
Time used: 0.0 secs
Memory used: 0.0 Mb (40412 bytes)
Write sensitivity analysis report to 'sensit.sen'...
GLPK 5.0 - SENSITIVITY ANALYSIS REPORT Page 1
Problem:
Objective: obj = 3500.5 (MAXimum)
No. Row name St Activity Slack Lower bound Activity Obj coef Obj value at Limiting
Marginal Upper bound range range break point variable
------ ------------ -- ------------- ------------- ------------- ------------- ------------- ------------- ------------
1 c_u_cts(1)_ NU 3001.00000 . -Inf 2000.00000 -.50000 3000.00000 x(subs)
.50000 3001.00000 3500.00000 +Inf 3750.00000 c_u_cts(3)_
2 c_u_cts(2)_ NU 1000.00000 . -Inf 501.00000 -2.00000 2502.50000 c_u_cts(3)_
2.00000 1000.00000 1500.50000 +Inf 4501.50000 x(subs)
3 c_u_cts(3)_ BS 2001.00000 499.00000 -Inf 1000.00000 -.50000 2500.00000 c_u_cts(1)_
. 2500.00000 +Inf 2.00000 7502.50000 c_u_cts(2)_
GLPK 5.0 - SENSITIVITY ANALYSIS REPORT Page 2
Problem:
Objective: obj = 3500.5 (MAXimum)
No. Column name St Activity Obj coef Lower bound Activity Obj coef Obj value at Limiting
Marginal Upper bound range range break point variable
------ ------------ -- ------------- ------------- ------------- ------------- ------------- ------------- ------------
1 x(toys) BS 2001.00000 3.00000 . 1000.00000 2.50000 2500.00000 c_u_cts(1)_
. +Inf 2500.00000 5.00000 7502.50000 c_u_cts(2)_
2 x(subs) BS 1001.00000 -2.50000 . -1000.00000 -3.00000 3000.00000 c_u_cts(1)_
. +Inf 1999.00000 -1.50000 4501.50000 c_u_cts(2)_
End of report