The Hardness of Approximation of Euclidean k-means
Pranjal Awasthi, Moses Charikar, Ravishankar Krishnaswamy, Ali Kemal Sinop
Introduction
While the -means heuristic is very much tied to the -means objective function, there are many examples where it converges to a solution which is far away from the optimal -means solution. This raises the important question of whether there exist provable algorithms for the -means problem in general Euclidean space, which is the focus problem of our paper. Unfortunately though, the approximability of the problem is not very well understood. From the algorithmic side, there has been much focus on getting -approximations that run as efficiently as possible. Indeed, for fixed , Euclidean -means admits a PTAS . These algorithms have exponential dependence in , but only linear dependence in the number of points and the dimensionality of the space. As mentioned above, there is also empirical and theoretical evidence for the effectiveness of very simple heuristics for this problem . For arbitrary and , the best known approximation algorithm for -means achieves a factor of . In contrast to the above body of work on getting algorithms for -means, lower bounds for -means have remained elusive. In fact, until recently, even NP-hardness was not known for the -means objective . This is perhaps due to the fact that as opposed to many discrete optimization problems, the -means problem allows one to choose any point in the Euclidean space as a center. The above observations lead to the following intriguing possibility
Is there a PTAS for Euclidean -means for arbitrary and dimension ?
In this paper we answer this question in the negative and provide the first hardness of approximation for the Euclidean -means problem.
There exists a constant such that it is NP-hard to approximate the Euclidean -means to a factor better than .
The starting point for our reduction is the Vertex-Cover problem on triangle-free graphs: here, given a triangle-free graph, the goal is to choose the fewest number of vertices which are incident on all the edges in the graph. This naturally leads us to our other main result in this paper, that of showing hardness of approximation of vertex cover on triangle-free graphs. Kortsarz et al show that if the vertex cover problem is hard to approximate to a factor of , then it is hard to approximate vertex cover on triangle-free graphs to the same factor of . While such a hardness (in fact, a factor of ) is known assuming the stronger unique games conjecture, the best known NP-hardness results do not satisfy . We settle this question by showing NP-hardness results for approximating vertex cover on triangle-free graphs, which match the best known hardness on general graphs.
It is NP-hard to approximate Vertex Cover on triangle-free graphs to within any factor smaller than .
Main Technical Contribution
In Section 4, we show a reduction from Vertex-Cover on triangle-free graphs to Euclidean -means where the vertex cover instances have small cover size if and only if the corresponding -means instances have a low cost. A crucial ingredient is to relate the cost of the clusters to the structural properties of the original graph, which lets us transition from the Euclidean problem to a completely combinatorial problem. Then in Section 5, we prove that the known hardness of approximation results for Vertex-Cover carry over to triangle-free graphs. This improves over existing hardness results for vertex cover on triangle-free graphs . Furthermore, we believe that our proof techniques are of independent interest. Specifically, our reduction transforms known hard instances of vertex cover, by taking a graph product with an appropriately chosen graph . We then show that the size of the vertex cover in the new graph (in proportion to the size of the graph) can be related to spectral properties of . In fact, by choosing to have a bounded spectral radius, we show that the vertex covers in and the product graph are roughly preserved, while also ensuring that the product graph is triangle-free. Combining this with our reduction to -means completes the proof.
Related Work
Arthur and Vassilvitskii proposed -means++, a random sampling based approximation algorithm for Euclidean -means which achieves a factor of . This was improved by Kanungo et al. who proposed a local search based algorithm which achieves a factor of . This is currently the best known approximation algorithm for -means. For fixed and , Matousek gave a PTAS for -means which runs in time . Here is the number of points and is the dimensionality of the space. This was improved by Badoiu et al. who gave a PTAS for fixed and any with run time . Kumar et al. gave an improved PTAS with exponential dependence in and only linear dependence in and . Feldman et al. combined this with efficient coreset constructions to give a PTAS for fixed with improved dependence on . The work of Dasgupta and Aloise et al. showed that Euclidean -means is NP-hard even for . Mahajan et al. also show that the -means problem is NP-hard for points in the plane.
There are also many other clustering objectives related to -means which are commonly studied. The most relevant to our discussion are the -median and the -center objectives. In the first problem, the objective is to pick centers to minimize the sum of distances of each point to the nearest center (note that the distances are not squared). The problem deviates from -means in two crucial aspects, both owing to the different contexts in which the two problems are studied: (i) the -median problem is typically studied in the setting where the centers are one of the data points (or come from a set of possible centers specified in the input), and (ii) the problem is also very widely studied on general metrics, without the Euclidean restriction. The -median problem has been a testbed of developing new techniques in approximation algorithms, and has constantly seen improvements even until very recently . Currently, the best known approximation for -median is a factor of due to Bykra et al. . On the other hand, it is also known that the -median objective (on general metrics) is NP-hard to approximate to a factor better than . When restricted to Euclidean metrics, Kolliopoulos et al. show a PTAS for -median on constant dimensional spaces. On the negative side for -median on Euclidean metrics, it is known that the discrete problem (where centers come from a specified input) cannot have a PTAS under standard complexity assumptions . As mentioned earlier, all these results are for the version when the possible candidate centers is specified in the input. For the problem where any point can be a center, Arora et al. show a PTAS when the points are on a 2-dimensional plane.
In the -center problem the objective is to pick center points such that the maximum distance of any data point to the closest center point is minimized. In general metrics, this problem admits a -factor approximation which is also optimal assuming . For Euclidean metric when the center could be any point in the space, the upper bound is still and the best hardness of approximation is a factor .
Our Hardness Reduction: From Vertex Cover to Euclidean k𝑘k-means
In this section, we show a reduction from the Vertex-Cover problem (on triangle-free graphs) to the -means problem. Formally, the vertex cover problem can be stated as follows: Given an undirected graph , choose a subset of vertices (with minimum ) such that is incident on every edge of the graph. More specifically, our reduction establishes the following theorem.
There is an efficient reduction from instances of Vertex Cover (on triangle-free graphs) to those of Euclidean -means that satisfies the following properties:
if the Vertex Cover instance has value , then the -means instance has cost at most .
if the Vertex Cover instance has value at least , then the optimal -means cost is at least . Here, is some fixed constant .
In 5, we show that there exist triangle-free graph instances of vertex cover on edges, and such that it is NP-hard to distinguish if the instance has a vertex cover of size at most , or all vertex covers have size at least , for some constant .
Now, let where from the hard vertex cover instances. Then, from 3, we get that if the vertex cover has value , then the -means cost is at most , and if the vertex cover is at least , then the optimal -means cost is at least . Therefore, the vertex cover hardness says that it is also NP-hard to distinguish if the resulting -means instance has cost at most or cost more than . Since is a constant, this implies that it is NP-hard to approximate the -means problem within some factor , thereby establishing our main result 1. In what follows, we prove 3.
Let denote the graph in the Vertex Cover instance , with parameter denoting the number of vertices we can select. We associate the vertices with natural numbers . Therefore, we refer to vertices by natural numbers , and edges by pairs of natural numbers .
As stated, the dimensionality of the points we have constructed is , and we get a hardness factor of . However, by using the dimensionality reduction ideas of Johnson and Lindenstrauss (see, e.g. ), without loss of generality, we can assume that the points lie in dimensions and our hardness results still hold true. This is because, after the transformation, all pairwise distances (and in particular, the -means objective function) are preserved upto a factor of of the original values, and so our hardness factor is also (almost) preserved, i.e., we would get hardness of approximation of .
However, for simplicity, we stick with the dimensional vectors as it makes the presentation much cleaner.
2 Completeness
Given any clustering , the following hold.
.
.
The proof is immediate, because every edge belongs to exactly one cluster in . ∎
Our next claim relates the connection cost of any cluster to the structure of the associated subgraph, which forms the crucial part of the analysis.
The total connection cost of any cluster is:
Firstly, note that . Now consider the center of cluster . By definition, we have that at coordinate :
So . Hence the total cost of this clustering is:
There exists a clustering of our -means instance with cost at most , where is the number of edges in the graph associated with the vertex cover instance , and is the size of the optimal vertex cover.
Consider a cluster , which consists of data points associated with edges covered by a single vertex . Then, by 6, the connection cost of this cluster is precisely , since the sub-graph associated with a cluster is simply a star rooted at . Here, is the number of edges which covers in the vertex cover (if an edge is covered by different vertices in the cover, it is included in only one vertex). Then, summing over all clusters, we get the claim. ∎
3 Soundness
In this section, we show that if there is a clustering of low -means cost, then there is a very good vertex cover for the corresponding graph. We begin with some useful notation.
Given a set of edges with corresponding node degrees , we define as the following:
Note that, by 6, the connection cost of a clustering of the points is equal to . Recall that we abuse notation slightly and view each cluster of the data points also as a subset of . Moreover, because clusters all points, the subgraphs form a partition of . Using this analogy, we study the properties of each subgraph and show that if the -means cost of is small, then most of these subgraphs in fact are stars. This will in turn help us recover a small vertex cover for . We begin with a simple property of .
For any set of edges ,
We have \mathsf{Cost}(E^{\prime})=\sum_{u\in V}d_{u}\Big{(}1-\frac{d_{u}}{m_{E^{\prime}}}\Big{)}=2m_{E^{\prime}}-\frac{\sum_{u\in V}d^{2}_{u}}{m_{E^{\prime}}}. The proof follows from noting that and . The last inequality is due to the fact that is maximized by the degree sequence . ∎
If the -means instance has a clustering with , then there exists a -vertex cover of in the instance .
Note that this, along with 7 would complete the proof of 3.
This means, except clusters, the remaining clusters all have . Moreover, 11 implies all these clusters are either stars or triangles and have . Since the graph is triangle free, they are all stars, and hence the corresponding center vertices cover all the edges in the respective clusters. It now remains to cover the edges in the remaining clusters which have larger values. Indeed, even for these clusters, we can appeal to 11, and choose two vertices per cluster to cover all but edges in each cluster. So the size of our candidate vertex cover is at most , and we have covered all but edges. But now, we notice that , and so we can simply include one vertex per uncovered edge and would obtain a vertex cover of size at most , thus completing the proof. ∎
Given a graph with edges and degrees ; let be such that
There always exists an edge with . Furthermore, if , then and is either a star graph or a triangle.
Since , we can think of as the the expectation of over a random edge chosen uniformly, :
From this, we can immediately conclude the existence of an edge with . Now to complete the second part of the Lemma statement, suppose . The number of edges incident to is:
Since is Schur-convex, its value increases under majorization:
So we obtain . Since , we divide both sides by :
In particular, as . Hence . Consequently, and . There are two possible cases: The graph is either a -cycle or -path. In the latter case, the corresponding is:
which is a contradiction and the graph is a triangle. ∎
Putting the pieces together, we get the proof of 3.
Unique Games Hardness: Khot and Regev show that approximating Vertex-Cover to factor is hard assuming the Unique Games conjecture. Furthermore, Kortsarz et al. show that any approximation algorithm with ratio for Vertex-Cover on -cycle-free graphs implies an approximation algorithm for Vertex-Cover (on general graphs). This result combined with the reduction in this section immediately implies APX hardness for -means under the unique games conjecture. In the next section we generalize the result of Kortsarz et al. by giving an approximation preserving reduction from Vertex-Cover on general graphs to Vertex-Cover on triangle-free graphs. This would enable us to get APX hardness for the -means problem.
Hardness of Vertex Cover on Triangle-Free Graphs
In this section, we show that the Vertex Cover problem is as hard on triangle-free graphs as it is on general graphs. To this end, for any graph , we define as the size of maximum independent set in . For convenience, we define as the ratio of to the number of nodes in :
Similarly, let be the size of minimum vertex cover in and be the ratio . The following is well known, which says independent sets and vertex covers are duals of each other.
Given , is an independent set if and only if is a vertex cover. In particular, .
Combining 14 with the best known unconditional hardness result for Vertex Cover, due to Dinur and Safra , we obtain the following corollary.
Given any unweighted triangle-free graph with bounded degrees, it is NP-hard to approximate Vertex Cover within any factor smaller than .
Given two simple graphs and , we define the Kronecker product of and , , as the graph with nodes and edges:
Observe that, if and denote the adjacency matrix of and , then .
Given any symmetric matrix , we will use to denote the largest eigenvalue of . For any graph on -nodes, we define the spectral radius of , , as the following:
Here is the all ’s vector of length .
If is triangle-free, then so does .
Suppose has a -cycle of the form . Then is a closed walk in . is triangle-free, therefore wlog; a contradiction as has no loops. ∎
The following Lemma says that as long as has good spectral properties, the relative size of maximum independent sets in will be preserved by .
Suppose is a -regular graph with spectral radius . For any graph with maximum degree ,
For the lower bound, consider an independent set in . It is easy to check that is an independent set in , thus .
For the upper bound, consider the indicator vector of an independent set in . Since the corresponding set contains no edges from ,
Define as the following vector:
For each , pick with probability . Let be the set of picked nodes. Next, start with . As long as there is an edge of contained in , arbitrarily remove one of its endpoints from . At the end of this process, the remaining set is an independent set for , and its size is at least the size of minus the number of edges contained in . Hence Observe that
The probability of any pair being contained in is given by
In the remaining part, we prove the supporting claims.
where is the -by- matrix of all ’s.
The second-to-last identity follows from the bi-linearity of Kronecker product. ∎
.
We have f^{T}(A\otimes\widetilde{J_{N}})f=f^{T}\Big{[}A\otimes\big{(}\widetilde{J_{N}}-B)\Big{]}f+f^{T}(A\otimes B)f. As noted above, being an independent set implies :
.
We know that the spectrum of the Kronecker product of two symmetric matrices correspond to the pairwise product of the spectrum of corresponding matrices, i.e., all eigenvalues of are of the form for each and . Therefore,
Observe that , since is the adjacency matrix of a graph with degree . Now we will upper bound . Since is a regular graph and is its normalized adjacency matrix, the largest eigenvector of is all ’s and the corresponding eigenvalue is . Therefore has the same eigenspace with . Moreover , thus:
We now prove the main theorem needed for our reduction.
Given a graph with maximum degree , for any , we can construct in polynomial time, a triangle-free graph with
. ∎
Noga Alon has provided an alternate construction where one can obtain a triangle free graph such that . This however, does not lead to improved constant in our analysis. For the sake of completeness, we include the alternate theorem in the Appendix (See Theorem 24).
We will end the section with the proof of 15. We need the following hardness result of : It follows from their Corollary 2.3 and Appendix 8 (weighted to unweighted reduction). As noted in , the construction produces bounded degree graphs.
For any constant , given any unweighted graph with bounded degrees, it is NP-hard to distinguish between:
(Yes) ,
(No) ;
where and are constants such that .
Given a bounded degree graph , consider the graph given by 21 for some small constant . Since is bounded degree and is constant, is also bounded degree. Furthermore, satisfies . Completeness follows immediately: . For the soundness, suppose . Then for suitable . The hardness of Vertex Cover follows from 13. ∎
Conclusions
In this paper we provide the first hardness of approximation for the fundamental Euclidean -means problem. Although our work clears a major hurdle of going beyond NP-hardness for this problem, there is still a big gap in our understanding with the best upper bound being a factor . We believe that our result and techniques will pave way for further work in closing this gap. Our reduction from vertex cover produces high dimensional instances () of -means. However, by using the Johnson-Lindenstrauss transform , we can project the instance onto dimensions and still preserve pairwise distances by a factor and the -means cost by a factor of . We leave it as an open question to investigate inapproximability results for -means in constant dimensions. It would also be interesting to study whether our techniques give hardness of approximation results for the Euclidean -median problem. Finally, our hardness reduction in 5 provides a novel analysis by using the spectral properties of the underlying graph to argue about independent sets in graph products – this connection could have applications beyond the present paper.
Acknowledgments
We would like to thank Noga Alon and Oded Regev for valuable feedback on the results in 5, in particular for suggesting alternate proofs of Theorem 16 and Theorem 17. We would also like to thank Noga for pointing out that the graph product construction in 5 does not eliminate even cycles.
References
Appendix A Appendix
Let be an arbitrary graph with maximum degree . It is possible to construct in polynomial time a triangle free graph such that .
Before proving the theorem, we need the following standard facts about graphs. The following proofs are suggested by Noga Alon.
Let be an graph, assume and let be a set of vertices of . Let denote the set of all neighbors of in . Then:
If then
If then
Part is proved in Corollary in . Part , for follows from the same corollary (which implies that in this range ). For , the result follows from the expander mixing lemma (see , corollary ), as there are edges between and . ∎
Let be a -expander with This means that all eigenvalues of , except the first, are bounded by . Let . Further, let . It is well known that such graphs exist. It is easy to see that any , since any independent set in leads to an independent set in .
For the other direction, let be an independent set in . Define
Be Lemma 25 part , is an independent set in . Let be a maximal (with respect to containment) independent set in that contains . By maximality, every vertex in has at least one neighbor in . Thus is a dominating set in and there is a collection of stars , covering all the vertices of . As is an independent set, . To complete the proof it suffices to show that for each of the stars in our collection whose set of vertices in is
The number of leaves of the star is at most . For each such leaf , the set of vertices of given by
is of cardinality smaller than . Moreover, all its neighbors in cannot belong to the set where is the center of the star . By Lemma 25 part , the number of these neighbors is at least times the cardinality of . This implies that the total size of all sets where the sum ranges over all leaves of is at most the number of vertices in , implying 1 and completing the proof. ∎