1 Combinatorial Algorithms Parametric Pruning. 2 Metric k-center Given a complete undirected graph G = (V, E) with nonnegative edge costs satisfying the.

Slides:



Advertisements
Similar presentations
NP-Hard Nattee Niparnan.
Advertisements

Instructor Neelima Gupta Table of Contents Approximation Algorithms.
Set Cover 資工碩一 簡裕峰. Set Cover Problem 2.1 (Set Cover) Given a universe U of n elements, a collection of subsets of U, S ={S 1,…,S k }, and a cost.
Chapter 6. Relaxation (1) Superstring Ding-Zhu Du.
Lecture 24 Coping with NPC and Unsolvable problems. When a problem is unsolvable, that's generally very bad news: it means there is no general algorithm.
1 NP-completeness Lecture 2: Jan P The class of problems that can be solved in polynomial time. e.g. gcd, shortest path, prime, etc. There are many.
Approximation Algorithms for TSP
1 The TSP : Approximation and Hardness of Approximation All exact science is dominated by the idea of approximation. -- Bertrand Russell ( )
Combinatorial Algorithms
1 NP-Complete Problems. 2 We discuss some hard problems:  how hard? (computational complexity)  what makes them hard?  any solutions? Definitions 
Approximation Algorithms Chapter 5: k-center. Overview n Main issue: Parametric pruning –Technique for approximation algorithms n 2-approx. algorithm.
Combinatorial Algorithms
Complexity 16-1 Complexity Andrei Bulatov Non-Approximability.
Computability and Complexity 23-1 Computability and Complexity Andrei Bulatov Search and Optimization.
Complexity 15-1 Complexity Andrei Bulatov Hierarchy Theorem.
Introduction to Approximation Algorithms Lecture 12: Mar 1.
Approximation Algorithms
Approximation Algorithms: Combinatorial Approaches Lecture 13: March 2.
P-Center & The Power of Graphs A part of the facility location problem set By Kiril Yershov and Alla Segal For Geometric Optimizations course Fall 2010.
1 Optimization problems such as MAXSAT, MIN NODE COVER, MAX INDEPENDENT SET, MAX CLIQUE, MIN SET COVER, TSP, KNAPSACK, BINPACKING do not have a polynomial.
NP-Complete Problems Reading Material: Chapter 10 Sections 1, 2, 3, and 4 only.
NP-Complete Problems Problems in Computer Science are classified into
9-1 Chapter 9 Approximation Algorithms. 9-2 Approximation algorithm Up to now, the best algorithm for solving an NP-complete problem requires exponential.
Greedy Algorithms Like dynamic programming algorithms, greedy algorithms are usually designed to solve optimization problems Unlike dynamic programming.
Approximations for hard problems Example: Scheduling Given: n jobs with processing times, m identical machines. Problem: Schedule so as to minimize makespan.
Approximation Algorithms Motivation and Definitions TSP Vertex Cover Scheduling.
The Theory of NP-Completeness 1. Nondeterministic algorithms A nondeterminstic algorithm consists of phase 1: guessing phase 2: checking If the checking.
1 Introduction to Approximation Algorithms. 2 NP-completeness Do your best then.
Nattee Niparnan. Easy & Hard Problem What is “difficulty” of problem? Difficult for computer scientist to derive algorithm for the problem? Difficult.
Approximating Minimum Bounded Degree Spanning Tree (MBDST) Mohit Singh and Lap Chi Lau “Approximating Minimum Bounded DegreeApproximating Minimum Bounded.
1 Introduction to Approximation Algorithms. 2 NP-completeness Do your best then.
Advanced Algorithm Design and Analysis (Lecture 13) SW5 fall 2004 Simonas Šaltenis E1-215b
1 A -Approximation Algorithm for Shortest Superstring Speaker: Chuang-Chieh Lin Advisor: R. C. T. Lee National Chi-Nan University Sweedyk, Z. SIAM Journal.
Chapter 15 Approximation Algorithm Introduction Basic Definition Difference Bounds Relative Performance Bounds Polynomial approximation Schemes Fully Polynomial.
Approximation Algorithms
Chapter 6: Geometric Analysis: The Gap Property By azam sadeghian 1.
Combinatorial Optimization Problems in Computational Biology Ion Mandoiu CSE Department.
Princeton University COS 423 Theory of Algorithms Spring 2001 Kevin Wayne Approximation Algorithms These lecture slides are adapted from CLRS.
Chapter 2 Greedy Strategy I. Independent System Ding-Zhu Du.
CSE 589 Part VI. Reading Skiena, Sections 5.5 and 6.8 CLR, chapter 37.
Instructor Neelima Gupta Table of Contents Class NP Class NPC Approximation Algorithms.
Approximation Algorithms for TSP Tsvi Kopelowitz 1.
Variations of the Prize- Collecting Steiner Tree Problem Olena Chapovska and Abraham P. Punnen Networks 2006 Reporter: Cheng-Chung Li 2006/08/28.
Algorithms for hard problems Introduction Juris Viksna, 2015.
CSC 413/513: Intro to Algorithms
Lecture. Today Problem set 9 out (due next Thursday) Topics: –Complexity Theory –Optimization versus Decision Problems –P and NP –Efficient Verification.
Introduction to NP Instructor: Neelima Gupta 1.
Approximation Algorithms by bounding the OPT Instructor Neelima Gupta
Approximation Algorithms Greedy Strategies. I hear, I forget. I learn, I remember. I do, I understand! 2 Max and Min  min f is equivalent to max –f.
Instructor Neelima Gupta Table of Contents Introduction to Approximation Algorithms Factor 2 approximation algorithm for TSP Factor.
COSC 3101A - Design and Analysis of Algorithms 14 NP-Completeness.
Approximation algorithms
TU/e Algorithms (2IL15) – Lecture 11 1 Approximation Algorithms.
ICS 353: Design and Analysis of Algorithms NP-Complete Problems King Fahd University of Petroleum & Minerals Information & Computer Science Department.
The Theory of NP-Completeness
More NP-Complete and NP-hard Problems
Chapter 10 NP-Complete Problems.
Richard Anderson Lecture 26 NP-Completeness
Optimization problems such as
Richard Anderson Lecture 26 NP-Completeness
Hamiltonian Cycle and TSP
Hamiltonian Cycle and TSP
Computability and Complexity
Approximation Algorithms for TSP
ICS 353: Design and Analysis of Algorithms
Parameterised Complexity
Richard Anderson Lecture 28 NP-Completeness
Approximation Algorithms
Approximation Algorithms
Lecture 24 Vertex Cover and Hamiltonian Cycle
Presentation transcript:

1 Combinatorial Algorithms Parametric Pruning

2 Metric k-center Given a complete undirected graph G = (V, E) with nonnegative edge costs satisfying the triangle inequality, and k is a positive integer. For any set S  V and vertex v define connect(v,S) = min{cost(u,v)|u  S} (the cost of the cheapest edge from v to a vertex in S.) Find a set S  V, with |S|=k, so as to minimize max v {connect(v,S)}. The metric k-center problem is NP-hard.

Parametric pruning (1) If we know the cost of an optimal solution, we may be able to prune away irrelevant parts of the input and thereby simplify the search for a good solution. However computing the cost of an optimal solution is precisely the difficult core of NP-hard NP-optimization problems. The technique of parametric pruning gets around this difficulty as follows. A parameter t is chosen, which can be viewed as a “guess” on the cost of an optimal solution. For each value of t, the given instance I is pruned by removing parts that will not be used in any solution of cost > t. 3

Parametric pruning (2) The algorithm consists of two steps. In the first step, the family of instances I(t) is used for computing a lower bound on OPT, say t ∗. In the second step, a solution is found in instance I(α t ∗ ), for a suitable choice of α. 4

5 Instance 10753

6 Idea of Algorithm (k=2, OPT  7) 10753

7 Idea of Algorithm (k=2, OPT  3) 10753

8 Parametric pruning Sort the edges of G in nondecreasing order of cost, i.e. cost(e 1 )  cost(e 2 )  …  cost(e m ). Let G i = (V, E i ), where E i ={e 1, e 2,…, e i }. For each G i, we have to check whether there exists a subset S  V such that every vertex in V – S is adjacent to a vertex in S.

9 Dominating Set A dominating set in an undirected graph G = (V, E) is a subset S  V such that every vertex in V – S is adjacent to a vertex in S. Let dom(G) denote the size of minimum cardinality dominating set in G. Computing dom(G) is NP-hard.

10 k-Center The k-center problem is equivalent to finding the smallest index i such that G i has a dominating set of size at most k. G i contains k stars (K 1,p ) spanning all vertices. K 1,7

11 G2G2 Independent set (stable set) in G = (V, E) is a subset I  V of pairwise non-adjacent vertices. Define the square of graph G = (V, E) to be the graph G 2 = (V, E′), containing an edge (u,v)  E′ whenever G has a path of length at most 2 between. G=K 1,4 G2=K5G2=K5

12 Lower bound Lemma 4.1 Given a graph H, let I be an independent set in H 2. Then, | I |  dom(H).

13 Hochbaum-Shmoys Algorithm (1986) Input (G, cost: E → Q + ) 1) Construct G 1 2, G 2 2,…, G m 2. 2) Compute a maximal independent set, I r in each graph G r 2. 3)Find the smallest index r such that | I r |  k, say j. Output (I j )

14 Approximation ratio of Hochbaum-Shmoys Algorithm-1 Theorem 4.2 Hochbaum-Shmoys Algorithm achieves an approximation factor of 2 for the metric k- center problem.

15 Main Lemma Lemma 4.3 For j as defined in the algorithm, cost(e j ) ≤ OPT. Proof. For evry r k. Now by Lemma 4.1 dom(G r ) ≥ | I r | > k. So r* > r, and r* ≥ j. cost(e j ) ≤ OPT

16 Proof of Theorem 4.2 A maximal independent set I j in a graph G j 2 is also a dominating set. Thus there exist stars in G j 2 centered on the vertices of I j, covering all vertices. By the triangle inequality, each edge used in constructing these stars has cost at most 2cost(e j ). Lemma 6.3 implies 2 cost(e j ) ≤ 2 OPT.

17 Tight Example (k = 1)

18 Metric weighted k-center Given a complete undirected graph G = (V, E) with nonnegative edge costs satisfying the triangle inequality, a weight function on vertices, w: V → R + and a bound W  R +. For any set S  V and vertex v define connect(v,S) = min{cost(u,v)|u  S}. Find a set S  V of total weight at most W, so as to minimize max v {connect(v,S)}.

19 Weight dominating set Let wdom(G) denote the weight of minimum weight dominating set in G. Calculating wdom(G) is NP-hard.

20 Parametric pruning Sort the edges of G in nondecreasing order of cost, i.e. cost(e 1 )  cost(e 2 )  …  cost(e m ). Let G i = (V, E i ), where E i ={e 1, e 2,…, e i }. We need to find the smallest index индекс i such that wdom(G i )  W. If i* is this index, then the cost of the optimal solution is OPT = cost(e i* ).

21 Lightest neighbors Given a vertex weighted graph G = (V, E) let I be an independent set in G 2. For each u  I, let s(u) denote a lightest neighbor of u in G, where u is also considered a neighbor of itself. Let S = {s(u) | u  I }.

22 Lower Bound Lemma 4.4 Given graph H. Let I be an independent set in H 2. Then w(S)  wdom(H). Proof. Let D be a minimum weight dominating set of H. Then the exists a set of disjoint stars in H, centered on the vertices of D and covering all the vertices. Since each of these stars becomes a clique in H 2, the set I can pick at most one vertex from each of them. Thus each vertex in I has a center of the corresponding star available as a neighbor in H. Hence, w(S)  wdom(H).

23 Hochbaum-Shmoys Algorithm-2 Input (G, cost: E → Q +, w: V → R +,W) 1) Construct G 1 2, G 2 2,…, G m 2. 2) Compute a maximal independent set I r, in each graph G r 2. 3) Compute S r = {s r (u) | u  I r } 4) Find the minimum index r such that w(S r )  W, say j. Output (S j )

24 Approximation ratio of Hochbaum-Shmoys Algorithm-2 Theorem 4.5 Hochbaum-Shmoys Algorithm-2 achieves an approximation factor of 3 for the metric weighted k-center problem.

Proof By Lemma 4.4, cost(e j ) is a lower bound on OPT; the argument is identical to that in Lemma 4.3. Since I j is a dominating set in G j 2, we can cover V with stars of G j 2 centered in vertices of I j. By the triangle inequality these stars use edges of cost at most 2 cost(e j ). Each star center is adjacent to a vertex in S j, using an edge of cost at most cost(e j ). Move each of the centers to the adjacent vertex in S j and redefine the stars. Again, by the triangle inequality, the largest edge cost used in constructing the final stars is at most cost(e j ). 25

26 Tight Example (W = 3)  22 1+ε 1 2   11 1 G b a cd

27 Tight Example  22 1+ε 1 2   11 1 G 2 I n+3 ={b} b a cd S n+3 ={a}OPT={a, c}

28 Shortest superstring Given a finite alphabet Σ, and a set of n strings S = {s 1,…,s n }  Σ +. Find a shortest string s that contains each s i as a substring. Without lost of generality, we may assume that no string s i is a substring of another string s j, i  j.

Overlap, prefix We begin by developing a good lower bound on OPT. Let us assume that s 1, s 2,…, s n are numbered in order of leftmost occurrence in the shortest superstring, s. Let overlap(s i, s j ) denote the maximum overlap between s i and s j i.e., the longest suffix of s i that is a prefix of s j. Let prefix(s i, s j ) be the prefix of s i obtained removing its overlap with s j. 29

30 Prefix s s1s1 s n–1 s2s2 pref(s 1, s 2 ) snsn s1s1 pref(s n–1, s n )pref(s n, s 1 )over(s n, s 1 )

31 Define the prefix graph of S as the directed graph G pref on vertex set V={1,…,n} that contains an edge i → j of weight prefix(s i,s j ) for each i, j. | prefix(s 1,s 2 )| + | prefix(s 2,s 3 )| + …+ | prefix(s n,s 1 )| represents the weight of the tour 1  2  …  n  1. Hence the minimum weight of a travelling salesman tour of the prefix graph gives a lower bound on OPT. Unfortunately, this lower bound is not very useful. TSP is NP-hard.

32 Lower Bound We will use the minimum weight of a cycle cover of the prefix graph. A cycle cover is a collection of disjoint cycles covering all vertices. A Hamiltonian cycle is a cycle cover. We get that the minimum weight of a cycle cover lower- bounds OPT. Unlike minimum TSP, a minimum weight cycle cover can be computed in polynomial time.

33 Cycle → prefix If c = (i 1  i 2  …  i l  i 1 ) is a cycle in the prefix graph, let α(с) = prefix(s i 1,s i 2 ) ○…○ prefix(s i l-1,s i l ) ○ prefix(s i l,s i 1 ). Let w(с) be the weight of с, w(с) = |α(с)|. Notice that each string s i 1,s i 2,…, s i l is a substring of (α(с)) . Next, let σ(с) = α(с) ○ s i 1. Then σ(с) is a superstring of s i 1,s i 2,…, s i l. In the above construction, we “opened” cycle c at an arbitrary string s i 1. For the rest of the algorithm, we will call s i 1 the representative string for с.

34 Example abcdeabcdeabcde bcdeabcdeabcdea cdeabcdeabcdeabc deabcdeabcdeabcd abcdeabcdeabcde α(с) = abcde, |α(с)|=5, (α(с)) 2 = abcdeabcde, bcdeabcdeabcdea is a substring of (α(с)) 4. σ(с) = α(с)○s i 1 = abcdeabcdeabcdeabcde

35 Algorithm Superstring Input (S = {s 1,…,s n }) 1) Construct the prefix graph G pref corresponding to strings in S. С 2) Find a minimum weight cycle cover of G pref, С = {c 1,…,c k } Output (σ(c 1 ) ○…○ σ(c k )).

36 Remark Clearly, the output σ(c 1 ) ○…○ σ(c k ) is a superstring of the strings in S. Notice that if in each of the cycles we can find a representative string of length at most the weight of the cycle, then the string output is within 2OPT. Thus, the hard case is when all strings of some cycle c are long.

37 Example abcde|abcde|abcde bcde|abcde|abcde|a cde|abcde|abcde|abc de|abcde|abcde|abcd abcde|abcde|abcde α(с) = abcde, |α(с)|=5, (α(с)) 2 = abcdeabcde, bcdeabcdeabcdea is a substring of (α(с)) 4. σ(с) = α(с)○s i 1 = abcde|abcde|abcde|abcde

38 New lower bound Lemma 4.6 If each string in S′  S is a substring of t  for a string t, then there is a cycle of weight at most |t| in the prefix graph covering all the vertices corresponding to string in S′.

39 Proof of Lemma 4.6 For each string in S′, locate the starting point of its first occurrence in t . All these starting points will be distinct and will lie in the first copy of t. Consider the cycle in the prefix graph visiting the corresponding vertices in this order. Clearly, the weight of this cycle is at most |t|.

40 Lower bound on overlap Lemma 4.7 Let c and c′ be two cycles in C (cyclic cover of the minimal weight), and let r, r′ be representative strings from these cycles. Then |overlap(r, r′)| < w(c) + w(c′).

41 |overlap(r, r′)| ≥ w(c) + w(c′) r r'r' overlap(r, r′) αα α'α'α'α' α'α' α ○ α' = α' ○ α α is a prefix of length w(c) of overlap (r, r′). α′ is a prefix of length w(c′) of overlap (r, r′). Since |overlap(r, r′)| ≥ w(c) + w(c′), it is follows that α and α′ commute.

42 |overlap(r, r′)| ≥ w(c) + w(c′). r r'r' overlap(r, r′) αα α'α'α'α' α'α' α ○ α' = α' ○ α α is a prefix of length w(c) of overlap (r, r′). α′ is a prefix of length w(c′) of overlap (r, r′). (α) ∞ = (α') ∞ For any N > 0, the prefix of length N of (α) ∞ is the same as that of (α') ∞.

Proof of Lemma 4.7 Now, by Lemma 4.6, there is a cycle of weight at most w(c) in the prefix graph covering all strings in c and c, contradicting the fact that C is a minimum weight cycle cover. So, we have |overlap(r, r′)| < w(c) + w(c′). 43

44 Approximation ratio of Algorithm Superstring Theorem 4.8 Algorithm Superstring achieves an approximation factor of 4 for the shortest superstring problem.

45 Algorithm Superstring Input (S = {s 1,…,s n }) 1) Construct the prefix graph G pref corresponding to strings in S. С 2) Find a minimum weight cycle cover of G pref, С = {c 1,…,c k } Output (σ(c 1 ) ○…○ σ(c k )).

46 Proof r i is a representative string for с i.

Exercise 4.1 Show that the metric k-center problem cannot be approximated within factor < 2, unless P=NP. Hint: show that such an algorithm can solve the dominating set problem in polynomial time. Dominating set Given an undirected graph G=(V,E) and a number k ∈ N, is there a dominating set X ⊆ V(G) with |X| ≤ k. 47