Design and Analysis of AlgorithmsApproximation algorithms for NP-complete problems
2Coping With NP-Hardness•Brute-force algorithms.Develop clever enumeration strategies.Guaranteed to find optimal solution.No guarantees on running time.Heuristics.–Develop intuitive algorithms.–Guaranteed to run in polynomial time.–No guarantees on quality of solution.Approximation algorithms.•Guaranteed to run in polynomial time.•Guaranteed to find "high quality" solution, say within 1% of optimum.Obstacle: need to prove a solution’s value is close to optimum,without even knowing what optimum value is!
3Approximate Algorithms (chap. 35)•Motivation:–Many problems are NP-complete, so unlikely find efficient algorithms–Three ways to get around:•If input size is small, exponential algorithm is OK.•Isolate important special case and find poly algorithms for them.•Find near-optimal solutions in poly time. •So approximate algorithms:–An algorithm returning a near-optimal solution is called approximate algorithm.
Some Characteristics of Approximation Algorithms•Time-efficient (sometimes not as efficient as heuristics)•Don’t guarantee optimal solution•Guarantee good solution within some factor of the optimum •Rigorous mathematical analysis to prove the approximation guarantee•Often use algorithms for related problems as subroutines- Depending on the problem , an optimal solution may be defined as the problem of maximization or minimization problem.
Approximation algorithms for NPC problems•If a problem is NP-complete, there is very likely no polynomial-time algorithm to find an optimal solution•The idea of approximation algorithms is to develop polynomial-time algorithms to find a near optimal solution
Approximation algorithms for NPC problems•E.g.: develop a greedy algorithm without proving the greedy choice property and optimal substructure.•Are those solution found near-optimal?•How near are they?
Approximation algorithms for NPC problems•Approximation ratio –C*-Define the cost of the optimal solution as C*–C- The cost of the solution produced by a approximation algorithm is C•The approximation algorithm is then called a -approximation algorithm.•
Approximation algorithms for NPC problems•E.g.:–If the total weigh of a MST of graph G is 20–A algorithm can produce some spanning trees, and they are not MSTs, but their total weights are always smaller than 25–What is the approximation ratio?