Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

Sensitivity Analysis

This tutorial covers the following subjects:

• Sensitivity in the RHS of constraints


• Sensitivity in the coefficients of the objective function
• Introducing a new variable
• Deleting a variable
• Introducing a constraint

Consider the following example:

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.

Types Amount of sugar Amount of chocolate Profit(cents)


(ounces) (ounces)
1 1 2 3
2 1 3 7
3 1 1 5

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:

Max Z = 3x1+ 7x2+ 5x3


s.t. x1+ x2+x3≤ 50 (Sugar constraint)
s. 2x1+ 3x2+ x3≤ 100 (Chocolate constraint)
x1 , x2 , x3 ≥ 0
The optimal tableau is as shown below:

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)

The constraint becomes: x1+ x2+x3≤ 50+∆1

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

P.S: If we happen to have a non-binding constraint (the corresponding slack variable is


basic a.k.a different from zero), the optimal basis remains feasible and optimal as long as
the availability (RHS) of the non-binding constraint is not reduced by an amount beyond its
optimal RHS value.
Question#2: In what interval would the sugar availability vary within without the need
to re-optimize the problem (the feasibility range of constraint 1) ?
50 50 100
− ≤ ∆1 ≤ 50 → 50 − ≤ 𝑅𝐻𝑆1 ≤ 50 + 50 → ≤ 𝑅𝐻𝑆1 ≤ 100
3 3 3

Question#3: What is the impact of increasing the availability of sugar by 40 units?

→ ∆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

Question#4: What is the impact of increasing the availability of sugar by 60 units?

→ ∆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)

B. Sensitivity in the coefficients of the objective function:


Question#5: Study the effect of changes in the profit rate of product 1 → 𝑥1 is a non-basic
variable, thus only its corresponding C value changes

Let: ∆𝑝1 : change in the profit rate of product 1

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

Let: ∆𝑝2 : change in the profit rate of product 2

𝑁𝑒𝑤 (C ) = 𝑜𝑙𝑑 (C) − 𝑅𝑜𝑤(𝑥2 ) ∗ ∆𝑝2

For the basis to remain optimal, the 𝑁𝑒𝑤 C of the non-basic variables must remain ≤ 0

7 x2 1/2 1 0 -1/2 1/2 25

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.

C. Introducing a new variable:


Let’s suppose that Sugarco will be introducing a new candy bar that requires 2 ounces of
sugar and 1 ounce of chocolate and has a unitary profit rate of 2$.

Question#1 : Will the optimal solution change by introducing product 4 ?

The new LP would be:

Max Z = 3x1+ 7x2+ 5x3+2x4


s.t. x1+ x2+x3+2x4≤ 50 (Sugar constraint)
s. 2x1+ 3x2+ x3+x4≤ 100 (Chocolate constraint)
x1, x2, x3, x4≥ 0
Adding a variable to the primal LP is equivalent to adding a constraint to the
dual LP:

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$ ?

The new dual constraint is:

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)

Question#2 : Will the optimal solution change by removing product 1?

𝑥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?

The new constraint:


2𝑥1 + 5𝑥2 ≤ 100
Constraint A

We plug in the current optimal solution to see if it is satisfied by it:


2 × 0 + 5 × 25 = 125
The result found is more than 100, this means that the new constraint is not satisfied by
the current optimal solution. We expect the profit to be worse than the current profit. The
limited amount of nuts will put an additional restriction on the number of products of each
type we can make, we will not be able to maintain the same production level or make
more than that amount), we will have to make less so that we do not run out of nuts.

We solve the new LP using the simplex algorithm to obtain the new optimal solution

Max Z = 3x1+ 7x2+ 5x3


s.t. x1+ x2+x3≤ 50 (Sugar constraint)
s. 2x1+ 3x2+ x3≤ 100 (Chocolate constraint)
2𝑥1 + 5𝑥2 ≤ 100 (nuts constraint)
x 1 , x2 , x3 ≥ 0
Question#2: Suppose we actually have 125 oz of nuts, will the basis remain optimal?
2𝑥1 + 5𝑥2 ≤ 125
Constraint B

➔ 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.

You might also like