32
Programming and Approximation Seminar in Approximation Algorithms

Linear Programming and Approximation Seminar in Approximation Algorithms

  • View
    225

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Linear Programming and Approximation Seminar in Approximation Algorithms

Linear Programming and Approximation

Seminar in Approximation Algorithms

Page 2: Linear Programming and Approximation Seminar in Approximation Algorithms

Linear Programming

Linear objective function and Linear constraints Canonical form Standard form

bAxxc :min T

0xbAxxc ,:min T

0, Unbounded

0

1

1

1

11

jj

jjjj

n

jjj

n

jjjn

jjj

n

jjj

n

jjj

xx

xxxx

bxa

bxa

bxa

s

bsxabxa

Page 3: Linear Programming and Approximation Seminar in Approximation Algorithms

Linear Programming – Example

0,,

625

103..

57min

321

321

321

321

xxx

xxx

xxxts

xxx

x=(2,1,3) is a feasible solution 7 * 2 + 1 + 5 * 3 = 30 is an upper bound the optimum

Page 4: Linear Programming and Approximation Seminar in Approximation Algorithms

Lower Bound

How can we find a lower bound? For example,

10357 321321 xxxxxx

0,,

625

103..

57min

321

321

321

321

xxx

xxx

xxxts

xxx

Page 5: Linear Programming and Approximation Seminar in Approximation Algorithms

Lower Bound

Another example:16)25()3(57 321321321 xxxxxxxxx

0,,

625

103..

57min

321

321

321

321

xxx

xxx

xxxts

xxx

Page 6: Linear Programming and Approximation Seminar in Approximation Algorithms

Lower Bound

Assign a non-negative coefficient yi to every primal inequality such that

Lower bound 10y1+6y2

0,,

)(625

)(103..

57min

321

2321

1321

321

xxx

yxxx

yxxxts

xxx

32132123211 57)25()3( xxxxxxyxxxy

Page 7: Linear Programming and Approximation Seminar in Approximation Algorithms

LP Duality

The problem of finding the best lower bound is a linear program

0,

53

12

75..

610max

Dual

21

21

21

21

21

yy

yy

yy

yyts

yy

0,,

625

103..

57min

Primal

321

321

321

321

xxx

xxx

xxxts

xxx

Page 8: Linear Programming and Approximation Seminar in Approximation Algorithms

LP Duality

0y

cyA

yb

T

T

ts ..

max

For every x and y: cTx bTy Thus, Opt(primal) Opt(dual) The dual of the dual is the primal

0x

bAx

xc

..

min

ts

T

Page 9: Linear Programming and Approximation Seminar in Approximation Algorithms

Example

0,,

625

103..

57min

Primal

321

321

321

321

xxx

xxx

xxxts

xxx

0,

53

12

75..

610max

Dual

21

21

21

21

21

yy

yy

yy

yyts

yy

x=(7/4,0,11/4) and y=(2,1) are feasible solutions

7*7/4 + 0 + 5*11/4 = 10*2 + 6*1 = 26

Thus, x and y are optimal

Page 10: Linear Programming and Approximation Seminar in Approximation Algorithms

Max Flow vs. Min s,t-cut

Path(s,t) - the set of directed paths from s to t.

Max Flow:

Dual:

Implicit Min s,t-cut Opt(Dual) = Opt(Min s,t-cut)

),(Path0

s.t.

max

:

1

tsPf

Eecf

f

ii

ePePi

m

ii

ii

Eed

tsPd

dc

e

iPe

e

Eeee

i

0

),(Path1s.t.

min

1ed 1,0ed

Page 11: Linear Programming and Approximation Seminar in Approximation Algorithms

LP-duality Theorem

Theorem: Opt(primal) is finite Opt(dual) is finite If x* and y* are optimal

Conclusion: LP NPcoNP

m

iii

n

jjj ybxc

1

*

1

*

Page 12: Linear Programming and Approximation Seminar in Approximation Algorithms

Weak Duality Theorem

If x and y are feasible

Proof:

m

iii

n

jjj ybxc

11

m

iii

m

ii

n

jjij

n

jj

m

iiij

n

jjj ybyxaxyaxc

11 11 11

)()(

Page 13: Linear Programming and Approximation Seminar in Approximation Algorithms

Complementary Slackness Conditions

x and y are optimal

Primal conditions:

Dual conditions:j

m

iiijj cyaxj

1

or 0either ,

i

n

jjiji bxayi

1

or 0either ,

Page 14: Linear Programming and Approximation Seminar in Approximation Algorithms

Complementary Slackness Conditions - Proof

j

m

iiijj cyax

1

or 0Either

By the duality theorem

Similar arguments work for y For other direction read the slide upwards

m

iii

m

ii

n

jjij

n

jj

m

iiij

n

jjj ybyxaxyaxc

11 11 11

)()(

01 1

n

jj

m

iiijj xyac

0 and 01

j

m

iiijj xyac

Page 15: Linear Programming and Approximation Seminar in Approximation Algorithms

Algorithms for Solving LP

Simplex [Dantzig 47] Ellipsoid [Khachian 79] Interior point [Karmakar 84]

Open question: Is there a strongly polynomial time algorithm for LP?

Page 16: Linear Programming and Approximation Seminar in Approximation Algorithms

Integer Programming

NP-hard Branch and Bound

LP relaxation Opt(LP) Opt(IP) Integrality Gap – Opt(IP)/Opt(LP)

nNx

0x

bAx

xc

s.t.

min T

Page 17: Linear Programming and Approximation Seminar in Approximation Algorithms

Using LP for Approximation

Finding a good lower bound - Opt(LP) Opt(IP) Integrality gap is the best we can hope for

Techniques: Rounding

– Solve LP-relaxation and then round solution.

Primal Dual– Find a feasible dual solution y, and a feasible integral primal

solution x such that cTx r * bTy

Page 18: Linear Programming and Approximation Seminar in Approximation Algorithms

Minimum Vertex Cover

LP-relaxation and its dual: (P)

(D)

Vux

Evuexx

xc

u

vu

Vuuu

0

),(1s.t.

min

Eey

Vucy

y

e

ueuee

Eee

0

s.t.

max

:

Page 19: Linear Programming and Approximation Seminar in Approximation Algorithms

Solving the Dual

Algorithm:

1. Solve (D)

2. Define:

Analysis:

CD is a cover:

ueueeD cyuC

:

:

eevDuD yyCxCxvue 0)()(),,(

Page 20: Linear Programming and Approximation Seminar in Approximation Algorithms

Solving the Dual

CD is r-approx:

Weak duality The. *2

2

)(

)(

)(

:

x

y

Cxy

yCx

Cxc

Eee

Ee euuDe

Vu eueeuD

VuuDu

eueeuD ycCu

:

,

eue

DCx:

2)(

Page 21: Linear Programming and Approximation Seminar in Approximation Algorithms

Rounding

Algorithm:

1. Solve (P)

2. Define:

Analysis:

x* is not feasible Due to the complementary conditions:

Conclusion: x(CP) is 2-approx

0: * uP xuC

)()( DP CxCx

0)()(),,( vPuP CxCxvue

Page 22: Linear Programming and Approximation Seminar in Approximation Algorithms

Rounding

Algorithm:

1. Solve (P)

2. Define:

Analysis:

x* is not feasible Clearly, Conclusion: x(C½) is 2-approx

21*:2

1 uxuC

)()(2

1 PCxCx

0)()(),,(2

12

1 vu CxCxvue

Page 23: Linear Programming and Approximation Seminar in Approximation Algorithms

The Geometry of LP Claim:

Let x1,x2 be feasible solutions

Then, x1+(1-)x2 is a feasible solution

Definition:x is a vertex if

Theorem:If a finite solution exists, there exists anoptimal solution x* which is a vertex

2121 )1( ,0,, xxxx

Page 24: Linear Programming and Approximation Seminar in Approximation Algorithms

Half IntegralityTheorem: If x is a vertex then x{0,1/2,1}n

Proof: Let x be a vertex such that x {0,1/2,1}n

Both solutions are feasible = shortest distance to {0,1/2,1}

Conclusion: 1,,0,such that 21** jxjx

21*

*2

1

0:

1:

v

v

xvV

xvV

Otherwise

'*

*

*

v

v

v

v

x

Vvx

Vvx

x

Otherwise

"*

*

*

v

v

v

v

x

Vvx

Vvx

x

)"'(21* xxx

Page 25: Linear Programming and Approximation Seminar in Approximation Algorithms

Half Integrality

Algorithm: Construct the following bipartite graph G’:

Find a vertex cover C’ in G’

(This can be done by using max-flow.)

EvuvuE

VuuV

VuuV

),(:)",'('

:""

:''

'"or '': CuCuuC

Page 26: Linear Programming and Approximation Seminar in Approximation Algorithms

Primal Dual

Construct an integral feasible solution x and a feasible solution y such that cTx r bTy

Weak duality theorem bTy Opt(LP) cTx r Opt(LP) r Opt(IP) x is r-approx

Page 27: Linear Programming and Approximation Seminar in Approximation Algorithms

Greedy H()-Approximation Algorithm While there exists an uncovered edge:

– – – Remove u and incident edges

C

}{uCC )(degminarg v

c

VvG

vu

Page 28: Linear Programming and Approximation Seminar in Approximation Algorithms

Primal Dual Schema

Modified version of the primal dual method for solving LP

Construct integral primal solution and feasible dual solution simultaneously.

We impose the primal complementary slackness conditions, while relaxing the dual conditions

Page 29: Linear Programming and Approximation Seminar in Approximation Algorithms

Relaxed Dual Conditions

Primal: Relaxed dual:

Claim: If x,y satisfy the above conditions

Proof:

j

m

iiijj cyaxj

1

or 0either ,

i

n

jjiji bxayi

1

or 0either ,

m

iii

n

jjj ybxc

11

m

iii

m

ii

n

jjij

n

jj

m

iiij

n

jjj ybyxaxyaxc

11 11 11

)()(

Page 30: Linear Programming and Approximation Seminar in Approximation Algorithms

Vertex Cover

Algorithm: For every edge e=(u,v) do:

Output C(We can construct C at the end.)

eve

eveueeue ycycy

::

,min

0 ; yC

eve

eveueeu ycycCC

::

,minarg

Page 31: Linear Programming and Approximation Seminar in Approximation Algorithms

Vertex Cover

There are no uncovered edges, or over packed vertices at the end. So x=x(C) and y are feasible.

Since x and y satisfy the relaxed complementary slackness conditions with =2, x is a 2-approx solution.– Primal:

– Relaxed Dual:

ueuee cyCu

:

2 0 ),,( vue xxyvue

Eee

Eevue

Ee euue

Vuu

euee

Vuuu yxxyxyxyxc 2

:

Page 32: Linear Programming and Approximation Seminar in Approximation Algorithms

Generalized Vertex Cover

LP-relaxation and its dual: (P)

(D)

EVtx

Evuexxx

xcxc

t

evu

Eeee

Vuuu

0

),(1s.t.

min

Eecy

Vucy

y

ee

ueuee

Eee

0

s.t.

max

: