You are on page 1of 32

QM3 Skills

Mathematical programming:
Sensitivity analysis

Week 1, chapter 2
2020-2021

09/09/2023 1
Sensitivity analysis. WHAT is it?
Max

• WHAT is it? Sensitivity analysis measures what


happens to an optimal solution and its value, in
case of small changes in single coefficients:
– an objective coefficient ,
– an RHS coefficient ,
– an LHS coefficient
2
Sensitivity analysis.
WHY, and HOW do it?
• WHY do it? When solving an LP problem we
assume that values of all model coefficients are
known exactly. Such accuracy rarely exists.

• HOW do it? The simplex method provides the


means to perform sensitivity analysis through its
sensitivity report.

3
Spreadsheet Case Production Planning

Case Production Planning


Products
A B
Variables 40 70
Objective 4000 3000 370000
Constraints Coefficients LHS Operator RHS
Demand Alpha 1 40 <= 60
Demand Beta   1 70 <= 90
Oven hrs 10 10 1100 <= 1100
Distribution hrs 50 20 3400 <= 3400

4
Solver reports

5
Sensitivity report
Microsoft Excel 14.0 Sensitivity Report
Worksheet: [QM2 math week 5 Production Planning.xlsx]Case Production Planning
Report Created: 27-2-2018 10:33:05

Variable Cells
    Final Reduced Objective Allowable Allowable
Cell Name Value Cost Coefficient Increase Decrease
$B$3 Variables A 40 0 4000 3500 1000
$C$3 Variables B 70 0 3000 1000 1400

Constraints
    Final Shadow Constraint Allowable Allowable
Cell Name Value Price R.H. Side Increase Decrease
$D$6 Demand Alpha LHS 40 0 60 1E+30 20
$D$7 Demand Beta LHS 70 0 90 1E+30 20
$D$8 Oven hrs LHS 1100 233,33333 1100 120 300
$D$9 Distribution hrs LHS 3400 33,33333 3400 600 600
6
Spreadsheet Case Production Planning
Case Production Planning
Products
A B
Variables 40 70
Objective 4000 3000 370000
Constraints Coefficients LHS Operator RHS
Demand Alpha 1 40 <= 60
Demand Beta   1 70 <= 90
Oven hrs 10 10 1100 <= 1100
Distribution hrs 50 20 3400 <= 3400

What will happen if the objective coefficient of A is


increased by a small amount, say from 4000 to 4001?
7
Spreadsheet Case Production Planning
Case Production Planning
Products
A B
Variables 40 70
Objective 4001 3000 370040
Constraints Coefficients LHS Operator RHS
Demand Alpha 1 40 <= 60
Demand Beta   1 70 <= 90
Oven hrs 10 10 1100 <= 1100
Distribution hrs 50 20 3400 <= 3400

The optimal solution does not change.


The optimal objective value changes a little: 1*40.
Next question: how much can we increase the coefficient
8
such that the optimal solution does not change?
Geometry of changes in
objective coefficients (OCs)
Compare:
B
 4000  4000 A + 3000 B
100  
 3000  with
5000 A + 3000 B

50

50 A 9
Geometry of changes in
objective coefficients (OCs)
Compare:
B
 4000  4000 A + 3000 B
100  
 3000  with
5000 A + 3000 B
 5000 
 
 3000 
50

50 A 10
Geometry of changes in
objective coefficients (OCs)
Compare:
B
 4000  4000 A + 3000 B
100  
 3000  with
5000 A + 3000 B
 5000 
 
 3000  Level curve of the objective
50 turns around the optimal point.

Question: How much can the


level curve turn without
changing the optimal solution?

50 A 11
Sensitivity report
Microsoft Excel 14.0 Sensitivity Report
Worksheet: [QM2 math week 5 Production Planning.xlsx]Case Production Planning
Report Created: 27-2-2018 10:33:05

Variable Cells
    Final Reduced Objective Allowable Allowable
Cell Name Value Cost Coefficient Increase Decrease
$B$3 Variables A 40 0 4000 3500 1000
$C$3 Variables B 70 0 3000 1000 1400

Constraints
    Final Shadow Constraint Allowable Allowable
Cell Name Value Price R.H. Side Increase Decrease
$D$6 Demand Alpha LHS 40 0 60 1E+30 20
$D$7 Demand Beta LHS 70 0 90 1E+30 20
$D$8 Oven hrs LHS 1100 233,33333 1100 120 300
$D$9 Distribution hrs LHS 3400 33,33333 3400 600 12600
Spreadsheet Case Production Planning
Case Production Planning
Products
A B
Variables 40 70
Objective 4000 3000 370000
Constraints Coefficients LHS Operator RHS
Demand Alpha 1 40 <= 60
Demand Beta   1 70 <= 90
Oven hrs 10 10 1100 <= 1100
Distribution hrs 50 20 3400 <= 3400

What will happen if the RHS of the oven constraint is


increased by a small amount, say from 1100 to 1101?13
Spreadsheet Case Production Planning
Case Production Planning
Products
A B
Variables 39,93 70,17
Objective 4000 3000 370233,33
Constraints Coefficients LHS Operator RHS
Demand Alpha 1 40 <= 60
Demand Beta   1 70 <= 90
Oven hrs 10 10 1101 <= 1101
Distribution hrs 50 20 3400 <= 3400

The optimal solution changes slightly. The objective changes


a little: 1*233,33. The binding constraints do not change.
14
Shadow price constraint oven hours
Case Production Planning
Products
A B
Variables 39,93 70,17
Objective 4000 3000 370233,33
Constraints Coefficients LHS Operator RHS
Demand Alpha 1 40 <= 60
Demand Beta   1 70 <= 90
Oven hrs 10 10 1101 <= 1101
Distribution hrs 50 20 3400 <= 3400

Increase of RHS with one unit increases


the profit with 233,33 (the shadow price)
15
Changes in the Right-hand sides
Microsoft Excel 14.0 Sensitivity Report
Worksheet: [QM2 math week 5 Production Planning.xlsx]Case Production Planning
Report Created: 27-2-2018 10:33:05

Variable Cells
    Final Reduced Objective Allowable Allowable
Cell Name Value Cost Coefficient Increase Decrease
$B$3 Variables A 40 0 4000 3500 1000
$C$3 Variables B 70 0 3000 1000 1400

Constraints
    Final Shadow Constraint Allowable Allowable
Cell Name Value Price R.H. Side Increase Decrease
$D$6 Demand Alpha LHS 40 0 60 1E+30 20
$D$7 Demand Beta LHS 70 0 90 1E+30 20
$D$8 Oven hrs LHS 1100 233,33333 1100 120 300
$D$9 Distribution hrs LHS 3400 33,33333 3400 600 600
16
Shadow price constraint distribution hrs
Case Production Planning
Products
A B
Variables 40,33 69,97
Objective 4000 3000 370033,33
Constraints Coefficients LHS Operator RHS
Demand Alpha 1 40 <= 60
Demand Beta   1 70 <= 90
Oven hrs 10 10 1100 <= 1100
Distribution hrs 50 20 3401 <= 3401

Increase of RHS with one unit increases


the profit with 33,33 (the shadow price) 17
Shadow price constraint demand alpha
Case Production Planning
Products
A B
Variables 40 70
Objective 4000 3000 370000
Constraints Coefficients LHS Operator RHS
Demand Alpha 1 40 <= 61
Demand Beta   1 70 <= 90
Oven hrs 10 10 1100 <= 1100
Distribution hrs 50 20 3400 <= 3400

Increase of RHS with one unit increases


the profit with 0 (the shadow price) 18
Changes in the Right-hand sides
Microsoft Excel 14.0 Sensitivity Report
Worksheet: [QM2 math week 5 Production Planning.xlsx]Case Production Planning
Report Created: 27-2-2018 10:33:05

Variable Cells
    Final Reduced Objective Allowable Allowable
Cell Name Value Cost Coefficient Increase Decrease
$B$3 Variables A 40 0 4000 3500 1000
$C$3 Variables B 70 0 3000 1000 1400

Constraints
    Final Shadow Constraint Allowable Allowable
Cell Name Value Price R.H. Side Increase Decrease
$D$6 Demand Alpha LHS 40 0 60 1E+30 20
$D$7 Demand Beta LHS 70 0 90 1E+30 20
$D$8 Oven hrs LHS 1100 233,33333 1100 120 300
$D$9 Distribution hrs LHS 3400 33,33333 3400 600 19600
Changes in Constraint RHS Values

The shadow price of a constraint indicates the


amount the objective function value increases
given
a unit increase in the RHS value

of the constraint, assuming all other coefficients


remain constant.
As a consequence:
shadow prices for nonbinding constraints are always zero. 20
Geometry of changes in
Right-hand sides (RHS)
B
100

50

10A + 10B ≤ 1100

50 A
21
Geometry of changes in
Right-hand sides (RHS)
Compare the constraints
B
100
10A + 10B ≤ 1100
and
10A + 10B ≤ 1150 10A + 10B ≤ 1150

50

10A + 10B ≤ 1100

50 A
Geometry of changes in
Right-hand sides (RHS)
Compare the constraints
B
100
10A + 10B ≤ 1100
and
10A + 10B ≤ 1150 10A + 10B ≤ 1150

If the RHS of a -constraint increases


50
the feasible region grows.

10A + 10B ≤ 1100 Question: How much can the RHS


change without changing the set of
binding constraints?

50 A
23
Changes in the Right-hand sides
Microsoft Excel 14.0 Sensitivity Report
Worksheet: [QM2 math week 5 Production Planning.xlsx]Case Production Planning
Report Created: 27-2-2018 10:33:05

Variable Cells
    Final Reduced Objective Allowable Allowable
Cell Name Value Cost Coefficient Increase Decrease
$B$3 Variables A 40 0 4000 3500 1000
$C$3 Variables B 70 0 3000 1000 1400

Constraints
    Final Shadow Constraint Allowable Allowable
Cell Name Value Price R.H. Side Increase Decrease
$D$6 Demand Alpha LHS 40 0 60 1E+30 20
$D$7 Demand Beta LHS 70 0 90 1E+30 20
$D$8 Oven hrs LHS 1100 233,33333 1100 120 300
$D$9 Distribution hrs LHS 3400 33,33333 3400 600 600
24
Overview: What happens in
case of small single changes?
• Small changes in Objective Coefficients:
– Optimal solution remains the same.
– Objective value changes with (increase of
objective coefficient) (value variable).
• Small changes in Right-Hand Sides:
– Optimal solution changes “along the line” of
the binding constraints.
– Objective value changes with (increase of
RHS) (Shadow price)
25
Reduced costs (bad name)
Consider a new product C that
– uses 5 hours of oven capacity per unit
– uses 10 hours of distribution capacity per unit
– has a revenue of 1300 per unit
Is it profitable to produce C or not?

• Per unit cost:


– 5 hours of oven capacity * 233,3
– 10 hours of distribution capacity * 33,3
– Total costs: 5*233,3 + 10*33,3 = 1500

– Revenue: 1300

– So the value of the optimal solution will DECREASE with 200


if a unit of C is produced: the reduced cost of C 26
An additional product C
Case Production Planning
A B C
Variables 40 70 0
Objective 4000 3000 1300 370000
Constraints Coefficients LHS Operator RHS
Demand Alpha 1     40 <= 60
Demand Beta   1   70 <= 90
Oven hrs 10 10 5 1100 <= 1100
Distribution hrs 50 20 10 3400 <= 3400

27
New sensitivity report
Adjustable Cells
    Final Reduced Objective Allowable Allowable
Cell Name Value Cost Coefficient Increase Decrease
$B$3 Variables A 40 0 4000 3500 1000
$C$3 Variables B 70 0 3000 1000 400
$D$3 Variables C 0 -200 1300 200 1E+30

Constraints
    Final Shadow Constraint Allowable Allowable
Cell Name Value Price R.H. Side Increase Decrease
$E$6 Demand Alpha LHS 40 0 60 1E+30 20
$E$7 Demand Beta LHS 70 0 90 1E+30 20
$E$8 Oven hrs LHS 1100 233,33333 1100 120 300
$E$9 Distribution hrs LHS 3400 33,33333 3400 600 600
28
Relation Reduced Cost and
Shadow Price (1)
The reduced cost for a product is its per-unit
(marginal) profit: per-unit revenue minus the per-
unit cost of the resources it consumes (using the
shadow prices).

Red.Cost  Obj .Coeff -  ShadowPric e * (units used)


constraint s

Short hand:
𝑅𝐶=𝑂𝐶− ∑ 𝑆𝑃 ∗𝑢𝑛𝑖𝑡𝑠
𝑐𝑜𝑛𝑠𝑡𝑟𝑎𝑖𝑛𝑡𝑠 29
Relation Reduced Cost and
Shadow Price (2)
𝑅𝐶=𝑂𝐶− ∑ 𝑆𝑃 ∗ 𝑢𝑛𝑖𝑡𝑠
𝑐𝑜𝑛𝑠𝑡𝑟𝑎𝑖𝑛𝑡𝑠
Profit = Revenue – Costs

A: 0 = 4000 – (10 * 233,3 + 50 * 33,3)


B: 0 = 3000 – (10 * 233,3 + 20 * 33,3)
C: – 200 = 1300 – ( 5 * 233,3 + 10 * 33,3)

In the optimal solution the reduced costs are:


= 0 for variables with value > 0
< 0 for variables with value = 0
30
Changes in Constraint Coefficients

• Suppose product C requires only 4 hours of oven


capacity rather than 5. Is it now profitable to
produce any?
– Revenue: 1300
– Cost: 4 * 233,33 + 10 * 33,33 = 1266,67
– Revenue – Cost = $33,33 = Yes!

• What is the amount of hours used in the oven (X)


at which C becomes profitable?
– Revenue – Cost = 0 = 1300 – X * 233,33 + 10 * 33,33
– So, X = 4,15
31
The Blue Ridge Hot Tubs Example...
X1: number of aqua-spas produced
X2: number of hydro-luxes produced
MAX: 350X1 + 300X2 } profit
S.T.: 1X1 + 1X2 <= 200 } pumps
9X1 + 6X2 <= 1566 } labor
12X1 + 16X2 <= 2880 } tubing
X1, X2 >= 0 } nonnegativity

See file Blue Ridge Hot Tubs.xlsm


32

You might also like