Você está na página 1de 47

What-If Analysis for Linear Programming

Chapter 4
Sensitivity Analysis

• Sensitivity analysis (or post-optimality analysis) is used to


determine how the optimal solution is affected by changes,
within specified ranges, in:
– the objective function coefficients
– the right-hand side (RHS) values

• Sensitivity analysis is important to the manager who must


operate in a dynamic environment with imprecise estimates
of the coefficients.

• Sensitivity analysis allows him to ask certain what-if


questions about the problem.
Sensitivity Analysis

• Sensitivity analysis: The study of how the changes in the


input parameters of an optimization model affect the
optimal solution

• It helps in answering the questions:


– How will a change in a coefficient of the objective
function affect the optimal solution?
– How will a change in the right-hand-side value for a
constraint affect the optimal solution?

• The shadow price for a constraint is the change in the


optimal objective function value if the right-hand side of
that constraint is increased by one
Sensitivity Analysis

• Classical sensitivity analysis:


– Based on the assumption that only one piece of input
data has changed
– It is assumed that all other parameters remain as stated
in the original problem

• When interested in what would happen if two or more


pieces of input data are changed simultaneously:
– The easiest way to examine the effect of simultaneous
changes is to make the changes and rerun the model
Changes in The Objective Function

• Let’s consider the Wyndor Glass Co. problem

B C D E F G
3 Doors Windows
4 Unit Profit $300 $500
5 Hours Hours
6 Hours Used Per Unit Produced Used Available
7 Plant 1 1 0 2 <= 4
8 Plant 2 0 2 12 <= 12
9 Plant 3 3 2 18 <= 18
10
11 Doors Windows Total Profit
12 Units Produced 2 6 $3,600

– What if profit for doors was not $300?


• $100, $200, $300…
Change in One Coefficient

$200 per door, no


change in the
optimal solution

$500 per door, no


change in the
optimal solution

$1,000 per door,


change in the
optimal solution
Change in One Coefficient
Solver
“Sensitivity
Report”

If you click on Sensitivity, a new


worksheet, called Sensitivity Report
is added. It contains two tables:
Variable cells and Constraints.

Variable cells table helps us answer questions related to changes in


the objective function coefficients.

Constraints table helps us answer questions related to changes in


the RHS coefficients.

We will discuss these tables separately.


Changes in
Objective Function Coefficients
Values in the “Allowable Increase” and
“Allowable Decrease” columns for the
Variable Cells indicate the amounts by which
an objective function coefficient can change
without changing the optimal solution,
assuming all other coefficients remain
constant.
Range of Optimality

• A range of optimality of an objective function


coefficient is found by determining an interval for
the objective function coefficient in which the
original optimal solution remains optimal while
keeping all other data of the problem constant.
The value of the objective function may change in
this range.
Analyzing the Sensitivity Report

• To find the range of the coefficient before the


optimal solution will change, you can use the
Solver information in the following way.
– The bottom end of the range on the coefficient
is:
• Objective coefficient – Allowable Decrease
– The upper end of the range of the coefficient is:
• Objective coefficient + Allowable Increase
Change in One Coefficient

• Using the sensitivity analysis

Variable Cells
Final Reduced Objective Allowable Allowable
Cell Name Value Cost Coefficient Increase Decrease
$C$12 Units Produced Doors 2 0 300 450 300
$D$12 Units Produced Windows 6 0 500 1E+30 300

So that your
optimal How much How much
solution will you can you can
not change increase decrease
Change in One Coefficient

W
Production rate
for windows

(2, 6) is optimal for 0 < PD < 750

6 Line B PD = 0 (Profit = 0 D + 500 W)

4 Line C
PD = 300 (Profit = 300 D + 500 W)
Feasible
region
2
PD = 750 (Profit = 750 D + 500 W)

Line A
0 2 4 6 D
Production rate for doors
Analyzing the Sensitivity Report Cont.

• In the Wyndor example the price of the doors


could increase to $750 or decrease to $0 before the
optimal solution would change.

• In the Wyndor example the price of the windows


could increase an infinite amount or decrease to
$200 before the optimal solution would change.
Alternate Optimal Solutions

Values of zero (0) in the “Allowable


Increase” or “Allowable Decrease” columns
for the Variable Cells indicate that an
alternate optimal solution exists.
Sensitive Parameters

• A parameter is considered a sensitive parameter if


small changes lead to a change in the optimal
solution.
– These parameters are the ones you will focus on
to make sure you have them as close to correct
as possible.
Changes in The Constraints

• Let’s consider the Wyndor Glass Co. problem


B C D E F G
3 Doors Windows
4 Unit Profit $300 $500
5 Hours Hours
6 Hours Used Per Unit Produced Used Available
7 Plant 1 1 0 2 <= 4
8 Plant 2 0 2 12 <= 12
9 Plant 3 3 2 18 <= 18
10
11 Doors Windows Total Profit
12 Units Produced 2 6 $3,600

– What if plant 2 has more hours available?


• 13, 14, 15…
Change in One Constraint

From 1213
1 more hour at Plant 2,
$150 increase in weekly
profit

From 1318
5 more hours at Plant 2, $750
increase in weekly profit,
$150 for each hour

From 1820
2 more hours at Plant 2, no
change in weekly profit
Change in One Constraint

• Shadow price: Given an optimal solution and the


corresponding value of the objective function for a
linear programming model, the shadow price for a
functional constraint is the rate at which the value
of the objective function changes by 1 unit change
on the right-hand-side
Change in One Constraint
• Using the sensitivity analysis
Variable Cells
Final Reduced Objective Allowable Allowable
Cell Name Value Cost Coefficient Increase Decrease
$C$12 Units Produced Doors 2 0 300 450 300
$D$12 Units Produced Windows 6 0 500 1E+30 300

Constraints
Final Shadow Constraint Allowable Allowable
Cell Name Value Price R.H. Side Increase Decrease
$E$7 Plant 1 Used 2 0 4 1E+30 2
$E$8 Plant 2 Used 12 150 12 6 6
$E$9 Plant 3 Used 18 100 18 6 6

Plant 2 and Plant 3 are binding constraints; increasing these


resources will increase the feasible region and move the optimal
point.

Plant 1 is a nonbinding constraint; increasing the resource will


increase the feasible region but will not move the optimal point.
Change in One Constraint
• Using the sensitivity analysis
Variable Cells
Final Reduced Objective Allowable Allowable
Cell Name Value Cost Coefficient Increase Decrease
$C$12 Units Produced Doors 2 0 300 450 300
$D$12 Units Produced Windows 6 0 500 1E+30 300

Constraints
Final Shadow Constraint Allowable Allowable
Cell Name Value Price R.H. Side Increase Decrease
$E$7 Plant 1 Used 2 0 4 1E+30 2
$E$8 Plant 2 Used 12 150 12 6 6
$E$9 Plant 3 Used 18 100 18 6 6

Shadow price represents change in the objective function value


per one-unit increase in the RHS of the constraint. In a business
application, a shadow price is the maximum price that we can pay
for an extra unit of a given limited resource.
Changes in Constraint RHS Values
• The shadow price of a constraint indicates the amount
by which the objective function value changes given a
unit increase in the RHS value of the constraint,
assuming all other coefficients remain constant.

• Shadow prices hold only within RHS changes falling


within the values in “Allowable Increase” and
“Allowable Decrease” columns.

• Shadow prices for nonbinding constraints are always


zero.
Range of Validity

• The range of validity for a functional constraint is


the range of values for this right-hand side over
which this constraint’s original shadow price
remains valid.

• The bottom end of the range is calculated by:


– Constraint RH Side – Allowable Decrease

• The upper end of the range is calculated by:


– Constraint RH Side + Allowable Increase
Comments About Changes
in Constraint RHS Values
• Shadow prices only indicate the changes that occur in
the objective function value as RHS values change.

• Changing a RHS value for a binding constraint also


changes the feasible region and the optimal solution.

• To find the optimal solution after changing a binding


RHS value, you must re-solve the problem.
Change in One Constraint

• Using the sensitivity analysis

Variable Cells
Final Reduced Objective Allowable Allowable
Cell Name Value Cost Coefficient Increase Decrease
$C$12 Units Produced Doors 2 0 300 450 300
$D$12 Units Produced Windows 6 0 500 1E+30 300

Constraints
Final Shadow Constraint Allowable Allowable
Cell Name Value Price R.H. Side Increase Decrease
$E$7 Plant 1 Used 2 0 4 1E+30 2
$E$8 Plant 2 Used 12 150 12 6 6
$E$9 Plant 3 Used 18 100 18 6 6

So that your How much How much


shadow price you can you can
will not change increase decrease
Change in One Constraint
Variable Cells
Final Reduced Objective Allowable Allowable
Cell Name Value Cost Coefficient Increase Decrease
$C$12 Units Produced Doors 2 0 300 450 300
$D$12 Units Produced Windows 6 0 500 1E+30 300

Constraints
Final Shadow Constraint Allowable Allowable
Cell Name Value Price R.H. Side Increase Decrease
$E$7 Plant 1 Used 2 0 4 1E+30 2
$E$8 Plant 2 Used 12 150 12 6 6
$E$9 Plant 3 Used 18 100 18 6 6

– Increasing capacity of
plant 2 by 1 hour
increases the profit by
150
• Would you pay $100 to
have 1 more hour in plant
2?
• Would you pay $200 to
have 1 more hour in plant
2?
Objective Function Right Hand Side

Change one coefficient at a time within allowable range


•The feasible region does not •Feasible region changes.
change. • If a nonbinding constraint
•Since constraints are not is changed, the solution is
affected, decision variable not affected.
values remain the same. • If a binding constraint is
•Objective function value will changed, the same corner
change. point remains optimal but
the variable values will
change.
Sensitivity Report: Caveat!

• Effects identified in the Sensitivity Report need to be carefully


interpreted.

• Specifically, the effect of the change of one parameter (e.g., a


RHS value or an objective coefficient) assume that all other
parameters of the model stay at their base case values.

• For example, the Sensitivity Report does not tell us what happens
if additional hours of both Plant 2 and Plant 3 Time become
available. In this scenario, we would need to enter the new values
and re-solve the model.
M&D Chemicals Problem

• Illustration:
– Production requirements for M&D Chemicals:
• The combined production for products A and B must
total at least 350 gallons
• Separately a major customer’s order for 125 gallons
of product A must also be satisfied
– Processing time:
• Product A: 2 hours/gallon
• Product B: 1 hour/gallon
• For the coming month, 600 hours of processing time
are available
M&D Chemicals Problem

– Production cost: Product A: $2/gallon; Product B:


$3/gallon
– Objective: Minimizing the total production cost

Problem Formulation

• To find the minimum-cost production schedule:


– Define the decision variables and the objective function
Let A = number of gallons of product A
B = number of gallons of product B
– Objective function = 2A + 3B
Sensitivity Analysis

Interpreting Excel Solver Sensitivity Report


• Consider the M&D chemicals problem:

A = number of gallons of product A

B = number of gallons of product B

Min 2A + 3B
s.t.
1A ≥ 125 Demand for product A

1A + 1B ≥ 350 Total production

2A + 1B ≤ 600 Processing time

A, B ≥ 0
Solver Sensitivity Report for the M&D Chemicals Problem
Example: Olympic Bike Co.
Olympic Bike is introducing two new lightweight bicycle frames,
the Deluxe and the Professional, to be made from special aluminum and
steel alloys. The anticipated unit profits are $10 for the Deluxe and $15
for the Professional.

The number of pounds of each alloy needed per frame is


summarized below. A supplier delivers 100 pounds of the aluminum
alloy and 80 pounds of the steel alloy weekly. How many Deluxe and
Professional frames should Olympic produce each week?

Aluminum Alloy Steel Alloy

Deluxe 2 3

Professional 4 2
Example: Olympic Bike Co.

• Model Formulation
– Verbal Statement of the Objective Function

Maximize total weekly profit.


– Verbal Statement of the Constraints

Total weekly usage of aluminum alloy < 100 pounds.

Total weekly usage of steel alloy < 80 pounds.


– Definition of the Decision Variables
x1 = number of Deluxe frames produced weekly.

x2 = number of Professional frames produced weekly.


Example: Olympic Bike Co.

• Model Formulation (Continued)

Max 10x1 + 15x2 (Total Weekly Profit)

s.t. 2x1 + 4x2 < 100 (Aluminum Available)

3x1 + 2x2 < 80 (Steel Available)

x1 , x2 > 0
Example: Olympic Bike Co.

• Partial Spreadsheet Showing Problem Data

A B C D
1 Material Requirements Amount
2 Material Deluxe Profess. Available
3 Aluminum 2 4 100
4 Steel 3 2 80
Example: Olympic Bike Co.

• Partial Spreadsheet Showing Solution

A B C D
6 Decision Variables
7 Deluxe Professional
8 Bikes Made 15 17.500
9
10 Maximized Total Profit 412.500
11
12 Constraints Amount Used Amount Avail.
13 Aluminum 100 <= 100
14 Steel 80 <= 80
Example: Olympic Bike Co.

• Optimal Solution

According to the output:

x1 (Deluxe frames) = 15

x2 (Professional frames) = 17.5

Objective function value = $412.50


Example: Olympic Bike Co.

• Range of Optimality

Question

Suppose the profit on deluxe frames is


increased to $20. Is the above solution still
optimal? What is the value of the objective
function when this unit profit is increased to $20?
Example: Olympic Bike Co.

• Sensitivity Report
Adjustable Cells
Final Reduced Objective Allowable Allowable
Cell Name Value Cost Coefficient Increase Decrease
$B$8 Deluxe 15 0 10 12.5 2.5
$C$8 Profess. 17.500 0.000 15 5 8.333333333

Constraints
Final Shadow Constraint Allowable Allowable
Cell Name Value Price R.H. Side Increase Decrease
$B$13 Aluminum 100 3.125 100 60 46.66666667
$B$14 Steel 80 1.25 80 70 30
Example: Olympic Bike Co.

• Range of Optimality

Answer

The output states that the solution remains


optimal as long as the objective function
coefficient of x1 is between 7.5 and 22.5. Since 20
is within this range, the optimal solution will not
change. The optimal profit will change: 20x1 +
15x2 = 20(15) + 15(17.5) = $562.50.
Example: Olympic Bike Co.

• Range of Optimality

Question

If the unit profit on deluxe frames were $6


instead of $10, would the optimal solution
change?
Example: Olympic Bike Co.

• Range of Optimality
Adjustable Cells
Final Reduced Objective Allowable Allowable
Cell Name Value Cost Coefficient Increase Decrease
$B$8 Deluxe 15 0 10 12.5 2.5
$C$8 Profess. 17.500 0.000 15 5 8.333333333

Constraints
Final Shadow Constraint Allowable Allowable
Cell Name Value Price R.H. Side Increase Decrease
$B$13 Aluminum 100 3.125 100 60 46.66666667
$B$14 Steel 80 1.25 80 70 30
Example: Olympic Bike Co.

• Range of Optimality

Answer

The output states that the solution remains


optimal as long as the objective function
coefficient of x1 is between 7.5 and 22.5. Since 6
is outside this range, the optimal solution would
change.
Example: Olympic Bike Co.

• Range of Validity

Question

What is the maximum amount the company


should pay for 50 extra pounds of aluminum?
Example: Olympic Bike Co.

• Range of Validity
Adjustable Cells
Final Reduced Objective Allowable Allowable
Cell Name Value Cost Coefficient Increase Decrease
$B$8 Deluxe 15 0 10 12.5 2.5
$C$8 Profess. 17.500 0.000 15 5 8.333333333

Constraints
Final Shadow Constraint Allowable Allowable
Cell Name Value Price R.H. Side Increase Decrease
$B$13 Aluminum 100 3.125 100 60 46.66666667
$B$14 Steel 80 1.25 80 70 30
Example: Olympic Bike Co.

• Range of Validity

Answer

The shadow price provides the value of extra


aluminum. The shadow price for aluminum is $3.125 per
pound and the maximum allowable increase is 60 pounds.
Since 50 is in this range, then the $3.125 is valid. Thus,
the value of 50 additional pounds is = 50($3.125) =
$156.25.

Você também pode gostar