Approximation Algorithm
Approximation Algorithm
Key Features
1. Efficiency:
o Approximation algorithms run in polynomial time, making them suitable for
large input sizes.
2. Approximation Ratio:
o Measures how close the approximation solution is to the optimal solution.
o If CapproxC_{\text{approx}}Capprox is the cost of the solution from the
approximation algorithm and CoptC_{\text{opt}}Copt is the cost of the
optimal solution: Approximation Ratio (R)=max(CapproxCopt,CoptCapprox)\
text{Approximation Ratio (R)} = \max \left(\frac{C_{\text{approx}}}{C_{\
text{opt}}}, \frac{C_{\text{opt}}}{C_{\text{approx}}}\
right)Approximation Ratio (R)=max(CoptCapprox,CapproxCopt)
Applications
1. Approximation Quality:
o The solution may not be close enough to the optimal, especially for problems
with high approximation ratios.
2. Not Always Applicable:
o For some problems, finding even an approximate solution can be as hard as
finding the exact solution.
3. No Guarantee for Specific Inputs:
o Performance depends on the problem instance. Some instances might yield
poor approximations.
4. Complexity of Implementation:
o Approximation algorithms can still be intricate and difficult to implement.
5. Trade-off Between Accuracy and Efficiency:
o Higher accuracy often comes at the cost of increased computational
complexity.
Example 1: Vertex Cover
Problem:
Given a graph G=(V,E)G = (V, E)G=(V,E), find the smallest subset of vertices such that
every edge in EEE has at least one endpoint in the subset.
Approximation Algorithm:
Analysis:
Approximation Ratio: 222 (the solution is at most twice the optimal size).
Example:
Problem:
Find the shortest possible route that visits every city exactly once and returns to the starting
city.
Approximation Algorithm:
Approximation Ratio:
For metric TSP (distances satisfy the triangle inequality), the approximation ratio is
222.
Example:
Conclusion