Download presentation
Presentation is loading. Please wait.
Published byLeonard Lane Modified over 9 years ago
1
Although this may seem a paradox, all exact science is dominated by the idea of approximation. Bertrand Russell Approximation Algorithm
2
2 Definition 3.1.1 An approximation algorithm A for an optimization problem Q is a polynomial time algorithm such that given an input instance I for Q it will output some s ∈ S(I) We will denote by A(I) the value f(s) of the solution obtained by A. We need some way of comparing approximation algorithms and analyzing the quality of solutions produced by them Moreover the measure of goodness of an approximation algorithm must somehow relate the optimal solution to the solution produced by the algorithm Such measures are referred to as performance guarantees and the exact choice of such a measure is not obvious.
3
3 Absolute Performance Guarantees Definition 3.1.2 An α-absolute approximation algorithm is a polynomial time approximation algorithm for Q such that for some constant α>0,
4
4 For example The planar coloring problem Find the minimum number of colors needed to color a planar graph G = (V, E). Theorem3.1.1 The problem of deciding whether a planar graph is colorable is NP-complete It is also well known that any planar graph is colorable In fact the infamous Four Color Theorem for planar maps tells us that every planar graph is colorable.
5
5 Theorem 3.1.2 Any planar graph can be colored using at most four colors. Hence, if m is the number of colors needed, then m≤4. An absolute approximation algorithm: PlanarColor(V, E) 1 if V=ø then m ← 0 2 else if E= ø then m ← 1 3 else if Bipartite(V, E) then m ← 2 4 else m← 4 5 return m
6
6 PlanarColor(V, E) is a 1-absolute approximation algorithm because: Its time complexity is O(|E| + |V|), i.e. polynomial in the size of the graph because Bipartite(V, E) can be written so as to check each edge at most twice.
7
7 Bipartite(V, E) 1 for i←1 to n do node(i) ← 0 2 ENQUEUE(Q, 1); node(1) ← 1 3 while Q ≠ø do 4 i←DEQUEUE(Q) 5 for each j such that (i, j) ∈ E do 6 if node(i) = node(j) then return false 7 else 8 if node(j) = 0 then 9 ENQUEUE(Q, j) 10 node(j) ←3 − node(i) 11 return true
8
8 Very few NP-hard problems have polynomial-time absolute approximation algorithms. Most of our focus is finding good relative approximation algorithms. Relative performance guarantees are more common than absolute (additive) performance guarantees. One reason is that many NP-hard optimization problems are rescalable: given an instance of the problem, one can construct a new, equivalent instance by scaling the objective function. For instance, the traveling salesman problem is rescalable — given an instance, multiplying the edge weights by any λ > 0 yields an equivalent problem with the objective function scaled byλ.
9
9 Relative Performance Guarantees Definition 3.1.3 Let A be an approximation algorithm for an optimization problem Q The performance ratio R(I) of the algorithm A on an input instance I is defined as in the case where Q is a minimization problem. On the other hand when Q is a maximization problem we define the performance ratio as
10
10 The ratio is always at least 1 and the algorithm produces a better approximation if the ratio is closer to 1. Definition 3.1.4 The absolute performance ratio R of an approximation algorithm A for an optimization problem Q is and call this approximation algorithm with absolute performance ratio R as R-approximation algorithm.
11
11 Definition 3.1.5 The asymptotic performance ratio R of an approximation algorithm A for an optimization problem Q is
12
12 Definition 3.1. 6 An approximation scheme (AS) for an optimization problem Q is an approximation algorithm A that takes as input not only an instance of the problem, but also a value ε> 0 such that for any fixed ε, the scheme is a (1+ε)-approximation algorithm, namely R(I,ε) ≤1+ε Definition 3.1. 7 Polynomial- time approximation scheme (PTAS) is an approximation scheme, For any fixed ε> 0, the approximation scheme runs in time polynomial in the size |I| of its input instance I.
13
13 The running time of a polynomial-time approximation scheme can increase very rapidly as ε decreases. Definition 3.1. 8 A fully polynomial-time approximation scheme (FPTAS) is an approximation scheme, the running time of this scheme is polynomial both in 1/ε and in the size |I| of the input instance I.
14
14 Homework Exercises:Page 76 1
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.