K-Center Problem - Advanced Algorithms - Lecture Notes, Study notes of Advanced Algorithms

Main points of this lecture are: K-Center Problem, Triangle Inequality, Emergency Centers, Undirected Graph, Subset of Nodes, Approximation Algorithm, Dominating Set, Set of Vertices, Distance Constrained Solutions, Square of Graph, Path of Length

Typology: Study notes

2012/2013

Uploaded on 04/23/2013

atasi
atasi 🇮🇳

4.6

(32)

134 documents

1 / 8

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Lecture 5: k-center Problem
1 Introduction
Imagine we have a complete, undirected
graph, where each node is a city, and edges
represent the shortest distance between these
cities. We have funds to build exactly k
emergency centers. The k-center problem
with triangle inequality is to place our k
emergency centers (e.g. marked by Xs in
the figure to the right) such that no one has
to go too far to get to their closest center.
k-center Problem:
Input: Given G= (V, E), a complete
undirected graph whose edges are shortest
paths between each pair of nodes. Let Dij denote the path distance between
nodes iand j. (Remember, if we start with an incomplete graph, we can
make it complete by adding edges where Dij is the length of the shortest
existing path between iand j.)
Output: A subset of nodes SVwith |S|=k, such that the longest
distance of a node to its closest node in Sis minimized. Specifically, we want
to minimize cost(S) = maxjVminiSDij .
Our Approximation Algorithm:
We assume that Gsatisfies the triangle inequality (i.e. Dij +Djk
Dik,i, j, k V). So first, we reorder the edges e1,e2..., em, in order of cost,
such that cost(e1)cost(e2)... cost(em). Then, we add the lightest
edge e1and look at that graph, then add the edges e1, e2, and look at that
1
pf3
pf4
pf5
pf8

Partial preview of the text

Download K-Center Problem - Advanced Algorithms - Lecture Notes and more Study notes Advanced Algorithms in PDF only on Docsity!

Lecture 5: k-center Problem

1 Introduction

Imagine we have a complete, undirected graph, where each node is a city, and edges represent the shortest distance between these cities. We have funds to build exactly k emergency centers. The k-center problem with triangle inequality is to place our k emergency centers (e.g. marked by Xs in the figure to the right) such that no one has to go too far to get to their closest center.

k-center Problem:

Input: Given G = (V, E), a complete undirected graph whose edges are shortest paths between each pair of nodes. Let Dij denote the path distance between nodes i and j. (Remember, if we start with an incomplete graph, we can make it complete by adding edges where Dij is the length of the shortest existing path between i and j.)

Output: A subset of nodes S ⊆ V with |S| = k, such that the longest distance of a node to its closest node in S is minimized. Specifically, we want to minimize cost(S) = maxj∈V mini∈S Dij.

Our Approximation Algorithm:

We assume that G satisfies the triangle inequality (i.e. Dij + Djk ≥ Dik, ∀i, j, k ∈ V ). So first, we reorder the edges e 1 , e 2 ..., em, in order of cost, such that cost(e 1 ) ≤ cost(e 2 ) ≤ ... ≤ cost(em). Then, we add the lightest edge e 1 and look at that graph, then add the edges e 1 , e 2 , and look at that

Figure 1: G 3 = (V, E 3 ) where E 3 = e 1 , e 2 , e 3

graph, then add edges e 1 , e 2 , e 3 ... Let Gi = (V, Ei), where Ei = {e 1 , e 2 , ..., ei}. Note that our original graph G is now Gm.

Definition 1.0.1 A dominating set of G is a subset S ⊆ V such that every node in V − S is adjacent to a vertex in S. (That is, for each node, either you’re in, or you have a neighbor who is in the dominating set.)

Claim 1.0.2 The optimal solution to a k-center problem is a dominating set in G. (Note that this is a trick question because G is complete. Any one vertex or set of vertices in a complete graph is a dominating set!)

Claim 1.0.3 The optimal solution to a k-center problem in G is a dominat- ing set in Gi for some i ≥ i 0.

This claim is trivially true (when i = m). Look at graphs G 1 , G 2 , G 3 ,..., Gm− 2 , Gm− 1 , Gm. As we move backward from Gm, at which point do we no longer have a dominating set?

Let C∗^ be the cost of an optimal solution to k-center in G. Let ec be the LAST edge of cost c∗. Remember, this edge is not unique! Multiple edges could have the same cost, so ec is the LAST edge, such that for all ec+1...ei, cost(ec+1...) > cost(gc).

Figure 3: Given G = (V, E), E is represented by solid edges, and E^2 is represented by solid and dashed edges.

Notes:

  • We can compute the square of a graph by multiplying the adjacency matrices.
  • The cube of graph G, denoted G^3 , adds edges between i and j if there exists a path of length 1, 2, or 3 between i and j. This can be extended to create G^4 , G^5 , ...
  • This makes no difference for G (which is complete), but we are also going to be looking at Gc, for different c’s, which are certainly not complete graphs.

Definition 1.0.7 An independent set in a graph G = (V, E) is a set S ⊆ V , such that ∀i ∈ S, if (i, j) ∈ E, then j 6 ∈ S.

Definition 1.0.8 A maximal independent set (MIS) in a graph G = (V, E) is an independent set such that ∀v ∈ V , either v ∈ S, or ∃u such that (u, v) ∈ E, and u ∈ S.

Finding a maximum independent set of a graph is NP-hard, but finding a maximal independent set of a graph can be solved in polynomial time using a simple greedy algorithm.

Lemma 1: Let H = (V, E). Let I be an independent set in H^2. Then |I| ≤ |dom(H)|, where dom(H) denotes the size of a minimum cardinality dominating set in H. Note: dom(H) is NP-hard to compute, but any inde- pendent set is smaller than this.

Proof: Let D be a minimum cardinality dominating set in H. For each vertex d ∈ D, its neighborhood forms a clique in H^2. So H^2 contains |D| cliques spanning all the vertices, which implies any independent set in H^2 can pick at most 1 vertex per clique. So |I| ≤ |D|.

If we start with a vertex and its neighbors and square it, we have a clique! Therefore, we can only take 1 vertex from each of these cliques / neighborhoods.

2 2-Approximation Algorithm for k-center

Algorithm A:

  1. Construct G^21 , G^22 ,... ,G^2 m.
  2. Compute a maximal independent set (MIS) Li in each graph G^2 i.
  3. Find the smallest index i, such that |Li| ≤ k, and call that MIS Lj
  4. Return Lj

Lemma 2: For j as defined in the algorithm above, the cost(ej ) ≤ C∗. Note that cost(ej ) is the most expensive edge in Lj.

Proof: For every i < j, we have |Li| > k since dom(Gi) ≥ |Li| by Lemma

  1. (That is, if we go through and look at G^21 , G^22 , G^23 , ... , G^2 m, we run out of our k centers before we reach G^2 m. That implies dom(Gi) > k. So the first index for which the k-center problem forms a dominating set > i, so C∗^ > cost(ei).)

Theorem 2.0.9 Algorithm A returns a solution of cost at most 2 ∗ OP T.

Proof: Observe that a maximal independent set in H^2 is also a dominating set in H^2 (any maximal independent set is a dominating set, but not vice

Thus, the the approximation algorithm will output a solution of cost 1 if there is a dominating set in G and output a solution of cost 2 otherwise. So we can use the approximation algorithm to decide whether there is a dominating set in G. Therefore, the approximation algorithm is also NP-hard.

4 Weighted k-center Problem

Idea: We can build as many emergency centers as we like, so long as we don’t exceed our budget of k. It may cost a different amount to build an emergency center at one location versus another.

This is actually the same problem as before, but we are given a weight func- tion on the vertices, w : v → R+, and a bound w ∈ R+. Our goal is to pick S ⊆ V such that w(S) ≤ W , where w is the weight function and W is the specified maximum total weight. Specifically, we want to minimize cost(S) = maxv∈V mins∈S cost(evs). Note that this reduces to the ordinary k-center problem when all vertex weights are 1 and W = k.

Let wdom(G) denote the weight of the min-weight dominating set in G, then with respect to the graph Gi (containing the i lightest edges), we need to find the smallest index i such that wdom(Gi) ≤ W. Notice that if i∗^ is the index, then the cost of the optimal solution is OP T (cost(ei∗^ ))

Given a vertex weighted graph H, let I be an independent set in H^2. For each u ∈ I, let S(u) denote the lightest (i.e. least expensive by weight) neighbor of u in H. We will allow u to be its own neighbor. Let S = {s(u)|u ∈ I}.

Lemma 3: w(S) ≤ wdom(H)

Proof Let D be a min-weight dominating set of H, I claim that I can con- struct a matching between vertices in I and vertices in D who are neighbors that saturates I, because

  1. Every 2 vertices in I cannot have a common neighbor in D 2) Each vertex in I has a neighbor in D because D is dominating.

Remains to show: each vertex in S weighs less than its corresponding

vertex to I’s matched vertex in D. That’s because we picked the neighbor or I of min-weight (weight at most its neighbor in D).

5 3-Approximation Algorithm for Weighted

k-center:

Algorithm B:

  1. Construct G^21 , G^22 , G^23 , ..., G^2 m.
  2. Compute a MIS Li in each graph G^2 i.
  3. Compute Si = {si(u)|u ∈ Li}.
  4. Find minimum index i such that w(Si) ≤ W , say j.
  5. Return Sj.

Theorem 5.0.11 Algorithm B is 3 ∗ OP T for weighted k-center.

Proof Let Si be the solution from the algorithm. Let OP T be the cost of the optimal solution. It holds that w(Si) > W ∀i < j. Therefore, by this and Lemma 3, wdom(Gi) > W ∀i < j. Hence the optimal cost of weighted k-center is at least the cost of the most expensive edge in Gj (i.e. the most expensive edge(s) were 3 hops away). So we know that cost(e) ≤ OP T for every edge in Gj.

Now, notice that Lj is a dominating set in G^2 i. So every vertex in G is on a path of length at most 1 from some vertex in Lj in G^2 i. (Notice that we might have taken a neighbor that was lighter!) Therefore, every vertex is on a path of length at least 3 from the neighbors of the vertices in Lj that we chose in our set.

Since every edge in Gj has weight at most OP T , the triangle inequality guarantees that the edges connecting any vertex in G to some vertex in Sj weigh no more than 3 ∗ OP T.