Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Vertex Cover Problem Given a graph G=(V, E), find V' ⊆ V such that for each edge (u, v) ∈ E at least one of u and v belongs to V’ and |V’| is minimized.

Similar presentations


Presentation on theme: "1 Vertex Cover Problem Given a graph G=(V, E), find V' ⊆ V such that for each edge (u, v) ∈ E at least one of u and v belongs to V’ and |V’| is minimized."— Presentation transcript:

1 1 Vertex Cover Problem Given a graph G=(V, E), find V' ⊆ V such that for each edge (u, v) ∈ E at least one of u and v belongs to V’ and |V’| is minimized. V' is called the vertex cover. The problem is NP-hard. A ratio-2 algorithm exists for vertex cover problem.

2 2 Ratio-2 Algorithm A ratio-2 algorithm for vertex cover: 1.for each edge that is not covered by any vertex do select the two ends of the edge 2. if there is any edge that is not covered by any selected vertices then go to step 1 else stop. Proof: for each edge, we have to use at least one vertex. Now, we use two, thus, the ratio is 2.

3 3 Non-approximatility for TSP without triangle inequality (Remember the Theorem) Theorem: For any number x>0, TSP problem without triangle inequality cannot be approximated within ratio x. In fact, x can be any polynomial of input size n, e.g., n, n 2, n 5, n , which is considered to be very bad. It can be even worse, e.g., x=2 n. The Reduction is still polynomial.

4 4 Proof The basic idea: Show that if there is an approximation algorithm A with ratio x for TSP problem without triangle inequality, then we can use the approximation algorithm A for TSP to solve the Hamilton Circuit problem, which is NP-hard. Since NP-hard problems do not have any polynomial time algorithms, the ratio x approximation algorithm can not exist.

5 5 1.Given an instance of Hamilton Circuit problem G=(V,E), where there are n nodes in V, we assign weight 1 to each edge in E. (That is, the distance between any pair of vertices in G is 1 if there is an edge connecting them.) 2.Add edges of cost 2+xn to G such that the resulting graph G'=(V,E ∪ E') is a complete graph.

6 6 3. Now, we call the approximation algorithm A for TSP to find a solution for TSP. 4. Now, we want to show that if the cost of the solution obtained from A is not greater than 1+xn, then there is a Hamilton circuit in G, otherwise, there is no Hamilton Circuit in G.

7 7 If A gives a solution of cost not greater than 1+xn, then no added edge (weight 2+xn) is used. Thus, G has a Hamilton circuit. If the cost of the solution given by A is greater than 1+xn, then at least one added edge is used. If there is a circuit in G, the cost of an optimal solution is n. The approximation algorithm A should give a solution with cost ≤ xn. Otherwise, there is no Hamilton circuit in G.

8 8 Example: Solid edges are the original edges in the graph G. Dashed edges are added edges. OPT=n if a Hamilton circuit exists. Otherwise, OPT>2+xn. Since ratio=x, if our solution<2+xn, Hamilton circuit exists.(In fact, if cost <2+xn, cost=n since no dashed edge is used and solid edges have cost 1.) 1 1 1 1

9 9 Pseudo-polynomial time algorithm (The concept and the terminology are important) Partition Problem: Input: Finite set A=(a 1, a 2, …, a n } and a size s(a) (integer) for each a  A. Question: Is there a subset A’  A such that  a  A’ s(a) =  a  A –A’ s(a)? Theorem: Partition problem is NP-complete (Karp, 1972). An dynamic algorithm: For i  n and j  0.5  a  A s(a), define t(i, j) to be true if and only if there is a subset A i of {a 1, a 2, …, a i } such that  a  Ai s(a)=j. Formula: T(i,j)=true if and only if t(i-1, j)=true or t(i-1, j-s(a i ))=true.

10 10 Example i012345678910111213 1TTFFFFFFFFFFFF 2TTFFFFFFFTTFFF 3TTFFFTTFFTTFFF 4TTFTTTTFTTTFTT 5TTFTTTTFTTTTTT Figure 4.8 Table of t(i,j) for the instance of PARTITION for which A={a 1,a 2,a 3,a 4,a 5 }, s(a 1 )=1, s(a 2 )=9, s(a 3 )=5, s(a 4 )=3, and s(a 5 )=8. The answer for this instance is "yes", since t(5,13)=T, reflecting the fact that s(a 1 )+s(a 2 )+s(a 4 )=13=26/2. j

11 11 Time complexity The algorithm takes at most O(nB) time to fill in the table. (Each cell needs constant time to compute). Do we have a polynomial time algorithm to solve the Partition Problem and thus all NP-complete problems? –No. –O(nb) is not polynomial in terms of the input size. S(a i )=2 n =10000…0. (binary number of n+1 bits, n 0’s). So B is at least O(2 n ). The input size is O(n) if there some a i with S(a i )=2 n. B is not polynomial in terms of n (input size) in general. However, if any upper bound is imposed on B, (e.g., B is Polynomial), the problem can be solved in polynomial time for this special case. (This is called pseudo-polynomial.)

12 12 Bottleneck Steiner Trees (Fun part, not required.) (Wang and Du 2002) Problem: Given a set P={p 1, p 2, …, p n } in the plane of n terminals and a positive integer k, find a Steiner tree with at most k Steiner points such that the length of the longest edges in the tree is minimized. Theorem: The problem cannot be approximated within ratio less than 2 if the distance between two terminals is rectilinear distance. Rectilinear distance between two points in the plane (x1,y1) and (x2, y2) is |x1-x2|+|y1-y2|. (x1,y1) (x2,y2)

13 13 Theorem 1: There exists a spanning tree T for P such that by adding k Steiner points to T, the longest edge in the resulting steinerized spanning tree is at most twice that of the optimum for the bottleneck Steiner tree problem. Example:

14 14 Theorem 2: Let e 1, e 2, …, e n-1 be all edges in a spanning tree T for P and e* 1, e* 2, …, e* n-1 be all edges in a minimum spanning tree T* for P. Suppose c(e i )  c(e i+1 ) and c(e* i )  c(e* i+1 ) for all 1  i  n-2. Then c(e* i )  c(e i ) for all 1  i  n-2.

15 15 Ratio-2 Approximation algorithm Step 1: Compute an minimum spanning tree T (e 1,e 2, …e n-1 edges) Setp 2: Compute l(e i ) for each edge e i. Step 3: Sort the edges in T in a non-increasing order based on l(e). Step 4: Add a degree-2 Steiner point into the edge with the largest l() such that Steiner points on the edge are uniformly distributed. Step 5: Update l(e) for the updated edge in Step 4. Step 6: Re-sort edges based on l() and repeat Steps 4-6 until k degree-2 Steiner points are added.


Download ppt "1 Vertex Cover Problem Given a graph G=(V, E), find V' ⊆ V such that for each edge (u, v) ∈ E at least one of u and v belongs to V’ and |V’| is minimized."

Similar presentations


Ads by Google