vertex cover problems - kit · vertex cover problems consider a graph g =(v,e) s ⊆v is a vertex...

58
Rob van Stee: Approximations- und Online-Algorithmen 1 Vertex Cover Problems Consider a graph G =( V, E ) S V is a vertex cover if { u, v } E : u S v S minimum vertex cover (MIN-VCP): find a vertex cover S that minimizes |S|.

Upload: others

Post on 06-Jul-2020

7 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Vertex Cover Problems - KIT · Vertex Cover Problems Consider a graph G =(V,E) S ⊆V is a vertex cover if ∀{u,v}∈E : u ∈S∨v ∈S minimum vertex cover (MIN-VCP): find a vertex

Rob van Stee: Approximations- und Online-Algorithmen 1

Vertex Cover Problems

Consider a graphG = (V,E)

S ⊆V is avertex coverif

∀{u,v} ∈ E : u ∈ S∨ v ∈ S

minimum vertex cover (MIN-VCP):

find a vertex coverS that minimizes|S|.

Page 2: Vertex Cover Problems - KIT · Vertex Cover Problems Consider a graph G =(V,E) S ⊆V is a vertex cover if ∀{u,v}∈E : u ∈S∨v ∈S minimum vertex cover (MIN-VCP): find a vertex

Rob van Stee: Approximations- und Online-Algorithmen 2

Motivation

� This problem has many applications

� Example: placing ATMs in a city

� Each additional ATM costs money

� Want to have an ATM in every street (block, district)

� Where should they be placed so that we need as little ATMs

as possible?

Page 3: Vertex Cover Problems - KIT · Vertex Cover Problems Consider a graph G =(V,E) S ⊆V is a vertex cover if ∀{u,v}∈E : u ∈S∨v ∈S minimum vertex cover (MIN-VCP): find a vertex

Rob van Stee: Approximations- und Online-Algorithmen 3

Greedy Algorithm

Function greedyVC(V,E)

C:= /0

while E 6= /0 doselectany{u,v} ∈ E

C:= C∪{u,v}remove all edges incident tou or v from E

return C

Exercise: explain how to implement the algorithm

to run in timeO(|V |+ |E|)

a

d

e f g

hb c

a

d

g

hb c

e f

a

hb c

e f

d

g

a f

hb c

e

d

g

(postprocess:)

Page 4: Vertex Cover Problems - KIT · Vertex Cover Problems Consider a graph G =(V,E) S ⊆V is a vertex cover if ∀{u,v}∈E : u ∈S∨v ∈S minimum vertex cover (MIN-VCP): find a vertex

Rob van Stee: Approximations- und Online-Algorithmen 4

Greedy Algorithm

Function greedyVC(V,E)

C:= /0

while E 6= /0 doselectany{u,v} ∈ E

C:= C∪{u,v}remove all edges incident tou or v from E

return C

Exercise: explain how to implement the algorithm

to run in timeO(|V |+ |E|)

a

d

e f g

hb c

a

d

g

hb c

e f

a

hb c

e f

d

g

a f

hb c

e

d

g

Page 5: Vertex Cover Problems - KIT · Vertex Cover Problems Consider a graph G =(V,E) S ⊆V is a vertex cover if ∀{u,v}∈E : u ∈S∨v ∈S minimum vertex cover (MIN-VCP): find a vertex

Rob van Stee: Approximations- und Online-Algorithmen 5

Greedy Algorithm

Function greedyVC(V,E)

C:= /0

while E 6= /0 doselectany{u,v} ∈ E

C:= C∪{u,v}remove all edges incident tou or v from E

return C

Exercise: explain how to implement the algorithm

to run in timeO(|V |+ |E|)

a

d

e f g

hb c

a

d

g

hb c

e f

a

hb c

e f

d

g

a f

hb c

e

d

g

Page 6: Vertex Cover Problems - KIT · Vertex Cover Problems Consider a graph G =(V,E) S ⊆V is a vertex cover if ∀{u,v}∈E : u ∈S∨v ∈S minimum vertex cover (MIN-VCP): find a vertex

Rob van Stee: Approximations- und Online-Algorithmen 6

Greedy Algorithm

Function greedyVC(V,E)

C:= /0

while E 6= /0 doselectany{u,v} ∈ E

C:= C∪{u,v}remove all edges incident tou or v from E

return C

Exercise: explain how to implement the algorithm

to run in timeO(|V |+ |E|)

a

d

e f g

hb c

a

d

g

hb c

e f

a

hb c

e f

d

g

a f

hb c

e

d

g

Page 7: Vertex Cover Problems - KIT · Vertex Cover Problems Consider a graph G =(V,E) S ⊆V is a vertex cover if ∀{u,v}∈E : u ∈S∨v ∈S minimum vertex cover (MIN-VCP): find a vertex

Rob van Stee: Approximations- und Online-Algorithmen 7

Theorem 1. Algorithm greedyVC computes a

two-approximation of MIN-VCP.

Proof. Correctness: trivial since only covered edges are

removed.

Quality: LetA denote the set of edges selected by greedyVC.

We have|C|= 2|A|.A is amatching, i.e., no node covers two edges inA.

Hence, any vertex cover contains at least one node from each

edge inA, i.e.,opt≥ |A|.

Page 8: Vertex Cover Problems - KIT · Vertex Cover Problems Consider a graph G =(V,E) S ⊆V is a vertex cover if ∀{u,v}∈E : u ∈S∨v ∈S minimum vertex cover (MIN-VCP): find a vertex

Rob van Stee: Approximations- und Online-Algorithmen 8

Weighted Vertex Cover

Consider a graphG = (V,E)

S ⊆V is a vertex cover if

∀{u,v} ∈ E : u ∈ S∨ v ∈ S

minimum WEIGHT vertex cover

(WEIGHT-VCP):

find a vertex coverS that minimizes

∑v∈S

c(s)

10

11

1

7

42 3

59

1 1 1

11

Page 9: Vertex Cover Problems - KIT · Vertex Cover Problems Consider a graph G =(V,E) S ⊆V is a vertex cover if ∀{u,v}∈E : u ∈S∨v ∈S minimum vertex cover (MIN-VCP): find a vertex

Rob van Stee: Approximations- und Online-Algorithmen 9

0-1 ILP Formulation

AssumeV = {1, . . . ,n}Variables:xv = 1 iff v ∈V

minimize c ·xsubject to

∀{u,v} ∈ E : xu + xv ≥ 1

∀v ∈V : xv ∈ {0,1}

Page 10: Vertex Cover Problems - KIT · Vertex Cover Problems Consider a graph G =(V,E) S ⊆V is a vertex cover if ∀{u,v}∈E : u ∈S∨v ∈S minimum vertex cover (MIN-VCP): find a vertex

Rob van Stee: Approximations- und Online-Algorithmen 10

0-1 ILP Formulation Linear Relaxation

AssumeV = {1, . . . ,n}Variables:xv = 1 iff v ∈V

minimizec ·xsubject to

∀{u,v} ∈ E : xu + xv ≥ 1

∀v ∈V : xv ∈ {0,1}

AssumeV = {1, . . . ,n}Variables:xv = 1 iff v ∈V

minimizec ·xsubject to

∀{u,v} ∈ E : xu + xv ≥ 1

∀v ∈V : xv ≥ 0

Page 11: Vertex Cover Problems - KIT · Vertex Cover Problems Consider a graph G =(V,E) S ⊆V is a vertex cover if ∀{u,v}∈E : u ∈S∨v ∈S minimum vertex cover (MIN-VCP): find a vertex

Rob van Stee: Approximations- und Online-Algorithmen 11

0-1 ILP Formulation Linear Relaxation

AssumeV = {1, . . . ,n}Variables:xv = 1 iff v ∈V

minimizec ·xsubject to

∀{u,v} ∈ E : xu + xv ≥ 1

∀v ∈V : xv ∈ {0,1}

AssumeV = {1, . . . ,n}Variables:xv = 1 iff v ∈V

minimizec ·xsubject to

∀{u,v} ∈ E : xu + xv ≥ 1

∀v ∈V : xv ≥ 0

LP Rounding Algorithm for WEIGHT-VCP

Function lpWeightedVC(V,E,c)x:= lpSolve(linearRelaxation(V,E,c))return {v ∈V : xv ≥ 1/2}

Page 12: Vertex Cover Problems - KIT · Vertex Cover Problems Consider a graph G =(V,E) S ⊆V is a vertex cover if ∀{u,v}∈E : u ∈S∨v ∈S minimum vertex cover (MIN-VCP): find a vertex

Rob van Stee: Approximations- und Online-Algorithmen 12

Theorem 2. Algorithm lpWeightedVC computes a

two-approximation of WEIGHT-VCP.

Correctness:Consider any edge{u,v} ∈ E.

We havexu + xv ≥ 1,

hence,max{xu,xv} ≥ 1/2,

i.e., rounding will put at least one of{u,v} into the output.

Page 13: Vertex Cover Problems - KIT · Vertex Cover Problems Consider a graph G =(V,E) S ⊆V is a vertex cover if ∀{u,v}∈E : u ∈S∨v ∈S minimum vertex cover (MIN-VCP): find a vertex

Rob van Stee: Approximations- und Online-Algorithmen 13

Theorem 2. Algorithm lpWeightedVC computes a

two-approximation of WEIGHT-VCP.

Quality: Let

x := the solution computed by lpWeightedVC

x∗ := the optimal solution, and

x̄ := the optimal solution of the linear relaxation

c ·x = ∑x̄i≥1/2

ci ≤ ∑x̄i≥1/2

2x̄ici ≤ 2n

∑i=1

x̄ici = 2c · x̄≤ 2c·x∗

Page 14: Vertex Cover Problems - KIT · Vertex Cover Problems Consider a graph G =(V,E) S ⊆V is a vertex cover if ∀{u,v}∈E : u ∈S∨v ∈S minimum vertex cover (MIN-VCP): find a vertex

Rob van Stee: Approximations- und Online-Algorithmen 14

Theorem 2. Algorithm lpWeightedVC computes a

two-approximation of WEIGHT-VCP.

Quality: Let

x := the solution computed by lpWeightedVC

x∗ := the optimal solution, and

x̄ := the optimal solution of the linear relaxation

c ·x = ∑x̄i≥1/2

ci ≤ ∑x̄i≥1/2

2x̄ici ≤ 2n

∑i=1

x̄ici = 2c · x̄≤ 2c·x∗

Page 15: Vertex Cover Problems - KIT · Vertex Cover Problems Consider a graph G =(V,E) S ⊆V is a vertex cover if ∀{u,v}∈E : u ∈S∨v ∈S minimum vertex cover (MIN-VCP): find a vertex

Rob van Stee: Approximations- und Online-Algorithmen 15

Theorem 2. Algorithm lpWeightedVC computes a

two-approximation of WEIGHT-VCP.

Quality: Let

x := the solution computed by lpWeightedVC

x∗ := the optimal solution, and

x̄ := the optimal solution of the linear relaxation

c ·x = ∑x̄i≥1/2

ci ≤ ∑x̄i≥1/2

2x̄ici ≤ 2n

∑i=1

x̄ici = 2c · x̄≤ 2c·x∗

Page 16: Vertex Cover Problems - KIT · Vertex Cover Problems Consider a graph G =(V,E) S ⊆V is a vertex cover if ∀{u,v}∈E : u ∈S∨v ∈S minimum vertex cover (MIN-VCP): find a vertex

Rob van Stee: Approximations- und Online-Algorithmen 16

Theorem 2. Algorithm lpWeightedVC computes a

two-approximation of WEIGHT-VCP.

Quality: Let

x := the solution computed by lpWeightedVC

x∗ := the optimal solution, and

x̄ := the optimal solution of the linear relaxation

c ·x = ∑x̄i≥1/2

ci ≤ ∑x̄i≥1/2

2x̄ici ≤ 2n

∑i=1

x̄ici = 2c · x̄≤ 2c·x∗

Page 17: Vertex Cover Problems - KIT · Vertex Cover Problems Consider a graph G =(V,E) S ⊆V is a vertex cover if ∀{u,v}∈E : u ∈S∨v ∈S minimum vertex cover (MIN-VCP): find a vertex

Rob van Stee: Approximations- und Online-Algorithmen 17

Theorem 2. Algorithm lpWeightedVC computes a

two-approximation of WEIGHT-VCP.

Quality: Let

x := the solution computed by lpWeightedVC

x∗ := the optimal solution, and

x̄ := the optimal solution of the linear relaxation

c ·x = ∑x̄i≥1/2

ci ≤ ∑x̄i≥1/2

2x̄ici ≤ 2n

∑i=1

x̄ici = 2c · x̄≤ 2c·x∗

Page 18: Vertex Cover Problems - KIT · Vertex Cover Problems Consider a graph G =(V,E) S ⊆V is a vertex cover if ∀{u,v}∈E : u ∈S∨v ∈S minimum vertex cover (MIN-VCP): find a vertex

Rob van Stee: Approximations- und Online-Algorithmen 18

Iterated Rounding

[Vazirani Section 23.2]

Function iteratedLpWeightedVC(V,E,c)M:= /0

while |E|> 0 dox:= lpSolve(linearRelaxation(V,E,c))let v denote the node whichmaximizesxv

M:= M∪{v}V := V \{v}E:= E \{{u,v} ∈ E}

return M

Page 19: Vertex Cover Problems - KIT · Vertex Cover Problems Consider a graph G =(V,E) S ⊆V is a vertex cover if ∀{u,v}∈E : u ∈S∨v ∈S minimum vertex cover (MIN-VCP): find a vertex

Rob van Stee: Approximations- und Online-Algorithmen 19

Iterated Rounding: Discussion

� Might give better solutions for many inputs

� No better approximationguaranteesfor VC

� Larger (still polynomial) execution time

� But: Resolving an LP is often quite fast

� Important technique for other problems

Page 20: Vertex Cover Problems - KIT · Vertex Cover Problems Consider a graph G =(V,E) S ⊆V is a vertex cover if ∀{u,v}∈E : u ∈S∨v ∈S minimum vertex cover (MIN-VCP): find a vertex

Rob van Stee: Approximations- und Online-Algorithmen 20

A Randomized Algorithm

[Ausiello et al. Section 5.1]

Function randWeightedVC(V,E,c)C:= /0

while E 6= /0 doselect any{v, t} ∈ E

flip a coin with sides{v, t} and

P [v] =ct

cv + ctx:= upper side of coin

C:= C∪{x}remove all edges incident tox from E

return C

a f

h

e

d

g

b c

a

h

e

d

g

b c

f

a

h

e

db c

f g

h

e

db c

f ga

e

db c

f ga

h

Page 21: Vertex Cover Problems - KIT · Vertex Cover Problems Consider a graph G =(V,E) S ⊆V is a vertex cover if ∀{u,v}∈E : u ∈S∨v ∈S minimum vertex cover (MIN-VCP): find a vertex

Rob van Stee: Approximations- und Online-Algorithmen 21

Theorem 3. Algorithm randWeightedVC computes

a vertex cover x with E[c ·x]≤ 2c ·x∗.

Correctness:as for greedyVC.

Page 22: Vertex Cover Problems - KIT · Vertex Cover Problems Consider a graph G =(V,E) S ⊆V is a vertex cover if ∀{u,v}∈E : u ∈S∨v ∈S minimum vertex cover (MIN-VCP): find a vertex

Rob van Stee: Approximations- und Online-Algorithmen 22

Theorem: Algorithm randWeightedVC computes

a vertex coverx with E[c ·x]≤ 2c ·x∗.Quality: Define the random variables

Xv :=

cv if v ∈ x

0 otherwise(1)

X{v,t},v :=

cv if {v, t} is selected andv ∈ x

0 otherwise(2)

Note thatXv = ∑{t:{v,t}∈E}

X{v,t},v

Page 23: Vertex Cover Problems - KIT · Vertex Cover Problems Consider a graph G =(V,E) S ⊆V is a vertex cover if ∀{u,v}∈E : u ∈S∨v ∈S minimum vertex cover (MIN-VCP): find a vertex

Rob van Stee: Approximations- und Online-Algorithmen 23

Lemma 4. E[X{v,t},v] = E[X{v,t},t ]

Proof.

E[X{v,t},v] = cvP [{v, t} is selected]P [v ∈ x]

E[X{v,t},v] = cvP [{v, t} is selected]ct

cv + ct

= ctP [{v, t} is selected]cv

cv + ct

= E[X{v,t},t ]

Page 24: Vertex Cover Problems - KIT · Vertex Cover Problems Consider a graph G =(V,E) S ⊆V is a vertex cover if ∀{u,v}∈E : u ∈S∨v ∈S minimum vertex cover (MIN-VCP): find a vertex

Rob van Stee: Approximations- und Online-Algorithmen 24

Lemma 4. E[X{v,t},v] = E[X{v,t},t ]

Proof.

E[X{v,t},v] = cvP [{v, t} is selected]P [v ∈ x]

E[X{v,t},v] = cvP [{v, t} is selected]ct

cv + ct

= ctP [{v, t} is selected]cv

cv + ct

= E[X{v,t},t ]

Page 25: Vertex Cover Problems - KIT · Vertex Cover Problems Consider a graph G =(V,E) S ⊆V is a vertex cover if ∀{u,v}∈E : u ∈S∨v ∈S minimum vertex cover (MIN-VCP): find a vertex

Rob van Stee: Approximations- und Online-Algorithmen 25

Lemma 4. E[X{v,t},v] = E[X{v,t},t ]

Proof.

E[X{v,t},v] = cvP [{v, t} is selected]P [v ∈ x]

E[X{v,t},v] = cvP [{v, t} is selected]ct

cv + ct

= ctP [{v, t} is selected]cv

cv + ct

= E[X{v,t},t ]

Page 26: Vertex Cover Problems - KIT · Vertex Cover Problems Consider a graph G =(V,E) S ⊆V is a vertex cover if ∀{u,v}∈E : u ∈S∨v ∈S minimum vertex cover (MIN-VCP): find a vertex

Rob van Stee: Approximations- und Online-Algorithmen 26

Lemma 5. ∑v 6∈x∗

E[Xv]≤ ∑t∈x∗

E[Xt ]

Proof.

∑v 6∈x∗

E[Xv] = ∑v 6∈x∗

E

[

∑{t:{v,t}∈E}

X{v,t},v

]

(Xv = ∑{t:{v,t}∈E}

X{v,t},v)

= ∑v 6∈x∗

∑{t:{v,t}∈E}

E[X{v,t},v] Linearity ofE[·]

= ∑v 6∈x∗

∑{t:{v,t}∈E}

E[X{v,t},t ](* ). Lemma 4

But also∑t∈x∗

E[Xt ] = ∑t∈x∗

∑{v:{v,t}∈E}

E[X{v,t},t ](** ).

Every term in (* ) shows up in (** ).

Page 27: Vertex Cover Problems - KIT · Vertex Cover Problems Consider a graph G =(V,E) S ⊆V is a vertex cover if ∀{u,v}∈E : u ∈S∨v ∈S minimum vertex cover (MIN-VCP): find a vertex

Rob van Stee: Approximations- und Online-Algorithmen 27

Lemma 5. ∑v 6∈x∗

E[Xv]≤ ∑t∈x∗

E[Xt ]

Proof.

∑v 6∈x∗

E[Xv] = ∑v 6∈x∗

E

[

∑{t:{v,t}∈E}

X{v,t},v

]

(Xv = ∑{t:{v,t}∈E}

X{v,t},v)

= ∑v 6∈x∗

∑{t:{v,t}∈E}

E[X{v,t},v] Linearity ofE[·]

= ∑v 6∈x∗

∑{t:{v,t}∈E}

E[X{v,t},t ](* ). Lemma 4

But also∑t∈x∗

E[Xt ] = ∑t∈x∗

∑{v:{v,t}∈E}

E[X{v,t},t ](** ).

Every term in (* ) shows up in (** ).

Page 28: Vertex Cover Problems - KIT · Vertex Cover Problems Consider a graph G =(V,E) S ⊆V is a vertex cover if ∀{u,v}∈E : u ∈S∨v ∈S minimum vertex cover (MIN-VCP): find a vertex

Rob van Stee: Approximations- und Online-Algorithmen 28

Lemma 5. ∑v 6∈x∗

E[Xv]≤ ∑t∈x∗

E[Xt ]

Proof.

∑v 6∈x∗

E[Xv] = ∑v 6∈x∗

E

[

∑{t:{v,t}∈E}

X{v,t},v

]

(Xv = ∑{t:{v,t}∈E}

X{v,t},v)

= ∑v 6∈x∗

∑{t:{v,t}∈E}

E[X{v,t},v] Linearity ofE[·]

= ∑v 6∈x∗

∑{t:{v,t}∈E}

E[X{v,t},t ](* ). Lemma 4

But also∑t∈x∗

E[Xt ] = ∑t∈x∗

∑{v:{v,t}∈E}

E[X{v,t},t ](** ).

Every term in (* ) shows up in (** ).

Page 29: Vertex Cover Problems - KIT · Vertex Cover Problems Consider a graph G =(V,E) S ⊆V is a vertex cover if ∀{u,v}∈E : u ∈S∨v ∈S minimum vertex cover (MIN-VCP): find a vertex

Rob van Stee: Approximations- und Online-Algorithmen 29

Lemma 5. ∑v 6∈x∗

E[Xv]≤ ∑t∈x∗

E[Xt ]

Proof.

∑v 6∈x∗

E[Xv] = ∑v 6∈x∗

E

[

∑{t:{v,t}∈E}

X{v,t},v

]

(Xv = ∑{t:{v,t}∈E}

X{v,t},v)

= ∑v 6∈x∗

∑{t:{v,t}∈E}

E[X{v,t},v] Linearity ofE[·]

= ∑v 6∈x∗

∑{t:{v,t}∈E}

E[X{v,t},t ](* ). Lemma 4

But also∑t∈x∗

E[Xt ] = ∑t∈x∗

∑{v:{v,t}∈E}

E[X{v,t},t ](** ).

Every term in (* ) shows up in (** ).

v

t tt

...

Page 30: Vertex Cover Problems - KIT · Vertex Cover Problems Consider a graph G =(V,E) S ⊆V is a vertex cover if ∀{u,v}∈E : u ∈S∨v ∈S minimum vertex cover (MIN-VCP): find a vertex

Rob van Stee: Approximations- und Online-Algorithmen 30

Theorem: Algorithm randWeightedVC computes

a vertex coverx with E[c ·x]≤ 2c ·x∗.Quality: (Finishing Up)

∑v∈V

E[Xv] = ∑v 6∈x∗

E[Xv]+ ∑t∈x∗

E[Xt ]

Lemma 5≤≤ 2 ∑

t∈x∗ct Xt = 0 or Xt = ct

Page 31: Vertex Cover Problems - KIT · Vertex Cover Problems Consider a graph G =(V,E) S ⊆V is a vertex cover if ∀{u,v}∈E : u ∈S∨v ∈S minimum vertex cover (MIN-VCP): find a vertex

Rob van Stee: Approximations- und Online-Algorithmen 31

Theorem: Algorithm randWeightedVC computes

a vertex coverx with E[c ·x]≤ 2c ·x∗.Quality: (Finishing Up)

∑v∈V

E[Xv] = ∑v 6∈x∗

E[Xv]+ ∑t∈x∗

E[Xt ]

Lemma 5≤ 2 ∑

t∈x∗E[Xt ]

≤ 2 ∑t∈x∗

ct Xt = 0 or Xt = ct

Page 32: Vertex Cover Problems - KIT · Vertex Cover Problems Consider a graph G =(V,E) S ⊆V is a vertex cover if ∀{u,v}∈E : u ∈S∨v ∈S minimum vertex cover (MIN-VCP): find a vertex

Rob van Stee: Approximations- und Online-Algorithmen 32

Theorem: Algorithm randWeightedVC computes

a vertex coverx with E[c ·x]≤ 2c ·x∗.Quality: (Finishing Up)

∑v∈V

E[Xv] = ∑v 6∈x∗

E[Xv]+ ∑t∈x∗

E[Xt ]

Lemma 5≤ 2 ∑

t∈x∗E[Xt ]

≤ 2 ∑t∈x∗

ct Xt = 0 or Xt = ct

Page 33: Vertex Cover Problems - KIT · Vertex Cover Problems Consider a graph G =(V,E) S ⊆V is a vertex cover if ∀{u,v}∈E : u ∈S∨v ∈S minimum vertex cover (MIN-VCP): find a vertex

Rob van Stee: Approximations- und Online-Algorithmen 33

Theorem: Algorithm randWeightedVC computes

a vertex coverx with E[c ·x]≤ 2c ·x∗.Quality: (Finishing Up)

∑v∈V

E[Xv] = ∑v 6∈x∗

E[Xv]+ ∑t∈x∗

E[Xt ]

Lemma 5≤ 2 ∑

t∈x∗E[Xt ]

≤ 2 ∑t∈x∗

ct Xt = 0 or Xt = ct

= 2c ·x∗

Page 34: Vertex Cover Problems - KIT · Vertex Cover Problems Consider a graph G =(V,E) S ⊆V is a vertex cover if ∀{u,v}∈E : u ∈S∨v ∈S minimum vertex cover (MIN-VCP): find a vertex

Rob van Stee: Approximations- und Online-Algorithmen 34

More on Vertex Cover

� There are simple deterministic linear time

2-approximations. (Special case of set covering)

� Best known algorithm: ratio 2−Θ(1/√

logn)

� fixed parameter algorithms: [Niedermeyer Rossmanith]find

optimal solution in timeO(

kn+ k21.292k)

if |x| ≤ k. Key

idea: (clever) exhaustive search+ problem reductions.

Example: include nodes of degree≥ k.

include neighbors of degree 1 nodes

Page 35: Vertex Cover Problems - KIT · Vertex Cover Problems Consider a graph G =(V,E) S ⊆V is a vertex cover if ∀{u,v}∈E : u ∈S∨v ∈S minimum vertex cover (MIN-VCP): find a vertex

Rob van Stee: Approximations- und Online-Algorithmen 35

Scheduling on Unrelated Parallel Machines

[Vazirani Chapter 17]

J: set ofn jobs

M: set ofm machines

pi j : processing time of jobj onmachinei

x( j): Machine where jobj is executed

Li: ∑{ j:x( j)=i}

pi j, load of machinei

Objective: Minimize MakespanLmax= maxi Li

Page 36: Vertex Cover Problems - KIT · Vertex Cover Problems Consider a graph G =(V,E) S ⊆V is a vertex cover if ∀{u,v}∈E : u ∈S∨v ∈S minimum vertex cover (MIN-VCP): find a vertex

Rob van Stee: Approximations- und Online-Algorithmen 36

A Misguided ILP model

minimizet subject to

∀ j ∈ J : ∑i∈M

xi j = 1

∀i ∈ M : ∑j∈J

xi j pi j ≤ t

∀i ∈ M, j ∈ J : xi j ∈ {0,1}

Page 37: Vertex Cover Problems - KIT · Vertex Cover Problems Consider a graph G =(V,E) S ⊆V is a vertex cover if ∀{u,v}∈E : u ∈S∨v ∈S minimum vertex cover (MIN-VCP): find a vertex

Rob van Stee: Approximations- und Online-Algorithmen 37

The problem with this formulation

minimizet subject to

∀ j ∈ J : ∑i∈M

xi j = 1

∀i ∈ M : ∑j∈J

xi j pi j ≤ t

∀i ∈ M, j ∈ J : xi j ∈ {0,1}

One Job, sizem everywhere.

Linearrelaxation: makespan1

Optimalsolution: makespanm... 1

m...

The linear relaxation is far away from the optimal solution

and hence yields little useful information

LP-speak:integrality gapm

Page 38: Vertex Cover Problems - KIT · Vertex Cover Problems Consider a graph G =(V,E) S ⊆V is a vertex cover if ∀{u,v}∈E : u ∈S∨v ∈S minimum vertex cover (MIN-VCP): find a vertex

Rob van Stee: Approximations- und Online-Algorithmen 38

The problem with this formulation

minimizet subject to

∀ j ∈ J : ∑i∈M

xi j = 1

∀i ∈ M : ∑j∈J

xi j pi j ≤ t

∀i ∈ M, j ∈ J : xi j ∈ {0,1}

In ILP, we always havexi j = 0 if pi j > t

This is lost in the linear relaxation: somexi j may get small

values

We cannot add this constraint since it is not a linear constraint

Page 39: Vertex Cover Problems - KIT · Vertex Cover Problems Consider a graph G =(V,E) S ⊆V is a vertex cover if ∀{u,v}∈E : u ∈S∨v ∈S minimum vertex cover (MIN-VCP): find a vertex

Rob van Stee: Approximations- und Online-Algorithmen 39

A Refined LP Relaxation (Parametric Pruning)

guessmakespanT e.g., binary search

feasible assignments:ST :={

(i, j) : pi j ≤ T}

no objective function (feasibility only)

LP(T ):

∀ j ∈ J : ∑{i:(i, j)∈ST }

xi j = 1

∀i ∈ M : ∑{ j:(i, j)∈ST }

xi j pi j ≤ T

∀(i, j) ∈ ST : xi j ≥ 0

Page 40: Vertex Cover Problems - KIT · Vertex Cover Problems Consider a graph G =(V,E) S ⊆V is a vertex cover if ∀{u,v}∈E : u ∈S∨v ∈S minimum vertex cover (MIN-VCP): find a vertex

Rob van Stee: Approximations- und Online-Algorithmen 40

A Refined LP Relaxation (Parametric Pruning)

guessmakespanT e.g., binary search

feasible assignments:ST :={

(i, j) : pi j ≤ T}

LP(T ):

∀ j ∈ J : ∑{i:(i, j)∈ST }

xi j = 1

∀i ∈ M : ∑{ j:(i, j)∈ST }

xi j pi j ≤ T

∀(i, j) ∈ ST : xi j ≥ 0

No objective function! We only look for afeasible solution

Page 41: Vertex Cover Problems - KIT · Vertex Cover Problems Consider a graph G =(V,E) S ⊆V is a vertex cover if ∀{u,v}∈E : u ∈S∨v ∈S minimum vertex cover (MIN-VCP): find a vertex

Rob van Stee: Approximations- und Online-Algorithmen 41

More LP-speak

Consider a solutionx of a given LP.

x is anextreme point solutionif it cannot be expressed as a

convex combinationαx′+(1−α)x′′ with α ∈ (0,1) of two

other feasible solutionsx′ andx′′.

x’’

x’

combinationconvex

Theorem 6. x∈ Rr is an extreme point solution iff it

corresponds to

setting r linearly independent constraints to equality.

Proof. not here.

Page 42: Vertex Cover Problems - KIT · Vertex Cover Problems Consider a graph G =(V,E) S ⊆V is a vertex cover if ∀{u,v}∈E : u ∈S∨v ∈S minimum vertex cover (MIN-VCP): find a vertex

Rob van Stee: Approximations- und Online-Algorithmen 42

ST :={

(i, j) : pi j ≤ T}

LP(T ):

∀ j ∈ J : ∑{i:(i, j)∈ST }

xi j = 1

∀i ∈ M : ∑{ j:(i, j)∈ST }

xi j pi j ≤ T

∀(i, j) ∈ ST : xi j ≥ 0

Lemma 7. An extreme point solution of LP(T ) has

at most n+m nonzero variables.

Proof. r = |ST | variables

n+m constraints (except≥ 0)Thm6 ≥ r− (n+m) of the≥ 0 constraints are tight.

Page 43: Vertex Cover Problems - KIT · Vertex Cover Problems Consider a graph G =(V,E) S ⊆V is a vertex cover if ∀{u,v}∈E : u ∈S∨v ∈S minimum vertex cover (MIN-VCP): find a vertex

Rob van Stee: Approximations- und Online-Algorithmen 43

Lemma 7. An extreme point solution of LP(T )

has at most n+m nonzero variables.

Corollary 8. An extreme point solution of LP(T )

sets ≥ n−m jobs integrally.

Proof.

a integrally set jobs a nonzero entries inxn−a fractionally set jobs ≥ 2(n−a) nonzero entries inxLemma 7

2(n−a)+a ≤ n+m

⇔ a ≥ n−m

Page 44: Vertex Cover Problems - KIT · Vertex Cover Problems Consider a graph G =(V,E) S ⊆V is a vertex cover if ∀{u,v}∈E : u ∈S∨v ∈S minimum vertex cover (MIN-VCP): find a vertex

Rob van Stee: Approximations- und Online-Algorithmen 44

One Reason why LP Relaxation is Useful

Theorem 6. x∈ Rr is an extreme point solution iff it

corresponds to

setting r linearly independent constraints to equality.

Theorem 6 often implies that

only few variables need to be rounded

to obtain an solution of the ILP.

. . . this does not mean rounding the remaining ones is easy.

Page 45: Vertex Cover Problems - KIT · Vertex Cover Problems Consider a graph G =(V,E) S ⊆V is a vertex cover if ∀{u,v}∈E : u ∈S∨v ∈S minimum vertex cover (MIN-VCP): find a vertex

Rob van Stee: Approximations- und Online-Algorithmen 45

The Algorithm: Top Level

α:= makespan one gets by assigning each job to the fastest machine for it

α is an upper bound for the optimal makespan

Page 46: Vertex Cover Problems - KIT · Vertex Cover Problems Consider a graph G =(V,E) S ⊆V is a vertex cover if ∀{u,v}∈E : u ∈S∨v ∈S minimum vertex cover (MIN-VCP): find a vertex

Rob van Stee: Approximations- und Online-Algorithmen 46

The Algorithm: Top Level

α:= makespan one gets by assigning each job to the fastest machine for it

α is an upper bound for the optimal makespan

Usebinary searchin the rangebα/mc ,αto find thesmallestT such thatLP(T ) has a feasible solutionx

Page 47: Vertex Cover Problems - KIT · Vertex Cover Problems Consider a graph G =(V,E) S ⊆V is a vertex cover if ∀{u,v}∈E : u ∈S∨v ∈S minimum vertex cover (MIN-VCP): find a vertex

Rob van Stee: Approximations- und Online-Algorithmen 47

The Algorithm: Top Level

α:= makespan one gets by assigning each job to the fastest machine for it

α is an upper bound for the optimal makespan

Usebinary searchin the rangebα/mc ,αto find thesmallestT such thatLP(T ) has a feasible solution

For thisT , find an extremal point solutionx

Page 48: Vertex Cover Problems - KIT · Vertex Cover Problems Consider a graph G =(V,E) S ⊆V is a vertex cover if ∀{u,v}∈E : u ∈S∨v ∈S minimum vertex cover (MIN-VCP): find a vertex

Rob van Stee: Approximations- und Online-Algorithmen 48

The Algorithm: Top Level

α:= makespan one gets by assigning each job to the fastest machine for it

α is an upper bound for the optimal makespan

Usebinary searchin the rangebα/mc ,αto find thesmallestT such thatLP(T ) has a feasible solution

For thisT , find an extremal point solutionxassign integrally set jobsin x

Page 49: Vertex Cover Problems - KIT · Vertex Cover Problems Consider a graph G =(V,E) S ⊆V is a vertex cover if ∀{u,v}∈E : u ∈S∨v ∈S minimum vertex cover (MIN-VCP): find a vertex

Rob van Stee: Approximations- und Online-Algorithmen 49

The Algorithm: Top Level

α:= makespan one gets by assigning each job to the fastest machine for it

α is an upper bound for the optimal makespan

Usebinary searchin the rangebα/mc ,αto find thesmallestT such thatLP(T ) has a feasible solution

For thisT , find an extremal point solutionxassign integrally set jobsin xdeal withthe fractionally set jobs // Rounding

Page 50: Vertex Cover Problems - KIT · Vertex Cover Problems Consider a graph G =(V,E) S ⊆V is a vertex cover if ∀{u,v}∈E : u ∈S∨v ∈S minimum vertex cover (MIN-VCP): find a vertex

Rob van Stee: Approximations- und Online-Algorithmen 50

Example

pi j 1 2 3 4 5

1 2 2 4 2 4

2 4 3 3 4 4

3 3 3 3 3 2

4 2 4 4 4 2

Four machines, five jobs

For each job, the best machine for it is marked in blue.

Page 51: Vertex Cover Problems - KIT · Vertex Cover Problems Consider a graph G =(V,E) S ⊆V is a vertex cover if ∀{u,v}∈E : u ∈S∨v ∈S minimum vertex cover (MIN-VCP): find a vertex

Rob van Stee: Approximations- und Online-Algorithmen 51

Example

pi j 1 2 3 4 5 Each job on fastest machine:

1 2 2 4 2 4 6 =: α

2 4 3 3 4 4 3

3 3 3 3 3 2 5

4 2 4 4 4 2 2

Initial guess for the makespan is 6

Using binary search, we find smallest makespan in the range

[6/4,6] that can be achieved using a fractional assignment

Page 52: Vertex Cover Problems - KIT · Vertex Cover Problems Consider a graph G =(V,E) S ⊆V is a vertex cover if ∀{u,v}∈E : u ∈S∨v ∈S minimum vertex cover (MIN-VCP): find a vertex

Rob van Stee: Approximations- und Online-Algorithmen 52

Example

pi j 1 2 3 4 5 Each job on fastest machine:

1 2 2 4 2 4 6 =: α

2 4 3 3 4 4 3

3 3 3 3 3 2 5

4 2 4 4 4 2 2

Solution of LP(3):

xi j 1 2 3 4 5

1 12

12 0 1

2 0

2 0 12

12 0 0

3 0 0 12

12 0

4 12 0 0 0 1

Page 53: Vertex Cover Problems - KIT · Vertex Cover Problems Consider a graph G =(V,E) S ⊆V is a vertex cover if ∀{u,v}∈E : u ∈S∨v ∈S minimum vertex cover (MIN-VCP): find a vertex

Rob van Stee: Approximations- und Online-Algorithmen 53

Dealing with Fractionally Set Jobs

Consider the bipartite graph

H:= (J′∪M′,E ′) where

J′:={

j ∈ J : ∃i : 0< xi j < 1}

M′:={

i ∈ M : ∃ j : 0< xi j < 1}

E ′:={

{i, j} : xi j 6= 0, i ∈ M′, j ∈ J′}

Idea: Find a perfect matching inH

assign jobs according to that matching

1

2

3

4

1

2

3

4

1 2 3 4

matching

1 2 3 4

Page 54: Vertex Cover Problems - KIT · Vertex Cover Problems Consider a graph G =(V,E) S ⊆V is a vertex cover if ∀{u,v}∈E : u ∈S∨v ∈S minimum vertex cover (MIN-VCP): find a vertex

Rob van Stee: Approximations- und Online-Algorithmen 54

Matching

A set of edgesM that do not have any nodes in common, i.e.,

(V,M) has maximumdegree one.

Perfect Matching

A matching of size|V |/2, i.e., all nodes arematched

Page 55: Vertex Cover Problems - KIT · Vertex Cover Problems Consider a graph G =(V,E) S ⊆V is a vertex cover if ∀{u,v}∈E : u ∈S∨v ∈S minimum vertex cover (MIN-VCP): find a vertex

Rob van Stee: Approximations- und Online-Algorithmen 55

Lemma 8. H is a pseudo forest, i.e., each connected component

HC = (VC,EC) has |EC| ≤ |VC| (a tree plus, possibly, one edge)

Proof. It suffices to show this for the larger graph

G:= (J ∪M,E) where

E:={

{i, j} : xi j 6= 0, i ∈ M, j ∈ J}

Consider a connected componentHC of G.

restrictx andLP(T ) to HC: xC, LPC(T )

xC is extreme point solution ofLPC(T )

(Otherwise,x itself could not be extreme point solution)

Lemma 7 LPC(T ) has≤ |VC| nonzero vars.,

i.e.,HC has≤ |VC| edges.

Page 56: Vertex Cover Problems - KIT · Vertex Cover Problems Consider a graph G =(V,E) S ⊆V is a vertex cover if ∀{u,v}∈E : u ∈S∨v ∈S minimum vertex cover (MIN-VCP): find a vertex

Rob van Stee: Approximations- und Online-Algorithmen 56

Example

pi j 1 2 3 4 5

1 2 2 4 2 4

2 4 3 3 4 4

3 3 3 3 3 2

4 2 4 4 4 2

xi j 1 2 3 4 5

1 12

12 0 1

2 0

2 0 12

12 0 0

3 0 0 12

12 0

4 12 0 0 0 1

T ∗ = 3

1

2

3

4

41

1

2 2 3

34

1 2 3 4

Page 57: Vertex Cover Problems - KIT · Vertex Cover Problems Consider a graph G =(V,E) S ⊆V is a vertex cover if ∀{u,v}∈E : u ∈S∨v ∈S minimum vertex cover (MIN-VCP): find a vertex

Rob van Stee: Approximations- und Online-Algorithmen 57

Lemma 9. H has a perfect matchingProof. We give an algorithm:M := /0

invariant H is abipartite pseudo forest

invariant all degree one nodes are machines

while ∃i ∈ M′ with degree onedoe = {i, j} := the sole edge incident toi

M := M ∪{e}removei, j and incident edges

assertH is a collection of disjointeven cycles

foreachcycleC ∈ H domatchalternating edgesin C 1

2 2 3

34

41

1

2 2 3

34

Page 58: Vertex Cover Problems - KIT · Vertex Cover Problems Consider a graph G =(V,E) S ⊆V is a vertex cover if ∀{u,v}∈E : u ∈S∨v ∈S minimum vertex cover (MIN-VCP): find a vertex

Rob van Stee: Approximations- und Online-Algorithmen 58

Theorem 10. The algorithm achieves an approximation

guarantee of factor 2 for scheduling unrelated parallel

machines.

Proof. Consider solutionx of LPT(T ∗)

makespan due tojobs set integrallyin x is ≤ T ∗≤opt.

In addition, each machinei receives≤ 1 job j from the

matchingM ⊆ H.

pi, j ≤ T ∗ ≤optsince otherwise{i, j} 6∈ H