0% found this document useful (0 votes)
3 views

ApproximationAlgorithms,VERTEX COVER

The document discusses approximation algorithms, which provide near-optimal solutions for NP-complete problems by relaxing the problem constraints. It defines the approximation ratio bound and introduces the vertex cover problem, explaining an algorithm called APPROX_VERTEX_COVER with a ratio bound of 2. The complexity of the algorithm is O(E), and it demonstrates how the algorithm ensures that the number of vertices in the approximation is at most twice that of the optimal solution.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

ApproximationAlgorithms,VERTEX COVER

The document discusses approximation algorithms, which provide near-optimal solutions for NP-complete problems by relaxing the problem constraints. It defines the approximation ratio bound and introduces the vertex cover problem, explaining an algorithm called APPROX_VERTEX_COVER with a ratio bound of 2. The complexity of the algorithm is O(E), and it demonstrates how the algorithm ensures that the number of vertices in the approximation is at most twice that of the optimal solution.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Approximation Algorithm

 Up to now, the best algorithm for solving an


NP-complete problem requires exponential
time in the worst case. It is too time-
consuming.
 To reduce the time required for solving a
problem, we can relax the problem, and
obtain a feasible solution “close” to an
optimal solution
1
Approximation Algorithm
 One compromise is to use heuristic solutions.

 The word “heuristic” may be interpreted as


“educated guess.”

2
Approximation Algorithm
An algorithm that returns near-optimal solutions is called
an approximation algorithm.

We need to find an approximation ratio bound for 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

produced by the approximation algorithm is within a factor of


 (n) of the C* of the optimal solution:

C C*
max{ , }   (n)
C* C
This definition applies for both minimization and maximization
problems.
4
-approximation algorithm

 An approximation algorithm with an


approximation ratio bound of  is called
a -approximation algorithm or a (1+)-
approximation algorithm.

 Note that  is always larger than 1 and


=-1.

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

You might also like