Linear Programming Duality

Post on 07-Apr-2022

9 views 0 download

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

𝑦"𝑏 βˆ’ π‘₯"𝑐 = 𝑦" 𝐴π‘₯ + 𝑠 βˆ’ π‘₯" 𝐴"𝑦 βˆ’ 𝑑 = 𝑦"𝑠 + π‘₯"𝑑

Thank You

Haifeng Xu University of Virginia

hx4ad@virginia.edu