A bi-criteria approximation algorithm for $k$ Means

Konstantin Makarychev, Yury Makarychev, Maxim Sviridenko, Justin Ward

Introduction

The kk-means clustering problem is one of the most popular models for unsupervised Machine Learning. The problem is formally defined as follows.

The most common heuristic for kk-means is Lloyd’s algorithm introduced in 1957 . Llloyd’s algorithm starts with some initial solution and then iteratively improves it by alternating two steps: at the first step, the algorithm picks the optimal clustering for the current set of centers; at the second step, the algorithm picks the optimal set of centers for the current clustering. While we know that the algorithm performs well on well-clusterable data it performs arbitrarily badly on general instances. There exist many variants of this algorithm and many heuristics for picking the initial solution. Unfortunately, none of them give a constant (not depending on kk) factor approximation. One of the most popular ones is the kk-means++ algorithm that has an O(log⁡k)O(\log k)-approximation factor .

The general kk-means clustering problem has recently been shown to be APX-hard, ruling out a PTAS in the general case . However, a variety of PTASes exist for special cases of the problem. Inaba, Katoh, and Imai gave a (1+ε)(1+\varepsilon)-approximation algorithm for the case in which the number of clusters, kk, and the dimension of the space, dd, are fixed. Since then many more PTASes were proposed for other special cases. Additionally, there are many results showing the NP-hardness for several special cases .

The best constant factor approximation algorithm for the general case of the problem was proposed by a decade ago. Their algorithm gives 9+ε9+\varepsilon factor approximation. Using the connection with kk-median problem designed an alternative constant factor approximation algorithm. showed that running the kk-means++ algorithm for more steps gives an α=4+ε\alpha=4+\varepsilon factor approximation by opening ⌈16(k+k)⌉\lceil 16(k+\sqrt{k})\rceil centers, and also showed how to modify the resulting solution to obtain a set of kk centers attaining an O(1)O(1) factor guarantee.

In most practical applications the target number kk of clusters is not fixed in advance, rather we would like to find a number kk that provides a well-clusterable solution. Here, we show how to substantially improve the approximation factor by slightly violating the constraint on the number of clusters. We present bi-criteria approximation algorithms for the general case of the problem. A (β,α)(\beta,\alpha) bi-criteria approximation algorithm finds a solution with βk\beta k clusters, whose cost is at most α\alpha times the optimal cost of a solution using kk clusters. In contrast to the approach of , our algorithms find an approximate solution for every β>1\beta>1. Our approximation is always at most 99, and decreases rapidly with β\beta. In particular, we obtain a 44-approximation by opening only 1.65k1.65k centers, improving over previous results by a factor of nearly 10, and obtain improved approximation factors α(β)\alpha(\beta) as β\beta continues to grow. For example, α(1.3)<6.45\alpha(1.3)<6.45, α(1.5)<4.8\alpha(1.5)<4.8; α(2)<2.59\alpha(2)<2.59, and α(3)<1.4\alpha(3)<1.4. In general, we argue that in many applications the number of clusters is not important as long as it approximately equals kk. For these applications we can obtain an approximation factor very close to 1.

We give three bi-criteria algorithms—two based on linear programming and one based on local search. We show the algorithms’ approximation factors as a function of β\beta in Figure 1. Note that our linear programming algorithm attains a better approximation α\alpha for large β\beta, while the local search algorithm is better for β\beta near 1.

In the kk-median problem, we are given a set of points D\cal D, a set of potential center locations C{\cal C} and a distance function (d(i,j))i∈C,j∈D(d(i,j))_{i\in{\cal{C}},j\in{\cal{D}}}. The cost of assigning point jj to center ii is d(i,j)d(i,j). Our goal is to open at most kk centers and assign each point to a center so as to minimize the total cost.

The first approximation algorithms for the kk-median problem were given by , who gave an LP-rounding algorithm that attains an approximation factor of 1+ε1+\varepsilon by opening O(kln⁡n)O(k\ln n) centers (i.e. a (1+ϵ,O(ln⁡n))(1+\epsilon,O(\ln n)) bi-criteria approximation). In further work, showed that if the distance function dd is a metric, it is possible to obtain a 2(1+ε)2(1+\varepsilon) approximation algorithm by opening only (1+1/ε)k(1+1/\varepsilon)k centers. The first constant-factor approximation for the metric kk-median problem using only kk centers was obtained by , who showed that a simple local search algorithm gives a 3+ε3+\varepsilon approximation. This remained the state of the art, until recently, when gave a 2.732+ε2.732+\varepsilon approximation algorithm based on LP rounding. Subsequently, this has been improved to 2.611+ε2.611+\varepsilon by .

We give three approximation algorithms. The first algorithm is based on linear programming. It gives

approximation (see also (11) for a slightly tighter bound). The second algorithm is based on local search. It gives

approximation. The third algorithm is also based on linear programming. It gives

approximation. The algorithm is similar to the first algorithm, but it uses pipage rounding (see ) instead of randomized rounding. In the conference version of the paper, we omit the description of the third algorithm. The approximation factors are shown in Figure 1.

In Section 2 we introduce the notation that we shall use throughout the rest of the paper and review standard notions related to both the kk-means and kk-median problems. In Section 3, we give the details of our reduction to kk-median. Finally, in Sections 4 and 5, respectively, we present our main LP-based algorithm and local search algorithm for the resulting kk-median instances.

Preliminaries

We now fix some notation, and recall some basic properties of kk-means solutions and the standard linear program for the kk-median problem. Additionally, we define the notion of an α\alpha-relaxed 3-hop triangle inequality, which will be crucial to the analysis of our LP-rounding algorithms.

Note that to describe an optimal solution to the kk-means problem, it is sufficient to specify either all clusters or all centers in the solution. Indeed, given a list of clusters S1,…,SkS_{1},\dots,S_{k}, we can find the optimal assignment of centers cic_{i} for it: the optimal choice of center cic_{i} for SiS_{i} is 1∣Si∣∑xj∈Sixj\frac{1}{|S_{i}|}\sum_{x_{j}\in S_{i}}x_{j}. For this choice of cic_{i}, we have

Given a partition S=⟨S1,…,Sk⟩S=\left\langle S_{1},\ldots,S_{k}\right\rangle of XX into clusters, we then denote by cost⁡X(S)\operatorname{cost}_{X}(S) the cost of this optimal choice of centers. That is,

Similarly, given a list CC of centers c1,…,ckc_{1},\dots,c_{k}, we can find the optimal partition S=⟨S1,…,Sk⟩S=\left\langle S_{1},\ldots,S_{k}\right\rangle of XX into clusters. For each c∈Cc\in C, let NC(c)N_{C}(c) be the set of those points x∈Xx\in X that are closer to cic_{i} than to other centers cj≠cic_{j}\neq c_{i} (if a point xx is at the same distance from several centers, we break the ties arbitrarily). The optimal partition for CC then sets Si=NC(ci)S_{i}=N_{C}(c_{i}). Given a set CC of kk centers, we define cost⁡X(C)≡cost⁡X(T)\operatorname{cost}_{X}(C)\equiv\operatorname{cost}_{X}(T), where T=⟨NC(c1),…,NC(ck)⟩T=\left\langle N_{C}(c_{1}),\ldots,N_{C}(c_{k})\right\rangle is the partition induced by CC.

2 k𝑘k-median

We will reduce a given instance XX of kk-means problem to an instance of the kk-median problem, specified by ⟨D,C,d⟩\langle{\cal{D}},{\cal{C}},d\rangle. By analogy with kk-means problem, we can consider a partition S=S1,…,SkS=S_{1},\ldots,S_{k} of demand points from D{\cal{D}}, and then consider the best choice of a single center for each partition. We denote the cost of this choice by cost⁡D,d(S)\operatorname{cost}_{{\cal{D}},d}(S):

Similarly, given a list of kk centers C=⟨c1,…,ck⟩C=\left\langle c_{1},\ldots,c_{k}\right\rangle, let NC(ci)N_{C}(c_{i}) be the set of those demand points x∈Dx\in{\cal{D}} that are closer (according to the distance function dd) to cic_{i} than to any other center in CC (again, if a point xx is at the same distance from several facilities, we break ties arbitrarily). As in the case of kk-means, we define cost⁡D,d(C)≡cost⁡D,d(T)\operatorname{cost}_{{\cal{D}},d}(C)\equiv\operatorname{cost}_{{\cal{D}},d}(T) where T=⟨NC(c1),…,NC(ck)⟩T=\left\langle N_{C}(c_{1}),\ldots,N_{C}(c_{k})\right\rangle is the partition of D{\cal{D}} induced by CC.

Although the distance function dd in our kk-median instances will not satisfy the standard triangle inequality, we can show that it satisfies a relaxed variant of the following sort:

We say that dd satisfies an α\alpha-relaxed 33-hop triangle inequality on D∪C{\cal{D}}\cup{\cal{C}} if, for any j,j′∈Dj,j^{\prime}\in{\cal{D}} and i,i′∈Ci,i^{\prime}\in{\cal{C}}, we have

Specifically, we shall show that the distances produced by our reduction satisfy a 33-relaxed 33-hop triangle inequality.

Reduction from k𝑘k-means to k𝑘k-median

We now give the details of our reduction from the kk-means to the kk-median problem. In the kk-median problem, a finite set C{\cal{C}} of candidate centers is specified, while in the kk-means problem, the ideal center for each cluster SiS_{i} of points is given by the centroid of SiS_{i}. Ideally, we want to ensure that for every possible centroid of the original kk-means instance, there is some nearby candidate centers in C{\cal{C}}. The following notion of an ε\varepsilon-approximate centroid set, introduced by , captures this requirement.

Observe that if C{\cal{C}} is an ε\varepsilon-approximate centroid set for XX, then for every set of kk centers CC (in particular, for the optimal set C∗C^{*}), there exists a kk-point subset C~⊂C\widetilde{C}\subset{\cal{C}} such that

Thus, if we restrict our search for kk center points in kk-means problem to only those points of C{\cal{C}}, we lose at most a factor of (1+ε)(1+\varepsilon).

Unfortunately, in our setting, the dimension pp of the space in which points x1,…,xnx_{1},\dots,x_{n} lie may be as large as nn. Thus, in order to apply Theorem 5, we first embed XX into a low-dimensional space using the Johnson–Lindenstrauss transform.

We say that the map φ\varphi is a dimension reduction transform for XX.

1. For every ε∈(0,1/2)\varepsilon\in(0,1/2), there exists a polynomial-time reduction from kk-means to kk-median with distance function that satisfies the 3-relaxed 3-hop triangle inequality. Specifically, given an instance XX of kk-means, the reduction outputs an instance ⟨D,C,d⟩\langle{\cal{D}},{\cal{C}},d\rangle of kk-median with ∣D∣=∣X∣|{\cal{D}}|=|X|, ∣C∣=nO(log⁡(1/ε)/ε2)|{\cal{C}}|=n^{O(\log(1/\varepsilon)/\varepsilon^{2})}, and distance dd that satisfies the 3-relaxed 3-hop triangle inequality such that

where S=⟨S1,…,Sk⟩S=\left\langle S_{1},\ldots,S_{k}\right\rangle is a partition of D{\cal{D}} and ψ(S)=⟨ψ(S1),…,ψ(Sk)⟩\psi(S)=\left\langle\psi(S_{1}),\ldots,\psi(S_{k})\right\rangle is the corresponding partition of XX. The reduction runs in time nO(log⁡(1/ε)/ε2)n^{O(\log(1/\varepsilon)/\varepsilon^{2})}.

Algorithm for k𝑘k-Median with Relaxed Triangle Inequality

We now turn to the problem of approximating the kk-median instance from Theorem 7. Our first algorithm is based on the following standard linear programming relaxation for the kk-median problem:

In the integral solution, each variable ycy_{c} indicates whether the center cc is open; and each variable zxcz_{xc} indicates whether the point xx is assigned to the center cc. Constraint (4) asserts that we should open exactly kk centers; constraint (5) ensures that every point is assigned to exactly one center; finally, constraint (6) says that points can be assigned only to open centers. In a fractional LP solution, all zxcz_{xc} and ycy_{c} lie in the interval $.Notethatintheintegralsolution,. Note that in the integral solution,z_{xc}=y_{c},if, ifz_{xc}>0(asboth(as bothz_{xc}andandy_{c}mustbeequaltomust be equal to1).WecanslightlychangeanyfeasibleLPsolutionsoitalsosatisfiesthisproperty.Specifically,wesplitanycenter). We can slightly change any feasible LP solution so it also satisfies this property. Specifically, we split any centercwhichdoesnotsatisfywhich does not satisfyy_{c}=z_{xc}(forsome(for somex\in X)intwoco−locatedcenters) in two co-located centersc_{1}andandc_{2}:onewithweight: one with weightz_{xc}andtheotherwithweightand the other with weighty_{c}-z_{xc}.Wedistributetheweights. We distribute the weightsz_{x^{\prime}c}amongthemasfollows:weletamong them as follows: we letz_{x^{\prime}c_{1}}=\min(z_{x^{\prime}c},y_{c_{1}});;z_{x^{\prime}c_{2}}=y_{c_{2}}-\min(z_{x^{\prime}c},y_{c_{1}}).Notethatthisisastandardassumptioninthe. Note that this is a standard assumption in thek−medianliterature.Wereferthereaderto(seeLemma1)andformoredetails.Thevalues-median literature. We refer the reader to (see Lemma 1) and for more details. The valuesy_{c}definethemeasuredefine the measureyonon{\cal{C}}::y(C)=\sum_{c\in C}y_{c}.Intheroundingalgorithmandintheanalysis,itwillbeconvenienttothinkofthismeasureasof“continuousmeasure”:Thatis,ifneededwewillsplitthecentersintoco−locatedcenterstoensurethatwecanfindasetofanygivenmeasure. In the rounding algorithm and in the analysis, it will be convenient to think of this measure as of “continuous measure”: That is, if needed we will split the centers into co-located centers to ensure that we can find a set of any given measure\mu$.

For every point x∈Xx\in X, let Cx={c∈C:zxc>0}C_{x}=\{c\in{\cal{C}}:z_{xc}>0\}. The set CxC_{x} contains all centers that serve xx in the LP solution. Recall that we modify the solution so that yc=zxcy_{c}=z_{xc} if zxc>0z_{xc}>0. Hence, yc=zxcy_{c}=z_{xc} if x∈Cxx\in C_{x}. For every point x∈Xx\in X, we define its LP radius RxR_{x} as:

Observe, that the LP value, which we denote by LPLP, equals ∑x∈XRx\sum_{x\in X}R_{x}.

Algorithm. We now describe our LP-rounding algorithm for kk-Medians with relaxed 33-hop triangle inequality.

There exists a (β,α)(\beta,\alpha) bi-criteria approximation algorithm for kk-means with

The algorithm first solves the LP problem and modifies the LP solution as described above if necessary. Then, it partitions all centers into βk\beta k groups Z∈ZZ\in{\cal{Z}}, each with LP measure 1/β1/\beta. It picks one center cc at random from each group ZZ with probability βyc\beta y_{c} (note, that ∑c∈Zβyc=1\sum_{c\in Z}\beta y_{c}=1). The algorithm outputs the set of βk\beta k chosen centers, and assigns every point to the closest center.

We now describe the construction of Z{\cal{Z}} in more detail. We partition centers into βk\beta k groups as follows. For every x∈Xx\in X, we find the unique ball BxB_{x} around xx whose LP weight exactly equals 1/β1/\beta (To do so, we may split some centers, and pick some centers in BxB_{x} at the boundary of the ball but not the others). We find a subset of points W{\cal{W}} such that balls BxB_{x} with x∈Wx\in{\cal{W}} are disjoint, and for every point x∈Xx\in X, we also define a “witness” w(x)∈Ww(x)\in{\cal{W}}. To this end, we sort all points x∈Xx\in X by the LP radius RxR_{x} in the ascending order, and then consider them one by one. For each x∈Xx\in X, if BxB_{x} is disjoint from all previously chosen balls, then we add xx to the set W{\cal{W}}, we set w(x)=xw(x)=x. Otherwise, if BxB_{x} intersects some other ball Bx′B_{x^{\prime}} that is already chosen, we discard BxB_{x} and set w(x)=x′w(x)=x^{\prime}. If there are several balls Bx′B_{x^{\prime}} intersecting BxB_{x}, we pick the first x′x^{\prime} according to our ordering as the witness. Note, that Rw(x)≤RxR_{w(x)}\leq R_{x} for all xx. Once, we found a disjoint collection of balls {Bx:x∈W}\{B_{x}:x\in{\cal W}\}, we add them to the set Z{\cal{Z}}. We partition centers not covered by ∪x∈WBx\cup_{x\in{\cal{W}}}B_{x} into groups of LP weight 1/β1/\beta arbitrarily and add these groups to Z{\cal{Z}}. Thus, we obtain a partitioning Z{\cal{Z}} of all centers into groups of LP weight 1/β1/\beta.

Analysis. We show that the algorithm returns a valid solution, and then prove an upper bound on its expected cost. The algorithm picks exactly one vertex from each group, so it always picks βk\beta k vertices. Hence, it always outputs a valid solution.

Fix x∈Xx\in X. Recall, that Cx={c:zxc>0}C_{x}=\{c:z_{xc}>0\} is the set of all centers that serve xx in the LP solution. We upper bound d(x,S)d(x,S) by d(x,(Cx∪Bw(x))∩S)d(x,(C_{x}\cup B_{w(x)})\cap S), which is the distance to the closest center in Cx∪Bw(x)C_{x}\cup B_{w(x)} chosen by the algorithm. Note that the solution SS always contains at least one center in Bw(x)B_{w(x)}, so (Cx∪Bw(x))∩S≠∅(C_{x}\cup B_{w(x)})\cap S\neq\varnothing. For the proof, we pick a particular (random) center f(x)∈(Cx∪Bw(x))∩Sf(x)\in(C_{x}\cup B_{w(x)})\cap S.

We define f(x)f(x) using the following randomized procedure. Consider the partitioning Z{\cal{Z}} of all centers into groups of measure 1/β1/\beta used by the algorithm. Let Z~={Z∩Cx:Z∈Z; Z∩Cx≠∅}\widetilde{\cal{Z}}=\{Z\cap C_{x}:Z\in{\cal{Z}};\,Z\cap C_{x}\neq\varnothing\} be the induced partitioning of the set CxC_{x}. For all Z~∈Z~\widetilde{Z}\in\widetilde{{\cal{Z}}} we independently flip a coin and with probability (1−e−βy(Z~))/(βy(Z~))(1-e^{-\beta y(\widetilde{Z})})/(\beta y(\widetilde{Z})) make the set Z~\widetilde{Z} active. We let A⊂CxA\subset C_{x} to be the union of all active sets Z~\widetilde{Z}; we say that centers in AA are active centers. Let f(x)f(x) be the center in A∩SA\cap S closest to xx, if A∩S≠∅A\cap S\neq\varnothing ; let f(x)f(x) to be the unique center in Bw(x)∩SB_{w(x)}\cap S, otherwise. We set E=0{\cal{E}}=0, if A∩S≠∅A\cap S\neq\varnothing; and E=1{\cal{E}}=1, otherwise. Roughly speaking, E{\cal{E}} indicates whether f(x)∈Cxf(x)\in C_{x} or f(x)∈Bw(x)f(x)\in B_{w(x)}: Specifically, if E=0{\cal{E}}=0, then f(x)∈Cxf(x)\in C_{x}; if E=1{\cal{E}}=1, then f(x)∈Bw(x)f(x)\in B_{w(x)}. Note, however, that Cx∩Bw(x)≠∅C_{x}\cap B_{w(x)}\neq\varnothing, and f(x)f(x) may belong to Cx∩Bw(x)C_{x}\cap B_{w(x)}.

The center f(x)f(x) may not be the closest to xx, but since f(x)∈Sf(x)\in S, we have

In Lemma 9, we show that Pr⁡(E=0)=1−e−β\Pr({\cal{E}}=0)=1-e^{-\beta}. Thus,

We bound the expected distance from xx to f(x)f(x) given E=0{\cal{E}}=0 in Lemma 10. We show that

Here, we used that RxβR^{\beta}_{x} is the radius of BxB_{x}; Rw(x)βR^{\beta}_{w(x)} is the radius of Bw(x)B_{w(x)}. By the Markov inequality, Rxβ≤βRx/(β−1)R^{\beta}_{x}\leq\beta R_{x}/(\beta-1) (see Lemma 15). In Lemma 14,we show that there exists two nonnegative numbers r1r_{1} and r2r_{2} (r1≤r2r_{1}\leq r_{2}) such that

where γ\gamma is some parameter in $$. Hence,

Combining all bounds above we get the following inequality:

This function can be upper bounded by α(β)\alpha(\beta) defined in (8). We conclude that the approximation factor of the algorithm is upper bounded by α(β)\alpha(\beta).

We now bound E[d(x,f(x))∣E=0]E[d(x,f(x))\mid{\cal{E}}=0].

We have E[d(x,f(x))∣E=0]≤RxE[d(x,f(x))\mid{\cal{E}}=0]\leq R_{x}.

We define two sets of random variables PP and QQ, and then show that they are identically distributed. If the algorithm picks a center cc in Z~\widetilde{Z}, and Z~\widetilde{Z} is active, let P(Z~)=cP(\widetilde{Z})=c. Let P(Z~)=⊥P(\widetilde{Z})=\perp, otherwise. The random variables P(Z~)P(\widetilde{Z}) are mutually independent for all Z~∈Z~\widetilde{Z}\in\widetilde{{\cal{Z}}}; and

To define QQ, we introduce an auxiliary Poisson arrival process. At every point of time t∈[0,β]t\in[0,\beta], we pick a center c∈Cxc\in C_{x} with probability ycdty_{c}dt (i.e., with arrival rate ycy_{c}). For every Z~\widetilde{Z}, let Q(Z~)Q(\widetilde{Z}) be the first center chosen in Z~\widetilde{Z}. If no centers in Z~\widetilde{Z} are chosen, we let Q(Z~)=⊥Q(\widetilde{Z})=\perp. Note that we pick two centers at exactly the same time with probability , hence Q(Z~)Q(\widetilde{Z}) is well defined. Conditional on Q(Z~)≠⊥Q(\widetilde{Z})\neq\perp, the random variable Q(Z~)Q(\widetilde{Z}) is uniformly distributed in Z~\widetilde{Z} with respect to LP weights ycy_{c} (since at every given time tt, the probability of arrival equals ycdty_{c}dt). Then, Pr⁡(Q(Z~)≠⊥)=(1−e−βy(Z~))\Pr(Q(\widetilde{Z})\neq\perp)=(1-e^{-\beta y(\widetilde{Z})}). Hence, Pr⁡(Q(Z~)=c)=(1−e−βy(Z~))yc/y(Z~)\Pr(Q(\widetilde{Z})=c)=(1-e^{-\beta y(\widetilde{Z})})y_{c}/y(\widetilde{Z}). Note that all random variables QQ are mutually independent. Thus, the random variables QQ have the same distribution as random variables PP.

Note that if E=0{\cal{E}}=0, then f(x)f(x) is the closest center in {P(Z~):Z~∈Z~;Z~≠⊥}\{P(\widetilde{Z}):\widetilde{Z}\in\widetilde{{\cal{Z}}};\widetilde{Z}\neq\perp\} to xx. If E=1{\cal{E}}=1, then all P(Z~)P(\widetilde{Z}) are equal to ⊥\perp. Let UQ={Q(Z~):Z~∈Z~;Q~≠⊥}U_{Q}=\{Q(\widetilde{Z}):\widetilde{Z}\in\widetilde{{\cal{Z}}};\widetilde{Q}\neq\perp\}. Since PP and QQ have the same distribution, we have

Let Dx=Bw(x)∩CxD_{x}=B_{w(x)}\cap C_{x} and γ=βy(Dx)\gamma=\beta y(D_{x}). Note that γ∈\gamma\in, since y(Bw(x))=1/βy(B_{w(x)})=1/\beta. We find Pr⁡(f(x)∈Dx∣E=1)\Pr(f(x)\in D_{x}\mid{\cal{E}}=1).

Observe that the set Dx=Bw(x)∩CxD_{x}=B_{w(x)}\cap C_{x} is one of the sets in the partitioning Z~\widetilde{\cal{Z}} as w(x)∈Ww(x)\in{\cal{W}} and Bw(x)∈ZB_{w(x)}\in{\cal{Z}}. Assume f(x)∈Dxf(x)\in D_{x} and E=1{\cal{E}}=1. Since f(x)∈Dxf(x)\in D_{x}, we have S∩Dx≠∅S\cap D_{x}\neq\varnothing. Thus, DxD_{x} must be inactive (otherwise, E{\cal{E}} would be ). Moreover, for every Z~≠Dx\widetilde{Z}\neq D_{x} (Z~∈Z\widetilde{Z}\in{\cal{Z}}), Z~\widetilde{Z} is inactive or Z~∩S=∅\widetilde{Z}\cap S=\varnothing (again, otherwise, E{\cal{E}} would be ). Hence, the event {f(x)∈Dx and E=1}\{f(x)\in D_{x}\text{ and }{\cal{E}}=1\} can be represented as the intersection of the following three independent events: {S∩Dx≠∅}\{S\cap D_{x}\neq\varnothing\}, {Dx is not active}\{D_{x}\text{ is not active}\}, and {there are no active vertices in (Cx∖Dx)∩S}\{\text{there are no active vertices in }(C_{x}\setminus D_{x})\cap S\}. The probability of the first event is βy(Dx)\beta y(D_{x}); the probability of the second event is 1−(1−e−βy(Dx))/(βy(Dx))1-(1-e^{-\beta y(D_{x})})/(\beta y(D_{x})); the probability of the third event is e−βy(Cx∖Dx)e^{-\beta y(C_{x}\setminus D_{x})} (this probability is computed as in Lemma 9). Thus,

Local Search

Unfortunately the analyses of relies heavily on the triangle inequality, while the instances generated by Theorem 7 satisfy only a 3-relaxed 3-hop triangle inequality. Thus, we proceed as in .

Let O=⟨o1,…,ok⟩O=\left\langle o_{1},\ldots,o_{k}\right\rangle be an optimal set of kk centers, and A=⟨a1,…,aβk⟩A=\left\langle a_{1},\ldots,a_{\beta k}\right\rangle be the set of βk\beta k centers produced by the local search algorithm. As in , we say that a center a∈Aa\in A captures a center o∈Oo\in O if aa is the center of AA that is closest to oo. Note that each center in AA can potentially capture several centers in OO, but each center in OO is captured by exactly one center of AA. We now construct a set of local swaps to consider in our analysis. We say that a center in AA is “good” if it does not capture any center of OO. Then, because each center of OO is captured by only one center of AA, we must have at least βk−k=(β−1)k\beta k-k=(\beta-1)k good centers in AA. We fix some such set of (β−1)k(\beta-1)k good centers; we call them “auxiliary” centers and set them aside for now.

For the remaining kk centers B⊆AB\subseteq A, we proceed exactly as in : we assign each center in OO to the bad center of BB that captures it. This creates a partition O1,…,OrO_{1},\ldots,O_{r} of centers in OO. We similarly partition the centers of BB into rr parts B1,…,BrB_{1},\ldots,B_{r} with ∣Bi∣=∣Oi∣|B_{i}|=|O_{i}|; for each 1≤i≤r1\leq i\leq r, let BiB_{i} contain the bad center of BB that captures all of OiO_{i} together with ∣Bi∣−1|B_{i}|-1 unique good centers of BB. Note that the fact that each center of OO is captured only once ensures that there are indeed enough good centers in BB for our construction. Now, we use this partition of BB and OO to construct a set of swaps, each assigned some weight. If ∣Oi∣≤p|O_{i}|\leq p, we consider the ⟨Bi,Oi⟩\langle B_{i},O_{i}\rangle with weight 1. If ∣Oi∣=q>p|O_{i}|=q>p, we consider a group of singleton swaps ⟨{b},{o}⟩\langle\{b\},\{o\}\rangle, where o∈Oio\in O_{i} and bb is a good center in BiB_{i}, each with weight 1q−1\frac{1}{q-1}. At this point, note that every center in OO occurs in swaps of total weight 11, and every center in BB occurs in swaps of total weight at most qq−1≤1+1p\frac{q}{q-1}\leq 1+\frac{1}{p}. Now, we add swaps involving auxiliary centers; for each of the (β−1)k(\beta-1)k auxiliary centers a∈A∖Ba\in A\setminus B and each o∈Oo\in O, we consider singleton swap ⟨{a},{o}⟩\langle\{a\},\{o\}\rangle, assigned weight 1k\frac{1}{k}. Each center of OO now occurs in swaps of total weight 1+(β−1)=β1+(\beta-1)=\beta, while each center of A∖BA\setminus B occurs in swaps of total weight 11.

Summarizing, our set of swaps satisfies the following properties: (1) each center of OO occurs in swaps of total weight β\beta; (2) each center of AA occurs in swaps of total weight at most 1+1p1+\frac{1}{p}; (3) for any swap ⟨A′,O′⟩\langle A^{\prime},O^{\prime}\rangle in our set, no center in A′A^{\prime} captures any center not in O′O^{\prime}. We now give a brief sketch of how these properties lead to our desired approximation ratio (we give a full description of the analysis in the appendix). Our analysis closely follows that of .

As in , the total change cost⁡D,d(A∖A′∪O′)−cost⁡D,d(A)\operatorname{cost}_{{\cal{D}},d}(A\setminus A^{\prime}\cup O^{\prime})-\operatorname{cost}_{{\cal{D}},d}(A) due to performing a single swap ⟨A′,O′⟩\langle A^{\prime},O^{\prime}\rangle is at most:

If AA is locally optimal, then we must have that cost⁡D,d(A∖A′∪O′)−cost⁡D,d(A)≥0\operatorname{cost}_{{\cal{D}},d}(A\setminus A^{\prime}\cup O^{\prime})-\operatorname{cost}_{{\cal{D}},d}(A)\geq 0 for all swaps (A′,O′)(A^{\prime},O^{\prime}) considered by the algorithm. In particular, for each swap ⟨A′,O′⟩\langle A^{\prime},O^{\prime}\rangle in our set, we have:

Multiplying each inequality (12) by the weight of its swap and then adding the resulting inequalities we obtain:

due to properties (1) and (2) of our set of swaps. Theorem 7 part 2, which shows that our center set is an approximate kk-means centroid set, then allows us to simplify the final term above as in , giving:

where α2=cost⁡D,d(A)cost⁡D,d(O)\alpha^{2}=\frac{\operatorname{cost}_{{\cal{D}},d}(A)}{\operatorname{cost}_{{\cal{D}},d}(O)} is the squared approximation ratio of our algorithm. Rearranging and simplifying (again, we give a detailed analysis in the appendix), we obtain.

Therefore, we have proved the following theorem:

There exists an algorithm that produces a solution for any instance of βk\beta k-median problem satisfying the properties of Theorem 7, where β>1\beta>1 is a fixed constant. For any p≥1p\geq 1 and any ε∈(0,1]\varepsilon\in(0,1], the algorithm runs in time polynomial in ∣C∪D∣|{\cal{C}}\cup{\cal{D}}| and produces a solution AA satisfying:

where OO is the optimal set of kk centers in C\cal C.

References

Appendix A Detailed Analysis of the LP Rounding Algorithm

Given f(x)∈Dxf(x)\in D_{x} and E=1{\cal{E}}=1, the random center f(x)f(x) is distributed uniformly in DxD_{x} (with respect to the LP weights yy). Hence, Pr⁡(f(x)=c)=yc/y(Dx)\Pr(f(x)=c)=y_{c}/y(D_{x}) for c∈Dxc\in D_{x}. We have

There exists two nonnegative numbers r1r_{1} and r2r_{2} satisfying

Denote the expected distance from a random center cc in Bw(x)∖DxB_{w(x)}\setminus D_{x} to w(x)w(x) by r1r_{1} and distance from a random center cc in Cw(x)∖Bw(x)C_{w(x)}\setminus B_{w(x)} to w(x)w(x) by r2r_{2}:

The following inequality holds: Rxβ≤βRx/(β−1)R_{x}^{\beta}\leq\beta R_{x}/(\beta-1).

Every center c∈Cx∖Bxc\in C_{x}\setminus B_{x} is at distance at least RxβR^{\beta}_{x} from xx. Hence,

Appendix B Detailed Analysis of the Local Search Algorithm

Here we give a detailed analysis of the local search algorithm from section 5, closely following .

Let ⟨ρi⟩\langle\rho_{i}\rangle and ⟨ξi⟩\langle\xi_{i}\rangle be two sequences of reals such that α2=(∑iρi2)/(∑iξi2)\alpha^{2}=(\sum_{i}\rho_{i}^{2})/(\sum_{i}\xi_{i}^{2}) for some α>0\alpha>0. Then,

We now show how local optimality implies the desired inequality. For a demand point x∈Dx\in{\cal{D}}, let axa_{x} and oxo_{x} denote the closest facility to xx in AA and OO, respectively. Recall that for for a∈Aa\in A, NA(a)N_{A}(a) is precisely the set of all those demand points x∈Dx\in{\cal{D}} such that ax=aa_{x}=a, and, similarly, for o∈Oo\in O, NO(o)N_{O}(o) is the set of all demand point x∈Dx\in{\cal{D}} such that ox=oo_{x}=o. Now, we upper bound the change in cost due to some swap ⟨A′,O′⟩\langle A^{\prime},O^{\prime}\rangle in our set of swaps. We do this by constructing a feasible assignment of all points in D{\cal{D}} to centers in A∖A′∪O′A\setminus A^{\prime}\cup O^{\prime}. For each o∈O′o\in O^{\prime}, we assign all the points in NO(o)N_{O}(o) to oo. This changes the cost by

Now, fix a point x∈NA(A′)∖NO(O′)x\in N_{A}(A^{\prime})\setminus N_{O}(O^{\prime}), and consider xx’s closest optimal center oxo_{x}. We must have ox∉O′o_{x}\not\in O^{\prime}. Let aoxa_{o_{x}} be the closest center to oxo_{x} in AA. Then, by property (3) above, aox∉A′a_{o_{x}}\not\in A^{\prime}, since aoxa_{o_{x}} captures oxo_{x} but ox∉O′o_{x}\not\in O^{\prime}. We reassign xx to aoxa_{o_{x}}. The total cost of reassigning all such points xx is at most:

where the inequality follows from the fact that axa_{x} is the closest center to xx in AA, and so d(x,aox)−d(x,ax)≥0d(x,a_{o_{x}})-d(x,a_{x})\geq 0 for all x∈NA(A′)∩NO(O′)x\in N_{A}(A^{\prime})\cap N_{O}(O^{\prime}). Thus, the total change cost⁡D,d(A∖A′∪O′)−cost⁡D,d(A)\operatorname{cost}_{{\cal{D}},d}(A\setminus A^{\prime}\cup O^{\prime})-\operatorname{cost}_{{\cal{D}},d}(A) for each swap ⟨A′,O′⟩\langle A^{\prime},O^{\prime}\rangle is at most:

If AA is locally optimal, then we must have that cost⁡D,d(A∖A′∪O′)−cost⁡D,d(A)≥0\operatorname{cost}_{{\cal{D}},d}(A\setminus A^{\prime}\cup O^{\prime})-\operatorname{cost}_{{\cal{D}},d}(A)\geq 0 for all swaps (A′,O′)(A^{\prime},O^{\prime}) considered by the algorithm. In particular, for each swap ⟨A′,O′⟩\langle A^{\prime},O^{\prime}\rangle in our set, we have:

Set γ=1+1p\gamma=1+\frac{1}{p}. Then, multiplying each such inequality by the weight of its swap and then adding the resulting inequalities we obtain

where we have exploited properties (1) and (2) of our set of swaps to bound the number of times a given center in OO or AA is counted in our sum of inequalities.

It remains to bound the final term in (13). Consider some o∈Oo\in O, and let cc be the centroid of NO(o)N_{O}(o). As above, we will let aoa_{o} denote the closest center in AA to OO. Then, note that:

Let α2=cost⁡D,d(A)cost⁡D,d(O)=∑x∈Dd(x,ax)∑x∈Dd(x,ox)\alpha^{2}=\frac{\operatorname{cost}_{{\cal{D}},d}(A)}{\operatorname{cost}_{{\cal{D}},d}(O)}=\frac{\sum_{x\in{\cal{D}}}d(x,a_{x})}{\sum_{x\in{\cal{D}}}d(x,o_{x})} be the approximation ratio attained by the algorithm. Summing over all o∈Oo\in O, and recalling that for all x∈NO(o)x\in N_{O}(o) we have ox=oo_{x}=o, we obtain:

Where in the last inequality, we have applied Lemma 17 to the sequences ρi\rho_{i} and ξi\xi_{i} defined by:

Applying the upper bound (14) to the final term of (13), we obtain:

where we have used the fact that cost⁡D,d(O)≤cost⁡D,d(A)\operatorname{cost}_{{\cal{D}},d}(O)\leq\operatorname{cost}_{{\cal{D}},d}(A). Rearranging, we have

Appendix C Proof of Theorem 7

We first show that for every solution of the kk-means problem on XX there is a corresponding solution of kk-means problem on X′X^{\prime} in which all centers lie in C{\cal{C}}, and vice versa.

For every partition S=⟨S1,…,Sk⟩S=\left\langle S_{1},\ldots,S_{k}\right\rangle of XX, there is a corresponding clustering of X′X^{\prime} given by S′=⟨φ(S1),…,φ(Sk)⟩S^{\prime}=\left\langle\varphi(S_{1}),\ldots,\varphi(S_{k})\right\rangle and some centers C′=⟨c1′,…,ck′⟩⊆CC^{\prime}=\left\langle c_{1}^{\prime},\ldots,c_{k}^{\prime}\right\rangle\subseteq{\cal{C}} such that:

Part 1: Consider a partition S=⟨S1,…,Sk⟩S=\left\langle S_{1},\ldots,S_{k}\right\rangle of XX and the corresponding partition S′=⟨S1′,…,Sk′⟩S^{\prime}=\left\langle S_{1}^{\prime},\dots,S_{k}^{\prime}\right\rangle of X′X^{\prime}, where Si′=φ(Si)S_{i}^{\prime}=\varphi(S_{i}). Let ci′=arg min⁡c∈C∑x∈Si′∥x′−c∥2c_{i}^{\prime}=\operatorname*{arg\,min}_{c\in{\cal{C}}}\sum_{x\in S_{i}^{\prime}}\|x^{\prime}-c\|^{2} for i∈{1,…,k}i\in\left\{1,\dots,k\right\}. Because C{\cal{C}} is an ε′\varepsilon^{\prime}-approximate centroid set for X′X^{\prime}, we have, for each cluster Si′S_{i}^{\prime},

Part 2: Consider a partition S′=⟨S1′,…,Sk′⟩S^{\prime}=\left\langle S_{1}^{\prime},\ldots,S_{k}^{\prime}\right\rangle of X′X^{\prime} and the corresponding partition S=⟨S1,…,Sk⟩S=\left\langle S_{1},\ldots,S_{k}\right\rangle of XX, where Si=φ−1(Si)S_{i}=\varphi^{-1}(S_{i}). Define the centers ci=∑x∈Six/∣Si∣c_{i}=\sum_{x\in S_{i}}x/|S_{i}|. Then, for each cluster SiS_{i}, we have:

Now we are ready to define instance ⟨D,C,d⟩\langle{\cal{D}},{\cal{C}},d\rangle. Let D=X′{\cal{D}}=X^{\prime}, C{\cal{C}} be the ε\varepsilon-approximate centroid we defined above, and d(c,x)=∥c−x∥2d(c,x)=\|c-x\|^{2} for every c∈Cc\in{\cal{C}} and x∈Dx\in{\cal{D}}. Define ψ:D→X\psi:{\cal{D}}\to X by ψ(x)=φ−1(x)\psi(x)=\varphi^{-1}(x).

We prove that our reduction, which maps instance XX of kk-means to instance ⟨D,C,d⟩\langle{\cal{D}},{\cal{C}},d\rangle of kk-median, satisfies the conditions of the theorem.

Our reduction produces an instance that satisfies the following properties:

The distance function dd satisfies the 3-relaxed 3-hop triangle inequality on D∪C{\cal{D}}\cup{\cal{C}}.

For every partition S=⟨S1,…,Sk⟩S=\left\langle S_{1},\ldots,S_{k}\right\rangle of D{\cal{D}} and the corresponding partition ψ(S)=⟨ψ(S1),…,ψ(Sk)⟩\psi(S)=\left\langle\psi(S_{1}),\ldots,\psi(S_{k})\right\rangle of XX, we have

For claim 2, consider any partition SS of D{\cal{D}}. Let T=ψ(S)T=\psi(S) be the corresponding partition of XX, given by Ti=ψ(Si)T_{i}=\psi(S_{i}). Then, from our definition of dd, we have cost⁡D,d(S)=cost⁡X′(S)\operatorname{cost}_{{\cal{D}},d}(S)=\operatorname{cost}_{X^{\prime}}(S). Moreover, by Lemma 18, we have cost⁡X′(S)\operatorname{cost}_{X^{\prime}}(S) is between cost⁡X(T)\operatorname{cost}_{X}(T) and (1+ε′)2cost⁡X(T)(1+\varepsilon^{\prime})^{2}\operatorname{cost}_{X}(T). Thus,