Chapter 5: Sensitivity Analysis and
Duality of LP Problems
¨ Sensitivity Analysis in LP
¨ Types of Sensitivity Analysis
¨ Duality of LP Problems
1. Sensitivity Analysis in LP
¨ How do changes in an LP’s parameters (objective function
coefficients, right-hand sides, and technological coefficients)
change the optimal solution?
¨ Procedure for Sensitivity Analysis
¨ Revision of model
¨ Revision of final tableau
¨ Conversion to proper form from Gaussian elimination
¨ Feasibility test
¨ Optimality test
¨ Re-optimization
NOTATIONS
Coefficient of:
Basic Z RHS
Variable Original Variable Slack
Variable
Z 1 cB .B-1.A – c = z*- c cB .B-1 = y* cB .B-1.b = Z*
xB 0 B-1 .A = A* B-1 = S* B-1 .b = b*
S*=B-1 z* =cB B-1 A = y*.A
A*= B-1. A=S*.A z*-c =cB B-1 A-c= y*.A-c
y* =cB B-1
Z* = cB B-1 b= y*.b
b* = B-1 b=S*.b
Example
Maximize Profit = $50 X1 + $120 X2
Subject to:
2 X1 + 4 X2 80 60
3 X1 + X2 60
X1, X2 0
• Optimal solution at point A
• Profit = 2400
A 20
• Basic variables: X2=20 , S2 = 40 50 X1 + 120 X2 =2400
• Non-basic: X1= S1=0.
20 40 50
2. Types of Sensitivity Analysis
¨ Changes in the objective function coefficients
¨ Changes in Right-Hand-Side values (RHS)
¨ Changes in the constraint coefficients
¨ Addition of a new constraint
¨ Addition of a new decision variable
2.1. Changing in the Objective
Function Coefficients, c
Changing in the Objective Function Coefficients, c (cont.)
Final Simplex Table
50 120 0 0
Cj Basi X1 X2 S1 S2
Eq. Z RHS
c
Z (0) 1 10 0 30 0 2400
120 X2 (1) 0 0.5 1 0.25 0 20
0 S2 (2) 0 2.5 0 -0.25 1 40
Change Coefficients of Nonbasic Variables: x1
∗ ′ ∗ ′ ∗
𝑧 −𝑐 =𝑧 −𝑐 +(𝑐 −𝑐 )=𝑦 𝑎 −𝑐¯ −Δ𝑐
1 1 1 1 1 1 𝑗 1 1
The optimal does not change if
Note: c1=c1’- c1
2.2. Changing Coefficient of the Basic Variable
¨ Allowable range to stay optimal:
¨ must be positive for variable xj to stay optimal
=0; = cj +cj
¨ zj*-cj’=zj*-cj+cj-cj’=(zj*-cj)-(cj’-cj)=(zj*-cj)- cj =0
Note: cj=cj’-cj
II. Changing in Coefficient of the Basic Variable: X2
Consider the optimal simplex tableau
50 C(X2) 0 0
Basic Eq. Z X1 X2 S1 S2 RHS
Z (0) 1 10 0 30 0 2400
C(X2) X2 (1) 0 0.5 1 0.25 0 20
0 S2 (2) 0 2.5 0 -0.25 1 40
Row 0 : 10 0 30 0
Change c2 120 to c2 120 c2
New row 0 : 10 0-c2 30 0
Note: c2=c2’-0
For x 2 to stay a basic z 2 *-c2 must be equal to 0.
Gaussian elimination:
Row 0: 10 0-c2 30 0
c2 Row 1: 0.5c2 c2 0.25c2 0 =
10 0.5c2 0 0.25c2 30 0
10 0.5c2 0 c2 20
The optimal does not change if 0.25c 30 0
c 120
c2 20 c2 100
2 2
2.2. Changing the Right-Hand-Side, bi
¨ RHS ranging: the process which determining number of resources
needed to add or to reduce so that we still have the same shadow
price.
¨ Take Quantity divide to corresponding columns in the final
tableau, get:
¨ For S : The smallest positive ratio is 80. This is how many
1
hours of resource 1 can be reduced without changing the
current solution. Hence, we can decrease RHS as much as
80, make minimum RHS will be (80-80) = 0.
S1 RHS Ratio
1/4 20 80
- 1/4 40 - 160
¨ The smallest negative ratio is -160. This is how many hours of
resource 1 can be added without changing the current
solution. Maximum value of RHS will be 80-(-160) =240
So, range of RHS of resource 1: (0, 240)
Changing the Right-Hand-Side (Cont.)
¨ Shadow Price: The shadow price is the change in objective
function value from increasing of one unit of a scare resource.
Where we can find shadow price? Look at the positive values at
Z-row of slack variables, these values are called shadow prices
or duals. If we look at the nonbasic real variable (X1), we have
(10), 10 is so called reduced cost. The reduced costs are the
values those we can reduce in coefficients of objective function
so that the associated variable become basic variables. Look at
the final tableau:
50 120 0 0
Basi X1 X2 S1 S2
Eq. Z RHS
c
Z (0) 1 10 0 30 0 2400
120 X2 (1) 0 0.5 1 0.25 0 20
0 S2 (2) 0 2.5 0 -0.25 1 40
Obj. function value will increase 30 when increasing one unit
of resource associated with S1
Changing the Right-Hand-Side (Cont.)
Changing the Right-Hand-Side (Cont.)
¨ The only revision in the model is the changes in RHS.
¨ RHS of final row 0: z*= y*b
¨ RHS at final rows 1,...,m = S*b
Basic Eq. Z X1 X2 S1 S2 RHS
Z (0) 1 10 0 30 0 2400
C(X2) X2 (1) 0 0.5 1 0.25 0 20
0 S2 (2) 0 2.5 0 -0.25 1 40
b1 * 1 1 1 20 0.25 0 b1
b * B b B b B (b b ) 40 0.25 1 b
2 2
if b1 change to b1 b1 b1
b1 * 20 0.25 0 b1 20 0.25b1
b * 40 0.25 1 40 0.25b
2 0 1
Changing the Right-Hand-Side (Cont.)
b1 * 20 0.25 0 b1 20 0.25b1
b * 40 0.25 1 40 0.25b
2 0 1
20 0.25b1 0 b1 80
40 0.25b1 0 b1 160
80 b1 160 -80<=b1’-80<=160
80 80 80 b1 160 80
0 120
80 b1 240
0 b1 240
3. The Duality in LP
Two of the most important topics in linear
programming are sensitivity analysis and duality.
Every linear programming problem has associated
with it another linear programming problem called
the dual.
¨ The Dual
¨ An alternate formulation of a linear programming problem
as either the original problem or its mirror image, the dual,
which can be solved to obtain the optimal solution.
¨ Its variables have a different economic interpretation than
the original formulation of the linear programming problem
(the primal).
¨ It can be easily used to determine if the addition of another
variable to a problem will change the optimal.
¨ The Dual
¨ The number of decision variables in the primal is equal to
the number of constraints in the dual.
¨ The number of decision variables in the dual is equal to the
number of constraints in the primal.
¨ Since it is computationally easier to solve problems with
less constraints in comparison to solving problems with
less variables, the dual gives us the flexibility to choose
which problem to solve.
Primal Problem Dual Problem
n m
Maximize Z= c j x j Minimize W= b j y j
j 1 i 1
subject to : subject to :
n m
a x
j 1
ij j b, for i 1, 2,..., m a ij yi c, for j 1, 2,..., n
i 1
and x j 0, for j 1, 2,..., n and yi 0, for i 1, 2,..., m
Example 1
Primal Problem Dual Problem
Maximize Z = 3x1 + 5x2 Minimize W = 4y1 + 12y2 +18y3
Subject to Subject to
x1 ≤ 4 (y1) y1 +3y3 ≥ 3 (x1)
2x2 ≤ 12 (y2) 2y2 +2y3 ≥ 5 (x2)
(y3)
3x1 + 2x2 ≤ 18 y1 ≥0
x1 ≥0 y2 ≥0
x2 ≥ 0. y3 ≥0
Example 2
Primal Standard primal Dual
Max Z = 5x1 + 12 x2 + 4x3 Max Z = 5x1 + 12 x2 + 4x3 + 0x4 Min Y = 10 U1+8U2
St. St. St.
x1 + 2x2 + x3 ≤ 10 x1 + 2x2 + x3 + x4 = 10 (U1) 1U1 + 2U2 ≥ 5
2x1 – 1x2 + 3x3 = 8 2x1 – 1x2 + 3x3 + 0x4 = 8 (U2) 2U1 - 1U2 ≥ 12
x1,x2, x3 ≥ 0 x 1, x 2, x 3, x 4 ≥ 0 1U1 + 3U2 ≥ 4
U1 ≥0
U2 unrestricted
The Duality in LP
Primal (Dual) Dual (Primal)
Maximization Profit Minimization Opportunity Cost
Constraints type ≤ Constraints type ≥
Constraints: resources Constraints: Product profits
Max. Profit = $50 X1 + $120 X2 Min. Opportunity Cost = 80 U1 + 60 U2
Subject to: Subject to:
2 X1 + 4 X2 80 ( U1) 2 U1 + 3 U2 ≥ 50 ( X1)
3 X1 + X2 60 ( U2) 4 U1 + 1 U2 ≥ 120 ( X2)
X1, X2 0 U1, U2 0
Solving Dual Problem
Primal (Dual) Dual (Primal)
Max. Profit = $50 X1 + $120 X2 Min. Opportunity Cost = 80 U1 + 60 U2
Subject to: Subject to:
2 X1 + 4 X2 80 2 U1 + 3 U2 ≥ 50
3 X1 + X2 60 4 U1 + 1 U2 ≥ 120
Primal optimal solution Dual optimal solution
Cj Solut X1 X2 S1 S2 Quan- Cj Solut U1 U2 S1 S2 A1 A2 Quan
ion tity ion -tity
120 X2 1/2 1 1/4 0 20 80 U1 1 1/4 0 -1/4 0 1/2 30
0 S2 5/2 0 -1/4 1 40 0 S1 0 -5/2 1 -1/2 -1 ½ 10
Zj 60 120 30 0 2400 Zj 80 20 0 -20 0 40 2400
Cj-Zj -10 0 -30 0 Cj-Zj 0 40 0 20 M M-40
X1=0; X2= 20; S1=0; S2 = 40 U1= 30; U2= 0; S1= 10; S2= 0
- Absolute values of number in the (Cj-Zj) row under slack variables are the
solutions of the dual (Ui’s). These are shadow prices.
- Optimal value of objective functions of both problems are equal. Always we have
Obj. value of max. problem ≤ Obj. value of min.problem.