Clustering under Perturbation Resilience

Maria Florina Balcan, Yingyu Liang

Introduction

Problems of clustering data from pairwise distance information are ubiquitous in science. A common approach for solving such problems is to view the data points as nodes in a weighted graph (with the weights based on the given pairwise information), and then to design algorithms to optimize various objective functions such as kk-median or min-sum. For example, in the kk-median clustering problem the goal is to partition the data into kk clusters CiC_{i}, giving each a center cic_{i}, in order to minimize the sum of the distances of all data points to the centers of their cluster. In the min-sum clustering approach the goal is to find kk clusters CiC_{i} that minimize the sum of all intra-cluster pairwise distances. Yet unfortunately, for most natural clustering objectives, finding the optimal solution to the objective function is NP-hard. As a consequence, there has been substantial work on approximation algorithms with both upper and lower bounds on the approximability of these objective functions on worst case instances.

Recently, Bilu and Linial suggested an exciting, alternative approach aimed at understanding the complexity of clustering instances which arise in practice. Motivated by the fact that distances between data points in clustering instances are often based on a heuristic measure, they argue that interesting instances should be resilient to small perturbations in these distances. In particular, if small perturbations can cause the optimum clustering for a given objective to change drastically, then that probably is not a meaningful objective to be optimizing. Bilu and Linial specifically define an instance to be α\alpha-perturbation resilientBilu and Linial refer to such instances as perturbation stable instances. for an objective Φ\Phi if perturbing pairwise distances by multiplicative factors in the range [1,α][1,\alpha] does not change the optimum clustering under Φ\Phi. They consider in detail the case of Max-Cut clustering and give an efficient algorithm to recover the optimum when the instance is resilient to perturbations on the order of α>min⁡{n/2,nΔ}\alpha>\min\{n/2,\sqrt{n\Delta}\} where Δ\Delta is the maximal degree of the graph. They also give an efficient algorithm for unweighted Max-Cut instances that are resilient to perturbations on the order of α≥4n/δ\alpha\geq 4n/\delta where δ\delta is the minimal degree of the graph.

Two important questions raised by the work of Bilu and Linial are: (1) the degree of resilience needed for their algorithm to succeed is quite high: can one develop algorithms for important clustering objectives that require much less resilience? (2) the resilience definition requires the optimum solution to remain exactly the same after perturbation: can one succeed under weaker conditions? In the context of center-based clustering objectives such as kk-median and kk-center, Awasthi et al. partially address the first of these questions and show that an algorithm based on the single-linkage heuristic can be used find the optimal clustering for α\alpha-perturbation-resilient instances for α=3\alpha=3. They also conjecture it to be NP-hard to beat 33 and prove beating 33 is NP-hard for a related but weaker notion (see the α\alpha-center proximity property in Definition 5).

In this work, we address both questions raised by and additionally improve over . First, for the center-based objectives we design a polynomial time algorithm for finding the optimum solution for instances resilient to perturbations of value α=1+2\alpha=1+\sqrt{2}, thus beating the previously best known factor of 33 of Awasthi et al . Second, for kk-median (which is a specific center-based objective), we consider a weaker, relaxed, and more realistic notion of perturbation-resilience where we allow the optimal clustering of the perturbed instance to differ from the optimal of the original in a small ϵ\epsilon fraction of the points. Compared to the original perturbation resilience assumption, this is arguably a more natural though also more difficult condition to deal with. We give positive results for this case as well, showing for somewhat larger values of α\alpha that we can still achieve a near-optimal clustering on the given instance (see Section 1.1 below for precise results). We additionally give positive results for min-sum clustering which is typically a harder objective than center-based objectives from approximability standpoint. For example, the best known guarantee for min-sum clustering on worst-case instances is an O(υ−1log⁡1+υn)O(\upsilon^{-1}\log^{1+\upsilon}n)-approximation algorithm that runs in time nO(1/υ)n^{O(1/\upsilon)} for any υ>0\upsilon>0 due to Bartal et al. ; by contrast, the best guarantee known for kk-median is factor 1+3+ϵ1+\sqrt{3}+\epsilon for any ϵ>0\epsilon>0.

Our results are achieved by carefully deriving structural properties of perturbation resilience. At a high level, all the algorithms we introduce work by first running appropriate linkage procedures to produce a hierarchical clustering, and then running dynamic programming to retrieve the best kk-clustering present in the tree. To ensure that (under perturbation resilient instances) the hierarchy output in the first step has a pruning of low cost, we derive new linkage procedures (closure linkage and robust average linkage) which are of independent interest. While the overall analysis is quite involved, the clustering algorithms we devise are simple and robust. This simplicity and robustness allow us to show how our algorithms can be made sublinear-time by returning an implicit clustering from only a small random sample of the input.

From a learning theory perspective, the resilience parameter, α\alpha, can also be seen as an analog to a margin for clustering. In supervised learning, the margin of a data point is the distance, after scaling, between the data point and the decision boundary of its classifier, and many algorithms have stronger guarantees when the smallest margin over the entire data set is sufficiently large . The α\alpha parameter, similarly controls the magnitude of the perturbation the data can withstand before being clustered differently, which is, in essence, the data’s distance to the decision boundary for the given clustering objective. Hence, perturbation resilience is also a natural and interesting assumption to study from a learning theory perspective.

In this paper, we advance the line of work of by solving several important problems of clustering perturbation-resilient instances under metric center-based and min-sum objectives.

In Section 3 we improve on the bounds of for α\alpha-perturbation resilient instances for center-based objectives, giving an algorithm that efficientlyFor clarity, in this paper efficient means polynomial in both nn (the number of points) and kk (the number of clusters). finds the optimum clustering for α=1+2\alpha=1+\sqrt{2}. Most of the frequently used center-based objectives, such as kk-median, are NP-hard to even approximate, yet we can recover the exact solution for perturbation resilient instances. Our algorithm is based on a new linkage procedure using a new notion of distance (closure distance) between sets that may be of independent interest.

In Section 4 we consider the more challenging and more general notion of (α,ϵ)(\alpha,\epsilon)-perturbation resilience for kk-median, where we allow the optimal solution after perturbation to be ϵ\epsilon-close to the original. We provide an efficient algorithm which for α>2+3\alpha>2+\sqrt{3} produces (1+O(ϵ/ρ))(1+O(\epsilon/\rho))-approximation to the optimum, where ρ\rho is the fraction of the points in the smallest cluster. The key structural property we derive and exploit is that, except for ϵn\epsilon n bad points, most points are α\alpha times closer to their own center than to any other center. To eliminate the noise introduced by the bad points, we carefully partition the points into a list of sufficiently large blobs, each of which contains only good points from one optimal cluster. This then allows us to construct a tree on the blobs with a low-cost pruning that is a good approximation to the optimum.

In Section 5 we provide the first efficient algorithm for optimally clustering α\alpha-perturbation resilient min-sum instances. We show that when α\alpha in the order of the ratio between the sizes of the largest and smallest clusters, there exists an algorithm that can output the optimal clustering in polynomial time. Our algorithm is based on an appropriate modification of average linkage that exploits the structure of min-sum perturbation resilient instances.

We also provide sublinear-time algorithms both for the kk-median and min-sum objectives (Sections 4.3 and 5.1), showing algorithms that can return an implicit clustering from only access to a small random sample.

Several recent papers have showed how to exploit the structure of perturbation resilient instances in order to obtain better approximation guarantees (than those possible on worst case instances) for other difficult optimization problems. These include the game theoretic problem of finding Nash equilibria and the classic traveling salesman problem .

In the context of objective based clustering, several recent papers have showed how to exploit other notions of stability for overcoming the existing hardness results on worst case instances. The ORSS stability notion of Ostrovsky, Rabani, Schulman and Swamy assumes that the cost of the optimal kk-means solution is small compared to the cost of the optimal (k−1)(k-1)-means solution. The BBG (c,ϵ)(c,\epsilon)-approximation stability condition of Balcan, Blum and Gupta assumes that every cc-approximation solution is close to the target clustering. We note that when the target clustering is the optimal clustering for the clustering objective, (c,ϵ)(c,\epsilon)-approximation stability implies (c,ϵ)(c,\epsilon)-perturbation resilience.

Awasthi, Sheffet and Blum proposed a stability condition called weak-deletion stability, and showed that it is implied by both the ORSS stability and the BBG stability. Kumar and Kannan proposed a proximity condition which assumes that in the target clustering, most data points satisfy that they are closer to their center than to any other center by an additive factor in the order of the maximal standard variance of their clusters in any direction. Their results are improved by Awasthi and Sheffet , which proposed a weaker version of the proximity condition called center separation, and designed algorithms achieving stronger guarantees under this weaker condition. These notions are not directly comparable to the perturbation resilience property.

Notation and Preliminaries

Note that in the definition, d′d^{\prime} need not be a metric. Also note that the definition depends on the objective. In this paper, we focus on the center-based and min-sum objectives. For the center-based objectives, we consider separable center-based objectives defined by .

A clustering objective is center-based if the optimal solution can be defined by kk points c1,⋯ ,ckc_{1},\cdots,c_{k} in the metric space called centers such that every data point is assigned to its nearest center. Such a clustering objective is separable if it furthermore satisfies the following two conditions:

The objective function value of a given clustering is either a (weighted) sum or the maximum of the individual cluster scores.

Given a proposed single cluster, its score can be computed in polynomial time.

One particular center-based objective is the kk-median objective. We partition SS into kk disjoint subsets P={P1,P2,…,Pk}\mathcal{P}=\{P_{1},P_{2},\dots,P_{k}\} and assign a set of centers p={p1,p2,…,pk}⊆S\mathbf{p}=\{p_{1},p_{2},\dots,p_{k}\}\subseteq S for the subsets. The objective is Φ(P,p)=∑i=1k∑p∈Pid(p,pi)\Phi(\mathcal{P},\mathbf{p})=\sum_{i=1}^{k}\sum_{p\in P_{i}}d(p,p_{i}). The centers in the optimal clustering are denoted as c={c1,…,ck}\mathbf{c}=\{c_{1},\dots,c_{k}\}. Clearly, in an optimal solution, each point is assigned to its nearest center. In such cases, the objective is denoted as Φ(c)\Phi(\mathbf{c}).

For the min-sum objective, we partition SS into kk disjoint subsets denoted as P={P1,P2,…,Pk}\mathcal{P}=\{P_{1},P_{2},\dots,P_{k}\}, and the goal is to minimize Φ(P)=∑i=1k∑p∈Pi∑q∈Pid(p,q)\Phi(\mathcal{P})=\sum_{i=1}^{k}\sum_{p\in P_{i}}\sum_{q\in P_{i}}d(p,q). Note that we sometimes denote Φ\Phi as ΦS\Phi_{S} in the case where the distinction is necessary, such as in Section 4.3.

In Section 4 we consider a generalization of perturbation resilience where we allow a small difference between the original optimum and the new optimum after perturbation. Formally:

Let C\mathcal{C} be the optimal kk-clustering and C′\mathcal{C^{\prime}} be another kk-clustering of a set of nn points. We say C′\mathcal{C^{\prime}} is ϵ\epsilon-close to C\mathcal{C} if min⁡σ∈Sk∑i=1k∣Ci∖Cσ(i)′∣≤ϵn\min_{\sigma\in\mathcal{S}_{k}}\sum_{i=1}^{k}|C_{i}\setminus C^{\prime}_{\sigma(i)}|\leq\epsilon n, where σ\sigma is a matching between indices of clusters of C′\mathcal{C^{\prime}} and those of C\mathcal{C}.

For simplicity, we assume ϵn\epsilon n is an integer and assume that min⁡i∣Ci∣\min_{i}|C_{i}| is known (otherwise, we can simply search over the nn possible different values).

α𝛼\alpha-Perturbation Resilience for Center-based Objectives

In this section we show that, for α≥1+2\alpha\geq 1+\sqrt{2}, if the clustering instance is α\alpha-perturbation resilient for center-based objectives, then we can in polynomial time find the optimal clustering. This improves on the α≥3\alpha\geq 3 bound of and stands in sharp contrast to the NP-Hardness results on worst-case instances. Our algorithm succeeds for an even weaker property, the α\alpha-center proximity, introduced in .

A clustering instance (S,d)(S,d) satisfies the α\alpha-center proximity property if for any optimal cluster Ci∈CC_{i}\in\mathcal{C} with center cic_{i}, Cj∈C(j≠i)C_{j}\in\mathcal{C}(j\neq i) with center cjc_{j}, any point p∈Cip\in C_{i} satisfies αd(p,ci)<d(p,cj)\alpha d(p,c_{i})<d(p,c_{j}).

Any clustering instance that is α\alpha-perturbation resilient to center-based objectives also satisfies the α\alpha-center proximity.

The proof follows easily by constructing a specific perturbation that blows up all the pairwise distances within cluster CiC_{i} by a factor of α\alpha. By α\alpha-perturbation resilience, the optimal clustering remains the same after this perturbation. This then implies the desired result. The full proof appears in . In the remainder of this section, we prove our results for α\alpha-center proximity, but because it is a weaker condition, our upper bounds also hold for α\alpha-perturbation resilience.

We begin with some key properties of α\alpha-center proximity instances.

For any points p∈Cip\in C_{i} and q∈Cj(j≠i)q\in C_{j}(j\neq i) in the optimal clustering of an α\alpha-center proximity instance, we have

d(ci,q)>α(α−1)α+1d(ci,p)d(c_{i},q)>\frac{\alpha(\alpha-1)}{\alpha+1}d(c_{i},p),

d(p,q)>(α−1)max⁡{d(p,ci),d(q,cj)}d(p,q)>(\alpha-1)\max\{d(p,c_{i}),d(q,c_{j})\}.

Consequently, when α≥1+2\alpha\geq 1+\sqrt{2}, we have

(1) Lemma 6 gives us that d(q,ci)>αd(q,cj)d(q,c_{i})>\alpha d(q,c_{j}). By the triangle inequality, we have d(ci,cj)≤d(q,cj)+d(q,ci)<(1+1/α)d(q,ci)d(c_{i},c_{j})\leq d(q,c_{j})+d(q,c_{i})<(1+1/\alpha)d(q,c_{i}). On the other hand, d(p,cj)>αd(p,ci)d(p,c_{j})>\alpha d(p,c_{i}) and therefore d(ci,cj)≥d(p,cj)−d(p,ci)>(α−1)d(p,ci)d(c_{i},c_{j})\geq d(p,c_{j})-d(p,c_{i})>(\alpha-1)d(p,c_{i}). Combining these inequalities, we get (1).

(2) The proof first appears in , and we include it for completeness. Without loss of generality, we can assume that d(p,ci)≥d(q,cj)d(p,c_{i})\geq d(q,c_{j}). By the triangle inequality we have d(p,q)≥d(p,cj)−d(q,cj)d(p,q)\geq d(p,c_{j})-d(q,c_{j}). From Lemma 6 we have d(p,cj)>αd(p,ci)d(p,c_{j})>\alpha d(p,c_{i}). Hence d(p,q)>αd(p,ci)−d(q,cj)≥(α−1)d(p,ci)≥(α−1)d(q,cj)d(p,q)>\alpha d(p,c_{i})-d(q,c_{j})\geq(\alpha-1)d(p,c_{i})\geq(\alpha-1)d(q,c_{j}). ∎

Lemma 7 implies for any optimal cluster CiC_{i}, the ball of radius max⁡p∈Cid(ci,p)\max_{p\in C_{i}}d(c_{i},p) around the center cic_{i} contains only points from CiC_{i}, and moreover, points inside the ball are each closer to the center than to any point outside the ball. Inspired by this structural property, we define the notion of closure distance between two sets as the radius of the minimum ball that covers the sets and has some margin from points outside the ball. We show that any (strict) subset of an optimal cluster has smaller closure distance to another subset in the same cluster than to any subset of other clusters or to unions of other clusters. Using this, we will be able to define an appropriate linkage procedure that, when applied to the data, produces a tree on subsets that will all be laminar with respect to the clusters in the optimal solution. This will then allow us to extract the optimal solution using dynamic programming applied to the tree.

The closure distance dS(A,A′)d_{S}(A,A^{\prime}) between two disjoint nonempty subsets AA and A′A^{\prime} of point set SS is the minimum d≥0d\geq 0 such that there is a point c∈A∪A′c\in A\cup A^{\prime} satisfying the following requirements:

Note that dS(A,A′)=dS(A′,A)≤max⁡p,q∈Sd(p,q)d_{S}(A,A^{\prime})=d_{S}(A^{\prime},A)\leq\max_{p,q\in S}d(p,q) for any AA and A′A^{\prime}. Furthermore, it can be computed in polynomial time.

For (1+2)(1+\sqrt{2})-center proximity instances, Algorithm 1 outputs the optimal clustering in polynomial time.

The proof follows immediately from the following key property of the Phase 1 of Algorithm 1. The details of dynamic programming are presented in Appendix A, and an efficient implementation of the algorithm is presented in Appendix B.

For (1+2)(1+\sqrt{2})-center proximity instances, Algorithm 1 constructs a binary tree T\mathcal{T} such that the optimal clustering is a pruning of this tree.

We prove correctness by induction. In particular, assume that our current clustering is laminar with respect to the optimal clustering. That is, for each cluster AA in our current clustering and each CC in the optimal clustering, we have either A⊆CA\subseteq C, or C⊆AC\subseteq A, or A∩C=∅A\cap C=\varnothing. This is clearly true at the start. To prove that the merge steps keep the laminarity, we need to show the following: if AA is a strict subset of an optimal cluster CiC_{i}, A′A^{\prime} is a subset of another optimal cluster or the union of one or more other clusters, then there exists BB from Ci∖AC_{i}\setminus A, such that dS(A,B)<dS(A,A′)d_{S}(A,B)<d_{S}(A,A^{\prime}).

Our factor of α=1+2\alpha=1+\sqrt{2} beats the NP-hardness lower bound of α=3\alpha=3 of for center-proximity instances. The reason is that the lower bound of requires the addition of Steiner points that can act as centers but are not part of the data to be clustered (though the upper bound of does not allow such Steiner points). One can also show a lower bound for center-proximity instances without Steiner points. In particular for any ϵ>0\epsilon>0, the problem of solving (2−ϵ)(2-\epsilon)-center proximity kk-median instances is NP-hard . There is also a low bound for perturbation resilience. Balcan, Haghtalab and White recently showed that there is no polynomial time algorithm for kk-center instances under (2−ϵ)(2-\epsilon)-perturbation resilience, unless NP= RP. They also showed that closure linkage solves kk-center instances under 2-perturbation resilience in polynomial time.

The first condition in our definition of closure distance is similar to the minimax linkage criteria . More precisely, our closure distance definition has two conditions: coverage condition and margin condition. If the margin condition is removed from the definition, then the closure distance reduces to the minimax linkage distance. For our purposes however, the margin condition is crucial — in particular, we can provably argue that when the center promixity condition is satisfied Algorithm 1 produces a tree such that the optimal clustering is a pruning of the tree (Theorem 9).

(α,ϵ)𝛼italic-ϵ(\alpha,\epsilon)-Perturbation Resilience for the k𝑘k-Median Objective

In this section we consider a natural relaxation of the α\alpha-perturbation resilience, the (α,ϵ)(\alpha,\epsilon)-perturbation resilience property, that requires the optimum after perturbation of up to a multiplicative factor α\alpha to be ϵ\epsilon-close to the original (one should think of ϵ\epsilon as sub-constant). We show that if the instance is (α,ϵ)(\alpha,\epsilon)-perturbation resilient with α>2+3\alpha>2+\sqrt{3}, then we can in polynomial time output a clustering that provides a (1+5ϵ/ρ)(1+5\epsilon/\rho)-approximation to the optimum, where ρ\rho is the fraction of the points in the smallest cluster. Thus this improves over the best worst-case approximation guarantees known when ϵ≤3ρ/5\epsilon\leq\sqrt{3}\rho/5 and also beats the lower bound of (1+1/e)(1+1/e) on the best approximation achievable on worst case instances for the metric kk-median objective when ϵ≤ρ/(5e)\epsilon\leq\rho/(5e).

The key idea is to understand and leverage the structure implied by (α,ϵ)(\alpha,\epsilon)-perturbation resilience. We show that perturbation resilience implies that there exists only a small fraction of points that are bad in the sense that their distance to their own center is not α\alpha times smaller than their distance to any other centers in the optimal solution. We then use this bounded number of bad points in our clustering algorithm.

Throughout this section we will assume that ∣Ci∣|C_{i}| is sufficiently large compared to ϵn\epsilon n, since for interesting practical clustering instances, one would expect that a large fraction of a optimal cluster will remain the same after small perturbation. The exact bound will be stated explicitly in our main theorems. For now we can simply assume ∣Ci∣>2ϵn|C_{i}|>2\epsilon n for all ii.

To understand the structure of (α,ϵ)(\alpha,\epsilon)-perturbation resilience, we need to consider the difference between the optimal clustering C\mathcal{C} under dd and the optimal clustering C′\mathcal{C^{\prime}} under a perturbation d′d^{\prime}, defined as min⁡σ∈Sk∑i=1k∣Ci∖Cσ(i)′∣\min_{\sigma\in\mathcal{S}_{k}}\sum_{i=1}^{k}|C_{i}\setminus C^{\prime}_{\sigma(i)}|. Since ∑i=1k∣Ci∖Cσ(i)′∣≤ϵn\sum_{i=1}^{k}|C_{i}\setminus C^{\prime}_{\sigma(i)}|\leq\epsilon n by assumption, we clearly have separately for each ii that ∣Ci∖Cσ(i)′∣≤ϵn|C_{i}\setminus C^{\prime}_{\sigma(i)}|\leq\epsilon n. Since ∣Ci∣>2ϵn|C_{i}|>2\epsilon n this implies that Cσ(i)′C^{\prime}_{\sigma(i)} is the unique cluster in C′{\cal C^{\prime}} such that ∣Ci∩Cσ(i)′∣>12∣Ci∣|C_{i}\cap C^{\prime}_{\sigma(i)}|>\frac{1}{2}|C_{i}|. Without loss of generality, let us index C′\cal C^{\prime} so that σ\sigma is the identity. We denote by ci′c^{\prime}_{i} the center of Ci′C^{\prime}_{i}.

In the following we introduce the notions of bad points and good points, and then show that under perturbation resilience we do not have too many bad points.

Define bad points for kk-median to be those that are not α\alpha times closer to its own center than to any other center in the optimal clustering. That is,

The other points G:=S∖BG:=S\setminus B are called good points. Let Gi:=G∩CiG_{i}:=G\cap C_{i} denote the good points in cluster CiC_{i}.

Suppose the clustering instance is (α,ϵ)(\alpha,\epsilon)-perturbation resilient and min⁡i∣Ci∣>6(α+1α−1)(ϵn+α+1)\min_{i}|C_{i}|>6\left(\frac{\alpha+1}{\alpha-1}\right)(\epsilon n+\alpha+1). Then ∣B∣≤ϵn|B|\leq\epsilon n.

Assume for contradiction that ∣B∣>ϵn|B|>\epsilon n. The main idea is to select a subset of (ϵn+1)(\epsilon n+1) bad points and then construct a specific perturbation so that in the new optimal clustering these (and only these) selected bad points move to new clusters, leading to a clustering that is ϵ\epsilon far from the original optimal clustering. This is contradictory to the (α,ϵ)(\alpha,\epsilon)-perturbation resilience property, and thus there are at most ϵn\epsilon n bad points.

The selected bad points and the perturbation are defined as follows. Select an arbitrary subset B^\hat{B} of (ϵn+1)(\epsilon n+1) bad points from BB, and let B^i=B^∩Ci\hat{B}_{i}=\hat{B}\cap C_{i} denote the selected bad points in CiC_{i}. Let c(p)c(p) denote the second nearest center for p∈B^ip\in\hat{B}_{i} and the nearest center for p∈Ci∖B^ip\in C_{i}\setminus\hat{B}_{i}. That is, for any 1≤i≤k1\leq i\leq k and any p∈Cip\in C_{i}, let

The perturbation blows up all distances by a factor of α\alpha except for those distances between pp and c(p)c(p). Formally,

The key challenge in showing the contradiction is to show that ci′=cic^{\prime}_{i}=c_{i} for all ii, that is, the optimal centers do not change after the perturbation. Once this is shown it is then immediate that in the optimum clustering under d′d^{\prime} each point pp is assigned to the center c(p)c(p), and thus the selected bad points B^\hat{B} will move from their original optimal clusters and all others will not. So the distance between the new clustering and the original clustering is ∣B^∣>ϵn|\hat{B}|>\epsilon n, which is contradictory to the (α,ϵ)(\alpha,\epsilon)-perturbation resilience property.

It will now be convenient to define a few quantities. Let Ai=Ci′∖CiA_{i}=C_{i}^{\prime}\setminus C_{i} (the points added when switching from CiC_{i} to Ci′C_{i}^{\prime}), Mi=Ci∖Ci′M_{i}=C_{i}\setminus C_{i}^{\prime} (the points removed), Wi=(Ci∩Ci′)∖B^iW_{i}=(C_{i}\cap C_{i}^{\prime})\setminus\hat{B}_{i} (the common points excluding selected bad points), and Vi=(Ci∩Ci′)∩B^iV_{i}=(C_{i}\cap C_{i}^{\prime})\cap\hat{B}_{i} (the selected bad points in common). So, Ci=Wi∪Vi∪MiC_{i}=W_{i}\cup V_{i}\cup M_{i} and Ci′=Wi∪Vi∪AiC_{i}^{\prime}=W_{i}\cup V_{i}\cup A_{i}. See Figure 3. Note that ∣Ai∣≤ϵn|A_{i}|\leq\epsilon n, ∣Mi∣≤ϵn|M_{i}|\leq\epsilon n, and ∣Vi∣≤ϵn+1|V_{i}|\leq\epsilon n+1, with the bulk of the points in WiW_{i}.

If min⁡i∣Ci∣>(2α−1+3)ϵn+1\min_{i}|C_{i}|>(\frac{2}{\alpha-1}+3)\epsilon n+1, then ci′≠cj(∀j≠i)c^{\prime}_{i}\neq c_{j}(\forall j\neq i).

Assume for contradiction that ci′=cjc^{\prime}_{i}=c_{j}. We first need to show cj′≠cl(∀l)c^{\prime}_{j}\neq c_{l}(\forall l). Clearly, cj′≠cjc^{\prime}_{j}\neq c_{j}, since otherwise, moving all the points in Cj′C^{\prime}_{j} to Ci′C^{\prime}_{i} will not increase the cost, which violates (α,ϵ)(\alpha,\epsilon)-perturbation resilience. We also know that cj′≠cl(l≠j)c^{\prime}_{j}\neq c_{l}(l\neq j) since otherwise, there is p∈Wjp\in W_{j}, d(cl,p)=d(cj′,p)≤d′(cj′,p)<d′(ci′,p)=d(cj,p)d(c_{l},p)=d(c^{\prime}_{j},p)\leq d^{\prime}(c^{\prime}_{j},p)<d^{\prime}(c^{\prime}_{i},p)=d(c_{j},p), which contradicts the fact that p∈Cjp\in C_{j}.

First, since points in WjW_{j} are α\alpha time closer to cj′c^{\prime}_{j} than to cjc_{j}, the distance between cj′c^{\prime}_{j} and cjc_{j} is small:

Second, since cjc_{j} is the optimal center for Cj=Wj∪Vj∪MjC_{j}=W_{j}\cup V_{j}\cup M_{j}, it should save a lot of cost on MjM_{j} compared to cj′c^{\prime}_{j}, which suggests that cjc_{j} and cj′c^{\prime}_{j} would be far apart. Formally,

When ∣Cj∣>(2α−1+3)ϵn+1|C_{j}|>(\frac{2}{\alpha-1}+3)\epsilon n+1, we have (1−1/α)∣Wj∣>(1+1/α)∣Mj∣(1-1/\alpha)|W_{j}|>(1+1/\alpha)|M_{j}|. Then Inequalities 3 and 2 lead to d(cj,cj′)=0d(c_{j},c^{\prime}_{j})=0. This means cj=cj′c_{j}=c^{\prime}_{j} which is a contradiction to the assumptions. ∎

Suppose min⁡i∣Ci∣>(2α−1+3)ϵn+1\min_{i}|C_{i}|>(\frac{2}{\alpha-1}+3)\epsilon n+1. If ci≠ci′c_{i}\neq c^{\prime}_{i}, then we have

These translations from d′d^{\prime} to dd can be verified by the definition of d′d^{\prime}. In most cases, d′(⋅,⋅)=αd(⋅,⋅)d^{\prime}(\cdot,\cdot)=\alpha d(\cdot,\cdot); the only exceptions are the distances between pp and c(p)c(p). The detailed verification is presented below.

(1) Since ci′≠cic^{\prime}_{i}\neq c_{i}, and by Claim 4.1, we know ci′≠cj(∀j)c^{\prime}_{i}\neq c_{j}(\forall j). So we only need to check if c(ci′)∈Aic(c^{\prime}_{i})\in A_{i}. We have

(2) If c(ci′)∉Aic(c^{\prime}_{i})\not\in A_{i}, then the inequality is trivial. If c(ci′)∈Aic(c^{\prime}_{i})\in A_{i}, then

We are now ready to present the complete proofs of the two key claims.

which implies the desired result when ∣Ci∣>5ϵn+2α+6|C_{i}|>5\epsilon n+2\alpha+6. ∎

For each ii, if ci′≠cic_{i}^{\prime}\neq c_{i} then d(ci,ci′)≥(α−12α)d(ci,Wi)ϵn+α+1.d(c_{i},c^{\prime}_{i})\geq\left(\frac{\alpha-1}{2\alpha}\right)\frac{d(c_{i},W_{i})}{\epsilon n+\alpha+1}.

On Ci∖MiC_{i}\setminus M_{i}, the cost of cic_{i} is smaller than that of ci′c_{i}^{\prime}. Specifically, from (8) we have:

Combining the upper bound of Claim 4.3 with the lower bound of Claim 4.4 when ci′≠cic_{i}^{\prime}\neq c_{i}, we get a contradiction for sufficiently large ∣Ci∣|C_{i}| as given in the theorem statement, yielding ci′=cic_{i}^{\prime}=c_{i}.

The bound in Theorem 12 is optimal in the sense that for any α>1\alpha>1 and 0<ϵ<1/50<\epsilon<1/5, we can easily construct an (α,ϵ)(\alpha,\epsilon)-perturbation resilient 22-median instance which has ϵn\epsilon n bad points.

The instance is shown in Figure 4. It has 33 groups of points: G1,G2G_{1},G_{2}, and BB. Both G1G_{1} and G2G_{2} have (1−ϵ)n/2(1-\epsilon)n/2 points, and BB has ϵn\epsilon n points. Let MM be a sufficiently large constant, say, M>n2/ϵM>n^{2}/\epsilon. The distances within the same group are 11, while those between the points in G1G_{1} and G2G_{2} are MM, those between the points in BB and G1G_{1} are Mα+1+1\frac{M}{\alpha+1}+1, and those between the points in BB and G2G_{2} are αMα+1−1\frac{\alpha M}{\alpha+1}-1. The instance satisfies the triangle inequality, which can be verified by a case analysis. The optimal clustering before perturbation has one center in G1G_{1} and the other in G2G_{2}. Then BB are trivially bad points, and thus we have ϵn\epsilon n bad points in this instance.

Now we show that the instance is (α,ϵ)(\alpha,\epsilon)-perturbation resilient. To prove that the optimal clustering after perturbation C′\mathcal{C}^{\prime} is ϵ\epsilon-close to the original optimal clustering, it suffices to show that C′\mathcal{C}^{\prime} has one center from G1∪BG_{1}\cup B and the other center from G2G_{2}. Assume for contradiction that this is not true. If both centers come from G2G_{2}, the cost of points in G1G_{1} is (1−ϵ)n2M\frac{(1-\epsilon)n}{2}M. On the other hand, the optimal cost before perturbation is (1−ϵ)n−2+ϵn(Mα+1+1)(1-\epsilon)n-2+\epsilon n(\frac{M}{\alpha+1}+1), so the optimal cost after perturbation is no more than α((1−ϵ)n−2+ϵn(Mα+1+1))\alpha((1-\epsilon)n-2+\epsilon n(\frac{M}{\alpha+1}+1)). But this is smaller than (1−ϵ)n2M\frac{(1-\epsilon)n}{2}M, which is a contradiction. Similarly, we get a contradiction if both centers come from G1∪BG_{1}\cup B.

2 Approximation Bound

Now, we consider the problem of approximating the cost of the optimum clustering. We can see that after removing the bad points, the optimal clusters are far apart from each other. In order to get rid of the influence of the bad points, we generate a list of blobs, which form a partition of the data points, and each of which contains only good points from one optimal cluster. Then we construct a tree on the list of blobs with a pruning that assigns all good points correctly. We will show that this pruning has low cost, so the lowest cost pruning of the tree is a good approximation. The details are described in Algorithm 2.

A key step is to generate the list of almost “pure” blobs, which is described in Algorithm 3. Suppose for any ii and any good point p∈Gip\in G_{i}, its γ∣Gi∣\gamma|G_{i}| nearest neighbors contain no good points outside CiC_{i}. Also suppose the algorithm knows the value of γ\gamma. Informally, the algorithm maintains a threshold tt. At each threshold, for each point pp that has not been added to the list, the algorithm checks its γt\gamma t nearest neighbors Nγt(p)N_{\gamma t}(p). It constructs a graph FtF_{t} by connecting any two points that have sufficiently many common neighbors. It then builds another graph HtH_{t} by connecting any two points that have sufficiently many common neighbors in FtF_{t}, and adds sufficiently large components in HtH_{t} to the list. Finally, for each remaining point pp, it checks if most of pp’s neighbors are in the list and if there are blobs containing a significant amount of pp’s neighbors. If so, it inserts pp into such a blob with the smallest median distance. Then the threshold is increased and the above steps are repeated.

The intuition behind Algorithm 3 is as follows. As mentioned above, the algorithm works when for any ii and any good point p∈Gip\in G_{i}, the γ∣Gi∣\gamma|G_{i}| nearest neighbors of pp contain no good points outside CiC_{i} (γ=1\gamma=1 for the kk-median instances considered in this section, as shown in Lemma 13; γ=45\gamma=\frac{4}{5} for the min-sum instances considered in Section 6, as shown in Claim 6.3). Without loss of generality, assume ∣C1∣≤∣C2∣≤⋯≤∣Ck∣|C_{1}|\leq|C_{2}|\leq\dots\leq|C_{k}|. When t≤∣C1∣t\leq|C_{1}|, good points in different clusters do not have most neighbors in common and thus are not connected in FtF_{t}. However, they may be connected by a path of bad points. So we further build the graph HtH_{t} to disconnect such paths, which ensures that the blobs added into the list contain only good points from one optimal cluster. The final insert step (Step 6) makes sure that when t=∣C1∣t=|C_{1}|, all remaining good points in C1C_{1} will be added to the list and will not affect the construction of blobs from other optimal clusters. We can show by induction that, at the end of the iteration t=∣Ci∣t=|C_{i}|, all good points in Cj(j≤i)C_{j}(j\leq i) are added to the list. When tt is large enough, any remaining bad points are inserted into the list, so the points are partitioned into a list of almost pure blobs. The formal guarantee for Algorithm 3 is stated in Lemma 14.

In the following, we prove that Algorithm 2 outputs a good approximation. We first prove a key property of the good points in (α,ϵ)(\alpha,\epsilon)-perturbation resilience instances in Lemma 13 and show in Lemma 14 that the property ensures the success of Algorithm 3, and then prove a property of the bad points in Lemma 15. Finally, we use these lemmas to prove the approximation bound in Theorem 16.

When α>2+3\alpha>2+\sqrt{3}, for any good points p1,p2∈Gi,q∈Gj(j≠i)p_{1},p_{2}\in G_{i},q\in G_{j}(j\neq i), we have d(p1,p2)<d(p1,q)d(p_{1},p_{2})<d(p_{1},q). Consequently, for any good point p∈Gip\in G_{i}, all its ∣Gi∣|G_{i}| nearest neighbors belong to Ci∪BC_{i}\cup B.

The following proof is implicit in and we include it for completeness. We rephrase it slightly so that it is more intuitive. By the triangle inequality and the definition of good points,

Now, to compare d(p1,q)d(p_{1},q) and d(p1,p2)d(p_{1},p_{2}), we need to get rid of the extra terms d(q,cj)d(q,c_{j}) and d(p1,ci)d(p_{1},c_{i}). By the same proof in Lemma 7(2),

So when α>2+3\alpha>2+\sqrt{3}, d(p1,q)>d(p1,p2)d(p_{1},q)>d(p_{1},p_{2}). ∎

Suppose the number of bad points is bounded by uBu_{B}, and for any ii and any good point p∈Gip\in G_{i}, all its γ∣Gi∣\gamma|G_{i}| nearest neighbors in SS are from Ci∪BC_{i}\cup B. If min⁡i∣Ci∣>30uB\min_{i}|C_{i}|>30u_{B}, then Algorithm 3 generates a list L\mathcal{L} of blobs each of size at least 12min⁡i∣Ci∣\frac{1}{2}\min_{i}|C_{i}| such that:

The blobs in L\mathcal{L} form a partition of SS.

Each blob in L\mathcal{L} contains good points from only one optimal cluster.

Without loss of generality, assume ∣C1∣≤∣C2∣≤⋯≤∣Ck∣|C_{1}|\leq|C_{2}|\leq\dots\leq|C_{k}|. We prove the following two claims by induction on i≤ki\leq k:

For any t≤∣Gi∣t\leq|G_{i}|, any blob in the list L\mathcal{L} only contains good points from only one optimal cluster; all blobs have size at least 12min⁡i∣Ci∣\frac{1}{2}\min_{i}|C_{i}|.

At the beginning of the iteration t=∣Gi∣+1t=|G_{i}|+1, any good point p∈Gj,j≤ip\in G_{j},j\leq i has already been assigned to a blob in the list that contains good points only from CjC_{j}.

The first two claims imply that each blob in the list contains good points from only one optimal cluster. Moreover, at the beginning of the iteration t=∣Gk∣+1t=|G_{k}|+1, all good points have been assigned to one of the blobs in L\mathcal{L}, so there are only bad points left, the number of which is smaller than 12min⁡i∣Ci∣\frac{1}{2}\min_{i}|C_{i}|. These remaining points will eventually be assigned to the blobs before γt>n\gamma t>n, so the blobs form a partition of SS.

The claims are clearly both true initially. We show now that as long as t≤∣G1∣t\leq|G_{1}|, the graphs FtF_{t} and HtH_{t} have the following properties.

No good point pip_{i} in cluster CiC_{i} is connected in FtF_{t} to a good point pjp_{j} in a different cluster CjC_{j}. By assumption, pip_{i} has no neighbors outside Ci∪BC_{i}\cup B and pjp_{j} has no neighbors outside Cj∪BC_{j}\cup B, so they share at most uB<(2γ−1)t−2uBu_{B}<(2\gamma-1)t-2u_{B} neighbors.

No point qq is connected in FtF_{t} to both a good point pip_{i} in CiC_{i} and a good point pjp_{j} in a different cluster CjC_{j}. If qq is connected to pip_{i}, then ∣Nγt(pi)∩Nγt(q)∣>(2γ−1)t−2uB|N_{\gamma t}(p_{i})\cap N_{\gamma t}(q)|>(2\gamma-1)t-2u_{B}. Since pip_{i} has no neighbors outside Ci∪BC_{i}\cup B, Nγt(q)N_{\gamma t}(q) contains more than (2γ−1)t−3uB≥γt/2(2\gamma-1)t-3u_{B}\geq\gamma t/2 points from GiG_{i}. Similarly, if qq is connected to pjp_{j}, then Nγt(q)N_{\gamma t}(q) contains more than γt/2\gamma t/2 points from GjG_{j}, which is contradictory. Thus, the graph FtF_{t} looks like the illustration in Figure 5.

All the components in HtH_{t} of size at least 12min⁡i∣Ci∣\frac{1}{2}\min_{i}|C_{i}| will only contain good points from one optimal cluster. As there are at most uBu_{B} bad points, any two points connected in HtH_{t} must be connected in FtF_{t} to at least one good point. Then by the above two properties, points on a path in HtH_{t} must be connected in FtF_{t} to good points in the same cluster, so there is no path connecting good points from different clusters.

We can use the three properties to argue the first claim: as long as t≤∣G1∣t\leq|G_{1}|, each blob in L\mathcal{L} contains good points from at most one optimal cluster. This is true at the beginning and by the third property, for any t≤∣G1∣t\leq|G_{1}|, anytime we insert a whole new blob in the list in Step 5, that blob must contain point from at most one optimal cluster. We now argue that this property is never violated as we assign points to blobs already in the list in Step 6. Suppose a good point p∈Cip\in C_{i} is inserted into C∈LC\in\mathcal{L}. Then C∈LpC\in\mathcal{L}_{p}, which means ∣Nγt(p)∩C∣≥∣C∣/5>uB|N_{\gamma t}(p)\cap C|\geq|C|/5>u_{B}. So Nγt(p)∩CN_{\gamma t}(p)\cap C contains at least one good point, which must be from CiC_{i} since Nγt(p)N_{\gamma t}(p) contains no good points outside CiC_{i}. Then by induction CC must contain only good points from CiC_{i}, and thus adding pp to CC does not violate the first claim.

We now show the second claim: after the iteration t=∣G1∣t=|G_{1}|, all the good points in C1C_{1} have already been assigned to a blob in the list that only contains good points from C1C_{1}. There are two cases. First, if at the beginning of the iteration t=∣G1∣t=|G_{1}|, there are still at least 12min⁡i∣Ci∣\frac{1}{2}\min_{i}|C_{i}| points from the good point set G1G_{1} that do not belong to blobs in the list. Any such good point has all γ∣G1∣\gamma|G_{1}| neighbors in C1∪BC_{1}\cup B. Then any two such good points share at least 2γ∣G1∣−∣C1∪B∣≥(2γ−1)∣G1∣−∣B∣≥(2γ−1)t−2uB2\gamma|G_{1}|-|C_{1}\cup B|\geq(2\gamma-1)|G_{1}|-|B|\geq(2\gamma-1)t-2u_{B} neighbors. So they will connect to each other in FtF_{t} and then in HtH_{t}, and thus we will add one blob to L\mathcal{L} containing all these points. Second, it could be that at the beginning of the iteration t=∣G1∣t=|G_{1}|, all but less than 12min⁡i∣Ci∣\frac{1}{2}\min_{i}|C_{i}| good points in G1G_{1} have been assigned to a blob in the list. Denote the points that have not yet been assigned as EE. Any point p∈Ep\in E has no neighbors outside C1∪BC_{1}\cup B. Then ∣Nγt(p)∖L∣≤∣E∣+∣B∣≤12min⁡i∣Ci∣+2uB|N_{\gamma t}(p)\setminus\mathcal{L}|\leq|E|+|B|\leq\frac{1}{2}\min_{i}|C_{i}|+2u_{B}. Also, there exists a blob CC containing good points from C1C_{1} such that C∈LpC\in\mathcal{L}_{p}. Otherwise, Nγt(p)N_{\gamma t}(p) contains at most (γ−35)(∣C1∪B∣)<γ∣C1∣−12∣C1∣−2uB(\gamma-\frac{3}{5})(|C_{1}\cup B|)<\gamma|C_{1}|-\frac{1}{2}|C_{1}|-2u_{B} points in C1∩LC_{1}\cap\mathcal{L}, while it contains at most ∣E∣|E| good points in C1∖LC_{1}\setminus\mathcal{L} and contains no points outside C1∪BC_{1}\cup B. In total, Nγt(p)N_{\gamma t}(p) has less than γt\gamma t points, which is contradictory. So Lp≠∅\mathcal{L}_{p}\neq\emptyset and pp will be added to the list in Step 6.

We then iterate the argument on the remaining set ASA_{S}. The key point is that for t≥∣Gi∣,i>1t\geq|G_{i}|,i>1, we have that all the good points in C1,C2,…,CiC_{1},C_{2},\dots,C_{i} have already been assigned to blobs in L\mathcal{L}. ∎

Lemma 13 and 14 show that Algorithm 3 with parameters uB=ϵnu_{B}=\epsilon n and γ=1\gamma=1 produces a list of sufficiently large, almost pure blobs. Then the robust linkage procedure in can build a tree on these blobs with a pruning that assigns all good points correctly. Now it suffices to show that this pruning is a good approximation, for which we need to bound the cost increased by the bad points assigned incorrectly. The following property of these bad points turns out to be useful. Intuitively, Algorithm 3 is designed such that whenever a bad point is added to a blob containing good points from a different cluster, it must be closer to a significant number of points in that cluster than to a significant number of points in its own cluster. Then the cost increased by incorrectly assigning each such bad point is small, resulting in a good approximation.

Suppose for any good point p∈Gip\in G_{i}, all its ∣Gi∣|G_{i}| nearest neighbors in SS are from Ci∪BC_{i}\cup B, and min⁡i∣Ci∣>30uB\min_{i}|C_{i}|>30u_{B}. When running Algorithm 3 with γ=1\gamma=1, if a bad point q∈Biq\in B_{i} is assigned to a blob CC containing good points from a different optimal clustering CjC_{j}, then there exist m=15min⁡i∣Ci∣m=\frac{1}{5}\min_{i}|C_{i}| points ZiZ_{i} from CiC_{i}, and mm points ZjZ_{j} from CjC_{j}, such that d(q,Zi)≥d(q,Zj)d(q,Z_{i})\geq d(q,Z_{j}).

There are two cases: qq is added into CC in (1) Step 5 or (2) Step 6.

There must be a path in HtH_{t} connecting qq to a good point in CjC_{j} at threshold tt. For any edge (x,y)(x,y) in HtH_{t}, since x,yx,y share at least ϵn\epsilon n neighbors in FtF_{t} and there are at most ϵn\epsilon n bad points, they share at least one good point as neighbor in FtF_{t}. As shown in the proof of Lemma 14, no point can connect to good points from different clusters, so in FtF_{t} all points on the path must connect to good points in CjC_{j}. In particular, qq is connected in FtF_{t} to a good point p∈Gjp\in G_{j}. Then ∣Nt(p)∩Nt(q)∣>t−2uB|N_{t}(p)\cap N_{t}(q)|>t-2u_{B}. Since pp is still in ASA_{S}, t≤∣Gj∣t\leq|G_{j}|, and thus Nt(p)N_{t}(p) contains no points outside Cj∪BC_{j}\cup B. This means that at least t−3uB≥mt-3u_{B}\geq m points in Nt(q)N_{t}(q) are good points in CjC_{j}, then we can select mm points ZjZ_{j} from Nt(q)∩GjN_{t}(q)\cap G_{j}. We also have that at most 2uB2u_{B} points in Nt(q)N_{t}(q) are points in CiC_{i}, so we can select mm points ZiZ_{i} from Ci∖Nt(q)C_{i}\setminus N_{t}(q).

There are three subcases when qq is inserted into CC at threshold tt.

There is no good points from CiC_{i} in the list. Since ∣Nt(q)∖L∣≤12min⁡i∣Ci∣+2uB|N_{t}(q)\setminus\mathcal{L}|\leq\frac{1}{2}\min_{i}|C_{i}|+2u_{B}, Nt(q)N_{t}(q) contains at most this number of good points in CiC_{i}. This means at least 12min⁡i∣Ci∣−2uB>m\frac{1}{2}\min_{i}|C_{i}|-2u_{B}>m good points in CiC_{i} are outside Nt(q)N_{t}(q), from which we can select ZiZ_{i}. On the other hand, we can select ZjZ_{j} as follows. When inserting qq into CC, we have ∣Nt(q)∩C∣≥25∣C∣≥m+uB|N_{t}(q)\cap C|\geq\frac{2}{5}|C|\geq m+u_{B}. Since CC contains only good points from CjC_{j} and some bad points, Nt(q)∩CN_{t}(q)\cap C contains at least mm good points in CjC_{j}, from which we can select ZjZ_{j}. Since ZjZ_{j} are from Nt(q)N_{t}(q) and ZiZ_{i} are outside Nt(q)N_{t}(q), we have d(q,Zi)≥d(q,Zj)d(q,Z_{i})\geq d(q,Z_{j}).

There exists C′∈LC^{\prime}\in\mathcal{L} containing good points from CiC_{i}, but C′∉LpC^{\prime}\not\in\mathcal{L}_{p}. This means ∣B(q,t)∩C′∣≤25∣C′∣|B(q,t)\cap C^{\prime}|\leq\frac{2}{5}|C^{\prime}|, so there are at least 35∣C′∣≥m+uB\frac{3}{5}|C^{\prime}|\geq m+u_{B} points in C′C^{\prime} are outside Nt(q)N_{t}(q). At least mm of these points are good points from CiC_{i}, since C′C^{\prime} contains only good points from CiC_{i} and at most uBu_{B} bad points. So, we can select ZiZ_{i} from them. On the other hand, we can select ZjZ_{j} as in the first subcase.

There exists C′∈LpC^{\prime}\in\mathcal{L}_{p} containing good points from CiC_{i}. Since qq is assigned to CC rather than C′C^{\prime} according to median distances, we know that at least half of the points Zj′Z^{\prime}_{j} from CC are closer to qq than at least half of the points Zi′Z^{\prime}_{i} from C′C^{\prime}. Since there are at most uBu_{B} bad points, we can select mm good points ZjZ_{j} from Zj′Z^{\prime}_{j} and select mm good points ZiZ_{i} from Zi′Z^{\prime}_{i}. Note that ZjZ_{j} are all from GjG_{j} and ZiZ_{i} are all from GiG_{i}, so d(q,Zi)≥d(q,Zj)d(q,Z_{i})\geq d(q,Z_{j}).

Therefore, the statement is true in all cases. ∎

If the clustering instance is (α,ϵ)(\alpha,\epsilon)-perturbation resilient for α>2+3\alpha>2+\sqrt{3} and ϵ≤ρ/30\epsilon\leq\rho/30 where ρ=min⁡i∣Ci∣n\rho=\frac{\min_{i}|C_{i}|}{n}, then Algorithm 2 produces a clustering which is (1+5ϵρ)(1+\frac{5\epsilon}{\rho})-approximation to the optimal clustering with respect to the kk-median objective in polynomial time.

By Lemma 13 and 14, Algorithm 3 partitions the points into a list of blobs, each of which has size at least 12min⁡i∣Ci∣\frac{1}{2}\min_{i}|C_{i}| and contains only good points from one optimal cluster. Let Bi′B^{\prime}_{i} denote the bad points that are assigned to blobs containing good points in CiC_{i}. By Lemma 13, Theorem 9 in can be applied to L\mathcal{L}, by which we know that {(Ci∩G)∪Bi′}\{(C_{i}\cap G)\cup B^{\prime}_{i}\} is a pruning of the tree. Suppose the cost of the optimum is OPT\mathcal{OPT}. We now show that this pruning, using the original centers {ci}\{c_{i}\}, is a (1+5ϵρ)(1+\frac{5\epsilon}{\rho})-approximation to OPT\mathcal{OPT}.

Suppose a bad point q∈Ciq\in C_{i} is assigned to a blob CC containing good points from a different optimal cluster CjC_{j}. By Lemma 15, there exist m=15min⁡i∣Ci∣m=\frac{1}{5}\min_{i}|C_{i}| points ZiZ_{i} from CiC_{i}, and mm points ZjZ_{j} from CjC_{j}, such that d(q,Zi)≥d(q,Zj)d(q,Z_{i})\geq d(q,Z_{j}). Then the increase in cost due to qq is bounded as follows:

As there are at most ϵn\epsilon n bad points and m=min⁡i∣Ci∣5m=\frac{\min_{i}|C_{i}|}{5}, the increase of cost is at most ϵnmOPT=5ϵρOPT\frac{\epsilon n}{m}\mathcal{OPT}=\frac{5\epsilon}{\rho}\mathcal{OPT}.

In Algorithm 3, for each p∈Sp\in S, we first sort all the other points in ascending order of distances in time O(n2log⁡n)O(n^{2}\log n). At each threshold tt, think of a directed tt-regular graph EtE_{t}, where, for each point qq in the tt nearest neighbors of a point pp, there is a directed edge from pp to qq in EtE_{t}. Let AEA_{E} denote the adjacency matrix for EtE_{t}, and let N=AEAE⊤N=A_{E}A^{\top}_{E}. Then NpqN_{pq} is the number of common neighbors between pp and qq, which can be used in constructing FtF_{t}. Computing NN takes time O(nω)O(n^{\omega}), where ω\omega is the matrix multiplication exponent. The same method can be used to compute the number of common neighbors in FtF_{t} and construct HtH_{t}. Since there are O(n)O(n) thresholds, the total time for constructing FtF_{t} and HtH_{t} is O(nω+1)O(n^{\omega+1}). For the other steps, adding a blob takes time O(n2)O(n^{2}) and inserting a point takes time O(n2)O(n^{2}). These steps can be performed at most O(n)O(n) times, so they take O(n3)O(n^{3}) time. In total, Algorithm 3 takes time O(nω+1)O(n^{\omega+1}). Since the robust linkage algorithm takes time at most O(nω+1)O(n^{\omega+1}), and the dynamic programming takes time O(n3)O(n^{3}) (Appendix A), the running time of Algorithm 2 is O(nω+1)O(n^{\omega+1}). ∎

3 Sublinear Time Algorithm for the k𝑘k-Median Objective

Consider a clustering instance (X,d)(X,d) that is (α,ϵ)(\alpha,\epsilon)-perturbation resilient to kk-median. For simplicity, suppose the distances are normalized such that max⁡p,qd(p,q)=1\max_{p,q}d(p,q)=1. Let N=∣X∣N=|X|. Let ρ=min⁡i∣Ci∣/N\rho=\min_{i}|C_{i}|/N denote the fraction of the points in the smallest cluster, ζ=ΦX(c)/N\zeta=\Phi_{X}(\mathbf{c})/N denote the average cost of the points in the optimum clustering.

Suppose (X,d)(X,d) is (α,ϵ)(\alpha,\epsilon)-perturbation resilient for α>2+3\alpha>2+\sqrt{3}, ϵ<ρ/100\epsilon<\rho/100. Then with probability ≥1−δ\geq 1-\delta, Algorithm 4 outputs an implicit clustering that is 2(1+16ϵρ)2(1+\frac{16\epsilon}{\rho})-approximation in time poly(log⁡Nδ,k,1ϵ,1ζ)poly(\log\frac{N}{\delta},k,\frac{1}{\epsilon},\frac{1}{\zeta}).

By the union bound, we have with probability at least 1−δ/41-\delta/4,

On the other hand, ΦS(P′,c′)≤2ΦS(P′,c)≤2(1+12ϵ/ρ)ΦS(c)\Phi_{S}(\mathcal{P^{\prime}},\mathbf{c^{\prime}})\leq 2\Phi_{S}(\mathcal{P^{\prime}},\mathbf{c})\leq 2(1+{12\epsilon}/{\rho})\Phi_{S}(\mathbf{c}). The second inequality comes from an argument similar to that in Theorem 16 and the fact that ΦS(P′,c)\Phi_{S}(\mathcal{P^{\prime}},\mathbf{c}) is different from ΦS(c)\Phi_{S}(\mathbf{c}) only on the bad points. The first inequality comes from the triangle inequality. More precisely, for any Ni′∈P′N^{\prime}_{i}\in\mathcal{P^{\prime}},

If we have an oracle that given a set of points Ci′C_{i}^{\prime} finds the best center in XX for that set, then we can save a factor of 22 in the approximation factor.

α𝛼\alpha-Perturbation Resilience for the Min-Sum Objective

For (3max⁡i∣Ci∣min⁡i∣Ci∣)(3\frac{\max_{i}|C_{i}|}{\min_{i}|C_{i}|})-perturbation resilient instances, Algorithm 5 outputs the optimal min-sum kk-clustering in polynomial time.

Proof of Theorem 18. We now present the formal proof of the theorem. We first prove the key claims mentioned in the intuition.

By the triangle inequality, for any p∈A,q∈C∖Dp\in A,q\in C\setminus D and z∈Dz\in D,

Summing over all p∈A,q∈C∖Dp\in A,q\in C\setminus D and z∈Dz\in D, we have

We consider a specific perturbation and use the fact that the optimum does not change after the perturbation. The perturbed metric is defined as:

Suppose the clustering instance is α\alpha-perturbation resilient to min-sum for α>3max⁡i′∣Ci′∣min⁡i′∣Ci′∣\alpha>3\frac{\max_{i^{\prime}}|C_{i^{\prime}}|}{\min_{i^{\prime}}|C_{i^{\prime}}|}. Then the following statements are true:

For any two different optimal clusters CiC_{i} and CjC_{j} and any nonempty Ai⊆Ci,Aj⊆CjA_{i}\subseteq C_{i},A_{j}\subseteq C_{j}, if ∣Ci∖Ai∣|C_{i}\setminus A_{i}| and ∣Cj∖Aj∣|C_{j}\setminus A_{j}| are larger than min⁡i′∣Ci′∣/2\min_{i^{\prime}}|C_{i^{\prime}}|/2, then

For any point pp, all its min⁡i′∣Ci′∣/2\min_{i^{\prime}}|C_{i^{\prime}}|/2 nearest neighbors are in the same optimal cluster.

(1) Let A‾i:=Ci∖Ai\overline{A}_{i}:=C_{i}\setminus A_{i} and A‾j:=Cj∖Aj\overline{A}_{j}:=C_{j}\setminus A_{j}. By Claim 5.1 and Fact 5.1,

Divide Inequality (12) by ∣Ai∣|A_{i}|, divide Inequality (13) by ∣Aj∣|A_{j}|, add them up, and move the d(Aj,Aj‾)d(A_{j},\overline{A_{j}}) and d(Ai,Ai‾)d(A_{i},\overline{A_{i}}) terms to the left-hand side:

Since α\alpha, ∣A‾j∣|\overline{A}_{j}| and ∣A‾i∣|\overline{A}_{i}| are large enough, (α−1)∣A‾i∣>∣Ci∣(\alpha-1)|\overline{A}_{i}|>|C_{i}| and (α−1)∣A‾j∣>∣Cj∣(\alpha-1)|\overline{A}_{j}|>|C_{j}|. So,

(2) Suppose pp comes from the optimal cluster CiC_{i}. Let q=arg⁡min⁡p′∉Cid(p,p′)q=\arg\min_{p^{\prime}\not\in C_{i}}d(p,p^{\prime}), and suppose q∈Cjq\in C_{j}.

We are now ready to use the lemmas to prove our theorem. It is sufficient to show that in Algorithm 5:

Initially each A∈C′A\in{\cal C}^{\prime} satisfies A⊆CA\subseteq C for some C∈CC\in{\cal C};

C′\mathcal{C^{\prime}} is always laminar to the optimal clustering C\mathcal{C}, that is, for any A∈C′A\in\mathcal{C^{\prime}} and C∈CC\in\mathcal{C}, we have either A⊆CA\subseteq C, or C⊆AC\subseteq A, or A∩C=∅A\cap C=\varnothing.

Then the minimum cost pruning of T\mathcal{T} will be the optimal clustering, which can be obtained by dynamic programming.

Claim 5.2(2) implies that initially each A∈C′A\in{\cal C}^{\prime} satisfies A⊆CA\subseteq C for some C∈CC\in{\cal C}. This means that C′\mathcal{C^{\prime}} is laminar initially. Then Claim 5.2(1) can be used to show that the merge steps preserve the laminarity, so C′\mathcal{C^{\prime}} is always laminar to the optimal clustering.

More precisely, we prove the laminarity by induction. By Claim 5.2(2), C′\mathcal{C^{\prime}} is laminar initially. It is sufficient to prove that if the current clustering is laminar, then the merge step keeps the laminiarity. Assume that our current clustering C′\mathcal{C^{\prime}} is laminar to the optimal clustering. Consider a merge of two clusters AA and A′A^{\prime}. There are two cases when laminarity could fail to be satisfied after the merge:

AA and A′A^{\prime} are strict subsets from different optimal clusters, that is, A⊊Ci,A′⊊Cj≠CiA\subsetneq C_{i},A^{\prime}\subsetneq C_{j}\neq C_{i};

AA is a strict subset of an optimal cluster CiC_{i} and A′A^{\prime} is the union of one or several other optimal cluster(s).

where the last inequality comes from α≥3max⁡i′∣Ci′∣min⁡i′∣Ci′∣\alpha\geq 3\frac{\max_{i^{\prime}}|C_{i^{\prime}}|}{\min_{i^{\prime}}|C_{i^{\prime}}|} and ∣Ci∖A∣≥min⁡i′∣Ci′∣/2|C_{i}\setminus A|\geq\min_{i^{\prime}}|C_{i^{\prime}}|/2. This contradicts Claim 5.1. So the merge of the two clusters AA and A′A^{\prime} will preserve the laminarity.

1 Sublinear Algorithm for the Min-Sum Objective

Our main result in this subsection is the following.

Suppose the clustering instance (X,d)(X,d) is α\alpha-perturbation resilient to the min-sum objective where α≥6max⁡i∣Ci∣min⁡i∣Ci∣\alpha\geq 6\frac{\max_{i}|C_{i}|}{\min_{i}|C_{i}|}. Then with probability at least 1−δ1-\delta, Algorithm 6 outputs an implicit optimum clustering in time poly(log⁡Nkδ,1ρ,1η)poly(\log{\frac{Nk}{\delta}},\frac{1}{\rho},\frac{1}{\eta}).

To prove the theorem, we first show the following (Lemma 20): with high probability, C′\mathcal{C^{\prime}} in Algorithm 5 is always laminar to C∩S\mathcal{C}\cap S. The key idea is that when the sample is sufficiently large, we have that for any p∈Cip\in C_{i} and Cj(j≠i)C_{j}(j\neq i),

We now present the proofs of the lemmas that imply the correctness of the theorem.

Suppose the clustering instance is α\alpha-perturbation resilient to the min-sum objective for α≥6max⁡i∣Ci∣min⁡i∣Ci∣\alpha\geq 6\frac{\max_{i}|C_{i}|}{\min_{i}|C_{i}|}. When n=O(1ρηln⁡Nkδ)n=O(\frac{1}{\rho\eta}\ln{\frac{Nk}{\delta}}), with probability at least 1−δ1-\delta, C′\mathcal{C^{\prime}} in Algorithm 5 is always laminar to C∩S\mathcal{C}\cap S.

First, since n=O(1ρηln⁡Nkδ)n=O(\frac{1}{\rho\eta}\ln{\frac{Nk}{\delta}}), by the Chernoff bound we have

Set υ=1/20\upsilon=1/20. By the union bound, with probability at least 1−δ/41-\delta/4, for any 1≤i≤k1\leq i\leq k,

Similarly, with probability at least 1−δ/41-\delta/4, for any i≠ji\neq j and p∈Cip\in C_{i},

Now, fix any ii and p∈Cip\in C_{i}. We have

By the union bound, with probability at least 1−δ/41-\delta/4, for any j≠ij\neq i and p∈Cip\in C_{i},

Now, by (14), we have max⁡i′∣Ci′∩S∣≤(1+υ)nNmax⁡i′∣Ci′∣\max_{i^{\prime}}|C_{i^{\prime}}\cap S|\leq(1+\upsilon)\frac{n}{N}\max_{i^{\prime}}|C_{i^{\prime}}|, min⁡i′∣Ci′∩S∣≥(1−υ)nNmin⁡i′∣Ci′∣\min_{i^{\prime}}|C_{i^{\prime}}\cap S|\geq(1-\upsilon)\frac{n}{N}\min_{i^{\prime}}|C_{i^{\prime}}|. Combining these bounds with (15) and (16), we have that with probability at least 1−δ1-\delta, for any i≠ji\neq j and any p∈Cip\in C_{i},

Suppose the clustering instance is α\alpha-perturbation resilient to the min-sum objective for α≥6max⁡i∣Ci∣min⁡i∣Ci∣\alpha\geq 6\frac{\max_{i}|C_{i}|}{\min_{i}|C_{i}|}. When n=O(1ρηln⁡Nkδ)n=O(\frac{1}{\rho\eta}\ln{\frac{Nk}{\delta}}), with probability at least 1−δ1-\delta, C∩S\mathcal{C}\cap S is the unique minimum min-sum cost pruning of the tree in Algorithm 5.

With probability at least 1−δ1-\delta, for any three different optimal clusters Ci,Cj,Cl∈CC_{i},C_{j},C_{l}\in\mathcal{C}, and any A⊆Ci∩SA\subseteq C_{i}\cap S,

Now, we use Claim 5.4 to prove the optimality of C∩S\mathcal{C}\cap S. Suppose a pruning P∗\mathcal{P^{*}} is obtained by splitting hh clusters in C∩S\mathcal{C}\cap S and at the same time joining some other clusters into gg unions. Specifically, for 1≤i≤h1\leq i\leq h, split Ci∩SC_{i}\cap S into mi≥2m_{i}\geq 2 clusters Si,1,…,Si,miS_{i,1},\dots,S_{i,m_{i}}; after that, merge Ch+1∩S,…,Ch+lg∩SC_{h+1}\cap S,\dots,C_{h+l_{g}}\cap S into gg unions, that is, for 1≤j≤g1\leq j\leq g and l0=0l_{0}=0, merge lj−lj−1≥2l_{j}-l_{j-1}\geq 2 clusters Ch+lj−1+1∩S,…,Ch+lj∩SC_{h+l_{j-1}+1}\cap S,\dots,C_{h+l_{j}}\cap S into a union UjU_{j}; the other clusters in C∩S\mathcal{C}\cap S remain the same in P∗\mathcal{P^{*}}. Since the number of clusters is still kk, we have ∑imi−h=lg−g\sum_{i}m_{i}-h=l_{g}-g. The cost saved by splitting clusters is

The cost increased by joining clusters is

To prove that C∩S\mathcal{C}\cap S is the unique minimum cost pruning, we need to show that (18) is less than (19). Since each term in (19) is twice larger than any term in (18), it suffices to show that the number of the terms in (19) is at least half the number of the terms in (18). Formally, we need to show

We have 2∑j(lj−lj−12)=∑j(lj−lj−1)(lj−lj−1−1)≥2∑j(lj−lj−1−1)=2(lg−g)2\sum_{j}{l_{j}-l_{j-1}\choose 2}=\sum_{j}(l_{j}-l_{j-1})(l_{j}-l_{j-1}-1)\geq 2\sum_{j}(l_{j}-l_{j-1}-1)=2(l_{g}-g), where the inequality comes from lj−lj−1≥2l_{j}-l_{j-1}\geq 2. Since lg−g=∑imi−hl_{g}-g=\sum_{i}m_{i}-h, it is sufficient to show lg−g≥hl_{g}-g\geq h. This comes from lg−g=∑imi−h=∑i(mi−1)≥∑i1=hl_{g}-g=\sum_{i}m_{i}-h=\sum_{i}(m_{i}-1)\geq\sum_{i}1=h since mi≥2m_{i}\geq 2. ∎

(α,ϵ)𝛼italic-ϵ(\alpha,\epsilon)-Perturbation Resilience for the Min-Sum Objective

Suppose the instance is (α,ϵ)(\alpha,\epsilon)-perturbation resilient to the min-sum objective for α>8max⁡i∣Ci∣min⁡i∣Ci∣\alpha>\frac{8\max_{i}|C_{i}|}{\min_{i}|C_{i}|} and ϵ<min⁡i∣Ci∣600nlog⁡n\epsilon<\frac{\min_{i}|C_{i}|}{600n\log n}. There exists an algorithm that outputs a clustering which is a (1+40ϵnlog⁡nmin⁡i∣Ci∣)\left(1+\frac{40\epsilon n\log n}{\min_{i}|C_{i}|}\right)-approximation to the optimal clustering in polynomial time. Furthermore, the output clustering is also (6ϵlog⁡n)(6\epsilon\log n)-close to the optimal clustering.

Since ϵ=O(min⁡i∣Ci∣nlog⁡n)\epsilon=O\left(\frac{\min_{i}|C_{i}|}{n\log n}\right), the approximation factor is always O(1)O(1) and gets better if ϵ\epsilon gets smaller. To prove the theorem, we first derive new useful structural properties implied by (α,ϵ)(\alpha,\epsilon)-perturbation resilience for min-sum, and then use them to design our algorithm achieving the guarantees in the theorem. Throughout this section, we assume α>8max⁡i∣Ci∣min⁡i∣Ci∣\alpha>\frac{8\max_{i}|C_{i}|}{\min_{i}|C_{i}|} and ϵ<min⁡i∣Ci∣600nlog⁡n\epsilon<\frac{\min_{i}|C_{i}|}{600n\log n}, except for where their values are explicitly specified. Also, since max⁡i∣Ci∣/min⁡i∣Ci∣<n\max_{i}|C_{i}|/\min_{i}|C_{i}|<n we may assume without loss of generality that α≤8n\alpha\leq 8n.

The rest of the section is organized as follows. In Section 6.1, we prove useful properties of the (α,ϵ)(\alpha,\epsilon)-perturbation resilient min-sum instances. We first show that in the optimal clustering, except for a few bad points, all the other points are good in the sense that they are much closer to their own clusters than to any other clusters. Furthermore, we show that there exist a subset of points we call potentially good points which can act as a proxy for the good points in the clustering tasks. Given these properties, we design an algorithm in Section 6.2. We first construct a tree with a pruning close to the optimal clustering, find that pruning, and finally adjust the points so that the pruning becomes the desired approximation.

We describe the high level ideas for the structural properties, and then present the formal proofs in Section 6.1.1 and Section 6.1.2.

The good points and bad points for min-sum are defined as follows. Here β\beta is chosen to be 45α\frac{4}{5}\alpha since we are not able to prove the bound for β=α\beta=\alpha but will be able to when β\beta is slightly smaller than α\alpha. Some other constant can be used instead of 45\frac{4}{5}.

Define bad points for min-sum to be those that are not β\beta times closer to their own clusters than to other clusters, where β=45α\beta=\frac{4}{5}\alpha. That is,

The other points G=S∖BG=S\setminus B are called good points.

Once we bound the number of bad points, it is possible to design approximation algorithms if the influence of the few bad points can be eliminated, since the good points in different optimal clusters are far from each other by definition, and thus can be handled by simple algorithms (such as the variant of average linkage algorithm used for α\alpha-perturbation resilient min-sum instances). However, it is unclear how to compute the bad points or the good points. The key is to introduce a proxy called potentially bad points (potentially good points respectively), which can be easily computed. These notions are formalized as follows.

For a set AA with ∣A∣>2mB|A|>2m_{B}, define the potentially bad points F(A)F(A) to be the 2mB2m_{B} points in AA that are farthest from AA. That is, F(A)⊆A,∣F(A)∣=2mBF(A)\subseteq A,|F(A)|=2m_{B}, and for any p∈F(A)p\in F(A), q∈S∖F(A)q\in S\setminus F(A), d(p,A)≥d(q,A)d(p,A)\geq d(q,A). The potentially good points of AA are defined to be P(A):=A∖F(A)P(A):=A\setminus F(A).

To show that the potentially good points can be regarded roughly as a proxy for the good points, we show that the cost between sufficiently many good points in two clusters accounts for most of the cost between the two clusters (Lemma 27), and that the cost between any points and the potentially good points in a cluster is roughly bounded by the cost between these points and any sufficiently large subset (in particular, the good points) of the cluster (Lemma 28). The first statement is due to that there are just a few bad points and the good points in different clusters are far apart. The second is due to that by definition, the potentially bad points are furthest away from other points in the cluster, so removing other points will not change the cost as much as removing the potentially bad points, even in the worst case.

Since the potentially good points can act as a proxy, the robust average distance approximates the average distance between good points, and the robust min-sum cost computed after removing the potentially bad points approximates the min-sum cost computed after removing the actual bad points. Thus, they can be used to design approximation algorithms using the potentially bad points as if we knew the actual bad points, as done in Section 6.2.

Suppose the clustering instance is (α,ϵ)(\alpha,\epsilon)-perturbation resilient to the min-sum objective for α>4\alpha>4 and ϵ<min⁡i∣Ci∣200n\epsilon<\frac{\min_{i}|C_{i}|}{200n}. Then ∣B∣≤mB=6ϵnlog⁡n|B|\leq m_{B}=6\epsilon n\log n.

We will first show that ∣B∣≤2ηϵn|B|\leq 2\eta\epsilon n where η=⌈log⁡max⁡imax⁡p∈Bid(p,Ci)min⁡imin⁡p∈Bid(p,Ci)⌉\eta=\left\lceil\log\frac{\max_{i}\max_{p\in B_{i}}d(p,C_{i})}{\min_{i}\min_{p\in B_{i}}d(p,C_{i})}\right\rceil, and then show that η≤3log⁡n\eta\leq 3\log n, completing the proof.

As the first step, assume for contradiction ∣B∣>2ηϵn|B|>2\eta\epsilon n. We will construct a perturbation which will eventually lead to a contradiction.

We will show that (21) is larger than (22), leading to the contradiction.

Ui=Ci′∩B^iU_{i}=C^{\prime}_{i}\cap\hat{B}_{i} are the selected bad points in CiC_{i} that need to be moved out.

These different types of points have the following relations:

We now consider the costs saved and added when moving these points for all clusters ii. Suppose we first move out {Wi}i=1k\{W_{i}\}_{i=1}^{k}, then {Vi}i=1k\{V_{i}\}_{i=1}^{k}, and finally {Ui}i=1k\{U_{i}\}_{i=1}^{k}. The cost saved by moving out {Wi}i=1k\{W_{i}\}_{i=1}^{k} is defined as

The cost saved by moving out {Vi}i=1k\{V_{i}\}_{i=1}^{k} is

The cost saved by moving out {Ui}i=1k\{U_{i}\}_{i=1}^{k} is

where the last inequality follows from β≤8n\beta\leq 8n. Then we have η≤3log⁡n\eta\leq 3\log n. ∎

1.2 Properties of Good Points and Potentially Good Points

Since there are just a few bad points and the good points in different clusters are far apart, the cost between sufficiently large subsets of their good points accounts for most of the cost between the two clusters. This means that we would be able to approximate the min-sum cost of all points by the min-sum cost only on the good points, if we knew the good points (Lemma 27). To prove Lemma 27, we will need the triangle inequality for the average distance, and also a technical lemma which shows that good points are much closer to its own cluster than to good points in any other cluster.

For any nonempty A⊆Gi,B⊆Gj,j≠iA\subseteq G_{i},B\subseteq G_{j},j\neq i, we have

Plug the second inequality into the first inequality, then the lemma follows. ∎

Now we turn to analyze the potentially good points. A key property of the potentially good points is the following: for any point pp and any sufficiently large set AA, the cost between pp and the potentially good points in AA is roughly bounded by the cost between pp and any sufficiently large subset HH of AA. See Lemma 28 for details. A specific case is when HH is the actual good points in AA. In this case, the property says that the cost between pp and the potentially good points is roughly bounded by the cost between pp and the actual good points. This means that in suitable situations, we can regard potentially good points as actual good points.

The lemma then follows from these two inequalities and the following claim.

Since ∣X∪V∣=∣F∣=2mB|X\cup V|=|F|=2m_{B} and ∣Y∪V∣=∣A∖H∣≤mB|Y\cup V|=|A\setminus H|\leq m_{B}, we have ∣Y∣∣X∣≤1/2\frac{|Y|}{|X|}\leq 1/2. Then the lemma follows from the fact that ∣A∣≥20mB,∣F∣=2mB|A|\geq 20m_{B},|F|=2m_{B} and ∣A∖H∣≤mB|A\setminus H|\leq m_{B}. ∎

This then completes the proof of Lemma 28. ∎

2 Approximation Bound

In this subsection, we design an approximation algorithm and prove our final result Theorem 22 by utilizing the properties of the (α,ϵ)(\alpha,\epsilon)-perturbation resilience.

First, note that we can generate a list of sufficiently large almost “pure” blobs using Algorithm 3. However, unlike for (α,ϵ)(\alpha,\epsilon)-perturbation resilient kk-median instances, it is not guaranteed that the robust linkage procedure in can link these blobs into a tree so that a pruning of the tree assigns all but bad points correctly. Fortunately, since the potentially good points can act as a proxy for the good points, we can pretend there are only good points. Since the average linkage succeeds in this case (as shown for the α\alpha-perturbation resilient instances), one would expect that the same idea can be applied. Indeed, we apply the idea but using the robust average distance instead of the average distance. As described in Algorithm 7, we first use Algorithm 3 to generate a list of blobs, and then use a robust version of average linkage to link them into a tree: repeatedly merge the two blobs with the minimum robust average distance.

After building the tree, one would like to find the pruning that assigns all but bad points correctly. Suppose we can remove the actual bad points and compute the cost between the good points. Since the good points from different clusters are far apart, the good point cost increased by joining different clusters in C′\mathcal{C}^{\prime} is larger than that saved by splitting clusters in C′\mathcal{C}^{\prime} (Lemma 32). Then any other pruning has larger cost than C′\mathcal{C}^{\prime}. Unfortunately, we do not know the actual good points. Therefore, we consider the potentially good points and compute the robust min-sum cost. We show that the pruning is in fact the pruning with the minimum robust min-sum cost, so that it can be computed in polynomial time by dynamic programming.

However, this pruning may not be a good approximation. For example, consider an instance consisting of two unbalanced clusters. Assume that there is only one bad point, belonging to the small cluster. Further assume the distances between the good points in each cluster are negligible, then assigning the bad point incorrectly to the large cluster will lead to an Ω(max⁡i∣Ci∣min⁡i∣Ci∣)\Omega\left(\frac{\max_{i}|C_{i}|}{\min_{i}|C_{i}|}\right)-approximation. So the pruning C′\mathcal{C}^{\prime} may not be a constant approximation. Notice that the bad point causing trouble in this example can actually be identified: it is closer to its own optimal cluster than to its cluster in C′\mathcal{C}^{\prime}. Then by reassigning the points in C′\mathcal{C}^{\prime}, a better approximation can be computed. It turns out that the reassignment is useful beyond this particular example, and can be used to compute a good approximation for general perturbation resilient instances. The details are described in Algorithm 8.

All these combined together lead to our final algorithm for (α,ϵ)(\alpha,\epsilon)-perturbation resilient min-sum instances, summarized in Algorithm 9.

The rest of the subsection presents the formal proofs. In Section 6.2.1, we show that Algorithm 7 outputs a tree with a pruning that assigns all but bad points correctly. In Section 6.2.2, we show that this pruning can be found in polynomial time by dynamic programming. In Section 6.2.3, we show Algorithm 8 computes a good approximation, completing the proof of Theorem 22.

We now present our guarantee of Algorithm 7.

The tree output in Algorithm 7 has a pruning C′\mathcal{C^{\prime}} that assigns all good points correctly.

To analyze the algorithm, we begin with the following property of good points. When combined with the property of Algorithm 3 (Lemma 14), it immediately shows that each blob in the list L0\mathcal{L}_{0} has size at least 12min⁡i∣Ci∣\frac{1}{2}\min_{i}|C_{i}|, and contains good points from only one optimal cluster.

For any p∈Gip\in G_{i}, all its 4∣Ci∣5\frac{4|C_{i}|}{5} nearest neighbors belong to Ci∪BC_{i}\cup B.

It now suffices to prove by induction that the clustering L∩G\mathcal{L}\cap G is always laminar to C∩G\mathcal{C}\cap G. It is true at the beginning by the property of Algorithm 3. Assume for contradiction that the laminarity is first violated after merging AA and DD. There are two cases:

AA and DD are strict subsets of different optimal clusters;

AA is a strict subset of GiG_{i} while DD is the union of the good points in several optimal clusters.

We have the following statements for the two cases respectively. By these two statements, we should first merge AA with A′A^{\prime} rather than with DD, which is contradictory and completes the proof.

(1) It follows from the following three statements:

We now prove the statements respectively.

(a) For simplicity, let GA=A∩G,GD=D∩GG_{A}=A\cap G,G_{D}=D\cap G. From Lemma 26, we have

where the last step follows from α≥6max⁡i∣Ci∣min⁡i∣Ci∣+2\alpha\geq 6\frac{\max_{i}|C_{i}|}{\min_{i}|C_{i}|}+2, ∣Gi∖A∣|G_{i}\setminus A| is at least 12min⁡i∣Ci∣−mB\frac{1}{2}\min_{i}|C_{i}|-m_{B}.

(b) By Lemma 28 and the fact that ∣A∣≥12min⁡i∣Ci∣,∣A′∣≥12min⁡i∣Ci∣|A|\geq\frac{1}{2}\min_{i}|C_{i}|,|A^{\prime}|\geq\frac{1}{2}\min_{i}|C_{i}| and min⁡i∣Ci∣>100mB\min_{i}|C_{i}|>100m_{B}, we have

Then the claim follows from the fact that ∣P(A)∣≥4850∣A∣,∣P(A′)∣≥4850∣A′∣|P(A)|\geq\frac{48}{50}|A|,|P(A^{\prime})|\geq\frac{48}{50}|A^{\prime}|.

(c) For simplicity, let GA=A∩G,GD=D∩GG_{A}=A\cap G,G_{D}=D\cap G. Divide GAG_{A} into two parts: WA=GA∩P(A)W_{A}=G_{A}\cap P(A) and XA=GA∩F(A)X_{A}=G_{A}\cap F(A). Define WDW_{D} and XDX_{D} similarly. See Figure 9 for an illustration.

Since ∣XD∣≤2mB|X_{D}|\leq 2m_{B} and ∣D∣≥12min⁡i∣Ci∣≥50mB|D|\geq\frac{1}{2}\min_{i}|C_{i}|\geq 50m_{B}, we have

(2) The proof idea is similar to that for Claim 6.4.(1). The only difference is the proof for

Since D∩G=∪j∈IDGjD\cap G=\cup_{j\in I_{D}}G_{j}, it suffices to show that

for any j∈IDj\in I_{D}, which can be proved by the same argument as in Claim 6.4.(1). ∎

Applying the claim completes the proof of Lemma 29. ∎

2.2 Getting A Pruning Close to the Optimal Clustering

We now show that the pruning C′\mathcal{C}^{\prime} that assigns all good points correctly is the pruning with the minimum robust min-sum cost.

Suppose the pruning C′={C1′,…,Ck′}\mathcal{C}^{\prime}=\{C^{\prime}_{1},\dots,C^{\prime}_{k}\} in tree T\mathcal{T} assigns all good points correctly. Then C′\mathcal{C}^{\prime} is the minimum robust min-sum cost pruning in the tree.

Computing the robust min-sum cost will eliminate the effect of the bad points and work as if we knew the actual good points: the robust min-sum cost saved by splitting a node is at most the good point cost saved (Claim 6.5), and the robust min-sum cost increased by merging two nodes is of the same order as the good point cost increased (Claim 6.6 and Corollary 31).

Let C=Ci′∪Cj′,F=F(C),P=P(C)C=C^{\prime}_{i}\cup C^{\prime}_{j},F=F(C),P=P(C), and G=Gi∪Gj,Gˉ=C∖GG=G_{i}\cup G_{j},\bar{G}=C\setminus G. Define Wi=Gi∩P,Xi=Gi∩FW_{i}=G_{i}\cap P,X_{i}=G_{i}\cap F; define WjW_{j}, XjX_{j} similarly. Also, define Y=P∩Gˉ,V=F∩GˉY=P\cap\bar{G},V=F\cap\bar{G}. See Figure 10. Then the left-hand side of the statement is

The same argument as that for Claim 6.6 leads to a corollary for the general case when multiple clusters are merged.

Let I⊆[k]I\subseteq[k]. Suppose for any t∈It\in I, ∣Ct∣≥100mB|C_{t}|\geq 100m_{B}, and Ct′C^{\prime}_{t} contains all good points in CtC_{t} but no good points in other optimal clusters. Then

Besides these claims, another key property we need is that the good points in different optimal clusters are far apart in the sense that the good points from two different clusters have cost much larger than those in a third cluster have, as formalized in Lemma 32. The proof of this lemma is technical and not related to the other parts of the proof, so we defer it to Appendix C.2.

Given the claims and Lemma 32, We are now ready to prove Lemma 30.

First, by Lemma 32, good points from different clusters are far apart while good points in the same cluster are close. Second, by Claim 6.5 and Corollary 31, the cost of good points can be approximated by the cost of the potentially good points (the robust min-sum cost). We now use the above lemmas to show that C′\mathcal{C}^{\prime} has minimum robust min-sum cost, so that we can use dynamic programming on the tree to get the pruning.

Suppose a pruning P\mathcal{P} is obtained by splitting hh clusters in C′\mathcal{C}^{\prime} and at the same time joining some other clusters into gg unions. Specifically, for 1≤i≤h1\leq i\leq h, split Ci′C^{\prime}_{i} into mi≥2m_{i}\geq 2 clusters Si,1,…,Si,miS_{i,1},\dots,S_{i,m_{i}}; after that, merge Ch+1′,…,Ch+lg′C^{\prime}_{h+1},\dots,C^{\prime}_{h+l_{g}} into gg unions, that is, for 1≤j≤g1\leq j\leq g, l0=0l_{0}=0, merge lj−lj−1≥2l_{j}-l_{j-1}\geq 2 clusters Ch+lj−1+1′,…,Ch+lj′C^{\prime}_{h+l_{j-1}+1},\dots,C^{\prime}_{h+l_{j}} into a union UjU_{j}; the other clusters in C′\mathcal{C}^{\prime} remain the same in P\mathcal{P}. Since the number of clusters is still kk, we have ∑imi−h=lg−g\sum_{i}m_{i}-h=l_{g}-g.

By Claim 6.5, the cost saved by splitting the hh clusters is

The cost increased by joining clusters is

where the first inequality follows from Claim 6.5, and the second inequality follows from Corollary 31. To prove C′\mathcal{C}^{\prime} is the minimum cost pruning, we need to show that the saved cost (32) is less than the increased cost (33). Since by Lemma 32, each term in (33) is larger than any term in (32), it is sufficient to show that the number of the terms in (33) is no less than the number of the terms in (32), that is ∑1≤j≤g(lj−lj−12)≥h.\sum_{1\leq j\leq g}{l_{j}-l_{j-1}\choose 2}\geq h. We have ∑j(lj−lj−12)=12∑j(lj−lj−1)(lj−lj−1−1)≥∑j(lj−lj−1−1)=lg−g\sum_{j}{l_{j}-l_{j-1}\choose 2}=\frac{1}{2}\sum_{j}(l_{j}-l_{j-1})(l_{j}-l_{j-1}-1)\geq\sum_{j}(l_{j}-l_{j-1}-1)=l_{g}-g, where the inequality is from lj−lj−1≥2l_{j}-l_{j-1}\geq 2. Since mi≥2m_{i}\geq 2, lg−g=∑i−1hmi−h≥hl_{g}-g=\sum_{i-1}^{h}m_{i}-h\geq h, which completes the proof. ∎

2.3 Getting a Good Approximation

We now show that Algorithm 8 outputs a good approximation. We first prove that after reassignment all good points are still assigned correctly (Lemma 33), and then bound the cost.

where the last step follows from Lemma 28. ∎

We are now ready to prove our final result.

Proof of Theorem 22. By Lemma 33, all the good points in CiC_{i} are assigned correctly to Ci′′C^{\prime\prime}_{i}. Let Ai=Ci′′∖GiA_{i}=C^{\prime\prime}_{i}\setminus G_{i} denote all the bad points assigned to Ci′′C^{\prime\prime}_{i}. The cost of the output clustering C′′\mathcal{C^{\prime\prime}} can be written as follows.

Let Wi=P(Ci′)∩GiW_{i}=P(C^{\prime}_{i})\cap G_{i}. See Figure 11 for an illustration. By Fact 6.1,

where the second step follows from Lemma 28 and the last from ∣Xj∣≤2mB|X_{j}|\leq 2m_{B} and ∣Yj∣≤mB|Y_{j}|\leq m_{B}. Then

The claim follows from the inequalities (6.2.3), (37) and ∣Xi∣≤2mB,∣Ai∣≤mB|X_{i}|\leq 2m_{B},|A_{i}|\leq m_{B}. ∎

The proof of correctness is completed by combining Claim 6.7, (6.2.3), and (35).

Algorithm 3 takes time O(nω+1)O(n^{\omega+1}) (as shown in the proof of Theorem 16), and the rest steps of Algorithm 7 take time O(n3)O(n^{3}). Finding the minimum robust min-sum cost pruning in the tree output by Algorithm 7 takes time O(n3)O(n^{3}), and Algorithm 8 takes time O(n3)O(n^{3}). So the total running time is O(nω+1)O(n^{\omega+1}).

Discussion and Open Questions

We advance the line of research on clustering under perturbation resilience in multiple ways. For α\alpha-perturbation resilient instances, we improve on the known guarantees for center-based objectives and give the first analysis for min-sum. Furthermore, for kk-median and min-sum, we analyze and give the first algorithmic guarantees known for a relaxed but more challenging condition of (α,ϵ)(\alpha,\epsilon)-perturbation resilience, where an ϵ\epsilon fraction of points are allowed to move after perturbation. We also give sublinear-time algorithms for kk-median and min-sum under perturbation resilience.

A natural direction for future investigation is to explore whether one can take advantage of smaller perturbation factors for perturbation resilient instances in Euclidian spacesThat is, where dd is a Euclidean metric, though as in Definitions 1 and 4, d′d^{\prime} need not be. Alternatively, one could also consider a natural version of Definitions 1 and 4 in which d′d^{\prime} must be Euclidean as well, and in fact implemented via a perturbation of coordinate values.. More broadly, it would be interesting to explore other ways in which perturbation resilient instances behave better than worst case instances (e.g., natural algorithms converge faster).

Another interesting direction is to design clustering algorithms under perturbation resilience whose output satisfies certain privacy requirements. For example, some stability notions can be useful for differential private analysis . It would be interesting to explore the perturbation resilience property and design efficient clustering algorithms that preserve differential privacy.

We thank Avrim Blum for numerous useful discussions. This work was supported in part by NSF grants CCF-0953192, CCF-1101283, CCF-1451177, ONR N00014-09-1-0751, AFOSR grant FA9550-09-1-0538, a Microsoft Faculty Fellowship, a Google Research Award, and a Sloan Fellowship.

References

Appendix A Finding the Minimum Cost k𝑘k-Cluster Pruning

The idea of using dynamic programming to find the optimal kk-clustering in a tree of clusters is proposed in . We can find the optimal clustering by examining the entire tree of clusters produced.

First recall our setting. Suppose we have a tree whose leaves are the data points. Each internal node of the tree represents a cluster that contains all points in the clusters represented by its children. Also suppose that the clustering objective is separable: (1) the objective function value of a given clustering is either a (weighted) sum or the maximum of the individual cluster scores; (2) given a proposed single cluster, its score can be computed in polynomial time. Our goal is to find a pruning of the tree that has kk clusters and has minimum cost.

Appendix B An Efficient Implementation of Algorithm 1

Here we show an efficient implementation of Algorithm 1, namely Algorithm 11. This implementation takes time only O(n3)O(n^{3}).

Note that at each merge step in Algorithm 1, we only need to find the two clusters with the minimum closure distance. So we hope to compute the minimum closure distance without computing all the distances between any two current clusters. First we notice the following facts.

In the execution of Algorithm 1, if dd is the minimum closure distance for the current clustering, then

there exist c,p∈Sc,p\in S such that d=d(c,p)d=d(c,p);

dd is no less than the minimum closure distances in previous clusterings.

For the first claim, let cc be the center of the ball in the definition of closure distance, and pp be the farthest point from the center in the ball, then d=d(c,p)d=d(c,p). The second claim comes from the fact that the clusters in the current clustering are supersets of those in previous clusterings. ∎

Fact B.1 implies that we can check in ascending order the pairwise distances no less than the minimum closure distance in the last clustering, and determine if the checked pairwise distance is the minimum closure distance in the current clustering. More specifically, suppose we have some black-box method for checking if a pairwise distance is the minimum closure distance in the current clustering, we can perform the closure linkage as follows: sort the pairwise distances in a list in ascending order; start from the first distance in the list; check if the current distance is the minimum closure distance in the current clustering; if it is, merge clusters covered by the ball defined by the checked distance; continue to check the next distance in the list. So it is sufficient to design a method to determine if a pairwise distance is the minimum closure distance in the current clustering. Our method is based on the following facts.

In Algorithm 1, if d(c,p)d(c,p) is the minimum closure distance for the current clustering, then

Notice if a pairwise distance satisfies the three claims, then it defines a closure distance for the clusters covered. So if we check the pairwise distances in ascending order, then the first one that satisfies the three claims must be the minimum closure distance in the current clustering. So we have a method to determine if a pairwise distance is the minimum closure distance.

However, naively checking the third claim in Fact B.2 takes O(n2)O(n^{2}), which is still not good enough. We can refine this step since intuitively, for every cc, if d(c,q)d(c,q) comes after d(c,p)d(c,p) in the distance list, then when checking d(c,q)d(c,q), we can utilize the information obtained from checking d(c,p)d(c,p). To do so, we introduce some notations.

For every p∈Sp\in S, define Lp=(L1p,…,Lnp)L^{p}=(L^{p}_{1},\dots,L^{p}_{n}) to be a sorted list of points in SS, according to their distances to pp in ascending order.

Define χ∗(p,i)\chi^{*}(p,i) to be the maximum j>ij>i such that there exits s≤is\leq i satisfying d(p,Lsp)≥d(Lsp,Ljp)d(p,L^{p}_{s})\geq d(L^{p}_{s},L^{p}_{j}); if no such point LjpL^{p}_{j} exists, let χ∗(p,i)=−1\chi^{*}(p,i)=-1.

Define χ(p,i)\chi(p,i) to be the maximum j>ij>i such that d(p,Lip)≥d(Lip,Ljp)d(p,L^{p}_{i})\geq d(L^{p}_{i},L^{p}_{j}); if no such jj exists, let χ(p,i)=−1\chi(p,i)=-1.

Intuitively, χ∗(p,i)\chi^{*}(p,i) is the index of the farthest point in LpL^{p}, which makes d(p,Lip)d(p,L^{p}_{i}) fail the third claim in Fact B.2. Then d(p,Lip)d(p,L^{p}_{i}) satisfies the third claim if and only if χ∗(p,i)=−1\chi^{*}(p,i)=-1, thus we turn the task of checking the claim into computing χ∗(p,i)\chi^{*}(p,i). In order to use the information obtained when previously checking d(p,Li−1p)d(p,L^{p}_{i-1}), we compute χ∗(p,i)\chi^{*}(p,i) from χ∗(p,i−1)\chi^{*}(p,i-1). By the definition of χ∗\chi^{*}, χ∗(p,i)\chi^{*}(p,i) is either the maximum j>ij>i such that there exits s≤i−1s\leq i-1 satisfying d(p,Lsp)≥d(Lsp,Ljp)d(p,L^{p}_{s})\geq d(L^{p}_{s},L^{p}_{j}), or the maximum j>ij>i there exits s=is=i satisfying d(p,Lsp)≥d(Lsp,Ljp)d(p,L^{p}_{s})\geq d(L^{p}_{s},L^{p}_{j}). Then it is easy to verify that

It takes O(n)O(n) time to compute χ(p,i)\chi(p,i), thus we can compute χ∗(p,i)\chi^{*}(p,i) for all p∈S,1≤i≤np\in S,1\leq i\leq n in O(n3)O(n^{3}) time. The implementation is finally summarized in Algorithm 11.

Appendix C (α,ϵ)𝛼italic-ϵ(\alpha,\epsilon)-Perturbation Resilient Min-Sum Instances

We are ready to prove the claim needed for bounding the number of bad points.

The claim follows by summing (40) and (41) over 1≤i≤k1\leq i\leq k and plugging in the last two inequalities. ∎

The claim follows by summing (42) and (43) over 1≤i≤k1\leq i\leq k and plugging the last two inequalities. ∎

The claim follows by summing (44) and (C.1) over 1≤i≤k1\leq i\leq k and plugging the last two inequalities. ∎

C.2 Properties of Good Points in Min-Sum

To bound the cost of C′={Ct′}\mathcal{{C^{\prime}}}=\{{C^{\prime}_{t}}\}, we compare it to the cost of the optimal clustering C={Ct}\mathcal{C}=\{C_{t}\} before perturbation. If C′=C\mathcal{{C^{\prime}}}=\mathcal{C}, then the cost is only increased by blowing up the distances between AA and Ci∖AC_{i}\setminus A (Claim C.1). However, the optimal clustering may change after the perturbation, so we need to consider how much cost is saved by the change (Claim C.2).

Suppose α>6max⁡i∣Ci∣min⁡i∣Ci∣\alpha>\frac{6\max_{i}|C_{i}|}{\min_{i}|C_{i}|} and min⁡i∣Ci∣≥100mB\min_{i}|C_{i}|\geq 100m_{B}. We have

Let Kt=Ct∩Ct′,At=Ct′∖Ct,Mt=Ct∖Ct′K_{t}=C_{t}\cap{C^{\prime}_{t}},A_{t}={C^{\prime}_{t}}\setminus C_{t},M_{t}=C_{t}\setminus{C^{\prime}_{t}}. See Figure 12 for an illustration. We have

The first term on the right-hand side corresponds to the cost increased by blowing up the distances within the clusters, the second term corresponds to the cost increased by moving points away. We will bound the two terms respectively in the following two claims, which then lead to the lemma.

Let l(p)l(p) denote the index of the optimal cluster in C\mathcal{C} that pp falls in: if p∈Ctp\in C_{t}, then l(p)=tl(p)=t. Similarly, let l′(p)l^{\prime}(p) denote the optimal cluster in C′\mathcal{{C^{\prime}}} that pp falls in after perturbation: if p∈Ct′p\in{C^{\prime}_{t}}, then l′(p)=tl^{\prime}(p)=t.

By the definition of the perturbation, we have

Let X=(∪tAt)∖(Al∩Cj)∖(Aj∩Cl)X=(\cup_{t}A_{t})\setminus(A_{l}\cap C_{j})\setminus(A_{j}\cap C_{l}).

Since X⊆∪tAtX\subseteq\cup_{t}A_{t}, and ∣Ct∣≥100∣At∣|C_{t}|\geq 100|A_{t}|, the second term on the right-hand side is bounded by

The claim follows from the inequalities (46), (47), and (48). ∎

The proof is completed by combining the two claims. ∎