What-if Analysis (Sensitivity
Analysis) for Linear
Programming
ADM2302 /Rim Jaber 1
Introduction
o Assumption: The parameters of the
model were known with certainty.
o In Reality: the model parameters are
simply estimates that are subject to
change.
o Example (RMC Problem).
ADM2302 /Rim Jaber 2
RMC, Inc. is a firm that produces chemical based products. In a
particular process three raw materials are used to produce
two products. The Material requirements per ton are:
Product Material 1 Material 2 Material 3
Fuel additive 2/5 0 3/5
Solvent base 1/2 1/5 3/10
For the current production period RMC has available the following
quantities of each raw material. Because of spoilage, any
materials not used for current production must be discarded.
Number of Tons
Material Available for Production
Material 1 20
Material 2 5
Material 3 21
If the contribution to the profit is $40 for each ton of fuel additive
and $30 for each ton of solvent base, How many tons of each
product should be produced in order to maximize the total
contribution profit?
ADM2302 /Rim Jaber 3
Introduction (cont’d)
RMC Problem Formulation (refer also
“RMC_problem.xlsx”)
Max Z = $ 40 x1 + 30 x2
Subject to
2/5 x1 + 1/2 x2 £ 20
1/5 x2 £ 5
3/5 x1 + 3/10 x2 £ 21
x1 ³ 0, x2 ³ 0
x1: number of tons of fuel additive that RMC produces
x2: number of tons of solvent base that RMC produces
4. The Feasible Region
x2
50
40
1/5 x2 = 5
30 2/5x1 + 1/2 x2 = 20
20
3/5 x1 + 3/10 x2= 21
10
x1
0 10 20 30 40 50
ADM2302 ~ Rim Jaber 5
A. The Optimal Solution: objective
function line solution method
x2
50 Maximum isoprofit line:
Z= $1600
40
30
Optimal Solution
Point
20 (25,20)
10
x1
0 10 20 30 40 50
ADM2302 ~ Rim Jaber 6
B. The Optimal Solution:
corner point solution method
x2
50
40 (0, 25)
(18.75,25)
30
Optimal Solution
Point
(25,20)
20
10 (0,0) (35,0)
x1
0 10 20 30 40 50
ADM2302 ~ Rim Jaber 7
Answer Report
Objective Cell (Max)
Cell Name Original Value Final Value
$D$5 Profit Totals $0.00 $1,600.00
Variable Cells
Cell Name Original Value Final Value Integer
$B$3 Solution Fuel Additive (x1) 0.00 25.00 Contin
$C$3 Solution Solvent Base (x2) 0.00 20.00 Contin
Constraints
Cell Name Cell Value Formula Status Slack
$D$8 Material 1 LHS 20.0 $D$8<=$F$8 Binding 0
$D$9 Material 2 LHS 4.0 $D$9<=$F$9 Not Binding 1
$D$10 Material 3 LHS 21.0 $D$10<=$F$10 Binding 0
ADM2302 /Rim Jaber 8
Sensitivity Report
Variable Cells
Final Reduced Objective Allowable Allowable
Cell Name Value Cost Coefficient Increase Decrease
$B$3 Solution Fuel Additive (x1) 25 0 40 20 16
$C$3 Solution Solvent Base (x2) 20 0 30 20 10
Constraints
Final Shadow Constraint Allowable Allowable
Cell Name Value Price R.H. Side Increase Decrease
$D$8 Material 1 LHS 20 33.333 20 1.5 6
$D$9 Material 2 LHS 4 0 5 1E+30 1
$D$10 Material 3 LHS 21 44.444 21 9 2.25
ADM2302 /Rim Jaber 9
Introduction (cont’d)
o What_if Analysis = Sensitivity
Analysis = Postoptimality Analysis =
Parametric Programming = Optimality
Analysis.
o The analysis of the effect of
parameter changes (coefficient of the
LP problem) on the optimal solution.
o Centered around “What-if question?”.
ADM2302 /Rim Jaber 10
Outline
n Changes in the Objective Functions Coefficients
n Changes in the Right-Hand Sides (RHS) Values
(changes in constraint quantity values)
o Shadow Prices
o Range of Feasibility
n Simultaneous Changes in the Objective Function
Coefficients
n Simultaneous Changes in the RHS
n Reduced cost
n Pricing out New variables
ADM2302 /Rim Jaber 11
Changes in the Objective
Functions Coefficients
o Definition:
n c1: the objective function coefficient of x1 (c1=40)
n c2: the objective function coefficient of x2 (c2=30)
Purpose
o Sensitivity analysis is performed to determine
the range for cj over which the current
solution remain optimal
o This can be directly obtained from Excel’s
sensitivity report.
ADM2302 /Rim Jaber 12
Changes in the Objective
Functions Coefficients (cont’d)
o Graphically
n Changes in the objective function coefficients
values do not affect the size of the feasible region.
o The range of optimality
n The range of values over which a variable’s
coefficient can change without causing a change
in the optimal solution (x1= 25, x2= 20) is:
o 24 £ c1 £ 60 (refer to the Excel Sensitivity
analysis report)
o 20 £ c2 £ 50 (refer to the Excel Sensitivity
analysis report)
ADM2302 /Rim Jaber 13
Changes in the Objective
Functions Coefficients (cont’d)
o What about the value of Z?
n Zero value decision variable (unused
activity)
o The value of the objective function, Z, will
not change.
n Non Zero value decision variables
o The value of Z, will change.
ADM2302 /Rim Jaber 14
Changes in the Objective Functions
Coefficients (cont’d)
o Question : What happen if the
estimate of the unit profit of ONE of
the RMC’s chemical based product is
inaccurate?
o Answer: The range of values is wide
for both objective function
coefficients. Thus we can still be
confident that we have obtained the
correct optimal solution.
ADM2302 /Rim Jaber 15
Changes in the Right-Hand
Sides (RHS) values
o = Changes in constraints quantity values
= changes in resources = changes in the
managerial policy decisions
o qi = the RHS value for constraint i
n q1 = 20 , q2 = 5 and q3 = 21
o Graphically
n A change in qi usually affect the size of the
feasible region and often the value of the
optimal solution.
ADM2302 /Rim Jaber 16
x2
50
40 (0, 25)
(18.75,25)
30
Optimal Solution
Point
(25,20)
20
10 (0,0) (35,0)
x1
0 10 20 30 40 50
ADM2302 /Rim Jaber 17
Changes in the Right-Hand
Sides (RHS) values (cont’d)
o Shadow Price
n The value of an additional unit of
resources (e.g. an additional 1 ton of
Material 1 will increase my profit by how
much? Is it worth it?)
o How to find the value of the shadow
price?
n Increase the RHS by one in the
spreadsheet, and solve.
n Look at the sensitivity report .
ADM2302 /Rim Jaber 18
Changes in the Right-Hand Sides
(RHS) values (cont’d)
Shadow Prices (Definitions):
o Is the marginal profit of additional
unit of resource.
o The maximum price you are willing to
pay for 1 unit of the resources.
o Amount by which profit will decrease
if the availability of the resource
associated with the constraint is
reduced by 1 unit.
ADM2302 /Rim Jaber 19
Changes in the Right-Hand
Sides (RHS) values (cont’d)
Purpose
n The effect on the optimal value if a small
change were to be made in the RHS
constraint (done for each constraint, one at
a time).
n We want to find the range value of qi over
which the shadow prices remain valid ó the
range over which the solution remain
feasible (x1 and x2 remain different than
zero, however their values may change).
ADM2302 /Rim Jaber 20
Changes in the Right-Hand
Sides (RHS) values (cont’d)
o Range of Feasibility
n The range of values over which the value
of the right hand side (qi) can vary
without causing a change in the
corresponding shadow price value.
o 14 <= q1 <= 21.5
o 4 <= q2
o 18.75 <= q3 <= 30
ADM2302 /Rim Jaber 21
Changes in the Right-Hand
Sides (RHS) values (cont’d)
o Changes in the right hand side of a
binding constraint causes the value of
the optimal solution to change.
o What about changes in the right hand
side of a non-binding constraint?
n Shadow price = 0, thus the optimal solution
will not change nor the profit as long as the
change is within the range of feasibility.
ADM2302 /Rim Jaber 22
Simultaneous Changes in the
Objective Function Coefficients
o The range of values discussed is based on
the assumption that only one coefficient
changes, and all the other coefficients
remain the same (accurate).
o Purpose
n determine, without solving the problem,
whether optimal solution may change if certain
changes occur simultaneously in the coefficients
of the objective function (given that those
changes are within the corresponding range).
ADM2302 /Rim Jaber 23
100 Percent Rule for Objective
Function Coefficients
o For all objective function coefficients that are
changed, sum the percentage of the
allowable increases and the allowable
decreases represented by the changes. If the
sum of the percentage changes does not
exceed 100%, the optimal solution will not
change.
S (Change / Allowable change)*100 £ 100
ADM2302 /Rim Jaber 24
100 Percent Rule for Objective
Function Coefficients
o Example (optimal solution does not
change)
n c1: 40 à 50 and c2: 30 à35
Percentage allowable increase for c1
= (50-40)/ (allowable increase for c1) %
= (50-40)/20 (100) = 50 %
Percentage allowable increase for c2
= (35-30)/ (allowable increase for c2) %
= (5)/20 (100) = 25 %
Sum= 50% + 25% = 75% <100%
ADM2302 /Rim Jaber 25
100 Percent Rule for Objective Function
Coefficients
Example: c1: 40 à 25 and c2: 30 à40
Percentage allowable decrease for c1
= (40-25)/ (allowable decrease for c1) %
= (15/16) (100) = 93.75 %
Percentage allowable increase for c2
= (40-30)/ (allowable increase for c2) %
= 10/20 (100) = 50 %
Sum= 93.75 % + 50% = 143.75% >100%
Since the 100% is not satisfied we must resolve the problem
to determine if the optimal solution will change or not.
ADM2302 /Rim Jaber 26
Simultaneous changes in the RHS
o The 100 percent Rule:
n For all right hand side that are changed
(with their corresponding range of
feasibility), sum percentages of allowable
increases and allowable decreases. If the
sum does not exceed 100% then the
shadow prices will not change.
o Example:
n Q1: 20 à 21 , 14 <= Q1 <=21.5
n Q2: 5à 4, 4 <= Q2
n Q3: 21 à24 , 18.75 <= Q3 <= 30
ADM2302 /Rim Jaber 27
100 Percent Rule for the RHS
o Example solution:
n Discussed during the synchronous class.
ADM2302 /Rim Jaber 28
Reduced Cost
o Reduced cost of an unused activity is:
n The amount by which the profit
contribution of an activity (objective
function coefficient) needs to be increased
before producing this activity.
n the amount by which the profit will
decrease if 1 unit of this activity is forced
into the solution.
ADM2302 /Rim Jaber 29
Multiple optimal solution
o Zero in the “final value” and reduced
cost” column.
o zero in the “allowable increase” or
“allowable decrease” columns of the
variable cells table.
ADM2302 /Rim Jaber 30
Pricing-out New Variables
o Information given in sensitivity report can be
used to study impact of introduction of new
decision variables (products).
o For example:
n If problem is re-solved with a new product in
model, will it be recommend that the new
product to be produced?
n Or, will it be recommend that a new product not
to be produced, and continue producing the same
products (that is, fuel additive and solvent base)?
ADM2302 /Rim Jaber 31
Pricing-out New Variables (cont’d)
o Suppose RMC, Inc. wants to produce
another chemical based products
ultra base (x3).
n 0.1 ton of material 1
n 0.1 ton of material 2
n 0.8 ton of material 3
n $35 for each ton
o Would you recommend that ultra
base to be produced?
ADM2302 /Rim Jaber 32
Pricing-out New Variables (cont’d)
1. Checking validity of the shadow price
using 100% rule.
2. Compute the opportunity cost:
marginal worth of the resources that
would be diverted from existing
product + cost of making the product
(it is 0 in this example).
3. Opportunity cost > profit contribution
n Do not produce the product.
ADM2302 /Rim Jaber 33
Pricing-out New Variables (cont’d)
o Solutions discussed during the
synchronous class.
ADM2302 /Rim Jaber 34
Summary of Sensitivity Report for Changes
in the Objective Function Coefficients
o Final Value
n The value of the decision variables (variable cells) in the
optimal solution.
o Reduced Cost
n Increase in the objective function value per unit increase in
the value of a zero value variable (for small increases)—may
be interpreted as the shadow price for the non-negativity
constraint.
o Objective Coefficient
n The current value of the objective coefficient.
o Allowable Increase/Decrease
n Defines the range of the coefficients in the objective function
for which the current solution (value of the decision variables
or changing cells in the optimal solution) will not change.
Summary of Sensitivity Report for Changes
in the Right-Hand-Sides
o Final Value
n The usage of the resource (or level of benefit achieved) in the
optimal solution—the left-hand side of the constraint.
o Shadow Price
n The change in the value of the objective function per unit increase
in the right-hand-side of the constraint (RHS):
∆Z = (Shadow Price)(∆RHS)
n (Note: only valid if change is within the allowable range—see
below.)
o Constraint R.H. Side
n The current value of the right-hand-side of the constraint.
o Allowable Increase/Decrease
n Defines the range of values for the RHS for which the shadow price
is valid and hence for which the new objective function value can be
calculated. (NOT the range for which the current solution will not
change.) 36