72
1 Chapter 4 Linear Optimization: Sensitivity Analysis Part 2 DECISION MODELING DECISION MODELING WITH WITH MICROSOFT EXCEL MICROSOFT EXCEL Copyright 2001 Prentice Hall Publishers and Ardith E. Baker

linear programming

  • Upload
    katnav

  • View
    217

  • Download
    0

Embed Size (px)

Citation preview

Page 1: linear programming

1

Chapter 4

Linear Optimization:

Sensitivity AnalysisPart 2

DECISION MODELING DECISION MODELING WITH WITH

MICROSOFT EXCELMICROSOFT EXCEL

Copyright 2001Prentice Hall Publishers and

Ardith E. Baker

Page 2: linear programming

2

SensitivityAnalysis

Sensitivity analysisSensitivity analysis is the effect a (small) change of an exogenous variable has upon another variable. In the case of optimization models,

sensitivity analysis refers to the process of analyzing such changes in a model after the optimal solution has been found.

We will use 2-dimensional graphs (i.e., only two decision variables) to give insight into LP sensitivity analysis. In addition, we will use Solver Sensitivity Report and SolverTable.

Page 3: linear programming

3

Oak ProductsModel

Let’s return to the Oak Products model of Chapter 3. In this simplified model, there are only two decision variables: Captains chairs (C )

Mates chairs (M )Now, review the symbolic model containing the objective functionobjective function and constraintsconstraints.

Page 4: linear programming

4

Max 56C + 40M (objective function)Subject to

8C + 4M < 1280 (Long Dowels Restriction)4C + 12M < 1600 (Short Dowels Restriction)C + M > 100 (Minimum Production)4C + 4M < 760 (Legs Restriction)C < 140 (Heavy Seats Restriction)M < 120 (Light Seats Restriction)C > 0 and M > 0 (Nonnegativity Conditions)

SymbolicModel

Page 5: linear programming

5

SensitivityAnalysis

Changes in the Changes in the Objective Objective

Function CoefficientsFunction Coefficients Suppose that the constraint data remain unchanged and only the objective coefficients are changed. The only effect on the model, is that the

slope of the isoprofit line will change.

By changing the coefficients of the Oak Products model’s objective function, you can see that some of those changes will not necessarily change the optimal solution, even though the isoprofit lines will have a different slope.

Page 6: linear programming

6

In general, the Allowable Increase and Allowable Decrease entries indicate how much a given decision variable’s Objective Coefficient may change, holding all the other data in the model constant, and still have the same LP solution.

Page 7: linear programming

7

SensitivityAnalysis

Changes in Constraint Changes in Constraint Right-Hand SidesRight-Hand Sides

Ignoring the objective function, let’s observe the effects of right-hand-side changes for inequality constraints.You can use GLP’s graphical analysis to

explain the effects of changes in these parameters.

You can see the effects of changing the right-hand-side of the inequality by changing that number directly, by dragging the constraint line or by clicking on the buttons next to each constraint in GLP.

Page 8: linear programming

8

Note that:Tightening an inequality constraint means making it more difficult to satisfy. For a > constraint, this means increasing the RHS. For a < constraint, this means decreasing the RHS.

Loosening an inequality constraint means making it easier to satisfy.

For a < constraint, this means increasing the RHS.

For a > constraint, this means decreasing the RHS.

Tightening either contracts the feasible region or leaves it unaffected.

Loosening either expands the feasible region or leaves it unaffected.

Page 9: linear programming

9

SensitivityAnalysis

RHS Sensitivity and the RHS Sensitivity and the Shadow PriceShadow Price

For the Oak Products Model, first hold all numbers fixed except for the inventory of Long Dowels.

Since this constraint is the < form, increasing the RHS results in “loosening” the constraint, making it easier to satisfy.

Let us change the inventory from L=1280 to L=1281, L=1320, and L=1350.

The geometric interpretation is that the feasible region is expanding.

Page 10: linear programming

10

L=1281Note that the constraints on Legs and Long Dowels continue to be binding.The optimal solution is C=130.25 and M=59.75

For a maximum profit

of $9684 (an

increase of $4,

the shadow shadow priceprice).

Page 11: linear programming

11

The shadow priceshadow price of a given constraint is the change per unit increase in RHS with all other data held fixed.

It is called a shadow priceshadow price because its value is masked or shadowed until the model is optimized and sensitivity analysis is done by Solver. In economic theory, the shadow price is sometimes called a reservation price.

Note that:

Page 12: linear programming

12

When L = 1280, the shadow price of 4 is valid for an allowable increase (in L) of 40 Long Dowels and an allowable decrease of 180 Long Dowels. For L values between 1000 and 1320 Long Dowels, the change in the OV for each unit of RHS inventory increase, with all other data held fixed, is $4/Long Dowel.

Page 13: linear programming

13

L=1320Now three constraints are binding.

The optimal solution is C=140 and M=50

For a maximum profit

of $9840.

Page 14: linear programming

14

Here is the corresponding Solver Solution:

Again, note 3 binding constraints and only 2 positive decision variables. When an LP solution has more binding constraints than positive variables, it is called degeneratedegenerate.

Page 15: linear programming

15

Here is the corresponding Sensitivity Report:

Degeneracy can lead to some anomalies when interpreting this report. Note the allowable increase/decrease for some shadow prices = 0.

Page 16: linear programming

16

When L = 1320, the shadow price remains at 4, but the allowable increase is 0, which means that the value 4 does not apply to RHS values any larger than 1320.

Indeed, the geometric analysis shows that the constraint becomes non-binding and redundant when L > 1320.

Small changes in the RHS of a non-binding constraint cannot affect the OV, and hence for a non-binding constraint the shadow price will always be zero.

Page 17: linear programming

17

The interpretation of the shadow price is valid only within a range for the given RHS. This range is specified by the Allowable Increase and Allowable Decrease columns in the Constraints section of the Sensitivity Report.

Note that:

Page 18: linear programming

18

L=1350The binding constraints are now Legs and Heavy Seats.The optimal solution is C=140 and M=50

For a maximum profit

of $9840.

Page 19: linear programming

19

Here is the corresponding Solver Solution:

The Long Dowels constraint is now non-binding.The shadow price is now $0.

Page 20: linear programming

20

When L = 1350, we see that now, with the relevant constraint non-binding, the shadow price is indeed zero and the allowable increase is infinite. That is, for any further increase in L, the constraint will remain non-binding and the shadow price will remain at the value 0.

Page 21: linear programming

21

Note that:

The shadow price of a non-binding constraint will always be zero. A non-binding constraint means that the constraint has slack or surplus.

The RHS sensitivity information that the Sensitivity Report provides does not tell us how the optimal decisions for C and M change. It merely explains the way in which the OV will change as the RHS changes.

Page 22: linear programming

22

SolverTable.xlaSolverTable.xla is a DataTable-like macro to re-optimize and tabulate an LP model after each change in its parameters.

Similar to Excel’s DataTable, SolverTable knows how to re-Solve the LP model for each change before tabulating any results. SolverTable can also tabulate the information in the Solver Sensitivity Report.SolverTable is not restricted to two-variable models.

SensitivityAnalysis

Using SolverTableUsing SolverTable

Page 23: linear programming

23

SensitivityAnalysis with SolverTable

To begin using SolverTable, open the SimpleOakProd.xls workbook.Open the add-in file SolverTable.xla.

Click on the resulting Enable Macros button.

SolverTable will install itself and be available as a menu item on the Tools menu.

Page 24: linear programming

24

To illustrate SolverTable, start with the Simplified Oak Products model.

RHS Ranging with SolverTableRHS Ranging with SolverTable

Page 25: linear programming

25

First a range of RHS parameter values for the constraint are entered as data in a column (or a row).

Next, enter a row of references to model output cells.

Page 26: linear programming

26

Now, highlight the table by click-dragging and choose SolverTable from the Tools pull-down menu.

Page 27: linear programming

27

In the resulting dialog, specify the cell location of the Long Dowel constraint’s RHS in the Input Column Cell edit field.

Click OK to run Solver on the model for each Long Dowels constraint RHS value (in this case for 11 optimizations).

Page 28: linear programming

28

SolverTable tabulates the requested model results referenced in the table’s columns.

The shadow price changes abruptly each time a different set of constraints combine to determine the optimal corner point.

Page 29: linear programming

29

Here are the corresponding GLP pictures of the Oak Products model for the Long Dowels Starting Inventory amounts (L).L = 400

Page 30: linear programming

30

L = 480

Page 31: linear programming

31

L = 800

Page 32: linear programming

32

L = 1100

Page 33: linear programming

33

L = 1320

Page 34: linear programming

34

L = 1350

Sweeping the values of L from 400 to 1350 causes the feasible region to expand until the Long Dowels constraint becomes redundant.

Page 35: linear programming

35

SolverTable can mimic DataTable 2 to tabulate simultaneous variations in two parameters, with the restriction that only one output cell can be tabulated. To illustrate, a range of parameter values for the inventory constraint RHS values for both Long and Short Dowels will be analyzed.

Using the Oak Products model, start

by setting up the table, in

this case with a range of parameter

values for both

parameters.

Page 36: linear programming

36

Now, click on Tools – SolverTable and in the resulting dialog, specify cell $F$7 as the Input Row Cell and $F$6 as the Input Column Cell.

Click OK to continue.

Page 37: linear programming

37

SolverTable will run Solver on the model for each paired combination of Long and Short Dowels constraint RHS values (108 optimizations in this case), and for each run, tabulate the single Profit result referenced in the table’s upper left corner.

Page 38: linear programming

38

SensitivityAnalysis

Objective Function Objective Function Coefficient Ranging Coefficient Ranging

with SolverTablewith SolverTable Similar to ranging an RHS, first set up a table with values of the objective function coefficient in a column or row.

Page 39: linear programming

39

As before, click on Tools – SolverTable and in the resulting dialog, specify cell $B$3 as the Input Column Cell.

Click OK to continue.

Page 40: linear programming

40

Here are the results of the SolverTable analysis. Notice that the objective function coefficients for profit per Captain chair are the coefficient values at which the LP solution changes (as shown by the Allowable Increase).

Page 41: linear programming

41

Here are the corresponding GLP pictures of the Oak Products model for the Captain objective function coefficient values (V). Note how the corner point solution changes abruptly for critical values of V. V = 0

Page 42: linear programming

42

V = 13.334

Page 43: linear programming

43

V = 40

Page 44: linear programming

44

V = 80

Page 45: linear programming

45

V = 99999

Sweeping the values of V from 0 to 99999 causes the objective function to rotate from horizontal to nearly vertical in slope.

Page 46: linear programming

46

SensitivityAnalysis

Technical Coefficient Technical Coefficient Ranging with Ranging with SolverTableSolverTable

SolverTable can be used to investigate alternative production technologies. Suppose Oak Products were to consider

the option of strengthening or slightly weakening a Mate chair by increasing or decreasing the number of long dowels it uses. Let’s examine the economic effects of reducing the number of long dowels per Mate chair from the current 4 to 2, and increasing the number above 4.

Page 47: linear programming

47

Here is the resulting solution:

As before, first set up a table in Excel and run SolverTable. In the SolverTable dialog, specify $C$6 (no. of Mates in the Long Dowel constraint) as the Input Column Cell.

Page 48: linear programming

48

Increasing the number of long dowels per Mate chair from 4 to 6 reduces the optimal number of Mates to produce (with an associated increase in Captains), with a net reduction in Profit.

Reducing the number of long dowels per Mate chair from 4 to 2 also reduces the optimal number of Mates (with an associated increase in Captains), but with a net increase in Profit.

Page 49: linear programming

49

SensitivityAnalysis

Eastern Steel ExampleEastern Steel Example

Ore from four different locations is blended to make a steel alloy.

Each ore contains three essential elements (A, B, and C) that must appear in the final blend at minimum threshold levels.

Find the cost-minimizing blend by solving the following LP model (Ti = fraction of a ton of ore from location i).

Page 50: linear programming

50

Min 800T1 + 400T2 + 600T3 + 500T4

s.t. 10T1 + 3T2 + 8T3 + 2T4 > 5

(requirement on A)90T1 + 150T2 + 75T3 + 175T4 > 100 (requirement on B)45T1 + 25T2 + 20T3 + 37T4 > 30 (requirement on C)

T1 + T2 + T3 + T4 = 1 (blend condition)

T1 , T2 , T3 , T4 > 0 (nonnegativity constraints)

Eastern Steel Symbolic ModelEastern Steel Symbolic Model

Page 51: linear programming

51

Here is the Excel spreadsheet:

Next, run Solver and specify the Sensitivity Report.

Page 52: linear programming

52

Look at the Reduced Cost column:

Page 53: linear programming

53

The Reduced Cost of any particular decision variable is defined to be the amount by which the coefficient of that variable in the objective function would have to change in order to have a positive optimal value for that variable.

Page 54: linear programming

54

The Reduced Cost of a decision variable (whose optimal value is currently zero) is the rate (per unit amount) at which the objective value is hurt as that variable is “forced into” a previously optimal solution.

Page 55: linear programming

55

SensitivityAnalysis

Sensitivity Report Sensitivity Report Interpretation for Interpretation for

Alternative LP ModelsAlternative LP Models In this example, the Friendly Loan Company has an annual $15 million loan budget. Profit is generated by the annual interest income from three types of loans: Real Estate (First Mortgage; 7%) Furniture Loans (12%)Signature Loans (15%)In addition, Friendly requires at least 60%

First Mortgage loans and no more than 10% Signature loans.

Page 56: linear programming

56

Here is the spreadsheet model:

Note how compact the model is. The constraints are immediately adjacent to the quantities they affect and are custom formatted to include the inequality while still being read as a number.Empty cells are shaded in order to focus attention on the important things.

Page 57: linear programming

57

Here are the spreadsheet formulas:

Page 58: linear programming

58

Using Solver, specify the parameters and solve the model.

Be sure to specify the Sensitivity Report.

Page 59: linear programming

59

The resulting Solver analysis shows that all $15 million will be loaned out ($9 million into First Mortgage Loans, $1.5 million into Signature loans, and $4.5 million into Furniture loans).

The annual Total interest income will be $1,395,000 with an average return of 9.3%.

All three constraints are binding.

Page 60: linear programming

60

Here is the Sensitivity Report for the model:

The Shadow Price of .12 indicates that a 12% return can be achieved on any budget increase. In addition, the Allowable Increase value indicates that we can increase the budget as much as we want (infinitely).

Page 61: linear programming

61

Verify Solver’s Sensitivity Report by typing a new budget limit into the spreadsheet and Solving.

Notice that the Avg. Return for this model is still 9.3%. This indicates that the marginal return for the extra $5 million is actually 9.3% and not 12% as indicated by the previous Sensitivity Analysis.

Page 62: linear programming

62

The Sensitivity Analysis for this model shows a shadow price of .12 (12%), the same as the previous model.

To understand what is happening, re-formulate the model using the recommended rules from Chapter 3.

Page 63: linear programming

63

Here is the reformulated spreadsheet model:

Page 64: linear programming

64

And the resulting Sensitivity Analysis from Solver:

Note the presence of 3 constraints and the correct Shadow Price of 9.3%.The solution is not degenerate and none of the constraints are binding.

Page 65: linear programming

65

Now that we have looked at both spreadsheet models (the compact model vs. the recommended LP model), it would seem that they give different results.

However, both models are completely correct, and neither Sensitivity Report contains any errors.To understand the differences, look at simple upper and lower bounds.

SensitivityAnalysis

Simple Upper and Simple Upper and Lower BoundsLower Bounds

Page 66: linear programming

66

The time and memory requirements for Solver to optimize a model are determined primarily by the size of the coefficient matrix of cells making up the LHS of the set of constraints.The size of the constraint coefficient matrix is proportional to the product of the number of decision variables and constraints. This size effects speed of optimization.In addition to nonnegativity constraints, Solver allows any upper or lower constraint bounds directly on the decision variables to be honored without actually considering them as constraints. This keeps the coefficient matrix smaller, allowing larger LP models to be optimized.

Page 67: linear programming

67

However, the only sensitivity information available for any simple upper and lower bound constraints are their shadow prices.Solver places any non-zero shadow price on an upper or lower bound constraint into the Reduced Cost column next to the relevant decision variable. The Reduced Cost numbers for Solver LP models containing simple upper and lower bounds are the shadow prices for whichever bound, if any, is binding on that decision variable.

Page 68: linear programming

68

The table below gives values the Reduced Cost shadow price entry may have in Solver models containing simple upper and lower bounds.

Value of DecisionVariable at Optimality

Reduced Cost Entry,Maximization Model

Reduced Cost Entry,Minimization Model

Lower Bound (>) Binding Zero or Negative Shadow Zero or Positive Shadow Price Price

Upper Bound (<) Binding Zero or Positive Shadow Zero or Negative Shadow Price Price

Neither Bound Binding Zero Shadow Price Zero Shadow Price

Page 69: linear programming

69

Solver invokes its special bounding procedure whenever it sees “Changing Cells” cell references in the Subject to the Constraints: box of the Solver Parameters dialog.Solver will not evoke this procedure if the upper or lower bound on any decision variable is specified indirectly on the worksheet.

This “indirect reference” can be achieved by the use of some intervening formula, such as the SUMPRODUCT formula.

Page 70: linear programming

70

Although the shadow price given in the two different models was correct, the interpretation of that price was incorrect.

SensitivityAnalysis

Shadow Price Shadow Price InterpretationInterpretation

Remember, a shadow price is the change in the LP’s OV per unit of change in a given constraint’s RHS value holding all other data, including the other RHS’s, constant.

Page 71: linear programming

71

So, for example, the correct interpretation of the shadow price of .120 should be :

Holding the Loan Limit RHS’s for Signature and First Mortgage loans at their original dollar amount bounds of $1500 and $9000, respectively, the improvement in the objective function value is .12 for each additional budget dollar.

The use of simple upper and lower bounds and the use of formulas on RHS’s of LP formulations can lead to more compact and managerially appealing spreadsheet formulations of LP’s.

Page 72: linear programming

72

Sensitivity Analysis Summary• Objective coefficients

– slope of iso-profit line• Right-hand sides of Constraints

– shadow price• “Technological” coefficients

– solver table• Upper/Lower bounds on variables

– reduced costs

• Alternative models