Top Banner

Click here to load reader

Approximation Algorithms. 2301681Approximation Algorithms2 Outlines  Why approximation algorithm?  Approximation ratio  Approximation vertex cover

Dec 19, 2015

ReportDownload

Documents

  • Slide 1
  • Approximation Algorithms
  • Slide 2
  • 2301681Approximation Algorithms2 Outlines Why approximation algorithm? Approximation ratio Approximation vertex cover problem Approximation traveling salesman problem (TSP) Other interesting problems
  • Slide 3
  • 2301681Approximation Algorithms3 3 approaches for NP-complete Problems For small inputs, an exponential algorithm is OK. Try to solve important special cases in polynomial time. Find near-optimal solutions in polynomial time (worst case or on average). An algorithm that returns near-optimal solutions is called an approximation algorithm.
  • Slide 4
  • 2301681Approximation Algorithms4 Approximation Ratio If, for any input of size n for a problem, the cost C of the solution produced by an algorithm is within a factor of (n) of the cost C of an optimal solution (where max(C/C , C /C) (n)), we say that, the algorithm has an approximation ratio of (n) or the algorithm is a (n)-approximation algorithm.
  • Slide 5
  • 2301681Approximation Algorithms5 On Approximation Ratio maximization problem 0 < C C C /C gives the factor by which the cost of an optimal solution is larger than the cost of the approximate solution. minimization problem 0 < C C C/C gives the factor by which the cost of the approximate solution is larger than the cost of an optimal solution. A 1-approximation algorithm produces an optimal solution. large approximation ratio => a solution can be much worse than optimal.
  • Slide 6
  • 2301681Approximation Algorithms6 Polynomial-time approximation algorithms may: have small constant approximation ratios. have approximation ratios that grow as functions of the input size n. achieve increasingly smaller approximation ratios by using more and more computation time.
  • Slide 7
  • 2301681Approximation Algorithms7 Approximation scheme An approximation algorithm that takes as input both an instance of the problem, and a value > 0 such that for any fixed , the scheme is a (1 + )-approximation algorithm.
  • Slide 8
  • 2301681Approximation Algorithms8 Polynomial-time Approximation Scheme An approximation scheme is a polynomial-time approximation scheme if for any fixed > 0, the scheme runs in time polynomial in the size n of its input instance. a fully polynomial-time approximation scheme if it is an approximation scheme and its running time is polynomial both in 1/ and in the size n of the input instance. Ex: running time of O((1/ ) 2 n 3 ).
  • Slide 9
  • Approximate Vertex Cover
  • Slide 10
  • 2301681Approximation Algorithms10 Vertex Cover A vertex cover of an undirected graph G = (V, E) is a subset V V such that if (u, v) is an edge of G, then either u V or v V. The size of a vertex cover is the number of vertices in it. An optimal vertex cover is a vertex cover of minimum size in an undirected graph. The vertex-cover problem is to find an optimal vertex cover in a given undirected graph.
  • Slide 11
  • 2301681Approximation Algorithms11 Example of Vertex Covers AB CED F AB CED F
  • Slide 12
  • 2301681Approximation Algorithms12 Approximate Vertex Cover AVC(G) C E E[G] while E do Choose an arbitrary edge (u,v) from E C C {u, v} E=E-{(x, y)| x=u or x=v or y=u or y=v} return C
  • Slide 13
  • 2301681Approximation Algorithms13 Find Approximted Vertex Covers (1) C E E[G] while E do Choose an arbitrary edge (u,v) from E C C {u, v} E = E - {(x, y)| x=u or x=v or y=u or y=v} return C AB CED F t return the largest element in L n O(2 n ) Max. size of L i is 2 n.">
  • 2301681Approximation Algorithms43 Exponential-time Exact Subset Sum EXACT-SUBSET-SUM(S, t) n |S| L 0 0 for i 1 to n do L i MERGE-LISTS(L i1, L i1 + x i ) remove from L i every element a, a>t return the largest element in L n O(2 n ) Max. size of L i is 2 n.
  • Slide 44
  • 2301681Approximation Algorithms44 Example Let S = {1, 4, 5} and t =8. L 0 = 0 L 1 = 0, 1 , L 2 = 0, 1, 4, 5 , L 3 = 0, 1, 4, 5, 6, 9, 10 . n |S| L 0 0 for i 1 to n do L i MERGE(L i1,L i1 +x i ) L i+1 = L i {a|a L i, a>t} return the largest element in L n
  • Slide 45
  • 2301681Approximation Algorithms45 fully polynomial-time approximation scheme Approximation by trimming each list L i after it is created. If two values in L are close to each other, then one of them can be removed. Let , 0 < < 1, be a trimming parameter. x approximates y with trimming parameter if y/(1 + ) x y. To trim a list L by remove an element z from L if there is an element x in L which approximates y.
  • Slide 46
  • 2301681Approximation Algorithms46 Trimming a list: Example Let = 0.1 and L = 10, 11, 12, 15, 20, 21, 22, 23, 24, 29 . To trim L, we obtain L = 10, 12, 15, 20, 23, 29 . 11 is represented by 10 21 and 22 are represented by 20 24 is represented by 23.
  • Slide 47
  • 2301681Approximation Algorithms47 APPROX-SUBSET-SUM APPROX-SUBSET-SUM(S, t, ) n = |S| L 0 = 0 for i = 1 to n do L i = MERGE-LISTS(L i1, L i1 + x i ) L i = TRIM(Li, /2n) L i+1 = L i {a| a L i and a>t } Find the largest value, z*, in L n return z*
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.