Local search yields approximation schemes for k-means and k-median in Euclidean and minor-free metrics
Vincent Cohen-Addad, Philip N. Klein, Claire Mathieu
Introduction
In this paper, we address three fundamental problems, facility location, -median and -means clustering, in two settings, graphs and Euclidean spaces. The problem of approximating -means clustering in low-dimensional Euclidean space has been studied since at least 1994 ; since then, many researchers have given approximation schemes that are polynomial for fixed but exponential in . Very recently, building on , a bicriteria polynomial-time approximation scheme has been given for -means: it finds centers whose cost is at most times the cost of an optimal -means solution. As the authors of that paper point out, it remained an open question whether there is a true polynomial-time approximation scheme for -means in the plane (where is considered part of the input); the best polynomial-time approximation bound known was . In this paper, we resolve this open question by giving the first polynomial-time approximation scheme for arbitrary (i.e. nonconstant) in low-dimensional Euclidean space.
Our analysis of the -means approximation scheme shows that it can also be applied to graphs belonging to a fixed nontrivial minor-closed family.Contracting an edge of a graph means identifying its endpoints and then removing it. A graph is a minor of graph if can be obtained from by edge deletions and edge contractions. The family of planar graphs, for example, is closed under taking minors, as is the family of graphs embeddable on a surface of genus , for any fixed integer . We say a minor-closed family is nontrivial if it omits at least one graph.
For example, for any fixed integer , graphs embeddable on a surface of genus form such a family. In particular, planar graphs forms such a family. Thus we also obtain the first polynomial-time approximation scheme for -means in planar graphs.
The problems of (uncapacitated) metric facility location and -median in graphs has similarly been studied for many years. The first polynomial-time approximation algorithm, with a logarithmic performance guarantee, was given by Hochbaum in 1982 . The first polynomial-time approximation algorithm to achieve a constant approximation ratio was given by Shmoys et al. in 1997. It was later improved by Jain and Vazirani and by Arya et al. . The current best approximation algorithm for metric (uncapacitated) facility location, due to Li, has approximation ratio 1.488 . Guha and Khuller proved that there exists no polynomial-time approximation algorithm with approximation ratio of 1.463 for metric facility location problem unless . The current best approximation ratio for the -median problem is by Li and Svensson .
In order to obtain a substantially better approximation ratio, therefore, one must restrict attention to special metrics. Because facility location problems often arise on the surface of the earth, it is natural to consider the metrics induced by planar graphs. Researchers have been trying to find a polynomial-time approximation scheme for the planar restriction for many years. An unpublished manuscript by Ageev dating back at least to 2001 addressed the planar case via a straightforward application of Baker’s method , giving an algorithm whose performance on an instance depends on how much of the cost of the optimal solution is facility-opening cost. Despite the title of the manuscript, the algorithm is not an approximation scheme for instances with arbitrary weights. Since then there have been no results on the problem despite efforts by several researchers in the area.
In this paper, we give the first polynomial-time approximation scheme for (uncapacitated uniform) facility location and -median where the metric is that induced by a planar graph or, more generally a graph belonging to a fixed nontrivial minor-closed family.
We describe a simple and natural, and previously studied local-search algorithm for clustering problems, parameterized by the desired cluster size , the objective function , and a parameter governing the local-search neighborhood.
For any fixed integers , there is a constant such that, for any , applying Algorithm 1 to the -dimensional Euclidean space with cost function
and yields a solution whose cost is at most times the minimum.
When , the objective function is the -means objective function. When , the objective function is that of -median.
For any integer , there is a polynomial-time approximation scheme for the -means problem in -dimensional Euclidean spaces.
Algorithm 1 can also be applied to the metric completion of a graph.
Let be a nontrivial minor-closed family of edge-weighted graphs. For any fixed integer , there is a constant with the following property. For any , for any , Algorithm 1 applied to the metric completion of with cost function
and with yields a solution whose cost is at most times the minimum.
It is straightforward to implement Algorithm 1 applied to the metric completion of a graph. As before, the number of iterations is where is the number of clients. We therefore obtain:
There is a polynomial-time approximation scheme for -means and for -median in planar graphs and in bounded-genus graphs.
More generally, for any nontrivial minor-closed family of edge-weighted graphs, there is a polynomial-time approximation schemes for -means and for -median for graphs in that family.
The local-search algorithm is easily adapted to the case where we do not specify the number of clusters but instead specify a per-cluster cost. This case includes a variant of the facility location problem.
The Uncapacitated Uniform Facility Location problem is as follows: given a finite metric space, a subset of points, and a facility opening cost , find a subset of points that minimizes .
To address this problem, we use a simple modification of the local-search algorithm given earlier.
Fix a nontrivial minor-closed family of graphs. There is a constant such that, when Algorithm 2 is applied to the metric completion of a graph in with
and , the output has cost at most times the minimum.
In fact, for , setting suffices to achieve a approximation. The theorem implies the following:
Fix a nontrivial minor-closed family of edge-weighted graphs. There is a polynomial-time approximation scheme for uniform uncapacitated facility location in graphs of .
2 Related work
In arbitrary metric spaces, it is NP-hard to approximate the -median and -means problems within a factor of and respectively, see Guha and Khuller and Jain et al. . In the case of Euclidean space, Guruswami and Indyk showed that there is no PTAS for -median if both and are part of the input. More recently, Awasthi et al. showed APX-Hardness for -means if both and are part of the input.
In Euclidean spaces, -approximation algorithms for -median have been proposed when or is fixed. For example, when is fixed, there exists different PTAS (See and for the best known so far). When is fixed, Arora et al. gave the first PTAS for the -median problem. This result was subsequently improved to an efficient PTAS by Kolliopoulos et al. and Har-Peled et al. .
For the -means problem, Kanungo et al. showed that local search achieves a -approximation in general metrics and this remains the best known approximation guarantee so far even for fixed . There are also a variety of results for -means and -median when the input has some stability conditions (see for example ) or in the context of smoothed analysis (see for example ).
Local Search for metric -median was first analyzed by Korupolu et al . They gave a bicriteria approximation using centers an achieving a cost of at most times the cost of the optimum -clustering. This was later improved to centers an achieving a cost of at most times the cost of the optimum -clustering by Charikar an Guha . Arya et al. gave the first analysis showing that Local Search with a neighborhood of size gives a approximation to -median. Moreover, they show that this bound is tight. As mentioned earlier, Kanungo et al. showed that local search is a -approximation for -means in general metrics. Local search is a very popular algorithm for clustering and has been widely used : see in the context of parallel algorithms, in the streaming model and for distributed computing. See for a general introduction to theory and practice of local search.
After we had written up our results and while we were editing the submission, we noticed a recent ArXiv paper that has similar results for doubling metrics.
Techniques
One key ingredient in our analyses is the existence of a certain kind of decomposition of the input called a weak -division. The concept (in a stronger form) is due to Frederickson in the context of planar graphs. It is straightforward to extend it to any family of graphs with balanced separators of size sublinear-polynomial. We also define a weak -division for points in a Euclidean space, and show that such a decomposition always exists. These definitions and results are in Sections 3.1 and 3.2. Note that -divisions play no role in our algorithm; only the analysis uses them.
Chan and Har-Peled showed that local search can be used to obtain a PTAS for (unweighted) maximum independent pseudo-disks in the plane, which implies the analogous result for planar graphs. More generally, Har-Peled and Quanrud show that local search can be used to obtain PTASs for several problems including independent set, set cover, and dominating set, in graphs with polynomial expansion. These graphs have small separators and therefore -divisions. However, our analysis of local search for clustering requires not only that the input graph have an -division but that a minor of the input graph have an -division. This is not true of graphs of polynomial expansion. Indeed, we show in Section 2.3 that there are low-density graphs in low-dimensional space (which are therefore polynomial-expansion graphs) for which our local-search algorithm produces a solution that is worse than the optimum by at least a constant factor.
Thus one of our technical contributions is showing how to take advantage of a property possessed by nontrivial minor-closed graph families that is not possessed by polynomial-expansion graph families.
2 Isolation
In order to obtain our approximation schemes for -means and -median clustering, we need another technique. As mentioned earlier, a bicriteria approximation scheme for -means was already known; the solution it returns has more than centers. It seems hard to avoid an increase in the number of centers in comparing a locally optimal solution to a globally optimal solution. It would help if we could show that the globally optimal solution could be modified so as to reduce the number of centers below while only slightly increasing the cost; we could then compare the local solution to this modified global solution, and the increase in the number of centers would leave the number no more than .
We now give the formal definition of 1-1 isolated.
Let be a positive constant and and be two solutions for the -clustering problem with exponent . Let denote the number of facilities of that are not in a 1-1 isolated region. There exists a set of facilities of of size at least that can be removed from at low cost: .
Note that the following theorem does not assume that is a local optimum and is an optimal solution. Thus we believe that this theorem can be of broader interest. We now define the concept of isolated regions; 1-1-isolated regions correspond to the special case of isolated regions when consists of a single facility.
Given a facility and a set of facilities , we say that the pair is an isolated region if
For each facility , most of the clients served by in are served by in : in other words, , and
Most of the clients served by in are served by facilities of in : in other words, ;
Finally, if is an isolated region, we say that and the elements of are isolated.
3 Tightness of the results
For any , there exists an infinite family of graphs excluding as a -shallow minor such that for any constant , local search with neighborhoods of size might return a solution of cost at least .
See Figure 1 and for a complete proof that local search performs badly on the instance depicted in the figure.
For any , there exists an infinite family of graphs that are low-density graphs such that for any constant , local search with neighborhoods of size might return a solution of cost at least .
The proposition follows from encoding the graph of Figure 1 as an low-density graph.
We additionally remark that Awasthi et al. show that the -means problem is APX-Hard for any non-constant dimension . Moreover, Kanungo et al. give an example where local search returns a solution of cost at least .
Preliminaries
We will use the following technical lemma in order to give a general proof that encompasses both the cases of -median and -means. Throughout the paper we assume constant and define to be a positive constant.
Let and . For any , we have
Moreover, by the binomial theorem, ∎
For a graph , we use and to denote the set of vertices of and the set of edges of , respectively. For a subgraph of , the vertex boundary of in , denoted , is the set of vertices such that is in but has an incident edge that is not in . (We might write if is unambiguous.) A vertex in the vertex boundary of is called a boundary vertex of . A vertex of that is not a boundary vertex of is called an internal vertex. We denote the set of internal vertices of as .
Let and be constants (depending on ). For a number , a weak -division of a graph (with respect to ) is a collection of subgraphs of , called regions, with the following properties.
Each edge of is in exactly one region.
The number of regions is at most .
Each region contains at most vertices.
The number of boundary vertices, summed over all regions, is at most .
A family of graphs is said to be closed under taking minor (minor-closed) if for any graph , for any minor of , we have .
Let be a nontrivial minor-closed family of graphs. There exist such that every graph in has a weak -division with respect to .
Alon, Seymour, and Thomas proved a separator theorem for the family of graphs excluding a fixed graph as a minor. Any nontrivial minor-closed family excludes some graph as a minor (else it is trivial). Frederickson gave a construction for a stronger kind of -division of a planar graph. The construction uses nothing of planar graphs except that they have such separators. ∎
Let be an undirected graph with edge-lengths. Fix an arbitrary priority ordering of the vertex set . For every subset of , we define the Voronoi partition with respect to . For each vertex , the Voronoi cell with center , denoted , is the set of vertices that are closer to than to any other vertex in , breaking ties in favor of the highest-priority vertex of .
For any , for any vertex , the induced subgraph is a connected subgraph of .
Let , and let denote a -to- shortest path. Let be a vertex on . Assume for a contradiction that, for some vertex , either the -to- shortest path is shorter than the shortest -to- path, or it is no longer and has higher priority than . Replacing the -to- subpath of with yields a -to- path that either is shorter than or is no longer than and originates at a higher-priority vertex than . ∎
It follows that, for any vertex of , contracting the edges of the subgraph yields a single vertex.
We define as the graph obtained from by contracting every edge of for every vertex . For each vertex , we denote by the vertex of resulting from contracting every edge of .
If belongs to a minor-closed family then so does .
2 Euclidean space r𝑟r-division
The number of regions is at most .
Each region contains at most points of .
.
Moreover, for any region , is a Voronoi separator for and .
The following theorem is from [17, Theorem 3.7].
There are most points of in the sphere and at most points of not in , and
is a Voronoi separator of the points of inside from the points of outside .
Here and are constants that depends only on the dimension .
From that theorem we can easily derive the following (see Section 8.1 for the proof):
3 Properties of the r𝑟r-Divisions
We present the properties of the -divisions that we will be using for the analysis of the solution output by the local search algorithm.
Let be a graph excluding a fixed minor and . Let be a region of the -division of . Suppose and are vertices of such that one of the vertices in is a vertex of and the other is not an internal vertex of . Then there exists a vertex such that is a boundary vertex of the region and .
Let be a shortest -to- path in . By the conditions on and , there is some vertex of such that is a boundary vertex of . Let be the center of the Voronoi cell whose contraction yields . By definition of Voronoi cell, . Therefore replacing the -to- subpath of with the shortest -to- path yields a path no longer than . ∎
We obtain the analogous lemma for the Euclidean case, whose proof follows directly from the definition of -division (i.e.: the fact that is a Voronoi separator).
Facility Location in minor-closed graphs: Proof of Theorem 1.3
As a warm-up, we analyze Local Search for Uniform Facility Location (Algorithm 2) applied to the metric completion of an edge-weighted graph belonging to a nontrivial minor-closed family . The proof of the -median and -means results (for both Euclidean and minor-closed metrics), involve the use of Theorem 2.2 and a more complex analysis.
Throughout this section we consider a solution output by Algorithm 2 (the “local” solution) and a globally optimal solution of value OPT. Let . Let . Consider the graph defined in Definition 3.4, and recall that each vertex of maps to a vertex in the contracted graph .
Since belongs to and is obtained from by contraction, it too belongs to and hence it has an -division. Let be the regions of this -division. For , define and as follows:
That is, is the set of vertices in the union of the local solution and the global solution that map via contraction to vertices of the region , and is the set of vertices in the union that map to boundary vertices of .
Let .
Fix a region of the -division of . We define and . We consider the mixed solution defined as follows:
.
To obtain from , one can remove the vertices in that are not in , and add the vertices in that are not in . Thus the size of the symmetric difference is at most . Since the vertices of are centers of Voronoi cells, these vertices all map to different vertices in the contracted graph . Therefore is at most the number of vertices in region , which is at most . ∎
Let be a vertex of and a region. Then:
First suppose is an internal vertex of , and let be the facility in closest to . If is in then it is in , so . Suppose is not in . Then by Lemma 3.8 there is a vertex such that is a boundary vertex of and . As before, is in so . Since , this proves the claimed upper bound.
Let be a vertex of . For , if is an internal vertex of the region then contributes only one towards the left-hand side. If is a boundary vertex of then . Therefore
To finish the proof, we bound the sum in the right-hand side. Each vertex in is the center of one Voronoi cell, so has vertices. For each region , there is one vertex in that corresponds to each boundary vertex of , so is the sum over all regions of the number of boundary vertices of that region, which, by Property 4 of -divisions, is at most , which, by choice of , is at most , which in turn is at most .
(Proof of Theorem 1.3) Lemma 4.1 and the stopping condition of Algorithm 2 imply the following:
Using Lemma 4.2 and summing over shows that
Combining Inequalities (1), (2) and (3), we obtain
We next sum this inequality over all regions of the weak -division and use Lemma 4.3.
Since , we obtain
This completes the proof of Theorem 1.3. ∎
Clusters in minor-closed graphs: Proof of Theorem 1.2
We prove Theorem 1.2. The proof is similar for graphs and for points lying in . It builds on the notions of isolation and 1-1 isolation introduced in Section 2.2.
We consider a solution output by Algorithm 1 and an optimal solution . Let be the set of facilities of and that are not in a 1-1 isolated region and let .
Let . Let be an -division of where . Define \mathcal{G}^{*}=\mathcal{G}_{1}\cup\{\text{boundary vertices of ther-division}\}.
The vertex sets of regions are of course not disjoint—a boundary vertex is in multiple regions—but it is convenient to represent them by disjoint sets. We therefore define a ground set , and, for each region , we define . Now form a partition of . To allow us to go from an element of back to a vertex, if we define . Finally, define .
Let be the set of facilities of and that are not in 1-1 isolated regions.
, where is the constant in the definition of -division.
Consider the -division. Each 1-1 isolated region results in a connected component of size 2 in and so no boundary vertices arise from such connected components. By the definition of -division, the sum over regions of boundary vertices is at most , where is the total number of elements of and that are not in 1-1 isolated regions. Since , we have that . ∎
By Theorem 2.2, we have that . By Lemma 5.1 we thus have
Let and be partitions of some ground set. Suppose and, for , .
There exists a partition that is a coarsening of satisfying the two following properties. For any part of the coarser partition,
Small Cardinality: is the union of parts of .
We now apply Lemma 5.3 to the partition with and . We refer to the parts of the resulting coarse partition as super-regions. Each super-region naturally corresponds to a subgraph of , the subgraph induced by , and we sometimes use to refer to this subgraph.
and .
Each region of the -division contains at most facilities where is the constant in the definition of -divisions. By Lemma 5.3, each super-region is the union of regions ∎
We now define to be the cost of client in solution and to be the cost of client in solution . For any client for some isolated region , define as the cost of assigning to the facility of that is the closest to . We let be a positive constant that will be chosen later.
Consider an isolated region .
Substituting, we have that is at most
Similarly, for any client for some isolated region , define as the cost of assigning to .
Consider an isolated region .
For a client and a super-region , we define to be the cost of in the mixed solution . Moreover, for each client , we consider the facilities and that serve this client in solution and respectively. We define to be an arbitrary pair and to be an arbitrary pair . We slightly abuse notation and say that is isolated if belongs to one of the isolated regions.
Let be a good client and a super-region. The value of is less than or equal to:
Observe that if , then and the first case holds. Now, for any super-region , contains the facility serving client in local. Thus its cost is at most and the second case holds. Finally, assume that contains and does not contain . If belongs to , then by the separation property of the -division (see Lemmas 3.8, 3.9), and . Otherwise, , and so, by the separation property there must be a boundary vertex of that is closer to than the facility that serves it in . Therefore, we have and the second case holds. ∎
Let be a bad client and a super-region. The value of is less than or equal to:
By Lemma 5.4, for any super-region the solution is in the local neighborhood of . By local optimality, we have
Observe that the number of regions is at most . Thus, summing over all regions we have
Inverting summations and applying Corollary 4, we obtain
By definition of and since each client in is bad, applying Lemma 5.6 yields
Hence, for small enough with respect to and , we have
Now, by definition of and since each client in is bad, applying Lemma 5.5 gives
since is a partition of the clients. Therefore, assuming is small enough with respect to and , there exists a constant such that
Now, observe that since . By Theorem 2.2, . Combining concludes the proof of Theorem 1.2 ∎
Clusters in Euclidean space : Proof of Theorem 1.1
The point sets of regions are not disjoint since points of appear in various regions. Thus, we again define a ground set , and, for each region , we define . Now form a partition of . To allow us to go from an element of back to a point, if we define . Finally, define .
We now branch with the rest of the proof of Theorem 1.2, starting from Lemma 5.1.
Reducing the number of clusters : Proof of Theorem 2.2
Let be a positive constant and and be two solutions for the -clustering problem with exponent . Let denote the number of facilities of that are not in a 1-1 isolated region. There exists a set of facilities of of size at least that can be removed from at low cost: .
Since the arcs of are dichromatic, if then . Consider the solution . Client that belong to for some can be assigned in to a facility that is no farther than . Therefore, the cost of the solution is at most .
We now define to be the cost of client in solution and to be the cost of client in solution .
Putting together we obtain that the total cost increase induced by the reassignment is at most
Postponed proofs
We describe a recursive procedure to construct the set in the definition of weak -division of . Assuming that , find a sphere and a set satisfying Theorem 3.6. Let be the result of applying the procedure to the union of with the set of points inside , and similarly obtain from the set of points outside . Return .
It is clear that the set together with its induced partition of returned by the procedure satisfies all the properties of a weak -division except for Property 4, which requires some calculation. Let when the procedure is applied to a set of size at most , where . If then , and if then
We show by induction that for suitable constants to be determined. We postpone the basis of the induction until are selected.
The function is strictly concave for , as can be seen by taking its second derivative. For any , there exists a number such that . By concavity, therefore, . Since a weighted average is at least the minimum, . Write . Since is strictly concave, . We choose , for then the first term in Inequality 7 is bounded by , and we obtain .
For the basis of the induction, suppose . Then
which is nonnegative for an appropriate choice of depending on and . ∎