Title: Vertex%20Cover%20Problem
1Vertex 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.
2Ratio-2 Algorithm
- A ratio-2 algorithm for vertex cover
- 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.
3Non-approximatility for TSP without triangle
inequality(Remember the Theorem)
- Theorem For any number xgt0, 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, n2, n5, n?, which is considered to be
very bad. - It can be even worse, e.g., x2n. The Reduction
is still polynomial.
4Proof
- 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- 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.) - Add edges of cost 2xn to G such that the
resulting graph G'(V,E?E') is a complete graph.
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
1xn, then there is a Hamilton circuit in G,
otherwise, there is no Hamilton Circuit in G.
7- If A gives a solution of cost not greater than
1xn, then no added edge (weight 2xn) is used. - Thus, G has a Hamilton circuit.
- If the cost of the solution given by A is greater
than 1xn, 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- Example
- Solid edges are the original edges in the graph
G. - Dashed edges are added edges.
- OPTn if a Hamilton circuit exists. Otherwise,
OPTgt2xn. - Since ratiox, if our solutionlt2xn, Hamilton
circuit exists.(In fact, if cost lt2xn, costn
since no dashed edge is used and solid edges have
cost 1.)
9Pseudo-polynomial time algorithm(The concept and
the terminology are important)
- Partition Problem
- Input Finite set A(a1, a2, , an 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 Ai of a1, a2,
, ai 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(ai))true.
10Example
j
i 0 1 2 3 4 5 6 7 8 9 10 11 12 13
1 T T F F F F F F F F F F F F
2 T T F F F F F F F T T F F F
3 T T F F F T T F F T T F F F
4 T T F T T T T F T T T F T T
5 T T F T T T T F T T T T T T
Figure 4.8 Table of t(i,j) for the instance of
PARTITION for which Aa1,a2,a3,a4,a5, s(a1)1,
s(a2)9, s(a3)5, s(a4)3, and s(a5)8. The
answer for this instance is "yes", since
t(5,13)T, reflecting the fact that
s(a1)s(a2)s(a4)1326/2.
11Time 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(ai)2n100000 . (binary number of n1 bits , n
0s). - So B is at least O(2n). The input size is O(n)
if there some ai with S(ai)2n. - 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.)
12Bottleneck Steiner Trees (Fun part, not
required.) (Wang and Du 2002)
- Problem Given a set Pp1, p2, , pn 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-x2y1-y2. (x1,y1)
(x2,y2)
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- Theorem 2 Let e1, e2, , en-1 be all edges in
a spanning tree T for P and e1, e2, , en-1
be all edges in a minimum spanning tree T for P.
- Suppose c(ei)?c(e i1) and c(ei) ?c(ei1) for
all 1 ? i ? n-2. Then c(ei) ? c(ei) for all 1 ?
i ? n-2.
15Ratio-2 Approximation algorithm
- Step 1 Compute an minimum spanning tree T
(e1,e2, e n-1 edges) - Setp 2 Compute l(ei) for each edge ei.
- 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.