XEQ206-Duality and Sensitivity Analysis
XEQ206-Duality and Sensitivity Analysis
4 Duality
For each LPP there is another LPP associated with it such that the two LPP’s have some relationship.
The first LPP is called the primal and the second associated with it is the dual. The two can be
represented as:
Primal
Max z = c1 x1 + c2 x2 + ... + cn xn
Subject to a11 x1 + a12 x2 + ... + a1n xn ≤ b1
a21 x1 + a22 x2 + ... + a2n xn ≤ b2
.
.
.
am1 x1 + am2 x2 + ... + amn xn ≤ bm
With x1 , x2 , ..., xn ≥ 0
Dual
Min ω = b1 y1 + b2 y2 + ... + bm ym
Subject to a11 y1 + a21 y2 + ... + am1 ym ≥ c1
a12 y1 + a22 y2 + ... + am2 ym ≥ c2
.
.
.
a1n y1 + a2n y2 + ... + amn ym ≥ cn
With y1 , y2 , ..., ym ≥ 0
NOTE:
Primal Dual
1.Normal Maximization problem i.e has all constraints Normal Minimization problem i.e has all constraint
of type ≤ and the variables are non-negative of type ≥ and the variables are non-negative
2. Maximization problem Minimization problem
3. Has z, x1 , x2 , ..., xn variables Has ω, y1 , y2 , ..., ym variables
4. Has constraints and variables of type ≤ Has constraints and variables of type ≥
5. Has constraints and variables of type ≥ Has constraints and variables of type ≤
6. Has unrestricted variables Has constraints of type =
Also if the primal has an optimal solution then z = ω.
Examples
Find the dual of the following LPs
1.
Max z = 60x1 + 30x2 + 20x3
Subject to 8x1 + 6x2 + x3 ≤ 48
4x1 + 2x2 + 1.5x3 ≤ 20
2x1 + 1.5x2 + 0.5x3 ≤ 8
With x1 , x2 , x3 ≥ 0
1
2.
Max z = 2x1 + x2
Subject to x1 + x2 = 2
2x1 − x2 ≥ 3
x1 − x2 ≤ 1
With x1 ≥ 0, x2 urs
3.
Solution
The dual of the LPs will be;
1.
2.
3.
Max z = 2x1 + x2 + x3 + x4
Subject to x1 + x2 + 2x4 = 2 ;since y1 is unrestricted
2x1 + x3 + x4 ≤ 4
x1 − x2 + x3 ≤ 6
With x1 , x2 ≥ 0, x3 urs, x4 ≤ 0 ;since 3rd constraint is = and 4th constraint is ≤
Exercise
Find the dual of the following LPs
2
1.
Max z = 6x1 + 7x2
Subject to 2x1 + 3x2 ≤ 12
2x1 + x2 ≤ 8
With x1 , x2 ≥ 0
2.
min ω = y1 − y2
Subject to 2y1 + y2 ≥ 4
y1 + y2 ≥ 1
y1 + 2y2 ≥ 3
With y1 , y2 ≥ 0
3.
Max z = 4x1 − x2 + 2x3
Subject to x1 + x2 ≤ 5
2x1 + x2 ≤ 7
2x2 + x3 ≥ 6
x1 + x3 = 4
With x1 ≥ 0, x2 , x3 urs
Example
From the example
max z = 6x1 + 7x2
Subject to 2x1 + 3x2 ≤ 12
2x1 + x2 ≤ 8
With x1 , x2 ≥ 0
In standard form;
max z = 6x1 + 7x2
Subject to 2x1 + 3x2 + s1 = 12
2x1 + x2 + s2 = 8
With x1 , x2 , s1 , s2 ≥ 0
The dual becomes;
min ω = 12y1 + 8y2
Subject to 2y1 + 2y2 ≥ 6
3y1 + y2 ≥ 7
With y1 , y2 ≥ 0
3
The optimal table for the primal problem was
x1 x2 s1 s2 RHS BV Ratio
R1 − 23 N.R2 0 1 1
2 − 21 2 x2 = 2
N.R2 = 34 R2 1 0 − 14 3
4 3 x1 = 3
R3 + 43 N.R2 0 0 2 1 32 z=32
Using this we obtain the dual solution as
2y1 + 2y2 − 6 = 0
3y1 + y2 − 7 = 0
solve the two simultaneously to obtain
y1 = 2
y2 = 1
and thus
z = 32
Exercise
Find the solution of the LP using the simplex method, obtain the dual and hence obtain the solution
of the dual.
4
3. Adding a new activity.
To carry out sensitivity analysis we shall use the Linear programming problem below. The optimal
solution is first obtained before carrying out sensitivity analysis.Given the LPP
x1 x2 x3 s1 s2 s3 RHS BV Ratio
48
R1 8 6 1 1 0 0 48 s1 = 48 8 = 6
R2 4 2 1.5 0 1 0 20 s2 = 20 20 4 =5
8
R3 2 1.5 0.5 0 0 1 8 s3 = 8 2 =4
R0 = z j − c j -60 -30 -20 0 0 0 0 z=0
x1 x2 x3 s1 s2 s3 RHS BV Ratio
R1 − 8N.R3 0 0 -1 1 0 -4 16 s1 = 16 −
4
R2 − 4N.R3 0 -1 0.5 0 1 -2 4 s2 = 4 0.5 = 8
R3 4
N.R3 = 2 1 0.75 0.25 0 0 0.5 4 x1 = 4 0.25 = 16
R0 + 60N.R3 0 15 -5 0 0 30 240 z=240
x1 x2 x3 s1 s2 s3 RHS BV Ratio
R1 + N.R2 0 -2 0 1 2 -8 24 s1 = 24
N.R2 = 2R2 0 -2 1 0 2 -4 8 x3 = 8
R3 − 0.25N.R2 1 1.25 0 0 -0.5 1.5 2 x1 = 2
R0 + 5N.R2 0 5 0 0 10 10 280 z=280
5
In the second table R0 = −30 − ∆ + 60(0.75) = 15 − ∆ under x2
In the third table R0 = −15 − ∆ + 5(−2) = 5 − ∆ under x2
But for the solution to be optimal all the values in R0 should be positive or 0. Therefore 5 − ∆ ≥ 0
which implies that 0 ≤ ∆ ≤ 5
This implies that if the price of x2 is increased or decreased by 5 or less,the solution remains op-
timal.i.e the solution remains optimal for 30 ≤ c2 ≤ 35 and z-value remains z=280.
But for the solution to be optimal all the values in R0 should be positive or 0. Therefore
5 + 1.25∆ ≥ 0
1.25∆ ≥ −5
∆ ≥ −4
10 − 0.5∆ ≥ 0
0.5∆ ≤ 10
∆ ≤ 20
10 + 1.5∆ ≥ 0
1.5∆ ≥ −10
20
∆≥−
3
The solution remains optimal IFF the change −4 ≤ ∆ ≤ 20 i.e the solution remains optimal for 56 ≤
c1 ≤ 80 but the z-value changes to z=280 + 2∆.
6
RHS
24 + 2∆
8 + 2∆
2 − 0.5∆
For it to be non-negative then
24 + 2∆ ≥ 0
∆ ≥ −12
8 + 2∆ ≥ 0
∆ ≥ −4
2 − 0.5∆ ≥ 0
∆≤4
The solution remains optimal IFF the change −4 ≤ ∆ ≤ 4 The objective function also changes to
280 + 10∆
i.e the solution remains optimal for 16 ≤ b2 ≤ 24 and the z-value changes to z=280 + 10∆. NOTE:
Shadow price is the amount by which the z value is improved if we increase constraint i by 1. If the
RHS of a constraint i changes by ∆ in the original formulation, the optimal objective value changes
by λi∗ ∆. λ1∗ = 0 can be found in R0 of the optimal table corresponding to s1 , λ2∗ = 10 can be found
in R0 of the optimal table corresponding to s2 and λ3∗ = 10 can be found in R0 of the optimal table
corresponding to s3 .
The only variable in R0 that can have a negative coefficient is x4 . To make x4 in the objective function
positive in the optimal table we reduce RHS of constraint 1 by x4 , constraint 2 by x4 and constraint 3
by x4 thus making s1 = x4 , s2 = x4 and s3 = x4 . The overall effect is to reduce the objective function
by
λ1∗ (x4 ) + λ2∗ (x4 ) + λ3∗ (x4 ) = 20(x4 )
The new objective function thus becomes 15x4 − 20x4 = −5x4 which is negative and thus not optimal.
This means that introducing a new variable x4 decreases revenue by 5.
Example
Using the LPP in the example above,
1. Show that the current solution remains optimal if c3 , satisfies 15 ≤ c3 ≤ 22.5. If c3 = 21, find
the new optimal solution.
7
2. Show that the current solution remains optimal if b1 ≥ 24. If b1 = 30, find the new optimal
solution.
3. Suppose a new activity is added with a profit of $36 and coefficient 6,2,and 2 in the 1st, 2nd
and 3rd constraints respectively. Should this new activity be added?
Solution
1. c3 is the cost coefficient of a basic variable x3 . To find for what values of c3 the solution will
remain optimal, let c3 = 20 + ∆ where ∆ is the change. The R0 changes in the tables as follows;
In the initial table
But for the solution to remain optimal all values in R0 should be positive or 0. Therefore
5 − 2∆ ≥ 0
∆ ≤ 2.5
10 + 2∆ ≥ 0
∆ ≥ −5
10 − 4∆ ≥ 0
∆ ≤ 2.5
The solution remains optimal IFF the change −5 ≤ ∆ ≤ 2.5 i.e. the solution remains optimal
for 15 ≤ c3 ≤ 22.5
For c3 = 21 then ∆ = 21 − 20 = 1, thus the new solution is still x1 = 2, x2 = 0, x3 = 8 but z
changes to z = 280 + 8 = 288
2. For the constraint 1 b1 then we use the column for s1 in the optimal table.The RHS becomes
RHS
24 + ∆
8 + 0∆
2 + 0∆
24 + ∆ ≥ 0
∆ ≥ −24
The solution remains optimal IFF the change ∆ ≥ −24 The objective function also changes to
280 + 0∆
i.e the solution remains optimal for b1 ≥ 24 and the z-value remains z=280.
For b1 = 30 then ∆ = 30 − 48 = −18 which satisfies ∆ ≥ −24 , thus the new solution is still
8
x1 = 2, x2 = 0, x3 = 8 and z=280.
The only variable in R0 that can have a negative coefficient is x4 . To make x4 in the objective
function positive in the optimal table we reduce RHS of constraint 1 by 6x4 , constraint 2 by 2x4
and constraint 3 by 2x4 thus making s1 = 6x4 , s2 = 2x4 and s3 = 2x4 . The overall effect is to
reduce the objective function by
The new objective function thus becomes 36x4 − 40x4 = −4x4 which is negative and thus not
optimal. This means that introducing a new variable x4 decreases revenue by 4 and thus x4
should not be produced.
Exercise
1. From the example in sensitivity analysis
Max z = 4A + 6B + 10C + 9D
Subject to 3A + 4B + 8C + 6D ≤ 400
6A + 2B + 5C + 8D ≤ 400
With A, B,C, D ≥ 0
A B C D s1 s2 RHS
R1 0.75 1 2 1.5 0.25 0 100
The optimal table is given as
R2 4.5 0 1 5 -0.5 1 200
R0 0.5 0 2 0 1.5 0 600
i How many units of A, B, C, D should be produced in order to maximize profit?
9
ii Assume that 20 units of C have been produced by mistake, what is the resulting decrease
in profit?
iii What is the reduced cost of changing the RHS of the first constraint?
iv In what range can the RHS of the first constraint vary without changing the optimality?
v Management is considering the production of a new product E that would require 2 units
in the first constraint and 10 units in the second constraint. What is the minimum profit
margin needed on this new product to make it worth producing?
10