Docsity

Linear Programming - Algorithm and Complexity Analysis - Lecture Slides, Slides of Computer Science

Toggle sidebar
bg1
Linear Programming
2
Linear Programming
Significance.
■Quintessential tool for optimal allocation of scarce resources,
among a number of competing activities.
■Powerful model generalizes many classic problems:
–shortest path, max flow, multicommodity flow, MST, matching,
2-person zero sum games
■Ranked among most important scientific advances of 20th century.
–accounts for a major proportion of all scientific computation
■Helps find "good" solutions to NP-hard optimization problems.
–optimal solutions (branch-and-cut)
–provably good solutions (randomized rounding)
3
Brewery Problem
Small brewery produces ale and beer.
■Production limited by scarce resources: corn, hops, barley malt.
■Recipes for ale and beer require different proportions of resources.
How can brewer maximize profits?
■Devote all resources to beer: 32 barrels of beer ⇒$736.
■Devote all resources to ale: 34 barrels of ale ⇒$442.
■7½ barrels of ale, 29½ barrels of beer ⇒$776.
■12 barrels of ale, 28 barrels of beer ⇒$800.
Beverage Corn
(pounds)
Malt
(pounds)
Hops
(ounces)
Beer 15 204
Ale 5354
Profit
($)
23
13
Quantity 480 1190160
4
Brewery Problem
0,
11902035
16044
480155t. s.
2313max
≥
≤+
≤+
≤+
+
BA
BA
BA
BA
BA
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd

Partial preview of the text

Download Linear Programming - Algorithm and Complexity Analysis - Lecture Slides and more Slides Computer Science in PDF only on Docsity!

Linear Programming

Linear Programming

Significance.^ n^ Quintessential tool for optimal allocation of scarce resources,among a number of competing activities.^ n^ Powerful model generalizes many classic problems:^ –

shortest path, max flow, multicommodity flow, MST, matching,2-person zero sum games n Ranked among most important scientific advances of 20

th^ century.

-^ accounts for a major proportion of all scientific computation n Helps find "good" solutions to NP-hard optimization problems. –^ optimal solutions (branch-and-cut) –^ provably good solutions (randomized rounding)

3

Brewery Problem

Small brewery produces ale and beer.^ n^ Production limited by scarce resources: corn, hops, barley malt.^ n^ Recipes for ale and beer require different proportions of resources.How can brewer maximize profits?^ n^ Devote all resources to beer: 32 barrels of beer

⇒^ $736.

n^ Devote all resources to ale: 34 barrels of ale

n^ 7½ barrels of ale, 29½ barrels of beer

⇒^ $776.

n^ 12 barrels of ale, 28 barrels of beer

⇒^ $800.

Beverage

Corn(pounds)

Malt(pounds) Hops(ounces)

Beer

Ale^

Profit($)^1323

Quantity

Brewery Problem

(^5) t. s.

max

B

A

B

A

B

A

B

A

B

A

Docsity.com

5

Brewery Problem: Feasible Region

Ale

Beer

Corn 5A + 15B

≤^480

Hops (0, 0) 4A + 4B

≤^160

Malt 35A + 20B

≤^1190

Brewery Problem: Objective Function

Ale

Beer

13A + 23B = 160013A + 23B = 80013A + 23B = 442

Profit

7

Ale

Beer

Extreme points

Brewery Problem: Geometry

Brewery problem observation.

Regardless of coefficients of linear

objective function, there exists an optimal solution that is an extremepoint.

Linear Programming

LP "standard" form.^ n^ Input data: rational numbers c

, b^ , aji

.ij^

n^ Maximize linear objective function. n^ Subject to linear inequalities.

nj

x

mi b xc xa j

i n j

jij n j

jj

∑= ∑=

max t.s. (P)

(^11)

maxt.s.

(P)

-^ x

b

xc Ax

Docsity.com

13

LP Duality

Primal problem. Find a lower bound on optimal value.^ n^ (x

, x^ , x 12

, x^ ) = (0, 0, 1, 0) 34

⇒^ z*

≥^ 5.

n^ (x^1

, x^ , x^2

, x^ ) = (2, 1, 1, 1/3) 34

z*^

≥^ 15.

n^ (x^1

, x^ , x^2

, x^ ) = (3, 0, 2, 0) 34

⇒^ z*

≥^ 22.

n^ (x^1

, x^ , x^2

, x^ ) = (0, 14, 0, 5) 34

z*^

≥^ 29.

t.s.

max

4 3 2 1

4 3 2 1

4 3 2 1

4 3 2 1

4 3 2 1

+^

x x x x

x x x x

x x x x

x x x x

x x x x

LP Duality

Primal problem. Find an upper bound on optimal value.^ n^ Multiply 2

nd^ inequality by 2: 10x

  • 2x 1

  • 6x 2

  • 16x 3

≤^ 110. 4

⇒^ z*

= 4x

  • x^1

  • 5x

  • 3x 3

≤^ 10x 4

  • 2x 1

  • 6x^2

  • 16x^3

≤^ 110. 4

n^ Adding 2

nd^ and 3

rd^ inequalities: 4x

  • 3x 1

  • 6x 2

  • 3x 3

≤^ 58. 4

⇒^ z*

= 4x

  • x^1

  • 5x

  • 3x 3

≤^ 4x 4

  • 3x 1

  • 6x 2

  • 3x 3

t.s.

max

4 3 2 1

4 3 2 1

4 3 2 1

4 3 2 1

4 3 2 1

x x x x

x x x x

x x x x

x x x x

x x x x

15

LP Duality

Primal problem. Find an upper bound on optimal value.^ n^ Adding 11 times 1

st^ inequality to 6 times 3

rd^ inequality:

⇒^ z*

= 4x

  • x^1

  • 5x

  • 3x 3

≤^ 5x 4

  • x^1

  • 7x

  • 3x 3

≤^ 29. 4

Recall.^ n^ (x

, x^ , x 12

, x^ ) = (0, 14, 0, 5) 34

z*^

≥^ 29.

t.s.

max

4 3 2 1

4 3 2 1

4 3 2 1

4 3 2 1

4 3 2 1

+^

x x x x

x x x x

x x x x

x x x x

x x x x

LP Duality

Primal problem. General idea: add linear combination (y

, y, y 12

) of the constraints. 3

Dual problem.

t.s.

max

4 3 2 1

4 3 2 1

4 3 2 1

4 3 2 1

4 3 2 1

x x x x

x x x x

x x x x

x x x x

x x x x

3 2 1 (^43) 2 1 (^33) 2 1

(^23) (^21) (^13) 2 1

y y y xy y y xy y y

xy yy xy y y

t.s.

min

3 2 1

3 2 1

3 2 1

3 2 1

3 2 1

3 2 1

y y y

y y y

y y y

y y y

y y y

y y y

Docsity.com

17

nj

x

mi b xc xa j

i n j

jij n j

jj

∑= ∑=

max t.s. (P)

(^11)

mi

y

nj c yb ya i

j m i

iij m i

ii

∑= ∑=

min t.s. (D)

(^11)

LP Duality

Primal and dual linear programs: given rational numbers a

, b^ , cij^ i^

, findj^

values x

, ythat optimize (P) and (D).i^ j^ Duality Theorem (Gale-Kuhn-Tucker 1951, Dantzig-von Neumann 1947).If (P) and (D) are nonempty then max = min.^ n^ Dual solution provides certificate of optimality

decision version

∈^ NP

∩^ co-NP.

n^ Special case: max-flow min-cut theorem. n^ Sensitivity analysis.

LP Duality: Economic Interpretation

Brewer’s problem: find optimal mix of beer and ale to maximize profits.Entrepreneur’s problem:

Buy individual resources from brewer at

minimum cost.^ n^ C, H, M = unit price for corn, hops, malt.^ n^ Brewer won’t agree to sell resources if 5C + 4H + 35M < 13.

(^5) t. s.

max (P)

B

A

B

A

B

A

B

A

B

A

t.s.

min (D)

M

H

C

M

H

C

M

H

C

M

H

C

A* = 12B* = 28OPT = 800 C* = 1H* = 2M* = 0OPT = 800

19

LP Duality: Economic Interpretation

Sensitivity analysis.^ n^ How much should brewer be willing to pay (marginal price) foradditional supplies of scarce resources?

3 corn $1, hops $2, malt $0. n^ Suppose a new product "light beer" is proposed. It requires 2 corn,5 hops, 24 malt. How much profit must be obtained from light beerto justify diverting resources from production of beer and ale?

3 At least 2 ($1) + 5 ($2) + 24 (0$) = $12 / barrel.

Standard Form

Standard form. Easy to handle variants.^ n^ x + 2y - 3z

≥^17

⇒^ -x - 2y + 3z

≤^ -17.

n^ x + 2y - 3z = 17

⇒^ x + 2y - 3z

≤^ 17,

-x - 2y + 3z

≤^ -17.

n^ min x + 2y - 3z

⇒^ max -x - 2y + 3z.

n^ x unrestricted

⇒^ x = y - z,

y^ ≥^

0, z^ ≥

nj

x

mi b xc xa j

i n j

jij n j

jj

∑= ∑=

max t.s. (P)

(^11)

Docsity.com

25

LP Application: Multicommodity Flow

Multicommodity flow. Given a network G = (V, E) with edge capacitiesu(e)^ ≥

0, edge costs c(e)

≥^ 0, set of commodities K, and supply /

demand d

k (v) for commodity k at node v, find a minimum cost flow that satisfies all of the demand.Applications.^ n^ Transportation networks.^ n^ Communication networks (Akamai).^ n^ Solving Ax =b with Gaussian elimination, preserving sparsity.^ n^ VLSI design.

Kk

Ee

ex

Ee

eu

ex

Kk

Vv

vd

ex

ex

ex

ec k EeKk

k

k v e

k k ve

Ee

k k Kk

∈∈ ∈∈

t.s.

min

ofout toin

Weighted Vertex Cover

Weighted vertex cover. Given an undirected graph G = (V, E) withvertex weights w

≥^ 0, find a minimum weight subset of nodes S suchv^

that every edge is incident to at least one vertex in S.^ n^ NP-hard even if all weights are 1.Integer programming formulation.^ n^ If x* is optimal solution to (ILP),then S = {v

∈^ V :x*

= 1} is a minv^

weight vertex cover.

3

(^6710)

A E

H

B D^

I

C

F G J

Total weight = 55.

Vv

x

E

wv

x

x

xw

ILP

v

w Vv v

vv

min) t.s.

27

Integer Programming

INTEGER-PROGRAMMING: Given rational numbers a

, b, cij^ i

, findj

integers x

that solve:j^ Claim. INTEGER-PROGRAMMING is NP-hard.Proof. VERTEX-COVER

≤^ INTEGER-PROGRAMMING.P^

nj

x

nj

x

mi

b

xc xa j j

i n j

jij n j

jj

integral

min t.s.

(^11)

Vv

x

Vv

x

E

wv

x

x x

w v v vVv v

0 integral

mint.s.

Weighted Vertex Cover

Linear programming relaxation.^ n^ Note: optimal value of (LP) is

≤^ optimal value of (ILP), and may be

strictly less.^ –^ clique on n nodes requires n-1nodes in vertex cover^ –^ LP solution x* = ½ has value n / 2 n Provides lower bound for approximation algorithm. n How can solving LP help us find good vertex cover?^3

Round fractional values.

Vv

x

E

wv

x

x

xw w v

Vv v

vv

mint.s.

(LP)

Docsity.com

29

Weighted Vertex Cover

Theorem. If x* is optimal solution to (LP), then S = {v

∈^ V :

x*^ v^

≥^ ½} is

a vertex cover within a factor of 2 of the best possible.^ n^ Provides 2-approximation algorithm.^ n^ Solve LP, and then round.S is a vertex cover.^ n^ Consider an edge (v,w)

∈^ E.

n^ Since x*

  • x*v

≥^ w 1, either x*

or x*v

≥^ w

½^ ⇒

(v,w) covered.

S has small cost.^ n^ Let S* be optimal vertex cover.

∑ ∑^ ∑ ∑

∈ ∈ ∈ ∈

vvVv vvSv v Sv

vSv

xw xw w

w

12

LP is relaxationx*

≥^ ½v

Weighted Vertex Cover

Good news.^ n^ 2-approximation algorithm is basis for most practical heuristics.^ –

can solve LP with min cut

⇒^

faster

-^ primal-dual schema

⇒^

linear time 2-approximation

n^ PTAS for planar graphs. n^ Solvable on bipartite graphs using network flow.Bad news. n^ NP-hard even on 3-regular planar graphs with unit weights. n^ If P

≠^ NP, then no

ρ-approximation for

ρ^ < 4/3, even with unit

weights.

(Dinur-Safra, 2001)

31

Maximum Satisfiability

MAX-SAT: Given clauses C

, C,... C 12

in CNF over Boolean variablesm

x^ , x^12

,... x

, and integer weights wn^

≥^ 0 for each clause, find a truthj^

assignment for the x

that maximizes the total weight of clausesi^

satisfied.^ n^ NP-hard even if all weights are 1.^ n^ Ex.

2 1 5

4 2 1 4

3 3 2 1 3

2 3 2 2

1 3 2 1

=^

w x x C

w x x C

w x x x C

w x x C

w x x C

x^ = 0^1 x^ = 0^2 x^ = 1^3 weight = 14

Maximum Satisfiability: Johnson’s AlgorithmRandomized polynomial time (RP). Polynomial time extended to allowcalls to

random()

call in unit time.

n^ Polynomial algorithm A with one-sided error:^ –^

if x is YES instance: Pr[A(x) = YES]

≥^ ½

-^ if x is NO instance:

Pr[A(x) = YES] = 0

n^ Fundamental open question: does P = RP?Johnson’s Algorithm: Flip a coin, and set each variable true withprobability ½, independently for each variable.Theorem: The "dumb" algorithm is a 2-approximation for MAX-SAT.

Docsity.com

37

Maximum Satisfiability: Randomized RoundingProof (continued).

1

(^1) ) (^1) (

satisfied]is clausePr[

) (

) (^

  • j e

j z

j

z

z

C

j j j j j − ≥

^ 

l^ l l l

(1-1/x)

x^ converges to e

) (^1) ( l (^) −l

− [ *z

]^ *

) (^1) (

z

zf

l −l −=

l ) l (^

(^

z

zf

1 - (1 - z* /

l^ l ) is concave

*)( zf

Maximum Satisfiability: Randomized RoundingProof (continued). n^ From previous slide: n^ Let W = weight of clauses that are satisfied.Corollary. If all clauses have length at most k

satisfied]is

clausePr[

je

j^

z

C^

OPT OPT

C zw w WE

e

LP m j e

jj m j e

j j ) 1 (

]

satisfiedis clausePr[

][

(^111)

1 1 − ≥

∑ ∑

=

])

1 ( 1 [

][

1 OPT

WE

k − k

39

Maximum Satisfiability: Best of Two

Observation. Two approximation algorithms are complementary.^ n^ Johnson’s algorithm works best when clauses are long.^ n^ LP rounding algorithm works best when clauses are short.How can we exploit this?^ n^ Run both algorithms and output better of two.^ n^ Re-analyze to get 4/3-approximation algorithm.^ n^ Better performance than either algorithm individually!

(^1) (x,

1 W)

←^

Johnson(C

,…,C 1

)m

(^2) (x,

2 W)

←^

LPround(C

,…,C 1

)m

IF (W

1 > W

RETURN x

1

ELSERETURN x

2 Best-of-Two (

C,^1

C,..., C^2

) m

Maximum Satisfiability: Best of Two

Theorem (Goemans-Williamson, 1994). The Best-of-Two algorithm isa 4/3-approximation algorithm for MAX-SAT.Proof.

[^

]^

[^

]

(^

[^

]

(^

2]Alg

by

satisfiedis

clausePr[

1]Alg

by

satisfiedis

clausePr[

max(

3434

*** 32 12**

1**

12 12 12 12

(^212) (^112)

(^21)

) (^1) ( )(

OPT OPT

z

w

z

w

C

w

C

w

W

WE

WW

E

j^ LP

j j^ j

j

j^ j

j

j^ j

j j

j j

j

∑^

∑^ ∑

−^

l l

l

next slide

Docsity.com

41

Maximum Satisfiability: Best of Two

Lemma. For any integer

l^ ≥^ 1,

Proof.^ n^ Case 1 (

l^ = 1): n^ Case 2 (

l^ = 2): n^ Case 3 (

l^ ≥^ 3):

[^

]^

*** 32

1**

1 2

) (^1) ( )(

j j^

z

z^ ≥

−^

l− l

l.

1

  • 32

12

j j

z z^ ≥+

  • 34 34

j j

z z^ ≥+

[^

]

***** (^5788) *** 32**

*** 1** (^312)

1**

1 2

) )(

) (^1) ( )(

j j

je

j

z z

z

z^ =

−^

l− l

l

Maximum Satisfiability: State of the Art

Observation. Can’t get better than 4/3-approximation using our LP.^ n^ If all weights = 1, OPT

= 4 but OPT = 3.LP^

Lower bound.^ n^ Unless P = NP, can’t do better than 8 / 7

≈^ 1.142.

Semi-definite programming.^ n^ 1.275-approximation algorithm.^ n^ 1.2-approximation algorithmif certain conjecture is true.Open research problem.^ n^ 4 / 3 - approximation algorithmwithout solving LP or SDP.

2 1 4

2 1 3

2 1 2

2 1 1

x x C

x x C

x x C

x x C

maxt.s.

(SDP)

bX f X

A

XC

i i^

  • •

C, X, B, A

∈^ SR(ni

×^ n)

f^ positive semi-definite

ij nn ijj (^) i

yx

YX

==^11

Appendix: Proof of LP Duality Theorem

t.s.

min

(D)

≥ cA ≥ y

b y

y

T T

t.s.

max

(P)

≤ b ≥ x

x Ax

Tc

LP Duality Theorem. For A

m ∈ ℜ ×n^ , b

m ∈ ℜ , c^ ∈ ℜ

n,

if (P) and (D) are nonempty then max = min.

LP Weak Duality

LP Weak Duality. For A

m ∈ ℜ ×n^ , b

m ∈ ℜ , c^ ∈ ℜ

n, if (P) and (D) are

nonempty, then max

≤^ min.

Proof (easy).^ n^ Suppose x

m ∈ ℜ is feasible for (P) and y

n ∈ ℜ is feasible for (D).

-^ x^ ≥

0, y

T^ A^ ≥

c^

⇒^ y

T^ Ax^

T^ ≥ cx.

-^ y^ ≥^

0, Ax

≤^ b^

⇒^ y

T^ Ax^

T^ ≤ yb

-^ combining two inequalities: c

T^ x^ ≤^

T^ yAx ≤^ y

T^ b

t.s.

max

(P)

≤ b ≥ x

x Ax

Tc

t.s.

min

(D)

≥ cA ≥ y

b y

y

T T

Docsity.com

49

Corollary. For A

m ∈ ℜ ×n^ , b

m ∈ ℜ exactly one of the following two

systems holds. Proof.^ n^ Define A’

m ∈ ℜ ×^ (m+n)

= [A | I ], x’ = [x | s ], where s

m ∈ ℜ

n^ Farkas’ Theorem to A’, b’: exactly one of (I’) and (II’) is feasible. n^ (I’) equivalent to (I), (II’) equivalent to (II).

Another Theorem of the Alternative

t.s.

(I)

x

b

Ax

x^

n

t.s. (II)

Ay by^ y y

T T m

t.s.

)(I’

sx

b

Is

Ax

s

x^

m n

t.s.

)(II’

Ay yI^ by

y

T T m

LP Strong Duality

LP Duality Theorem. For A

m ∈ ℜ ×n^ , b

m ∈ ℜ , c^ ∈ ℜ

n, if (P) and (D) are

nonempty then max = min.Proof (max

≤^ min). Weak LP duality. Proof (min

≤^ max). Suppose max <

α. We show min <

α.

n^ By definition of

α, (I) infeasible

0 ⇒^ (II) feasible by Farkas Corollary.

t.s.

max

(P)

≤ b ≥ x

x Ax

Tc

t.s.

min

(D)

≥ cA ≥ y

b y

y

T T

t.s.

(I)

xc x

b

Ax

x

T n

t.s. , (II)

z zy czAy by

z y^

T T m

α

51

LP Strong Duality

Let^

“irh†‚yˆ‡v‚‡‚DD Case 1: z = 0.^ n^ Then, { y

m ∈ ℜ T^ : yA

≥^ 0, y

T^ b <0,y

≥^ 0 } is feasible.

n^ Farkas Corollary

⇒^ { x

n ∈ ℜ : Ax

≤^ b, x

≥^ 0 } is infeasible.

n^ Contradiction since by assumption (P) is nonempty.Case 2: z > 0. n^ Scale

“†‚‡uh‡ †h‡v†svr†DDhq“

n^ Resulting

srh†viyr‡‚9hq

T^ b < α.

t.s. , (II)

z zy czAy by

z y^

T T m^

α

Docsity.com