Clustering Stable Instances of Euclidean k-means

Abhratanu Dutta, Aravindan Vijayaraghavan, Alex Wang

Introduction

One of the major challenges in the theory of clustering is to bridge the large disconnect between our theoretical and practical understanding of the complexity of clustering. While theory tells us that most common clustering objectives like kk-means or kk-median clustering problems are intractable in the worst case, many heuristics like Lloyd’s algorithm or k-means++ seem to be effective in practice. In fact, this has led to the “CDNM” thesis : “Clustering is difficult only when it does not matter”.

We try to address the following natural questions in this paper: Why are real-world instances of clustering easy? Can we identify properties of real-world instances that make them tractable?

One way to model real-world instances of clustering problems is through instance stability, which is an implicit structural assumption about the instance. Practically interesting instances of the kk-means clustering problem often have a clear optimal clustering solution (usually the ground-truth clustering) that is stable: i.e., it remains optimal even under small perturbations. As argued in , clustering objectives like kk-means are often just a proxy for recovering a ground-truth clustering that is close to the optimal solution. Instances in practice always have measurement errors, and optimizing the kk-means objective is meaningful only when the optimal solution is stable to these perturbations.

Multiplicative perturbation stability represents an elegant, well-motivated formalism that captures robustness to measurement errors for clustering problems in general metric spaces (γ=1.1\gamma=1.1 captures relative errors of 10% in the distances). However, multiplicative perturbation stability has the following drawbacks in the case of Euclidean clustering problems:

Measurement errors in Euclidean instances are better captured using additive perturbations. Uncertainty of δ\delta in the position of x,yx,y leads to an additive error of δ\delta in ∥x−y∥2\lVert x-y\rVert_{2}, irrespective of how large or small ∥x−y∥2\lVert x-y\rVert_{2} is.

The amount of stability, γ\gamma, needed to enable efficient algorithms (i.e., γ≥2\gamma\geq 2) often imply strong structural conditions, that are unlikely to be satisfied by many real-world datasets. For instance, γ\gamma-factor perturbation stability implies that every point is a multiplicative factor of γ\gamma closer to its own center than to any other cluster center.

Algorithms that are known to have provable guarantees under multiplicative perturbation stability are based on single-linkage or MST algorithms that are very non-robust by nature. In the presence of a few outliers or noise, any incorrect decision in the lower layers gets propagated up to the higher levels.

In this work, we consider a natural additive notion of stability for Euclidean instances: the optimal clustering should not change even when each point is moved a Euclidean distance of at most δ\delta. This corresponds to a small additive perturbation to the pairwise distances between the pointsNote that not all additive perturbations to the distances can be captured by an appropriate movement of the points in the cluster. Hence the notion we consider in our paper is a weaker assumption on the instance.. Unlike multiplicative notions of perturbation stability , this notion of additive perturbation is not scale invariant. Hence the normalization or scale of the perturbation is important.

Ackerman and Ben-David initiated the study of additive perturbation stability when the distance between any pair of points can be changed by at most δ=εdiam⁡(X)\delta=\varepsilon\operatorname{diam}(X) with diam⁡(X)\operatorname{diam}(X) being the diameter of the whole dataset. The algorithms take time nO(k/ε2)=nO(kdiam⁡2(X)/δ2)n^{O(k/\varepsilon^{2})}=n^{O(k\operatorname{diam}^{2}(X)/\delta^{2})} and correspond to polynomial time algorithms when k,1/εk,1/\varepsilon are constants. However, this dependence of kdiam⁡2(X)/δ2k\operatorname{diam}^{2}(X)/\delta^{2} in the exponent is not desirable since the diameter is a very non-robust quantity – the presence of one outlier (that is even far away from the decision boundary) can increase the diameter arbitrarily. Hence, these guarantees are useful mainly when the whole instance lies within a small ball and the number of clusters is small . Our notion of additive perturbation stability will use a different scale parameter that is closely related to the distance between the centers instead of the diameter diam⁡(X)\operatorname{diam}(X). Our results for additive perturbation stability have no explicit dependence on the diameter, and allows instances to have potentially unbounded clusters (as in the case of far-way outliers). With some additional assumptions, we also obtain polynomial time algorithmic guarantees for large kk.

We consider a notion of additive stability where the points in the instance can be moved by at most δ=εD\delta=\varepsilon D, where ε∈(0,1)\varepsilon\in(0,1) is a parameter, and D=max⁡i≠jDij=max⁡i≠j∥μi−μj∥2D=\max_{i\neq j}D_{ij}=\max_{i\neq j}\lVert\mu_{i}-\mu_{j}\rVert_{2} is the maximum distance between pairs of means. Suppose XX is a kk-means clustering instance with optimal clustering C1,C2,…,CkC_{1},C_{2},\dots,C_{k}. We say that XX is ε\varepsilon-additive perturbation stable (ε\varepsilon-APS) iff every δ\delta-additive perturbation of XX has C1,C2,…,CkC_{1},C_{2},\dots,C_{k} as an optimal clustering solution. Note that there is no restriction on the diameter of the instance, or even the diameters of the individual clusters. Hence, our notion of additive perturbation stability allows the instance to be unbounded.

Clusters in the optimal solution of an ε\varepsilon-APS instance satisfy a natural geometric condition — there is an “angular separation” between every pair of clusters.

Let XX be an ε\varepsilon-APS instance and let Ci,CjC_{i},C_{j} be two clusters in its optimal solution. Any point x∈Cix\in C_{i} lies in a cone whose axis is along the direction (μi−μj)(\mu_{i}-\mu_{j}) with half-angle arctan(1/ε)\text{arctan}(1/\varepsilon). Hence if uu is the unit vector along μi−μj\mu_{i}-\mu_{j} then

The distance between μi\mu_{i} and the apex of the cone is Δ=(12−ε)D\Delta=(\tfrac{1}{2}-\varepsilon)D. We will call Δ\Delta the scale parameter of the clustering. See Figure 1a for an illustration.

We believe that many clustering instances in practice satisfy the ε\varepsilon-APS condition for reasonable constants ε\varepsilon. In fact, our experiments in Section 7 suggest that the above geometric condition is satisfied for reasonable values e.g., ε∈(0.001,0.2)\varepsilon\in(0.001,0.2).

While the points can be arbitrarily far away from their own means, the above angular separation (1) is crucial in proving the polynomial time guarantees for our algorithms. For instance, this implies that at least 1/21/2 of the points in a cluster CiC_{i} are within a Euclidean distance of at most O(Δ/ε)O(\Delta/\varepsilon) from μi\mu_{i}. This geometric condition (1) of the dataset enables the design of a tractable algorithm for k=2k=2 with provable guarantees. This algorithm is based on a modification of the perceptron algorithm in supervised learning, and is inspired by . See Section 4 for details on the k=2k=2 case.

We consider a natural strengthening of additive perturbation stability where there is an additional margin between any pair of clusters. This is reminiscent of margin assumptions in supervised learning of halfspaces and spectral clustering guarantees of Kumar and Kannan (see Section 1.2). Consider a kk-means clustering instance XX with optimal solution C1,C2,…,CkC_{1},C_{2},\dots,C_{k}. We say this instance is (ρ,Δ,ε)-separated(\rho,\Delta,\varepsilon)\text{-separated} iff for each i≠j∈[k]i\neq j\in[k], the subinstance induced by Ci,CjC_{i},C_{j} has parameter scale Δ\Delta, and all points in the clusters Ci,CjC_{i},C_{j} lie inside cones of half-angle arctan(1/ε)\text{arctan}(1/\varepsilon), which are separated by a margin of at least ρ\rho. This is implied by the stronger condition that the subinstance induced by Ci,CjC_{i},C_{j} is ε\varepsilon-additive perturbation stable with scale parameter Δ\Delta even when CiC_{i} and CjC_{j} are moved towards each other by ρ\rho. See Figure 1b for an illustration. (ρ,Δ,ε)-separated(\rho,\Delta,\varepsilon)\text{-separated} stable instances are defined formally in geometric terms in Section 3.

There is an O~(n2kd)\widetilde{O}(n^{2}kd)-timeThe O~\widetilde{O} hides logarithmic factors in nn. algorithm that given any instance XX that is (ρ,Δ,ε)-separated(\rho,\Delta,\varepsilon)\text{-separated} with ρ≥Ω(Δ/ε2)\rho\geq\Omega(\Delta/\varepsilon^{2}) recovers its optimal clustering C1,…,CkC_{1},\dots,C_{k}.

A formal statement of the theorem (with unequal sized clusters) and its proof are given in Section 5. We prove these polynomial time guarantees for a new, simple algorithm (Algorithm 5.1). The algorithm constructs a graph with one vertex for each point, and edges between points that are within a distance of at most rr (for an appropriate threshold rr). The algorithm then finds the kk-largest connected components and uses the empirical means of these kk components to cluster all the points.

In addition to having provable guarantees, the algorithm also seems efficient in practice, and performs well on standard clustering datasets. Experiments that we conducted on some standard clustering datasets in UCI suggest that our algorithm manages to almost recover the ground truth and achieves a kk-means objective cost that is very comparable to Lloyd’s algorithm and kk-means++.

In fact, our algorithm can also be used to initialize Lloyd’s algorithm: our guarantees show that when the instance is (ρ,Δ,ε)-separated(\rho,\Delta,\varepsilon)\text{-separated}, one iteration of Lloyd’s algorithm already finds the optimal clustering. Experiments suggest that our algorithm finds initializers of smaller kk-means cost compared to the initializers of kk-means++ and also recover the ground-truth to good accuracy.

Experimental results and analysis of real-world data sets can be found in Section 7.

Perturbation stability requires the optimal solution to remain completely unchanged under any valid perturbation. In practice, the stability of an instance may be dramatically reduced by a few outliers. We show provable guarantees for a slight modification of Algorithm 5.1 in the setting where an η\eta-fraction of the points can be arbitrary outliers, and do not lie in the stable regions. Formally, we assume that we are given an instance X∪ZX\cup Z where there is an (unknown) set of points ZZ with ∣Z∣=η∣X∣|Z|=\eta|X| such that XX is a (ρ,Δ,ε)-separated(\rho,\Delta,\varepsilon)\text{-separated} instance. Here ηn\eta n is assumed to be less than the size of the smallest cluster by a constant factor. This is similar to robust perturbation resilience considered in . Our experiments in Section 7 indicate that the stability or separation can increase a lot after ignoring a few points close to the margin.

In what follows, wmax⁡=max⁡∣Ci∣/nw_{\max}=\max\lvert C_{i}\rvert/n and wmin⁡=min⁡∣Ci∣/nw_{\min}=\min\lvert C_{i}\rvert/n are the maximum and minimum weight of clusters, and η<wmin⁡\eta<w_{\min}.

Given X∪ZX\cup Z where XX is (ρ,Δ,ε)-separated(\rho,\Delta,\varepsilon)\text{-separated} for

and η=∣Z∣/∣X∣<wmin\eta=\lvert Z\rvert/\lvert X\rvert<w_{\text{min}}, there is a polynomial time algorithm running in time O~(n2dk)\widetilde{O}(n^{2}dk) that returns a clustering consistent with C1,…,CkC_{1},\dots,C_{k} on XX.

This robust algorithm is effectively the same as Algorithm 5.1 with one additional step that removes all low-degree vertices in the graph. This step removes bad outliers in ZZ without removing too many points from XX.

2 Comparisons to other related work

Awasthi et al. showed that γ\gamma-multiplicative perturbation stable instance also satisfied the notion of γ\gamma-center based stability (every point is a γ\gamma-factor closer to its center than to any other center) . They showed that an algorithm based on the classic single linkage algorithm works under this weaker notion when γ≥3\gamma\geq 3. This was subsequently improved by , and the best result along these lines gives a polynomial time algorithm that works for γ≥2\gamma\geq 2. A robust version of (γ,η)(\gamma,\eta)-perturbation resilience was explored for center-based clustering objectives . As such, the notions of additive perturbation stability, and (ρ,Δ,ε)-separated(\rho,\Delta,\varepsilon)\text{-separated} instances are incomparable to the various notions of multiplicative perturbation stability. Furhter as argued in , we believe that additive perturbation stability is more realistic for Euclidean clustering problems.

The exciting results of Kumar and Kannan and Awasthi and Sheffet also gave a determinstic margin-separation condition, under which spectral clustering (PCA followed by kk-means) This requires appropriate initializers, that they can obtain in polynomial time. finds the optimum clusters under deterministic conditions about the data. Suppose σ=∥X−C∥op2/n\sigma=\lVert X-C\rVert^{2}_{op}/n is the “spectral radius” of the dataset, where CC is the matrix given by the centers. In the case of equal-sized clusters, the improved results of proves approximate recovery of the optimal clustering if the margin ρ\rho between the clusters along the line joining the centers satisfies ρ=Ω(kσ)\rho=\Omega(\sqrt{k}\sigma). Our notion of margin ρ\rho in (ρ,Δ,ε)-separated(\rho,\Delta,\varepsilon)\text{-separated} instances is analogous to the margin separation notion used by the above results on spectral clustering . In particular, we require a margin of ρ=Ω(Δ/ε2)\rho=\Omega(\Delta/\varepsilon^{2}) where Δ\Delta is our scale parameter, with no extra k\sqrt{k} factor. However, we emphasize that the two margin conditions are incomparable, since the spectral radius σ\sigma is incomparable to the scale parameter Δ\Delta.

We now illustrate the difference between these deterministic conditions by presenting a couple of examples. Consider an instance with nn points drawn from a mixture of kk Gaussians in dd dimensions with identical diagonal covariance matrices with variance 11 in the first O(1)O(1) coordinates and roughly 1/d1/d in the others, and all the means lying in the subspace spanned by these first O(1)O(1) co-ordinates. In this setting, the results of require a margin separation of at least klog⁡n\sqrt{k\log n} between clusters. On the other hand, these instances satisfy our geometric conditions with ε=Ω(1)\varepsilon=\Omega(1), Δ log⁡n\Delta~{}\sqrt{\log n} and therefore our algorithm only needs a margin separation of ρlog⁡n\rho\sqrt{\log n} (hence, saving a factor of k\sqrt{k})Further, while algorithms for learning GMM models may work here, adding some outliers far from the decision boundary will cause many of these algorithms to fail, while our algorithm is robust to such outliers.. However, if the nn points were drawn from a mixture of spherical Gaussians in high dimensions (with d≫kd\gg k), then the margin condition required for is weaker.

Finally, we note another strand of recent works show that convex relaxations for kk-means clustering become integral under distributional assumptions about points and sufficient separation between the components .

Preliminaries

A given choice of centers μ1,…,μk\mu_{1},\dots,\mu_{k} determines an optimal clustering C1,…,CkC_{1},\dots,C_{k} where Ci={ x }i=arg⁡min⁡j∥x−μj∥C_{i}=\set{x}{i=\arg\min_{j}\lVert x-\mu_{j}\rVert}. We can rewrite the objective as

On the other hand, a given choice for cluster CiC_{i} determines its optimal center as μi=1∣Ci∣∑x∈Cix\mu_{i}=\frac{1}{\lvert C_{i}\rvert}\sum_{x\in C_{i}}x, the mean of the points in the set. Thus, we can reformulate the problem as minimizing over clusters C1,C2,…,CkC_{1},C_{2},\dots,C_{k} of { xi }\set{x_{i}} the objective

Stability definitions and geometric properties

We define an instance parameter, β\beta, capturing how balanced a given instance’s clusters are.

Given an instance XX with optimal clustering C1,…,CkC_{1},\dots,C_{k}, we say XX satisfies balance parameter β≥1\beta\geq 1 if for all i≠ji\neq j, β∣Ci∣>∣Cj∣\beta\lvert C_{i}\rvert>\lvert C_{j}\rvert.

2 Additive perturbation stability

Let X={ x1,…,xn }X=\set{x_{1},\dots,x_{n}} be a kk-means clustering instance with unique optimal clustering C1,C2,…,CkC_{1},C_{2},\dots,C_{k} whose means are given by μ1,μ2,…,μk\mu_{1},\mu_{2},\dots,\mu_{k}. Let D=max⁡i,j∥μi−μj∥D=\max_{i,j}\left\lVert\mu_{i}-\mu_{j}\right\rVert. We say that X′={ x1′,…,xn′ }X^{\prime}=\set{x^{\prime}_{1},\dots,x^{\prime}_{n}} is an ε\varepsilon-additive perturbation of XX if for all ii, ∥xi′−xi∥≤εD\left\lVert x^{\prime}_{i}-x_{i}\right\rVert\leq\varepsilon D.

Let XX be a kk-means clustering instance with unique optimal clustering C1,C2,…,CkC_{1},C_{2},\dots,C_{k}. We say that XX is ε\varepsilon-additive perturbation stable (APS) if every ε\varepsilon-additive perturbation of XX has an optimal clustering given by C1,C2,…,CkC_{1},C_{2},\dots,C_{k}.

Intuitively, the difficulty of the clustering task increases as the stability parameter ε\varepsilon decreases. For example, when ε=0\varepsilon=0 the set of ε\varepsilon-APS instances contains any instance with a unique solution. In the following we will only consider ε>0\varepsilon>0.

3 Geometric implication of ε𝜀\varepsilon-APS

Let XX be an ε\varepsilon-APS kk-means clustering instance such that each cluster has at least 44 points. Fix i≠ji\neq j and consider clusters CiC_{i}, CjC_{j} with means μi\mu_{i}, μj\mu_{j}. We fix the following notation.

Let Di,j=∥μi−μj∥D_{i,j}=\left\lVert\mu_{i}-\mu_{j}\right\rVert and let D=max⁡i′,j′∥μi′−μj′∥D=\max_{i^{\prime},j^{\prime}}\left\lVert\mu_{i^{\prime}}-\mu_{j^{\prime}}\right\rVert.

Let p=μi+μj2p=\frac{\mu_{i}+\mu_{j}}{2} be the midpoint between μi\mu_{i} and μj\mu_{j}.

We can establish geometric conditions that XX must satisfy by considering different perturbations. As an example, one could move all points in CiC_{i} and CjC_{j} towards each other in the intermean direction a distance of εD\varepsilon D; by assumption no point has crossed the separating hyperplane and thus we can conclude the existence of a margin of width 2εD2\varepsilon D.

A careful choice of a family of perturbations allows us to prove Proposition 1.1. Consider the perturbation which moves μi\mu_{i} and μj\mu_{j} in opposite directions orthogonal to uu while moving a single point towards the other cluster parallel to uu (see figure 2). The following lemma establishes Proposition 1.1.

For any x∈Ci∪Cjx\in C_{i}\cup C_{j}, ∥(x−p)(V)∥≤1ε(∥(x−p)(u)∥−εDi,j)\lVert(x-p)_{(V)}\rVert\leq\frac{1}{\varepsilon}\left(\lVert(x-p)_{(u)}\rVert-\varepsilon D_{i,j}\right).

Let v∈Vv\in V be a unit vector perpendicular to uu. Without loss of generality, let a∈Cia\in C_{i} (taking uu or −u-u does not change the inequality). Let b,c,d∈Cib,c,d\in C_{i} such that a,b,c,d∈Cia,b,c,d\in C_{i} are distinct. Let δ=εDi,j≤εD\delta=\varepsilon D_{i,j}\leq\varepsilon D and consider the ε\varepsilon-additive perturbation X′X^{\prime} given by the union of

and an unperturbed copy of X∖(Ci∪Cj)X\setminus(C_{i}\cup C_{j}).

By assumption, { Ci,Cj }\set{C_{i},C_{j}} remain optimal clusters in X′X^{\prime}. We have constructed X′X^{\prime} such that the new means of CiC_{i}, CjC_{j} are μi′=μi−δ2v\mu_{i}^{\prime}=\mu_{i}-\frac{\delta}{2}v and μj′=μj+δ2v\mu_{j}^{\prime}=\mu_{j}+\frac{\delta}{2}v, and the midpoint between the means is p′=pp^{\prime}=p. The halfspace containing μi′\mu_{i}^{\prime} given by the linear separator between μi′\mu_{i}^{\prime} and μj′\mu_{j}^{\prime} is ⟨x−p′,μi′−μj′⟩≥0\langle x-p^{\prime},\mu_{i}^{\prime}-\mu_{j}^{\prime}\rangle\geq 0. Hence, as a′a^{\prime} is classified correctly by the ε\varepsilon-APS assumption,

Then noting that ⟨a−p,u⟩≥0\langle a-p,u\rangle\geq 0, we have that ⟨a−p,v⟩≤1ε(∥(a−p)(u)∥−δ)\langle a-p,v\rangle\leq\frac{1}{\varepsilon}\left(\lVert(a-p)_{(u)}\rVert-\delta\right). ∎

This geometric property follows from perturbations which only affect two clusters at a time. Our results follow from this weaker notion.

4 (ρ,Δ,ε)𝜌Δ𝜀(\rho,\Delta,\varepsilon)-separation

Motivated by Lemma 3.4, we define a geometric condition where the angular separation and margin separation are parametrized separately. These separations are implied by a stronger stability assumption where any pair of clusters is ε\varepsilon-APS with scale parameter Δ\Delta even after being moved towards each other a distance of ρ\rho.

We say that a pair of clusters is (ρ,Δ,ε)(\rho,\Delta,\varepsilon)-separated if their points lie in cones with axes along the intermean direction, half-angle arctan⁡(1/ε)\arctan(1/\varepsilon), and apexes at distance Δ\Delta from their means and at least ρ\rho from each other (see figure 1b). Formally, we require the following.

Given a pair of clusters CiC_{i}, CjC_{j} with means μi\mu_{i}, μj\mu_{j}, let u=μi−μj∥μi−μj∥u=\frac{\mu_{i}-\mu_{j}}{\lVert\mu_{i}-\mu_{j}\rVert} be the unit vector in the intermean direction and let p=(μi+μj)/2p=(\mu_{i}+\mu_{j})/2. We say that CiC_{i} and CjC_{j} are (ρ,Δ,ε)(\rho,\Delta,\varepsilon)-separated if Di,j≥ρ+2ΔD_{i,j}\geq\rho+2\Delta and for all x∈Ci∪Cjx\in C_{i}\cup C_{j},

We say that an instance XX is (ρ,Δ,ε)(\rho,\Delta,\varepsilon)-separated if every pair of clusters in the optimal clustering is (ρ,Δ,ε)(\rho,\Delta,\varepsilon)-separated.

k𝑘k-means clustering for k=2𝑘2k=2

In this section, we give an algorithm that is able to cluster 22-means ε\varepsilon-APS instances correctly.

There exists a universal constant c≥1c\geq 1 such that for any fixed ε>0\varepsilon>0, there exists an nO((1/ε)c)dn^{O((1/\varepsilon)^{c})}d time algorithm that correctly clusters all ε\varepsilon-APS 22-means instances.

The algorithm is inspired by work in showing that the perceptron algorithm runs in poly-time with high probability in the smoothed analysis setting.

The following well-known theorem bounds the number of total mistakes the perceptron algorithm can make in terms of the sequence’s angular margin.

The number of mistakes made by the perceptron algorithm is bounded above by (1/γ)2(1/\gamma)^{2} for

2 A perceptron-based clustering algorithm

Lemma 3.4 gives a lower bound for γ\gamma in the correctly-centered set { x1−p,…,xn−p }\set{x_{1}-p,\dots,x_{n}-p}. Thus Lemma 4.3 might suggest a simple algorithm: for each multiset of bounded size and each of its possible labels, compute the cost of the associated clustering, then output the clustering of minimum cost. However, a difficulty arises as the clusters C1C_{1}, C2C_{2} may not be linearly separable (in particular the separating hyperplane may not pass through the origin). Note that the guarantees of the perceptron algorithm, and hence Lemma 4.3, do not hold in this case. Instead, we will apply the above idea to an instance YY, constructed from XX, in which C1C_{1}, C2C_{2} are linearly separable and we can efficiently lower bound γ\gamma.

3 Overview of proof of Theorem 4.1

We will lower bound γ\gamma for a particular instance Ya,bY_{a,b} in which a,ba,b have nice properties. The following lemma states that on one of the iterations of its outer for loop, Algorithm 4.4 will pick such points.

There exist points a∈C1a\in C_{1}, b∈C2b\in C_{2} such that ⟨a−p,u⟩≤Δ/2\langle a-p,u\rangle\leq\Delta/2 and ⟨b−p,−u⟩≤Δ/2\langle b-p,-u\rangle\leq\Delta/2.

The geometric conditions implied by ε\varepsilon-APS allow us to bound δ=∥a−b∥\delta=\lVert a-b\rVert in terms of ε,D\varepsilon,D. In particular, using this handle on δ\delta, it is possible to prove the following lower bound on γ\gamma.

There exists constant c1c_{1} such that for any a,ba,b satisfying Lemma 4.5, the corresponding instance Ya,bY_{a,b} has

The correctness of Algorithm 4.4 for all ε\varepsilon-APS 22-means clustering instances in which each cluster has at least 44 points then follows from Lemmas 4.3, 4.5, and 4.6. On the other hand, the optimal 22-means clustering where one of the clusters has at most 33 points can be calculated in O(n4d)O(n^{4}d) time. An algorithm that returns the better of these two solutions thus correctly clusters all ε\varepsilon-APS 22-means instances, completing the proof of Theorem 4.1. See Appendix A.2 for proofs of Lemmas 4.5 and 4.6.

k𝑘k-means clustering for general k𝑘k

For general kk, we will require the stronger (ρ,Δ,ε)(\rho,\Delta,\varepsilon)-separation. Consider the following algorithm.

Algorithm 5.1 recovers C1,…,CkC_{1},\dots,C_{k} for any (ρ,Δ,ε)-separated(\rho,\Delta,\varepsilon)\text{-separated} instance with ρ=Ω(Δε2+βΔε)\rho=\Omega\left(\frac{\Delta}{\varepsilon^{2}}+\frac{\beta\Delta}{\varepsilon}\right) and can be implemented in O~(n2kd)\widetilde{O}(n^{2}kd) time.

This running time can be achieved by inserting edges into a dynamic graph in order, maintaining connected components and their means using a union-find data structure, and noting that the number of connected components can change at most nn times.

In particular, note that this algorithm does not need any prior knowledge of the stability parameters and its running time has no dependence on ρ\rho, Δ\Delta, or ε\varepsilon.

Si,j(nice)={ x∈Si,j(cone) }⟨x−μi,u⟩≤0S_{i,j}^{(\text{nice})}=\set{x\in S_{i,j}^{(\text{cone})}}{\langle x-\mu_{i},u\rangle\leq 0},

Si(good)=⋂j≠iSi,j(nice)S_{i}^{(\text{good})}=\bigcap_{j\neq i}S_{i,j}^{(\text{nice})}.

It suffices to prove the following two lemmas. Lemma 5.4 states that the initialization returned by the INITIALIZE subroutine satisfies certain properties when we guess r=ρr=\rho correctly. As ρ\rho is only used as a threshold on edge lengths, testing the distances between all pairs of data points i.e. { ∥a−b∥:a,b∈X }\set{\lVert a-b\rVert:a,b\in X} suffices. Lemma 5.5 states that the ASSIGN subroutine correctly clusters all points given an initialization satisfying these properties.

For a (ρ,Δ,ε)-separated(\rho,\Delta,\varepsilon)\text{-separated} instance with balance parameter β\beta and ρ=Ω(βΔ/ε)\rho=\Omega(\beta\Delta/\varepsilon), the INITIALIZE subroutine finds a set { a1,…,ak }\set{a_{1},\dots,a_{k}} where ai∈Si(good)a_{i}\in S_{i}^{(\text{good})} when r=ρr=\rho.

For a (ρ,Δ,ε)-separated(\rho,\Delta,\varepsilon)\text{-separated} instance with ρ=Ω(Δ/ε2)\rho=\Omega(\Delta/\varepsilon^{2}), the ASSIGN subroutine recovers C1,C2,⋯CkC_{1},C_{2},\cdots C_{k} correctly when initialized with kk points { a1,a2,…,ak }\set{a_{1},a_{2},\dots,a_{k}} where ai∈Si(good)a_{i}\in S_{i}^{(\text{good})}.

Suppose r=ρr=\rho and consider the graph constructed by Algorithm 5.1. We start by defining the core region of each cluster.

The core regions are defined in such a way that for each cluster CiC_{i}, all points in Ci∩Si(core)C_{i}\cap S_{i}^{(\text{core})} belong to a single connected component. Although Si(core)S_{i}^{(\text{core})} may not contain too many points on its own, the connected component containing Si(core)S_{i}^{(\text{core})} will contain most (at least β/(1+β)\beta/(1+\beta) fraction) of the points in CiC_{i}. Hence, the kk largest components will be the connected components containing the kk different core regions. Finally, since the connected component containing Si(core)S_{i}^{(\text{core})} contains most of the points in CiC_{i}, the geometric conditions of (ρ,Δ,ε)(\rho,\Delta,\varepsilon)-separation ensure that the empirical mean of the connected component lies in Si(good)S_{i}^{(\text{good})}. The following lemma states some properties of the connected components in our graph. Its proof can be found in Appendix B.1.

Any connected component only contains points from a single cluster.

For all i,ji,j, Si(core)⊇Si,j(nice)S_{i}^{(\text{core})}\supseteq S_{i,j}^{(\text{nice})}. There is a point x∈Cix\in C_{i} such that x∈Si(core)∩Si,j(nice)x\in S_{i}^{(\text{core})}\cap S_{i,j}^{(\text{nice})}.

For all i,ji,j, let Ai,j={ x∈Ci }⟨x−μi,u⟩≤βΔA_{i,j}=\set{x\in C_{i}}{\langle x-\mu_{i},u\rangle\leq\beta\Delta}. Then, ∣Ai,j∣≥β1+β∣Ci∣\lvert A_{i,j}\rvert\geq\frac{\beta}{1+\beta}\lvert C_{i}\rvert.

For all ii, Si(core)∩XS_{i}^{(\text{core})}\cap X is connected in GG.

For all i,ji,j, Ai,jA_{i,j} is connected in GG.

The largest component, KiK_{i}, in each cluster contains Ai,jA_{i,j} for each j≠ij\neq i. In particular, ∣Ki∣≥β1+β∣Ci∣\lvert K_{i}\rvert\geq\frac{\beta}{1+\beta}\lvert C_{i}\rvert, and KiK_{i} contains Si(core)∩XS_{i}^{(\text{core})}\cap X.

Lemma 5.8 states that the kk largest components (and hence { a1,…,ak }\set{a_{1},\dots,a_{k}}) must belong to different clusters while Lemma 5.9 states that each aia_{i} lie inside a good region. Together, they imply Lemma 5.4, i.e. each aia_{i} comes from a different good region.

The set of kk largest components of GG contains the largest component of each cluster.

Let KiK_{i} be the largest component in CiC_{i} and let Kj′K_{j}^{\prime} be a component in CjC_{j} that is not the largest. Then by the β\beta parameter, ∣Ki∣≥β1+β∣Ci∣>11+β∣Cj∣≥∣Kj′∣\lvert K_{i}\rvert\geq\frac{\beta}{1+\beta}\lvert C_{i}\rvert>\frac{1}{1+\beta}\lvert C_{j}\rvert\geq\lvert K_{j}^{\prime}\rvert. It follows that the kk largest connected components are K1,K2,…,KkK_{1},K_{2},\dots,K_{k}. ∎

The mean of points in KiK_{i} lies in Si(good)S_{i}^{(\text{good})}.

Let aia_{i} be the mean of the points in KiK_{i}. As Ki⊆Si,j(cone)K_{i}\subseteq S_{i,j}^{(\text{cone})} is a convex set, ai∈Si,j(cone)a_{i}\in S_{i,j}^{(\text{cone})}. As Ki⊇Si(core)∩X⊇Si,j(nice)∩XK_{i}\supseteq S_{i}^{(\text{core})}\cap X\supseteq S_{i,j}^{(\text{nice})}\cap X, the points x∈Cix\in C_{i} not contained in KiK_{i} have ⟨x−μi,u⟩>0\langle x-\mu_{i},u\rangle>0. Noting that ∑x∈Ci⟨x−μi,u⟩=0\sum_{x\in C_{i}}\langle x-\mu_{i},u\rangle=0, it follows that ⟨ai−μi⟩≤0\langle a_{i}-\mu_{i}\rangle\leq 0. Hence, ai∈Si,j(nice)a_{i}\in S_{i,j}^{(\text{nice})}. As this holds for each j≠ij\neq i, ai∈Si(good)a_{i}\in S_{i}^{(\text{good})}. ∎

2 Proof of Lemma 5.5.

We will show that for any ai∈Si,j(nice)a_{i}\in S_{i,j}^{(\text{nice})}, aj∈Sj,i(nice)a_{j}\in S_{j,i}^{(\text{nice})}, and x∈Cix\in C_{i}, xx is closer to aia_{i} than to aja_{j}. The following lemma states some properties of the perpendicular bisector between aia_{i} and aja_{j}. These statements follow from the definitions of the nice regions and the angular separation. Its proof can be found in Appendix B.2.

Suppose ρ=Ω(Δ/ε2)\rho=\Omega(\Delta/\varepsilon^{2}). Then, for ai∈Si,j(nice)a_{i}\in S_{i,j}^{(\text{nice})} and aj∈Sj,i(nice)a_{j}\in S_{j,i}^{(\text{nice})}, we have

∥(ai−aj)(u)∥≥∥(ai−aj)(V)∥ε\lVert(a_{i}-a_{j})_{(u)}\rVert\geq\frac{\lVert(a_{i}-a_{j})_{(V)}\rVert}{\varepsilon},

⟨ai+aj2−p,u⟩≤Δ2\langle\frac{a_{i}+a_{j}}{2}-p,u\rangle\leq\frac{\Delta}{2}, and

\Big{\lVert}\left(\frac{a_{i}+a_{j}}{2}-p\right)_{(V)}\Big{\rVert}\leq\Delta/\varepsilon.

To prove Lemma 5.5, we rewrite the condition ∥x−ai∥≤∥x−aj∥\lVert x-a_{i}\rVert\leq\lVert x-a_{j}\rVert as ⟨x−p−(12(ai+aj)−p),ai−aj⟩≥0\langle x-p-(\tfrac{1}{2}(a_{i}+a_{j})-p),a_{i}-a_{j}\rangle\geq 0. Then we write each vector in terms of their projection on uu and VV and use the above lemma to bound each of the terms.

It suffices to show that for any ai∈Si,j(nice)a_{i}\in S_{i,j}^{(\text{nice})}, aj∈Sj,i(nice)a_{j}\in S_{j,i}^{(\text{nice})}, and x∈Cix\in C_{i}, ∥x−ai∥≤∥x−aj∥\lVert x-a_{i}\rVert\leq\lVert x-a_{j}\rVert. Then by Lemma 5.10 above,

where the first inequality follows because of equality on the first term and Cauchy-Schwarz on the rest. So, for all ai∈Si,j(nice)a_{i}\in S_{i,j}^{(\text{nice})}, aj∈Sj,i(nice)a_{j}\in S_{j,i}^{(\text{nice})}, and x∈Cix\in C_{i}, xx is closer to aia_{i} than aja_{j}. ∎

Robust k𝑘k-means

A simple extension of algorithm 5.1 does well even in the presence of adversarial noise for instances with (ρ,Δ,ε)(\rho,\Delta,\varepsilon)-separation for large enough ρ\rho. Specifically, we consider the following model.

Let wmax⁡=max⁡∣Ci∣/nw_{\max}=\max\lvert C_{i}\rvert/n and let wmin⁡=min⁡∣Ci∣/nw_{\min}=\min\lvert C_{i}\rvert/n be the maximum and minimum weight of clusters. We will assume that η<wmin⁡\eta<w_{\min}.

Given X∪ZX\cup Z where XX satisfies (ρ,Δ,ε)(\rho,\Delta,\varepsilon)-separation for

∣X∣=n\lvert X\rvert=n and ∣Z∣≤ηn\lvert Z\rvert\leq\eta n for η<wmin⁡\eta<w_{\min}, there exists values of r,tr,t such that Algorithm 6.1 returns a clustering consistent with C1,…,CkC_{1},\dots,C_{k} on XX. Algorithm 6.1 can be implemented in O~(n2kd)\widetilde{O}(n^{2}kd) time.

The proof of this theorem is similar to the proof of Theorem 5.2 and can be found in Appendix C.

Experimental results

We evaluate Algorithm 5.1 on multiple real world datasets and compare its performance to the performance of kk-means++, and also check how well these datasets satisfy our geometric conditions.

Experiments were run on unnormalized and normalized versions of four labeled datasets from the UCI Machine Learning Repository: Wine (n=178n=178, k=3k=3, d=13d=13), Iris (n=150n=150, k=3k=3, d=4d=4), Banknote Authentication (n=1372n=1372, k=2k=2, d=5d=5), and Letter Recognition (n=20,000n=20,000, k=26k=26, d=16d=16). Normalization was used to scale each feature to unit range.

The cost of the solution returned by Algorithm 5.1 for each of the normalized and unnormalized versions of the datasets is recorded in Table 1 column 2. Our guarantees show that under (ρ,Δ,ε)(\rho,\Delta,\varepsilon)-separation for appropriate values of ρ\rho (see section 5), the algorithm will find the optimal clustering after a single iteration of Lloyd’s algorithm. Even when ρ\rho does not satisfy our requirement, we can use our algorithm as an initialization heuristic for Lloyd’s algorithm. We compare our initialization with the kk-means++ initialization heuristic (D2D^{2} weighting). In Table 1, this is compared to the smallest initialization cost of 1000 trials of kk-means++ on each of the datasets, the solution found by Lloyd’s algorithm using our initialization and the smallest kk-means cost of 100 trials of Lloyd’s algorithm using a kk-mean++ initialization.

As the ground truth clusterings in our datasets are not in general linearly separable, we consider the clusters given by Lloyd’s algorithm initialized with the ground truth solutions.

Values of ε\varepsilon for Lemma 3.4. We calculate the maximum value of ε\varepsilon such that every pair of clusters satisfies the angular and margin separations implied by ε\varepsilon-APS (Lemma 3.4). The results are recorded in Table 2. We see that the average value of ε\varepsilon lies approximately in the range (0.01,0.1)(0.01,0.1).

Values of (ρ,Δ,ε)(\rho,\Delta,\varepsilon)-separation. We attempt to measure the values of ρ\rho, Δ\Delta, and ε\varepsilon in the datasets. For η=0.05,0.1\eta=0.05,0.1, ε=0.1,0.01\varepsilon=0.1,0.01, and a pair of clusters CiC_{i}, CjC_{j}, we calculate ρ\rho as the maximum margin separation a pair of axis-aligned cones with half-angle arctan⁡(1/ε)\arctan(1/\varepsilon) can have while capturing a (1−η)(1-\eta)-fraction of all points. For some datasets and values for η\eta and ε\varepsilon, there may not be any such value of ρ\rho, in this case we leave the corresponding entry blank. These results are collected in Table 3.

The clustering returned by our algorithm recovers well (≈97%\approx 97\%) the solution returned by Lloyd’s algorithm initialized with the ground truth for Wine, Iris, and Banknote Authentication across normalized and unnormalized datasets.

Acknowledgments

The authors are grateful to Avrim Blum for numerous helpful discussions regarding the perceptron algorithm.

References

Appendix A k𝑘k-means clustering for k=2𝑘2k=2

Let r=(1/γ)2+1r=(1/\gamma)^{2}+1. Consider the performance of the perceptron algorithm on rr consecutive runs of the y1,…,yny_{1},\dots,y_{n}, i.e., let the input be

A.2 Proof of Lemmas 4.5, 4.6

We state two lemmas that follow immediately from Lemma 3.4 and will be useful for the proofs in this section.

In particular, for x∈C1x\in C_{1}, ⟨x−p,u⟩≥εD\langle x-p,u\rangle\geq\varepsilon D and for x∈C2x\in C_{2}, ⟨x−p,u⟩≤−εD\langle x-p,u\rangle\leq-\varepsilon D.

There exist points a∈C1a\in C_{1}, b∈C2b\in C_{2} such that ⟨a−p,u⟩≤Δ/2\langle a-p,u\rangle\leq\Delta/2 and ⟨b−p,−u⟩≤Δ/2\langle b-p,-u\rangle\leq\Delta/2.

Note that ⟨μ1−p,u⟩=1∣C1∣∑x∈C1⟨x−p,u⟩\langle\mu_{1}-p,u\rangle=\frac{1}{\lvert C_{1}\rvert}\sum_{x\in C_{1}}\langle x-p,u\rangle. As ⟨μ1−p,u⟩=Δ/2\langle\mu_{1}-p,u\rangle=\Delta/2, there must be some a∈C1a\in C_{1} such that { a−p,u }≤Δ/2\set{a-p,u}\leq\Delta/2. The second assertion is proved similarly. ∎

Lemma 4.6

Note that Lemmas A.1 and 4.5 together imply that we cannot have an instance with ε>1/2\varepsilon>1/2.

There is no ε\varepsilon-APS kk-means clustering instance for ε>1/2\varepsilon>1/2.

The following lemma bounds δ=∥a−b∥\delta=\lVert a-b\rVert in terms of ε\varepsilon, DD.

Let a,b∈Xa,b\in X be points satisfying Lemma 4.5. Then,

For the first inequality, ∥a−b∥≥∣⟨u,a−b⟩∣=∣⟨u,a−p⟩−⟨u,b−p⟩∣\left\lVert a-b\right\rVert\geq\lvert\langle u,a-b\rangle\rvert=\lvert\langle u,a-p\rangle-\langle u,b-p\rangle\rvert. Then by Lemma A.1, ∥a−b∥≥2εD\lVert a-b\rVert\geq 2\varepsilon D.

For the second inequality, ∥a−b∥≤∥a−p∥+∥p−b∥\left\lVert a-b\right\rVert\leq\left\lVert a-p\right\rVert+\left\lVert p-b\right\rVert. By assumption, ⟨a−p,u⟩≤Δ/2\langle a-p,u\rangle\leq\Delta/2. Then by Lemma A.2, ∥a−p∥≤(1+ε2)/ε2D/2\left\lVert a-p\right\rVert\leq\sqrt{(1+\varepsilon^{2})/\varepsilon^{2}}D/2. Similarly, ∥b−p∥≤(1+ε2)/ε2D/2\left\lVert b-p\right\rVert\leq\sqrt{(1+\varepsilon^{2})/\varepsilon^{2}}D/2. ∎

Finally, we restate and prove Lemma 4.6 below.

There exists constant c1c_{1} such that for any a,ba,b satisfying Lemma A.2, the corresponding instance Ya,bY_{a,b} has

We bound each term in the minimization individually. Let i∈[n]i\in[n], then

From Lemma A.2, ∣⟨xi−p,u⟩∣≥ε21+ε2∥xi−p∥≥ε1+ε∥xi−p∥\lvert\langle x_{i}-p,u\rangle\rvert\geq\sqrt{\frac{\varepsilon^{2}}{1+\varepsilon^{2}}}\left\lVert x_{i}-p\right\rVert\geq\frac{\varepsilon}{1+\varepsilon}\left\lVert x_{i}-p\right\rVert

By Lemma A.2, ∥xi∥2≤2∥xi−p∥2+2∥p∥2≤2∥xi−p∥2+121+ε2ε2D2\left\lVert x_{i}\right\rVert^{2}\leq 2\left\lVert x_{i}-p\right\rVert^{2}+2\left\lVert p\right\rVert^{2}\leq 2\left\lVert x_{i}-p\right\rVert^{2}+\frac{1}{2}\frac{1+\varepsilon^{2}}{\varepsilon^{2}}{D^{2}}

From Lemma A.4, δ2≤1+ε2ε2D2\delta^{2}\leq\frac{1+\varepsilon^{2}}{\varepsilon^{2}}D^{2}

As pp and the origin both lie on the line between μ1\mu_{1} and μ2\mu_{2}, ∣⟨p,u⟩∣≤D2≤δ4ε\lvert\langle p,u\rangle\rvert\leq\frac{D}{2}\leq\frac{\delta}{4\varepsilon}

From Lemma A.1, ∥xi−p∥≥εD\left\lVert x_{i}-p\right\rVert\geq\varepsilon D

As ε≤1/2\varepsilon\leq 1/2 by Lemma A.3, we can bound the fraction below by some constant c1≈0.563c_{1}\approx 0.563. ∎

Appendix B k𝑘k-means clustering for general k𝑘k

Any connected component only contains points from a single cluster.

For all i,ji,j, Si(core)⊇Si,j(nice)S_{i}^{(\text{core})}\supseteq S_{i,j}^{(\text{nice})}. There is a point x∈Cix\in C_{i} such that x∈Si(core)∩Si,j(nice)x\in S_{i}^{(\text{core})}\cap S_{i,j}^{(\text{nice})}.

For all i,ji,j, let Ai,j={ x∈Ci }⟨x−μi,u⟩≤βΔA_{i,j}=\set{x\in C_{i}}{\langle x-\mu_{i},u\rangle\leq\beta\Delta}. Then, ∣Ai,j∣≥β1+β∣Ci∣\lvert A_{i,j}\rvert\geq\frac{\beta}{1+\beta}\lvert C_{i}\rvert.

For all ii, Si(core)∩XS_{i}^{(\text{core})}\cap X is connected in GG.

For all i,ji,j, Ai,jA_{i,j} is connected in GG.

The largest component, KiK_{i}, in each cluster contains Ai,jA_{i,j} for each j≠ij\neq i. In particular, ∣Ki∣≥β1+β∣Ci∣\lvert K_{i}\rvert\geq\frac{\beta}{1+\beta}\lvert C_{i}\rvert, and KiK_{i} contains Si(core)∩XS_{i}^{(\text{core})}\cap X.

Let x∈Cix\in C_{i} and y∈Cjy\in C_{j}. Then ∥x−y∥≥∣⟨x−y,u⟩∣≥ρ\lVert x-y\rVert\geq\lvert\langle x-y,u\rangle\rvert\geq\rho, thus no edge connecting points in different clusters is added to GG.

For x∈Si,j(nice)x\in S_{i,j}^{(\text{nice})}, ∥(x−μi)(V)∥≤1ε(Δ−∥(x−μi)(u)∥)\lVert(x-\mu_{i})_{(V)}\rVert\leq\frac{1}{\varepsilon}(\Delta-\lVert(x-\mu_{i})_{(u)}\rVert), hence ∥x−μi∥≤Δ/ε\lVert x-\mu_{i}\rVert\leq\Delta/\varepsilon. Recall μi\mu_{i} is the mean of the points in cluster CiC_{i}. By an averaging argument, Si,j(nice)∩X={ x∈Ci }⟨x−(μi−Δu),u⟩≤ΔS_{i,j}^{(\text{nice})}\cap X=\set{x\in C_{i}}{\langle x-(\mu_{i}-\Delta u),u\rangle\leq\Delta} is nonempty and hence Si(core)∩Si,j(nice)S_{i}^{(\text{core})}\cap S_{i,j}^{(\text{nice})} is nonempty.

μi\mu_{i} is the mean of the points in cluster CiC_{i}. By an averaging argument, ∣Ai,j∣Δ−(∣Ci∣−∣Ai,j∣)βΔ≥0\lvert A_{i,j}\rvert\Delta-(\lvert C_{i}\rvert-\lvert A_{i,j}\rvert)\beta\Delta\geq 0. Rearranging, ∣Ai,j∣≥β1+β∣Ci∣\lvert A_{i,j}\rvert\geq\frac{\beta}{1+\beta}\lvert C_{i}\rvert.

For x,y∈Si(core)x,y\in S_{i}^{(\text{core})}, ∥x−y∥≤2Δ/ε\lVert x-y\rVert\leq 2\Delta/\varepsilon. Thus for ρ=Ω(Δ/ε)\rho=\Omega(\Delta/\varepsilon), the points Si(core)∩XS_{i}^{(\text{core})}\cap X are connected.

From 2 above, Si,j(nice)∩XS_{i,j}^{(\text{nice})}\cap X is nonempty; fix such a point xx. For y∈Ai,jy\in A_{i,j}, ∥x−y∥2=∥(x−y)(u)∥2+∥(x−y)(V)∥2≤((β+1)Δ)2+((β+1)Δ/ε)2\lVert x-y\rVert^{2}=\lVert(x-y)_{(u)}\rVert^{2}+\lVert(x-y)_{(V)}\rVert^{2}\leq\left((\beta+1)\Delta\right)^{2}+\left((\beta+1)\Delta/\varepsilon\right)^{2}. Thus for ρ=Ω(βΔ/ε)\rho=\Omega(\beta\Delta/\varepsilon), all of Ai,jA_{i,j} is connected through xx.

Let KiK_{i} be the component containing Si(core)∩XS_{i}^{(\text{core})}\cap X. By 2 above, for all jj there exists a point x(j)∈Si(core)x_{(j)}\in S_{i}^{(\text{core})} such that x(j)∈Si,j(nice)⊆Ai,jx_{(j)}\in S_{i,j}^{(\text{nice})}\subseteq A_{i,j}. Then as Ai,jA_{i,j} is connected, KiK_{i} must also contain Ai,jA_{i,j}. As ∣Ki∣≥∣A∣\lvert K_{i}\rvert\geq\lvert A\rvert and β≥1\beta\geq 1, part 3 above tells us that KiK_{i} is the largest connected component in CiC_{i}.

B.2 Proof of Lemma 5.10

Suppose ρ=Ω(Δ/ε2)\rho=\Omega(\Delta/\varepsilon^{2}). Then, for ai∈Si,j(nice)a_{i}\in S_{i,j}^{(\text{nice})} and aj∈Sj,i(nice)a_{j}\in S_{j,i}^{(\text{nice})}, we have

∥(ai−aj)(u)∥≥∥(ai−aj)(V)∥ε\lVert(a_{i}-a_{j})_{(u)}\rVert\geq\frac{\lVert(a_{i}-a_{j})_{(V)}\rVert}{\varepsilon},

⟨ai+aj2−p,u⟩≤Δ2\langle\frac{a_{i}+a_{j}}{2}-p,u\rangle\leq\frac{\Delta}{2}, and

\Big{\lVert}\left(\frac{a_{i}+a_{j}}{2}-p\right)_{(V)}\Big{\rVert}\leq\Delta/\varepsilon.

We have ∥(ai−aj)(V)∥≤2Δ/ε\lVert(a_{i}-a_{j})_{(V)}\rVert\leq 2\Delta/\varepsilon. On the other hand, ρ≤∥(ai−aj)(u)∥\rho\leq\lVert(a_{i}-a_{j})_{(u)}\rVert. Thus the inequality holds for ρ≥2Δ/ε2\rho\geq 2\Delta/\varepsilon^{2}.

⟨ai+aj−2p,u⟩=⟨ai−p,u⟩+⟨aj−p,u⟩≤Di,j/2+(−Di,j/2+Δ)=Δ\langle a_{i}+a_{j}-2p,u\rangle=\langle a_{i}-p,u\rangle+\langle a_{j}-p,u\rangle\leq D_{i,j}/2+(-D_{i,j}/2+\Delta)=\Delta. Multiplying by 1/21/2 gives the desired inequality.

∥(ai+aj−2p)(V)∥≤∥(ai−p)(V)∥+∥(aj−p)(V)∥≤2Δ/ε\lVert(a_{i}+a_{j}-2p)_{(V)}\rVert\leq\lVert(a_{i}-p)_{(V)}\rVert+\lVert(a_{j}-p)_{(V)}\rVert\leq 2\Delta/\varepsilon. Multiplying by 1/21/2 gives the desired inequality.

Appendix C Robust k𝑘k-means

For completeness, we restate Algorithm 6.1 and Theorem 6.2.

Given X∪ZX\cup Z where XX satisfies (ρ,Δ,ε)(\rho,\Delta,\varepsilon)-separation for

∣X∣=n\lvert X\rvert=n, and ∣Z∣≤ηn\lvert Z\rvert\leq\eta n for η<wmin⁡\eta<w_{\min}, there exists values of r,tr,t such that Algorithm 6.1 returns a clustering consistent with C1,…,CkC_{1},\dots,C_{k} on XX. Algorithm 6.1 can be implemented in O~(n2kd)\widetilde{O}(n^{2}kd) time.

Define the following extended and robust versions of the regions defined in Section 5. Given i,ji,j, let Ci,CjC_{i},C_{j} be the corresponding clusters with means μi,μj\mu_{i},\mu_{j}. Let u=μi−μj∥μi−μj∥u=\frac{\mu_{i}-\mu_{j}}{\lVert\mu_{i}-\mu_{j}\rVert} be the unit vector in the inter-mean direction.

Si,j(e nice)={ x∈Si,j(cone) }⟨x−μi,u⟩≤αΔS_{i,j}^{(\text{e nice})}=\set{x\in S_{i,j}^{(\text{cone})}}{\langle x-\mu_{i},u\rangle\leq\alpha\Delta},

Si(r good)=⋂j≠iSi,j(r e nice)S_{i}^{(\text{r good})}=\bigcap_{j\neq i}S_{i,j}^{(\text{r e nice})}.

Again, it suffices to prove the following two lemmas. Lemma C.2 states that the initialization returned by the INITIALIZE subroutine satisfies certain properties when given r,tr,t. As in the case of Algorithm 5.1, this algorithm uses rr and tt as thresholds. Hence, it is possible to guess rr from the (n2)\binom{n}{2} pairwise edge lengths and tt from [n][n] if necessary. Lemma C.3 states that the ASSIGN subroutine correctly clusters all points given an initialization satisfying these properties.

Given X∪ZX\cup Z where XX is a (ρ,Δ,ε)-separated(\rho,\Delta,\varepsilon)\text{-separated} instance with ρ=Ω(αΔ/ε2)\rho=\Omega(\alpha\Delta/\varepsilon^{2}) and η<wmin⁡\eta<w_{\min}, for the choices of rr and tt as above, the INITIALIZE subroutine finds a set { a1,…,ak }\set{a_{1},\dots,a_{k}} where ai∈Si(r good)a_{i}\in S_{i}^{(\text{r good})}

Given X∪ZX\cup Z where XX is a (ρ,Δ,ε)-separated(\rho,\Delta,\varepsilon)\text{-separated} instance with ρ=Ω(αΔ/ε2)\rho=\Omega(\alpha\Delta/\varepsilon^{2}) and η<wmin⁡\eta<w_{\min}, the ASSIGN subroutine finds a clustering consistent with C1,…,CkC_{1},\dots,C_{k} on XX when initialized with kk points { a1,…,ak }\set{a_{1},\dots,a_{k}} where ai∈Si(r good)a_{i}\in S_{i}^{(\text{r good})}.

Consider the graph constructed by Algorithm 6.1. The following lemma states some properties of the connected components in our graph.

For any i≠ji\neq j, the set of vertices Si,j(e nice)∩XS_{i,j}^{(\text{e nice})}\cap X forms a clique and the size of this clique is greater than tt. In particular, no vertex in Si,j(e nice)S_{i,j}^{(\text{e nice})} is deleted.

Fix ii. For all j≠ij\neq i, the vertices Si,j(e nice)∩XS_{i,j}^{(\text{e nice})}\cap X belong to a single connected component. Let KiK_{i} be this connected component.

Before vertex deletion (and after), no vertex is adjacent to pure points from different clusters.

After vertex deletion, every remaining point lies in Si(r good)S_{i}^{(\text{r good})} for some ii. Hence by part 2, every connected component contains pure points from at most a single cluster. In particular, K1,…,KkK_{1},\dots,K_{k} are distinct.

The diameter of Si,j(e nice)S_{i,j}^{(\text{e nice})} is diam⁡(Si,j(e nice))≤(α+1)2Δ/ε<r\operatorname{diam}(S_{i,j}^{(\text{e nice})})\leq(\alpha+1)2\Delta/\varepsilon<r. Thus every pair of points in this region is connected. Recall that μi\mu_{i} is the mean of the pure points in cluster CiC_{i}. By an averaging argument, ∣Si,j(e nice)∩X∣Δ−(∣Ci∣−∣Si,j(e nice)∩X∣)αΔ≥0\lvert S_{i,j}^{(\text{e nice})}\cap X\rvert\Delta-(\lvert C_{i}\rvert-\lvert S_{i,j}^{(\text{e nice})}\cap X\rvert)\alpha\Delta\geq 0. Rearranging, ∣Si,j(e nice)∩X∣≥αα+1∣Ci∣≥αα+1nwmin⁡=t\lvert S_{i,j}^{(\text{e nice})}\cap X\rvert\geq\frac{\alpha}{\alpha+1}\lvert C_{i}\rvert\geq\frac{\alpha}{\alpha+1}nw_{\min}=t.

Fix ii. Let j≠ij\neq i. Recall Si,j(nice)∩XS_{i,j}^{(\text{nice})}\cap X is nonempty; let x∈Si,j(nice)∩Xx\in S_{i,j}^{(\text{nice})}\cap X. Then ∥x−μi∥≤Δ/ε\lVert x-\mu_{i}\rVert\leq\Delta/\varepsilon. We show that for any j′≠ij^{\prime}\neq i, the connected component containing xx contains Si,j′(e nice)∩XS_{i,j^{\prime}}^{(\text{e nice})}\cap X. Let y∈Si,j′(e nice)∩Xy\in S_{i,j^{\prime}}^{(\text{e nice})}\cap X. Then ∥y−x∥≤∥y−μi∥+∥x−μi∥≤(α+1)Δ/ε+αΔ+Δ/ε<Δ(α+1)(1+2/ε)=r\lVert y-x\rVert\leq\lVert y-\mu_{i}\rVert+\lVert x-\mu_{i}\rVert\leq(\alpha+1)\Delta/\varepsilon+\alpha\Delta+\Delta/\varepsilon<\Delta(\alpha+1)(1+2/\varepsilon)=r.

Pure points in different clusters are at distance at least ρ\rho whereas two vertices sharing a neighbor must be at distance less than 2r2r. Thus the inequality holds for ρ≥Ω(αΔ/ε)\rho\geq\Omega(\alpha\Delta/\varepsilon).

Let xx be a point not in ⋃iSi(r good)\bigcup_{i}S_{i}^{(\text{r good})}. By part 3 above, xx can only be connected to pure points in a single cluster. Suppose it is connected to pure points in cluster CiC_{i}. By assumption, there exists a jj such that x∉Si,j(r e nice)x\notin S_{i,j}^{(\text{r e nice})}. We bound the degree of xx above by the number of points in X∖Si,j(e nice)X\setminus S_{i,j}^{(\text{e nice})} and the ηn\eta n-many impure points, i.e., deg⁡(x)≤ηn+∣Ci∣α+1≤n(η+wmax⁡α+1)\deg(x)\leq\eta n+\frac{\lvert C_{i}\rvert}{\alpha+1}\leq n(\eta+\frac{w_{\max}}{\alpha+1}). By our choice of tt, we have that deg⁡(x)<t\deg(x)<t. Thus xx is deleted and all remaining points lie in ⋃iSi(r good)\bigcup_{i}S_{i}^{(\text{r good})}.

For any i,ji,j, the minimum distance between Si(r good)S_{i}^{(\text{r good})} and Sj(r good)S_{j}^{(\text{r good})} is at least ρ−2r\rho-2r. For some ρ≥Ω(αΔ/ε)\rho\geq\Omega(\alpha\Delta/\varepsilon) then, the distance between these regions is greater than ρ−2r>r\rho-2r>r and no connected component contains pure points from multiple clusters.

Lemma C.5 state that the kk largest components contain pure points corresponding to different clusters while Lemma C.6 states that each aia_{i} lies inside a robust good region. Together, they imply Lemma C.2, i.e. each aia_{i} lies in a different robust good region.

Let KiK_{i} be defined as above. For any arbitrary connected component KK not in K1,…,KkK_{1},\dots,K_{k}, ∣Ki∣>∣K∣\lvert K_{i}\rvert>\lvert K\rvert. In particular, the kk largest components of GG are K1,…,KkK_{1},\dots,K_{k}.

As in part 2 above, the size of KiK_{i} is bounded below by the averaging argument ∣Ki∣≥αα+1∣Ci∣\lvert K_{i}\rvert\geq\frac{\alpha}{\alpha+1}\lvert C_{i}\rvert. By part 3 above, KK contains pure points from at most a single cluster CjC_{j}. By part 5 above, the size of the connected component KK is bounded above by the number of remaining points after KjK_{j} is removed and the ηn\eta n-many impure points, i.e., ∣Cj∣≤1α+1∣Cj∣+ηn\lvert C_{j}\rvert\leq\frac{1}{\alpha+1}\lvert C_{j}\rvert+\eta n. Then by our choice of α\alpha, ∣K∣<∣Ki∣\lvert K\rvert<\lvert K_{i}\rvert. ∎

The mean of KiK_{i} lies in Si(r good)S_{i}^{(\text{r good})}.

By above, Ki⊆Si(r good)K_{i}\subseteq S_{i}^{(\text{r good})}. As Si(r good)S_{i}^{(\text{r good})} is convex, the mean of KiK_{i} also lies in Si(r good)S_{i}^{(\text{r good})}. ∎

C.2 Proof of Lemma C.3

We will show that for any ai∈Si,j(r e nice)a_{i}\in S_{i,j}^{(\text{r e nice})}, aj∈Sj,i(r e nice)a_{j}\in S_{j,i}^{(\text{r e nice})} and x∈Cix\in C_{i}, xx is closer to aia_{i} than aja_{j}. The following lemma states some properties of the perpendicular bisector between aia_{i} and aja_{j}.

Suppose ρ=Ω(αΔ/ε2)\rho=\Omega(\alpha\Delta/\varepsilon^{2}). Then, for ai∈Si,j(r e nice)a_{i}\in S_{i,j}^{(\text{r e nice})} and aj∈Sj,i(r e nice)a_{j}\in S_{j,i}^{(\text{r e nice})}, we have

∥(ai−aj)(u)∥≥∥(ai−aj)(V)∥ε\lVert(a_{i}-a_{j})_{(u)}\rVert\geq\frac{\lVert(a_{i}-a_{j})_{(V)}\rVert}{\varepsilon},

⟨ai+aj2−p,u⟩≤(α+1)Δ/2+r\langle\frac{a_{i}+a_{j}}{2}-p,u\rangle\leq(\alpha+1)\Delta/2+r,

\Big{\lVert}\left(\frac{a_{i}+a_{j}}{2}-p\right)_{(V)}\Big{\rVert}\leq(\alpha+1)\Delta/\varepsilon+r.

By triangle inequality, ∥(ai−aj)(V)∥≤2((α+1)Δ/ε+r)\lVert(a_{i}-a_{j})_{(V)}\rVert\leq 2((\alpha+1)\Delta/\varepsilon+r). On the other hand, ∥(ai−aj)(u)∥≥ρ−2r\lVert(a_{i}-a_{j})_{(u)}\rVert\geq\rho-2r. Thus the inequality holds for ρ≥2r+2ε((α+1)Δ/ε+r)\rho\geq 2r+\frac{2}{\varepsilon}((\alpha+1)\Delta/\varepsilon+r).

⟨ai+aj−2p,u⟩=⟨ai−p,u⟩+⟨aj−p,u⟩≤(Di,j/2+αΔ+r)+(−Di,j/2+Δ+r)=(α+1)Δ+2r\langle a_{i}+a_{j}-2p,u\rangle=\langle a_{i}-p,u\rangle+\langle a_{j}-p,u\rangle\leq(D_{i,j}/2+\alpha\Delta+r)+(-D_{i,j}/2+\Delta+r)=(\alpha+1)\Delta+2r. Multiplying by 1/21/2 gives the desired inequality.

∥(ai+aj−2p)(V)∥≤∥(ai−p)(V)∥+∥(aj−p)(V)∥≤2((α+1)Δ/ε+r)\lVert(a_{i}+a_{j}-2p)_{(V)}\rVert\leq\lVert(a_{i}-p)_{(V)}\rVert+\lVert(a_{j}-p)_{(V)}\rVert\leq 2((\alpha+1)\Delta/\varepsilon+r). Multiplying by 1/21/2 gives the desired inequality.

To prove Lemma C.3, we rewrite the condition ∥x−ai∥≤∥x−aj∥\lVert x-a_{i}\rVert\leq\lVert x-a_{j}\rVert as ⟨(x−p)−(12(ai+aj)−p),ai−aj⟩≥0\langle(x-p)-(\tfrac{1}{2}(a_{i}+a_{j})-p),a_{i}-a_{j}\rangle\geq 0. Then we write each vector in terms of their projection on uu and VV and use the above lemma to bound each of the terms.

It suffices to show that for any ai∈Si,j(r e nice)a_{i}\in S_{i,j}^{(\text{r e nice})}, aj∈Sj,i(r e nice)a_{j}\in S_{j,i}^{(\text{r e nice})} and x∈Cix\in C_{i}, ∥x−ai∥≤∥x−aj∥\lVert x-a_{i}\rVert\leq\lVert x-a_{j}\rVert. Then by Lemma C.7 above,

where the inequality follows because of equality on the first term and Cauchy-Schwarz on the rest. So, when ρ=Ω(αΔ/ε2)\rho=\Omega(\alpha\Delta/\varepsilon^{2}), for all ai∈Si,j(r e nice)a_{i}\in S_{i,j}^{(\text{r e nice})}, aj∈Sj,i(r e nice)a_{j}\in S_{j,i}^{(\text{r e nice})}, and x∈Cix\in C_{i}, xx is closer to aia_{i} than aja_{j}. ∎