linear programming duality
TRANSCRIPT
CS6501: Topics in Learning and Game Theory(Fall 2019)
Linear Programming Duality
Instructor: Haifeng Xu
Slides of this lecture is adapted from Shaddin Dughmi athttps://www-bcf.usc.edu/~shaddin/cs675sp18/index.html
2
รRecap and Weak Duality
รStrong Duality and Its Proof
รConsequence of Strong Duality
Outline
3
Linear Program (LP)
minimize (or maximize) ๐" โ ๐ฅsubject to ๐& โ ๐ฅ โค ๐& โ๐ โ ๐ถ-
๐& โ ๐ฅ โฅ ๐& โ๐ โ ๐ถ/๐& โ ๐ฅ = ๐& โ๐ โ ๐ถ1
General form:
maximize ๐" โ ๐ฅsubject to ๐& โ ๐ฅ โค ๐& โ๐ = 1,โฏ ,๐
๐ฅ6 โฅ 0 โ๐ = 1,โฏ , ๐
Standard form:
4
Application: Optimal Production
ร ๐ products, ๐ raw materials
รEvery unit of product ๐ uses ๐&6 units of raw material ๐
รThere are ๐& units of material ๐ availableรProduct ๐ yields profit ๐6 per unit
รFactory wants to maximize profit subject to available raw materials
Can be formulated as an LP in standard form
max ๐" โ ๐ฅs.t. โ6;-< ๐&6 ๐ฅ6 โค ๐&, โ๐ โ [๐]
๐ฅ6 โฅ 0, โ๐ โ [๐]
5
Primal and Dual Linear Program
max ๐" โ ๐ฅs.t. โ6;-< ๐&6 ๐ฅ6 โค ๐&, โ๐ โ [๐]
๐ฅ6 โฅ 0, โ๐ โ [๐]
Primal LP Dual LP
min ๐" โ ๐ฆs.t. โ&;-@ ๐&6 ๐ฆ& โฅ ๐6, โ๐ โ [๐]
๐ฆ& โฅ 0, โ๐ โ [๐]
Dual LP corresponds to the buyerโs optimization problem, as follows:รBuyer wants to directly buy the raw material
รDual variable ๐ฆ& is buyerโs proposed price per unit of raw material ๐รDual price vector is feasible if factory is incentivized to sell materials
รBuyer wants to spend as little as possible to buy raw materials
Economic Interpretation:
6
Primal and Dual Linear Program
max ๐" โ ๐ฅs.t. โ6;-< ๐&6 ๐ฅ6 โค ๐&, โ๐ โ [๐]
๐ฅ6 โฅ 0, โ๐ โ [๐]
Primal LP Dual LP
min ๐" โ ๐ฆs.t. โ&;-@ ๐&6 ๐ฆ& โฅ ๐6, โ๐ โ [๐]
๐ฆ& โฅ 0, โ๐ โ [๐]
Upperbound Interpretation:
Dual LP can be interpreted as finding best upperbound for the primalร Multiplying each row ๐ of primal by ๐ฆ& and summing the constraints
ร Goal: find the best such ๐ฆ to get the smallest upper bound
7
ร So far, mainly writing the Dual based on syntactic rules
ร Next, will show Primal and Dual are inherently related
8
Weak Duality
max ๐A โ ๐ฅs.t. ๐ด๐ฅ โค ๐
๐ฅ โฅ 0
Primal LPmin ๐A โ ๐ฆs.t. ๐ดA๐ฆ โฅ ๐
๐ฆ โฅ 0
Dual LP
Theorem [Weak Duality]: For any primal feasible ๐ฅ and dualfeasible ๐ฆ, we have ๐" โ ๐ฅ โค ๐" โ ๐ฆ
Corollary:ร If primal is unbounded, dual is infeasibleร If dual is unbounded, primal is infeasibleร If primal and dual are both feasible, then
OPT(primal) โค OPT(dual)
obj value of dual
obj value of primal
9
Weak Duality
max ๐A โ ๐ฅs.t. ๐ด๐ฅ โค ๐
๐ฅ โฅ 0
Primal LPmin ๐A โ ๐ฆs.t. ๐ดA๐ฆ โฅ ๐
๐ฆ โฅ 0
Dual LP
Theorem [Weak Duality]: For any primal feasible ๐ฅ and dualfeasible ๐ฆ, we have ๐" โ ๐ฅ โค ๐" โ ๐ฆ
Corollary: If ๐ฅ is primal feasible and ๐ฆ is dualfeasible, and ๐" โ ๐ฅ = ๐" โ ๐ฆ, then both are optimal.
obj value of dual
obj value of primal
10
Interpretation of Weak Duality
Economic Interpretation: If prices of raw materials are set such that there is incentive to sell raw materials directly, then factoryโs total revenue from sale of raw materials would exceed its profit from any production.
Upperbound Interpretation: The method of rescaling and summing rows of the Primal indeed givens an upper bound of the Primalโs objective value (well, self-evidentโฆ).
11
Proof of Weak Duality
max ๐A โ ๐ฅs.t. ๐ด๐ฅ โค ๐
๐ฅ โฅ 0
Primal LPmin ๐A โ ๐ฆs.t. ๐ดA๐ฆ โฅ ๐
๐ฆ โฅ 0
Dual LP
๐ฆ" โ ๐ โฅ ๐ฆ" โ ๐ด๐ฅ = ๐ฅ" โ ๐ด"๐ฆ โฅ ๐ฅ" โ ๐
12
รRecap and Weak Duality
รStrong Duality and Its Proof
รConsequence of Strong Duality
Outline
13
Strong Duality
Theorem [Strong Duality]: If either the primal or dual is feasibleand bounded, then so is the other and OPT(primal) = OPT(dual).
obj value of primal
obj value of dual
John von Neumann
โฆ I thought there was nothing worth publishing until the Minimax Theorem was proved.
14
Interpretation of Strong Duality
Economic Interpretation: There exist raw material prices such that the factory is indifferent between selling raw materials or products.
Upperbound Interpretation: The method of scaling and summing constraints yields a tight upperbound for the primal objective value.
15
Proof of Strong Duality
16
Projection Lemma
Weierstrassโ Theorem: Let ๐ be a compact set, and let ๐(๐ง) be acontinuous function on ๐ง. Then min{ ๐(๐ง) โถ ๐ง โ ๐ } exists.
๐ง
๐(๐ง)
17
Projection Lemma
Weierstrassโ Theorem: Let ๐ be a compact set, and let ๐(๐ง) be acontinuous function on ๐ง. Then min{ ๐(๐ง) โถ ๐ง โ ๐ } exists.
Projection Lemma: Let ๐ โ โ@ be a nonempty closed convex setand let ๐ฆ โ ๐. Then there exists ๐งโ โ ๐ with minimum ๐/ distancefrom ๐ฆ. Moreover, โ ๐ง โ ๐ we have ๐ฆ โ ๐งโ "(๐ง โ ๐งโ) โค 0.
๐ฆ ๐งโ
๐งProof: homework exercise
๐
18
Separating Hyperplane Theorem
Theorem: Let ๐ โ โ@ be a nonempty closed convex set and let๐ฆ โ ๐. Then there exists a hyperplane ๐ผ" โ ๐ง = ๐ฝ that strictlyseparates ๐ฆ from ๐. That is, ๐ผ" โ ๐ง โฅ ๐ฝ, โ ๐ง โ ๐ and ๐ผ" โ ๐ฆ < ๐ฝ.
๐ฆ ๐งโ
๐ง
Proof: choose ๐ผ = ๐งโ โ ๐ฆ and ๐ฝ = ๐ผ โ ๐งโ and use projection lemmaร Homework exercise
๐ผ" โ ๐ง = ๐ฝ
๐๐ผ
19
Farkasโ LemmaFarkasโ Lemma: Let ๐ด โ โ@ร< and ๐ โ โ@, then exactly one ofthe following two statements holds:a) There exists ๐ฅ โ โ< such that ๐ด๐ฅ = ๐ and ๐ฅ โฅ 0b) There exists y โ โ@ such that ๐ด"๐ฆ โฅ 0 and ๐"๐ฆ < 0
Case a):
20
Farkasโ LemmaFarkasโ Lemma: Let ๐ด โ โ@ร< and ๐ โ โ@, then exactly one ofthe following two statements holds:a) There exists ๐ฅ โ โ< such that ๐ด๐ฅ = ๐ and ๐ฅ โฅ 0b) There exists y โ โ@ such that ๐ด"๐ฆ โฅ 0 and ๐"๐ฆ < 0
Case a):
21
Farkasโ LemmaFarkasโ Lemma: Let ๐ด โ โ@ร< and ๐ โ โ@, then exactly one ofthe following two statements holds:a) There exists ๐ฅ โ โ< such that ๐ด๐ฅ = ๐ and ๐ฅ โฅ 0b) There exists y โ โ@ such that ๐ด"๐ฆ โฅ 0 and ๐"๐ฆ < 0
Case b):
22
Farkasโ Lemma
Geometric interpretation:
Farkasโ Lemma: Let ๐ด โ โ@ร< and ๐ โ โ@, then exactly one ofthe following two statements holds:a) There exists ๐ฅ โ โ< such that ๐ด๐ฅ = ๐ and ๐ฅ โฅ 0b) There exists y โ โ@ such that ๐ด"๐ฆ โฅ 0 and ๐"๐ฆ < 0
Z๐-
Z๐/
Z๐6 is ๐โth column of ๐ด๐
a) ๐ is in the cone
23
Farkasโ Lemma
Geometric interpretation:
Farkasโ Lemma: Let ๐ด โ โ@ร< and ๐ โ โ@, then exactly one ofthe following two statements holds:a) There exists ๐ฅ โ โ< such that ๐ด๐ฅ = ๐ and ๐ฅ โฅ 0b) There exists y โ โ@ such that ๐ด"๐ฆ โฅ 0 and ๐"๐ฆ < 0
Z๐-
Z๐/
Z๐6 is ๐โth column of ๐ด
๐a) ๐ is in the coneb) ๐ is not in the cone, and there exists a hyperplane with direction ๐ฆ
that separates ๐ from the cone
๐ฆ
24
Farkasโ Lemma
Proof: ร Cannot both hold; Otherwise, yields contradiction as follows:
ร Next, we prove if (a) does not hold, then (b) must holdโข This implies the lemma
Farkasโ Lemma: Let ๐ด โ โ@ร< and ๐ โ โ@, then exactly one ofthe following two statements holds:a) There exists ๐ฅ โ โ< such that ๐ด๐ฅ = ๐ and ๐ฅ โฅ 0b) There exists y โ โ@ such that ๐ด"๐ฆ โฅ 0 and ๐"๐ฆ < 0
= ๐ฆ" โ ๐ด๐ฅ = ๐ฆ" โ ๐ < 0.0 โค (๐ด"๐ฆ)" โ ๐ฅ
25
Farkasโ Lemma
รConsider Z = {๐ด๐ฅ: ๐ฅ โฅ 0} so that ๐ is closed and convexร(a) does not hold โ ๐ โ ๐รBy separating hyperplane theorem, there exists hyperplane ๐ผ โ ๐ง = ๐ฝ such that ๐ผ" โ ๐ง โฅ ๐ฝ for all ๐ง โ ๐ and ๐ผ" โ ๐ < ๐ฝ
รNote 0 โ ๐, therefore ๐ฝ โค ๐ผ" โ 0 = 0 and thus ๐ผ" โ ๐ < 0ร๐ผ"๐ด๐ฅ โฅ ๐ฝ for any ๐ฅ โฅ 0 implies ๐ผ"๐ด โฅ 0 since ๐ฅ can be arbitrary
largeรLetting ๐ผ be our ๐ฆ yields the lemma
Farkasโ Lemma: Let ๐ด โ โ@ร< and ๐ โ โ@, then exactly one ofthe following two statements holds:a) There exists ๐ฅ โ โ< such that ๐ด๐ฅ = ๐ and ๐ฅ โฅ 0b) There exists y โ โ@ such that ๐ด"๐ฆ โฅ 0 and ๐"๐ฆ < 0
Claim: if (a) does not hold, then (b) must hold.
26
An Alternative of Farkasโ LemmaFollowing corollary of Farkasโ lemma is more convenient for our proof
Corollary: Exactly one of the following systems holds:
โ ๐ฅ โ โ<, s.t.๐ด โ ๐ฅ โค ๐๐ฅ โฅ 0
โ ๐ฆ โ โ@, s.t.๐ดA โ ๐ฆ โฅ 0๐A โ ๐ฆ < 0๐ฆ โฅ 0
Compare to the original version
โ ๐ฅ โ โ<, s.t.๐ด โ ๐ฅ = ๐๐ฅ โฅ 0
โ ๐ฆ โ โ@, s.t.๐ดA โ ๐ฆ โฅ 0๐A โ ๐ฆ < 0
27
An Alternative of Farkasโ Lemma
Corollary: Exactly one of the following systems holds:
โ ๐ฅ โ โ<, s.t.๐ด โ ๐ฅ โค ๐๐ฅ โฅ 0
โ ๐ฆ โ โ@, s.t.๐ดA โ ๐ฆ โฅ 0๐A โ ๐ฆ < 0๐ฆ โฅ 0
Proof: Apply Fakasโ lemma to the following linear systems
โ ๐ฅ โ โ<, s.t.๐ด โ ๐ฅ + ๐ผ โ ๐ = ๐๐ฅ, ๐ โฅ 0
โ ๐ฆ โ โ@, s.t.๐ดA โ ๐ฆ โฅ 0๐ผ โ ๐ฆ โฅ 0๐A โ ๐ฆ < 0
Following corollary of Farkasโ lemma is more convenient for our proof
28
Proof of Strong Duality
ProofรDual of the dual is primal; so w.l.o.g assume primal is feasible and
bounded
รWeak duality yields OPT(primal) โค OPT(dual) รNext we prove the converse, i.e., OPT(primal) โฅ OPT(dual)
max ๐A โ ๐ฅs.t. ๐ด๐ฅ โค ๐
๐ฅ โฅ 0
Primal LPmin ๐A โ ๐ฆs.t. ๐ดA๐ฆ โฅ ๐
๐ฆ โฅ 0
Dual LP
Theorem [Strong Duality]: If either the primal or dual is feasibleand bounded, then so is the other and OPT(primal) = OPT(dual).
29
Proof of Strong Duality
รWe prove if OPT(primal)< ๐ฝ for some ๐ฝ, then OPT(dual)< ๐ฝรApply Farkasโ lemma to the following linear system
max ๐A โ ๐ฅs.t. ๐ด๐ฅ โค ๐
๐ฅ โฅ 0
Primal LPmin ๐A โ ๐ฆs.t. ๐ดA๐ฆ โฅ ๐
๐ฆ โฅ 0
Dual LP
โ๐ฅ โ โ< such that๐ด๐ฅ โค ๐โ๐A โ ๐ฅ โค โ๐ฝ๐ฅ โฅ 0
โ๐ฆ โ โ@ and ๐ง โ โ๐ดA๐ฆ โ ๐๐ง โฅ 0๐"๐ฆ โ ๐ฝ๐ง < 0๐ฆ, ๐ง โฅ 0
รBy assumption, the first system is infeasible, so the second must holdโข If ๐ง > 0, can rescale (๐ฆ, ๐ง) to make ๐ง = 1, yielding OPT(dual)< ๐ฝโข If ๐ง = 0, then system ๐ดA๐ฆ โฅ 0, ๐"๐ฆ < 0, ๐ฆ โฅ 0 feasible. Farkasโ lemma implies
that system ๐ด๐ฅ โค ๐, ๐ฅ โฅ 0 is infeasible, contradicting theorem assumption.
30
รRecap and Weak Duality
รStrong Duality and Its Proof
รConsequence of Strong Duality
Outline
31
Complementary Slackness
max ๐A โ ๐ฅs.t. ๐ด๐ฅ โค ๐
๐ฅ โฅ 0
Primal LPmin ๐A โ ๐ฆs.t. ๐ดA๐ฆ โฅ ๐
๐ฆ โฅ 0
Dual LP
ร ๐ & = ๐ โ ๐ด๐ฅ & is the ๐โth primal slack variableร ๐ก6 = ๐ด"๐ฆ โ ๐ 6 is the ๐โth dual slack variable
Complementary Slackness:๐ฅ and ๐ฆ are optimal if and only if they are feasible andร ๐ฅ6๐ก6 = 0 for all j = 1,โฏ ,๐ร ๐ฆ&๐ & = 0 for all ๐ = 1,โฏ , ๐
Remark: can be used to recover optimal solution of the primal from optimal solution of the dual (very useful in optimization).
32
Economic Interpretation of Complementary Slackness: Given the optimal production and optimal raw material pricesร It only produces products for which profit equals raw material
costร A raw material is priced greater than 0 only if it is used up in
the optimal production
max ๐" โ ๐ฅs.t. โ6;-< ๐&6 ๐ฅ6 โค ๐&, โ๐ โ [๐]
๐ฅ6 โฅ 0, โ๐ โ [๐]
Primal LP Dual LP
min ๐" โ ๐ฆs.t. โ&;-@ ๐&6 ๐ฆ& โฅ ๐6, โ๐ โ [๐]
๐ฆ& โฅ 0, โ๐ โ [๐]
33
Proof of Complementary Slackness
max ๐A โ ๐ฅs.t. ๐ด๐ฅ โค ๐
๐ฅ โฅ 0
Primal LPmin ๐A โ ๐ฆs.t. ๐ดA๐ฆ โฅ ๐
๐ฆ โฅ 0
Dual LP
34
Proof of Complementary Slackness
ร Add slack variables into both LPs
max ๐A โ ๐ฅs.t. ๐ด๐ฅ + ๐ = ๐
๐ฅ, ๐ โฅ 0
Primal LPmin ๐A โ ๐ฆs.t. ๐ดA๐ฆ โ ๐ก = ๐
๐ฆ, ๐ก โฅ 0
Dual LP
๐ฆ"๐ โ ๐ฅ"๐ = ๐ฆ" ๐ด๐ฅ + ๐ โ ๐ฅ" ๐ด"๐ฆ โ ๐ก = ๐ฆ"๐ + ๐ฅ"๐ก
35
Proof of Complementary Slackness
ร Add slack variables into both LPs
ร For any feasible ๐ฅ, ๐ฆ, the gap between primal and dual objectivevalue is precisely the โaggregated slacknessโ ๐ฆ"๐ + ๐ฅ"๐ก
ร Strong duality implies ๐ฆ"๐ + ๐ฅ"๐ก = 0 for the optimal ๐ฅ, ๐ฆ.
ร Since ๐ฅ, ๐ , ๐ฆ, ๐ก โฅ 0, we have ๐ฅ6๐ก6 = 0 for all j and ๐ฆ&๐ & = 0 for all ๐.
max ๐A โ ๐ฅs.t. ๐ด๐ฅ + ๐ = ๐
๐ฅ, ๐ โฅ 0
Primal LPmin ๐A โ ๐ฆs.t. ๐ดA๐ฆ โ ๐ก = ๐
๐ฆ, ๐ก โฅ 0
Dual LP
๐ฆ"๐ โ ๐ฅ"๐ = ๐ฆ" ๐ด๐ฅ + ๐ โ ๐ฅ" ๐ด"๐ฆ โ ๐ก = ๐ฆ"๐ + ๐ฅ"๐ก