Local Search Yields a PTAS for k-Means in Doubling Metrics
Zachary Friggstad, Mohsen Rezapour, Mohammad R. Salavatipour
Introduction
With advances in obtaining and storing data, one of the emerging challenges of our age is data analysis. It is hard to find a scientific research project which does not involve some form of methodology to process, understand, and summarize data. A large portion of data analysis is concerned with predicting patterns in data after being trained with some training data set (machine learning). Two problems often encounterd in data analysis are classification and clustering. Classification (which is an instance of supervised learning) is the task of predicting the label of a new data point after being trained with a set of labeled data points (called a training set). Basically, after given a training set of correctly labeled data points the program has to identify the label of a given new (unlabeled) data point. Clustering (which is an instance of unsupervised learning) is the task of grouping a given set of objects or data points into clusters/groups such that the data points that are more similar fall into the same cluster while data points (objects) that do not seem similar are in different clusters. Some of the main purposes of clustering are to understand the underlying structure and relation between objects and find a compact representation of data points.
This value is called the cost of the clustering. Typically, the centres are selected to be the centroid (mean) of the cluster . In other situations the centres must be from the data points themselves (i.e. ) or from a given set . This latter version is referred to as discrete -means clustering. Although in most application of -means the data points are in some Euclidean space, the discrete variant can be defined in general metrics. The -means clustering problem is known to be an NP-hard problem even for or when .
Clustering, in particular the -means clustering problem as the most popular model for it, has found numerous applications in very different areas. The following is a (short) list of applications of clustering that have been addressed by Jain : image segmentation, information access, grouping customers into different types for efficient marketing, grouping delivery services for workforce management and planning, and grouping genome data in biology. For instance, clustering is used to identify groups of genes with related expression patterns in a key step of the analysis of gene functions and cellular processes. It is also extensively used to group patients based on their genetic, pathological, and cellular features which is proven useful in analyzing human genetics diseases (e.g., see ).
The most widely used algorithm for -means (which is also sometimes referred to as “the” -means algorithm) is a simple heuristic introduced by Lloyd in 1957 . This algorithm starts from an initial partition of the points into clusters and it repeats the following two steps as long as it improves the quality of the clustering: pick the centroids of the clusters as centres, and then re-compute a new clustering by assigning each point to the nearest centre. Although this algorithm works well in practice it is known that the ratio of the cost of the solution computed by this algorithm vs the optimum solution cost (known as the “approximation ratio”) can be arbitrarily large (see ). Various modifications and extensions of this algorithm have been produced and studied, e.g. ISODATA, FORGY, Fuzzy C-means, -means++, filtering using kd-trees (see ), but none of them are known to have a bounded approximation ratio in the general setting. Arthur and Vassilvitskii show that Lloyd’s method with properly chosen initial centres will be an -approximation. Ostrovsky et al. show that under some assumptions about the data points the approximation ratio is bounded by a constant. The problem of finding an efficient algorithm for -means with a proven theoretical bound on the cost of the solution returned is probably one of the most well studied problems in the whole field of clustering with hundreds of research papers devoted to this.
Arthur and Vassilvitskii , Dastupta and Gupta , and Har-Peled and Sadri study convergence rate of Lloyd’s algorithm. In particular show that it can be super-polynomial. More recently, Vattani shows that it can take exponential time even in two dimensions. Arthur et al. proved that Lloyd’s algorithm has polynomial-time smoothed complexity. Kumar and Kannan , Ostrovsky et al. , and Awasthi et al. gave empirical and theoretical evidence for when and why the known heuristics work well in practice. For instance show that when the size of an optimum -means is sufficiently larger than the cost of -means then one can get a near optimum solution to -means using a variant of Lloyd’s algorithm.
The -means problem is known to be NP-hard . In fact, the -means problem is NP-hard if is arbitrary even for . Also, if is arbitrary the problem is NP-hard even for . However, the -means problem can be solved in polynomial time by the algorithm of when both and are constant.
-median Another very well studied problem that is also closely related to -means is -median. The only difference is that the goal (objective function) in -median is to minimize the sum of distances, instead of sum of square of distances as in -means, i.e. minimize where is the distance between and . This problem occurs in operations research settings.
There are constant factor approximation algorithms for -median in general metrics. The simple local search (which swaps in and out a constant number of centres in each iteration) is known to give a approximation by Arya et al. . The current best approximation uses different techniques and has an approximation ratio of . The local search -approximation (for -means) in can be seen as an extension of the analysis in for -median. One reason that analysis of -means is more difficult is that the squares of distances do not necessarily satisfy the triangle inequality. For instances of -median on Euclidean metrics, Arora et al. , building on the framework of Arora , gave the first PTAS. Kolliopoulos and Rao improved the time complexity and presented a PTAS for Euclidean -median with time complexity . Such an approximation is also known as an efficient PTAS: the running time of the -approximation is of the form (in fixed-dimension metrics).
Uncapacitated facility location The uncapacitated facility location problem is the same as -median except instead of a cardinality constraint bounding the number of open facilities, we are instead given opening costs for each . The goal is to find a set of centers that minimizes . Currently the best approximation for uncapacitated facility location in general metrics is a 1.488-approximation . As with -median, a PTAS is known for uncapacitated facility location in constant-dimensional Euclidean metrics , with the latter giving an efficient PTAS.
A precise description of the algorithm is given in Section 2. At a high level, we start with any set of centres . Then, while there is some other set of centres with for some constant such that is a cheaper solution than , we set . Repeat until cannot be improved any further. Each iteration takes time, which is polynomial when is a constant. Such a solution is called a local optimum solution with respect to the -swap heuristic. We still have to ensure that the algorithm only iterates a polynomial number of times; a standard modification discussed in Section 2 ensures this.
Let . We will articulate the absolute constants suppressed by the notation later on in our analysis.
The local search algorithm that swaps up to centres at a time is a -approximation for -means in metrics with doubling dimension .
Note that even for the case of -median, this is the first PTAS for metrics with constant doubling dimension. Also, while a PTAS was known for -median for constant-dimensional Euclidean metrics, determining if local search provided such a PTAS was an open problem. For example, shows that local search can be used to get a approximation for -median that uses up to centres.
As mentioned earlier, Awasthi et al. proved that -means is APX-hard for and they left the approximability of -means for lower dimensions as an open problem. A consequence of our algorithm is that one can get a -approximation for -means that runs in sub-exponential time for values of up to . More specifically, for any given and for sufficiently small absolute constant we get a -approximation for -means that runs in time , for some constant ; for we get a quasi-polytime approximation scheme (QPTAS). Therefore, our result in a sense shows that the requirement of of to prove APX-hardness of -means is almost tight unless .
The notion of coresets and using them for finding faster algorithms for -means has been studied extensively (e.g. and references there). A coreset is a small subset of data points (possibly with weights associated to them) such that running the clustering algorithm on them (instead of the whole data set) generates a clustering of the whole data set with approximately good cost. In order to do this, one can go to the discrete case. To use coresets, we need to be able to solve (discrete) -means in the more general setting where each centre has an associated weight , and the cost of assigning a point to (if is selected to be a centre) is . Our local search algorithm works for this weighted setting as well. We will show how to use these ideas to improve the running time of the local search algorithm.
Finally, we observe that our techniques easily extend to show a natural local-search heuristic for uncapacitated facility location is a PTAS. In particular, for the same constant as in Theorem 1 (in fact, it can be slightly smaller) we consider the natural local search algorithm that returns a solution such that for all with both and (i.e. add and/or drop up to centres in ).
The local search algorithm that adds and/or drops up to centres at a time is a -approximation for uncapacitated facility location in metrics with doubling dimension .
This seems to be the first explicit record of a PTAS for uncapacitated facility location in doubling metrics, but one was known in constant-dimensional Euclidean metrics . Prior to this work, local search was only known to provide a PTAS for uncapacitated facility location in constant-dimensional Euclidean metrics if all opening costs are the same . The basic idea why this works is our analysis in Theorem 1 considers test swaps that, overall, swap in each local optimum centre exactly once and swap out each global optimum centre exactly once (i.e. the swaps come from a full partitioning of the local and global optimum). The partitioning we use to obtain these swaps only uses the assumption that precisely centres are open in a feasible solution at one point, and this step can be safely ignored in the case of uncapacitated facility location.
Lastly, we consider the common generalization of -median and uncapacitated facility location where all centres have costs and at most centres may be chosen (sometimes called the generalized -median or -uncapacitated facility location problem). We consider the local search operation that tries to add and/or drop up to centres at a time as long as the candidate solution being tested includes at most centres. We get a PTAS in this case as well. To the best of our knowledge, the previous best approximation was a 5-approximation in general metrics, also obtained by local search .
The local search algorithm that adds and/or drops up to centres at a time (provided the resulting solution has at most facilities) is a a -approximation for generalized -median in metrics with doubling dimension .
Note: Shortly after we announced our result , Cohen-Addad, Klein, and Mathieu announced similar results for -means on Euclidean and minor-free metrics using the local search method. Specifically, they prove that the same local search algorithm yields a PTAS for -means on Euclidean and minor-free metrics. These results are obtained independently.
2 Proof Outline
The general framework for analysis of local search algorithms for -median and -means in is as follows. Let and be a local optimum and a global optimum solution, respectively. They carefully identify a set of potential swaps between local and global optimum. In each such swap, the cost of assigning a data point to the nearest centre after a swap is bounded with respect to the local and global cost assignment. In other words, if is the set of solutions obtained by performing swaps from , the main task is to show that for some constant . Given that for all (because is a local optimum), .
Our analysis has the same structure but has many more ingredients and several intermediate steps to get us what we want. Note that the following only describes steps used in the analysis of the local search algorithm; we do not perform any of the steps described below in the algorithm itself.
Let us define and as before. First, we do a filtering over and to obtain subsets and such that every centre in (in ) is “close” to a centre in (in ) while these filtered centres are far apart. We define a “net” around each centre which captures a collection of other filtered centres in that are relatively close to . The idea of the net is that if we choose to close (in a test swap) then the data points that were to be assigned to will be assigned to a nearby centre in the net of . Since the metric is a constant-dimensional Euclidean metric (or, more generally, a doubling metric), we can choose these nets to have constant size.
For each assigned to in , if the centre that is assigned to in the optimum solution lies somewhat close to then we can reassign to a facility in the net around that is close to . In this case, the reassignment cost for will be close to . Otherwise, if lies far from then we can reassign to a facility near in the net around and the reassignment cost will only be and we will generate the term for the local search analysis when is opened in another different swap.
Of course, there are some complications in that we need to do something else with if the net around is not open. This will happen infrequently, but we need a somewhat reasonable bound when it does happen. Also, for reasons that will become apparent in the analysis we do something different in the case that is somewhat close to but is much closer to a different facility in than it is to .
Notation and Preliminaries
We usually refer to a potential centre in by a simple index and a point in by a simple index (or slight variants like or ). This is to emphasize that we do not need to talk about specific coordinates of points in Euclidean space. In fact, only once in our proof do we rely on the particular embedding of the points in Euclidean space. This argument will also be replaced by a more general argument when discussing doubling metrics in Section 5.1. So, for any set and any , let . We also define .
Our goal in (discrete) -means is to find a set of centres of size to minimize . Note that once we fix the set of centres we can find a partitioning of that realizes by assigning each to the nearest centre in , breaking ties arbitrarily.
The simple -swap local search heuristic shown in Algorithm 1 is essentially the same one considered in .
Recall that we defined , where the constants will be specified later and consider the local search algorithm with swaps. By a standard argument (as in ) one can show that replacing the condition of the while loop with , the algorithm terminates in polynomial time. Furthermore, if is such that any locally optimum solution returned by Algorithm 1 has cost at most where denotes a global optimum solution, then any such that for any possible swap satisfies . This follows by arguments in and the fact that our local search analysis uses at most “test swaps”.
For ease of exposition, we ignore this factor loss, and consider the solution returned by Algorithm 1. Recall that we use to denote the global optimum solution. For , let and , so and . We also denote the centre in nearest to by and the centre in nearest to by . Define to be the function that assigns to its nearest centre in and assigns to its nearest centre in . For any two sets , we let .
We assume . This is without loss of generality because we could duplicate each location in and say uses the originals and the duplicates. It is easy to check that would still be a locally optimum solution in this instance. We can also assume that these are the only possible colocated facilities, so for distinct or distinct . Finally, we will assume is sufficiently small (independent of all other parameters, including ) so that all of our bounds hold.
To prove this, we will construct a set of test swaps that yield various inequalities which, when combined, provide the desired bound on . That is, we will partition into sets where for each part . For each such set , because is a locally optimum solution. We will provide an explicit upper bound on this cost change that will reveal enough information to easily conclude . For example, for a point if then the change in ’s assignment cost is at most because we could assign from to . The problem is that points with but must go somewhere else; most of our effort is ensuring that the test swaps are carefully chosen so such reassignment cost increases are very small.
First we need to describe the partition of . This is a fairly elaborate scheme that involves several steps. As mentioned earlier, the actual algorithm for -means is the simple local search we described and the algorithms we describe below to get this partitioning scheme are only for the purpose of proof and analysis of the local search algorithm.
For let . For let .
The first thing is to sparsify and using a simple filtering step. Algorithm 2 filters to a set that is appropriately sparse for our analysis.
Think of as a proxy for that is very close to . Using a similar process, we filter to get and proxy centres for each . The idea is that the set of centres left in and are somewhat far apart yet any point that was assigned to a centre in (or in ) can be “cheaply” reassigned to a proxy.
For each we have . For any distinct we have .
Proof. That follows immediately by construction. If or vice-versa, then in fact simply by definition of .
Now suppose and that was considered after in Algorithm 2 (so ). The fact that was added to even though was already in means . The same argument works if .
Next we define mappings similar to except they only concern centres that were not filtered out.
maps each to its nearest location in and vice versa.
defined by .
defined by .
Finally, for each , let be the centre in that is closest to , breaking ties arbitrarily.
Note may not necessarily be the centre in that is closest to . Also note that if one considers a bipartite graph with parts and , then maps centres from one side to the other.
For each , .
Proof. Suppose , the proof is essentially the same for . On one hand, we know
because . On the other hand,
Conclude by observing .
Figure 1 depicts many of the concepts covered above. Finally, the last definition in this section identifies pairs of centres that we would like to have in the same part of the partition we construct.
For each , the set is the “net” for centre that was discussed in the proof outline in Section 1.2.
Ultimately we will require that pairs in are not separated by the partition. Our requirement for is not quite as strong. The partition is constructed randomly and it will be sufficient to have each pair in being separated by the partition with probability at most .
The following says that if at least one centre of each pair in is open after a swap, then every centre in is somewhat close to some open centre. The bound is a bit big, but it will be multiplied by whenever it is used in the local search analysis.
Let be such that for each . Then for any .
Proof. We first prove the statement for , the other case is similar but requires one additional step so we will discuss it below. Consider the following sequence of centres. Initially, set , , and . We build the rest inductively, noting that we guarantee for even indices (so is defined).
Inductively, for even we do the following. If then we stop. Otherwise, if then by assumption it must be that so we let and stop. Finally, if then we set and and iterate with . This walk is depicted in Figure 2.
We will soon show the walk terminates. For now, we observe that, apart from the first step, the steps decrease in length geometrically. In particular, consider some such that the walk did not stop at . If then
If then it must be . In this case, it must be , so because is the closest centre in to (by definition), we have
We prove that the lengths of the edges traversed decrease geometrically with every other step. This, along with the fact that the lengths of the steps of the walk are nonincreasing (except, perhaps, the first two steps), will show that this process eventually terminates and also bounds the cost of the path.
For every even such that the walk did not end at or , we have .
Proof. Because the walk did not end at or , meaning . Using this and Lemma 2 in the first bound below, we see
Let be the index of the last centre in the walk. Thus, for all . From this and Claim 1 we have
The second last step uses Lemma 2 and the last step uses the fact that (either or else was filtered out by , in which case it has a larger -value) and the assumption that is small enough.
Now suppose . We bound mostly using what we have done already. That is, we have
Note again by Lemma 2. So,
2 Good Partitioning of 𝒪∪𝒮𝒪𝒮{\mathcal{O}}\cup{\mathcal{S}} and Proof of Theorem 4
The main tool used in our analysis is the existence of the following randomized partitioning scheme.
There is a randomized algorithm that samples a partitioning of such that:
For each part , .
For each part , includes at least one centre from every pair in .
For each , .
The following gives a way to handle the fact that the triangle inequality does not hold with squares of the distances.
For any real numbers we have .
Proof.
For each point , . Similarly, .
Proof. As usual, we only prove the first statement since the second is nearly identical. If then is trivially true. Otherwise, was already in when was considered by the filtering algorithm meaning .
Proof of Theorem 4. Let be a partition sampled by the algorithm from Theorem 5. For each point and each part of , let denote the change in assignment cost for the point after swapping in the centers in and swapping out . Local optimality of and means for any part .
Classify each point in one of the following ways:
Lucky: and do not lie in the same part of .
Long: is not lucky but .
Bad: is not lucky or long and yet lie in different parts of .
Good: is neither lucky, long, nor bad.
We now place an upper bound on for each point . Note that each centre in is swapped out exactly once over all swaps and each centre in is swapped in exactly once. With this in mind, consider the following cases for a point . In the coming arguments, we let and for brevity. Note and .
In all cases for except when is bad, the main idea is that we can bound the distance from to some point in by first moving it to either or and then moving it a distance of to reach an open facility. Considering that we reassigned from , the reassignment cost will be
Case: is lucky For the part with , we have as we could move from to . If is swapped out in a different swap , we move to (which remains open because is lucky) and bound by:
again using the assumption that is sufficiently small. For every other swap , we have that remains open after the swap so as we could just leave at ). In total, we have
Case: is long Again, for with we get . If is swapped out in a different swap , then we bound by moving from to the open centre nearest to . Note that contains at least one centre from every pair in , so we bound this distance using Lemma 3. This case is depicted in Figure 3. We have
Using this, we bound as follows.
In every other swap we could leave at . Thus, for a long point we have
Case: is bad We only move in the swap when is closed. In this case, we assign in the same way as if it was long. Our bound is weaker here and introduces significant positive dependence on . This will eventually be compensated by the fact that is bad with probability at most over the random choice of . For now, we just provide the reassignment cost bound for bad .
Case: is good This breaks into two subcases. We know because is not long. In one subcase, so . Since is not bad and not lucky, we have for some common part . In the other subcase, . Note in this case we still have for some common part because is not lucky.
Subcase: The only time we move is when is closed. As observed in the previous paragraph, this happens in the same swap when is opened, so send to . This is illustrated in Figure 4.
Subcase: Again, the only time we move is when is closed. We reassign by first moving it to and then using Lemma 3 to further bound the cost. Figure 5 depicts this reassignment.
We bound the cost change for this reassignment as follows. Recall that by our filtering. This implies that which in turn implies ; thus which in turn is bounded by in this subcase (by the assumption of subcase). Thus,
Considering both subcases we can say that for any good point that
Aggregating these bounds and remembering for each because is a locally optimum solution, we have
The last step is to average this inequality over the random choice of . Note that any point is bad with probability at most by the guarantee in Theorem 5 and the definition of bad. Thus, we see
3 Running Time Analysis
Recall that we can go to the discrete case by finding a set of size . The analysis of Arya et al. shows that the number of local search steps is at most , where is the initial solution. This is polynomial in the total bit complexity of the input (i.e. the input size). So we focus on bounding the time complexity of each local search step. Since the number of swaps in each step is bounded by , a crude upper bound on the time complexity of each step is .
We can speed up this algorithm by using the idea of coresets. First observe that our local search algorithm extends to the weighted setting where each point has a weight and the cost of a clustering with centres is .
Earlier works on coresets for -means imply the existence of a -coresets of small size. For example, show existence of -coresets of size . Applying the result of , we get a -centroid set of size over a -coreset of size . Thus running our local search -swap algorithm takes time per iteration where .
The Partitioning Scheme: Proof of Theorem 5
We treat differently in our partitioning algorithm. It is important to note that no pair in or has precisely one point in , as the following shows.
For each pair of centres , .
Proof. Consider some colocated pair . As and because no other centre in is colocated with and , then and . Thus, and it is the unique closest facility in to so . This shows every pair with either or must have both so .
Next consider some . We know by definition of . Thus, if then as well. Conversely, suppose . Since then . So, meaning as well.
2 Properties of the Partitioning Scheme
We will show the parts formed in the partitioning scheme so far have constant size (depending only on and ) and also that each pair in is cut with low probability. Figure 6 illustrates some key concepts in these proofs.
The last bound follows for sufficiently small and because is the smallest integer at least .
For each with we have .
The probability that and are cut by the random offset along one of the -dimensions is then at most . Taking the union bound over all dimensions, the probability that and lie in different cells is at most .
Finally, we bound the probability that will be moved to a different part when fixing . If or if then this will not happen. So, we will bound if . That is, we bound the probability that lie in different parts where is such that and . Note that by Lemma 2 and by definition of . So and lie in different bands with probability at most by the same argument as with . Similarly, conditioned on lying in the same band, the probability they lie in different cells is at most again by the same arguments as with .
Note that if lie in different parts then they were cut by the random band or by the random box, or else were cut by the random band or the random box (the latter may not apply if is not involved in a pair in ). Thus, by the union bound we have
3 Balancing the Parts
The proof of Lemma 6 shows that partitions naturally into colocated centres. So let denote the partition of into these pairs. Finally let denote the partition of into singleton sets.
We summarize important properties of .
is itself a partitioning of into parts with size at most (Lemma 7).
Over the randomized formation of , each has endpoints in different parts with probability at most . For lying in this follows from Lemma 8. For lying in this follows because they must then be colocated pairs so they always form a part by themselves.
From now on, we simply let . We show how to combine parts of into constant-size parts that are also balanced between and . Since merging parts does not destroy the property of two centres lying together, we will still have that pairs of centres in appear together and any pair of centres in lie in different parts with probability at most .
For any subset , let denote the imbalance of .
Let be an integer and a collection of disjoint, nonempty subsets of such that . If for each then there is some nonempty where such that .
Proof. If for some then simply let . Otherwise, note for each and partition into sets for . We have
so if then and we can take . Similarly if then we can take .
Finally, we are left with the case that and both exceed . By the pigeonhole principle, there are values such that and . In this case, we take to be any sets from plus any sets from . Then and is balanced, which is what we needed to show.
To complete the partitioning we iteratively apply Lemma 9 to with where we note by Lemma 7. Each iteration, we find some nonempty such that . Remove from and repeat until all sets from have been removed. Each balanced part obtained is the union of at most different parts in , meaning each part has size at most .
Given a metric , the aspect ratio, denoted by , is the ratio of the largest distance to the smallest non-zero distance in the metric: . Talwar gave a hierarchical decomposition of a doubling metric using an algorithm similar to one by Fakcharoenphol et al. . It assumes , which can be accomplished by scaling the distances. So, is the maximum distance between two points in the metric.
Suppose . There is a randomized hierarchical decomposition of , which is a sequence of partitions , , , where is a refinement of , , and . The decomposition has the following properties:
corresponds to the leaves and corresponds to the root of the split-tree , and the height of is , where and is the aspect ratio of metric.
For each level and each , has diameter at most .
The branching factor of is at most .
For any , the probability that they are in different sets corresponding to nodes in level of is at most .
The rest of the proof of Theorem 5 remains the same as in Subsection 4.3.
Extending to the uncapacitated facility location and generalized k𝑘k-median problems
Recall that the setting of uncapacitated facility location is similar to -median except we are given opening costs for each instead of a cardinality bound . A feasible solution is any nonempty and its cost is
The standard local search algorithm is the following. Let be defined as before.
We will show every locally optimum solution has cost at most using at most test swaps. Thus, replacing the cost condition in Algorithm 1 with is a polynomial-time variant that is also a PTAS.
Let be a locally optimum solution and a global optimum. We may assume, by duplicating points if necessary (for the analysis only), that , thus (where refers to the size of the original set of facilities before duplication). Our analysis proceeds in a manner that is nearly identical to our approach for -means.
In particular, we prove the following. It is identical to Theorem 5 in every way except the first point does not require and to have equal size.
There is a randomized algorithm that samples a partitioning of such that:
For each part , .
For each part , includes at least one centre from every pair in .
For each , .
The proof is identical to Theorem 5, except we do not to the “balancing” step in Section 4.3. Indeed this was the only step in the proof of Theorem 5 that required .
We now complete the proof of Theorem 2. Proof. Let and for each . Sample a partition of as per Theorem 7. For each part and each we let denote . Using the same bounds considered in the proof of Theorem 4 we have
As each is closed exactly once and each is opened exactly once, the fact that is locally optimal and fact that each has shows
Rearranging shows .
Finally we conclude by analyzing a local search algorithm for generalized -median. Here we are given both a cardinality bound and opening costs for each . The goal is to open some with to minimize
Note this is the same as , we use this slightly different notation to avoid confusion as we are discussing a different problem now.
Proof. Let and denote a local optimum and a global optimum (respectively). By adding artificial points with that are extremely far away from , we may assume . Then we simply use our original partitioning result, Theorem 5, to define test swaps. Noting that each is closed exactly once and each is opened exactly once over the swaps induced by a partition , we proceed in the same way as above in the proof of Theorem 2 and see
Conclusion
The running time of a single step of the local search algorithm is where for the case of -means when the metric has doubling dimension . We have not tried to optimize the constants in the notations in . The dependence on cannot be improved much under the Exponential Time Hypothesis (ETH). For example, if the running time of a single iteration was only for some constant then we would have a sub-exponential time -approximation when . Recall that -means is APX-hard when , so this would refute the ETH.
It may still be possible to obtain an EPTAS for any constant dimension . That is, there could be a PTAS with running time of the form for some function (perhaps depending also on ). Finally, what is the fastest PTAS we can obtain in the special case of the Euclidean plane (i.e. )? It would be interesting to see if there is an EPTAS whose running time is linear or near linear in for any fixed constant .