490 likes | 522 Vues
Polynomial Time Approximation Schemes. Presented By:. Leonid Barenboim Roee Weisbert. Introduction. Approximation Algorithms used to find approximate solutions to optimization problems. often associated with NP-hard problems.
E N D
Polynomial Time Approximation Schemes Presented By: Leonid Barenboim Roee Weisbert
Introduction • Approximation Algorithms • used to find approximate solutions to optimization problems. • often associated with NP-hard problems. • since it is unlikely that one can find an efficient polynomial exact • solution, a marginal error rate Is allowed in order to get a “close enough” • approximation in a polynomial running time.
Introduction PTAS (Polynomial Time Approximation Scheme) Takes an instance of an optimization problem and a constant parameter ε > 0. Produces a solution that is within a factor 1 + ε of being optimal, in polynomial time. For example: computing a (1 + 1/100)-approximation of a solution with minimum number of elements: Elements in optimal solution: |opt| in approximation: < 1.01 * |opt|
Edge-Coloring Assign colors to edges such that edges that have a common vertex are assigned distinct colors. Computing a solution with minimum number of colors – NP-hard.
Edge-Coloring D = 4 Definition:D – maximum vertex degree. The number of colors in an optimal solution is > D. Theorem(Vizing, 1964): Any graph is (D+1)-colorable in polynomial time.
(D+4)-Coloring Planar Graphs Planar Graph – no two edges are crossing Fact: |E| < 3|V|. (can be proved using Euler Characteristic.) Therefore, there is a vertex with degree < 6 . Otherwise, 2|E| = Sv in V deg(v) > 6|V| .
(D+4)-Coloring Planar Graphs The Algorithm While the graph is not empty: Find a vertex v with degree < 6, and remove it. Add the removed vertices back, in inverse order: For each added vertex: color its adjacent uncolored edges using colors from {1,2,…,D+4}. 1. 2. 3. 4. 5. G(V / v) G v
(D+4)-Coloring Planar Graphs The Algorithm While the graph is not empty: Find a vertex v with degree < 6, and remove it. Add the removed vertices back, in inverse order: For each added vertex: color its adjacent uncolored edges using colors from {1,2,…,D+4}. 1. 2. 3. 4. 5. G(V / v)
(D+4)-Coloring Planar Graphs The Algorithm While the graph is not empty: Find a vertex v with degree < 6, and remove it. Add the removed vertices back, in inverse order: For each added vertex: color its adjacent uncolored edges using colors from {1,2,…,D+4}. 1. 2. 3. 4. 5. u G(V / {v , u})
(D+4)-Coloring Planar Graphs The Algorithm While the graph is not empty: Find a vertex v with degree < 6, and remove it. Add the removed vertices back, in inverse order: For each added vertex: color its adjacent uncolored edges using colors from {1,2,…,D+4}. 1. 2. 3. 4. 5. G(V / {v , u})
(D+4)-Coloring Planar Graphs The Algorithm While the graph is not empty: Find a vertex v with degree < 6, and remove it. Add the removed vertices back, in inverse order: For each added vertex: color its adjacent uncolored edges using colors from {1,2,…,D+4}. 1. 2. 3. 4. 5. u G(V / {v , u})
(D+4)-Coloring Planar Graphs The Algorithm While the graph is not empty: Find a vertex v with degree < 6, and remove it. Add the removed vertices back, in inverse order: For each added vertex: color its adjacent uncolored edges using colors from {1,2,…,D+4}. 1. 2. 3. 4. 5. w u G(V / {v , u})
(D+4)-Coloring Planar Graphs The Algorithm While the graph is not empty: Find a vertex v with degree < 6, and remove it. Add the removed vertices back, in inverse order: For each added vertex: color its adjacent uncolored edges using colors from {1,2,…,D+4}. 1. 2. 3. 4. 5. w u G(V / {v , u})
(D+4)-Coloring Planar Graphs The Algorithm While the graph is not empty: Find a vertex v with degree < 6, and remove it. Add the removed vertices back, in inverse order: For each added vertex: color its adjacent uncolored edges using colors from {1,2,…,D+4}. 1. 2. 3. 4. 5. w u G(V / {v , u})
(D+4)-Coloring Planar Graphs The Algorithm While the graph is not empty: Find a vertex v with degree < 6, and remove it. Add the removed vertices back, in inverse order: For each added vertex: color its adjacent uncolored edges using colors from {1,2,…,D+4}. 1. 2. 3. 4. 5. w u G(V / {v , u})
(D+4)-Coloring Planar Graphs The Algorithm While the graph is not empty: Find a vertex v with degree < 6, and remove it. Add the removed vertices back, in inverse order: For each added vertex: color its adjacent uncolored edges using colors from {1,2,…,D+4}. 1. 2. 3. 4. 5. w u G(V / {v , u})
(D+4)-Coloring Planar Graphs The Algorithm While the graph is not empty: Find a vertex v with degree < 6, and remove it. Add the removed vertices back, in inverse order: For each added vertex: color its adjacent uncolored edges using colors from {1,2,…,D+4}. 1. 2. 3. 4. 5. w u G v
The Shifting Strategy Hochbaum and Mass, 1984 The shifting strategy allows to bound the error of a divide-and-conquer approach by applying it repetitively, and eventually- selecting the most favorable solution.
Covering with Planar Disks • Given: • set P of n points in the plane. • some numerical value D. • Let value lbe called the “shifting parameter”. • The goal: to cover P’s points with the minimal number of disks of diameter D. Illustration: D
The Shifting Strategy Step 1 : Wrapping P’s points with an area we refer as I. Illustration:
The Shifting Strategy This is how the optimal solution might look. We’ll refer to It as OPT. Illustration:
The Shifting Strategy Step 2 : We subdivide I into vertical stripes of width D. Each stripe is left closed and right open groups of lconsecutive stripes. Note: At this point (for better understanding) let’s deal with l=3andD=1 Illustration: D D D l*D
The Shifting Strategy Note 1: At this point we shall assume that an algorithm (As) was given to us. furthermore, this algorithm could yield an optimal solution within the range of a given stripe. Illustration: l*D
The Shifting Strategy Note 2 : although an optimal solution could be yielded at any stripe (in separate), their union doesn’t guarantee an optimal solution of entire rectangle’s area. hence – one should consider using Shifts of those stripes, in order to reach as close as he can to OPT. Illustration: ≠ OPT l*D
The Shifting Strategy Step 3 : We’ll notice that there are l ways to partition that area to stripes of width l*D. Illustration: (SHIFT 0)
The Shifting Strategy Step 3 : We’ll notice that there are l ways to partition that area to stripes of width l*D. Illustration: (SHIFT 1)
The Shifting Strategy Step 3 : We’ll notice that there are l ways to partition that area to stripes of width l*D. Illustration: (SHIFT 2)
Algorithm Flow num = ∞ For i = 1 to l // As(SHIFTi) is an application of As on all stripes of SHIFTi num = min(As(SHIFTi), num) Return num Note: we claim that this algorithm is a close and good enough approximation of OPT. Let’s prove it!
Approximation Proof First, let’s take a look on how the union of all Shifts might look: Observation 1:each circle intersects with no more than one vertical line. (!) remember- those lines are left closed and right opened.
Approximation Proof Let’s take a look on the different shifts’ results in comparison to OPT: |SHIFT0| = 11 |SHIFT1| = 9 |OPT| = 9 |SHIFT2| = 9
Approximation Proof Now, let’s take a look on the number of circles from OPT that are being intersected by every Shift’s vertical lines: SHIFT0 OPT SHIFT1 Observation 2:there exists SHIFTi for some value of i, that contains a number of intersected OPT circles which is < (1/l * |OPT|). note: in our case it’s less than ((1/3) * 9). SHIFT2
Approximation Proof Proof: in proof by contradiction we assume that in every SHIFTi , the number of intersected circles (originated from OPT ) is (1/3*|OPT|) (1/3*|OPT|) SHIFT0 (1/3*|OPT|) SHIFT1 OPT (1/3*|OPT|) We get an immediate contradiction! Intuition: The Pigeonhole Principle. SHIFT2
Approximation Proof At this point, we’ll take SHIFT1 that sustains the: (1/3*|OPT|) property. and compare it to OPT by terms of the stripes of this particular SHIFT. As(SHIFT1) OPT We’ll count the number of circles in every separate stripe (“splits” in OPT will be counted twice!), and come to the conclusion that this SHIFT’s accumulated number should definitely be less than the number of circles we count in OPT. On the other hand, we already proved that this number is (1 +1/3) * |OPT|.
Approximation Proof Which proves that by a given algorithm As we can (and will) get a (1+1/l)*|OPT| approximation of the optimal solution. or in other words: ( ) 1 Σ min i=1,...,l | OPT j | |OPT| 1 + l j∈Si But… We should produce such algorithm As, rather than assuming its existence…
Exploring Algorithm As Let’s take a look at a particular stripe in order to understand how As should work: • Assume we can compute an optimal solution • in each square, by an algorithm Bs. l*D
Exploring Algorithm As Let’s take a look at a particular stripe in order to understand how As should work: • Assume we can compute an optimal solution • in each square, by an algorithm Bs. Apply the shifting techniques with square shifts. l*D
Exploring Algorithm As Let’s take a look at a particular stripe in order to understand how As should work: • Assume we can compute an optimal solution • in each square, by an algorithm Bs. Apply the shifting techniques with square shifts. l*D
Exploring Algorithm As Let’s take a look at a particular stripe in order to understand how As should work: • Assume we can compute an optimal solution • in each square, by an algorithm Bs. Apply the shifting techniques with square shifts. l*D
Exploring Algorithm As Let’s take a look at a particular stripe in order to understand how As should work: • Assume we can compute an optimal solution • in each square, by an algorithm Bs. Apply the shifting techniques with square shifts. l*D
Exploring Algorithm As Let’s take a look at a particular stripe in order to understand how As should work: • Assume we can compute an optimal solution • in each square, by an algorithm Bs. Apply the shifting techniques with square shifts. l*D
Exploring Algorithm As Let’s take a look at a particular stripe in order to understand how As should work: • Assume we can compute an optimal solution • in each square, by an algorithm Bs. Apply the shifting techniques with square shifts. l*D
Exploring Algorithm As Let’s take a look at a particular stripe in order to understand how As should work: • Assume we can compute an optimal solution • in each square, by an algorithm Bs. Apply the shifting techniques with square shifts. Select the shift with minimum number of disks. The solution in a stripe is (1 + 1/ l)-approximation. The entire solution is (1 + 1/ l) -approximation. 2 l*D
Optimal Solution in a Square Computed directly using exhaustive search in polynomial time.
Optimal Solution in a Square Computed directly using exhaustive search in polynomial time. Lemma 1: A square of size l D * l D can be covered with 2 l disks 2
Optimal Solution in a Square Computed directly using exhaustive search in polynomial time. Lemma 2: There is an optimal solution in which each disk with > 2 vertices has two vertices on its boundary.
Optimal Solution in a Square Computed directly using exhaustive search in polynomial time. Lemma 3: Each two points have two options for disk placements.
Optimal Solution in a Square Computed directly using exhaustive search in polynomial time. Let n = 2 * ( ) n 2 Lemma 3: Each two points have two options for disk placements.
Optimal Solution in a Square Computed directly using exhaustive search in polynomial time. Let n = 2 * ( ) n 2 Lemma 3: Total number of combinations: n * (n-1) * … * (n - 2 l ) < n Each two points have two options for disk placements. 2 2 4 l
Summary • Optimal solution in a square in polynomial time • (1 +1/ l )-approximation in a stripe in polynomial time • (1 + 1 / l ) - approximation in the original area I in polynomial time 2 For any e there is l such that (1 + 1 / l ) < 1 + e 2 PTAS for the problem of Covering with Planar Disks