+ All Categories
Home > Documents > CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear...

CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear...

Date post: 31-Jul-2020
Category:
Upload: others
View: 2 times
Download: 0 times
Share this document with a friend
100
CS672: Approximation Algorithms Spring 2020 Linear Programming Review Instructor: Shaddin Dughmi
Transcript
Page 1: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

CS672: Approximation AlgorithmsSpring 2020

Linear Programming Review

Instructor: Shaddin Dughmi

Page 2: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Outline

1 Linear Programming Basics

2 Duality and Its Interpretations

3 Properties of Duals

4 Weak and Strong Duality

5 Consequences of Duality

6 Uses and Examples of Duality

7 Solvability of LP

Page 3: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Outline

1 Linear Programming Basics

2 Duality and Its Interpretations

3 Properties of Duals

4 Weak and Strong Duality

5 Consequences of Duality

6 Uses and Examples of Duality

7 Solvability of LP

Page 4: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

LP General Form

minimize (or maximize) cᵀxsubject to aᵀi x ≤ bi, for i ∈ C1.

aᵀi x ≥ bi, for i ∈ C2.aᵀi x = bi, for i ∈ C3.

Decision variables: x ∈ Rn

Parameters:c ∈ Rn defines the linear objective functionai ∈ Rn and bi ∈ R define the i’th constraint.

Linear Programming Basics 1/37

Page 5: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Standard Form

maximize cᵀxsubject to aᵀi x ≤ bi, for i = 1, . . . ,m.

xj ≥ 0, for j = 1, . . . , n.

Every LP can be transformed to this formminimizing cᵀx is equivalent to maximizing −cᵀx≥ constraints can be flipped by multiplying by −1

Each equality constraint can be replaced by two inequalitiesUconstrained variable xj can be replaced by x+j − x

−j , where both

x+j and x−j are constrained to be nonnegative.

Linear Programming Basics 2/37

Page 6: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Geometric View

Linear Programming Basics 3/37

Page 7: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Geometric View

Linear Programming Basics 3/37

Page 8: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

A 2-D example

maximize x1 + x2subject to x1 + 2x2 ≤ 2

2x1 + x2 ≤ 2x1, x2 ≥ 0

Linear Programming Basics 4/37

Page 9: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Application: Optimal Production

n products, m raw materialsEvery unit of product j uses aij units of raw material iThere are bi units of material i availableProduct j yields profit cj per unitFacility wants to maximize profit subject to available raw materials

maximize cᵀxsubject to aᵀi x ≤ bi, for i = 1, . . . ,m.

xj ≥ 0, for j = 1, . . . , n.

Linear Programming Basics 5/37

Page 10: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Terminology

Hyperplane: The region defined by a linear equalityHalfspace: The region defined by a linear inequality aᵀi x ≤ bi.Polyhedron: The intersection of a set of linear inequalities

Feasible region of an LP is a polyhedronPolytope: Bounded polyhedron

Equivalently: convex hull of a finite set of pointsVertex: A point x is a vertex of polyhedron P if 6 ∃y 6= 0 withx+ y ∈ P and x− y ∈ PFace of P : The intersection with P of a hyperplane H disjoint fromthe interior of P

Linear Programming Basics 6/37

Page 11: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Basic Facts about LPs and Polyhedrons

FactFeasible regions of LPs (i.e. polyhedrons) are convex

FactSet of optimal solutions of an LP is convex

In fact, a face of the polyhedronintersection of P with hyperplane cᵀx = OPT

FactA feasible point x is a vertex if and only if n linearly independentconstraints are tight (i.e., satisfied with equality) at x.

Linear Programming Basics 7/37

Page 12: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Basic Facts about LPs and Polyhedrons

FactFeasible regions of LPs (i.e. polyhedrons) are convex

FactSet of optimal solutions of an LP is convex

In fact, a face of the polyhedronintersection of P with hyperplane cᵀx = OPT

FactA feasible point x is a vertex if and only if n linearly independentconstraints are tight (i.e., satisfied with equality) at x.

Linear Programming Basics 7/37

Page 13: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Basic Facts about LPs and Polyhedrons

FactFeasible regions of LPs (i.e. polyhedrons) are convex

FactSet of optimal solutions of an LP is convex

In fact, a face of the polyhedronintersection of P with hyperplane cᵀx = OPT

FactA feasible point x is a vertex if and only if n linearly independentconstraints are tight (i.e., satisfied with equality) at x.

Linear Programming Basics 7/37

Page 14: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Basic Facts about LPs and Polyhedrons

FactAn LP either has an optimal solution, or is unbounded or infeasible

Linear Programming Basics 8/37

Page 15: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Fundamental Theorem of LPIf an LP in standard form has an optimal solution, then it has a vertexoptimal solution.

ProofAssume not, and take a non-vertex optimal solution x with themaximum number of tight constraintsThere is y 6= 0 s.t. x± y are feasibley is perpendicular to the objective function and the tightconstraints at x.

i.e. cᵀy = 0, and aᵀi y = 0 whenever the i’th constraint is tight for x.

Can choose y s.t. yj < 0 for some jLet α be the largest constant such that x+ αy is feasible

Such an α exists

An additional constraint becomes tight at x+ αy, a contradiction.

Linear Programming Basics 9/37

Page 16: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Fundamental Theorem of LPIf an LP in standard form has an optimal solution, then it has a vertexoptimal solution.

ProofAssume not, and take a non-vertex optimal solution x with themaximum number of tight constraints

There is y 6= 0 s.t. x± y are feasibley is perpendicular to the objective function and the tightconstraints at x.

i.e. cᵀy = 0, and aᵀi y = 0 whenever the i’th constraint is tight for x.

Can choose y s.t. yj < 0 for some jLet α be the largest constant such that x+ αy is feasible

Such an α exists

An additional constraint becomes tight at x+ αy, a contradiction.

Linear Programming Basics 9/37

Page 17: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Fundamental Theorem of LPIf an LP in standard form has an optimal solution, then it has a vertexoptimal solution.

ProofAssume not, and take a non-vertex optimal solution x with themaximum number of tight constraintsThere is y 6= 0 s.t. x± y are feasible

y is perpendicular to the objective function and the tightconstraints at x.

i.e. cᵀy = 0, and aᵀi y = 0 whenever the i’th constraint is tight for x.

Can choose y s.t. yj < 0 for some jLet α be the largest constant such that x+ αy is feasible

Such an α exists

An additional constraint becomes tight at x+ αy, a contradiction.

Linear Programming Basics 9/37

Page 18: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Fundamental Theorem of LPIf an LP in standard form has an optimal solution, then it has a vertexoptimal solution.

ProofAssume not, and take a non-vertex optimal solution x with themaximum number of tight constraintsThere is y 6= 0 s.t. x± y are feasibley is perpendicular to the objective function and the tightconstraints at x.

i.e. cᵀy = 0, and aᵀi y = 0 whenever the i’th constraint is tight for x.

Can choose y s.t. yj < 0 for some jLet α be the largest constant such that x+ αy is feasible

Such an α exists

An additional constraint becomes tight at x+ αy, a contradiction.

Linear Programming Basics 9/37

Page 19: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Fundamental Theorem of LPIf an LP in standard form has an optimal solution, then it has a vertexoptimal solution.

ProofAssume not, and take a non-vertex optimal solution x with themaximum number of tight constraintsThere is y 6= 0 s.t. x± y are feasibley is perpendicular to the objective function and the tightconstraints at x.

i.e. cᵀy = 0, and aᵀi y = 0 whenever the i’th constraint is tight for x.

Can choose y s.t. yj < 0 for some j

Let α be the largest constant such that x+ αy is feasibleSuch an α exists

An additional constraint becomes tight at x+ αy, a contradiction.

Linear Programming Basics 9/37

Page 20: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Fundamental Theorem of LPIf an LP in standard form has an optimal solution, then it has a vertexoptimal solution.

ProofAssume not, and take a non-vertex optimal solution x with themaximum number of tight constraintsThere is y 6= 0 s.t. x± y are feasibley is perpendicular to the objective function and the tightconstraints at x.

i.e. cᵀy = 0, and aᵀi y = 0 whenever the i’th constraint is tight for x.

Can choose y s.t. yj < 0 for some jLet α be the largest constant such that x+ αy is feasible

Such an α exists

An additional constraint becomes tight at x+ αy, a contradiction.

Linear Programming Basics 9/37

Page 21: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Fundamental Theorem of LPIf an LP in standard form has an optimal solution, then it has a vertexoptimal solution.

ProofAssume not, and take a non-vertex optimal solution x with themaximum number of tight constraintsThere is y 6= 0 s.t. x± y are feasibley is perpendicular to the objective function and the tightconstraints at x.

i.e. cᵀy = 0, and aᵀi y = 0 whenever the i’th constraint is tight for x.

Can choose y s.t. yj < 0 for some jLet α be the largest constant such that x+ αy is feasible

Such an α exists

An additional constraint becomes tight at x+ αy, a contradiction.

Linear Programming Basics 9/37

Page 22: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Counting non-zero Variables

CorollaryIf an LP in standard form has an optimal solution, then there is anoptimal solution with at most m non-zero variables.

maximize cᵀxsubject to aᵀi x ≤ bi, for i = 1, . . . ,m.

xj ≥ 0, for j = 1, . . . , n.

e.g. for optimal production with n products and m raw materials,there is an optimal plan with at most m products.

Linear Programming Basics 10/37

Page 23: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Outline

1 Linear Programming Basics

2 Duality and Its Interpretations

3 Properties of Duals

4 Weak and Strong Duality

5 Consequences of Duality

6 Uses and Examples of Duality

7 Solvability of LP

Page 24: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Linear Programming Duality

Primal LP

maximize cᵀxsubject to Ax � b

Dual LP

minimize bᵀysubject to Aᵀy = c

y � 0

A ∈ Rm×n, c ∈ Rn, b ∈ Rm

yi is the dual variable corresponding to primal constraint Aix ≤ biAT

j y = cj is the dual constraint corresponding to primal variable xj

Duality and Its Interpretations 11/37

Page 25: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Linear Programming Duality: Standard Form, andVisualization

Primal LP

maximize cᵀxsubject to Ax � b

x � 0

Dual LP

minimize yᵀbsubject to Aᵀy � c

y � 0

x1 x2 x3 x4y1 a11 a12 a13 a14 b1y2 a21 a22 a23 a24 b2y3 a31 a32 a33 a34 b3

c1 c2 c3 c4

yi is the dual variable corresponding to primal constraint Aix ≤ biAT

j y ≥ cj is the dual constraint corresponding to primal variable xj

Duality and Its Interpretations 12/37

Page 26: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Linear Programming Duality: Standard Form, andVisualization

Primal LP

maximize cᵀxsubject to Ax � b

x � 0

Dual LP

minimize yᵀbsubject to Aᵀy � c

y � 0

x1 x2 x3 x4y1 a11 a12 a13 a14 b1y2 a21 a22 a23 a24 b2y3 a31 a32 a33 a34 b3

c1 c2 c3 c4

yi is the dual variable corresponding to primal constraint Aix ≤ biAT

j y ≥ cj is the dual constraint corresponding to primal variable xj

Duality and Its Interpretations 12/37

Page 27: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Linear Programming Duality: Standard Form, andVisualization

Primal LP

maximize cᵀxsubject to Ax � b

x � 0

Dual LP

minimize yᵀbsubject to Aᵀy � c

y � 0

x1 x2 x3 x4y1 a11 a12 a13 a14 b1y2 a21 a22 a23 a24 b2y3 a31 a32 a33 a34 b3

c1 c2 c3 c4

yi is the dual variable corresponding to primal constraint Aix ≤ biAT

j y ≥ cj is the dual constraint corresponding to primal variable xjDuality and Its Interpretations 12/37

Page 28: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Interpretation 1: Economic Interpretation

Recall the Optimal Production problem from last lecturen products, m raw materialsEvery unit of product j uses aij units of raw material iThere are bi units of material i availableProduct j yields profit cj per unitFacility wants to maximize profit subject to available raw materials

Primal LP

max∑n

j=1 cjxjs.t.

∑nj=1 aijxj ≤ bi, for i ∈ [m].

xj ≥ 0, for j ∈ [n].

Dual LP

min∑m

i=1 biyis.t.

∑mi=1 aijyi ≥ cj , for j ∈ [n].

yi ≥ 0, for i ∈ [m].

x1 x2 x3 x4y1 a11 a12 a13 a14 b1y2 a21 a22 a23 a24 b2y3 a31 a32 a33 a34 b3

c1 c2 c3 c4

Dual variable yi is a proposed price per unit of raw material iDual price vector is feasible if facility has incentive to sell materialsBuyer wants to spend as little as possible to buy materials

Duality and Its Interpretations 13/37

Page 29: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Interpretation 1: Economic Interpretation

Primal LP

max∑n

j=1 cjxjs.t.

∑nj=1 aijxj ≤ bi, for i ∈ [m].

xj ≥ 0, for j ∈ [n].

Dual LP

min∑m

i=1 biyis.t.

∑mi=1 aijyi ≥ cj , for j ∈ [n].

yi ≥ 0, for i ∈ [m].

x1 x2 x3 x4y1 a11 a12 a13 a14 b1y2 a21 a22 a23 a24 b2y3 a31 a32 a33 a34 b3

c1 c2 c3 c4

Dual variable yi is a proposed price per unit of raw material iDual price vector is feasible if facility has incentive to sell materialsBuyer wants to spend as little as possible to buy materials

Duality and Its Interpretations 13/37

Page 30: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Interpretation 1: Economic Interpretation

Primal LP

max∑n

j=1 cjxjs.t.

∑nj=1 aijxj ≤ bi, for i ∈ [m].

xj ≥ 0, for j ∈ [n].

Dual LP

min∑m

i=1 biyis.t.

∑mi=1 aijyi ≥ cj , for j ∈ [n].

yi ≥ 0, for i ∈ [m].

x1 x2 x3 x4y1 a11 a12 a13 a14 b1y2 a21 a22 a23 a24 b2y3 a31 a32 a33 a34 b3

c1 c2 c3 c4

Dual variable yi is a proposed price per unit of raw material iDual price vector is feasible if facility has incentive to sell materialsBuyer wants to spend as little as possible to buy materials

Duality and Its Interpretations 13/37

Page 31: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Interpretation 1: Economic Interpretation

Primal LP

max∑n

j=1 cjxjs.t.

∑nj=1 aijxj ≤ bi, for i ∈ [m].

xj ≥ 0, for j ∈ [n].

Dual LP

min∑m

i=1 biyis.t.

∑mi=1 aijyi ≥ cj , for j ∈ [n].

yi ≥ 0, for i ∈ [m].

x1 x2 x3 x4y1 a11 a12 a13 a14 b1y2 a21 a22 a23 a24 b2y3 a31 a32 a33 a34 b3

c1 c2 c3 c4

Dual variable yi is a proposed price per unit of raw material iDual price vector is feasible if facility has incentive to sell materialsBuyer wants to spend as little as possible to buy materials

Duality and Its Interpretations 13/37

Page 32: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Interpretation 1: Economic Interpretation

Primal LP

max∑n

j=1 cjxjs.t.

∑nj=1 aijxj ≤ bi, for i ∈ [m].

xj ≥ 0, for j ∈ [n].

Dual LP

min∑m

i=1 biyis.t.

∑mi=1 aijyi ≥ cj , for j ∈ [n].

yi ≥ 0, for i ∈ [m].

x1 x2 x3 x4y1 a11 a12 a13 a14 b1y2 a21 a22 a23 a24 b2y3 a31 a32 a33 a34 b3

c1 c2 c3 c4

Dual variable yi is a proposed price per unit of raw material iDual price vector is feasible if facility has incentive to sell materialsBuyer wants to spend as little as possible to buy materials

Duality and Its Interpretations 13/37

Page 33: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Interpretation 2: Finding the Best Upperbound

Consider the simple LP from last lecture

maximize x1 + x2subject to x1 + 2x2 ≤ 2

2x1 + x2 ≤ 2x1, x2 ≥ 0

We found that the optimal solution was at (23 ,23), with an optimal

value of 4/3.

What if, instead of finding the optimal solution, we saught to findan upperbound on its value by combining inequalities?

Each inequality implies an upper bound of 2Multiplying each by 1

3 and summing gives x1 + x2 ≤ 4/3.

Duality and Its Interpretations 14/37

Page 34: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Interpretation 2: Finding the Best Upperbound

Consider the simple LP from last lecture

maximize x1 + x2subject to x1 + 2x2 ≤ 2

2x1 + x2 ≤ 2x1, x2 ≥ 0

We found that the optimal solution was at (23 ,23), with an optimal

value of 4/3.What if, instead of finding the optimal solution, we saught to findan upperbound on its value by combining inequalities?

Each inequality implies an upper bound of 2Multiplying each by 1

3 and summing gives x1 + x2 ≤ 4/3.

Duality and Its Interpretations 14/37

Page 35: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Interpretation 2: Finding the Best Upperbound

x1 x2 x3 x4y1 a11 a12 a13 a14 b1y2 a21 a22 a23 a24 b2y3 a31 a32 a33 a34 b3

c1 c2 c3 c4

Multiplying each row i by yi and summing gives the inequality

yTAx ≤ yT b

When yTA ≥ cT , the right hand side of the inequality is an upperbound on cTx for every feasible x.

cTx ≤ yTAx ≤ yT b

The dual LP can be thought of as trying to find the bestupperbound on the primal that can be achieved this way.

Duality and Its Interpretations 15/37

Page 36: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Interpretation 2: Finding the Best Upperbound

x1 x2 x3 x4y1 a11 a12 a13 a14 b1y2 a21 a22 a23 a24 b2y3 a31 a32 a33 a34 b3

c1 c2 c3 c4

Multiplying each row i by yi and summing gives the inequality

yTAx ≤ yT b

When yTA ≥ cT , the right hand side of the inequality is an upperbound on cTx for every feasible x.

cTx ≤ yTAx ≤ yT b

The dual LP can be thought of as trying to find the bestupperbound on the primal that can be achieved this way.

Duality and Its Interpretations 15/37

Page 37: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Interpretation 2: Finding the Best Upperbound

x1 x2 x3 x4y1 a11 a12 a13 a14 b1y2 a21 a22 a23 a24 b2y3 a31 a32 a33 a34 b3

c1 c2 c3 c4

Multiplying each row i by yi and summing gives the inequality

yTAx ≤ yT b

When yTA ≥ cT , the right hand side of the inequality is an upperbound on cTx for every feasible x.

cTx ≤ yTAx ≤ yT b

The dual LP can be thought of as trying to find the bestupperbound on the primal that can be achieved this way.

Duality and Its Interpretations 15/37

Page 38: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Interpretation 3: Physical Forces

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

Eventually, ball will come to rest against the walls of the polytope.Wall aix ≤ bi applies some force −yiai to the ballSince the ball is still, cT =

∑i yiai = yTA.

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

i yibi tobring ball back to origin by moving polytopeWe will see that, at optimality, only the walls adjacent to the ballpush (Complementary Slackness)

Duality and Its Interpretations 16/37

Page 39: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Interpretation 3: Physical Forces

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

Wall aix ≤ bi applies some force −yiai to the ballSince the ball is still, cT =

∑i yiai = yTA.

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

i yibi tobring ball back to origin by moving polytopeWe will see that, at optimality, only the walls adjacent to the ballpush (Complementary Slackness)

Duality and Its Interpretations 16/37

Page 40: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Interpretation 3: Physical Forces

Apply force field c to a ball inside bounded 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 = yTA.Dual can be thought of as trying to minimize “work”

∑i yibi to

bring ball back to origin by moving polytopeWe will see that, at optimality, only the walls adjacent to the ballpush (Complementary Slackness)

Duality and Its Interpretations 16/37

Page 41: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Interpretation 3: Physical Forces

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

∑i yiai = yTA.

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

i yibi tobring ball back to origin by moving polytopeWe will see that, at optimality, only the walls adjacent to the ballpush (Complementary Slackness)

Duality and Its Interpretations 16/37

Page 42: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Interpretation 3: Physical Forces

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

∑i yiai = yTA.

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

i yibi tobring ball back to origin by moving polytopeWe will see that, at optimality, only the walls adjacent to the ballpush (Complementary Slackness)

Duality and Its Interpretations 16/37

Page 43: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Outline

1 Linear Programming Basics

2 Duality and Its Interpretations

3 Properties of Duals

4 Weak and Strong Duality

5 Consequences of Duality

6 Uses and Examples of Duality

7 Solvability of LP

Page 44: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Duality is an Inversion

Primal LP

maximize cᵀxsubject to Ax � b

x � 0

Dual LP

minimize bᵀysubject to Aᵀy � c

y � 0

Duality is an InversionGiven a primal LP in standard form, the dual of its dual is itself.

Properties of Duals 17/37

Page 45: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Correspondance Between Variables and Constraints

Primal LP

max∑n

j=1 cjxjs.t.

yi :

∑nj=1 aijxj ≤ bi, for i ∈ [m].

xj ≥ 0, for j ∈ [n].

Dual LP

min∑m

i=1 biyis.t.

xj :

∑mi=1 aijyi ≥ cj , for j ∈ [n].

yi ≥ 0, for i ∈ [m].

The i’th primal constraint gives rise to the i’th dual variable yiThe j’th primal variable xj gives rise to the j’th dual constraint

Properties of Duals 18/37

Page 46: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Correspondance Between Variables and Constraints

Primal LP

max∑n

j=1 cjxjs.t.yi :

∑nj=1 aijxj ≤ bi, for i ∈ [m].

xj ≥ 0, for j ∈ [n].

Dual LP

min∑m

i=1 biyis.t.

xj :

∑mi=1 aijyi ≥ cj , for j ∈ [n].

yi ≥ 0, for i ∈ [m].

The i’th primal constraint gives rise to the i’th dual variable yi

The j’th primal variable xj gives rise to the j’th dual constraint

Properties of Duals 18/37

Page 47: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Correspondance Between Variables and Constraints

Primal LP

max∑n

j=1 cjxjs.t.yi :

∑nj=1 aijxj ≤ bi, for i ∈ [m].

xj ≥ 0, for j ∈ [n].

Dual LP

min∑m

i=1 biyis.t.xj :

∑mi=1 aijyi ≥ cj , for j ∈ [n].

yi ≥ 0, for i ∈ [m].

The i’th primal constraint gives rise to the i’th dual variable yiThe j’th primal variable xj gives rise to the j’th dual constraint

Properties of Duals 18/37

Page 48: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Syntactic Rules

Primal LP

max cᵀxs.t.yi : aix ≤ bi, for i ∈ C1.yi : aix = bi, for i ∈ C2.

xj ≥ 0, for j ∈ D1.xj ∈ R, for j ∈ D2.

Dual LP

min bᵀys.t.xj : aᵀj y ≥ cj , for j ∈ D1.

xj : aᵀj y = cj , for j ∈ D2.

yi ≥ 0, for i ∈ C1.yi ∈ R, for i ∈ C2.

Rules of ThumbLenient constraint (i.e. inequality)⇒ stringent dual variable (i.e.nonnegative)Stringent constraint (i.e. equality)⇒ lenient dual variable (i.e.unconstrained)

Properties of Duals 19/37

Page 49: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Outline

1 Linear Programming Basics

2 Duality and Its Interpretations

3 Properties of Duals

4 Weak and Strong Duality

5 Consequences of Duality

6 Uses and Examples of Duality

7 Solvability of LP

Page 50: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Weak DualityPrimal LP

maximize cᵀxsubject to Ax � b

x � 0

Dual LPminimize bᵀysubject to Aᵀy � c

y � 0

Theorem (Weak Duality)For every primal feasible x and dual feasible y, we have cᵀx ≤ bᵀy.

CorollaryIf primal and dual both feasible and bounded,OPT (Primal) ≤ OPT (Dual)

If primal is unbounded, dual is infeasibleIf dual is unbounded, primal is infeasible

Weak and Strong Duality 20/37

Page 51: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Weak DualityPrimal LP

maximize cᵀxsubject to Ax � b

x � 0

Dual LPminimize bᵀysubject to Aᵀy � c

y � 0

Theorem (Weak Duality)For every primal feasible x and dual feasible y, we have cᵀx ≤ bᵀy.

CorollaryIf x∗ is primal feasible, and y∗ is dual feasible, and cᵀx∗ = bᵀy∗, thenboth are optimal.

Weak and Strong Duality 20/37

Page 52: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Interpretation of Weak Duality

Economic InterpretationIf selling the raw materials is more profitable than making anyindividual product, then total money collected from sale of rawmaterials would exceed profit from production.

Upperbound InterpretationSelf explanatory

Physical InterpretationWork required to bring ball back to origin by pulling polytope is at leastpotential energy difference between origin and primal optimum.

Weak and Strong Duality 21/37

Page 53: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Interpretation of Weak Duality

Economic InterpretationIf selling the raw materials is more profitable than making anyindividual product, then total money collected from sale of rawmaterials would exceed profit from production.

Upperbound InterpretationSelf explanatory

Physical InterpretationWork required to bring ball back to origin by pulling polytope is at leastpotential energy difference between origin and primal optimum.

Weak and Strong Duality 21/37

Page 54: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Interpretation of Weak Duality

Economic InterpretationIf selling the raw materials is more profitable than making anyindividual product, then total money collected from sale of rawmaterials would exceed profit from production.

Upperbound InterpretationSelf explanatory

Physical InterpretationWork required to bring ball back to origin by pulling polytope is at leastpotential energy difference between origin and primal optimum.

Weak and Strong Duality 21/37

Page 55: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Proof of Weak Duality

Primal LPmaximize cᵀxsubject to Ax � b

x � 0

Dual LPminimize bᵀysubject to Aᵀy � c

y � 0

cᵀx ≤ yᵀAx ≤ yᵀb

Weak and Strong Duality 22/37

Page 56: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Strong Duality

Primal LPmaximize cᵀxsubject to Ax � b

x � 0

Dual LPminimize bᵀysubject to Aᵀy � c

y � 0

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

Weak and Strong Duality 23/37

Page 57: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Interpretation of Strong Duality

Economic InterpretationBuyer can offer prices for raw materials that would make facilityindifferent between production and sale.

Upperbound InterpretationThe method of scaling and summing inequalities yields a tightupperbound on the primal optimal value.

Physical InterpretationThere is an assignment of forces to the walls of the polytope thatbrings ball back to the origin without wasting energy.

Weak and Strong Duality 24/37

Page 58: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Interpretation of Strong Duality

Economic InterpretationBuyer can offer prices for raw materials that would make facilityindifferent between production and sale.

Upperbound InterpretationThe method of scaling and summing inequalities yields a tightupperbound on the primal optimal value.

Physical InterpretationThere is an assignment of forces to the walls of the polytope thatbrings ball back to the origin without wasting energy.

Weak and Strong Duality 24/37

Page 59: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Interpretation of Strong Duality

Economic InterpretationBuyer can offer prices for raw materials that would make facilityindifferent between production and sale.

Upperbound InterpretationThe method of scaling and summing inequalities yields a tightupperbound on the primal optimal value.

Physical InterpretationThere is an assignment of forces to the walls of the polytope thatbrings ball back to the origin without wasting energy.

Weak and Strong Duality 24/37

Page 60: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Informal Proof of Strong Duality

Recall the physical interpretation of duality

When ball is stationary at x, we expect force c to be neutralizedonly by constraints that are tight. i.e. force multipliers y � 0 s.t.

yᵀA = cyi(bi − aix) = 0

yᵀb− cᵀx = yᵀb− yᵀAx =∑i

yi(bi − aix) = 0

We found a primal and dual solution that are equal in value!

Weak and Strong Duality 25/37

Page 61: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Informal Proof of Strong Duality

Recall the physical interpretation of dualityWhen ball is stationary at x, we expect force c to be neutralizedonly by constraints that are tight. i.e. force multipliers y � 0 s.t.

yᵀA = cyi(bi − aix) = 0

yᵀb− cᵀx = yᵀb− yᵀAx =∑i

yi(bi − aix) = 0

We found a primal and dual solution that are equal in value!

Weak and Strong Duality 25/37

Page 62: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Informal Proof of Strong Duality

Recall the physical interpretation of dualityWhen ball is stationary at x, we expect force c to be neutralizedonly by constraints that are tight. i.e. force multipliers y � 0 s.t.

yᵀA = cyi(bi − aix) = 0

yᵀb− cᵀx = yᵀb− yᵀAx =∑i

yi(bi − aix) = 0

We found a primal and dual solution that are equal in value!Weak and Strong Duality 25/37

Page 63: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Outline

1 Linear Programming Basics

2 Duality and Its Interpretations

3 Properties of Duals

4 Weak and Strong Duality

5 Consequences of Duality

6 Uses and Examples of Duality

7 Solvability of LP

Page 64: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Complementary Slackness

Primal LP

maximize cᵀxsubject to Ax � b

x � 0

Dual LP

minimize yᵀbsubject to Aᵀy � c

y � 0

Let si = (b−Ax)i be the i’th primal slack variableLet tj = (Aᵀy − c)j be the j’th dual slack variable

Complementary SlacknessFeasible x and y are optimal if andonly if

xjtj = 0 for all j = 1, . . . , n

yisi = 0 for all i = 1, . . . ,m

x1 x2 x3 x4y1 a11 a12 a13 a14 b1y2 a21 a22 a23 a24 b2y3 a31 a32 a33 a34 b3

c1 c2 c3 c4

Consequences of Duality 26/37

Page 65: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Complementary Slackness

Primal LP

maximize cᵀxsubject to Ax � b

x � 0

Dual LP

minimize yᵀbsubject to Aᵀy � c

y � 0

Let si = (b−Ax)i be the i’th primal slack variableLet tj = (Aᵀy − c)j be the j’th dual slack variable

Complementary SlacknessFeasible x and y are optimal if andonly if

xjtj = 0 for all j = 1, . . . , n

yisi = 0 for all i = 1, . . . ,m

x1 x2 x3 x4y1 a11 a12 a13 a14 b1y2 a21 a22 a23 a24 b2y3 a31 a32 a33 a34 b3

c1 c2 c3 c4

Consequences of Duality 26/37

Page 66: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Complementary Slackness

Primal LP

maximize cᵀxsubject to Ax � b

x � 0

Dual LP

minimize yᵀbsubject to Aᵀy � c

y � 0

Let si = (b−Ax)i be the i’th primal slack variableLet tj = (Aᵀy − c)j be the j’th dual slack variable

Complementary SlacknessFeasible x and y are optimal if andonly if

xjtj = 0 for all j = 1, . . . , n

yisi = 0 for all i = 1, . . . ,m

x1 x2 x3 x4y1 a11 a12 a13 a14 b1y2 a21 a22 a23 a24 b2y3 a31 a32 a33 a34 b3

c1 c2 c3 c4

Consequences of Duality 26/37

Page 67: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Interpretation of Complementary Slackness

Economic InterpretationGiven an optimal primal production vector x and optimal dual offerprices y,

Facility produces only products for which it is indifferent betweensale and production.Only raw materials that are binding constraints on production arepriced greater than 0

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

Consequences of Duality 27/37

Page 68: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Interpretation of Complementary Slackness

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

Consequences of Duality 27/37

Page 69: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Proof of Complementary Slackness

Primal LP

maximize cᵀxsubject to Ax � b

x � 0

s � 0

Dual LP

minimize yᵀbsubject to Aᵀy � 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 ifcomplementary slackness holds.

Consequences of Duality 28/37

Page 70: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Proof of Complementary Slackness

Primal LP

maximize cᵀxsubject to Ax+ s = b

x � 0s � 0

Dual LP

minimize yᵀbsubject to Aᵀy − t = c

y � 0t � 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 ifcomplementary slackness holds.

Consequences of Duality 28/37

Page 71: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Proof of Complementary Slackness

Primal LP

maximize cᵀxsubject to Ax+ s = b

x � 0s � 0

Dual LP

minimize yᵀbsubject to Aᵀy − t = c

y � 0t � 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 ifcomplementary slackness holds.

Consequences of Duality 28/37

Page 72: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Proof of Complementary Slackness

Primal LP

maximize cᵀxsubject to Ax+ s = b

x � 0s � 0

Dual LP

minimize yᵀbsubject to Aᵀy − t = c

y � 0t � 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 ifcomplementary slackness holds.

Consequences of Duality 28/37

Page 73: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Recovering Primal from Dual

Will encounter LPs where the dual is easier to solve than primalComplementary slackness allows us to recover the primal optimalfrom the dual optimal, and vice versa.

Assuming non-degeneracy: At every vertex of primal [dual] thereare exactly n [m] tight constraints which are linearly independent.

Primal LP(n variables, m+ n constraints)

maximize cᵀxsubject to Ax � b

x � 0

Dual LP(m variables, m+ n constraints)

minimize yᵀbsubject 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 yExactly n dual constraints are loose

n loose dual constraints impose n tight primal constraintsAssuming non-degeneracy, solving the linear equation yields aunique primal optimum solution x.

Consequences of Duality 29/37

Page 74: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Recovering Primal from Dual

Will encounter LPs where the dual is easier to solve than primalComplementary slackness allows us to recover the primal optimalfrom the dual optimal, and vice versa.

Assuming non-degeneracy: At every vertex of primal [dual] thereare exactly n [m] tight constraints which are linearly independent.

Primal LP(n variables, m+ n constraints)

maximize cᵀxsubject to Ax � b

x � 0

Dual LP(m variables, m+ n constraints)

minimize yᵀbsubject 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 yExactly n dual constraints are loose

n loose dual constraints impose n tight primal constraintsAssuming non-degeneracy, solving the linear equation yields aunique primal optimum solution x.

Consequences of Duality 29/37

Page 75: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Recovering Primal from Dual

Will encounter LPs where the dual is easier to solve than primalComplementary slackness allows us to recover the primal optimalfrom the dual optimal, and vice versa.

Assuming non-degeneracy: At every vertex of primal [dual] thereare exactly n [m] tight constraints which are linearly independent.

Primal LP(n variables, m+ n constraints)

maximize cᵀxsubject to Ax � b

x � 0

Dual LP(m variables, m+ n constraints)

minimize yᵀbsubject 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 yExactly n dual constraints are loose

n loose dual constraints impose n tight primal constraintsAssuming non-degeneracy, solving the linear equation yields aunique primal optimum solution x.

Consequences of Duality 29/37

Page 76: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Recovering Primal from Dual

Will encounter LPs where the dual is easier to solve than primalComplementary slackness allows us to recover the primal optimalfrom the dual optimal, and vice versa.

Assuming non-degeneracy: At every vertex of primal [dual] thereare exactly n [m] tight constraints which are linearly independent.

Primal LP(n variables, m+ n constraints)

maximize cᵀxsubject to Ax � b

x � 0

Dual LP(m variables, m+ n constraints)

minimize yᵀbsubject 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 yExactly n dual constraints are loose

n loose dual constraints impose n tight primal constraintsAssuming non-degeneracy, solving the linear equation yields aunique primal optimum solution x.

Consequences of Duality 29/37

Page 77: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Recovering Primal from Dual

Will encounter LPs where the dual is easier to solve than primalComplementary slackness allows us to recover the primal optimalfrom the dual optimal, and vice versa.

Assuming non-degeneracy: At every vertex of primal [dual] thereare exactly n [m] tight constraints which are linearly independent.

Primal LP(n variables, m+ n constraints)

maximize cᵀxsubject to Ax � b

x � 0

Dual LP(m variables, m+ n constraints)

minimize yᵀbsubject 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 yExactly n dual constraints are loose

n loose dual constraints impose n tight primal constraints

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

Consequences of Duality 29/37

Page 78: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Recovering Primal from Dual

Will encounter LPs where the dual is easier to solve than primalComplementary slackness allows us to recover the primal optimalfrom the dual optimal, and vice versa.

Assuming non-degeneracy: At every vertex of primal [dual] thereare exactly n [m] tight constraints which are linearly independent.

Primal LP(n variables, m+ n constraints)

maximize cᵀxsubject to Ax � b

x � 0

Dual LP(m variables, m+ n constraints)

minimize yᵀbsubject 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 yExactly n dual constraints are loose

n loose dual constraints impose n tight primal constraintsAssuming non-degeneracy, solving the linear equation yields aunique primal optimum solution x.

Consequences of Duality 29/37

Page 79: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Outline

1 Linear Programming Basics

2 Duality and Its Interpretations

3 Properties of Duals

4 Weak and Strong Duality

5 Consequences of Duality

6 Uses and Examples of Duality

7 Solvability of LP

Page 80: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Uses of Duality in Algorithm Design

1 Gain structural insightsDual of a problem gives a “different way of looking at it”.

2 As a benchmark; i.e. to certify (approximate) optimalityThe primal/dual paradigmA dual may be explicitly constructed by the algorithm, or as part ofits analysis

Let’s look at some duals and interpret them.

Uses and Examples of Duality 30/37

Page 81: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Uses of Duality in Algorithm Design

1 Gain structural insightsDual of a problem gives a “different way of looking at it”.

2 As a benchmark; i.e. to certify (approximate) optimalityThe primal/dual paradigmA dual may be explicitly constructed by the algorithm, or as part ofits analysis

Let’s look at some duals and interpret them.

Uses and Examples of Duality 30/37

Page 82: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

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 11

2

2 2

2

3

330

50

1

Primal LPmin

∑e∈E `exe

s.t.∑e→v

xe −∑v→e

xe = δv, ∀v ∈ V.

xe ≥ 0, ∀e ∈ E.

Dual LPmax yt − yss.t. yv − yu ≤ `e, ∀(u, v) ∈ E.

Where δv = −1 if v = s, 1 if v = t, and 0 otherwise.

Interpretation of DualStretch s and t as far apart as possible, subject to edge lengths.

Uses and Examples of Duality 31/37

Page 83: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Shortest Path

s t

1 11

2

2 2

2

3

330

50

1

Primal LP

min∑

e∈E `exes.t.

∑e→v

xe −∑v→e

xe = δv, ∀v ∈ V.

xe ≥ 0, ∀e ∈ E.

Dual LPmax yt − yss.t. yv − yu ≤ `e, ∀(u, v) ∈ E.

Where δv = −1 if v = s, 1 if v = t, and 0 otherwise.

Interpretation of DualStretch s and t as far apart as possible, subject to edge lengths.

Uses and Examples of Duality 31/37

Page 84: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Shortest Path

s t

1 11

2

2 2

2

3

330

50

1

Primal LP

min∑

e∈E `exes.t.

∑e→v

xe −∑v→e

xe = δv, ∀v ∈ V.

xe ≥ 0, ∀e ∈ E.

Dual LPmax yt − yss.t. yv − yu ≤ `e, ∀(u, v) ∈ E.

Where δv = −1 if v = s, 1 if v = t, and 0 otherwise.

Interpretation of DualStretch s and t as far apart as possible, subject to edge lengths.

Uses and Examples of Duality 31/37

Page 85: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Maximum Weighted Bipartite Matching

Set B of buyers, and set G of goods. Buyer i has value wij for good j,and interested in at most one good. Find maximum value assignmentof goods to buyers.

Primal LPmax

∑i,jwijxij

s.t.∑j∈G

xij ≤ 1, ∀i ∈ B.∑i∈B

xij ≤ 1, ∀j ∈ G.

xij ≥ 0, ∀i ∈ B, j ∈ G.

Dual LPmin

∑i∈B

ui +∑j∈G

pj

s.t. ui + pj ≥ wij , ∀i ∈ B, j ∈ G.ui ≥ 0, ∀i ∈ B.pj ≥ 0, ∀j ∈ G.

Interpretation of Dualpj is price of good jui is utility of buyer iComplementary Slackness:

A buyer i only grabs goods j maximizing wij − pjOnly fully assigned goods have non-zero priceA buyer witn nonzero utility must receive an item

Uses and Examples of Duality 32/37

Page 86: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Maximum Weighted Bipartite MatchingPrimal LPmax

∑i,jwijxij

s.t.∑j∈G

xij ≤ 1, ∀i ∈ B.∑i∈B

xij ≤ 1, ∀j ∈ G.

xij ≥ 0, ∀i ∈ B, j ∈ G.

Dual LPmin

∑i∈B

ui +∑j∈G

pj

s.t. ui + pj ≥ wij , ∀i ∈ B, j ∈ G.ui ≥ 0, ∀i ∈ B.pj ≥ 0, ∀j ∈ G.

Interpretation of Dualpj is price of good jui is utility of buyer iComplementary Slackness:

A buyer i only grabs goods j maximizing wij − pjOnly fully assigned goods have non-zero priceA buyer witn nonzero utility must receive an item

Uses and Examples of Duality 32/37

Page 87: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Maximum Weighted Bipartite MatchingPrimal LPmax

∑i,jwijxij

s.t.∑j∈G

xij ≤ 1, ∀i ∈ B.∑i∈B

xij ≤ 1, ∀j ∈ G.

xij ≥ 0, ∀i ∈ B, j ∈ G.

Dual LPmin

∑i∈B

ui +∑j∈G

pj

s.t. ui + pj ≥ wij , ∀i ∈ B, j ∈ G.ui ≥ 0, ∀i ∈ B.pj ≥ 0, ∀j ∈ G.

Interpretation of Dualpj is price of good jui is utility of buyer iComplementary Slackness:

A buyer i only grabs goods j maximizing wij − pjOnly fully assigned goods have non-zero priceA buyer witn nonzero utility must receive an item

Uses and Examples of Duality 32/37

Page 88: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Minimum Cost Set Cover

Elements [n] = {1, . . . , n}, sets S1, . . . , Sm ⊆ [n] with weightsw1, . . . , wm ≥ 0. Find minimum weight collection of sets whose union is[n].

Primal LP

minm∑j=1

wjxj

s.t.m∑

j:Sj3ixj ≥ 1, ∀i ∈ [n].

xj ≥ 0, ∀j ∈ [m].

Dual LP

maxn∑

i=1yi

s.t.∑

i∈Sjyi ≤ wj , ∀j ∈ [m].

yi ≥ 0, ∀i ∈ [n].

Interpretation of DualTrying to “sell” coverage to elements at prices yi.

Objective: Maximize revenueFeasible: charge elements in Sj no more than it would cost them ifthey broke away and bought Sj themselvesComplementary Slackness:

Only select sets that are “paid for” by the dual pricesOnly elements that are covered exactly once are charged.

Uses and Examples of Duality 33/37

Page 89: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Minimum Cost Set CoverPrimal LP

minm∑j=1

wjxj

s.t.m∑

j:Sj3ixj ≥ 1, ∀i ∈ [n].

xj ≥ 0, ∀j ∈ [m].

Dual LP

maxn∑

i=1yi

s.t.∑

i∈Sjyi ≤ wj , ∀j ∈ [m].

yi ≥ 0, ∀i ∈ [n].

Interpretation of DualTrying to “sell” coverage to elements at prices yi.

Objective: Maximize revenueFeasible: charge elements in Sj no more than it would cost them ifthey broke away and bought Sj themselvesComplementary Slackness:

Only select sets that are “paid for” by the dual pricesOnly elements that are covered exactly once are charged.

Uses and Examples of Duality 33/37

Page 90: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Minimum Cost Set CoverPrimal LP

minm∑j=1

wjxj

s.t.m∑

j:Sj3ixj ≥ 1, ∀i ∈ [n].

xj ≥ 0, ∀j ∈ [m].

Dual LP

maxn∑

i=1yi

s.t.∑

i∈Sjyi ≤ wj , ∀j ∈ [m].

yi ≥ 0, ∀i ∈ [n].

Interpretation of DualTrying to “sell” coverage to elements at prices yi.

Objective: Maximize revenueFeasible: charge elements in Sj no more than it would cost them ifthey broke away and bought Sj themselvesComplementary Slackness:

Only select sets that are “paid for” by the dual pricesOnly elements that are covered exactly once are charged.

Uses and Examples of Duality 33/37

Page 91: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Outline

1 Linear Programming Basics

2 Duality and Its Interpretations

3 Properties of Duals

4 Weak and Strong Duality

5 Consequences of Duality

6 Uses and Examples of Duality

7 Solvability of LP

Page 92: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Solvability of Explicit Linear Programs

maximize cᵀxsubject 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 either given directly as input, or are of size polynomial in thedescription size of the instance.

Theorem (Polynomial Solvability of Explicit LP)There is a polynomial time algorithm for linear programming, when thelinear program is represented explicitly.

Originally using the ellipsoid algorithm, and more recently interior-pointalgorithms which are more efficient in practice.

Solvability of LP 34/37

Page 93: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Solvability of Explicit Linear Programs

maximize cᵀxsubject 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 either given directly as input, or are of size polynomial in thedescription size of the instance.

Theorem (Polynomial Solvability of Explicit LP)There is a polynomial time algorithm for linear programming, when thelinear program is represented explicitly.

Originally using the ellipsoid algorithm, and more recently interior-pointalgorithms which are more efficient in practice.

Solvability of LP 34/37

Page 94: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Implicit Linear Programs

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

E.g. Held-Karp relaxation for TSP

min∑

e∈E dexes.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 35/37

Page 95: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Implicit Linear Programs

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

min∑

e∈E dexes.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 35/37

Page 96: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

Solvability of Implicit Linear Programs

maximize cᵀxsubject 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 � bExplicit 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 oracleAn algorithm that takes as input x ∈ Rn, and either certifies Ax � b orfinds a violated constraint aix > bi.

Solvability of LP 36/37

Page 97: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

E.g. of a Separation Oracle

min∑

e∈E dexes.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)) ≥ 2for 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 37/37

Page 98: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

E.g. of a Separation Oracle

min∑

e∈E dexes.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)) ≥ 2for 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 37/37

Page 99: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

E.g. of a Separation Oracle

min∑

e∈E dexes.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)) ≥ 2for 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 37/37

Page 100: CS672: Approximation Algorithms Spring 2020 Linear ...shaddin/cs672sp20/slides/LP.pdf · Linear Programming Basics 6/37. Basic Facts about LPs and Polyhedrons Fact Feasible regions

E.g. of a Separation Oracle

min∑

e∈E dexes.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)) ≥ 2for 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 37/37


Recommended