Vertex Cover Problem n n Definition A vertex
Vertex Cover Problem n n Definition: A vertex cover of a graph is a set of vertices which contains at least one end-point of each edge. This problem is NP-hard. 1 2 3 4 2020/9/16 Data Compression and Multimedia Communication Lab. 1
Performance Ratio n Definition: 1 2 3 4 2020/9/16 Data Compression and Multimedia Communication Lab. 2
Greedy Algorithm n n Input: Un-weighted graph G(V, E) Output: Vertex cover C Step 1: C . Step 2: While E do begin n n Pick a vertex v V of maximum degree in the current graph C C+v E E–{e|v e} end; Step 3: Return C. 2020/9/16 Data Compression and Multimedia Communication Lab. 3
Step 1 n C = , E = { (1, 2), (1, 3), (1, 4), (2, 5), 1 (3, 5), (4, 5) } 2 3 4 5 2020/9/16 Data Compression and Multimedia Communication Lab. 4
Step 2 n n n Pick v = 1, C = {1}, E = { (2, 5), (3, 5), (4, 5) } 1 2 3 4 5 2020/9/16 Data Compression and Multimedia Communication Lab. 5
Step 2 (Cont. ) n n n Pick v = 5, C = {1, 5}, E = {} 2 3 4 5 2020/9/16 Data Compression and Multimedia Communication Lab. 6
Step 3 n Return C = { 1, 5 } 1 2 3 4 5 2020/9/16 Data Compression and Multimedia Communication Lab. 7
Worse Case n Construct a graph such that n n |L| = r |Ri| = , deg(Ri)=i |R| = |R 1| + |R 2| + … +|Rr| = r (1 + 1/2 + … + 1/r ) = (r log r) |R|/|L| = (log r) 2020/9/16 Data Compression and Multimedia Communication Lab. 8
Approximation Algorithm MM n n n Input: Un-weighted graph G(V, E) Output: Vertex cover C Step 1: Pick any maximal matching M E in G. Step 2: C {v|v is matched in M}. 1 2 Step 3: Return C. 3 5 2020/9/16 Data Compression and Multimedia Communication Lab. 4 9
Three Questions n n n What is the time-complexity of our approximation algorithm? What is the bound of the approximation solution? Is this analysis tight? 2020/9/16 Data Compression and Multimedia Communication Lab. 10
How good is the solution? n All edges in M are covered by minimum vertex cover n n Our approximation algorithm generate a cover C which contains exactly 2|M| vertices. n n i. e. |M| OPT i. e. C = 2|M| OPT C = 2|M| 2020/9/16 1 2 3 4 Data Compression and Multimedia Communication Lab. 11
Weighted Vertex Cover (weights on vertices) n n Definition: A vertex cover of a graph is a set of vertices which contains at least one end-point of each edge. Definition: A weighted vertex cover of a graph is a vertex cover whose total weight is minimum. 2020/9/16 Data Compression and Multimedia Communication Lab. 12
Greedy Algorithm n n n Step 1: C . Step 2: while E do begin Pick a vertex v V with minimum w(v); C C+v E E–{e|v e} 1 end; 2 Step 3: Return C. 3 2020/9/16 Data Compression and Multimedia Communication Lab. 4 13
Worse Case 1 1 1 1 2020/9/16 1 Data Compression and Multimedia Communication Lab. 14
n n n K. L. Clarkson, “Modification of the Greedy Algorithm for Vertex Cover”, Information Processing Letters, 16 (1983), pp. 23 -25. Input: Graph G(V, E) and weight function w on V. Output: Vertex cover C. 2020/9/16 Data Compression and Multimedia Communication Lab. 15
n n n 1. 2. 3. 4. 5. n n v V do W(v) w(v); v V do D(v) dv; e E do EC(e) 0; C ; While E do begin Pick a vertex v V for which W(v)/D(v) is minimized; C C + v; V V – v W(v) 0; e=(u, v) E do begin n n n E E – e; W(u) – W(v)/D(v); D(u) = D(u) – 1; EC(e) W(v)/D(v) End; 6. Return C. 2020/9/16 Data Compression and Multimedia Communication Lab. 16
2020/9/16 Data Compression and Multimedia Communication Lab. 17
2020/9/16 Data Compression and Multimedia Communication Lab. 18
2020/9/16 Data Compression and Multimedia Communication Lab. 19
2020/9/16 Data Compression and Multimedia Communication Lab. 20
Fact 1 For all vertices v V and edges e E, W(v) 0 n. EC(e) 0 n at all times during the execution of the algorithm. 2020/9/16 Data Compression and Multimedia Communication Lab. 21
Fact 2 For all vertices v V at all times during the execution of the algorithm 2020/9/16 Data Compression and Multimedia Communication Lab. 22
Fact 3 n At the end of the algorithm’s execution 2020/9/16 Data Compression and Multimedia Communication Lab. 23
n n n Lemma 1: Proof: By Fact 3, Each edge in E is counted at most twice in the last expression. 2020/9/16 Data Compression and Multimedia Communication Lab. 24
n n Lemma 2: Theorem: Clarkson’s algorithm achieves a performance ratio of 2. 2020/9/16 Data Compression and Multimedia Communication Lab. 25
- Slides: 25