Turning Big data into tiny data: Constant-size coresets for k-means, PCA and projective clustering
Dan Feldman, Melanie Schmidt, Christian Sohler
Introduction
In many areas of science, progress is closely related to the capability to analyze massive amounts of data. Examples include particle physics where according to the webpage dedicated to the Large Hadron collider beauty experiment [lhc] at CERN, after a first filtering phase 35 GByte of data per second need to be processed “to explore what happened after the Big Bang that allowed matter to survive and build the Universe we inhabit today” [lhc]. The IceCube neutrino observatory “searches for neutrinos from the most violent astrophysical sources: events like exploding stars, gamma ray bursts, and cataclysmic phenomena involving black holes and neutron stars.” [Ice]. According to the webpages [Ice], the datasets obtained are of a projected size of about 10 Teta-Bytes per year. Also, in many other areas the data sets are growing in size because they are increasingly being gathered by ubiquitous information-sensing mobile devices, aerial sensory technologies (remote sensing), genome sequencing, cameras, microphones, radio-frequency identification chips, finance (such as stocks) logs, internet search, and wireless sensor networks [Hel, SH09].
The world’s technological per-capita capacity to store information has roughly doubled every 40 months since the 1980s [HL11]; as of 2012, every day 2.5 quintillion bytes() of data were created [IBM]. Data sets as the ones described above and the challenges involved when analyzing them is often subsumed in the term Big Data. Big Data is also sometimes described by the “3Vs” model [Bey]: increasing volume (number of observations or records), its velocity (update time per new observation) and its variety (dimension of data, features, or range of sources).
In order to analyze data that for example results from the experiments above, one needs to employ automated data analysis methods that can identify important patterns and substructures in the data, find the most influential features, or reduce size and dimensionality of the data. Classical methods to analyze and/or summarize data sets include clustering, i.e., the partitioning of data into subsets of similar characteristics, and principal component analysis which allows to consider the dimensions of a data set that have the highest variance. Examples for such methods include -means clustering, principal component analysis (PCA), and subspace clustering.
The main problem with many existing approaches is that they are often efficient for large number of input records, but are not efficient enough to deal with Big Data where also the dimension is asymptotically large. One needs special algorithms that can easily handle massive streams of possibly high dimensional measurements and that can be easily parallelized and/or applied in a distributed setting.
In this paper, we address the problem of analyzing Big Data by developing and analyzing a new method to reduce the data size while approximately keeping its main characteristics in such a way that any approximation algorithm run on the reduced set will return an approximate solution for the original set. This reduced data representation (semantic compression) is sometimes called a coreset. Our method reduces any number of items to a number of items that only depends on some problem parameters (like the number of clusters) and the quality of the approximation, but not on the number of input items or the dimension of the input space.
Furthermore, we can always take the union of two data sets that were reduced in this way and the union provides an approximation for the two original data sets. The latter property is very useful in a distributed or streaming setting and allows for very simple algorithms using standard techniques. For example, to process a very large data set on a cloud, a distributed system or parallel computer, we can simply assign a part of the data set to each processor, compute the reduced representation, collect it somewhere and do the analysis on the union of the reduced sets. This merge-and-reduce method is strongly related to MapReduce and its popular implementations (e.g. Hadoop [Whi12]). If there is a stream of data or if the data is stored on a secondary storage device, we can read chunks that fit into the main memory of each individual computer and then reduce the data in this chunk. In the end, we apply our data analysis tools on the union of the reduced sets via small communication of only the coresets between the computers.
Our main result is a dimensionality reduction algorithm for points in high -dimensional space to points in dimensional space, such that the sum of squared distances to every object that is contained in a -dimensional subspace is approximated up to a -factor. This result is applicable to a wide range of problems like PCA, -means clustering and projective clustering. For the case of PCA, i.e., subspace approximation, we even get a coreset of cardinality (here is just the dimension of the subspace). The cardinality of this coreset is constant in the sense that it is independent of the input size: both its original cardinality and dimension . A coreset of such a constant cardinality is also obtained for -means queries, i.e., approximating the sum of squared distances over each input point to its closest center in the query.
For other objectives, we combine our reduction with existing coreset constructions to obtain very small coresets. A construction that computes coresets of cardinality will result in a construction that computes coresets of cardinality , i.e., independent of . This scheme works as long as there is such a coreset construction, e.g., it works for -means or -line-means. For the projective clustering problem (more precisely, the affine -subspace -clustering problem that we define below), such a coreset construction does not and can not exist. We circumvent this problem by requiring that the points are on an integer grid (the resulting size of the coreset will depend polylogarithmically on the size of the grid and n).
A more detailed (technical) description of our results is given in Section 2.4 after a detailed discussion about the studied problems and concepts.
We remark that in the conference version of this paper, some of the coreset sizes resulting from applying our new technique were incorrect. We have updated the results in this paper (see Section 2.4 for an overview). In particular, the coreset size for projective clustering is not independent of .
Previous publications
The main results of this work have been published in [FSS13]. However, the version at hand is significantly different. We carefully derive the concrete application to several optimization problems, develop explicit streaming algorithms, explain and re-prove some related results that we need, correct errors from the conference version (see above), provide pseudo code for most methods and add a lot of explanations compared to the conference version. The PhD thesis [Sch14] also contains a write-up of the main results, but without the streaming algorithms for subspace approximation and projective clustering.
Preliminaries
In this section we formally define our notation and the problems that we study.
to denote its Frobenius norm. It is known that the Frobenius norm does not change under orthogonal transformations, i.e., for an matrix and an orthogonal matrix . This also implies the following observation that we will use frequently in the paper.
Let be an matrix and be a matrix with orthonormal columns. Then
Proof: Let be a orthogonal matrix whose first columns agree with . Then we have .
[Matrix form of the Pythagorean Theorem] Let be a matrix with orthonormal columns and be a matrix with orthonormal columns that spans the orthogonal complement of . Furthermore, let be any matrix. Then we have
Proof: Let be the matrix whose first columns equal and the second columns equal . Observe that is an orthogonal matrix. Since the Frobenius norm does not change under multiplication with orthogonal matrices, we get
The result follows by observing that .
In the following we will introduce the definitions related to range spaces and VC-dimension that are used in this paper.
In the context of range spaces we will use the following type of approximation.
We will also use the following bound from [LLS01] (see also [HS11]) on the sample size required to obtain a -approximation.
1 Data Analysis Methods
In this section we briefly describe the data analysis methods for which we will develop coresets in this paper. The first two subsection define and explain two fundamental data analysis methods: -means clustering and principal component analysis. Then we discuss the other techniques considered in this paper, which can be viewed as generalizations of these problems. We always start to describe the motivation of a method, then give the technical problem definition and in the end discuss the state of the art.
The goal of clustering is to partition a given set of data items into subsets such that items in the same subset are similar and items in different subsets are dissimilar. Each of the computed subsets can be viewed as a class of items and, if done properly, the classes have some semantic interpretation. Thus, clustering is an unsupervised learning problem. In the context of Big Data, another important aspect is that many clustering formulations are based on the concept of a cluster center, which can be viewed as some form of representative of the cluster. When we replace each cluster by its representative, we obtain a concise description of the original data. This description is much smaller than the original data and can be analyzed much easier (and possibly by hand). There are many different clustering formulations, each with its own advantages and drawbacks and we focus on some of the most widely used ones. Given the centers, we can typically compute the corresponding partition by assigning each data item to its closest center. Since in the context of Big Data storing such a partition may already be difficult, we will focus on computing the centers in the problem definitions below.
Maybe the most widely used clustering method is -means clustering. Here the goal is to minimize the sum of squared error to cluster centers.
The -means problem is studied since the fifties. It is NP-hard, even for two centers [ADHP09] or in the plane [MNV09]. When either the number of clusters is a constant (see, for example, [FMS07, KSS10, FL11]) or the dimension is constant [FRS16, CKM16], it is possible to compute a -approximation for fixed in polynomial time. In the general case, the -means problem is APX-hard and cannot be approximated better than 1.0013 [ACKS15, LSW17] in polynomial time. On the positive side, the best known approximation guarantee has recently been improved to 6.357 [ANSW16].
1.1 Principal Component Analysis
The eigenvectors corresponding to the largest eigenvalues point into the direction(s) of highest variance. These are the most important directions. Ordering all eigenvectors according to their eigenvalues means that one gets a basis for which is ordered by importance. Consequently, one typical application of PCA is to identify the most important dimensions. This is particularly interesting in the context of high dimensional data, since maintaining a complete basis of the input space requires space. Using PCA, we can keep the most important directions. We are interested in computing an approximation of these directions.
If we would like to do a PCA on unnormalized data, the problem is better captured by the affine -subspace problem.
A coreset for -subspace queries, i.e., that approximates the sum of squared distances to a given -dimensional subspace was suggested by Ghashami, Liberty, Phillips, and Woodruff [Lib13, GLPW16], following the conference version of our paper. This coreset is composable and has cardinality of . It also has the advantage of supporting streaming input without the merge-and-reduce tree as defined in Section 1 and the additional factors it introduces. However, it is not clear how to generalize the result for affine -subspaces [JF] as defined below.
It is known [DFK+04] that computing the -means on the low -rank of the input data (its first largest singular vectors), yields a -approximation for the -means of the input. Our result generalizes this claim by replacing with and with , as well as approximating the distances to any centers that are contained in a -subspace.
The coresets in this paper are not subset of the input. Following papers aimed to add this property, e.g. since it preserves the sparsity of the input, easy to interpret, and more numerically stable. However, their size is larger and the algorithms are more involved. The first coreset for the -subspace problem (as defined in this paper) of size that is independent of both and , but are also subsets of the input points, was suggested in [FVR15, FVR16]. The coreset size is larger but still polynomial in . A coreset of size that is a bit weaker (preserves the spectral norm instead of the Frobenius norm) but still satisfies our coreset definition was suggested by Cohen, Nelson, and Woodruff in [CNW16]. This coreset is a generalization of the breakthrough result by Batson, Spielman, and Srivastava [BSS12] that suggested such a coreset for . Their motivation was graph sparsification, where each point is a binary vector of 2 non-zeroes that represents an edge in the graph. An open problem is to reduce the running time and understand the intuition behind this result.
1.2 Subspace Clustering
A generalization of both the -means and the linear -subspace problem is linear -subspace -clustering. Here the idea is to replace the cluster centers in the -means definition by linear subspaces and then to minimize the squared Euclidean distance to the nearest subspace. The idea behind this problem formulation is that the important information of the input points/vectors lies in their direction rather than their length, i.e., vectors pointing in the same direction correspond to the same type of information (topics) and low dimensional subspaces can be viewed as combinations of topics describe by basis vectors of the subspace. For example, if we want to cluster webpages by their TFIDF (term frequency inverse document frequency) vectors that contain for each word its frequency inside a given webpage divided by its frequency over all webpages, then a subspace might be spanned by one basis vector for each of the words “computer”,“laptop”, “server”, and “notebook”, so that the subspace spanned by these vectors contains all webpages that discuss different types of computers.
A different view of subspace clustering is that it is a combination of clustering and PCA: The subspaces provide for each cluster the most important dimensions, since for one fixed cluster the subspace that minimizes the sum of squared distances is the space spanned by the right singular vectors of the restricted matrix. First provable PCA approximation of Wikipedia were obtained using coresets in [FVR16].
Notice that -means clustering is affine subspace clustering for and the linear/affine -subspace problem is linear/affine -subspace -clustering. An example of a linear -subspace -clustering is visualized in Figure 1.
Deshpande, Rademacher, Vempala and Wang propose a polynomial time -approximation algorithm for the -subspace -clustering problem [DRVW06] when and are constant. Newer algorithms with faster running time are based on the sensitivity sampling framework by Feldman and Langberg [FL11]. We discuss [FL11] and the results by Varadarajan and Xiao [VX12a] in detail in Section 8.
2 Coresets and Dimensionality Reductions
For the general -subspace -clustering problem, coresets of small size do not exist [Har04, Har06]. Edwards and Varadarajan [EV05] circumvent this problem by studying the problem under the assumption that all input points have integer coordinates. They compute a coreset for the -subspace -clustering problem with maximum distance instead of the sum of squared distances. We discuss their result together with the work of Feldman and Langberg [FL11] and Varadarajan and Xiao [VX12a] in Section 8. The latter paper proposes coresets for the general -subspace -clustering problem with integer coordinates.
Drineas et. al. [DFK+04] developed an SVD based dimensionality reduction for the -means problem. They projected onto the most important dimensions and solved the lower dimensional instance to optimality (assuming that is a constant). This gives a -approximate solution. Boutsidis, Zouzias, Mahoney, and Drineas [BZMD15] show that the exact SVD can be replaced by an approximate SVD, giving a -approximation to dimensions with faster running time. Boutsidis et. al. [BMD09, BZMD15] combine the SVD approach with a sampling process that samples dimensions from the original dimensions, in order to obtain a projection onto features of the original point set. The approximation guarantee of their approach is , and the number of dimensions is reduced to .
3 Streaming algorithms
A stream is a large, possibly infinitely long list of data items that are presented in arbitrary (so possibly worst-case) order. An algorithm that works in the data stream model has to process this stream of data on the fly. It can store some amount of data, but its memory usage should be small. Indeed, reducing the space complexity is the main focus when developing streaming algorithms. In this paper, we consider algorithms that have a constant or polylogarithmic size compared to the input that they process. The main influence on the space complexity will be from the model parameters (like the number of centers in the -means problem) and from the desired approximation factor.
A standard technique to maintain coresets is the merge-and-reduce method, which goes back to Bentley and Saxe [BS80] and was first used to develop streaming algorithms for geometric problems by Agarwal et al. [AHPV04b]. It processes chunks of the data and reduces each chunk to a coreset. Then the coresets are merged and reduced in a tree-fashion that guarantees that no input data point is part of more than reduce operations. Every reduce operation increases the error, but the upper bound on the number of reductions allows the adjustment of the precision of the coreset in an appropriate way (observe that this increases the coreset size). We discuss merge-and-reduce in detail in Section 7.
Har-Peled and Mazumdar initiated the development of coreset-based streaming algorithms for the -means problem. Their algorithm stores at most during the computation. The coreset construction by Chen [Che09] combined with merge-and-reduce gave the first the construction of coresets of polynomial size (in , , and ) in the streaming model. Various additional results exist that propose coresets of smaller size or coreset algorithms that have additional desirable properties like good implementability or the ability to cope with point deletions [AMR+12, FGS+13, FMSW10, FS05, HPK07, LS10, BFL+17]. The construction with the lowest space complexity is due to Feldman and Langberg [FL11].
Recall from Section 2.1 that the -means problem can be approximated up to arbitrary precision when or is constant, and that the general case allows for a constant approximation. Since one can combine the corresponding algorithms with the streaming algorithms that compute coresets for -means, these statements are thus also true in the streaming model.
4 Our results and closely related work
Our main conceptual idea can be phrased as follows. For clustering problems with low dimensional centers any high dimensional input point set may be viewed as consisting of a structured part, i.e. a part that can be clustered well and a ”pseudo-random” part, i.e. a part that induces roughly the same cost for every cluster center (in this way, it behaves like a random point set). This idea is captured in the new coreset definition given in Definition 13.
Our new method allows us to obtain coresets and streaming algorithms for a number of problems. For most of the problems our coresets are independent of the dimension and the number of input points and this is the main qualitative improvement over previous results.
In particular, we obtain (for constant error probability) a coreset of size
for the linear and affine -subspace problem,
We also provide detailed streaming algorithms for subspace approximation, -means, and -dimensional subspace -clustering. We do not explicitly state an algorithm that is based on coresets for -line means as it follows using similar techniques as for -means and -dimensional subspace -clustering and a weaker version also follows from the subspace -clustering problem with .
Furthermore, we develop a different method for constructing a coreset of size independent of and and show that this construction works for a restricted class of Bregman divergences.
The SVD and its ability to compute the optimal solution for the linear and affine subspace approximation problem has been known for over a century. About ten years ago, Drineas, Frieze, Kannan, Vempala, Vinay [DFK+04] observed that the SVD can be used to obtain approximate solutions for the -means problem. They showed that projecting onto the first singular vectors and then optimally solving -means in the lower dimensional space yields a -approximation for the -means problem.
Coresets for the linear j𝑗j-subspace problem
Now, we will show that appropriately chosen vectors suffice to approximate the cost of every -dimensional subspace . We obtain these vectors by considering the singular value decomposition . Our first step is to replace the matrix by its rank approximation as defined in Definition 1. We show the following simple lemma regarding the error of this approximation with respect to squared Frobenius norm.
Proof: Using the singular value decomposition we write and . We first observe that is always non-negative. Then
holds since has orthonormal columns. Now we observe that and its rows satisfy that
To see the inequality, recall that the spectral norm is compatible with the Euclidean norm ([QSS00]), set and and observe that
Proof: By the triangle inequality and the fact that has orthonormal columns we have
which proves that . Let by a matrix that spans the orthogonal complement of the column space of . Using Claim 3, , , and we obtain
where the inequality follows from Lemma 14.
Proof: From our choice of it follows that
where the last inequality follows from the fact that the optimal solution to the -subspace problem has cost . Now the Corollary follows from Lemma 15.
In the following, we summarize the properties of our coreset construction.
This takes time.
Proof: The correctness follows immediately from Corollary 16 and the above discussion together with the observation that all are . The running time follows from computing the exact SVD [Pea01].
If one is familiar with the coreset literature it may seem a bit strange that the resulting point set is unweighted, i.e., we replace unweighted points by unweighted points. However, for this problem the weighting is implicitly done by scaling. Alternatively, we could also define our coreset to be the set of the first rows of where the th row is weighted by , and is the SVD of .
Coresets for the Affine j𝑗j-Subspace Problem
We will now extend our coreset to the affine -subspace problem. The main idea of the new construction is very simple: Subtract the mean of from each input point to obtain a matrix , compute a coreset for and then add the mean to the points in the coreset to obtain a coreset . While this works in principle, there are two hurdles that we have to overcome. Firstly, we need to ensure that the mean of the coreset is before we add . Secondly, we need to scale and weight our coreset. The resulting construction is given as pseudo code in Algorithm 2.
Proof: Assume that spans . Then it holds that
where (3) follows because translating and by does not change the distances, (4), (5) follows by and (6) follows by Claim 3 and the fact that has orthonormal columns.
This takes time.
because was constructed as a coreset for . Set , i.e., . By our assumption above, . We get that
where we first translate and by and then exploit to use Lemma 18 twice. Now (7) yields the statement of the theorem since all equal .
There are situation where we would like to apply the coreset computation on a weighted set of input points (for example, lateron in our streaming algorithms). If the point weights are integral then we can reduce to the unweighted case by replacing a point by a corresponding number of copies. Finally, we observe that the same argument works for general point weights, if we reduce the problem to an input set where each point has a weight and we let go to . This blows up the input set, but we will only require this to argue that the analysis is correct. In the algorithm we use that for the linear subspace problem scaling by a factor of is equivalent to assigning a weight of to a point. The algorithm can be found below.
Proof: Using the singular value decomposition of we get
where the first and second equality follows since the columns of and respectively are orthonormal. By (2), , which proves the theorem.
In the following we will prove our main dimensionality reduction result. The result states that we can use as an approximation for in any clustering or shape fitting problem of low dimensional shapes, if we add to the cost. Observe that this is simply the cost of projecting the points on the subspace spanned by the first right singular vectors, i.e., the cost of “moving” the points in to . In order to do so, we use the following ‘weak triangle inequality’, which is well known in the coreset literature.
Proof: Let be a row in and be a corresponding row in . Using the triangle inequality,
The following theorem combines Lemma 15 with Corollary 20 and 21 to get the dimensionality reduction result.
where (10) is by the triangle inequality, (11) is by replacing with in Corollary 16, and (12) is by (9).
where in the last inequality we used the assumption .
Theorem 22 has a number of surprising consequences. For example, we can solve -means or any subspace clustering problem approximately by using instead of .
Proof: Let be an input parameter. Let denote an optimal set of centers for the -means objective function on input . We apply Theorem 22 with parameter and for both and in order to get that
From these inequalities we can deduce that
Since we have and so the corollary follows.
Our result can be immediately extended to the affine -subspace -clustering problem. The proof is similar to the proof of the previous corollary.
A call to Algorithm affine -subspace -clustering approximation returns an -approximation to the optimal solution for the affine -subspace -clustering problem on input . In particular, if , the solution is a -approximation.
Small Coresets for 𝒞𝒞\mathcal{C}-Clustering Problems
In this section we use the result of the previous section to prove that any -clustering problem, which is closed under rotations and reflections, has a coreset of cardinality independent of the dimension of the space, if it has a coreset for a constant number of dimensions.
Now consider a -clustering problem, where is closed under rotations and reflections. Furthermore, assume that each set is contained in a -dimensional subspace. Our plan is to apply the above Corollary to the matrix . Then we know that there is a space of dimension such that for every subspace there is an orthogonal matrix that moves into and keeps the points described by the rows of unchanged. Furthermore, since applying does not change Euclidean distance we know that the sum of squared distances of the rows of to equals the sum of squared distances to and is contained in (by the above Corollary) and in since is closed under rotations and reflections.
Now assume that we have a coreset for the subspace . As oberserved, we have and . In particular, the sum of squared distances to is approximated by the coreset. But this is identical to the sum of squared distances to and so this is approximated by the coreset as well.
Proof: We first apply Theorem 22 with replaced by to obtain for every :
Using in Corollary 21 we obtain
where the last inequality is since is contained in a -subspace and . Plugging (15) in (14) yields
Before turning to specific results for clustering problems, we describe a framework introduced by Feldman and Langberg [FL11] that allows to compute coresets for certain optimization problems (that minimize sums of cost of input objects) that also include the clustering problems considered in this paper. The framework is based on a non-uniform sampling technique. We sample points with different probabilities in such a way that points that have a high influence on the optimization problem are sampled with higher probability to make sure that the sample contains the important points. At the same time, in order to keep the sample unbiased, the sample points are weighted reciprocal to their sampling probability. In order to analyze the quality of this sampling process Feldman and Langberg [FL11] establish a reduction to -approximations of a certain range space.
The first related sampling approach in the area of coresets for clustering problems was by Chen [Che09] who partitions the input point set in a way that sampling from each set uniformly results in a coreset. The partitioning is based on a constant bicriteria approximation (the idea to use bicriteria approximations as a basis for coreset constructions goes back to Har-Peled and Mazumdar [HPM04], but their work did not involve sampling), i.e., we are computing a solution with (instead of ) centers, whose cost is at most a constant times the cost of the best solution with centers. In Chen’s construction, every point is assigned to its closest center in the bicriteria approximation. Uniform sampling is then applied to each subset of points. Since the points in the same subset have a similar distance to their closest center, the sampling error can be charged to this contribution of the points and this is sufficient to obtain coresets of small size.
A different way is to directly base the sampling probabilities on the distances to the centers from the bicriteria approximation. This idea is used by Arthur and Vassilvitskii [AV07] for computing an approximation for the -means problem, and it is used for the construction of (weak) coresets by Feldman, Monemizadeh and Sohler [FMS07]. The latter construction uses a set of centers that provides an approximative solution and distinguishes between points that are close to a center and points that are further away from their closest center. Uniform sampling is used for the close points. For the other points, the probability is based on the cost of the points. In order to keep the sample unbiased the sample points are weighted with where is the sampling probability.
The sensitivity of a function is now defined as the maximum share that it can contribute to the sum of the function values for any given shape. The total sensitivity of the input objects with respect to the shape fitting problem is the sum of the sensitivities over all . We remark that the functions will be weighted later on. However, a weight will simply encode a multiplicity of a point and so we will first present the framework for unweighted sets.
where the is over all with (if the set is empty we define ). The total sensitivity of is .
We remark that a function with sensitivity does not contribute to any solution of the problem and can be removed from the input. Thus, in the following we will assume that no such functions exist.
Notice that sensitivity is a measure of the influence of a function (describing an input object) with respect to the cost function of the shape fitting optimization problem. If a point has a low sensitivity, then there is no set of shapes to which cost the object contributes significantly. In contract, if a function has high sensitivity then the object is important for the shape fitting problem. For example, if in the -means clustering problem there is one point that is much further away from the cluster centers than all other points then it contributes significantly to the cost function and we will most likely not be able to approximate the cost if we do not sample this point.
How can we exploit sensitivity in the context of random sampling? The most simple sampling approach (that does not exploit sensitivity) is to sample a function uniformly at random and assign a weight to the point (where . For each fixed this gives an unbiased estimator, i.e., the expected value of is . Similarly, if we would like to sample points we can assign a weight to any of them to obtain an unbiased estimator. The problem with uniform sampling is that it may miss points that are of high influence to the cost of the shape fitting problem (for example, a point far away from the rest in a clustering problem). This also leads to a high variance of uniform sampling.
The definition of sensitivity allows us to reduce the variance by defining the probabilities based on the sensitivity. The basic idea is very simple: If a function contributes significantly to the cost of some shape, then we need to sample it with higher probability. This is where the sensitivity comes into play. Since the sensitivity measures the maximum influence a function has on any shape, we can sample with probability . This way we make sure that we sample points that have a strong impact on the cost function for some with higher probability. In order to ensure that the sample remains unbiased, we rescale a function that is sampled with probability with a scalar and call the rescaled function and let be the set of rescaled functions from . This way, we have for every fixed that the expected contribution of is , i.e., is an unbiased estimator for the cost of . The rescaling of the functions has the effect that the ratio between the maximum contribution a function has on a shape and the average contribution can be bounded in terms of the total sensitivity, i.e., if the total sensitivity is small then all functions contribute roughly the same to any shape. This will also result in a reduced variance.
Now the main contribution of the work of Feldman and Langberg [FL11] is to establish a connection to the theory of range spaces and VC-dimension. In order to understand this connection we rephrase the non-uniform sampling process as described above by a uniform sampling process. We remark that this uniform sampling process is only used for the analysis of the algorithm and must not be carried out by the sampling algorithm. The reduction is as follows. For some (large) value , we replace each rescaled function by copies of (for the exposition at this place let us assume that is integral). This will result in a new set of functions. We observe that sampling uniformly from is equivalent to sampling a function with probability and rescaling it by . Thus, this is again an unbiased estimator for (i.e., holds.). Also notice that , which means that relative error bounds for carry over to error bounds for .
We further observe that for any fixed and any function that corresponds to we have that . Furthermore, the average value of is . Thus, the maximum contribution of an only slightly deviates from its average contribution.
Now we can discretize the distance from any to the input points into ranges according to their relative distance from . If we know the number of points inside these ranges approximately, then we also know an approximation of .
In order to analyze this, Feldman and Langberg [FL11] establish a connection to the theory of range spaces and the Vapnik-Chervonenkis dimension (VC dimension). In our exposition we will mostly follow a more recent work by Braverman et al. [BFL16] that obtains stronger bounds.
In our analysis we will be interested in the VC-dimension of the range space . We recall that consists of (possibly multiply) copies of rescaled functions from the set . We further observe that multiple copies of a function do not affect the VC-dimension. Therefore, we will be interested in the VC-dimension of the range space where is obtained from by rescaling each function in by a non-negative scalar.
Finally, we remark that the sensitivity of a function is typically unknown. Therefore, the idea is to show that it suffices to be able to compute an upper bound on the sensitivity. Such an upper bound can be obtained in different ways. For example, for the -means clustering problem, such bounds can be obtained from a constant (bi-criteria) approximation.
In what follows we will prove a variant of a Theorem from [BFL16]. The difference is that in our version we guarantee that the weight of a coreset point is at least its weight in the input set, which will be useful in the context of streaming when the sensitivity is a function of the number of input points. The bound on the weight follows by including all points of very high sensitivity approximation value directly into the coreset.
Observe that in the context of the affine -subspace -clustering problem, the sum of the weights of a coreset for an unweighted point set cannot exceed (since we can put the centers to infinity).If for a different problem it is not possible to directly obtain an upper bound on the weights (for example, in the case of linear subspaces), one can add an artificial set of centers that enforces the bound on the weights in a similar way as in the affine case. However, we will not need this argument when we apply Theorem 31. Thus, when we apply Theorem 31 later on, we know that the weight of each point in the coreset is at least its weight in the input set, and that the total weight is not very large.
weighted functions such that with probability we have for all simultaneously
where denotes the weight of a function , and where is an upper bound on the VC-dimension of every range space induced by and that can be obtained by defining to be the set of functions from where each function is scaled by a separate non-negative scalar.
Proof: Our analysis follows the outline sketched in the previous paragraphs, but will be extended to non-negatively weighted sets of functions. The point weights will be interpreted as multiplicities. If each function has a weight , the definition of sensitivity becomes
It now follows from Theorem 7 that an i.i.d. sample of functions from the uniform distribution over is an -approximation for the range space with probability at least . We call this sample . In the following, we show that (suitably scaled) together with is a coreset for . In order to do so, we show that approximates the cost of every for (and so for ). For this purpose let us fix an arbitrary and let us assume that is indeed an -approximation. We would like to estimate upto small error. First we observe that
In order to charge this error, consider with corresponding . We know that
This implies . Combining both facts and the choice of , we obtain that the error is bounded by
Thus, when we rescale the functions inf by to obtain a new set of function we obtain
2 Bounds on the VC dimension of clustering problems
Proof: We first show that in the case the VC-dimension of the range space is . Then the result follows from the fact that the -fold intersection of range spaces of VC-dimension has VC-dimension [BEHW89, EA07].
Consider a subset with , denote the functions in by . Our next step will be to give an upper bound on the number of different ranges in our range space for that intersect with . Recall that the ranges are defined as
3 New Coreset for k𝑘k-Means Clustering
can be computed in time .
A constant -approximation can be computed in time with probability at least [ADK09]. From this we can compute the upper bounds on the sensitivites and so the result follows from Theorem 31.
The following theorem reduces the size of the coreset to be independent of . We remark that also here one can obtain slightly stronger bounds that are a bit harder to read. We opted for the simpler version.
can be computed, with probability at least , in time.
Proof: We would like to apply Theorem 28 where we need to do minor modifications to deal with weighted points. We first need to compute an optimal subspace in the weighted setting. We exploit that scaling each row by and then computing in time the singular value decomposition will result in a subspace that minimizes the squared distances from the weighted points. Next we need to project on the subspace spanned by the first right singular vectors for , i.e., we compute in time where is the matrix spanned by the first right singular vectors. The correctness of this approach follows from dividing the weighted points into infinitesimally weighted points of equal weight.
By replacing with in Theorem 35, an -coreset of the desired size and probability of failure can be computed for . Plugging this coreset in Theorem 28 yields the desired coreset in time
4 Improved Coreset for k𝑘k-Line-Means
The result in the following theorem is a coreset which is a weighted subset of the input set. Smaller coresets for -line means whose weights are negative or depends on the queries, as well as weaker coresets, can be found in [FMSW10, FL11] and may also be combined with the dimensionality reduction technique in our paper.
can be computed in time .
It is thus left to bound the sensitivity of each point and the total sensitivity. As explained in [VX12b], computing these bounds is based on two steps: firstly we compute an approximation to the optimal -line mean, so we can use Theorem 50 to bound the sensitivities of the projected sets of points on each line. Secondly, we bound the sensitivity independently for the projected points on each line, by observing that their distances to a query is the same as the distances to weighted centers. Sensitivities for such queries were bounded in [FS12] by . We formalize this in the rest of the proof.
An -approximation for the -line means problem with and can be computed in time with probability at least , where is defined in the theorem, using runs (amplification) of the algorithm in Theorem 10 in [FL11].
Next, due to [FS12] and [VX12b], any -approximation for the -line means problem can be used to compute upper bounds on the point sensitivities and then the sum of all point sensitivities is bounded by in additional time as defined in the theorem.
By combining this bound on the total sensitivity with the bound on the VC dimension in Theorem 31, we obtain that it is possible to compute a set of size as desired.
Notice that computing a constant factor approximation (or any finite multiplicative factor approximation that may be depend on ) to the -line means problem is NP-hard as explained in the introduction, if is part of the input. No bicriteria approximation with that takes polynomial time in is known. This is why we get a squared dependence on in our coreset size. It is possible to compute a constant factor approximation (in time exponential in ) : Set the precision to a reasonable constant, say , and then use exhaustive search on the -coreset to obtain a solution with a constant approximation factor. The constant factor approximation can then be used to compute a coreset of smaller size. However, exhaustive search on the coreset still takes time , meaning that the running time would include and a term that is doubly exponential in . We thus consider it preferable to use the coreset computation as stated in Theorem 37. This is in contrast to the case of -means where a constant factor approximation can be computed in time polynomial in ; see the proof of Theorem 36.
Now we apply our dimensionality reduction to see that it is possible to compute coresets whose size is independent of . The running time of the computation is also improved compared to Theorem 37.
can be computed in time .
Proof: Similarly to the proof of Theorem 36, we compute in time where . By replacing with in Theorem 37, a coreset of the desired size and probability of failure can be computed for . Plugging this coreset in Theorem 28 yields the desired coreset .
5 Computing Approximations Using Coresets
A well-known application of coresets is to first reduce the size of the input and then to apply an approximation algorithm. In Algorithm 6 below we demonstrate how Theorem 28 can be combined with existing coreset constructions and approximation algorithms to improve the overall running time of clustering problems by applying them on a lower dimensional space, namely, instead of dimensions. The exact running times depend on the particular approximation algorithms and coreset constructions. In Algorithm 6 below, we consider any -clustering problem that is closed under rotations and reflections and such that each is contained in some -dimensional subspace.
where (16), (18) and (19) follows from Theorem 28, (17) follows since is an -approximation to the -clustering of . After rearranging the last inequality,
where in the last inequality we used the assumption .
Streaming Algorithms for Subspace Approximation and k𝑘k-Means Clustering
Our next step will be to show some applications of our coreset results. We will use the standard merge and reduce technique [BS80] (more recently known as a general streaming method for composable coresets, e.g. [IMMM14, MZ15, AFZZ15]), to develop a streaming algorithm [AHPV04a]. In fact, even for the off-line case, where all the input is stored in memory, the running time may be improved by using the merge and reduce technique.
The idea of the merge and reduce technique is to read a batch of input points and then compute a coreset of them. Then the next batch is read and a second coreset is built. After this, the two coresets are merged and a new coreset is build. Let us consider the case of the linear -subspace problem as an example. We observe that the union of two coresets is a coreset in the following sense: Assume we have two disjoint point sets and with corresponding coresets and , such that
where and . Thus, the set together with the real value is a coreset for .
The merges are arranged in a way such that in an input stream of length , each input point is involved in merges. Since in each merge we are losing a factor of we need to put to obtain an -coreset in the end. We will now start to work out the details.
During the streaming, we only compute coresets of small sets of points. The size of these sets depends on the smallest input that can be reduced by half using our specific coreset construction. This property allows us to merge and reduce coresets of coresets for an unbounded number of levels, while introducing only multiplicative error. Note that the size here refers to the cardinality of a set, regardless of the dimensionality or required memory of a point in this set. We obtain the following result for the subspace approximation problem.
where denotes the matrix whose rows are the input points.
Furthermore, algorithm Output-Coreset computes in time from and a coreset of size such that
Proof: The proof follows earlier applications of the merge and reduce technique in the streaming setting [AHPV04a]. We first observe that after points have been processed, we have . From this, the bound on the size of follows immediately.
To analyze the running time let be the maximum value of during the processing of the input points. We observe that the overall running time is dominated by the coreset computations. Since the running time for the coreset computation for input point is is , we get
At the same time, we get since the value of reached the value and so the stage has been fully processed. Using we obtain
Finally, we would like to prove the bound on the approximation error. For this purpose fix some value of . We observe that the multiplicative approximation factor in the error bound for is for . Thus, this factor is at most . It remains to prove the following claim.
Proof: In the following we will use the inequality , which holds for all integer . We first prove the statement when is integral. Then
If is not an integer, we can find with such that is integral. The calculation above shows that
With the above claim the approximation guarantee follows. Finally, we observe that the running time for algorithm Output-Coreset follows from Theorem 17 and the claim on the quality is true because .
2 Streaming algorithms for the affine j𝑗j-subspace problem
We continue with the affine -subspace problem. This is the first coreset construction in this paper that uses weights. However, we can still use the previous algorithm together with algorithm affine--subspace-Coreset-Weighted-Inputs which can deal with weighted point sets. We obtain the following result. Let us use and to denote the algorithms Streaming-Subspace-Approximation and Output-Coreset with algorithm Subspace-Coreset replaced by algorithm affine--subspace-Coreset-Weighted-Inputs.
where denotes the matrix whose rows are the input points.
Furthermore, algorithm computes in time from an -coreset of size for the affine -subspace problem.
3 Streaming algorithms for k𝑘k-means clustering
Next we consider streaming algorithms for -means clustering. Again we need to slightly modify our approach due to the fact that the best known coreset constructions are randomized. We need to make sure that the sum of all error probabilities over all coreset constructions done by the algorithm is small. We assume that we have access to an algorithm -MeansCoreset that computes on input a weighted point set (represented by a matrix and weight vector ) with probability an -coreset of size for the -means clustering problem as provided in Theorem 36.
where denotes the matrix whose rows are the input points.
Furthermore, with probability at least we can compute in time from a coreset of size such that
Finally, we can compute in time a -approximation for the -means problem from this coreset.
Proof: We first analyze the success probability of the algorithm. In the th call to a coreset construction via Subspace-Coreset during the execution of Algorithm 7, we apply the above coreset construction with probability of failure . After reading points from the stream, all the coreset constructions will succeed with probability at least
Suppose that all the coreset constructions indeed succeeded (which happens with probability at least ), the error bound follows from Claim 41 in a similar way as in the proof of Theorem 40. The space bound of follows from the fact that and since is at most .
The running time follows from the fact that the computation time of a coreset of size can be done in time .
The last result follows from the fact that for every cluster there exists a subset of points such that their mean is a -approximation to the center of the cluster (and so we can enumerate all such candidate centers to obtain a -approximation for the coreset).
Coresets for Affine j𝑗j-Dimensional Subspace k𝑘k-Clustering
Now we discuss our results for the projective clustering problem. A preliminary version of parts of this chapter was published in [Sch14].
In this section, we use the sensitivity framework to compute coresets for the affine subspace clustering problem. We do so by combining the dimensionality reduction technique from Theorem 22 with the work by Varadarajan and Xiao [VX12a] on coresets for the integer linear projective clustering problem.
Every set of affine subspaces of dimension is contained in a -dimensional linear subspace. Hence, in principle we can apply Theorem 28 to the integer projective clustering problem, using and replace the input by the low rank approximation .
where the maximum is over . We need the following well-known technical fact, where we denote the determinant of by . A proof can for example be found in [GKL95], where this theorem is the second statement of Theorem 1.4 (where the origin is a vertex of the simplex).
If additionally satisfies , for all , then we have
Proof: Let be any set of affine -dimensional subspaces. Consider the partitioning of the rows in into matrices, according to their closest subspace in . Ties broken arbitrarily. Let be a matrix in this partition whose rank is at least . There must be such a matrix by the assumptions of the lemma. By letting denote the closest affine subspace from to the rows of , we have
Consider a -dimensional cube that is contained in , and contains the origin as well as the projection of onto . Suppose we choose the cube such that its side length is minimal, and let be this side length. For , we know that
If all points in satisfy , then
where the last inequality follows by combining the facts: (i) by letting denote the SVD of , (ii) since is invertible (has full rank), and (iii) each entry of is an integer, so implies . Combining the last inequalities yields
Our next step is to introduce -coresets, which will be a building block in the computation of coresets for the affine -dimensional -clustering problem. An -coreset is a coreset approximating the maximum distance between the point set and any query shape. The name is due to the fact that the maximum distance is the infinity norm of the vector that consists of the distances between each point and its closest subspace. The next definition follows [EV05].
If is the family of all sets of affine subspaces of dimension , then we call the --coreset an --coreset for .
We need the following result on -coresets for our construction.
Let be an integer and . Let and . There is an --coreset for , of size , where depends only on and . Moreover, can be constructed (with probability ) in time.
Let be an integer and be a matrix of rank . Let , , and let . Assuming the singular value decomposition of is given, an --coreset for of size can be constructed in time, where depends only on , and .
Proof: In order to deal with the weights we proceed as follows. We first define and . Since all are within a factor of of . Then we replace the input matrix by a matrix that contains copies of row of matrix , i.e. we replace each row of by a number of unweighted copies corresponding to its weight (rounded down).
Consider the set for some , and notice that it contains by definition. For each , let be one of the points in of maximum distance to . By the -coreset property, this implies that
Using this with the fact that is a subset of yields
By the definition of the sensitivity of a point, splitting a point into equally weighted points leads to dividing its sensitivity by . Recall that contains copies of . This implies that for every pair and with we get
where the second inequality follows because by its definition, and the last inequality is a bound on the harmonic number .
4 Bounding sensitivities by a movement argument
In this section we will describe a way to bound the sensitivities using a movement argument. Such an approach first appeared in [VX12b] and we will present a slight variation of it.
Proof: Let and be defined as in the theorem. Let be an arbitrary set of -dimensional affine subspaces. For every row of we have
Now the result follows from the definition of sensitivity.
5 Coresets for the Affine j𝑗j-Dimensional k𝑘k-Clustering Problem
In this section, we combine the insights from the previous subsections and conclude with our coreset result.
where is a function that depends only on and . Furthermore, the points in have integer coordinates and and the points have norm at most .
It remains to argue how to compute upper bounds on the sensitivities and get an upper bound for the total sensitivity. The rank of is at most , so Corollary 48 implies that an --coreset of size for , can be constructed in time, where depends only on and . Using this with Lemma 49 yields an upper bound on the sensitivity for every , such that the total sensitivity is bounded by
and the individual sensitivities can be computed in time. The result follows from Theorem 31 and the fact that the coreset computed in Theorem 31 is a subset of the input points.
where is a function that depends only on and . Furthermore, the norm of each row in is at most and .
Proof: The outline of the proof is as follows. We first apply our results on dimensionality reduction for coresets and reduce computing a coreset for the input matrix to computing a coreset for the low rank approximation for . A simple argument would then be to snap the points to a sufficiently fine grid and apply the reduction to -coresets summarized in this section. However, such an approach would give a coreset size that is exponential in (and so in ), which is not strong enough to obtain streaming algorithms with polylogarithmic space.
Therefore, we will proceed slightly differently. We still start by projecting to . However, the reason for this projecting is only to get a good bound on the VC-dimension. In order to compute upper bounds on the sensitivities of the points we apply Lemma 50 in the following way. We project the points of to an optimal -dimensional subspace and snap them to a sufficiently fine grid. Then we use Lemma 50 to get a bound on the total sensitivity. Note that we can charge the cost of snapping the points since the input matrix has rank more than and so by Lemma 45 there is a lower bound on the cost of an optimal solution. We now present the construction in detail.
Our first step is to replace the input matrix by a low rank matrix. An annoying technicality is that we would like to make sure that our low rank matrix has still optimal cost bounded away from . We therefore proceed as follows. We take an arbitrary set of rows of that are not contained in a -dimensional subspace. Such a set must exist by our assumption on the rank of . We use to denote the matrix that corresponds to this subset (with weights according to the corresponding weights of ) and we use to denote the matrix corresponding to the remaining points. We then compute for a value . If the rows are weighted, then we can think of a point weight as the multiplicity of a point and compute the low rank approximation as described in the proof of Theorem 36 and we let denote the projection of the weighted points on the subspace spanned by the first right singular values of , where is the singular value decomposition of (and we observe that the row norms of are at most ). We use to denote the matrix that corresponds to the union of the matrices and . In the following we will prove the result for the unweighted case and observe that it immediately transfers to the weighted case by reducing weights to multiplicities of points. We observe that by Theorem 22 with replaced by we obtain for every set that is the union of -dimensional affine subspaces:
Now let be an -coreset for the -dimensional affine -subspace clustering problem in a subspace that contains and has dimension , where is the rank of . Using identical arguments as in the proof of Theorem 28 we obtain that is an -coreset for .
By Lemma 50 it follows we can compute upper bounds on the sensitivites of by using the sensitivities of plus a term based on the movement distance. The total sensitivity will be bounded by a constant times the total sensitivity of .
It remains to argue how to compute upper bounds on the sensitivities and get an upper bound for the total sensitivity. The rank of is at most , so Corollary 48 implies that an --coreset of size for , can be constructed in time, where depends only on and . Using this with Lemma 49 yields an upper bound on the total sensitivity of and the individual sensitivities can be computed in time. The result follows from Theorem 31.
Streaming Algorithms for Affine j𝑗j-Dimensional Subspace k𝑘k-Clustering
We will consider a stream of input points with integer coordinates and whose maximum norm is bounded by . In principle, we would like to apply the merge and reduce approach similarly to what we have done in the previous streaming section. However, we need to deal with the fact that the resulting coreset does not have integer coordinates, so we cannot immediately apply the coreset construction recursively. Therefore, we will split our streaming algorithm into two cases. As long as the input/coreset points lie in a low dimensional subspace, we apply Theorem 51 to compute a coreset. This coreset is guaranteed to have integer coordinates of norm at most . Once we reach the situation that the input points are not contained in a -dimensional subspace we will switch to the coreset construction of Theorem 52. We will exploit that by Lemma 45 we have a lower bound of, say, on the cost of the optimal solution. In order to meet the prerequisites of Theorem 52 we need to move the points to a grid. If the grid is sufficiently fine, this will change the cost of any solution insignificantly and we can charge it to .
We will start with the first algorithm. We assume that there is an algorithm -SubspaceCoreset that computes a coreset of size , where is the bound guaranteed by Theorem 51. We do not specify the coreset algorithm is pseudocode since the result is of theoretical nature and the algorithm rather complicated.
Now we turn to the second algorithm. We assume that the algorithm receives a lower bound of on the cost of an optimal solution. Such a lower bound follows from Lemma 45 when the input consists of integer points that are not contained on a -dimensional subspace. Since this is the case when Algorithm 11 is invoked, we may assume that .
Let . There exists such that on input a stream of -dimensional points with integer coordinates and maximum -norm , algorithms 10 and 11 maintain with probability at least in overall time a set of points weighted with a vector and a real value such that for every set of -dimensional subspaces the following inequalities are satisfied:
where denotes the matrix whose rows are the input points.
Proof: We first analyze the success probability of algorithms 10 and 11. In the th call to a coreset construction during the execution of our algorithms, we apply the above coreset construction with probability of failure . After reading points from the stream, all the coreset constructions will succeed with probability at least
The space bound of follows from the fact that and since is at most . Furthermore, we observe that for algorithm 11 we can assume that the input has integer coordinates and maximum norm for some function (where we use that we can assume as otherwise we can simply maintain all the points. The running time follows from the fact that the computation time of a coreset of size can be done in time .
It remains to proof that the resulting sets are a coreset. Here we first observe that at any stage of the algorithm a coreset that corresponding to a set of input points can have at most points. Otherwise, the coreset property would be violated if all centers are sufficiently far away from the input set. For the analysis, we can replace our weighted input set by unweighted sets (written by a matrix ) and apply Corollary 21 to show that
where is the matrix obtained by snapping the rows of to a grid of side length . Suppose that all the coreset constructions indeed succeeded (which happens with probability at least ), the error bound follows from Claim 41 in a similar way as in the proof of Theorem 40 by viewing the snapping procedure as an additional coreset construction (so that we have levels instead of ).
Small Coresets for Other Dissimilarity Measures
In this section, we describe an alternative way to prove the existence of coresets with a size that is independent of the number of input points and the dimension. It has an exponential dependency on and thus leads to larger coresets. However, we show that the construction works for a -means variant based on a restricted class of -similar Bregman divergences. Bregman divergences are not symmetric, and the -means variant with Bregman divergences is not a -clustering problem as defined in Definition 12. Thus, the additional construction can solve at least one case that the previous sections do not cover.
2 Clustering problems with nice dissimilarity measures
We say that a dissimilarity is nice if the clustering problem that it induces satisfies the following two conditions. Firstly, if we have an where the best clustering with clusters is not much cheaper than the cost of with only one center, then this has to induce a coreset for . We imagine this as being pseudo random; since it has so little structure, representing with fewer points is easy. Secondly, if a subset has negligible cost compared to , then it is possible to compute a small weighted set which approximates the cost of up to an additive error which is an -fraction of the cost of . Note that this is a much easier task than computing a coreset for , since may be represented by a set with a much higher error then its own cost. The following definition states our requirements in more detail. If we say that is a partitioning of , we mean that the rows of are partitioned into sets which then induce matrices with columns. By we mean that the rows of are a subset of the rows of , and by we mean the number of rows in .
We say that a dissimilarity measure is nice if the clustering problem with dissimilarity (see Definition 54) satisfies the following conditions.
If an optimal -clustering of is at most a -factor cheaper than the best -clustering, then this must induce a coreset for :
If for all partitionings of into matrices, then there exists a coreset of size such that for any set of centers we have , for a function which only depends on and , and a function that only depends on .
If the cost of is very small, then it can be represented by a small set which has error for any :
If for , then there exist a set of size and a constant such that for any set of centers we have .
3 Algorithm for nice dissimilarity measures
In the following, we will assume that we can solve the clustering problem optimally. This is only for simplicity of exposition; the algorithm still works if we use an approximation algorithm. Algorithms 12 and 13 give pseudo code for the algorithm. Algorithm 12 is a recursive algorithm that partitions into subsets. Every subset in the partitioning is either very cheap (defined more precisely below), or pseudo random, meaning that . This is achieved by a recursive partitioning. The trick is that whenever a set is not pseudo random, then the overall cost is decreased by a factor of by the next partitioning step. This means that after sufficiently many () levels, all sets have to be cheap. Indeed, not only are the individual sets cheap, even the sum of all their -clustering costs is cheap.
Let denote the set of all subsets generated by the algorithm on level (where the initial call is level , and where not all sets in end up in since some of them are further subdivided). The input set has cost . For every level in the algorithm, the overall cost is decreased by a factor of . Thus, the sum of all -clustering costs of sets in is . For , this is smaller than . We have at most sets that survive until level of the recursion, and then their overall cost is bounded by . By Condition 2, this implies the existence of a set of size which has an error of at most .
For all sets where we stop early (the pseudo random sets), Condition 1 directly gives a coreset of size . The union of these coresets give a coreset for the union of all pseudo random sets. Altogether, they induce an error of less than . Together with the error induced by the cheap sets on level , this gives a total error of . So, if we start every thing with , we get a coreset for with error . The size of the coreset is .
If is a nice dissimilarity measure according to Definition 56, then there exists a coreset of size for for the clustering problem with dissimilarity .
For -means, we can achieve that and . Thus, the overall coreset size is . We do not present this in detail as the coreset is larger than the -means coreset coming from our first construction. However, the proof can be deduced from the following proof for a restricted class of -similar Bregman divergences, as the -means case is easier.
4 Coresets for μ𝜇\mu-similar Bregman divergences
We say that is -covering if it contains the union of all balls of radius for all . For our proof, we need that is convex and -covering. Because of this additional restriction, our setting is much more restricted than in [AB09]. It is an interesting open question how to remove this restriction and also how to relax the -similarity.
To show that Condition 1 holds, we set and assume that we are given a point set that is pseudo random. This means that it satisfies for any partitioning of into subsets that
We show that this restricts the error of clustering all points in with the same center, more specifically, with the center , the center closest to . To do so, we virtually add points to . For every , we add one point with weight with coordinate to . Notice that is defined on these points because we assumed that is -covering. The additional point shifts the centroid of to because
We name the set consisting of together with the weighted added point and the union of all is . Now, clustering with center is certainly an upper bound for the clustering cost of with . Additionally, when clustering with only one center, then is optimal, so clustering with can only be more expensive. Thus, clustering all with the centers gives an upper bound on the cost of clustering with . So, to complete the proof, we have to upper bound the cost of clustering all with the respective centers . We do this by bounding the additional cost of clustering the added points with , which is
for the -dimensional vector defined by
with and . Then,
where we use the triangle inequality again for the second inequality. Now we observe that
Additionally, by the definition of -similarity and by Equation (27) it holds that
This implies that and thus
This means that Condition 1 holds: If a -clustering of is not much cheaper than a -clustering, then assigning all points in to the same center yields a -approximation for arbitrary center sets. This means that we can represent by , with weight and . Since we only need one point for this, we even get that .
For the second condition, assume that is a set of subsets of representing the subsets according to an optimal -clustering. Let a set of centers be given, and define the partitioning for every according to as above. By Equation (27) and by the precondition of Condition 2,
We use the same technique as in the proof that Condition 1 holds. There are two changes: First, there are sets where the centroids of the subsets must be moved to the centroid of the specific (where in the above proof, we only had one set ). Second, the bound depends on instead of , so the approximation is dependent on as well, but this is consistent with the statement in Condition 2.
We set and again virtually add points. For each and each subset of , we add a point with weight and coordinate to . Notice that these points lie within the convex set that is defined on because we assumed that is -covering.
We name the new sets , and . Notice that the centroid of is now
in all cases. Again, clustering with is an upper bound for the clustering cost of with , and because the centroid of is , clustering every with is an upper bound on clustering with . Finally, we have to upper bound the cost of clustering all in all with , which we again do by bounding the additional cost incurred by the added points. Adding this cost over all yields
For the last equality, we define vectors by
and concatenate them in arbitrary but fixed order to get a dimensional vector . By the triangle inequality,
with and . Define and by concatenating the vectors and , respectively, in the same order as used for . Then we can again conclude that
where we use the triangle inequality for the second inequality. Now we observe that
Additionally, by the definition of -similarity and by Equation (27) it holds that
This implies that and thus
Proof: We have seen that the two conditions hold with , and and . By Lemma 57, this implies that we get a coreset, and that the size of this coreset is bounded by