0% found this document useful (0 votes)
78 views25 pages

dualityAndSensitivity PDF

The primal problem seeks to maximize the objective function of 20x1 + 30x2 + 25x3 + 40x4 subject to the following constraints: x1 + x2 + x3 ≤ 4 2x1 + x2 + 3x3 + x4 ≤ 8 x1, x2, x3, x4 ≥ 0 The dual problem seeks to minimize the objective function of 4y1 + 8y2 subject to the following constraints: 20y1 + 2y2 ≥ 20 30y1 + y2 ≥ 30 25y1 + 3y2 ≥ 25 40y1 + y2 ≥ 40 y1, y2 ≥

Uploaded by

sunil modi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
78 views25 pages

dualityAndSensitivity PDF

The primal problem seeks to maximize the objective function of 20x1 + 30x2 + 25x3 + 40x4 subject to the following constraints: x1 + x2 + x3 ≤ 4 2x1 + x2 + 3x3 + x4 ≤ 8 x1, x2, x3, x4 ≥ 0 The dual problem seeks to minimize the objective function of 4y1 + 8y2 subject to the following constraints: 20y1 + 2y2 ≥ 20 30y1 + y2 ≥ 30 25y1 + 3y2 ≥ 25 40y1 + y2 ≥ 40 y1, y2 ≥

Uploaded by

sunil modi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 25

Duality Theory

Ankur Sinha, PhD


Production and Quantitative Methods
Indian Institute of Management Ahmedabad
Gujarat India
Resouce Allocation vs Resource Valuation

• Until now the problems that we considered were resource


allocation (primal) problems
• Corresponding to every resource allocation problem there
exists an equivalent resource valuation (dual) problem
• In case of linear programs, the optimal solution of a primal
and the corresponding dual problem coincide
• Every linear program can be converted into the dual form
Insight Primal-Dual

• Suppose that a farmer has L km2 of land on which he intends to plant rice and wheat. The
farmer has F kilograms of fertilizers, and P kilograms of pesticides.
– Available resources: Land (L), Fertilizer (F) and pesticide (P)

• Each square kilometer of rice requires FR kilograms of fertilizer and PR kilograms of pesticide,
while each square kilometer of wheat requires FW kilograms of fertilizer and PW kilograms of
pesticide. If we denote the area of land planted with rice and wheat by xR and xW then the
constraints can be written as follows:
– xR + xW ≤ L
– FR xR + FW xW ≤ F
– PR xR + PW xW ≤ P
– x R ≥ 0, x W ≥ 0

• Let CR be the contribution of rice per square kilometer, and CW be the contribution of wheat
per square kilometer. Then the objective function can be written as:
– CR xR + CW xW
Primal Formulation

Maximize CR xR + CW xW
Subject to
xR + xW ≤ L
FR xR + FW xW ≤ F
PR xR + PW xW ≤ P
xR ≥ 0, xW ≥ 0

• What are we trying to do in the above formulation?


– Allocate resources in an optimal manner to maximize the revenues
– Revenue maximization or resource allocation
Rethink

• Assume now that a third party decides to buy the resources from the
farmer and they want to set unit prices yL, yF and yP for each of the inputs
land, fertilizer and pesticide, respectively. Their objective is to minimize
the total cost of procuring the set amounts of inputs:
– L yL + F yF + P yP

• The farmer would accept the deal only if the resources are valued such
that it provides the farmer with a lower bound on the unit price of each
of his crops (outputs), CR for rice and CW for wheat. Therefore, the
constraints are as follows:
– yL + FR yF + PR yP ≥ CR
– yL + FW yF + PW yP ≥ CW
– yL ≥ 0, yF ≥ 0, yP ≥ 0
Dual Formulation

Minimize L yL + F yF + P yP
Subject to
yL + FR yF + PR yP ≥ CR
yL + FW yF + PW yP ≥ CW
yL ≥ 0, yF ≥ 0, yP ≥ 0

• What are we trying to do in the above formulation?


– Value the resources in an optimal manner to minimize expenditure
– Expenditure minimization or resource valuation
– Primal problem involves physical quantities while dual problem involves economic values
– Optimal value of a dual variable represents the shadow price of the corresponding resource
Standard form (maximization)

Writing Dual of a Primal

• Write your primal in the standard form (maximization)


– Objective function is to be maximized
– All variables should be non-negative
– All constraints should be of “less than or equal to” type
• For example, the following problem is in standard form

Max Z = 3x1 + 5x2 ,


s.t.
x1 £4
2 x2 £ 12
3 x1 + 2 x2 £ 18
x1 ³ 0, x 2 ³ 0
Standard form (maximization)

Writing Dual of a Primal

Primal Problem Dual Problem

Max 3 x1 + 5 x2 , Min 4 y1 + 12 y2 + 18 y3 ,
Subject to Subject to
x1 £ 4 y1 + 3 y3 ³ 3
2 x2 £ 12 2 y2 + 2 y3 ³ 5
3 x1 + 2 x2 £ 18 y1 ³ 0, y 2 ³ 0, y3 ³ 0
x1 ³ 0, x2 ³ 0
Standard form (maximization)

Flip and Switch


Primal Problem Dual Problem

é x1 ù é y1 ù
Max Z = [3,5]ê ú, Min W = [4,12,18]êê y2 úú
ë x2 û
êë y3 úû
Subject to Switch
Subject to
é1 0ù é4ù é y1 ù
ê0 2ú é x1 ù £ ê12ú é 1 0 3 ù ê ú é3ù
ê úêx ú ê ú ê0 2 2ú ê y2 ú ³ ê5ú
êë3 2úû ë 2 û êë18úû ë ûê y ú ë û
ë 3û
é y1 ù é0ù
é x1 ù é0ù ê y ú ³ ê0ú.
ê x ú ³ ê0ú. ê 2ú ê ú
Flip

ë 2û ë û êë y3 úû êë0úû
Standard form (maximization)

Writing Dual of a Primal


Primal in standard form Dual in standard form

Max c1x1 + c2 x2 +... + cn xn Min b1 y1 + b2 y2 +... + bm ym


s.t. a11 x1 + a12 x2 +...+ a1n xn £ b1 s.t. a11 y1 + a21 y2 +"+ am1 ym ³ c1
a21 x1 + a22 x2 +...+ a2 n xn £ b2 a12 y1 + a22 y2 +"+ am 2 ym ³ c2
... ... ... ... ... ... ... ...
... ... ... ... ... ... ... ...
am1 x1 + am 2 x2 +...+ amn xn £ bm a1n y1 + a2 n y2 +"+ amn ym ³ cn
x1 , x2 ,..., xn ³ 0 y1 , y2 , ! , ym ³ 0
Standard form (maximization)

What if Primal is not in standard form?

• Convert it into standard form as follows:


– If objective is Minimize 5 x1 - 2 x2
• Replace it by Maximize -5 x 1 + 2 x 2
– If a constraint is 4 x1 - 7 x2 ≥ 0
• Replace it by - 4 x 1 + 7 x 2 ≤ 0
– If a variable is negative x2 ≤ 0
• Define a new variable x 2’ = -x 2 which implies x 2’ ≥ 0, replace x 2 by -x 2’
– If x1 is unrestricted
• Define new variables u 1≥ 0, u 2 ≥ 0 such that x 1=u 1-u 2 , replace x 1 by u 1-u 2
– If a constraint is 3 x1 - 5 x2 = 0
• Replace it with two constraints, 3 x 1 - 5 x 2 ≤ 0, 3 x 1 - 5 x 2 ≥ 0
• Convert both to less than or equal to type 3 x 1 - 5 x 2 ≤ 0, - 3 x 1 + 5 x 2 ≤ 0
Standard form (minimization)

Writing Dual of a Primal

• Write your primal in the standard form (minimization)


– Objective function is to be minimized
– All variables should be non-negative
– All constraints should be of “greater than or equal to” type
– Note that it is same as going from dual to primal for standard form
(maximization)
Standard form (minimization)

Writing Dual of a Primal

Primal Problem Dual Problem

Min 4 y1 + 12 y2 + 18 y3 , Max 3 x1 + 5 x2 ,
Subject to Subject to
y1 + 3 y3 ³ 3 x1 £ 4
2 y2 + 2 y3 ³ 5 2 x2 £ 12
y1 ³ 0, y 2 ³ 0, y3 ³ 0 3 x1 + 2 x2 £ 18
x1 ³ 0, x2 ³ 0
Standard form (minimization)

Flip and Switch


Primal Problem Dual Problem

é y1 ù é x1 ù
Min W = [4,12,18]êê y2 úú
Max Z = [3,5]ê ú,
ë x2 û
êë y3 úû
Subject to Subject to
Switch

é y1 ù é1 0ù é4ù
é 1 0 3 ù ê ú é3ù ê0 2ú é 1 ù £ ê12ú
x
ê0 2 2ú ê y2 ú ³ ê5ú ê úêx ú ê ú
ë ûê y ú ë û
ë 3û êë3 2úû ë 2 û êë18úû

é y1 ù é0ù
ê y ú ³ ê0ú. é x1 ù é0ù
ê 2ú ê ú ê x ú ³ ê0ú.
Flip

êë y3 úû êë0úû ë 2û ë û
Some shortcuts

• If a variable in primal is free, make the corresponding


constraint in dual as equality
• If a constraint in primal is equality, make the corresponding
variable in dual as free
• If a constraint in primal is opposite of what is expected in the
standard form, then make the corresponding variable as non-
positive
• If a variable in primal is non-positive, then make the
corresponding constraint in dual opposite of what you
normally do in standard form
Standard form (maximization)

Write the dual


Primal Formulation

Max
20 x1 + 30 x2 + 25 x3 + 40 x4
s.t.
5 x1 + 3x2 - 5 x3 + 3x4 £ 25
9 x1 - 4 x2 + 8 x3 - 4 x4 ³ 10
2 x1 - 7 x2 - 6 x3 + 5 x4 = 15
x1 , x2 ³ 0, x3 free, x4 £ 0
Standard form (maximization)

Write the dual: Solution


Dual Formulation

Min 25 y1 + 10 y2 + 15 y3
s.t. 5 y1 + 9 y2 + 2 y3 ³ 20
3 y1 - 4 y2 - 7 y3 ³ 30
- 5 y1 + 8 y2 - 6 y3 = 25
3 y1 - 4 y2 + 5 y3 £ 40
y1 ³ 0, y2 £ 0, y3 free
Laws of Duality
q Weak Law of Duality: Each feasible solution for the primal (maximization)
problem has an objective value that is less than or equal to the objective
value of every feasible solution to the dual (minimization) problem.
• In other words: c T x £ bT y

• Proof: Ax £ b
cT £ ( AT y )T
Þ cT x £ ( AT y )T x = y T Ax £ y T b = bT y
Þ c T x £ bT y

Solutions to PRIMAL Solutions to DUAL

PRIMAL Optimal DUAL Optimal


DUALITY
GAP
Laws of Duality
q Strong Law of Duality:
• If the primal problem has a finite optimum, then at the optimum:
• Objective value of Primal = Objective value of Dual
• In other words: cT x* = bT y *

• Primal Unbounded è Dual Infeasible


• Primal Infeasible è Dual Unbounded or Infeasible

Daulity gap is zero in linear programs


Merton Trucks Revisited

• Write the dual of the primal and find the shadow prices.
Complementary Slackness
Consider at an optimal solution to the primal problem:

Primal Constraint Corresponding Dual Variable


(Shadow Price)
Non-binding (Slack≠0) 0
Binding (Slack=0) May be Non-zero

Slack ´ Shadow Price = 0

In other words: (Ax – b)i yi = 0

Dual of a dual is primal: Therefore, this also holds: (ATy – c)j xj = 0

Complementary slackness: The above conditions always holds at the


optimum

Both ways implication: If x and y satisfy the above complementary slackness


conditions then they are the optimal solutions
Complementary Slackness

In an optimal solution,

• If a resource is NOT completely used up, then the


corresponding shadow price is 0
• If shadow price is greater than 0, then the corresponding
resource IS completely used up.
• If a resource IS completely used up, then the corresponding
shadow price may EITHER be 0 OR positive.
• If shadow price is zero then the corresponding resource may
OR may not be completely
used up.
• It is IMPOSSIBLE that simultaneously the shadow price is
greater than 0 and the corresponding resource is NOT
completely used up.
When is both slack and shadow price 0?
When is both slack and shadow price 0?

Answer: In case of degeneracy.


Let us look at an example!
Primal degeneracy ≡ multiple optima in dual

Maximize 3000#$ + 5000# & Minimize 45008 1 + 60008 2 + 50008 3 + 45008 4


Subject to Subject to
2#$ + 2# & ≤ 4500 (,ℎ.#/01) 81 28 1 + 28 2 + 28 3 + 08 4 ≥ 3000
2#$ + 2# & ≤ 6000 82 28 1 + 28 2 + 08 3 + 38 4 ≥ 5000
2#$ + 4 & ≤ 5000 83 8 1, 8 2, 8 3, 8 4 ≥ 0
4 $ + 3# & ≤ 4500 84
#$ , # & ≥ 0

Optimal solutions
8 1 = 2000, 8 2 = 500, 8 3 = 0, 8 4 = 0
Degenerate
optimum

8 1 = 0, 8 2 = 1500, 8 3 = 0, 8 4 = 666 &⁄<

You might also like