sensitivity analysis with excel - · pdf filesensitivity analysis with excel 1 ... the shadow...

32
1 Sensitivity Analysis with Excel 1 Lecture Outline Sensitivity Analysis 2 Effects on the Objective Function Value (OFV): Changing the Values of Decision Variables Looking at the Variation in OFV: Excel One- and Two-Way Data Tables, and Scenario Manager Finding the Optimum OFV: Excel Solver Effects on the Optimum: Making One Change to the Model Parameters: Changing a Decision Variable Coefficient in a Constraint (Graphical intuitions) Changing the Right Hand Side (RHS) of a Constraint: Slack & Shadow Price Changing a Decision Variable Coefficient in the Objective Function: Reduced Cost Making Multiple Changes to the Model Parameters The 100% Rule • SolverTable

Upload: phambao

Post on 31-Jan-2018

226 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Sensitivity Analysis with Excel - · PDF fileSensitivity Analysis with Excel 1 ... The Shadow Price only remains valid within the Allowable Increase and Decrease shown for that Shadow

1

Sensitivity Analysis with Excel

1

Lecture Outline

Sensitivity Analysis

2

Effects on the Objective Function Value (OFV):• Changing the Values of Decision Variables

• Looking at the Variation in OFV: Excel One- and Two-Way Data Tables, and Scenario Manager

• Finding the Optimum OFV: Excel Solver

Effects on the Optimum:• Making One Change to the Model Parameters:

• Changing a Decision Variable Coefficient in a Constraint(Graphical intuitions)

• Changing the Right Hand Side (RHS) of a Constraint: Slack & Shadow Price

• Changing a Decision Variable Coefficient in the Objective Function:Reduced Cost

• Making Multiple Changes to the Model Parameters• The 100% Rule• SolverTable

Page 2: Sensitivity Analysis with Excel - · PDF fileSensitivity Analysis with Excel 1 ... The Shadow Price only remains valid within the Allowable Increase and Decrease shown for that Shadow

2

Steps in Modeling

3

STEP 1: Formulate

STEP 2: Solve (Find the Optimum)

STEP 3: Do a Sensitivity Analysis

Problem StatementBoxers and Briefs Example - Revisited

4

Champion Sports manufactures two types of custom men's underwear: boxers and briefs. How many boxers and how many briefs should be produced per week, to maximize

profits, given the following constraints…

– The (profit) contribution per boxer is $3.00, compared to $4.50 per brief.

– Briefs use 0.5 yards of material; boxers use 0.4 yards. 300 yards of material are available.

– It requires 1 hour to manufacture one pair of boxers and 2 hours for one pair of briefs. 900 labors hours are available.

– There is unlimited demand for boxers but total demand for briefs is 375 units per week.

– Each boxer uses 1 insignia logo and 600 insignia logos are in stock.

Page 3: Sensitivity Analysis with Excel - · PDF fileSensitivity Analysis with Excel 1 ... The Shadow Price only remains valid within the Allowable Increase and Decrease shown for that Shadow

3

Algebraic Formulation

5

• Variables: number of Boxers, number of Briefs.

• Objective function:

– maximize ( $3.00 x Boxers ) + ( $4.50 x Briefs )

• Constraints:

– Material: ( .4 x Boxers ) + ( .5 x Briefs ) <= 300 yards

– Labor: ( 1 x Boxers ) + ( 2 x Briefs ) <= 900 hrs

– Demand: ( 0 x Boxers ) + ( 1 x Briefs ) <= 375 units

– Logos: ( 1 x Boxers ) + ( 0 x Briefs ) <= 600

– Non-Negativity:

Boxers >= 0

Briefs >= 0

Constraint Coefficients

The Algebraic LP FormulationRevisited

6

Objective Function Coefficients

Constraints Right Hand Sides (RHS)

Page 4: Sensitivity Analysis with Excel - · PDF fileSensitivity Analysis with Excel 1 ... The Shadow Price only remains valid within the Allowable Increase and Decrease shown for that Shadow

4

Graphical Formulation

7

The Graphical LP Formulation - Revisited

Optimal Solution

8

900

800

700

500

400

300

200

100

600

900800700500400300200100 600

Material

Bo

xe

rs

Briefs

Logos

Hours

Demand

$3.00 $4.50 Total

Boxers Briefs Profit

A 300 200 $1,800.00

B 0 375 $1,687.50

C 150 375 $2,137.50

D 500 200 $2,400.00

E 600 120 $2,340.00

F 600 0 $1,800.00

C

B

A

F

D Optimum

E

Page 5: Sensitivity Analysis with Excel - · PDF fileSensitivity Analysis with Excel 1 ... The Shadow Price only remains valid within the Allowable Increase and Decrease shown for that Shadow

5

ExcelFormulation

9

Excel Formulation - RevisitedBoxers and Briefs Example: Profit Maximization

10

See boxers_and_briefs_example.xls in the downloads for today’s class.

Page 6: Sensitivity Analysis with Excel - · PDF fileSensitivity Analysis with Excel 1 ... The Shadow Price only remains valid within the Allowable Increase and Decrease shown for that Shadow

6

Excel Tools for Sensitivity Analysis

11

• One-way Data Table, Two-Way Table, Scenario Manager

• Solver Answer Report

• Slack

• Solver Sensitivity Report

• Shadow Price, Allowable Increase / Decrease

• Reduced Cost, Allowable Increase / Decrease

• SolverTable

Pertains to changing RHS of a constraint

Pertains to changing Objective Function

Coefficients

Changing the Value of Decision VariablesWith Two- Way Data Tables

12

The two-way data table below shows the effect, on profit, of changing the two decision variables (i.e. the number of boxers produced, and

the number of briefs produced). This initial analysis assumes there are no constraints. Clearly, if constraints are taken into account, the maximum profit in

the data table shown below ($4350, for 700 boxers and 500 briefs) would change since that is not a feasible solution.

Page 7: Sensitivity Analysis with Excel - · PDF fileSensitivity Analysis with Excel 1 ... The Shadow Price only remains valid within the Allowable Increase and Decrease shown for that Shadow

7

Steps in Modeling

13

STEP 1: Formulate

STEP 2: Solve (Find the Optimum)

STEP 3: Do a Sensitivity Analysis

Changing the Value of Decision VariablesWith Two- Way Data Tables

14

Don’t panic ! You aren’t expected to know how to construct the table / formula shown below – its only shown to illustrate how complex it is to create a table that shows the feasible and optimal solutions ! Notice that we were lucky in this instance that the optimum solution falls at a

point that was in our table: had we chosen broader intervals for number of boxers and briefs we would have found a good, but not

optimal, solution.

The two-way data table below shows the effect on profit of changing the number of boxers and briefs produced. Conditional formatting has been used to highlight

infeasible solutions (in red) and the optimal feasible solution (in green).

Page 8: Sensitivity Analysis with Excel - · PDF fileSensitivity Analysis with Excel 1 ... The Shadow Price only remains valid within the Allowable Increase and Decrease shown for that Shadow

8

Excel Answer Report - RevisitedBoxers and Briefs Example: Profit Maximization

15

Fortunately, as we’ve seen Excel provides us with an easy mean of finding the optimal feasible solution: simply use Excel Solver.

– Make sure Solver is available:

• If not, Tools | Add-Ins… | Solver Add-in

– Use it:

• Tools | Solver…

– Read the Answer Report to find the optimal value, and the decision variable settings at this optimum.

Excel Answer Report

16

Optimum Objective

Function Value

Status of the Constraints

Optimum Product Mix

Page 9: Sensitivity Analysis with Excel - · PDF fileSensitivity Analysis with Excel 1 ... The Shadow Price only remains valid within the Allowable Increase and Decrease shown for that Shadow

9

Steps in Modeling

17

STEP 1: Formulate

STEP 2: Solve (Find the Optimum)

STEP 3: Do a Sensitivity Analysis

Answer Report

18

The Answer Report also shows us which constraints are binding and non-binding at the optimum. “Slack” indicates the spare capacity on a non-binding constraint at the optimum.

– Slack = 0 implies constraint is binding: resources are exhausted

– Slack ≠ 0 implies constraint is non-binding: there are left-over resources

We can see below, for instance, that:– getting additional logos

wouldn’t help us improve profitsince we already have 100 unused logos at the optimum

– advertising our briefs to stimulate demand (at the current price) would bemoney wasted, since demandfor briefs is already greaterthan the number of briefs weshould produce at the optimum.

– material and labor constraints are cramping our profit.

Page 10: Sensitivity Analysis with Excel - · PDF fileSensitivity Analysis with Excel 1 ... The Shadow Price only remains valid within the Allowable Increase and Decrease shown for that Shadow

10

Slack and Binding

19

• Slack measures unused available resources

• Binding constraints

– Optimal solution lies on binding constraints

– Multiple binding constraints means solution is at intersection of constraints: a vertex

• Slack and binding constraints

– Slack = 0 : the resource is exhausted, the constraint is binding, the optimal vertex includes this constraint.

– Slack ≠≠≠≠ 0 : spare capacity is available, constraint is not binding

Excel Sensitivity Analysis Report

20

Choose Sensitivity to see a more detailed Sensitivity Report...

Pertain to Objective FunctionCoefficient Ranging

Pertain to Right Hand Side (RHS) Ranging on Constraints

Page 11: Sensitivity Analysis with Excel - · PDF fileSensitivity Analysis with Excel 1 ... The Shadow Price only remains valid within the Allowable Increase and Decrease shown for that Shadow

11

Excel Sensitivity Analysis Report

21

The Excel Sensitivity Analysis Report allows you to see:

• … over what range and under what conditions the components of a solution remain unchanged

• … how sensitive a solution is to changes in the data, and to get an insight into how technological improvements may affect optimum values.

Sensitivity Analysis

Changing a Decision VariableCo-Efficient in a Constraint

Graphical Intuitions

22

The Sensitivity Report doesn’t tell us anything about what happens when the coefficients of a decision variable in a constraint change, but here are some

graphical intuitions…900

800

700

500

400

300

200

100

600

500400300200100 600

Material

Briefs

Logos

Hours

Demand

Bo

xe

rs

900

800

700

500

400

300

200

100

600

500400300200100 600

Briefs

Logos

Hours

Demand

Bo

xe

rs

Assume we changed the amount of material required per brief from 0.5 yards to 1 yard. Notice how the shape of the

feasible region changes, and the optimal solution

changes.

Material

Page 12: Sensitivity Analysis with Excel - · PDF fileSensitivity Analysis with Excel 1 ... The Shadow Price only remains valid within the Allowable Increase and Decrease shown for that Shadow

12

Sensitivity Analysis Report

Changing the Right Hand Side (RHS) of a Constraint

Graphical Intuitions

23

Changing the RHS of a constraint causes the constraint line to shift left or right, but does not alter the slope of the line !

900

800

700

500

400

300

200

100

600

500400300200100 600

Material

Briefs

Logos

HoursDemand

Bo

xe

rs

Assume an extra 100 yards of

material became available (increasing our total available to 400 yards). Notice how the material constraint shifts

right. The change is greater than the

‘allowable increase’ (see later) and the optimum solution vertex changes.

900

800

700

500

400

300

200

100

600

500400300200100 600

Material

Briefs

Logos

HoursDemand

Bo

xe

rs

Sensitivity Analysis

Changing the Right Hand Side (RHS)of a Constraint

The Shadow Price

24

What is meant by the optimal vertex ?

The optimal vertex is :“what intersection of constraints is the optimal solution to be found at?”.

From the previous slide, we saw that the original optimal vertex was:

“at the intersection of the materials and hours constraints”.

However, when we increased the RHS of the materials constraint beyond the maximum ‘allowable increase’ (i.e. by 100 yards), the optimal vertex shifts to:

“at the intersection of the logos and hours constraints”.

Had the change in materials been within the allowable increase, then the optimal vertex would have stayed the same (i.e. it would still have been “at the

intersection of the materials and hours constraints) but the optimal product mix and the optimal solution value would have changed.

Page 13: Sensitivity Analysis with Excel - · PDF fileSensitivity Analysis with Excel 1 ... The Shadow Price only remains valid within the Allowable Increase and Decrease shown for that Shadow

13

Sensitivity Analysis

Changing the Right Hand Side (RHS) of a Constraint

Graphical Intuitions

25

Changing the RHS of a constraint causes the constraint line to shift to a parallel position to the left or right, but does not alter the slope of the line !

Assume a extra 100 hours of labor became available (increasing our

total available to 1000 hours). Notice how the labor constraint

shifts right, and the optimal solution value and optimal

product mix change.

However, the change is less than the ‘allowable increase’ for this

constraint and the optimum solution vertex stays the same: the optimal solution is still at the intersection of the materials and

labor hours constraints .

900

800

700

500

400

300

200

100

600

500400300200100 600

Material

Briefs

Logos

HoursDemand

Bo

xe

rs

Sensitivity Analysis

Changing the Right Hand Side (RHS) of a Constraint

26

• Tighten constraint: make feasible region smaller.

– Optimal value can only get worse (fewer choices)

• Loosen (relax) constraint: make feasible region larger.

– Optimal value can only do better (more choices)

• Assume b is a positive number and the constraint line has the form y = ax + b (i.e. y – ax = b) then increasing the RHS (i.e. b) will cause the line to shift vertically up and will:

– Tighten the constraint if it’s a lower-bound constraint

– Loosen the constraint if its an upper-bound constraintSo notice that increasing the RHS may have positive or negative effectson the optimum, depending on the type of constraint !

• In contrast, if b is a positive number and the constraint line has the form y = ax – b (i.e. ax – y = b) then increasing the RHS (i.e. b) will cause the line to shift vertically down !

Page 14: Sensitivity Analysis with Excel - · PDF fileSensitivity Analysis with Excel 1 ... The Shadow Price only remains valid within the Allowable Increase and Decrease shown for that Shadow

14

Sensitivity Analysis Report

Changing the Right Hand Side (RHS)of a Constraint

The Shadow Price

27

The Shadow Price for a constraint is the change in the optimal objective function value per unit increase in the Right Hand Side (RHS) of a given

constraint.

The Shadow Price only remains valid within the Allowable Increase and Decrease shown for that Shadow Price.

Shadow PricesExample

28

A stain is found on 15 yards of material, reducing material from 300 to 285 yards. How does this affect optimal profit ?

New optimal profit = Old optimal profit - (shadow price x yards)= $2,400 – ($5/yard x 15 yards) = $2,325

Notice the Allowable range for the Materials Usage constraint.What could you say about a stain on 60 yards?

Page 15: Sensitivity Analysis with Excel - · PDF fileSensitivity Analysis with Excel 1 ... The Shadow Price only remains valid within the Allowable Increase and Decrease shown for that Shadow

15

Shadow PricesExample

29

Labor is willing to negotiate 100 additional hours of production work. How much of a premium should management pay for overtime hours?

Addition to optimal profit = shadow price x hours = $1/hour x 100 hours = $100

If $9.28 for 900th hour, then $10.28 for 901st hour. But remember, the productivity rate will change when people work longer hours…

Increase Labor by 100 hours

30

900

800

700

500

400

300

200

100

600

900800700500400300200100 600

Material

Bo

xe

rs

Briefs

Logos

Hours

DemandF E

C

B

AG

$3.00 $4.50 Total

Boxers Briefs Contribution

A 300 200 $1,800.00

B 0 375 $1,687.50

C 150 375 $2,137.50

D 500 200 $2,400.00

E 600 120 $2,340.00

F 600 0 $1,800.00

G 333.3 333.3 $2,500.00

D

Page 16: Sensitivity Analysis with Excel - · PDF fileSensitivity Analysis with Excel 1 ... The Shadow Price only remains valid within the Allowable Increase and Decrease shown for that Shadow

16

Shadow PricesExample

31

How much would you pay for one additional insignia logo?

Nothing: logos are not constraining the solution!

Notice the range for logos: what is 1E+30?

Shadow Price / RHS Ranging

32

• Shadow price– Shadow price = marginal change to objective function value of

increasing constraint RHS by 1 unit

– Scaling issues: changing one model unit(e.g. model may be in millions of units …)

• Slack and shadow price– Shadow price = 0 implies constraint is not binding

– Shadow price ≠ 0 implies Slack = 0

• Slack and allowable increase/decrease– How much you must tighten a constraint to make it bind

– Notice that, for a non-binding constraint, either the allowable increase or the allowable decrease will be equal to the slack, since either adding or subtracting the slack to / from the RHS will make the constraint bind.

Page 17: Sensitivity Analysis with Excel - · PDF fileSensitivity Analysis with Excel 1 ... The Shadow Price only remains valid within the Allowable Increase and Decrease shown for that Shadow

17

Shadow Price / RHS Ranging

33

• Shadow price on a constraint:– Change in optimal objective function value per unit change in right-

hand-side of the constraint

– zero if constraint is non-binding

• Shadow price and RHS ranging: – Allowable increase / decrease =

Range of RHS coefficients for which shadow prices remain valid.

• Optimal value (production mix) will change:– If binding constraints are moved, the optimal mix changes

– The objective function value changes

– The shadow price allows us to predict new optimal value.

– Need to resolve the model to get the new mix (decision variables).

Allowable Increase / Decrease for the RHS of a Constraint

34

Allowable increase/decrease in constraints:

• How much you can tighten or relax a constraint RHS and remain binding (or non-binding) (see also: Slack)

• Range in RHS coefficients for which the shadow price remains valid (see also: Shadow Price)

• Feasible Region: How much you can reshape the feasible region without changing the optimal vertex. (The optimal mix will always change, but the optimal vertex stays the same within the allowable increase/decrease.)

Page 18: Sensitivity Analysis with Excel - · PDF fileSensitivity Analysis with Excel 1 ... The Shadow Price only remains valid within the Allowable Increase and Decrease shown for that Shadow

18

Allowable Increase / Decrease for the RHS of a Constraint

35

Change within allowable increase/decrease

• Optimal vertex (intersection of the binding constraints) is unchanged.

• Optimal value of objective function is updated by Shadow Price.

• Optimal product mix (value of decision variables) is calculated by re-testing the model.

Change outside allowable increase/decrease

• Start over ….

Shadow Price, Slack, and Binding

36

Page 19: Sensitivity Analysis with Excel - · PDF fileSensitivity Analysis with Excel 1 ... The Shadow Price only remains valid within the Allowable Increase and Decrease shown for that Shadow

19

Shadow Price inMaximization vs Minimization Problems

37

– For maximization problems:

• increase in the objective function value is good (+ve shadow price is good, and helps the optimum solution)

• decrease in the objective function value is bad(-ve shadow price is bad, and hurts the optimum solution)

– For minimization problems:

• increase in the objective function value is bad (+ve shadow price is bad, and hurts the optimum solution)

• decrease in the objective function value is good(-ve shadow price is good, and helps the optimum solution)

Shadow Prices in a Minimization Problem

38

Our objective in the Big Mac Attack Problem is to achieve least-cost in meeting our Recommended Daily Allowance (RDA) requirements:

including both upper and lower limits.

Page 20: Sensitivity Analysis with Excel - · PDF fileSensitivity Analysis with Excel 1 ... The Shadow Price only remains valid within the Allowable Increase and Decrease shown for that Shadow

20

Shadow Prices in a Minimization Problem

39

Sodium was an upper bound constraint. It has a negative shadow price: increasing the RHS of the sodium constraint would loosen the constraint

and allow us to achieve a better optimum: i.e. a lower meal cost.

Constraints

Final Shadow Constraint Allowable AllowableCell Name Value Price R.H. Side Increase Decrease

$D$21 TOTAL Protein 80.7 0.00000E+00 55 25.70794559 1E+30$E$21 TOTAL Fat 52.5 0.00000E+00 54.7 1E+30 2.242552634

$F$21 TOTAL Sodium 3000 -2.98066E-04 3000 80.04881803 864.3523347

$G$21 TOTAL VitaminA 100 1.57422E-02 100 79.62482802 42.4869867$H$21 TOTAL VitaminC 100 6.80000E-03 100 1E+30 38.07812436

$I$21 TOTAL VitaminB1 138 0.00000E+00 100 38.48083748 1E+30

$J$21 TOTAL VitaminB2 116 0.00000E+00 100 16.44004464 1E+30

$K$21 TOTAL Niacin 124 0.00000E+00 100 24.04707449 1E+30$L$21 TOTAL Calcium 100 1.38042E-02 100 78.48290598 13.19677205$M$21 TOTAL Iron 100 3.38561E-02 100 28.82593 8.011547469

Vitamin C was an lower bound constraint. It has a positive shadow price: increasing the RHS of the Vitamin C constraint would tighten the

constraint and force us to a worse optimum: i.e. a higher meal cost.

Sensitivity Analysis Report

Changing a Decision Variable Co-Efficient in the Objective Function

40

The allowable increase and decrease for the Adjustable Cells (i.e. for the objective function coefficients) tells us how much the objective

function coefficients can change before the optimal solution vertex changes.

Note that the optimal solution value changes as the objective function coefficients change, but the optimal product mix and vertex stays the same within the objective function coefficient’s allowable increase/decrease range.

Page 21: Sensitivity Analysis with Excel - · PDF fileSensitivity Analysis with Excel 1 ... The Shadow Price only remains valid within the Allowable Increase and Decrease shown for that Shadow

21

Sensitivity Analysis Report

Changing an Objective Function CoefficientGraphical Intuitions

41

• Changing an objective function coefficient changes the slope of the objective function.

• Optimal solution value always changes but, within the allowable increase / decrease, the optimal product mix will not: within the allowable increase decrease the isoprofit line just swivels around a single point!

• If the slope of the objective function changes beyond the allowable increase / decrease then the optimal vertex will change, and the optimal product mix will change, as illustrated to the right. At right we see the relative contribution of briefs (i.e. the coefficient of ‘briefs’ in the objective function) increasing, causing the objective function to become steeper, until eventually (beyond the allowable increase) the optimal product mix and optimal vertex shift. The new optimal solution favors more briefs in the optimal product mix.

900

800

700

500

400

300

200

100

600

500400300200100 600

Material

Briefs

Logos

HoursDemand

Bo

xe

rs

Sensitivity Analysis Report

Changing an Objective Function CoefficientGraphical Intuitions

42

Multiple Optima

Notice that, for a certain combination of objective function coefficients, the objective function can becomes tangent to a segment

of a constraint line (in this case, to a segment of the Hours constraint). In this case, every point along the tangential line segment is an optimum, so multiple optimal product mixes

are available, all with the same optimal solution value.

Notice that for an isoprofit line with multiple optima, the allowable increase and decrease are zero, since it is impossible for the line to

swivel around a single point and any change in the objective function coefficients will

cause the optimal vertex to shift !

900

800

700

500

400

300

200

100

600

500400300200100 600

Material

Briefs

Logos

HoursDemand

Bo

xe

rs

Page 22: Sensitivity Analysis with Excel - · PDF fileSensitivity Analysis with Excel 1 ... The Shadow Price only remains valid within the Allowable Increase and Decrease shown for that Shadow

22

Summary

Changing a Decision Variable Co-Efficient in the Objective Function

43

• A coefficient is associated with each decision variable

• The allowable increase / decrease for each coefficient is the range over which the coefficient can vary without changing the product mix (i.e. without changing the vertex at which the optimal solution is found)

• The following do change:

– Objective Function Value

– Shadow Prices

– Reduced Costs

• Need to resolve the model to find this information

• Can use to understand flexibility in relative pricing of a product.

Summary

Changing a Decision Variable Co-Efficient in the Objective Function

44

• Changes “slope” of isoprofit / isocost curve (in 2D)

• Changes decision variable contribution to objective function

• Does NOT change shape of feasible region

• In 2-dimensional case, the slope of the objective function changes, but, within the allowable increase / decrease range, the optimal solution still resides at the same extreme vertex of the feasible region

Page 23: Sensitivity Analysis with Excel - · PDF fileSensitivity Analysis with Excel 1 ... The Shadow Price only remains valid within the Allowable Increase and Decrease shown for that Shadow

23

Changing a Decision Variable Co-Efficient in the Objective Function

Example

45

A management consultant offers to improve efficiency in the production of boxers. This would increase the contribution by $0.50 to $3.50. What is the new mix? What is the increase in weekly profit ?

No change in the product mix.

Change in weekly profit = $0.50 x 500 boxers/week = $250 ($2,650 total)

Note the range: What could you say about $1 increase?

Changing a Decision Variable Co-Efficient in the Objective Function

Example

46

The contribution of briefs decreases by $0.75 to $3.75. What is the new mix? What is the decrease in weekly profit?

No change in the product mix.

Change in weekly profit =

$0.75 x 200 briefs/week = $150 ($2,250 total)

Page 24: Sensitivity Analysis with Excel - · PDF fileSensitivity Analysis with Excel 1 ... The Shadow Price only remains valid within the Allowable Increase and Decrease shown for that Shadow

24

Reduced Cost

47

• Associated with each decision variable.

• Amount by which profit contribution of variable must be improved before the variable will have a positive value in the solution.

• Or, rate at which the objective function value will deteriorate if a variable currently at zero is forced to increase by a small amount.

• Zero if the variable already appears in the optimal solution.

Reduced Cost (RC)

48

• Unit cost (penalty or loss) in optimal objective function value of forcibly including a Decision Variable (DV) not in the optimal solution.

• Necessary change in DV coefficient (‘reduction’ in price) so the DV is part of the optimal solution.

• Rate at which the optimal objective function value deteriorates when a non-optimal DV is required.

• Reduced cost of a DV happens to be equivalent to the shadow price of the non-negativity constraint for that DV. Why ? Because forcing a variable into a solution is the same as increasing the RHS of its non-negativity constraint (e.g. from ≥0 to ≥1).

• RC = 0 implies DV is part of the optimal solution.

• RC ≠ 0 implies DV does not contribute to the optimal objective function value, and that forcing that DV into the solution would worsen the optimal solution.

Page 25: Sensitivity Analysis with Excel - · PDF fileSensitivity Analysis with Excel 1 ... The Shadow Price only remains valid within the Allowable Increase and Decrease shown for that Shadow

25

Adjustable Cells

Final Reduced Objective Allowable Allowable

Cell Name Value Cost Coefficient Increase Decrease

$B$11 Production Boxers 500 $0.00 3 0.6 0.3

$C$11 Production Padded 0 ($1.00) 6 1 1E+30

$D$11 Production Briefs 200 $0.00 4.5 1.5 0.75

Reduced CostsExample

49

New line: padded briefs, 1 yard of material and 2 hours of labor. Contribution is $6.00 per padded brief.

Forced to produce one unit of padded brief per week, what would be cost?

Reduced cost is -$1.00 per padded brief.

Force the model to construct ONLY boxers:

• Objective function:– Maximize ( $10.00 x Boxers ) + ( $1 x Briefs )

• Constraints:– Material: ( 1 x Boxers ) + ( 0.5 x Briefs ) ≤ 300 yards

– Logos: ( 1 x Boxers ) + ( 0 x Briefs ) ≤ 600 logos

– Labor: ( 1 x Boxers ) + ( 2 x Briefs ) ≤ 900 hrs

– Demand: ( 0 x Boxers ) + ( 1 x Briefs ) ≤ 375 units

– Boxers ≥ 0 Briefs ≥ 0

Amended ModelTo Demonstrate Reduced Cost

50

Page 26: Sensitivity Analysis with Excel - · PDF fileSensitivity Analysis with Excel 1 ... The Shadow Price only remains valid within the Allowable Increase and Decrease shown for that Shadow

26

Reduced CostExample

51

Adjustable Cells

Final Reduced Objective Allowable AllowableCell Name Value Cost Coefficient Increase Decrease

$C$3 Decision Variables Boxers 300 0 10 1E+30 7.999999955$D$3 Decision Variables Briefs 0 -3.999999967 1.00000002 3.999999967 1E+30

Constraints

Final Shadow Constraint Allowable AllowableCell Name Value Price R.H. Side Increase Decrease

$E$6 Material 300 10 300 300 300

$E$7 Logos 300 0 600 1E+30 300$E$8 Labor 300 0 900 1E+30 600$E$9 Demand 0 0 375 1E+30 375

The optimal solution to the amended model is:

300 Boxers, 0 Briefs for Optimal Value: $3,000

Now, the President comes to visit Penn, but he has forgotten his briefs … so we must manufacture at least one pair. What is the

penalty? … Think carefully …

Reduced CostExample (Amended Model)

52

Adjustable Cells

Final Reduced Objective Allowable AllowableCell Name Value Cost Coefficient Increase Decrease

$C$3 Decision Variables Boxers 300 0 10 1E+30 7.999999955$D$3 Decision Variables Briefs 0 -3.999999967 1.00000002 3.999999967 1E+30

Constraints

Final Shadow Constraint Allowable AllowableCell Name Value Price R.H. Side Increase Decrease

$E$6 Material 300 10 300 300 300

$E$7 Logos 300 0 600 1E+30 300$E$8 Labor 300 0 900 1E+30 600$E$9 Demand 0 0 375 1E+30 375

Every boxer contributes $10.00 Every brief contributes $1.00 If we make 1 brief we get $1 more profit, but we lose 0.5 yards of material, which costs us 0.5 boxers (i.e. $5 of boxer profits) Thus the marginal loss is $4 (= $1 - $5). Notice that the labor, logo, and demand constraints weren’t binding so producing an extra pair of briefs doesn’t cost us anything there !

– Maximize: ( $10.00 x Boxers ) + ( $1 x Briefs )

– Material: ( 1 x Boxers ) + ( 0.5 x Briefs ) ≤ 300 yards

Only Binding Constraint

Page 27: Sensitivity Analysis with Excel - · PDF fileSensitivity Analysis with Excel 1 ... The Shadow Price only remains valid within the Allowable Increase and Decrease shown for that Shadow

27

Multiple Optima

53

• We saw earlier that one indicator of multiple optimawas a zero allowable increase and decrease, since that implied that the objective function overlapped with a line segment (rather than merely being tangent to a single point), and thus could not pivot within a range around a single point.

• As second indicator of multiple optima is finding a decision variable with a Final Value (at the optimum)

of zero, and a Reduced Cost of zero. This means that the variable can be forced into the optimal solution at no cost, and therefore an alternative optimum is available.

Reduced Cost inMaximization vs Minimization Problems

54

• Reduced cost tells you the effect on the objective function value of forcing a variable into the optimal solution. Forcing a variable into the optimal solution always worsens the solution, irrespective of whether its a max or min problem. However:

• a worse solution in a max problem involves a lower optimal value (i.e. negative reduced cost)

• a worse solution in a min problem involves a higher optimal value (i.e. positive reduced cost).

• This is why:

• max problems have negative reduced costs

• min problems have positive reduced costs

Page 28: Sensitivity Analysis with Excel - · PDF fileSensitivity Analysis with Excel 1 ... The Shadow Price only remains valid within the Allowable Increase and Decrease shown for that Shadow

28

Changing Multiple Parameters Simultaneously:The 100% Rule

55

• We've only changed on parameter at a time. What happens if we change more than one?

• Use the 100% rule for simultaneous changes in constraint RHSs and Decision Variable coefficients.

• Calculate each change as a percentage (%) of its respective allowable increase/decrease.

• If the accumulated (absolute value) % changes are less than 100%, then you sum their shadow price / reduced cost impacts.

• Otherwise, you must recalculate the LP…

The 100% Rule

56

• 100% also holds for objective coefficients.

• Can also be combined for changes in constraint functions.

• If a single value is outside of range, or if the sum of ratios > 1, then you need to re-compute a solution (resolve the LP) for new constraints.

• Remember:

– Change constraint functions, production mix changes

– Change objective function (within allowable increase / decrease), production mix does not.

Page 29: Sensitivity Analysis with Excel - · PDF fileSensitivity Analysis with Excel 1 ... The Shadow Price only remains valid within the Allowable Increase and Decrease shown for that Shadow

29

The 100% RuleExample

57

If material decreases from 300 to 290 yards and labor increases from 900 to 1000 hours, what is the change in weekly contribution?

100 / 131.25 labor hours + 10 / 52.5 material= 0.7619 + 0.1905 = 0.9524 < 1.0000

So, change in Objective Function Value =($1/hr x 100 hrs) - ($5/yard x 10 yards) = $50

So, new Objective Function Value =$2,450 (= $2,400 + $50)

NOTE: The solution changes to 266.67 boxers and 366.67 briefs (need to resolve to get this information)

100% RuleExample: Pricing out a New Product

58

Product designers offer a new line of “padded” briefs that require 1 yard of material and 2 hours of labor. Contribution would be $6.00 per brief. Should management introduce this line?

Percentage changes: 1 / 52.5 material 2 / 60 labor hours

= 0.019 + 0.033 = 0.052 < 1.0000

Loss from one “padded” brief = reducing relevant constraints

($5.00/yard x 1 yard) + ($1.00/hour x 2 hours) = $7.00

Do not produce! $7.00 cost exceeds the $6.00 contribution

Constraints

Final Shadow Constraint Allowable Allowable

Cell Name Value Price R.H. Side Increase Decrease

$D$4 Yards_Material 300 5 300 15 52.5

$D$5 Logos 500 0 600 1E+30 100

$D$6 Hours_Labor 900 1 900 131.25 60

$D$7 Demand_Briefs 200 0 375 1E+30 175

Page 30: Sensitivity Analysis with Excel - · PDF fileSensitivity Analysis with Excel 1 ... The Shadow Price only remains valid within the Allowable Increase and Decrease shown for that Shadow

30

SolverTable

59

SolverTable is an Excel Add-In that allows you to produce 2-way data tables which look at the sensitivity of the optimum solution to changes in any 2 parameters.

Question: How does SolverTable differ from a regular 2-way data table ?

Answer:They’re pretty much the same, except:• SolverTable reruns Excel Solver for each combination of parameter

values, whereas a regular 2-way data table could not do that.• SolverTable does not auto-update – it merely pastes values. So

SolverTable would need to be rerun if other model parameters (besides the 2 you are testing) change. In contrast, a regular 2-way data table uses formulas, and the values of these formulas automatically update as model parameters change.

SolverTable

60

– Getting it:

• Download it from

http://highered.mcgraw-hill.com/sites/0072493682/student_view0/cd_update__solver_table.html

– Installing It:

• Follow the instruction on the web-page above.

• Then open Excel and go to Tools | Add-Ins… | Solver Table Add-in

– Using it:

• Lay out your 2-way table, putting the formula to evaluate under the different scenarios in the top left hand corner, like you would in a regular 2-way data table.

• Go to Tools | SolverTable…

Warning: Because of the complexity of the 2-way data tables and SolverTables in the Boxers and Briefs example spreadsheet, it could take you up to 20 minutes to run the scenario analysis. Press Escape repeatedly at any time, or Ctrl+Break, if you wish to terminate the analysis.

Page 31: Sensitivity Analysis with Excel - · PDF fileSensitivity Analysis with Excel 1 ... The Shadow Price only remains valid within the Allowable Increase and Decrease shown for that Shadow

31

SolverTable ExampleChanging Multiple Decision Variables Coefficients in a Constraint

61

The example below shows the results of running SolverTable to investigate the effects of changing per-unit labor requirements for boxers and briefs on the optimal solution. In other words, it shows the effect of changing the coefficients of the decision variables in

the labor constraint. The top table shows the effect on the optimal solution value (i.e. optimal profit in dollars). The bottom table shows the effect on the optimal product

mix. You can see that increasing the number of hours required per product type (boxers or brief) decreases the amount of that product type in the optimal mix.

Effect on Optimal Solution Value

Effect on Optimal Product Mix

Key Points

62

Constraint Right Hand Sides:

• Slack and Shadow Price

• Changes within the allowable ↑ / ↓ never alter whether a constraint is (non) binding.

• Change constraint RHS: value of decision variables (product mix) changes.

Objective Function Coefficients:

• Reduced Cost

• Changes within the allowable ↑ / ↓ never alter the optimal vertex.

• Changes within the allowable ↑ / ↓: value of decision variables (product mix) does not change.

Page 32: Sensitivity Analysis with Excel - · PDF fileSensitivity Analysis with Excel 1 ... The Shadow Price only remains valid within the Allowable Increase and Decrease shown for that Shadow

32

Sensitivity Analysis Report

Summary

63

Allowable objective function coefficient range:

Solution vertex stays the same.

Optimal product mix(Optimal decision variable values)

Usage of resource(Left Hand Side of constraint)

Increase in optimal objective function value per unit increase in right hand side (RHS) of constraint.

∆∆∆∆Z = (shadow price) ×××× (∆∆∆∆RHS)

Allowable constraint RHS range:Shadow price is valid.

Non-zero if the variable is not in the solution.

Zero if it is.

Sensitivity Analysis

Why Should You Care ?

64

• Uncertainty – welcome to the real world.

• Slack – what to do with unused resources?

• Iteration – constraints are rarely fixed

e.g. begin with a budget allocation and then evaluate alternatives