Professional Documents
Culture Documents
Sensitivity Analysis Step by Step Tutorial
Sensitivity Analysis Step by Step Tutorial
Sugarco can manufacture three types of candy bars. Each candy bar consists completely of
sugar and chocolate. The compositions of each type of candy bar and the profit earned from
each candy bar are shown in the table below.
Fifty oz of sugar and 100 oz of chocolate are available. Let xi be the number of Type i candy
bars manufactured. Sugarco should solve the following LP:
CB Basis x1 x2 x3 s1 s2 Value
5 x3 1/2 0 1 3/2 -1/2 25
7 x2 1/2 1 0 -1/2 1/2 25
C -3 0 0 -4 -1 Z=300
A. Sensitivity in the RHS of a constraint
Question#1: Study the effect of changes in the availability of sugar
→ This question is about the sensitivity in the RHS (right hand side) of a constraint, note
that the sugar availability constraint is a binding constraint as the associated slack variable
is non-basic (s1=0)
What this question is trying to say is: by how many units can we increase/decrease the
availability of sugar without any impact on the feasibility and hence the optimality of the
optimal basis
Preserving the optimality of the optimal basis means that even though the values would
change, nothing will leave/enter the basis
Answer: let ∆1: the change in the RHS of constraint 1 (change in the availability of sugar)
A change in the RHS of a constraint will only affect the corresponding column in the simplex
tableau ( the corresponding slack variable column)
The parameter ∆1 and the variable s1 have identical coefficients in the standard form and will
continue to have identical coefficients through all simplex iterations until the optimal tableau
For the optimal basis to remain feasible and hence optimal all the RHS values must remain ≥ 0
S1 RHS
3/2 25
-1/2 25
3 3 2 50
25 + 2 ∆1 ≥ 0 ∆1 ≥ −25 ∆1 ≥ −25 ∗ 3 ∆1 ≥ − 50
2
{ 1 → { 1 →{ →{ 3 ➔ − ≤ ∆1 ≤ 50
3
25 − ∆1 ≥ 0 − ∆1 ≥ −25 −∆1 ≥ −25 ∗ 2 ∆1 ≤ 50
2 2
→ As long as we do not decrease the availability of sugar by more than 50/3 (16.67) units or
increase by more than 50 units the optimal basis remains optimal
→ ∆1 = 40 ,this increase is within the feasibility range of constraint 1, thus the basis remains
optimal however the RHS values including the Z value will change
3
S1 RHS 25 + 2 ∗ 40 = 85
3/2 25 { 25 − 1 ∗ 40 = 5 → 𝑥3 = 85 , 𝑥2 = 5 𝑎𝑛𝑑 𝑍 =
2
-1/2 25 300 + 4 ∗ 40 = 460
460
Zj= 4 Z=300
→ ∆1 = 60 , this increase is not within the range of feasibility of the constraint, the basis will
change, we have to re-optimize the LP (here we are not asked to re-optimize)
C value of 𝑥1 is equal to -3, for the optimal basis to remain feasible and optimal, the new
𝑐 − 𝑏𝑎𝑟 value (after including ∆𝑝1 ) must remain ≤ 0
−3 + ∆𝑝1 ≤ 0 → ∆𝑝1 ≤ 3 → As long as the profit rate of product 1 does not increase beyond
$6, the optimality is preserved.
→ As long as we do not increase the profit rate of product 1 by more than $3, the optimal
basis remains optimal
Note that if we increase the profit rate by exactly $3 which is the shadow price of x1 , we will
have multiple solutions , as x1, a non-basic variable will have a C = 0 , so even though the
optimal basis remains optimal ,we no longer have 1 finite solution , we would have multiple
solutions.
Question#6 : Study the effect of changes in the profit rate of product 2
→ 𝑥2 is a basic variable, thus the C values of all non-basic variables will be impacted
For the basis to remain optimal, the 𝑁𝑒𝑤 C of the non-basic variables must remain ≤ 0
cj − zj -3 0 0 -4 -1 Z=300
1
𝑁𝑒𝑤𝑐̅ (𝑥1 ) = −3 − 2 ∆𝑝2 ≤ 0 ∆𝑝2 ≥ −6
1
𝑁𝑒𝑤𝑐̅ (𝑠1 ) = −4 + 2 ∆𝑝2 ≤ 0 → { ∆𝑝2 ≤ 8
1 ∆𝑝2 ≥ −2
𝑁𝑒𝑤𝑐̅ (𝑠2 ) = −1 − 2 ∆𝑝2 ≤ 0
{
→ −2 ≤ ∆𝑝2 ≤ 8
As long as the variation in the profit rate of product 2 is within the interval, the optimal basis
remains optimal
The profit rate of product 2 must be in this interval → 5 ≤ profit rate of product 2 ≤ 10 for
the optimal basis to remain unchanged.
Primal Dual
Max Z = 3x1+ 7x2+ 5x3+2x4 𝑀𝑖𝑛 𝑊 = 50𝑦1 + 100𝑦2
s.t x1+ x2+x3+2x4≤ 50 s.t. 𝑦1 + 2𝑦2 ≥ 3
𝑦1 + 3𝑦2 ≥ 7
s. 2x1+ 3x2+ x3+x4≤ 100 𝑦1 + 𝑦2 ≥ 5
x1, x2, x3, x4≥ 0 2𝑦1 + 𝑦2 ≤ 2
𝑦1 , 𝑦2 ≥ 0
We plug the optimal solution in this new constraint and check if it is satisfied:
CB Basis x1 x2 x3 s1 s2 Value
5 x3 1/2 0 1 3/2 -1/2 25
7 x2 1/2 1 0 -1/2 1/2 25
C -3 0 0 -4 -1 Z=300
2 × 4 + 1 ≤ 2 → False, the constraint was not satisfied by the optimal solution hence,
the optimal solution will not remain the same
Question#2 : Will the optimal solution change by introducing product 4 if its profit rate
is 10$ ?
2𝑦1 + 𝑦2 ≤ 10
2 × 4 + 1 ≤ 10→ the constraint is satisfied and hence no changes will happen to the
optimal solution
D. Deleting a variable:
Question#1 : Will the optimal solution change by removing product 3?
𝑥3 is a basic variable, hence, the optimal solution will change (we re-optimize if asked)
𝑥3 is not a basic variable, hence, the optimal solution will remain unchanged
E. Adding a constraint:
Suppose now that we’re going to start adding nuts to type 1 and 2 of candy bars,
producing 1 candy bar of type 1 and 2 requires 2 and 5 ounces of nuts respectively, we
currently have 100 oz of nuts available.
Question#1: Would the basis remain optimal after adding this new constraint? Without
doing any calculations would the total profit increase or decrease?
We solve the new LP using the simplex algorithm to obtain the new optimal solution
➔ Yes, in this case, the constraint is satisfied by the current optimal solution, it is thus
considered redundant and will not impact the optimal solution.