CS672: Approximation Algorithms Spring 14 Introduction to Linear - - PowerPoint PPT Presentation

cs672 approximation algorithms spring 14 introduction to
SMART_READER_LITE
LIVE PREVIEW

CS672: Approximation Algorithms Spring 14 Introduction to Linear - - PowerPoint PPT Presentation

CS672: Approximation Algorithms Spring 14 Introduction to Linear Programming II Instructor: Shaddin Dughmi Outline Recall: Duality and Its Interpretations 1 Weak and Strong Duality 2 Consequences of Duality 3 Uses and Examples of Duality


slide-1
SLIDE 1

CS672: Approximation Algorithms Spring 14 Introduction to Linear Programming II

Instructor: Shaddin Dughmi

slide-2
SLIDE 2

Outline

1

Recall: Duality and Its Interpretations

2

Weak and Strong Duality

3

Consequences of Duality

4

Uses and Examples of Duality

5

Solvability of LP

slide-3
SLIDE 3

Outline

1

Recall: Duality and Its Interpretations

2

Weak and Strong Duality

3

Consequences of Duality

4

Uses and Examples of Duality

5

Solvability of LP

slide-4
SLIDE 4

Linear Programming Duality

“Flexible” Form:

Primal LP

maximize c⊺x subject to Ax b

Dual LP

minimize b⊺y subject to A⊺y = c y 0

Recall: Duality and Its Interpretations 1/21

slide-5
SLIDE 5

Linear Programming Duality

“Flexible” Form:

Primal LP

maximize c⊺x subject to Ax b

Dual LP

minimize b⊺y subject to A⊺y = c y 0 Packing/Covering form:

Primal LP

maximize c⊺x subject to Ax b x 0

Dual LP

minimize b⊺y subject to A⊺y c y 0

Recall: Duality and Its Interpretations 1/21

slide-6
SLIDE 6

Interpretation 1: Economic Interpretation

Primal LP

max n

j=1 cjxj

s.t. n

j=1 aijxj ≤ bi,

∀i ∈ [m]. xj ≥ 0, ∀j ∈ [n]. n products, m raw materials Every unit of product j uses aij units of raw material i There are bi units of material i available Product j yields profit cj per unit Facility wants to maximize profit

Recall: Duality and Its Interpretations 2/21

slide-7
SLIDE 7

Interpretation 1: Economic Interpretation

Primal LP

max n

j=1 cjxj

s.t. n

j=1 aijxj ≤ bi,

∀i ∈ [m]. xj ≥ 0, ∀j ∈ [n]. n products, m raw materials Every unit of product j uses aij units of raw material i There are bi units of material i available Product j yields profit cj per unit Facility wants to maximize profit

Dual LP

min m

i=1 biyi

s.t. m

i=1 aijyi ≥ cj,

∀j ∈ [n]. yi ≥ 0, ∀i ∈ [m]. yi is a proposed price per unit of raw material i Feasibility means facility has incentive to sell as opposed to produce Buyer wants to spend as little as possible to buy materials

Recall: Duality and Its Interpretations 2/21

slide-8
SLIDE 8

Interpretation 2: Finding the Best Upperbound

Primal LP

maximize c⊺x subject to Ax b x 0

Dual LP

minimize b⊺y subject to A⊺y c y 0 Multiplying each row i by yi and summing gives the inequality yT Ax ≤ yT b When yT A cT , we have cT x ≤ yT Ax ≤ yT b The dual LP can be thought of as trying to find the best upperbound on the primal that can be achieved by combining inequalities this way.

Recall: Duality and Its Interpretations 3/21

slide-9
SLIDE 9

Interpretation 3: Physical Forces

Apply force field c to a ball inside polytope Ax b.

Recall: Duality and Its Interpretations 4/21

slide-10
SLIDE 10

Interpretation 3: Physical Forces

Apply force field c to a ball inside polytope Ax b. Eventually, ball will come to rest against the walls of the polytope.

Recall: Duality and Its Interpretations 4/21

slide-11
SLIDE 11

Interpretation 3: Physical Forces

Apply force field c to a ball inside polytope Ax b. Eventually, ball will come to rest against the walls of the polytope. Wall aix ≤ bi applies some force −yiai to the ball

Recall: Duality and Its Interpretations 4/21

slide-12
SLIDE 12

Interpretation 3: Physical Forces

Apply force field c to a ball inside polytope Ax b. Eventually, ball will come to rest against the walls of the polytope. Wall aix ≤ bi applies some force −yiai to the ball Since the ball is still, cT =

i yiai = yT A.

Recall: Duality and Its Interpretations 4/21

slide-13
SLIDE 13

Interpretation 3: Physical Forces

Apply force field c to a ball inside polytope Ax b. Eventually, ball will come to rest against the walls of the polytope. Wall aix ≤ bi applies some force −yiai to the ball Since the ball is still, cT =

i yiai = yT A.

Dual can be thought of as trying to minimize “work”

i yibi to

bring ball back to origin by moving polytope

Recall: Duality and Its Interpretations 4/21

slide-14
SLIDE 14

Outline

1

Recall: Duality and Its Interpretations

2

Weak and Strong Duality

3

Consequences of Duality

4

Uses and Examples of Duality

5

Solvability of LP

slide-15
SLIDE 15

Weak Duality

Primal LP

maximize c⊺x subject to Ax b x 0

Dual LP

minimize b⊺y subject to A⊺y c y 0

Theorem (Weak Duality)

For every primal feasible x and dual feasible y, we have c⊺x ≤ b⊺y.

Corollary

If primal and dual both feasible and bounded, OPT(Primal) ≤ OPT(Dual) If primal is unbounded, dual is infeasible If dual is unbounded, primal is infeasible

Weak and Strong Duality 5/21

slide-16
SLIDE 16

Weak Duality

Primal LP

maximize c⊺x subject to Ax b x 0

Dual LP

minimize b⊺y subject to A⊺y c y 0

Theorem (Weak Duality)

For every primal feasible x and dual feasible y, we have c⊺x ≤ b⊺y.

Corollary

If x is primal feasible, and y is dual feasible, and c⊺x = b⊺y, then both are optimal.

Weak and Strong Duality 5/21

slide-17
SLIDE 17

Interpretation of Weak Duality

Economic Interpretation

If selling the raw materials is more profitable than making any individual product, then total money collected from sale of raw materials would exceed profit from production.

Weak and Strong Duality 6/21

slide-18
SLIDE 18

Interpretation of Weak Duality

Economic Interpretation

If selling the raw materials is more profitable than making any individual product, then total money collected from sale of raw materials would exceed profit from production.

Upperbound Interpretation

Self explanatory

Weak and Strong Duality 6/21

slide-19
SLIDE 19

Interpretation of Weak Duality

Economic Interpretation

If selling the raw materials is more profitable than making any individual product, then total money collected from sale of raw materials would exceed profit from production.

Upperbound Interpretation

Self explanatory

Physical Interpretation

Work required to bring ball back to origin by pulling polytope is at least potential energy difference between origin and primal optimum.

Weak and Strong Duality 6/21

slide-20
SLIDE 20

Proof of Weak Duality

Primal LP

maximize c⊺x subject to Ax b x 0

Dual LP

minimize b⊺y subject to A⊺y c y 0

c⊺x ≤ y⊺Ax ≤ y⊺b

Weak and Strong Duality 7/21

slide-21
SLIDE 21

Strong Duality

Primal LP

maximize c⊺x subject to Ax b x 0

Dual LP

minimize b⊺y subject to A⊺y c y 0

Theorem (Strong Duality)

If either the primal or dual is feasible and bounded, then so is the other and OPT(Primal) = OPT(Dual).

Weak and Strong Duality 8/21

slide-22
SLIDE 22

Interpretation of Strong Duality

Economic Interpretation

Buyer can offer prices for raw materials that would make facility indifferent between production and sale.

Weak and Strong Duality 9/21

slide-23
SLIDE 23

Interpretation of Strong Duality

Economic Interpretation

Buyer can offer prices for raw materials that would make facility indifferent between production and sale.

Upperbound Interpretation

The method of scaling and summing inequalities yields a tight upperbound on the primal optimal value.

Weak and Strong Duality 9/21

slide-24
SLIDE 24

Interpretation of Strong Duality

Economic Interpretation

Buyer can offer prices for raw materials that would make facility indifferent between production and sale.

Upperbound Interpretation

The method of scaling and summing inequalities yields a tight upperbound on the primal optimal value.

Physical Interpretation

There is an assignment of forces to the walls of the polytope that brings ball back to the origin without wasting energy.

Weak and Strong Duality 9/21

slide-25
SLIDE 25

Informal Proof of Strong Duality

Recall the physical interpretation of duality

Weak and Strong Duality 10/21

slide-26
SLIDE 26

Informal Proof of Strong Duality

Recall the physical interpretation of duality When ball is stationary at x, we expect force c to be neutralized

  • nly by constraints that are tight

i.e. force multipliers y such that yi(bi − aix) = 0

Weak and Strong Duality 10/21

slide-27
SLIDE 27

Informal Proof of Strong Duality

Recall the physical interpretation of duality When ball is stationary at x, we expect force c to be neutralized

  • nly by constraints that are tight

i.e. force multipliers y such that yi(bi − aix) = 0

y⊺b − c⊺x = y⊺b − yT Ax =

  • i

yi(bi − aix) = 0 We found a primal and dual solution that are equal in value!

Weak and Strong Duality 10/21

slide-28
SLIDE 28

Outline

1

Recall: Duality and Its Interpretations

2

Weak and Strong Duality

3

Consequences of Duality

4

Uses and Examples of Duality

5

Solvability of LP

slide-29
SLIDE 29

Complementary Slackness

Primal LP

maximize c⊺x subject to Ax b x 0

Dual LP

minimize y⊺b subject to A⊺y c y 0

Consequences of Duality 11/21

slide-30
SLIDE 30

Complementary Slackness

Primal LP

maximize c⊺x subject to Ax b x 0

Dual LP

minimize y⊺b subject to A⊺y c y 0 Let si = (b − Ax)i be the i’th primal slack variable Let tj = (A⊺y − c)j be the j’th dual slack variable

Consequences of Duality 11/21

slide-31
SLIDE 31

Complementary Slackness

Primal LP

maximize c⊺x subject to Ax b x 0

Dual LP

minimize y⊺b subject to A⊺y c y 0 Let si = (b − Ax)i be the i’th primal slack variable Let tj = (A⊺y − c)j be the j’th dual slack variable

Complementary Slackness

x and y are optimal if and only if xjtj = 0 for all j = 1, . . . , n yisi = 0 for all i = 1, . . . , m x1 x2 x3 x4 y1 a11 a12 a13 a14 b1 y2 a21 a22 a23 a24 b2 y3 a31 a32 a33 a34 b3 c1 c2 c3 c4

Consequences of Duality 11/21

slide-32
SLIDE 32

Interpretation of Complementary Slackness

Economic Interpretation

Given an optimal primal production vector x and optimal dual offer prices y, Facility produces only products for which it is indifferent between sale and production. Only raw materials that are binding constraints on production are priced greater than 0

Consequences of Duality 12/21

slide-33
SLIDE 33

Interpretation of Complementary Slackness

Physical Interpretation

Only walls adjacent to the balls equilibrium position push back on it.

Consequences of Duality 12/21

slide-34
SLIDE 34

Proof of Complementary Slackness

Primal LP

maximize c⊺x subject to Ax b x 0

Dual LP

minimize y⊺b subject to A⊺y c y 0

Consequences of Duality 13/21

slide-35
SLIDE 35

Proof of Complementary Slackness

Primal LP

maximize c⊺x subject to Ax + s = b x 0 s 0

Dual LP

minimize y⊺b subject to A⊺y − t = c y 0 t 0 Can equivalently rewrite LP using slack variables

Consequences of Duality 13/21

slide-36
SLIDE 36

Proof of Complementary Slackness

Primal LP

maximize c⊺x subject to Ax + s = b x 0 s 0

Dual LP

minimize y⊺b subject to A⊺y − t = c y 0 t 0 Can equivalently rewrite LP using slack variables

y⊺b − c⊺x = y⊺(Ax + s) − (y⊺A − t⊺)x = y⊺s + t⊺x

Consequences of Duality 13/21

slide-37
SLIDE 37

Proof of Complementary Slackness

Primal LP

maximize c⊺x subject to Ax + s = b x 0 s 0

Dual LP

minimize y⊺b subject to A⊺y − t = c y 0 t 0 Can equivalently rewrite LP using slack variables

y⊺b − c⊺x = y⊺(Ax + s) − (y⊺A − t⊺)x = y⊺s + t⊺x Gap between primal and dual objectives is 0 if and only if complementary slackness holds.

Consequences of Duality 13/21

slide-38
SLIDE 38

Recovering Primal from Dual

Complementary slackness allows us to “read off” the primal

  • ptimal from the dual optimal, and vice versa.

Consequences of Duality 14/21

slide-39
SLIDE 39

Recovering Primal from Dual

Complementary slackness allows us to “read off” the primal

  • ptimal from the dual optimal, and vice versa.

Assuming non-degeneracy: Every vertex of primal [dual] is the solution of exactly n [m] tight constraints.

Consequences of Duality 14/21

slide-40
SLIDE 40

Recovering Primal from Dual

Complementary slackness allows us to “read off” the primal

  • ptimal from the dual optimal, and vice versa.

Assuming non-degeneracy: Every vertex of primal [dual] is the solution of exactly n [m] tight constraints.

Primal LP

(n variables, m + n constraints)

maximize c⊺x subject to Ax b x 0

Dual LP

(m variables, m + n constraints)

minimize y⊺b subject to A⊺y c y 0

Consequences of Duality 14/21

slide-41
SLIDE 41

Recovering Primal from Dual

Complementary slackness allows us to “read off” the primal

  • ptimal from the dual optimal, and vice versa.

Assuming non-degeneracy: Every vertex of primal [dual] is the solution of exactly n [m] tight constraints.

Primal LP

(n variables, m + n constraints)

maximize c⊺x subject to Ax b x 0

Dual LP

(m variables, m + n constraints)

minimize y⊺b subject to A⊺y c y 0 Let y be dual optimal. By non-degeneracy:

Exactly m of the m + n dual constraints are tight at y Exactly n dual constraints are loose

Consequences of Duality 14/21

slide-42
SLIDE 42

Recovering Primal from Dual

Complementary slackness allows us to “read off” the primal

  • ptimal from the dual optimal, and vice versa.

Assuming non-degeneracy: Every vertex of primal [dual] is the solution of exactly n [m] tight constraints.

Primal LP

(n variables, m + n constraints)

maximize c⊺x subject to Ax b x 0

Dual LP

(m variables, m + n constraints)

minimize y⊺b subject to A⊺y c y 0 Let y be dual optimal. By non-degeneracy:

Exactly m of the m + n dual constraints are tight at y Exactly n dual constraints are loose

n loose dual constraints impose n tight primal constraints

Consequences of Duality 14/21

slide-43
SLIDE 43

Recovering Primal from Dual

Complementary slackness allows us to “read off” the primal

  • ptimal from the dual optimal, and vice versa.

Assuming non-degeneracy: Every vertex of primal [dual] is the solution of exactly n [m] tight constraints.

Primal LP

(n variables, m + n constraints)

maximize c⊺x subject to Ax b x 0

Dual LP

(m variables, m + n constraints)

minimize y⊺b subject to A⊺y c y 0 Let y be dual optimal. By non-degeneracy:

Exactly m of the m + n dual constraints are tight at y Exactly n dual constraints are loose

n loose dual constraints impose n tight primal constraints

Assuming non-degeneracy, solving the linear equation yields a unique primal optimum solution x.

Consequences of Duality 14/21

slide-44
SLIDE 44

Outline

1

Recall: Duality and Its Interpretations

2

Weak and Strong Duality

3

Consequences of Duality

4

Uses and Examples of Duality

5

Solvability of LP

slide-45
SLIDE 45

Uses of Duality in Algorithm Design

1

Gain structural insights

Dual of a problem gives a “different way of looking at it”.

2

As a benchmark; i.e. to certify (approximate) optimality

The primal/dual paradigm A dual may be explicitly constructed by the algorithm, or as part of its analysis

Uses and Examples of Duality 15/21

slide-46
SLIDE 46

Uses of Duality in Algorithm Design

1

Gain structural insights

Dual of a problem gives a “different way of looking at it”.

2

As a benchmark; i.e. to certify (approximate) optimality

The primal/dual paradigm A dual may be explicitly constructed by the algorithm, or as part of its analysis

Let’s look at some duals and interpret them.

Uses and Examples of Duality 15/21

slide-47
SLIDE 47

Shortest Path

Given a directed network G = (V, E) where edge e has length ℓe ∈ R+, find the minimum cost path from s to t.

s t 1 1 1 2 2 2 2 3 3 3 5 1

Uses and Examples of Duality 16/21

slide-48
SLIDE 48

Shortest Path

s t 1 1 1 2 2 2 2 3 3 3 5 1

Primal LP

min

  • e∈E ℓexe

s.t.

  • e→v

xe −

v→e

xe = δv, ∀v ∈ V. xe ≥ 0, ∀e ∈ E.

Dual LP

max yt − ys s.t. yv − yu ≤ ℓe, ∀(u, v) ∈ E. Where δv = −1 if v = s, 1 if v = t, and 0 otherwise.

Uses and Examples of Duality 16/21

slide-49
SLIDE 49

Shortest Path

s t 1 1 1 2 2 2 2 3 3 3 5 1

Primal LP

min

  • e∈E ℓexe

s.t.

  • e→v

xe −

v→e

xe = δv, ∀v ∈ V. xe ≥ 0, ∀e ∈ E.

Dual LP

max yt − ys s.t. yv − yu ≤ ℓe, ∀(u, v) ∈ E. Where δv = −1 if v = s, 1 if v = t, and 0 otherwise.

Interpretation of Dual

Stretch s and t as far apart as possible, subject to edge lengths.

Uses and Examples of Duality 16/21

slide-50
SLIDE 50

Vertex Cover

Given an undirected graph G = (V, E), with weights wi for i ∈ V , find minimum-weight S ⊆ V “covering” all edges.

Uses and Examples of Duality 17/21

slide-51
SLIDE 51

Vertex Cover

Given an undirected graph G = (V, E), with weights wi for i ∈ V , find minimum-weight S ⊆ V “covering” all edges.

Primal LP

min

  • i∈V wixi

s.t. xi + xj ≥ 1, ∀(i, j) ∈ E. x 0

Dual LP

max

  • e∈E ye

s.t.

  • e∈Γ(i)

ye ≤ wi, ∀i ∈ V. y 0

Uses and Examples of Duality 17/21

slide-52
SLIDE 52

Vertex Cover

Given an undirected graph G = (V, E), with weights wi for i ∈ V , find minimum-weight S ⊆ V “covering” all edges.

Primal LP

min

  • i∈V wixi

s.t. xi + xj ≥ 1, ∀(i, j) ∈ E. x 0

Dual LP

max

  • e∈E ye

s.t.

  • e∈Γ(i)

ye ≤ wi, ∀i ∈ V. y 0

Interpretation of Dual

Trying to “sell” coverage to edges at prices ye. Objective: Maximize revenue Feasible: charge any neighborhood (of a vertex i) no more than it would cost them if they broke away and bought i themselves

Uses and Examples of Duality 17/21

slide-53
SLIDE 53

Outline

1

Recall: Duality and Its Interpretations

2

Weak and Strong Duality

3

Consequences of Duality

4

Uses and Examples of Duality

5

Solvability of LP

slide-54
SLIDE 54

Solvability of Explicit Linear Programs

maximize c⊺x subject to Ax b x 0 In the examples we have seen so far, the linear program is explicit I.e. the constraint matrix A, as well as rhs vector b and objective c, are of polynomial size.

Solvability of LP 18/21

slide-55
SLIDE 55

Solvability of Explicit Linear Programs

maximize c⊺x subject to Ax b x 0 In the examples we have seen so far, the linear program is explicit I.e. the constraint matrix A, as well as rhs vector b and objective c, are of polynomial size.

Theorem (Polynomial Solvability of Explicit LP)

There is a polynomial time algorithm for linear programming, when the linear program is represented explicitly. Originally using the ellipsoid algorithm, and more recently interior-point algorithms which are more efficient in practice.

Solvability of LP 18/21

slide-56
SLIDE 56

Implicit Linear Programs

These are linear programs in which the number of constraints is exponential (in the natural description of the input) These are useful as an analytical tool Can be solved in many cases!

Solvability of LP 19/21

slide-57
SLIDE 57

Implicit Linear Programs

These are linear programs in which the number of constraints is exponential (in the natural description of the input) These are useful as an analytical tool Can be solved in many cases! E.g. Held-Karp relaxation for TSP min

  • e∈E dexe

s.t. x(δ(S)) ≥ 2, ∀∅ ⊂ S ⊂ V. x(δ(v)) = 2, ∀v ∈ V. 0 x 1 Where δ(S) denotes the edges going out of S ⊆ V .

Solvability of LP 19/21

slide-58
SLIDE 58

Solvability of Implicit Linear Programs

maximize c⊺x subject to Ax b x 0

Theorem (Polynomial Solvability of Implicit LP)

Consider a family Π of linear programming problems I = (A, b, c) admitting the following operations in polynomial time (in I and n): A separation oracle for the polyhedron Ax b Explicit access to c Moreover, assume that every aij, bi, cj are at most poly(I, n). Then there is a polynomial time algorithm for Π (both primal and dual).

Separation oracle

An algorithm that takes as input x ∈ Rn, and either certifies Ax b or finds a violated constraint aix > bi.

Solvability of LP 20/21

slide-59
SLIDE 59

E.g. of a Separation Oracle

min

  • e∈E dexe

s.t. x(δ(S)) ≥ 2, ∀∅ ⊂ S ⊂ V. x(δ(v)) = 2, ∀v ∈ V. 0 x 1

Solvability of LP 21/21

slide-60
SLIDE 60

E.g. of a Separation Oracle

min

  • e∈E dexe

s.t. x(δ(S)) ≥ 2, ∀∅ ⊂ S ⊂ V. x(δ(v)) = 2, ∀v ∈ V. 0 x 1 Nontrivial part: given fixed x need to check whether x(δ(S)) ≥ 2 for all S, else find such an S which violates this.

Solvability of LP 21/21

slide-61
SLIDE 61

E.g. of a Separation Oracle

min

  • e∈E dexe

s.t. x(δ(S)) ≥ 2, ∀∅ ⊂ S ⊂ V. x(δ(v)) = 2, ∀v ∈ V. 0 x 1 Nontrivial part: given fixed x need to check whether x(δ(S)) ≥ 2 for all S, else find such an S which violates this. Suffices to minimize x(δ(S)) over all nonempty S ⊂ V .

Solvability of LP 21/21

slide-62
SLIDE 62

E.g. of a Separation Oracle

min

  • e∈E dexe

s.t. x(δ(S)) ≥ 2, ∀∅ ⊂ S ⊂ V. x(δ(v)) = 2, ∀v ∈ V. 0 x 1 Nontrivial part: given fixed x need to check whether x(δ(S)) ≥ 2 for all S, else find such an S which violates this. Suffices to minimize x(δ(S)) over all nonempty S ⊂ V . This is min-cut in a weighted graph, which we can solve.

Solvability of LP 21/21