1 / 10

Approximation Algorithms

Approximation Algorithms. Approximation Algorithms. Coming up Concepts of approximation algorithms Examples of approximation algorithms The Vertex-Cover Problem The Traveling Salesman Problem (Chap 35). Approximation Algorithms. If a problem is NP-complete, what can we do?

livia
Download Presentation

Approximation Algorithms

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Approximation Algorithms

  2. Approximation Algorithms Coming up • Concepts of approximation algorithms • Examples of approximation algorithms • The Vertex-Cover Problem • The Traveling Salesman Problem (Chap 35)

  3. Approximation Algorithms If a problem is NP-complete, what can we do? • If the actual inputs are small, an algorithm with exponential running time may be satisfactory. • We may be able to isolate important special cases that are solvable in polynomial time. • It may still be possible to find near-optimal solutions in polynomial time. Approximation Algorithm near-optimal solutions

  4. Approximation Algorithms For optimization problems, solutions are associated with a cost. • The optimal solution should provide an optimal cost: C*. • An approx. algorithm gives a near-optimal solution with a cost, say C. We care about how C is near to C*. Consider C/C* and C*/C. For minimization problems: C/C* > 1, C*/C<1 => max(C/C*, C*/C) = C/C* describes how good C is. For maximization problems: C*/C > 1, C/C*<1 => max(C/C*, C*/C) = C*/C describes how good C is. Thus, max (C/C*, C*/C) describes how C* is near to the optimal.

  5. Approximation Algorithms Given an optimization alg., we say it has an approximation ratio of (n) if:For any input of size n, max (C/C*, C*/C) (n). It is a (n)-approximation algorithm. A 1-approximation algorithm produces an optimal solution. Some polynomial-time approx. algorithms have approximation ratios that grow as functions of the input size n.(eg. set-cover) Some polynomial-time approx. algorithms have approximation ratios that improve when it is allowed to spend longer and longer time to run.(eg. Subset-sum) Some polynomial-time approx. algorithms have approximation ratios that can be specified by you as 1+ and it runs as a (1+)-approx alg.. T(n) could be polynomial or exponential in 1/ etc.. eg.O((1/ )2n3).

  6. 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 Approximation Algorithms Approx_Vertex_Cover(G) /* G = (V,E) */ 1 C =  2 E’ = E 3 while E’   4 let (u,v) be an arbitrary edge of E’ 5 C = C U {u,v} 6 remove from E’ every edge joining either u or v 7 return C The Vertex-Cover Problem: Optimal solution (C*) Near-optimal solution (C)

  7. b c d b c d a e f g a e f g Approximation Algorithms Approx_Vertex_Cover(G) /* G = (V,E) */ 1 C =  2 E’ = E 3 while E’   4 let (u,v) be an arbitrary edge of E’ 5 C = C U {u,v} 6 remove from E’ every edge joining either u or v 7 return C Approx_Vertex_Cover is a 2-approximation algorithm. Proof: Consider line 4. Suppose there are totally |A| edges considered in line 4. Then |C*||A| But |C| = 2|A| Hence |C| = 2|A|  2|C*| Optimal solution (C*) Near-optimal solution (C)

  8. a a a d d d a a d d e e e e e b b b f f f g g g b b f f g g c c c c c h h h h h Optimal solution (C*) Approximation Algorithms The Traveling-Salesman Problem (where the edge weights are the Euclidean distances) Given a complete graph, Find a simple cycle thru all vertices with minimum total weight. Near-optimal solution (C)

  9. a a d d a a d d e e e e b b f f g g b b f f g g c c c c h h h h Optimal solution (C*) Near-optimal solution (C) Approximation Algorithms The Traveling-Salesman Problem (where the edge weights are the Euclidean distances) Approx_TSP_Tour is a 2-approximation algorithm. Proof: • If we removed one edge from C*, we get a spanning tree. • ie. The cost of C*  some spanning tree. • Cost of the min. spanning tree  costs of all spanning trees. • => Cost of the min. spanning tree  cost of C*. • Cost of C  2 x cost of the minimum spanning tree. • Conclusion: cost of C  2 x cost of C*.

  10. Approximation Algorithms Summary • Concepts of approximation algorithms • Examples of approximation algorithms • The Vertex-Cover Problem • The Traveling Salesman Problem

More Related