Partial Vertex Cover Joshua Wetzel Department of Computer Science Rutgers University–Camden
[email protected]
April 2, 2009
Joshua Wetzel
Partial Vertex Cover
1 / 48
Vertex Cover
Input: Given G = (V , E) Non-negative weights on vertices
Objective: Find a least-weight collection of vertices such that each edge in G in incident on at least one vertex in the collection
Joshua Wetzel
Partial Vertex Cover
2 / 48
Vertex Cover: Example
24
50
24
50 10
15
10
15
6
30
6
30
18
18
12
12
COST = 97
COST = 108
Joshua Wetzel
Partial Vertex Cover
3 / 48
Vertex Cover: IP Formulation
xv ← 1 if v is in our cover, 0 otherwise X min wv xv v ∈V
s.t. xa + xb ≥ 1, ∀ e = (a, b) xv ∈ {0, 1}, ∀ v ∈ V
Joshua Wetzel
Partial Vertex Cover
4 / 48
LP Relaxation
Integer programs have been shown to be NP-hard Relax the integrality constraints xv ∈ {0, 1}, ∀ v ∈ V min
X
wv xv
v ∈V
s.t. xa + xb ≥ 1, ∀ e = (a, b) xv ≥ 0, ∀ v ∈ V
Joshua Wetzel
Partial Vertex Cover
5 / 48
Constructing the Dual LP
Primal LP: min
X
wv xv
v ∈V
s.t. xa + xb ≥ 1, ∀ e = (a, b)
(ye )
xv ≥ 0, ∀ v ∈ V
Joshua Wetzel
Partial Vertex Cover
6 / 48
Primal LP and Dual LP
Dual LP:
Primal LP: min
X
max
wv xv
X
ye
e∈E
v ∈V
s.t.
s.t.
xa + xb ≥ 1, ∀ e = (a, b) xv ≥ 0, ∀ v ∈ V
Joshua Wetzel
X
ye ≤ wv , ∀ v ∈ V
e : e hits v
ye ≥ 0, ∀ e ∈ E
Partial Vertex Cover
7 / 48
Primal-Dual Method
DualFeasible ≤ DualOPT = PrimalOPT PrimalOPT ≤ OPTIP Construct the dual LP Construct an algorithm that manually tightens dual constraints to obtain a ’maximal’ dual solution
Joshua Wetzel
Partial Vertex Cover
8 / 48
Clarkson’s Algorithm
Inititally all edges are uncovered. While ∃ an uncovered edge in G: raise ye for all uncovered edges P simultaneouslty until a vertex, v , becomes full (i.e y e = wv ) e:e hits v
C ← C ∪ {v } any e that touches v is covered.
Return C as our vertex cover
Joshua Wetzel
Partial Vertex Cover
9 / 48
Clarkson’s Algorithm: Example X
ye ≤ wv
e:e hits v 0 24
50
10 0
0
0
0 15
6 0 0
30
18
0
0
0 12
Raise each ye uniformly until a vertex is full. Joshua Wetzel
Partial Vertex Cover
10 / 48
Clarkson’s Algorithm: Example X
ye ≤ wv
e:e hits v 2 24
50
10 2
2
2
2 15
6 2 2
30
18
2
2
2 12
Joshua Wetzel
Partial Vertex Cover
11 / 48
Clarkson’s Algorithm: Example X
ye ≤ wv
e:e hits v 3 24
50
10 3
2
2
3 15
6 2 3
30
18
3
3
3 12
Joshua Wetzel
Partial Vertex Cover
12 / 48
Clarkson’s Algorithm: Example X
ye ≤ wv
e:e hits v 12 24
50
10 12
2
2
12 15
6 2 3
30
18
3
3
3 12
Joshua Wetzel
Partial Vertex Cover
13 / 48
Clarkson’s Algorithm: Example X
ye ≤ wv
e:e hits v 19 24
50
10 12
2
2
19 15
6 2 3
30
18
3
3
3 12
COST = 83 Joshua Wetzel
Partial Vertex Cover
14 / 48
Clarkson’s Algorithm: Analysis
19 24
50
10 12
2
Dual Obj. Fn: X max ye
2
e
19 15
6 2
3
30
18
3
3
3
Our Cost = wt(red vertices) X ≤ 2 ye
12
X
e hits red
≤ 2 ye ≤ wv
e:e hits v
X
ye
e
= 2DFS ≤ 2OPT
Joshua Wetzel
Partial Vertex Cover
15 / 48
Clarkson’s Algorithm: Tight Example
1
1
1
1 1
1 1
1
1
6
1
1
6 1
1
1
1
COSTOPT = 6
Joshua Wetzel
1 1
1
COSTClarkson = 12
Partial Vertex Cover
16 / 48
Partial Vertex Cover
Input: Graph, G = (V , E) Non-negative integer weights for vertices Integer, k
Objective: Find the least cost set of vertices in G that will cover at least k edges.
Joshua Wetzel
Partial Vertex Cover
17 / 48
Key Issue
In full vertex cover OPT covers all edges and hence we know which edges to cover. In partial vertex cover, we do not know which k edges OPT covers. When k is part of the input, the techniques for full-coverage do not directly apply.
Joshua Wetzel
Partial Vertex Cover
18 / 48
Clarkson’s Algorithm Fails
Input: k = 1 1
1
5
1
1
1
1
1
5/6
5/6
5/6 5/6
1
1
1
COSTOPT = 1
Joshua Wetzel
5
5/6
1
5/6 1
COSTClarkson = 5
Partial Vertex Cover
19 / 48
Related Work
Bshouty & Burroughs 1998: solve the LP, modify it and then round the modified solution. 2-approximation for partial vertex cover. Hochbaum 1998: 2-approximation for partial vertex cover. Bar-Yehuda 1999: “local ratio” method, 2-approximation for partial vertex cover. Mestre 2005: 2-approximation primal-dual algorithm for partial vertex cover with improved running time
Joshua Wetzel
Partial Vertex Cover
20 / 48
Vertex Cover: IP Formulation
xv ← 1 if v is in our cover, 0 otherwise X min wv xv v ∈V
s.t. xa + xb ≥ 1, ∀ e = (a, b) xv ∈ {0, 1}, ∀ v ∈ V
Joshua Wetzel
Partial Vertex Cover
21 / 48
Partial Vertex Cover: IP formulation xv ← 1 if vertex v is chosen in the cover, 0 otherwise. ye ← 1 if edge e is not covered, 0 otherwise. X min wv xv v ∈V
s.t. ye + xa + xb ≥ 1, ∀e = (a, b) X ye ≤ m − k e∈E
xv ∈ {0, 1}, ∀v ∈ V ye ∈ {0, 1}, ∀e ∈ E
Joshua Wetzel
Partial Vertex Cover
22 / 48
Patial Vertex Cover: LP formulation
Relax the integrality constraints. xv ∈ {0, 1} → xv ≥ 0, ∀ v ∈ V ye ∈ {0, 1} → ye ≥ 0, ∀ e ∈ E
Joshua Wetzel
Partial Vertex Cover
23 / 48
Constructing the Dual LP
min
X
wv xv
v ∈V
s.t. ye + xa + xb ≥ 1, ∀ e = (a, b) X ye ≤ (m − k)
(ue ) (z)
e∈E
xv ≥ 0, ∀ v ∈ V ye ≥ 0, ∀ e ∈ E
Joshua Wetzel
Partial Vertex Cover
24 / 48
Primal LP and Dual LP
Primal LP: min
X
Dual LP:
wv xv
max
v ∈V
X
ue − z(m − k)
e∈E
s.t.
s.t. ye + xa + xb ≥ 1, ∀e X ye ≤ m − k
X
ue ≤ wv , ∀v ∈ V
e : e hits v
e∈E
ue ≤ z, ∀ e ∈ E
xv ≥ 0, ∀ v ∈ V
ue ≥ 0, ∀ e ∈ E
ye ≥ 0, ∀ e ∈ E
z ≥0
Joshua Wetzel
Partial Vertex Cover
25 / 48
Intuition for Primal-Dual Input: k = 1 1
1
5
1
1
1
1
1
5/6
5/6
5/6 5/6
1
1
1
COSTOPT = 1
5
5/6
1
5/6 1
COSTClarkson = 5
In last iteration, Clarkson’s Alg. may choose more edges than we need at a very high cost We must somehow bound the cost of last vertex chosen Joshua Wetzel
Partial Vertex Cover
26 / 48
Primal-Dual Algorithm
For each vertex, v, in G Guess v to be the heaviest vertex in OPT , called vh Cv ← {vh } Raise weight of all heavier vertices in G to ∞ Remove all edges touching vh from G k ′ ← k − deg(vh ) Run Clarkson on this instance until k ′ edges are covered. Cchoices ← Cchoices ∪ CV
Return the lowest cost cover, C
Joshua Wetzel
Partial Vertex Cover
27 / 48
Primal-Dual Algorithm: Example
24
50
10
15
18
15
17
12
Input: G = (V , E ),
Joshua Wetzel
k =8
Partial Vertex Cover
28 / 48
Primal-Dual Algorithm: Example X
ue ≤ wv
e:e hits v 0 INF
INF
10
0
0
0 15
INF 0
15
0 INF
Vh
0
0
12
k′ = 6 Joshua Wetzel
Partial Vertex Cover
29 / 48
Primal-Dual Algorithm: Example X
ue ≤ wv
e:e hits v 4 INF
INF
10
4
4
4 15
INF 4
15
4 INF
Vh
4
4
12
Joshua Wetzel
Partial Vertex Cover
30 / 48
Primal-Dual Algorithm: Example X
ue ≤ wv
e:e hits v 6 INF
INF
10
6
6
6 15
INF 6
15
4 INF
Vh
4
4
12
Joshua Wetzel
Partial Vertex Cover
31 / 48
Primal-Dual Algorithm: Example X
ue ≤ wv
e:e hits v 11 INF
INF
10
11
11
6 15
INF 11
15
4 INF
Vh
4
4
12
Joshua Wetzel
Partial Vertex Cover
32 / 48
Primal-Dual Algorithm: Example X
ue ≤ wv
e:e hits v INF
INF
INF
INF
11
10 6
15
INF INF
15
4 INF
Vh
4
4
12
COST = ∞ Joshua Wetzel
Partial Vertex Cover
33 / 48
Primal-Dual Algorithm: Example X
ue ≤ wv
e:e hits v INF INF
INF
10
INF
INF
10 INF
INF
INF INF
INF INF
12
Vh
COST = ∞ Joshua Wetzel
Partial Vertex Cover
34 / 48
Primal-Dual Algorithm: Example X
ue ≤ wv
e:e hits v 11 INF
INF
10
11
11
6 11
15
INF 4
15
17
Vh 4
4 12
COST = 69 Joshua Wetzel
Partial Vertex Cover
35 / 48
Primal-Dual Algorithm: Example X
ue ≤ wv
e:e hits v INF INF
INF
10
INF 6 11 15
INF
Vh
INF 15 INF 4
4
4 12
COST = ∞ Joshua Wetzel
Partial Vertex Cover
36 / 48
Primal-Dual Algorithm: Example X
ue ≤ wv
e:e hits v INF INF
INF
INF
INF
10
Vh
INF INF
INF INF INF
INF
INF INF INF INF
COST = ∞ Joshua Wetzel
Partial Vertex Cover
37 / 48
Primal-Dual Algorithm: Example X
ue ≤ wv
e:e hits v 12 INF
INF
INF
12 12 15
18
Vh 3
15
17 3
3
3 12
COST = 60 Joshua Wetzel
Partial Vertex Cover
38 / 48
Primal-Dual Algorithm: Example X
ue ≤ wv
e:e hits v
24
INF
Vh 10
12 7 12 15
18 12 3
15
17 3
3
3 12
COST = 76 Joshua Wetzel
Partial Vertex Cover
39 / 48
Primal-Dual Algorithm: Example X
ue ≤ wv
e:e hits v
Vh 24
50
10
6 6 15
18 6 3
15
17 3
3
3 12
COST = 80 Joshua Wetzel
Partial Vertex Cover
40 / 48
Primal-Dual Algorithm: Example Heaviest Vertex
Cost
24
50
10
15
18
15
17
12
15 12 17 15 10 18 24 50
∞ ∞ 69 ∞ ∞ 60 76 80
Return cover with cost of 60
Joshua Wetzel
Partial Vertex Cover
41 / 48
Analysis: Cost of OPT Ih : inst. in which we correctly guess heaviest vertex in OPT 12 24
50
INF
INF 10
10
12 12
15
15
18
Vh 3
15
15 17
17 3
3
3 12
12
OPT
Ih OPT = OPT (Ih ) + w (vh )
Joshua Wetzel
Partial Vertex Cover
42 / 48
Analysis: Our Cost
OPT = OPT (Ih ) + w (vh ) 12 24
50
INF
INF 10
10
12 12
15
15
18
18
Vh 15
Vh 3
15 17
17 3
3
3 12
12
OPT (Ih ) + w (vh ) = 45
Joshua Wetzel
COST (Ih ) + w (vh ) = 60
Partial Vertex Cover
43 / 48
Analysis: What is z? Z INF
INF
12 INF
INF
10
Z 10
12
Z 15
12 15
18
Vl
Vh
18
Vl
3
15
Vh
17
3
15
3
17 3
3
3 3
12
3 12
ue ≤ z, ∀ e
Ih
z = 12 Num of edges for which ue = z is at least m′ − k ′
Joshua Wetzel
Partial Vertex Cover
44 / 48
Analysis: Our Cost OPT = OPT (Ih ) + w (vh ) Z
Our Cost ≤ Cost(Ih ) + w (vh )
INF
INF
10
Z Z 15
≤ w (RedVert) + 2w (vh ) X ≤ 2 ue + 2w (vh )
18
Vl
Vh
3
15
e hits red
17 3
= w (RedVert) + w (vl ) + w (vh )
3
3 12
X ≤ 2[ ue − z(m′ − k ′ )] + 2w (vh ) e
≤ 2DFS(Ih ) + 2w (vh )
Ih
≤ 2OPT (Ih ) + 2w (vh ) ≤ 2OPT
Joshua Wetzel
Partial Vertex Cover
45 / 48
Primal LP and Dual LP
Primal LP: min
X
Dual LP:
wv xv
max
v ∈V
X
ue − z(m − k)
e∈E
s.t.
s.t. ye + xa + xb ≥ 1, ∀e X ye ≤ m − k
X
ue ≤ wv , ∀v ∈ V
e : e hits v
e∈E
ue ≤ z, ∀ e ∈ E
xv ≥ 0, ∀ v ∈ V
ue ≥ 0, ∀ e ∈ E
ye ≥ 0, ∀ e ∈ E
z ≥0
Joshua Wetzel
Partial Vertex Cover
46 / 48
Reference
K. L. Clarkson. A modification of the greedy algorithm for the vertex cover. Information Processing Letters 16:23-25, 1983. R. Gandhi, S. Khuller, and A. Srinivasan. Approximation Algorithms for Partial Covering Problems. Journal of Algorithms, 53(1):55-84, October 2004.
Joshua Wetzel
Partial Vertex Cover
47 / 48
Thank You.
Joshua Wetzel
Partial Vertex Cover
48 / 48