ApproximationAlgorithms,VERTEX COVER
ApproximationAlgorithms,VERTEX COVER
2
Approximation Algorithm
An algorithm that returns near-optimal solutions is called
an approximation algorithm.
3
Approximation ratio bound
We say an approximation algorithm for the problem has a ratio
bound of (n) if for any input size n, the cost C of the solution
C C*
max{ , } (n)
C* C
This definition applies for both minimization and maximization
problems.
4
-approximation algorithm
5
Vertex Cover Problem
Let G=(V, E). The subset S of V that
meets every edge of E is called the
vertex cover.
The Vertex Cover problem is to find a
vertex cover of the minimum size. It is
NP-hard or the optimization version of
an NP-Complete decision problem.
6
Examples of vertex cover
7
APPROX_VERTEX_COVER(G)
1 C
2 E' E( G )
3 while E'
4 do let ( u , v ) be an arbitrary edge of E'
5 C C {u, v}
6 remove from E' every edge incident on either u or v
7 return C
8
b c d b c d
a e f g a e f g
b c d b c d
a e f g a e f g
b c d b c d
a e f g a e f g
Complexity: O(E) 9
Theorem 35.1 APPROX_VERTEX_COVER has ratio
bound of 2. C*: optimal solution
C: approximate solution
Proof. A: the set of edges selected in step 4
Let A be the set of selected edges.
| C| 2| A| When one edge is selected, 2 vertices are added into C.
| A| | C*| No two edges in A share a common
endpoint due to step 6.
| C| 2| C*|
10