Approximation Algorithms PDF
Approximation Algorithms PDF
Algorithms
Departmet of Mathematics
Indian Institute of Technology Guwahati, India
gkd@iitg.ernet.in
I Background
I Definition of approximation algorithms
I Some examples of approximation algorithms
I Polynomial time approximation scheme (PTAS)
I Conclusion
Optimization Problem
I Brute-force algorithms
1. Develop clever enumeration strategies.
2. Guaranteed to find optimal solution.
3. No guarantees on running time.
I Heuristics
1. Develop intuitive algorithms.
2. Guaranteed to run in polynomial time.
3. No guarantees on quality of solution.
I Approximation algorithms
1. Guaranteed to run in polynomial time.
2. Guaranteed to get a solution which is close to the optimal solution
(a.k.a near optimal).
3. Obstacle : need to prove a solution’s value is close to optimum value,
without even knowing what the optimum value is !
Approximation Algorithm : Definition
P An optimization problem
A An approximation algorithm
I An instance of P
∗
A (I) Optimal value for the instance I
A(I) Value for the instance I generated by A
1. Absolute approximation
I A is an absolute approximation algorithm if there exists a constant k
such that, for every instance I of P, |A∗ (I) − A(I)| ≤ k.
I For example, Planar graph coloring.
2. Relative approximation
I A is an relative approximation algorithm if there exists a constant k
A∗ (I) A(I)
such that, for every instance I of P, max{ A(I) , A∗ (I) } ≤ k.
I Vertex cover.
Examples we discuss in this lecture
1. Vertex Cover
2. Traveling Salesman Problem
3. Bin Packing
1) Vertex Cover
(a) (b)
(c) (d)
Figure: (a) An undirected graph (b) A trivial vertex cover (c) A vertex cover (d)
An other vertex cover
Greedy algorithm 1
1. C ←∅
2. pick any edge (u, v ) ∈ E .
3. C = C ∪ {u, v }
4. remove all edges incident on either u or v from E .
5. repeat the process till all edges are removed from E .
6. return C .
Algorithm 1 with an example
A C
B
(d) (e) (f )
1 1
2 2
3 3
.. ..
n n
1. C ←∅
2. take a vertex v ∈ V of maximum degree (tie can be broken arbitrarily).
3. C = C ∪ {v }
4. remove all edges incident on v from E .
5. repeat the process till all edges are removed from E .
6. return C .
Algorithm 2 with an example
k! vertices of degree k
···
C2
100
C1
31
66
C3 85
101
20
65
C4 110 C5
Example
C2
100
∞
C1
31
∞ 66
C3 85
101
20
65
C4 110 C5
Example
C2
100
∞
C1
31
∞ 66
C3 85
101
20
65
C4 110 C5
Hardness
30 20 12 30 20 12
10 10
40 40
30 20 12 30 20 12
10 10
40 40
30 20 12 30 20 12
10 10
40 40
Analysis of Algorithm 1
1. Compute a MST.
2. Replace each edge of MST by two copies of itself.
3. Find an Eulerian tour.
4. Shortcut the tour to get a Hamiltonian cycle.
5. Return the Hamilton cycle.
Example
C2
100
C1
31
66
C3 85
101
20
65
C4 110 C5
Example
C2
C1
31
66
C3
20
65
C4 C5
Example
C2
C1 31
31
66
66 C3
20
65 65
20
C4 C5
Example
C2
C1 31 Eulerian tour
31
66
20
65 65
20
C4 C5
Example
C2
100
Eulerian tour
C1 C1, C3, C4, C3, C5, C3, C2, C3, C1
66
C3 85
Hamilton Cycle
C1, C3, C4, C5, C2, C1
20
C4 110 C5
Analysis of Algorithm 2
0.1
0.1 0.2 0.4
0.5
0.2
0.1
0.1
0.2
0.8 0.7
0.5 0.6 0.4
0.4
0.8 0.7
0.6
0.4
0.2
D D D
l×D
D D D
D D D
D D D
1. Basics of approximation.
2. Need of approximation algorithms.
3. Some examples, Vertex cover, TSP, and Bin packing.
4. PTAS
Some books
Arora, S. (1996).
Polynomial time approximation schemes for euclidean tsp and other
geometric problems.
In Foundations of Computer Science, 1996. Proceedings., 37th Annual
Symposium on, pages 2–11. IEEE.
Håstad, J. (2001).
Some optimal inapproximability results.
Journal of the ACM (JACM), 48(4):798–859.
Hochbaum, D. S. and Maass, W. (1985).
Approximation schemes for covering and packing problems in image
processing and VLSI.
Journal of the ACM (JACM), 32(1):130–136.
Karakostas, G. (2009).
A better approximation ratio for the vertex cover problem.
ACM Transactions on Algorithms (TALG), 5(4):41.
Thank You!