Professional Documents
Culture Documents
W6 - Duality
W6 - Duality
𝑥𝑗 ≥ 0 (𝑗 = 1,2, … , 𝑛) 𝑦𝑖 ≥ 0 (𝑗 = 1,2, … , 𝑛)
The Dual of a Normal LP (3/3)
Example 1
From the previous Dakota problem
(omitting the 4th constraint), Its dual is
max 𝑧 = 60𝑥1 + 30𝑥2 + 20𝑥3 min 𝑤 = 48𝑦1 + 20𝑦2 + 8𝑦3
s.t. s.t.
8𝑥1 + 6𝑥2 + 𝑥3 ≤ 48 (lumber) 8𝑦1 + 4𝑦2 + 2𝑦3 ≥ 60 (desk)
4𝑥1 + 2𝑥2 + 1.5𝑥3 ≤ 20 (finishing) 6𝑦1 + 2𝑦2 + 1.5𝑦3 ≥ 30 (tables)
2𝑥1 + 1.5𝑥2 + 0.5𝑥3 ≤ 8 (carpentry) 𝑦1 + 1.5𝑥2 + 0.5𝑥3 ≥ 20 (chairs)
𝑥1, 𝑥2, 𝑥3 ≥ 0
𝑦1, 𝑦2, 𝑦3 ≥ 0
Normalizing a Non-Normal LP (1/3)
• Unfortunately, many LPs are not normal maximization or minimization
problems. For these cases, we need to “convert” them into a normal LP.
• For a maximization primal problem:
o Step 1: Multiply each ≥ constraint by multiplying −1, converting it into a ≤
constraint
o Step 2: Replace each equality constraint by two inequality constraints
o Step 3: Replace each urs variable 𝑥𝑖 by 𝑥𝑖 = 𝑥𝑖′ − 𝑥𝑖′′ , where 𝑥𝑖′ , 𝑥𝑖′′ ≥ 0.
• For a minimization primal problem:
o Step 1: Multiply each ≤ constraint by multiplying −1, converting it into a ≥
constraint
o Step 2: Replace each equality constraint by two inequality constraints
o Step 3: Replace each urs variable 𝑥𝑖 by 𝑥𝑖 = 𝑥𝑖′ − 𝑥𝑖′′ , where 𝑥𝑖′ , 𝑥𝑖′′ ≥ 0.
Normalizing a Non-Normal LP (2/3)
Example 2
Suppose for a non-normal max LP The normal max LP is
max 𝑧 = 2𝑥1 + 𝑥2 max 𝑧 = 2𝑥1 + 𝑥2′ − 𝑥2′′
s.t. s.t.
𝑥1 + 𝑥2 = 2 𝑥1 + 𝑥2′ − 𝑥2′′ ≤ 2
2𝑥1 − 𝑥2 ≥ 3 −𝑥1 − 𝑥2′ + 𝑥2′′ ≤ −2
𝑥1 − 𝑥2 ≤ 1 −2𝑥1 + 𝑥2′ − 𝑥2′′ ≤ −3
𝑥1 − 𝑥2′ + 𝑥2′′ ≤ 1
𝑥1 ≥ 0, 𝑥2 urs 𝑦1 urs, 𝑦2 ≤ 0, 𝑦3 ≥ 0
Finding Dual of a Non-Normal LP (3/4)
To find the dual of a non-normal minimization problem, we need to:
• For all ith ≤ primal constraint, the corresponding dual variable 𝑦𝑖 must
be nonpositive, or 𝑦𝑖 ≤ 0.
• For all ith = primal constraint, the corresponding dual variable 𝑦𝑖 must
be unrestricted to sign (urs).
• For all ith urs primal variable, the corresponding ith dual constraint must
be an equality constraint.
Finding Dual of a Non-Normal LP (4/4)
Example 5
Suppose for a non-normal min LP The dual is
min 𝑧 = 2𝑥1 + 4𝑥2 + 6𝑥3 max 𝑤 = 2𝑦1 + 𝑦2 + 𝑦3 + 3𝑦4
s.t. s.t.
𝑥1 + 2𝑥2 + 𝑥3 ≥ 2 𝑦1 + 𝑦2 + 2𝑦4 = 2
𝑥1 − 𝑥3 ≥ 1 2𝑦1 + 𝑦3 + 𝑦4 ≤ 4
𝑥2 + 𝑥3 = 1 𝑦1 − 𝑦2 + 𝑦3 ≤ 6
2𝑥1 + 𝑥2 ≤ 3
𝑥1 urs; 𝑥2 , 𝑥3 ≥ 0 𝑦1 , 𝑦2 ≥ 0, 𝑦3 urs, 𝑦4 ≤ 0
The Dual Theorem (1/5)
• The dual problem acts as a boundary for the value of its primal and there are
two kinds of duality: weak and strong duality.
• Let
𝑥1
𝑥2
𝐱= ⋮
𝑥𝑛
be a feasible solution to the primal and 𝐲 = 𝑦1 𝑦2 ⋯ 𝑦𝑚 be any feasible
solution to the dual and 𝑧 = 𝐜𝐱 and 𝑤 = 𝐲𝐛
• A weak duality is when the gap between 𝑧 and 𝑤 is greater than 0. For a
maximization problem, 𝑧 ≤ 𝑤 and for a minimization problem 𝑧 ≥ 𝑤
• However if, 𝒛 = 𝒘 then the duality is called strong duality.
• If a primal problem has an unbounded solution, then the dual will be
infeasible.
The Dual Theorem (2/5)
Primal and dual optimality must also follow the following. Let
𝑥1
𝑥2
𝐱= ⋮
𝑥𝑛
be a feasible solution to the primal and 𝐲 = 𝑦1 𝑦2 ⋯ 𝑦𝑚 be any
feasible solution to the dual. Then 𝐱 is primal optimal and 𝐲 is dual
optimal if and only if
𝑠𝑖 𝑦𝑖 = 0, (𝑖 = 1,2, … , 𝑚)
𝑒𝑗 𝑥𝑗 = 0, (𝑗 = 1,2, … , 𝑛)
This is called the complementary slackness theorem.
The Dual Theorem (3/5)
Suppose BV is an optimal basis for the primal. Then 𝑐𝐵𝑉 𝐵 −1 is an optimal
solution to the dual. Also, 𝑧ҧ = 𝑤.
ഥ
When we find the optimal solution to the primal by using the simplex
algorithm, we have also found the optimal solution to the dual.
• If the ith primal constraint is a ≤ constraint,
𝑦𝑖 = the coefficient of 𝑠𝑖 in primal optimal row 0
• If the ith primal constraint is a ≥ constraint,
𝑦𝑖 = − the coefficient of 𝑒𝑖 in primal optimal row 0
• If the ith primal constraint is a = constraint is equal to
𝑦𝑖 = (coefficient of 𝑎𝑖 in optimal row 0) − 𝑀 (if primal is max problem)
𝑦𝑖 = (coefficient of 𝑎𝑖 in optimal row 0) + 𝑀 (if primal is min problem)
The Dual Theorem (4/5)
Example 6
Consider the following primal LP max 𝑧 = 3𝑥1 + 2𝑥2 + 5𝑥3 , s.t. 𝑥1 + 3𝑥2 + 2𝑥3 ≤ 15;
2𝑥2 − 𝑥3 ≥ 5; 2𝑥1 + 𝑥2 − 5𝑥3 = 10; and 𝑥1 , 𝑥2 , 𝑥3 ≥ 0.
565 15 65 120
The optimal solution is 𝑧 = 23
, 𝑥3 = ,𝑥
23 2
= ,𝑥
23 1
= 23
, 𝑠1 = 𝑒2 = 𝑎2 = 𝑎3 = 0. And
the optimal tableau is
51 58 9 565
Its dual optimal solution is 𝑦1 = ,𝑦 =− ,𝑦 = ,𝑤 =
23 2 23 3 23 23
The Dual Theorem (5/5)
Example 7
Consider the following primal LP min 𝑧 = 3𝑥1 + 2𝑥2 + 𝑥3 , s.t. 𝑥1 + 𝑥2 + 𝑥3 ≥ 4;
𝑥2 − 𝑥3 ≤ 2; 𝑥1 + 𝑥2 + 2𝑥3 = 6; and 𝑥1 , 𝑥2 , 𝑥3 ≥ 0.
The optimal solution is 𝑧 = 6, 𝑥2 = 2, 𝑥3 = 2, 𝑥1 = 𝑒1 = 𝑠2 = 𝑎1 = 𝑎3 = 0. And the
optimal tableau is
• We can now apply the dual simplex method to this new problem.
• Row 4 will be the pivot row since it has the most negative RHS and 𝑥2
will be the entering variable.
Dual Simplex Method (7/7)
Find optimal solution after adding constraint
• After performing ERO, the new tableau will become
B.V 𝒛 𝒙𝟏 𝒙𝟐 𝒙𝟑 𝐬𝟏 𝐬𝟐 𝐬𝟑 𝐬𝟒 RHS
𝑧 1 0 0 0 0 10 10 5 275
𝑠1 0 0 0 0 1 2 −8 −2 26
𝑥3 0 0 0 1 0 2 −4 −2 10
𝑥1 0 1 0 0 0 −1/2 3/4 5/4 3/4
𝑥2 0 0 1 0 0 0 0 −1 1
• Since there are no negative RHS and the optimality condition is met,
then we have reached the new optimal solution.
Economic Interpretation of the Dual
Problem
• From the Dakota dual problem, suppose we want to purchase all their
resources (lumber, finishing hour, and carpentry hour).
• When we purchase, we always want to minimize the cost. Hence the
objective function of the dual is a minimization problem.
• However, to induce Dakota to sell their resource, we must convince them
that selling their resource is more profitable than producing their products.
For example, the price for 8 board feet of lumber, 4 finishing hours, and 2
carpentry hours must be higher than the price of a desk which is sold at 60$
each. This is expressed in the first constraint of the dual
8𝑦1 + 4𝑦2 + 2𝑦3 ≥ 60
• In summary, when the primal is a normal max problem, the dual variables are
related to the value of the resources available to the decision maker. For this
reason, the dual variables are often referred to as resource shadow prices.
Shadow Prices
• The shadow price of the ith constraint is the amount by which the
optimal z-value is improved if we increase 𝑏𝑖 by 1 (from 𝑏𝑖 to 𝑏𝑖 + 1),
assuming the current basis remains optimal.
• By using the Dual Theorem, we can easily determine the shadow price
of the ith constraint. To illustrate, we use the Dakota problem again.
• Let 𝑐𝐵𝑉 𝐵 −1 = 0 10 10 , or 𝑦1 = 0, 𝑦2 = 10, 𝑦3 = 10. From its dual
problem we know that the resources cost is given by 48𝑦1 + 20𝑦2 + 8𝑦3.
• What happens when 𝑏2 is increased by 1 unit i.e. 𝑏2=21? Then the dual
objective function will be 48𝑦1 + 21𝑦2 + 8𝑦3 and
48𝑦1 + 21𝑦2 + 8𝑦3 − 48𝑦1 + 20𝑦2 + 8𝑦3 = 𝑦2
• Since 𝑦2 = 10, this means changing one unit of 𝑏2 will improve 10 unit of
the objective function.
Duality and Sensitivity Analysis (1/4)
• Duality can be used as an alternative way for the following types of
sensitivity analysis:
o Changing the objective function coefficient of a nonbasic variable
o Changing the column of a nonbasic variable
o Adding a new activity
• Primal optimality and dual feasibility are equivalent, so we see that the
above changes will leave the current basis optimal if and only if the
current dual solution 𝑐𝐵𝑉 𝐵−1 remains dual feasible.
Duality and Sensitivity Analysis (2/4)
Changing the objective function coefficient of NBV
Consider to Dakota problem again. The optimal solution was 𝑧 = 280, 𝑠1 =
24, 𝑥3 = 8, 𝑥1 = 2, 𝑥2 = 𝑠2 = 𝑠3 = 0 and the optimal dual solution was 𝑦1 = 0, 𝑦2 =
10, 𝑦3 = 10.
Let 𝑐2 be the coefficient of 𝑥2 in the objective function. For what values of 𝑐2 will
the current basis remain optimal? Note that if 𝑥2 is changed then the second
dual constraint will also change while the other remains unchanged. The
second dual constraint is
6𝑦1 + 2𝑦2 + 1.5𝑦3 ≥ 𝑐2
If 𝑦1 = 0, 𝑦2 = 10, 𝑦3 = 10 satisfies the inequality then the dual feasibility (and
primal optimality) is maintained.
6(0) + 2(10) + 1.5(10) ≥ 𝑐2 or 𝑐2 ≤ 35
This shows that for 𝑐2 ≤ 35, the current basis remains optimal. Conversely, if 𝑐2 >
35, the current basis is no longer optimal.
Duality and Sensitivity Analysis (3/4)
Changing a Non-Basic Variable
Suppose we now 𝑐2 = 43, and each 𝑥2 (tables) requires 5 board feet of
lumber, 2 finishing hours, and 2 carpentry hours. The second dual
constraint is now
5𝑦1 + 2𝑦2 + 2𝑦3 ≥ 43
For 𝑦1 = 0, 𝑦2 = 10, 𝑦3 = 10 this dual constraint is not satisfied and the dual
feasibility (and primal optimality) is not maintained.
In terms of shadow price, will cost $40 but can be sold at $43. Dakota
can now increase their revenue by selling tables.
Thus, the current basis is no longer optimal, and 𝑥2 (tables) will be basic in
the new optimal solution.
Duality and Sensitivity Analysis (4/4)
Adding New Activity
Suppose Dakota is considering manufacturing footstools (𝑥4 ). A footstool
sells for $15 and uses 1 board foot of lumber, 1 finishing hour, and 1
carpentry hour. Does the current basis remain optimal?
The new dual constraint will be
𝑦1 + 𝑦2 + 𝑦3 ≥ 15