Presentation is loading. Please wait.

Presentation is loading. Please wait.

Approximation Algorithms Chapter 5: k-center. Overview n Main issue: Parametric pruning –Technique for approximation algorithms n 2-approx. algorithm.

Similar presentations


Presentation on theme: "Approximation Algorithms Chapter 5: k-center. Overview n Main issue: Parametric pruning –Technique for approximation algorithms n 2-approx. algorithm."— Presentation transcript:

1 Approximation Algorithms Chapter 5: k-center

2 Overview n Main issue: Parametric pruning –Technique for approximation algorithms n 2-approx. algorithm for k-center n 3-approx. algorithm for weighted k-center n Proof of inapproximabilities of k-center –Under the assumption that P ≠ NP. No (2-  )-approx. algorithm for k-center No a (n)-approx. algorithm for k-center –Where the triangle inequality does not necessarily hold on weights of edges.

3 k-center n Task: –Choose k vertices that minimize the distances (costs) between any vertex and the chosen vertices.

4 k-center n Task: –Choose k vertices that minimize the distances (costs) between any vertex and the chosen vertices. –In the example below, k = 2.

5 Applications of k-center (1/2) n Find appropriate location of branch offices. –It could be cost-effective if the branch offices place as close as possible to any offices.

6 Applications of k-center (2/2) n Clustering by center points –In this application, the sum of the distances among vertices in a cluster is not considered. –In this clustering, the longest distance in each cluster should be minimized.

7 Definition of k-center (1/2) n Input: –Undirected complete graph with n vertices G=(V, E). The triangle inequality holds on costs of edges. –Positive integer k. # vertices selected as centers. 54 6 98 6 k =2 ab cd

8 Definition of k-center (2/2) Output: S ⊆ V that minimizes the cost of S (|S|=k). –The cost of S: the maximum value of costs of edges e=(v,s) between v ∈ V and s ∈ S. 54 6 98 6 k =2 54 6 98 6 ab cd 54 6 98 6 ab cd ab cd Cost: 5Cost: 6 : vertex chosen

9 Parametric pruning (1/3) n Technique to search for optimal solution. n [Basic idea] –Suppose the cost of the optimal solution is known. –This assumption makes an input simpler by removing irrelevant parts (edges). –However, how do we know the cost in advance? Cost: 5 Pruning 54 6 98 6 ab cd 54 ab cd

10 Parametric pruning (2/3) n Case of a minimization problem n I(t): pruned input of input I without its irrelevant parts –irrelevant parts are what will not be used in any solution of cost < t. Parametric pruning 1.Let T={t 1,…,t k }. 2.Find a lower bound of the optimal cost OPT from I(t). Let I(t*) be a pruned input for finding the lower bound. 3.Choose appropriate positive a, and find the solution of I(at*).

11 Parametric pruning (3/3) n Prune parts of an input based on cost. –In case of k-center, pruning is done on weights of edges. pruning 54 6 9 8 6 ab cd 4 ab cd 54 ab cd 54 6 ab cd 54 6 6 ab cd 54 6 8 6 ab cd 54 6 9 8 6 ab cd G1G1 G2G2 G3G3 G4G4 G5G5 G6G6 G

12 Overview n Main issue: Parametric pruning –Technique for approximation algorithms n 2-approx. algorithm for k-center n 3-approx. algorithm for weighted k-center n Proof of inapproximabilities of k-center –Under the assumption that P ≠ NP. No (2-  )-approx. algorithm for k-center No a (n)-approx. algorithm for k-center –Where the triangle inequality does not necessarily hold on weights of edges.

13 2-approximation algorithm 2-approx. algorithm for k-center Theorem 5.5 Lower bound of the optimal cost OPT Lemma 5.4 Parametric pruning based on the maximal independent set Algorithm 5.3 Square of a graph Relation between the dominating set and the maximal independent set Lemma 5.2 Equivalence between k-center and the dominating set The dominating setk-center

14 Dominating set n A set of chosen vertices s.t. any vertex is adjacent to a chosen vertex. a bc de a bc de a bc de a bc de a bc de Input

15 Equivalence between… n k-center –Any weight of edge between a vertex and some chosen vertex is not more than OPT. n Dominating set of G i –Any vertex is connected to some chosen vertex by a edge with weight less than OPT. 45 54 6 7 98 8 6 a bc de 4 54 a bc de cost (e i* ) = OPT.

16 2-approximation algorithm 2-approx. algorithm for k-center Theorem 5.5 Lower bound of the optimal cost OPT Lemma 5.4 Parametric pruning based on the maximal independent set Algorithm 5.3 Square of a graph Relation between the dominating set and the maximal independent set Lemma 5.2 Equivalence between k-center and the dominating set The dominating setk-center

17 Square of a graph n G 2 : Any pair of vertices are adjacent if the path length between the vertices in G is at most two. GG2G2 G’G’ 2 G’’ G’’ 2

18 Stars and cliques n Star: K 1,p n Stars: A set of stars that cover all the vertices. K 1,6 G Stars in G K 1,3 K 1,3 2 Clique

19 Independent set n Independent set S ⊆ V in H –Chosen vertices s, s’ ∈ S are not adjacent. G G’ G’’ Independent set G G’ G’’ Non-independent set

20 Algorithm 5.3 n Input: graph G, positive integer k. n 1. Construct G 1 2, …, G m 2. n 2. Compute a maximal independent set, M i, in each graph G i 2. n 3. Find the smallest index i s.t. |M i | ≦ k, say j. n 4. Return M j.

21 Overview of Algorithm 5.3 Find a maximal independent set in G i 2. There is at most one chosen vertex in a clique in G i 2. Construct G i 2 from G i. There is at most one chosen vertex in a star in G i. Any vertex is connected to a chosen vertex with a path of length 2

22 Algorithm 5.3 n Input: graph G, pos. int. k. n 1. Construct G 1 2, …, G m 2. n 2. Find a maximal indep- endent set M i for each G i 2. n 3. Find the smallest index j s.t. |M i | ≦ k. n 4. Return M j. G 5 46 7 8 9 777 5 4 68 9 5 4 6 8 5 4 6 5 4 6 5 44 k=2

23 Algorithm 5.3 n Input: graph G, pos. int. k. n 1. Construct G 1 2, …, G m 2. n 2. Find a maximal indep- endent set M i for each G i 2. n 3. Find the smallest index j s.t. |M j | ≦ k. n 4. Return M j. G 5 46 7 8 9 777 5 4 68 9 5 4 6 8 5 4 6 5 4 6 5 44 k=2

24 Lemma 5.2 (1/3) n |I| ≦ |D| holds in H. –I : independent set of H 2 (used in Algorithm 5.3), –D: a minimal dominating set of H (k-center). |I| ≦ # cliques in H 2 = # stars in H = |D|.

25 Lemma 5.2 (2/3) n |I| ≦ |D| holds in H, –where I is the independent set in H 2 and D is the minimum dominating set in H. |I| ≦ # cliques in H 2 = # stars in H = |D|. Only one vertex is available in a clique for an element of an independent set. H H2H2

26 Lemma 5.2 (3/3) n I| ≦ |D| holds in H, –where I is the independent set in H 2 and D is the minimum dominating set in H. Example of such case where |I| < # cliques in H. HH2H2 A clique in H 2 |I| ≦ # cliques in H 2 = # stars in H = |D|.

27 Lemma 5.4 (1/2) n Algorithm 5.3 finds j s.t. cost(e j ) ≦ OPT. k 12j-1j index i | M i | dom(G i ) i* 1 2

28 Lemma 5.4 (2/2) n Algorithm 5.3 finds j s.t. cost(e j ) ≦ OPT. k 12j index i | M i | dom(G i ) i* 1 2 j is not the minimum value s.t. | M i | ≦ k.

29 Theorem 5.5 (1/3) n Algorithm 5.3 is a 2-approximation algorithm for k-center. –A maximal independent set S is also a dominating set. To show this property, suppose that a set S is not a dominating set, but a maximal independent set. Maximal independent set S. Suppose a non- dominating vertex exists. This must be in the maximal independent set. This fact contradicts with “S is a maximal independent set.” Any of its adjacent vertices are not chosen. =

30 Theorem 5.5 (2/3) n The maximal dominating set M i Algorithm 5.3 finds is also a dominating set. –Dominating set = set of centers of stars in G i 2. Gi2Gi2 GiGi Some edges does not appear in G i. = Its weight is more than cost(e j ). The edge exists in G i 2. In G i, these two vertices are connected with a path length=2. =

31 Theorem 5.5 (3/3) n Algorithm 5.3 is a 2-approximation algorithm for k-center. –Weight of any edge in G i 2, but not in G i is at most 2cost (e i ). –The triangle inequalities are assumed on the weights. Edge in G i 2 but not in G i. a b 2 cost(e i ) ≦ 2 OPT. Less than cost(e i )

32 A tight example 2 2 2 1 1 1 k = 1 OPT = 1. 2 2 1 1 1 Gi2Gi2 GiGi Cost: 2 2

33 Overview n Main issue: Parametric pruning –Technique for approximation algorithms n 2-approx. algorithm for k-center n 3-approx. algorithm for weighted k-center n Proof of inapproximabilities of k-center –Under the assumption that P ≠ NP. No (2-  )-approx. algorithm for k-center No a (n)-approx. algorithm for k-center –Where the triangle inequality does not necessarily hold on weights of edges.

34 Idea of Theorem 5.7 Assumption: P ≠ NP. P NP NP-hard problem cannot be solved in polynomial time. Input of dominating set (NP-complete problem) (2-  ) approx. poly. algorithm for k-center Answer for its input Such algorithm does not exist. Inconsistent

35 NP-hardness of dominating set (1/3) n Poly. time reduction from Vertex Cover. –http://www.cs.umd.edu/~samir/451/red.ps –Vertex Cover is known as an NP-hard problem Input of vertex cover a bc de a bc de Input of dominating set abac bd cd ce de bc k=3

36 NP-hardness of dominating set n Solution of Vertex Cover → Solution of dominating set. Input of vertex cover a bc de bc de Input of dominating set bd cd ce de At least one of vertices for each edge must be chosen. Any vertex is adjacent to a chosen vertex. a abac bc

37 NP-hardness of dominating set n Solution of Vertex Cover ← Solution of dominating set Input of Vertex Cover a bc de bc de Input of dominating set bd cd ce de bc de Input of dominating set’ bd cd ce de a abac bc a abac bc

38 Theorem 5.7 n Poly. time reduction from dominating set to k- center. a bc de Dominating set a bc de k -center weight 1 weight 2 The triangle Inequality holds on weights of edges.

39 Theorem 5.7 n Reduction from dominating set to k-center. a bc de Dominating set a bc de k -center Cost of sol. = 1 [# vertices in a dominating set in G] ≦ k > k Cost of sol. = 2 For any input, cost of the solution is always less than (2- e )OPT. In this case, edges with weight 2 are unavailable. (2- e )-approx. algorithm exists.

40 Corollary n Suppose G does not satisfy the triangle inequality. No a (n)-approx. algorithm for k-center in G. a bc de Dominating set a bc de k -center Cost: 1 [# vertices in a dominating set in G] ≦ k > k Cost: a (n) + e For any input, the cost must be less than a (n)OPT. Edges with a (n) + e are unavailable.

41 Overview n Main issue: Parametric pruning –Technique for approximation algorithms n 2-approx. algorithm for k-center n 3-approx. algorithm for weighted k-center n Proof of inapproximabilities of k-center –Under the assumption that P ≠ NP. No (2-  )-approx. algorithm for k-center No a (n)-approx. algorithm for k-center –Where the triangle inequality does not necessarily hold on weights of edges.

42 Weighted k-center k =2 54 6 98 6 ab cd 54 6 98 6 ab cd 54 6 98 6 ab cd 54 6 98 6 ab cd 1020 10 54 6 98 6 ab cd 54 6 98 6 ab cd W = 30. k-centerWeighted k-center Weights on vertices

43 Weighted k-center n Weighted k-center is a generalization of k-center. k =2 54 6 98 6 ab cd 54 6 98 6 ab cd 54 6 98 6 ab cd 54 6 98 6 ab cd 11 1 1 54 6 98 6 ab cd W = 2. 54 6 98 6 ab cd k-centerWeighted k-center

44 Lemma 5.2 in weighted k-center n k-center –# vertices in an independent set in H 2 ≦ # vertices in a minimal dominating set of H n Weighted k-center –Sum of weights of vertices in an independent set in H 2 ≦ Sum of weights of vertices in a minimal dominating set of H ? HH2H2 10101010 203030 1010 3030 1010 Counter example

45 Adjacent vertices with min. weight n s(u): vertex adjacent to u in H with the minimum weight. –u can be s(u). –Not in H 2. ab cd 1520 1025 s(a)=a, s(b)=a, s(c)=c, s(d)=c. H ab cd 1520 1025 H2H2

46 Lemma 5.9 (1/2) w(S) ≦ w(D) = wdom(H). –Consider stars whose centers are in a minimal weight dominating set. H

47 Lemma 5.9 (2/2) w(S) ≦ w(D) = wdom(H). –S ={s(u)|u I} (a set of vertices that is adjacent to a vertex in I). –D: A minimum weight dominating set of H. –wdom(H): weight of a minimum weight dominating set of H. At most one vertex can be chosen from a clique as an element of an independent set. H H2H2 Choose a vertex with less weight. Weight of the vertex in S is less than weight in D. Vertex in a minimal weight dominating set D.

48 Algorithm 5.10 n Input: graph G, positive integer k. n 1. Construct G 1 2, …, G m 2. n 2. Compute a maximal independent set, M i, in each graph G i 2. 3. S i ={s i (u): u ∈ M i } 4. Find the minimum index j s.t. w(S i ) ≦ W. n 5. Return S j.

49 Algorithm 5.10 n Input: graph G, pos. int. k. n 1. Construct G 1 2, …, G m 2. n 2. Compute a max. indep- endent set, M i, in each G i 2. 3. Find the min. index j s.t. |M j | ≦ k. n 4. Return M j. G 5 46 7 8 9 5 4 6 7 8 9 5 4 6 7 8 5 4 6 7 5 4 6 5 44 10 2030

50 Algorithm 5.10 n Input: graph G, pos. int. k. n 1. Construct G 1 2, …, G m 2. n 2. Compute a max. indep- endent set, M i, in each G i 2. 3. Find the min. index j s.t. |M j | ≦ k. n 4. Return M j. G 5 46 7 8 9 5 4 6 7 8 9 5 4 6 7 8 5 4 6 7 5 4 6 5 44 10 2030 W=30W=40W=20 W=10 W=30

51 Lower bound for OPT cost(e j ) ≦ OPT where j was obtained by Algorithm 5.10. W 12j-1j index i w(Si)w(Si) wdom(G i ) i*

52 Theorem 5.11 n Like Theorem 5.5, the cost (length of path) between any vertex and the closest vertex in a weighted min. independent set is at most 2cost(e j ). n The cost between any vertex and the closest vertex in s(u) is at most 3cost(e j ). Moving to a vertex with less weight. Weight is at most 2cost(e j ) in G. Weight is at most 3cost(e j ) in G.

53 Example 5.12 ( A tight example ) 1 1+ e 11 1222 ∞ 22 3 2+ e 3+ e 4+ e G3G3 111 1222 ∞ Sum of weights of vertices: ∞ G4G4 111 Cost: 3 1+ e W=3 G42G42 111 1+ e Sum of weights of vertices: 1 A maximal independent set A maximal ind. set Moving to a vertex with less weight Minimum cost: 1+ 

54 Conclusion n Parametric pruning was introduced. –Technique for approximation algorithms –2-approx. algorithm for k-center –3-approx. algorithm for weighted k-center –Proof of inapproximabilities of k-center Under the assumption that P ≠ NP.


Download ppt "Approximation Algorithms Chapter 5: k-center. Overview n Main issue: Parametric pruning –Technique for approximation algorithms n 2-approx. algorithm."

Similar presentations


Ads by Google