Advanced Algorithms LP-based Algorithms LP rounding: Relax the - - PowerPoint PPT Presentation

advanced algorithms
SMART_READER_LITE
LIVE PREVIEW

Advanced Algorithms LP-based Algorithms LP rounding: Relax the - - PowerPoint PPT Presentation

Advanced Algorithms LP-based Algorithms LP rounding: Relax the integer program to LP; round the optimal LP solution to a nearby feasible integral solution. The primal-dual schema: Find a pair of


slide-1
SLIDE 1

Advanced Algorithms

南京大学 尹一通

slide-2
SLIDE 2

LP-based Algorithms

  • LP rounding:
  • Relax the integer program to LP;
  • round the optimal LP solution to a nearby

feasible integral solution.

  • The primal-dual schema:
  • Find a pair of solutions to the primal and dual

programs which are close to each other.

slide-3
SLIDE 3

Vertex Cover

Instance: An undirected graph G(V,E) Find the smallest C ⊆ V that every edge has at least

  • ne endpoint in C.

v1 v2 v3 v4

e1 e3 e2 e4 e1 e2 e3 e4

v1 v2 v3 v4

e5 e6 incidence graph

instance of set cover with frequency =2

e5 e6

slide-4
SLIDE 4

Instance: An undirected graph G(V,E) Find the smallest C ⊆ V that every edge has at least

  • ne endpoint in C.

Find a maximal matching M; return the set C ={v: uv∈M} of matched vertices;

e1 e2 e3 e4

v1 v2 v3 v4

e5 e6

maximality C is vertex cover matching |M| ≤ OPTVC |C| ≤ 2|M| ≤ 2OPT (weak duality)

slide-5
SLIDE 5

Duality

e1 e2 e3 e4

v1 v2 v3 v4

e5 e6

vertex cover: matching:

variables xv∈{0,1} variables ye∈{0,1} constraints ∑v∈e xv ≥ 1 constraints ∑e∋v ye ≤ 1

slide-6
SLIDE 6

Duality

Instance: graph G(V,E)

X

v∈V

xv X

v∈e

xv ≥ 1, xv ∈ {0, 1}, ye ∈ {0, 1}, X

e3v

yv ≤ 1, X

e∈E

ye minimize subject to maximize subject to

∀e ∈ E ∀v ∈ V ∀e ∈ E ∀v ∈ V

primal: dual: vertex covers matchings

slide-7
SLIDE 7

Duality for LP-Relaxation

Instance: graph G(V,E)

X

v∈V

xv X

v∈e

xv ≥ 1, X

e3v

yv ≤ 1, X

e∈E

ye minimize subject to maximize subject to

∀e ∈ E ∀v ∈ V ∀e ∈ E ∀v ∈ V

primal: dual:

xv≥ 0, ye≥ 0,

slide-8
SLIDE 8

Estimate the Optima

7x1 + x2 + 5x3

minimize subject to OPT ≤ any feasible solution ≤

x1 − x2 + 3x3 ≥ 10 5x1 + 2x2 − x3 ≥ 6 x1, x2, x3 ≥ 0

+ + ≤ =

16

16

slide-9
SLIDE 9

Estimate the Optima

7x1 + x2 + 5x3

minimize subject to OPT ≤

x1 − x2 + 3x3 ≥ 10 5x1 + 2x2 − x3 ≥ 6 x1, x2, x3 ≥ 0

+ + ≤

y1 y2 y1 y2 10y1 + 6y2

for any

y1 + 5y2 ≤ 7 −y1 + 2y2 ≤ 1 3y1 − y2 ≤ 5 y1, y2 ≥ 0

slide-10
SLIDE 10

Primal-Dual

7x1 + x2 + 5x3

min s.t.

x1, x2, x3 ≥ 0 10y1 + 6y2 y1 + 5y2 ≤ 7 −y1 + 2y2 ≤ 1 3y1 − y2 ≤ 5 y1, y2 ≥ 0 x1 − x2 + 3x3 ≥ 10 5x1 + 2x2 − x3 ≥ 6

max s.t. Primal Dual

∀dual feasible ≤primal OPT LP ∈ NP∩coNP

slide-11
SLIDE 11

c1 c2 cn a11 a12 a1n am1 am2 amn

Surviving Problem

price

vitamin 1 vitamin m ≥ b1 ≥ bm

x1 x2 xn solution:

healthy minimize the total price while keeping healthy

slide-12
SLIDE 12

c1 c2 cn a11 a12 a1n am1 am2 amn

price

vitamin 1 vitamin m ≥ b1 ≥ bm

x1 x2 xn solution:

healthy minimize the total price while keeping healthy

min cTx s.t. Ax ≥ b x ≥ 0

Surviving Problem

slide-13
SLIDE 13

c1 c2 cn a11 a12 a1n am1 am2 amn

LP Duality

price

vitamin 1 vitamin m b1 bm

y1 ym dual solution:

healthy

min cTx s.t. Ax ≥ b x ≥ 0 Primal: Dual: max bTy s.t. y ≥ 0 m types of vitamin pills, design a pricing system competitive to n natural foods, max the total price yTA ≤ cT

slide-14
SLIDE 14

LP Duality

min cTx s.t. Ax ≥ b x ≥ 0 Primal: Dual: max bTy s.t. yTA ≤ cT y ≥ 0 ≥ Weak Duality: yTA ≤ cT x x yTb ≤ Monogamy: dual(dual(LP)) = LP

∀ feasible primal solution x and dual solution y

slide-15
SLIDE 15

LP Duality

min cTx s.t. Ax ≥ b x ≥ 0 Primal: Dual: max bTy s.t. ≥ Weak Duality Theorem: x yTb ≤

∀ feasible primal solution x and dual solution y

cT yTA ≤ cT y ≥ 0

slide-16
SLIDE 16

LP Duality

min cTx s.t. Ax ≥ b x ≥ 0 Primal: Dual: max bTy s.t. Strong Duality Theorem: y*Tb = cTx*

Primal LP has finite optimal solution x* iff dual LP has finite optimal solution y*.

yTA ≤ cT y ≥ 0

slide-17
SLIDE 17

min cTx s.t. Ax ≥ b x ≥ 0 Primal: Dual: max bTy s.t. yTA ≤ cT y ≥ 0

∀ feasible primal solution x and dual solution y

yTb ≤ yTA x ≤ cTx

Strong Duality Theorem x and y are both optimal iff yTb = yTA x = cTx

m

X

i=1

biyi =

m

X

i=1

@

n

X

j=1

aijxj 1 A yi

n

X

j=1

cjxj =

n

X

j=1

m X

i=1

aijyi ! xj

∀i: either Ai· x = bi or yi = 0 ∀j: either yTA·j = cj or xj = 0

slide-18
SLIDE 18

min cTx s.t. Ax ≥ b x ≥ 0 Primal: Dual: max bTy s.t. yTA ≤ cT y ≥ 0

∀ feasible primal solution x and dual solution y x and y are both optimal iff ∀i: either Ai· x = bi or yi = 0 ∀j: either yTA·j = cj or xj = 0 Complementary Slackness Conditions:

Complementary Slackness

slide-19
SLIDE 19

min cTx s.t. Primal: Dual: max bTy

∀ feasible primal solution x and dual solution y ∀i: either Ai· x ≤ α bi or yi = 0 ∀j: either yTA·j ≥ cj/β or xj = 0

Complementary Slackness

Relaxed

for α, β ≥ 1:

cTx ≤ αβ bTy ≤ αβ OPTLP

n

X

j=1

cjxj ≤

n

X

j=1

β

m

X

i=1

aijyi ! xj = β

m

X

i=1

@

n

X

j=1

aijxi 1 A yj ≤ αβ

m

X

i=1

biyi

Ax ≥ b x ≥ 0 s.t. yTA ≤ cT y ≥ 0

slide-20
SLIDE 20

min cTx s.t. x ∈ ℤ≥0

Primal IP: Dual LP-relax: max bTy Find a primal integral solution x and a dual solution y ∀i: either Ai· x ≤ α bi or yi = 0 ∀j: either yTA·j ≥ cj/β or xj = 0 for α, β ≥ 1:

cTx ≤ αβ bTy ≤ αβ OPTLP

Primal-Dual Schema

≤ αβ OPTIP Ax ≥ b s.t. yTA ≤ cT y ≥ 0

slide-21
SLIDE 21

e1 e2 e3 e4

v1 v2 v3 v4

e5 e6

vertex cover: matching:

variables xv∈{0,1} variables ye∈{0,1} constraints ∑v∈e xv ≥ 1 constraints ∑e∋v ye ≤ 1

primal: dual-relax:

X

v∈V

xv

min s.t.

X

v∈e

xv ≥ 1, ∀e ∈ E xv ∈ {0, 1}, ∀v ∈ V

X

e∈E

ye

min s.t.

X

e3v

ye ≤ 1, ∀v ∈ V ye ≥ 0, ∀e ∈ E

feasible (x, y) such that: ∀e: ye > 0 ⟹ ∑v∈e xv ≤ α ∀v: xv = 1 ⟹ ∑e∋v ye = 1

slide-22
SLIDE 22

primal: dual-relax:

X

v∈V

xv

min s.t.

X

v∈e

xv ≥ 1, ∀e ∈ E xv ∈ {0, 1}, ∀v ∈ V

X

e∈E

ye

min s.t.

X

e3v

ye ≤ 1, ∀v ∈ V ye ≥ 0, ∀e ∈ E

Initially x = 0, y = 0; while E ≠ ∅

pick an e ∈ E and raise ye until some v goes tight; set xv = 1 for those tight v and delete all e∋v from E;

event: “v is tight (saturated)” ∑e∋v ye = 1

every deleted e is incident to a v that xv = 1 all edges are eventually deleted

  • ∀e ∈ E: ∑v∈e xv ≥ 1

x is feasible ∀e: either ∑v∈e xv ≤ 2 or ye = 0 ∀v: either ∑e∋v ye = 1 or xv = 0

relaxed complementary slackness:

X

v∈V

xv ≤ 2 · OPT

to 1 v∈e

slide-23
SLIDE 23

Initially x = 0, y = 0; while E ≠ ∅

pick an e ∈ E and raise ye until some v goes tight; set xv = 1 for those tight v and delete all e∋v from E;

to 1 v∈e

Find a maximal matching; return the set of matched vertices; SOL ≤ 2 OPT the returned set is a vertex cover

slide-24
SLIDE 24

The Primal-Dual Schema

  • Write down an LP-relaxation and its dual.
  • Start with a primal infeasible solution x and a

dual feasible solution y (usually x=0, y=0).

  • Raise x and y until x is feasible:
  • raise y until some dual constraints gets tight yTA·j = cj ;
  • raise xj (integrally) corresponding to the tight dual

constraints.

  • Show the complementary slackness conditions:

∀i: either Ai· x ≤ α bi or yi = 0 ∀j: either yTA·j ≥ cj/β or xj = 0 cTx ≤ αβ bTy ≤ αβ OPT

min cTx s.t. Ax ≥ b x ∈ ℤ≥0 max bTy s.t. yTA ≤ cT y ≥ 0

slide-25
SLIDE 25

minimize ∑v∈V xv subject to ∑v∈e xv ≥1, e ∈ E v ∈ V xv ∈ {0, 1}, vertex cover : given G(V,E), xv ∈ [0, 1],

LP relaxation of

Integrality Gap

Integrality gap = sup

I

OPT(I) OPTLP(I) For the LP relaxation of vertex cover: integrality gap = 2

slide-26
SLIDE 26

Facility Location

hospitals in Nanjing

slide-27
SLIDE 27

Facility Location

Find a subset I⊆F of opening facilities and a way φ: C→I of connecting all clients to them such that the total cost is minimized.

X

j∈C

cφ(j),j + X

i∈I

fi

cij fi …

… … facilities: clients:

… …

i

j

… … … … … …

  • uncapacitated facility location;
  • NP-hard; AP(Approximation Preserving)-reduction from Set Cover;
  • [Dinur, Steuer 2014] no poly-time (1-o(1))ln n-approx. algorithm unless NP = P.

Instance: set F of facilities; set C of clients; facility opening costs f: F→ [0, ∞); connection costs c: F×C→ [0, ∞);

slide-28
SLIDE 28

… …

… … facilities: clients:

… …

i

j

… … … … … …

Metric Facility Location

dij

X

j∈C

dφ(j),j + X

i∈I

fi

triangle inequality:

di1j1 + di2j1 + di2j2 ≥ di1j2 ∀i1, i2 ∈ F, ∀j1, j2 ∈ C

i1 i2

j1 j2

Instance: set F of facilities; set C of clients; facility opening costs f: F→ [0, ∞); connection metric d: F×C→ [0, ∞); Find a subset I⊆F of opening facilities and a way φ: C→I of connecting all clients to them such that the total cost is minimized.

fi

slide-29
SLIDE 29

X

j∈C

dφ(j),j + X

i∈I

fi

Instance: set F of facilities; set C of clients; facility opening costs f: F→ [0, ∞); connection metric d: F×C→ [0, ∞); Find φ: C→I ⊆ F to minimize

X

i∈F,j∈C

dijxij + X

i∈F

fiyi

min s.t.

xij, yi ∈ {0, 1},

∀i ∈ F, j ∈ C

X

i∈F

xij ≥ 1, ∀j ∈ C

∀i ∈ F, j ∈ C

LP-relaxation:

xij, yi ≥ 0, dij fi

yi ∈ {0, 1}

xij ∈ {0, 1}

indicates i ∈ I indicates i = φ(j)

yi ≥ xij,

… …

… … facilities: clients:

… …

i

j

… … … … … …

i

slide-30
SLIDE 30

… …

… … facilities: clients:

… …

i

j

… … … … … …

X

i∈F,j∈C

dijxij + X

i∈F

fiyi

min s.t.

∀i ∈ F, j ∈ C

X

i∈F

xij ≥ 1,

∀j ∈ C ∀i ∈ F, j ∈ C

Primal:

yi − xij ≥ 0,

dij fi

Dual-relax: max

X

j∈C

αj

s.t.

X

j∈C

βij ≤ fi,

∀i ∈ F

∀i ∈ F, j ∈ C

αj − βij ≤ dij,

αj, βij ≥ 0,

∀i ∈ F, j ∈ C

αj βij αj : amount of value paid by client j to all facilities βij ≥ αj - dij : payment to facility i by client j (after deduction)

xij, yi ∈ {0, 1},

complimentary slackness conditions: (if ideally held)

xij =1 ⇒ αj - βij = dij ; yi =1 ⇒ ∑j∈C βij = fi ; αj > 0 ⇒ ∑i∈F xij = 1 ; βij > 0 ⇒ yi = xij ;

slide-31
SLIDE 31

X

i∈F,j∈C

dijxij + X

i∈F

fiyi

min s.t.

∀i ∈ F, j ∈ C

X

i∈F

xij ≥ 1,

∀j ∈ C ∀i ∈ F, j ∈ C

yi − xij ≥ 0,

max

X

j∈C

αj

s.t.

X

j∈C

βij ≤ fi,

∀i ∈ F

∀i ∈ F, j ∈ C

αj − βij ≤ dij,

αj, βij ≥ 0,

∀i ∈ F, j ∈ C xij, yi ∈ {0, 1},

Initially α = 0, β = 0, no facility is open, no client is served; raise αj for all client j simultaneously at a uniform continuous rate:

  • upon αj = dij for a closed facility i: edge (i,j) is paid; fix βij = αj - dij as αj being raised;
  • upon ∑j∈C βij = fi : tentatively open facility i; connect all clients j with paid (i,j) to

facility i and stop raising αj;

  • upon αj = dij for a tentatively open facility i: connect client j to facility i and stop

raising αj;

dij fi αj βij

… …

… … facilities: clients:

… …

i

j

… … … … … …

slide-32
SLIDE 32

Initially α = 0, β = 0, no facility is open, no client is served; raise αj for all client j simultaneously at a uniform continuous rate:

  • upon αj = dij for a closed facility i: edge (i,j) is paid; fix βij = αj - dij as αj being raised;
  • upon ∑j∈C βij = fi : tentatively open facility i; connect all clients j with paid (i,j) to

facility i and stop raising αj;

  • upon αj = dij for a tentatively open facility i: connect client j to facility i and stop

raising αj;

  • The events that occur at the same time are processed in arbitrary order.
  • Fully paid facilities are tentatively open: ∑j∈C βij = fi
  • Fully paid edges to tentatively opening facilities are connected: αj - βij = dij
  • Eventually all clients connect to tentatively opening facilities.

A client may connect to more than one facilities! dij fi αj βij

… …

… … facilities: clients:

… …

i

j

… … … … … …

slide-33
SLIDE 33

Initially α = 0, β = 0, no facility is open, no client is served; raise αj for all client j simultaneously at a uniform continuous rate:

  • upon αj = dij for a closed facility i: edge (i,j) is paid; fix βij = αj - dij as αj being raised;
  • upon ∑j∈C βij = fi : tentatively open facility i; connect all clients j with paid (i,j) to

facility i and stop raising αj;

  • upon αj = dij for a tentatively open facility i: connect client j to facility i and stop

raising αj;

Phase I: Phase II:

construct graph G(V,E) where V={tentatively open facilities} and (i1, i2)∈E if facilities i1, i2 are connected to same client j in Phase I; find a maximal independent set I of G and permanently open facilities in I; connect facilities in I to the directly connected clients in Phase I; for every unconnected client (the indirectly connected clients): connect it to the nearest open facility;

i1 i2

j1 j2

dij fi αj βij

… …

… … facilities: clients:

… …

i

j

… … … … … …

slide-34
SLIDE 34

Initially α = 0, β = 0, no facility is open, no client is served; raise αj for all client j simultaneously at a uniform continuous rate:

  • upon αj = dij for a closed facility i: edge (i,j) is paid; fix βij = αj - dij as αj being raised;
  • upon ∑j∈C βij = fi : tentatively open facility i; connect all clients j with paid (i,j) to

facility i and stop raising αj;

  • upon αj = dij for a tentatively open facility i: connect client j to facility i and stop

raising αj;

Phase I: Phase II:

construct graph G(V,E) where V={tentatively open facilities} and (i1, i2)∈E if facilities i1, i2 are connected to same client j in Phase I; find a maximal independent set I of G and permanently open facilities in I; connect facilities in I to the directly connected clients in Phase I; for every unconnected client (the indirectly connected clients): connect it to the nearest open facility;

i1 i2

j1 j2

Every client is connected to exact one open facilities.

I is independent set (feasible)

slide-35
SLIDE 35

X

i∈F,j∈C

dijxij + X

i∈F

fiyi

min s.t.

∀i ∈ F, j ∈ C

X

i∈F

xij ≥ 1,

∀j ∈ C ∀i ∈ F, j ∈ C

Primal:

yi − xij ≥ 0,

dij fi

Dual-relax: max

X

j∈C

αj

s.t.

X

j∈C

βij ≤ fi,

∀i ∈ F

∀i ∈ F, j ∈ C

αj − βij ≤ dij,

αj, βij ≥ 0,

∀i ∈ F, j ∈ C

αj βij αj : amount of value paid by client j to all facilities βij ≥ αj - dij : payment to facility i by client j (after deduction)

xij, yi ∈ {0, 1},

complimentary slackness conditions: (if ideally held)

xij =1 ⇒ αj - βij = dij ; yi =1 ⇒ ∑j∈C βij = fi ; αj > 0 ⇒ ∑i∈F xij = 1 ; βij > 0 ⇒ yi = xij ;

… …

… … facilities: clients:

… …

i

j

… … … … … …

slide-36
SLIDE 36

Initially α = 0, β = 0, no facility is open, no client is served; raise αj for all client j simultaneously at a uniform continuous rate:

  • upon αj = dij for a closed facility i: edge (i,j) is paid; fix βij = αj - dij as αj being raised;
  • upon ∑j∈C βij = fi : tentatively open facility i; connect all clients j with paid (i,j) to

facility i and stop raising αj;

  • upon αj = dij for a tentatively open facility i: connect client j to facility i and stop

raising αj;

Phase I: Phase II:

construct graph G(V,E) where V={tentatively open facilities} and (i1, i2)∈E if facilities i1, i2 are connected to same client j in Phase I; find a maximal independent set I of G and permanently open facilities in I; connect facilities in I to the directly connected clients in Phase I; for every unconnected client (the indirectly connected clients): connect it to the nearest open facility;

i1 i2

j1 j2

SOL

φ(j) = ( i that βij = αj - dij

if j is directly connected if j is indirectly connected nearest facility in I

X

i∈I

fi + X

j:directly connected

dφ(j)j + X

j:indirectly connected

dφ(j)j

≤ X

j:directly connected

αj

n

≤ 3 X

j:indirectly connected

αj triangle inequality + maximality of I

≤ 3 X

j∈C

αj ≤ 3 OPT

=

slide-37
SLIDE 37

Initially α = 0, β = 0, no facility is open, no client is served; raise αj for all client j simultaneously at a uniform continuous rate:

  • upon αj = dij for a closed facility i: edge (i,j) is paid; fix βij = αj - dij as αj being raised;
  • upon ∑j∈C βij = fi : tentatively open facility i; connect all clients j with paid (i,j) to

facility i and stop raising αj;

  • upon αj = dij for a tentatively open facility i: connect client j to facility i and stop

raising αj;

Phase I: Phase II:

construct graph G(V,E) where V={tentatively open facilities} and (i1, i2)∈E if facilities i1, i2 are connected to same client j in Phase I; find a maximal independent set I of G and permanently open facilities in I; connect facilities in I to the directly connected clients in Phase I; for every unconnected client (the indirectly connected clients): connect it to the nearest open facility;

i1 i2

j1 j2

SOL ≤ 3 OPT can be implemented discretely:

  • sort all edges (i,j) ∈ F×C by non-decreasing dij
  • dynamically maintain the time of next event by heap

in O(m log m) time, m=|F||C|

slide-38
SLIDE 38

X

j∈C

dφ(j),j + X

i∈I

fi

Instance: set F of facilities; set C of clients; facility opening costs f: F→ [0, ∞); connection metric d: F×C→ [0, ∞); Find φ: C→I ⊆ F to minimize

X

i∈F,j∈C

dijxij + X

i∈F

fiyi

min s.t.

xij, yi ∈ {0, 1},

∀i ∈ F, j ∈ C

X

i∈F

xij ≥ 1, ∀j ∈ C

∀i ∈ F, j ∈ C

yi − xij ≥ 0,

dij fi …

… … facilities: clients:

… …

i

j

… … … … … …

  • Integrality gap = 3
  • no poly-time <1.463-approx.

algorithm unless NP=P

  • [Li 2011] 1.488-approx.

algorithm