Analysis of Ward's Method
Anna Gro{\ss}wendt, Heiko R\"oglin, Melanie Schmidt

TL;DR
This paper analyzes Ward's hierarchical clustering method for the $k$-means problem, providing approximation guarantees under separation and balance conditions, and establishing bounds in various dimensions.
Contribution
It offers the first theoretical analysis of Ward's method for $k$-means, showing approximation ratios and bounds under specific data conditions.
Findings
Ward's method achieves a 2-approximation under separation.
Full optimal recovery with balance condition.
Lower bounds in high dimensions without separation.
Abstract
We study Ward's method for the hierarchical -means problem. This popular greedy heuristic is based on the \emph{complete linkage} paradigm: Starting with all data points as singleton clusters, it successively merges two clusters to form a clustering with one cluster less. The pair of clusters is chosen to (locally) minimize the -means cost of the clustering in the next step. Complete linkage algorithms are very popular for hierarchical clustering problems, yet their theoretical properties have been studied relatively little. For the Euclidean -center problem, Ackermann et al. show that the -clustering in the hierarchy computed by complete linkage has a worst-case approximation ratio of . If the data lies in for constant dimension , the guarantee improves to , but the -notation hides a linear dependence on .…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsFacility Location and Emergency Management · Advanced Clustering Algorithms Research · Stochastic Gradient Optimization Techniques
\RedeclareSectionCommand
[indent=0pt]subparagraph
Analysis of Ward’s Method††thanks: This research was supported by ERC Starting Grant 306465 (BeyondWorstCase).
Anna Großwendt Department of Computer Science, University of Bonn, Bonn, Germany
[email protected], [email protected], [email protected]
Heiko Röglin44footnotemark: 4
Melanie Schmidt44footnotemark: 4
Abstract
We study Ward’s method for the hierarchical -means problem. This popular greedy heuristic is based on the complete linkage paradigm: Starting with all data points as singleton clusters, it successively merges two clusters to form a clustering with one cluster less. The pair of clusters is chosen to (locally) minimize the -means cost of the clustering in the next step.
Complete linkage algorithms are very popular for hierarchical clustering problems, yet their theoretical properties have been studied relatively little. For the Euclidean -center problem, Ackermann et al. [1] show that the -clustering in the hierarchy computed by complete linkage has a worst-case approximation ratio of . If the data lies in for constant dimension , the guarantee improves to [23], but the -notation hides a linear dependence on . Complete linkage for -median or -means has not been analyzed so far.
In this paper, we show that Ward’s method computes a -approximation with respect to the -means objective function if the optimal -clustering is well separated. If additionally the optimal clustering also satisfies a balance condition, then Ward’s method fully recovers the optimum solution. These results hold in arbitrary dimension. We accompany our positive results with a lower bound of for data sets in that holds if no separation is guaranteed, and with lower bounds when the guaranteed separation is not sufficiently strong. Finally, we show that Ward produces an -approximative clustering for one-dimensional data sets.
1 Introduction
Clustering is a fundamental tool in machine learning. As an unsupervised learning method, it provides an easy way to gain insight into the structure of data without the need for expert knowledge to start with. One of the most popular clustering objectives is -means: Given a set of points in the Euclidean space , find centers that minimize the sum of the squared distances of each point in to its closest center. The objective is also called sum of squared errors, since the centers can serve as representatives, and then the sum of the squared distances becomes the squared error of this representation.
Theory has focused on metric objective functions for a long time: Facility location or -median are very well understood, with upper and lower bounds on the best possible approximation guarantee slowly approaching one another. The -means cost function is arguably more popular in practice, yet its theoretical properties were long not the topic of much analysis. In the last decade, considerable efforts have been made to close this gap.
We now know that -means is NP-hard, even in the plane [31] and also even for two centers [3]. The problem is also APX-hard [9], and the currently best approximation algorithm achieves an approximation ratio of 6.357 [2]. The best lower bound, though, is only 1.0013 [27]. A seminal paper on -means is the derivation of a practical approximation algorithm, -means++, which is as fast as the most popular heuristic for the problem (the local search algorithm due to Lloyd [29]), has an upper bound of on the expected approximation ratio, and has proven to significantly improve the performance on actual data [6]. Due to its simplicity and superior performance, it (or variants of it) can now be seen as the de facto standard initialization for Lloyd’s method.
From a practical point of view, however, there is still one major drawback of using -means++ and Lloyd’s method, and this has nothing to do with its approximation ratio or speed. Before using any method that strives to optimize -means, one has to determine the number of clusters. If one knows very little about the data at hand, then even this might pose a challenge. Indeed, there are several suggestions how to set , which usually look at the tradeoff between the number of clusters and the cost (which decreases if the number of clusters is increased). For example, the elbow method searches for a point where the cost decreases dramatically, arguing that this happens only at the point of the true number of clusters. However, there are many more methods to choose from (see for example the summary in §5 of [37]). Notice that one usually needs to compute multiple clusterings for different to use such a method.
However, there is a simpler and popular method available: hierarchical clustering. Instead of computing clusterings for several different numbers of clusters and comparing them, one computes one clustering tree (a dendrogram), which contains a clustering for every value of . For any , the -clustering in such a tree results from the -clustering in the same tree by merging two clusters. The hierarchical clustering does not only provide an answer for every , it also allows the user to view the data at different levels of granularity. A hierarchical clustering is apparently something very desirable, but the question is: Can the solutions be good for all values of ? Do we lose much by forcing the hierarchical structure?
Dasgupta and Long [21] were the first to give positive and negative answers to this question. Their analysis evolves around the (metric) -center problem, which is to minimize the maximum radius of any cluster. They compare the -center cost on each level of a hierarchical clustering to an optimal clustering with the best possible radius with the same number of clusters and look for the level with the worst factor. It turns out that popular heuristics for hierarchical clustering can be off by a factor of or even compared to an optimal clustering. Dasgupta and Long also propose a clever adaption of the -approximation for -center due to González [22], which results in a hierarchical clustering algorithm. For this algorithm, they can guarantee that the solution is an -approximation of the optimum on every level of the hierarchy simultaneously.
In a series of works, Mettu, and Plaxton [34], Plaxton [36] and finally Lin, Nagarajan, Rajaraman, and Williamson [28] develop and refine algorithms for the hierarchical -median problem, which can be seen as the metric cousin of the hierarchical -means problem. It consists of minimizing the sum of the distances of every point to its closest center, and is usually studied in metric spaces. The best known approximation guarantee is . However, the quality guarantee vastly deteriorates for -means: An -approximation for the hierarchical -means problem follows from [36, 34] as well as from [28], but the approximation ratios range between and .
On the practical side, however, there is a long known greedy algorithm for the hierarchical -means problem, named Ward’s method [39]. In the fashion of complete linkage algorithms, it does the following. It starts with singleton clusters, one for each data point from the input . Then it performs iterations where two clusters in the current clustering are merged (this is called agglomerative clustering). In each iteration, it chooses the pair of clusters which results in the cheapest clustering. This is a locally optimal choice only, since the optimal merge in one operation may prove to be a poor choice with respect to a later level of the hierarchy.
To the best of the authors’ knowledge, the worst-case quality of Ward’s method has not been studied so far. In particular, it was not known whether the algorithm can be used to compute constant-factor approximations. We answer this question negatively by giving a family of examples with increasing and where the approximation factor of Ward is .
To explain the algorithms popularity, we then proceed to study it under different clusterability assumptions. Clustering problems are usually NP-hard and even APX-hard, yet clustering is routinely solved in practical applications. This discrepancy has led to the hypothesis that data sets are either easy to cluster, or they have little interesting structure to begin with. ‘Well-clusterable data sets are computationally easy to cluster’ [14] and ‘Clustering is difficult only when it does not matter’ [18] are two slogans summarizing this idea. Following it, many notions have been developed that strive to capture how well a data set is clusterable. One such notion is center separation [15]: A data set is -center separated for some number of clusters if the distance between any pair of clusters in the target clustering is at least times the maximal radius of one of the clusters. It satisfies the similar -center proximity [8] for if in the optimum -clustering the distance of each data point to any center except for its own is larger by a factor of at least than the distance to its own center.
We apply these notions to hierarchical clustering by showing that if there is a well-separated optimum solution for a level, then the clustering computed by Ward on this level is a -approximation. This means that Ward finds good clusterings for all levels of granularity that have a meaningful clustering; and these good clusterings have a hierarchical structure. For levels on which the sizes of the optimal clusters are additionally to some extend balanced, we prove that Ward even computes the optimum clustering.
Related work.
The design of hierarchical clustering algorithms that satisfy per-level guarantees started with the paper by Dasgupta and Long [21]. They give a deterministic -approximation and a randomized -approximation for hierarchical -center. Their method turns González’ algorithm [22] into a hierarchical clustering algorithm. González’ algorithm is a -approximation not only for -center, but also for the incremental -center problem: Find an ordering of all points, such that for all , the first points in the ordering approximately minimize the -center cost. The idea to make an algorithm for incremental clustering hierarchical was picked up by Plaxton [36], who proves that this approach leads to a constant factor approximation for the hierarchical -median problem. He uses an incremental -median algorithm due to Mettu and Plaxton [34]. Finally, Lin, Nagarajan, Rajaraman and Williamson [28] propose a general framework for approximating incremental problems that also works for incremental variants of MST, vertex cover, and set cover. They also cast hierarchical -median and -means into their framework for incremental approximation. They get a randomized/deterministic -approximation for hierarchical -median and a randomized/deterministic -approximation for -means, where is the approximation ratio of a -means approximation algorithm. Thus, applying [2] yields guarantees of and , respectively.
Lattanzi, Leonardi, Mirrokni, and Razenshteyn [26] develop a constant factor algorithm for robust hierarchical -center, i.e., a variant with outliers. In a different line of work, Dasgupta recently developed a new cost function for similarity-based hierarchical clusterings [20]. Although it can be transferred to the setting of dissimilarity measures, this yields an objective for which any solution is a constant factor approximation [17]. Work on this new cost function includes [16, 17, 20]. Balcan et al. present an algorithm for computing hierarchical clusterings that clusters the data accurately in the presence of outliers if the data satisfies certain clusterability properties [11, 13].
In practice, -means and hierarchical -means are rather tackled by popular heuristics, but the properties of these algorithms are often unknown. The famous -means algorithm due to Lloyd [30] was analyzed about ten years ago and became the subject of many papers, including [4, 5, 7, 19, 33, 35, 38]. This has led to the development of -means++ [6], a practically efficient algorithm with a theoretical approximation guarantee of .
Hierarchical clustering algorithms work either top-down (divisive methods) or bottom-up (agglomerative methods). Agglomerative methods are more popular because they are usually faster, and the most popular agglomerative methods are based on the complete linkage strategy. Here, the clusters to be merged are those which minimize the cost of the clustering in the next step. Using complete linkage for -means yields Ward’s method [39].
There is a relatively small number of papers studying the performance of complete linkage algorithms. Dasgupta and Long [21] establish the above mentioned lower bound for -center. Ackermann, Blömer, Kuntze, and Sohler [1] study complete linkage for variants of -center in the Euclidean space. The variants include minimizing the radius, the discrete radius and the diameter. They show that for constant dimension, complete linkage provides -approximations for -center as well as all variants of it. The drawback is that the approximation factor depends on the the dimension of the space (the extent of the dependence goes from linear dependence to doubly exponential dependence, depending on the problem variant). Großwendt and Röglin [23] improve the analysis, showing that for constant dimension, complete linkage indeed provides an -approximation. The dependencies on prevail.
Balcan, Liang, and Gupta [13] observe that Ward’s method cannot be used to recover a given target clustering.
There is a vast body of literature on clusterability assumptions, i.e., assumptions on the input that make clustering easier either in the sense that a target clustering can be (partially) recovered or that a good approximation of an objective function can be computed efficiently. A survey of recent work in this area can be found in [14]. Particularly relevant for our paper are the notions of -center separation [15] and -center proximity [8] mentioned above. There are several papers showing that under these assumptions it is possible to recover the target/optimal clustering if and are sufficiently large [8, 12, 25, 32]. Other notions include the strict separation property of Balcan, Blum, and Vempala [11], the -separation property of Ostrovsky et al. [35], and the weaker version of the proximity condition due to Kumar and Kannan [24] which Awasthi and Sheffet [10] proposed (it is based on the spectral norm of a matrix whose rows are the difference vectors between the points in the data set and their centers). For all these notions of clusterability, algorithms are developed that (partially) recover the target/optimal clustering.
Our results.
In §3, we analyze the approximation factor of Ward’s method on data sets that satisfy different well-known clusterability notions. It turns out that the assumption that the input satisfies a high -center separation [15] or -center proximity [8] implies a very good bound on the approximation guarantee of Ward’s method. We show that Ward’s method computes a -approximation for all values of for which the input data set satisfies -center separation or -center proximity. We also show that on instances that satisfy -center separation and for which all clusters and in the optimal clustering satisfy , Ward even recovers the optimal clustering.
In §4 we show that, in general, Ward’s method does not achieve a constant approximation factor. We present a family of instances with on which the cost of the -clustering computed by Ward is larger than the cost of the optimal -means clustering of by a factor of . Then we observe that the family of instances used for this lower bound satisfy the strict separation property of Balcan, Blum, and Vempala [11], the -separation property of Ostrovsky et al. [35] for any , and the separation condition from Awasthi and Sheffet [10]. Hence, none of these three notions of clusterability helps Ward’s method to avoid that the approximation factor grows exponentially with the dimension.
Finally in §5 we show that the approximation ratio of Ward’s method on one-dimensional inputs is . The one-dimensional case turns out to be more tricky than one would expect, and our analysis is quite complex and technically challenging.
Preliminaries.
We consider inputs in the Euclidean space . The Euclidean distance of is denoted by . Let be a finite set of points. For any center , we denote the sum of the squared distances of each point in to by This sum is minimized when the center is the centroid of . We set . For any set of centers , the -means objective cost is The -means cost of is . If is weighted with a weight function , then we denote the total weight by and extend the above notations by , , and . The weighted -means objective is . We denote by / the value of a solution that minimizes the (weighted) -means objective, i.e., and , respectively.
We use the abbreviation for .
Hierarchical clustering.
As described by Dasgupta and Long [21], a hierarchical clustering is a nested partitioning of a point set into and finally clusters, where each intermediate clustering is a more fine-grained version of the previous clustering that results from dividing one cluster into two. This definition is ‘top-down’. Complete linkage algorithms build the hierarchical clustering ‘bottom-up’ by starting with singleton clusters and then subsequently merging two clusters into one until only one cluster remains. We will adapt this view and define a hierarchical clustering as a sequence of partitionings , where and , i.e., shall be the clustering after merges. The intermediate partitionings satisfy that for two clusters . Note that we can fully describe by the sequence of the merge operations that it implicitly contains.
A hierarchical clustering contains a -clustering for any . The clusterings are given as partitionings, the centers are implicitly defined as the centroids. More precisely, the -clustering defined by a hierarchical clustering has the centers . We thus define the -means clustering cost of for a given as
[TABLE]
Useful Facts about -means.
The following two facts are well known.
Lemma 1** (Relaxed triangle inequality).**
For all ,
Lemma 2**.**
For any finite point set and any ,
Lemma 2 has the following important consequence. Whenever a set of points is clustered together, i.e., all points in it are assigned to the same center in a given solution, then the cost for this assignment can be computed by knowing only the centroid of the point set and . Thus, we can treat such a as one weighted point with some additional constant cost. This view is very helpful to simplify the analysis of agglomerative hierarchical clustering strategies.
Ward’s method.
Ward’s method (or simply Ward in the following) is a greedy algorithm. To describe it, the easiest way is to define the following quantity that describes how much the sum of the -means costs increases when merging two clusters.
Definition 3**.**
Let be two finite point sets. We define . If a set contains only one point, e.g., , we slightly abuse notation and write (similarly, if and , we write ).
Ward’s method is agglomerative. It starts with singleton clusters. Then in every step, it greedily chooses two clusters in the current clustering for which is minimal. This choice is optimal for the next clustering, but subsequent merges and clusterings may suffer from it. We denote the costs of the -clustering computed by Ward’s method on data set by .
2 Techniques and Observations
2.1 Upper Bounds: Proof Technique in a Nutshell
Let us give an overview of the basic idea underlying our proof that Ward’s method computes a -approximation for all values of for which the input data set satisfies -center separation or -center proximity. The main challenge is to relate the cost of the -clustering computed by Ward to the cost of an optimal -clustering. For this, we fix an arbitrary optimal -clustering . Consider an arbitrary cluster and let be the data points consists of (in the actual proof, is defined slightly differently). We consider the set of merges. Observe that the merges in cannot be applied one after another because after the first merge the singleton point is gone, which is to be merged in the second merge . Since it is possible to do every second merge of , one can argue that all merges in together cost at most . Now let . Then all merges in together cost at most .
The next step is then to construct a bijection between the set of the merges performed by Ward to form a -clustering and the set . This bijection has the property that every merge of Ward is at most as expensive as the merge in assigned to it. This implies that Ward computes a clustering with cost at most . In order to construct this bijection, consider a step of Ward in which two clusters and are merged. Let denote the current clustering directly before this merge happens, and let denote the set of those merges from that are feasible in and unassigned, i.e., those merges for which both clusters are contained in and that have not been assigned to any previous merge of Ward. We know that any merge from is at least as expensive as the merge of and because Ward chooses the next merge greedily. Hence, in the bijection we can map the merge of and to an arbitrary merge from . This implies that if is non-empty in every step, the bijection can be constructed. Since this can only be guaranteed if every merge of Ward decreases the number of available merges in by only 1. One can show that this follows from the separation assumption.
For the one-dimensional case, the basic approach is similar. The main difference is that without separation, we can no longer guarantee that the number of available merges decreases by only with every step of Ward. Indeed, the original set of good merges may be empty after merges. To bound the cost of the remaining merge steps, we find a new set of (relatively) good merges, i.e., a set of merges whose costs can be bounded by a constant times . Again, this set may run dry, and we have to start again. Essentially, we show that after a constant number of phases (Ward merges that are charged against a specific set of good merges), Ward has obtained a -clustering.
Although the basic idea is similar, the technical implementation of the proof for is very different from our proof for well-clusterable data. Every time that Ward does not merge in a way compatible to the optimum clustering, we have to account for all possible consequences. Techniques like reordering help us to organize the proof. We also simplify the instance before the actual proof.
2.2 Useful Statements
Here we discuss some of the technical statements which we feel may be of interest for future work. All omitted proofs in this section can be found in the full version of this paper.
Cost of one step.
The value plays a central role in the analysis of Ward’s method. By using Lemma 2, it is easy to show that does not depend on or . The following lemma gives an explicit formula, which leads to convenient upper and lower bounds. These bounds say that the cost of merging two clusters is roughly equivalent to assigning the points of the smaller cluster to the centroid of the larger cluster.
Lemma 4**.**
Let and be two clusters. Then . Furthermore, The left hand side is attained for , and the right hand side for .
How cost accumulates.
Notice that whenever Ward makes a decision, it is optimal for the clustering in the next step. Where does its error lie? The problem is that every merge forces the points of two clusters to be in the same cluster for any clustering to come. In later clusterings, the condition to cluster certain points together may induce error. We need a way to bound this error. We prove the following technical statement.
Corollary 5**.**
Let , , and be three disjoint sets of points with (or , for weighted sets). Then and .
To see how Corollary 5 can be used, assume that and belong to different optimum clusters which Ward merged during its execution. Now Corollary 5 tells us something about the compatibility of with the optimum clustering. We pick the smaller of the two clusters, say . Assume that we still have some subset of ’s optimum cluster, i.e., there is a cluster that is still part of the clustering. Then we can merge with . Corollary 5 says that what we lose is proportional to the optimum cost plus the cost that we already invested into our clustering at an earlier time: and are both part of the optimum cost, and is what Ward (accumulatively) already payed for merging and .
Monotonicity.
Notice that performing arbitrary merge operations is not monotone: Say that are one-dimensional points such that the centroid of and is . Then merging and first results in a point set where merging with costs nothing; clearly, this is not monotone. Indeed, when considering a natural variant of Ward’s method for the related -median problem, monotonicity is not true. Even for a simple isosceles triangle, greedily chosen merges result in non-monotone merge costs. However, Ward’s merges are indeed monotone. We show the following statement by proving a decomposition lemma for .
Corollary 6**.**
[Monotonicity of Ward’s method] Let be the increase of the objective function in the -th step of Ward’s method. Then for .
Monotonicity is a very helpful property. In the argument discussed in §2.1 we use, e.g., that all merges that are possible in the final -clustering computed by Ward’s method are at least as expensive as all merges that are performed before by Ward’s method to obtain the -clustering.
Special structures in dimension one.
The following statements only hold for . First we observe that Ward satisfies the following convexity property.
Lemma 7** (Convexity in ).**
For any three finite convex clusters with , we have or .
Lemma 7 means that Ward will never merge and if a point or cluster lies between them on the line. This establishes that Ward’s clusters never overlap. It gives us a concept of neighbors on the line.
We combine Lemma 7 with a convexity property of Ward (see Corollary 25). This allows us to prove a powerful technique that we call reordering. Say that Ward at some point merges two clusters and . Then and are neighbors on the line. This means that merging and will result in a centroid which is further away from any other cluster than and are. So, clusters that did not want to merge with or would also not merge with (by Corollary 25). Thus, we could perform the merge earlier without distorting Ward’s course of action at all (except that the merge is at the wrong position). This allows us to reorder Ward’s merges for our analysis.
3 Ward on Well-Clusterable Data
Clustering suffers from a general gap between theoretical study and practical application; clustering objectives are usually NP-hard to optimize, and even NP-hard to approximate to arbitrary precision. On the other hand, heuristics like Lloyd’s algorithm, which can produce arbitrarily bad solutions, are known to work well or reasonably well in practice. One way of interpreting this situation is that data often has properties that make the problem computationally easier. Indeed, for clustering it is very natural to assume that the data has some structure – otherwise, what do we hope to achieve with our clustering? The challenge is to find good measures of structure that characterize what makes clustering easy (but non-trivial).
Many notions of clusterability have been introduced in the literature and there are also different ways to measure the quality of a clustering. While traditionally a clustering is evaluated on the basis of an objective function (e.g., the -means objective function), there has been an increased interest recently to study which notions of clusterability make it feasible to recover (partially) a target clustering, some true clustering of the data. For this, the niceness conditions imposed on the input data are usually some form of separation condition on the clusters of the target clustering. We study the effect of five well-studied clusterability notions on the quality of the solution computed by Ward’s method.
First we study the notions of -center separation and -center proximity, which have been introduced by Ben-David and Haghtalab [15] and Awasthi, Blum, and Sheffet [8], respectively.
Definition 8** ([15]).**
An input satisfies -center separation with respect to some target clustering if there exist centers such that for all . We say the input satisfies weak -center separation if for each cluster with and for all , .
Kushagra, Samadi, and Ben-David [25] show that single linkage and a pruning technique are sufficient to find the target clustering under the condition that the data satisfies -center separation for .
While the goal of Ben-David and Haghtalab [15] is to recover a target clustering, we focus in this paper on approximating the -means objective function. Hence, in the following we will always assume that the target clustering is an optimal -means clustering (which we usually denote by ) and the centers are the optimal -means centers for this clustering. We will make this assumption also for all other notions of clusterability that are based on a target clustering and that we introduce in the following.
Definition 9** ([8]).**
An instance satisfies -center proximity if there exists an optimal -means clustering with centers such that for all and for any point it holds .
Awasthi, Blum, Sheffet [8] introduced the notion of -perturbation resilience and showed that it implies -center proximity. They show that for , the optimal clustering can be recovered if the data is -perturbation resilient. This was improved by Balcan and Liang [12] and finally by Makarychev and Makarychev [32], who show that it is possible to completely recover the optimal clustering for . The latter paper shows that the results even hold for a weaker property called metric perturbation resilience. We show that for large enough and , Ward’s method computes a -approximation if the data satisfies -center separation or -center proximity.
Theorem 10**.**
Let be an instance that satisfies weak -center separation or -center proximity for some and some number of clusters. Then the -clustering computed by Ward on is a -approximation with respect to the -means objective function.
We also show that on instances that satisfy -center separation and for which all clusters and in the optimal clustering satisfy , Ward even recovers the optimal clustering.
It is interesting to note that the example proposed by Arthur and Vassilvitskii [6] that shows that the famous -means++ algorithm has an approximation ratio of satisfies -center separation and -center proximity for large values of and , and has balanced clusters, i.e., .
Observation 11**.**
There is a family of examples where -means++ has an expected approximation ratio of , while Ward computes an optimal solution.
In contrast we will see that the instances that we use to prove our exponential lower bound on the approximation factor of Ward’s method (Theorem 22) satisfy -center separation and -center proximity for and . We will also see that even for arbitrary large and there are instances that satisfy -center separation and -center proximity and on which Ward’s method does not compute an optimal solution. In addition to center separation and center proximity we study the following three other prominent notions of clusterability: the strict separation property due to Balcan, Blum, and Vempala [11], -separation due to Ostrovsky et al. [35], and the separation condition from Awasthi and Sheffet [10] We will see that the exponential lower bound instances satisfy these clusterability notions when the target clustering is the optimal -means clustering. Hence, none of these notion guarantees that Ward’s method computes a good clustering.
Corollary 12**.**
For any , there is a family of point sets with that are -separated and that satisfy -center separation, -center proximity, the strict separation property and the AS-center separation property where for . Furthermore, for any and any , there exists a point set that satisfies -center separation and -center proximity and for which Ward does not compute an optimal solution.
3.1 Upper Bounds
In this section, we analyze the behavior of Ward on -center separated instances and instances that satisfy -center proximity for some number of clusters. We are only interested in the -clustering computed by Ward. Hence, in the following we assume that is fixed and that Ward stops as soon as it has obtained a -clustering. First we prove that center proximity implies weak center separation. Hence, it suffices to study instances that satisfy weak center separation. Deferred proofs can be found in the full version of this paper.
Lemma 13**.**
Let be an instance that satisfies -center proximity. Then also satisfies weak -center separation.
In the following we call a cluster that is formed by Ward an inner cluster if is completely contained within an optimum cluster. We start our analysis with the following lemma, which states one very crucial property of Ward’s behavior on well-separated data. It implies that Ward does not merge inner clusters from two different optimal clusters as long as there exists more than one inner cluster in both of these optimal clusters.
Lemma 14**.**
Let be an instance that satisfies weak -center separation for some . Assume we have two optimal clusters and and each of them contains at least two inner clusters and , respectively, directly after the -th step of Ward. Then, in step , Ward will not merge an inner cluster of with an inner cluster of .
Inner-cluster merges
In the following, assume that is an arbitrary instance and and that the clusters are an optimal -clustering of with objective value . Our goal is to show that the -clustering computed by Ward on is worse by only a factor of at most if satisfies weak -center separation for some .
Observe that Lemma 14 does not exclude the possibility that Ward performs inner-cluster merges on , i.e., it might merge two inner clusters from the same optimum cluster at some point during its execution. While we will see that in the one-dimensional case one can assume that such inner-cluster merges do not happen, we cannot make this assumption in general. In our analysis, we bound the costs of the inner-cluster merges separately from the costs of the other merges, which we call non-inner merges in the following.
We define an equivalence relation on as follows: two points and are equivalent if and only if there exists an inner cluster constructed by Ward at some point of time with . We denote the equivalence classes of by . The following observation is immediate.
Observation 15**.**
If Ward merges in any step an inner cluster with another cluster that is not an inner cluster of the same optimal cluster, then is an equivalence class.
This means that the equivalence classes represent inner clusters of Ward right before they are merged with points from outside their optimal cluster. With other words, if we perform all inner cluster merges that are performed by Ward and leave out all non-inner merges, we get the clustering represented by .
Consider an arbitrary optimal cluster and let denote the inner clusters of in . We assume that these inner clusters are indexed in the order in which they are merged with other clusters by Ward. To illustrate this definition, consider the step in which is merged by Ward with some other cluster . Since , this step is a non-inner merge and in particular is not equal to any of the clusters . At the time this merge happens, the indexing guarantees that the cluster is either present or there exist multiple parts of that are only later merged by inner-cluster merges to . Since Ward merges and , we know that for any . We will use this fact to give an upper bound for the costs of the clustering .
It might be that some inner clusters of in are not merged at all by Ward and contained in the clustering . These inner clusters are the last in the ordering, i.e., they are where is the number of such clusters.
Potential graph
In order to bound the costs of the clustering produced by Ward we introduce the potential graph with vertex set . The edges of are directed and there are only edges between inner clusters of the same optimal cluster. Consider an arbitrary optimal cluster with and let be the inner clusters of in indexed as above in the order in which they are merged with other clusters by Ward. Then for every the set contains the edge . Both the vertices and the edges are weighted and we denote the sum of all vertex and edge weights by .
The weight of a vertex is defined as , i.e., the weight of vertex equals the costs of forming the inner cluster . We will now define weights for the edges such that the sum of all vertex and edge weights in the potential graph is at most . After that we prove that there is a one-to-one correspondence between the non-inner merges of Ward and the edges in the graph such that the costs of each non-inner merge of Ward are at most the weight of the associated edge. Together this proves that Ward computes a solution with costs at most .
To define the weight of the edge , we first consider the case that is merged at some point of time with another cluster by Ward. Then let again denote the parts of that are present at that point of time. The edge weight is defined as 444When reading the proof the reader might notice that our definition of is to some extend arbitrary. Instead of defining it as , we could also define it as or as for any .. Observe that since Ward performs greedy merges, this definition guarantees that the merge of and costs at most the edge weight . If is not merged at all by Ward, we set the weight to .
Lemma 16**.**
Let be a finite point set and let denote an arbitrary partition of into pairwise disjoint parts. Then .
Lemma 17**.**
The weights in the potential graph satisfy .
Bijection between non-inner merges and edges
We have seen that the sum of the weights in the potential graph is at most . Our goal is now to find a bijection between the non-inner merges of Ward and the edges of the potential graph such that the costs of any non-inner merge are bounded from above by the weight of the edge assigned to it in the bijection. The existence of such a bijection implies that also the costs of the solution computed by Ward are at most .
Now we construct this bijection. Let us first consider non-inner merges in which at least one of the clusters is an inner cluster contained in . Let this be the inner cluster of some optimal cluster and assume further that . Then has an outgoing edge to . We denote by the cluster with which is merged and we assign the merge of with to the edge in the bijection.
Lemma 18**.**
Let be an instance that satisfies weak -center separation for some . Consider a non-inner merge of Ward between two inner clusters from . Then at most one of these inner clusters has an outgoing edge in .
Observe that it cannot happen that the same edge is assigned to two different merges by the construction described above because an edge can only be assigned to a step in which is merged with some other cluster and there can only be one such merge.
Let denote the set of edges that are not assigned to a step of Ward by the above construction. The potential graph contains vertices and edges. Since the number of non-inner merges of Ward is also , there are also non-inner merges that are not yet assigned to an edge. We finish the construction of the bijection by assigning the unassigned non-inner merges arbitrarily bijectively to .
Lemma 19**.**
The costs of each non-inner merge of Ward are bounded from above by the weight of the assigned edge in the potential graph.
Now the following theorem follows easily.
Theorem 20**.**
Let be an instance that satisfies weak -center separation or -center proximity for some . Then Ward computes a -approximation on .
Theorem 21**.**
Let be an instance with optimal -means clustering with centers . Assume that satisfies -center separation for some , where is the largest factor between the sizes of any two optimum clusters. Then Ward computes the optimal -means clustering .
In the full version of this paper we show that Theorem 20 does not hold for significantly smaller and .
4 Exponential Lower Bound in High Dimension
In the following, we describe a family of instances of increasing dimension where Ward computes for some number of clusters a -clustering that costs . Here and in all other worst-case examples, we assume that given a choice between equally expensive merges, Ward chooses the action that leads to a worse outcome. This is without loss of generality because we can always slightly move the points to ensure the outcome we want. However, it greatly simplifies the exposition.
To further simplify the exposition, the below definitions use points of infinite weight and assume that the optimal cluster centers coincide with these infinite weight points. For any finite realization of the example, that is not the case. To ensure that Ward actually behaves like described in the following, we have to move the high weight points by an infinitesimal distance. We do this in the full version of this paper, but for sake of clarity, omit it in the exposition here. Notice that merging a cluster of infinite weight with a cluster of finite weight costs by Lemma 4.
Let be given. We construct an instance with points. For let and define
[TABLE]
All points from whose first coordinate is or have weight (we call these heavy points). All other points have weight (we call these light points). For an illustration of and , see Figure 1.
We show the following theorem.
Theorem 22**.**
The family of point sets satisfies for .
In the theorem, we use , i.e., we are interested in finding a -clustering of . Observe that in the optimal -clustering of , the heavy points are in separate clusters. Due to their infinite weight, they also determine the cluster centers. Hence, in the optimal solution each light point is in the same cluster as its closest heavy point. Since each light point is within distance of a heavy point, the cost of the optimal solution is
[TABLE]
Now we look at a run of Ward’s method on . We say that phase lasts as long as there is at least one light point that forms its own cluster. We prove by induction that during phase the only clusters that occur are singleton clusters consisting of one light or one heavy point and clusters that consist of two light points that differ only in the first coordinate. We call the latter pair clusters. At the beginning this is clearly the case. Now assume that the induction hypothesis holds at some point of time in phase . Merging two heavy points has infinite cost and merging a heavy point with a light point or a pair cluster has cost at least because is the minimum distance between a light and a heavy point. Merging two singleton light points that differ only in the first coordinate costs (observe that the induction hypothesis guarantees that for any singleton light point the light point that differs only in the first coordinate is also a singleton point). Merging two singleton light points that differ in any other coordinate costs at least , merging a singleton light point with a pair cluster costs at least , and merging two pair clusters costs at least . Hence, we can assume that Ward merges two singleton light points that differ only in the first coordinate. After that the induction hypothesis is still true. Hence, in phase all pairs of points of the form and will be merged. We call the clusters that consist of these points the -clusters in the following.
Then phase starts. Phase lasts as long as there are pair clusters. We show by induction that the only clusters that occur in phase are singleton heavy points, pair clusters, and clusters with four points that result from merging two pair clusters that differ only in the second coordinate. We call the latter quadruple clusters. Merging two pair clusters of the form and to form a quadruple cluster costs . Merging two pair clusters that differ in any other coordinate than the second is more expensive because their centers are further apart than . Merging the -cluster with a heavy point costs at least because the center of this cluster is , which is at distance from the heavy points. Similarly merging a quadruple cluster (whose center is ) with a heavy point costs at least . Merging a quadruple cluster with a pair cluster costs at least and merging two quadruple clusters costs at least . Hence, we can assume that Ward merges two pair clusters that differ only in the second coordinate. After that the induction hypothesis is still true. Hence, in phase all pairs of clusters of the form and will be merged. We call the clusters that consist of these points the -clusters in the following.
At the beginning of phase , there are singleton heavy points and clusters of the form with points each. Phase ends when there is no cluster of the form left. One can show again by induction that Ward merges in phase all pairs of clusters of the form and . The center of the cluster is , which is at distance from the heavy points. Hence, merging such a cluster with a heavy point costs at least , where the equation follows from the following observation.
Observation 23**.**
It holds that .
Merging the clusters and costs
[TABLE]
Merging two clusters that differ in one of the last coordinates costs at least . Hence, in phase i all pairs of clusters of the form and will merge, which costs in total .
Phases until together cost , where we used Observation 23. After phase , all light points will be in the same cluster. Then the number of clusters is and in the last step the cluster of light points, whose center is the origin, will be merged with one heavy point. This costs
[TABLE]
Phase costs in total . Thus, the overall cost of Ward’s solution is
[TABLE]
This implies
[TABLE]
5 Ward’s Method in Dimension One
In this section, we discuss the approximation ratio of Ward’s method for inputs and show the following theorem.
Theorem 24**.**
Let be an arbitrary instance that is one-dimensional. Then, for every , the -clustering computed by Ward on is an -approximation with respect to the -means objective function.
For the purpose of analyzing the worst-case behavior of Ward’s method, an instance sometimes also contains an integer in addition to (even though Ward itself only takes as the input). If we specify and , then we are interested in the quality of the -clustering produced by Ward on .
We will usually denote the hierarchical clustering computed by Ward on by . Ward’s method always chooses greedily a cheapest merge to perform. We say that a merge is a greedy merge if it is a cheapest merge; if all merges are greedy, we call greedy. Ward’s method computes a greedy hierarchical clustering, and every greedy hierarchical clustering can be the output of Ward’s method.
5.1 Prelude: Reordering
Recall the following statement from §2.2:
See 7 Lemma 7 means that Ward will always merge and or and , and never and . This gives us a convexity property: If Ward forms a cluster , then no other point or cluster lies within the convex hull of . Clusters can thus also never overlap, and we get a concept of neighbors on the line. Thus, the clusterings consist of non-overlapping clusters, which we can thus view as ordered by their position on the line. Ward’s method always merges neighbors on the line. We will combine it with the following useful corollary of Lemma 4. It gives a condition under which merging a cluster with a subcluster is cheaper than merging with . Notice that without the condition, the statement is not true: Imagine that and have the same centroid (merging them is free), but . Then clearly, merging with is more expensive than merging and .
Corollary 25**.**
Assume we have two finite clusters and a third finite cluster such that . Then .
Corollary 25 holds in arbitrary dimension. However, for , it is much easier to benefit from it. We get a very convenient tool that we call reordering. Say that Ward at some point merges two clusters and . By Lemma 7, that means that and are neighbors on the line (at the time of the merge). Now assume that and are present for a while before they are merged. Then during all this time, they are neighbors. Notice that this means that merging and will result in a centroid which is further away from any other cluster than and are. So, clusters that did not want to merge with or would also not merge with by Corollary 25. Thus, we could perform the merge earlier without distorting Ward’s course of action at all (except that the merge is at the wrong position). Lemma 26 below formulates this idea.
Recall that a hierarchical clustering can also be described by the merge operations that produce it. We usually denote the sequence of merges by . We say that a cluster exists in after merge if . If is the result of the merge (i.e., , and it is later merged with another cluster in merge (i.e., or ), then exists as long as merge has happened and merge has not yet happened. All singleton clusters exist in . After merge , is the only remaining existing cluster.
Lemma 26** (Reordering Lemma).**
Let be an input for which Ward computes the clustering with merge operations . Consider the merge for . If both and exist after merge , then
The sequence of merge operations
[TABLE]
results in a valid hierarchical clustering . 2. 2.
* for all .* 3. 3.
All merges except the moved merge are greedy merges.
Proof.
(1) and (2) hold because performing merges in a different order does not change the resulting clustering, and after merge , all deviations from the original order are done. For (3), we have to argue that inserting as step does not create cheaper merges. For this, we observe that by Lemma 7, and are neighbors on the line. In the original sequence, no cluster was merged with or up to point . The cluster is a superset of and of , and its centroid is further away from all other clusters than the centroids of and . Thus by Corollary 25, up to point , merging with cannot be cheaper than the merges we do. However, after , the clustering is identical to by (1), thus all remaining merges are also greedy merges. ∎
Lemma 26 a crucial observation to allow us to systematically analyze Ward’s steps: We can sort them into steps that depend on each other, and then analyze them in batches / phases.
In for , reordering does not work. Also, we cannot assume that there are no inner-cluster merges.
5.2 Prelude: No Inner-cluster Merges
Reordering also gives us a nice simplification tool. Assume that and are in fact singleton clusters, and , and they are from the same optimum cluster. Then they are present from the start; we can reorder the merge to be the first merge Ward does. Indeed, instead of actually doing this merge, we can also simply forget about it and replace and by a weighted point. How does this affect the approximation ratio? Both Ward’s cost and the optimal cost decrease by , meaning that the approximation ratio can only get worse. We can now assume that there are no merges between inner clusters, since inner clusters arise from merging input points that belong to the same optimum cluster. We formalize our observation in Lemma 27.
We directly apply Lemma 26 in order to achieve a simplification method. Recall that (given an optimal -clustering) we call a merge an inner-cluster merge if and are inner clusters from the same optimum cluster. For a worst-case instance we can always assume that such inner-cluster merges do not happen, as they are only helpful for Ward’s method. We formally see this in the next lemma, where we relocate inner-cluster merges to the front of the hierarchical clustering and then eliminate them.
Recall that is the cost of the -clustering contained in . For an instance and Ward’s resulting clustering , the approximation ratio of Ward’s method is .
Lemma 27**.**
Let be an instance with and , for which is an optimal -clustering and for which Ward computes the hierarchical clustering with merge operations . Then there exists a weighted point set and a hierarchical clustering for with merges with the following properties:
* is greedy.* 2. 2.
No is an inner-cluster merge with respect to . 3. 3.
For some , and .
Proof.
Assume that is weighted; this will be necessary to iterate the following process. Let be a merge operation in that merges two points for , i.e., two points from the same cluster in the optimal solution. Let their weights be and . By Lemma 26, we can move the merge to the front. Then we replace and in by one point with weight . By Lemma 4, behaves identically to in Ward’s method. Thus, we can adjust by removing the merge operation , and replacing and by in all further merge operations of the cluster . We see that (1) holds for the new hierarchical clustering. Our adjustment will change the cost by . Similarly, we can replace and in by , which decreases the cost of the clustering induced by by . Since this is still a possible clustering, the optimal clustering can cost at most . Thus, (3) holds for the new clustering.
Observe that if (2) is not true, then there has to be a merge operation where two points from the same cluster in the optimum are merged. Thus, we can complete the proof by repeating the above process until we have removed all pairs with this property. Then (2) holds. ∎
Now if Ward performs inner-cluster merges on an instance, we apply Lemma 27. If this changes the optimum solution, we just apply Lemma 27 again, and repeat this until Ward does not do any inner-cluster merges. We explicitly note the following trivial corollary.
Corollary 28**.**
Assume that and result from applying Lemma 27 until Ward does not do inner cluster merges. If a merge for contains an inner cluster, then this inner cluster is a (weighted) input point.
Proof.
If resulted from a previous merge, then this merge was an inner-cluster merge, which is a contradiction. ∎
Corollary 28 implies that we can use the terms inner cluster and input point interchangeably.
5.3 Prelude: Clustering points together
Crucial in showing the approximation factors of the good merges is the following lemma. To see its usage, assume that and belong to one optimum cluster, and and belong to another. Then the lemma implies that if Ward has already merged and , but is small, say , then we can still obtain a -approximation. Its proof is deferred to the full version of this paper.
Lemma 29**.**
Let be disjoint sets with and . Then
[TABLE]
and
[TABLE]
5.4 The analysis
We now analyze the worst-case behavior of Ward’s method on the line by fixing an arbitrary worst-case example that does not contain inner-cluster merges (we can assume this by Lemma 27).
The general plan is the following. Whenever Ward merges two clusters, it does so greedily, meaning that the cost of the merge is always bounded by the cost of any other merge. Thus, if we can find a merge with low cost, then the merge actually performed can only be cheaper. We can clearly find cheap merges in the beginning, however, Ward’s decisions may lead us to a situation where we run out of the originally good options. The idea of the proof is to find a point during Ward’s execution where:
- •
We still know a bound on the costs produced so far.
- •
We know a set of good merges that can still be performed and lead to a good -clustering.
- •
We can ensure that no merge can possibly destroy two merges from .
At such a point in time, we can use to charge the remaining merges that Ward does to compute a -clustering. We find this point in time by sorting specific merges of Ward into the front, and bounding their cost. There will be five phases of merges which we need to pull forward and charge.
The phases
We will use the reordering lemma (Lemma 26) to sort the merges into phases and then analyze the cost of the solution after each phase.
In the following, we call a cluster that contains points from more than one optimum cluster composed, more precisely, we call it an -composed cluster if it contains points from different optimum clusters. Most of the time, we are interested in -composed clusters, and we name such a cluster -composed cluster from and if these are the involved optimum clusters.
The goal of the reordering is simple in nature; we want to collect all merges that create -composed clusters and that grow -composed clusters. We can think of the phases as different stages of development of -composed clusters. A -composed cluster may become part of the -clustering computed by Ward’s method, or it may at some point become -composed for , at which time we are no longer interested in it. By the final stage of a -composed cluster we either mean how it looks in the -clustering, or how it looked in the last step before it became more than -composed.
Consider the example in Figure 2, where we depict the development of a -composed cluster from and which in its final stage consists of the input points . It undergoes five principal phases: It is created by merging a point from with a point from (phase ). Then it grows; it is merged with points left and right of itself (phase ). We add extra phases for the last points on both sides. In phase , the first side is completed; in the example, it is the left side. This merge is again followed by a growth phase (phase ). The final phase consists of the final merge on the other side; the right side in the example. (We skip some merges in , the details of are not discussed until much later in this proof).
So, we use reordering to pull the following phases of merges to the front.
- P1
(Creation phase)
We create -composed clusters by collecting the merges with , for some . The collected merges constitute phase . For technical reasons, we make one exception. If the -composed cluster only consists of two input points in its final stage (i.e., the creating merge is also the last merge), then we defer the merge to phase . 2. P2
(Main growth phase)
We now grow the -composed clusters initialized during phase . For each -composed cluster, we move the growth merges to phase , preserving their original order. We stop right before one side of the -composed cluster is done. There may be many growth merges for a cluster, or none. 3. P3
(First side elimination phase)
This phase consists of at most one merge for each -composed cluster, and this merge is the last merge on the first side. After phase , every -composed cluster thus has one side where it will not be merged with further input points. Notice that a cluster may skip phase if it only shares one point with or in its final stage, anyway. 4. P4
(Second growth phase)
This phase resembles phase , however, the growth is now one-sided. For each -composed cluster, we move the growth merges to phase , preserving their original order, and stopping right before the final merge. 5. P5
(Second side elimination phase)
The last phase consists of at most one merge for each cluster. If the final stage of a -composed cluster contains only two points, then the merging of these two points is done in phase . Otherwise, phase may contain the last merge for the cluster, resulting in its final state. For technical reasons, we have to exclude some merges; we postpone the details to Definition 32.
We now analyze the sum of the -means costs of all clusters in the clustering after each phase. The proofs of the lemmata are deferred to the full version of the paper. We start with phases and .
Lemma 30**.**
Let with and be a -composed cluster after phases and . Then
[TABLE]
Furthermore, .
In phase , Ward’s method faces the first situation where it may run out of good merge options and has to resort to more expensive merges. Notice that by the definition of our phases, each cluster has one side where after phase , there is exactly one point left which has not been added to the cluster. The key technical observation that we use again and again during the (omitted) proofs is the following corollary.
See 5
We need the following interpretation of Corollary 5. If we have a 2-composed cluster which consists of a lighter cluster for an optimum cluster and a heavier cluster for another optimum cluster , then merging with another cluster basically costs as much as and cost individually, plus what merging and costed us already (up to constant factors). Corollary 5 allows us to analyze the -means costs of the clusters after phase .
Lemma 31**.**
Let be the final state of a -composed cluster, with and . The state of the cluster after phase is either or . In both cases,
[TABLE]
Now we come to phase , which we haven’t completely defined yet. The problem with phase is that we can no longer charge all clusters ‘internally’. To see this, first notice that we say that a -composed cluster from and points to cluster if
- •
holds and is the cluster left of , or
- •
holds and is the cluster right of .
We define a lopsided cluster to be a -composed cluster for which the last merge is , but at the time of this merge, does not point to . This means that we cannot use Corollary 5 (directly) to charge this merge. As a technicality, we also call a -composed cluster lopsided if it only contains two points in its final state; again, we cannot use Corollary 5 in this case.
We have to pay attention to one more detail when defining phase . When charging -composed clusters internally, we could always be sure that the clusters that are involved are part of one of the two optimum clusters that the -composed cluster intersects. That is because the -composed cluster by definition only contains points from two optimum clusters, and we only dealt with points and subclusters of such a -composed cluster. However, in the following arguments, we will have to argue about clusters neighboring a -composed cluster. These may or may not belong to one of the optimum clusters. Let and be two clusters that are neighbors on the line such that lies left of . We say that there is an opt change between and if the last point in and the first point in belong to different optimum clusters.
Now we define phase . Let be the cluster that lies on the other side of than at the time of the merge . Let be the cluster that lies ‘behind’ from the point of view of at the time of the merge . By behind from ’s point of view we mean that if lies left of , then lies left of , and if lies right of , then lies right of .
Definition 32** (Phase P5).**
Phase contains the final merge of a cluster if any of the following conditions applies.
* is not lopsided (phase ),* 2. 2.
* is lopsided, there is no opt change between and , and is an inner cluster (phase ),* 3. 3.
* is lopsided, there is no opt change between and , and is an inner cluster (phase ),* 4. 4.
* is lopsided, there is no opt change between and , is -composed, and points to {x} (phase ).*
The next lemma deals with merges in .
Lemma 33**.**
Let be the final state of a -composed cluster, with and . Assume that is not lopsided. Then
[TABLE]
Now we consider the merges in phase .
Lemma 34**.**
Let be the final state of a -composed cluster, with and . Assume that is lopsided. Assume that at the time of the merge , the cluster on the other side of is an inner cluster , and there is no opt change between and . Then if , we have
[TABLE]
and if , then
[TABLE]
The following lemma is the main lemma about the phases and summarizes our findings: After phase , the error is still bounded by a constant times the optimum value.
Lemma 35**.**
Let be the clustering after phase . Then
[TABLE]
Good merges for the final analysis
In general, the clustering of Ward after phase has still more than clusters. It remains to analyze the merges after phase that reduce the number of clusters to . For the final charging argument, we need four types of good merges. Good merges are not necessarily merges that Ward’s method does, instead, it’s a collection of merges that are possible and can be used for charging. Indeed, good merges include merges that would not be present anymore if Ward did them, since then we would move them to the phases. But if Ward never uses them, they may still be present for us to charge against.
The whole point of the phases is to ensure that any merge that Ward may still do does not destroy two good merges. The final arguments of the proof will be to count good merges and to show that no two good merges can be invalidated simultaneously by one of Ward’s merges.
Recall that is the current Ward solution, and is a fixed optimal solution, numbered from left to right. The following merges are good merges in the sense that we can bound the increase in cost. Of course, the result of the merge only forms a cluster of low cost if the participating clusters had low cost beforehand.
- T1:
Two inner clusters of the same optimal cluster , i.e., . This type of merge is never actually applied by Ward on simplified examples, but we need it for charging.
- T2:
A -composed cluster for some and an inner cluster , with the condition that is an inner cluster of as well. Also: The symmetric situation of a -composed cluster for some and an inner cluster with the condition that .
- T3:
A -composed cluster for some and an inner cluster , with the condition that points to . Also: The symmetric situation of a -composed cluster for some and an inner cluster with the condition that points to .
- T4:
Two -composed clusters and that point at each other.
We already know T1 merges (inner-cluster merges), T2 merges (growth phase and phase ) and T3 merges (merges chargeable with Corollary 5). We know that applying them increases the cost by at most a constant factor. We also know that these merges cannot happen anymore: T1 merges are inner-cluster merges, which Ward does not do on our example. T2 merges happen either in the growth phase, or in phase . T3 merges merge non-lopsided clusters, which happens in phase .
T4 is a type of merge that we did not yet consider, and which Ward can still do. Indeed, to charge it, we need the general charging statement in the below Lemma 29 from which Corollary 5 follows.
See 29
Let and constitute a T4 merge as described above. Then Lemma 29 with , , and implies that
[TABLE]
Thus, if was bounded by a constant factor times the optimal cost of the points in , then this is still true after the merge of and (with a higher factor).
Counting inner clusters
Observe that the only merges that delete more than one inner cluster are the merges in phase . All other merges remove either exactly one inner cluster, or none at all. In phase -, every merge eliminates exactly one inner cluster. In the beginning, there are inner clusters. So if phase has merges and until together have merges, then we have inner clusters after phase , and we have -composed clusters. The total number of all clusters is .
Consider the Ward clustering after phase . We split the clustering into blocks, based on the inner clusters. More precisely, we get blocks that start with an inner cluster, possibly has some -composed clusters and ends with another inner cluster. The blocks overlap in the inner clusters.
We argue that there is at least one good merge in every block except for blocks. The exceptions are the blocks where the optimum cluster changes between start and end, but the change happens between the clusters (not in a -composed cluster). This can only happen times because of the cluster borders are within -composed clusters. For the remaining blocks, we argue the following. If there are no -composed clusters in the block, then the two inner clusters are neighbored and form a T1 merge. If there is only one -composed cluster in the block, then it has to point at an inner cluster and thus there is a T2 or a T3 merge. If there are multiple -composed clusters, we argue as follows. The first -composed cluster either points left and thus there is a T2 or a T3 merge, or it points to the right. Any further -composed cluster either points to the one before it, forming a T4 merge, or it points to the right. This goes on until we either find a merge, or we find the last -composed cluster, which then has to point at the second inner cluster, forming a T2 or T2 merge.
We collect one good merge from every block and call the resulting set of merges . Observe that the cost of all merges in together is a constant factor of the cost that we have so far, so all merges together cost .
This argument alone is not enough. The main feature of is that every merge that Ward actually performs can make at most one merge from our set invalid. This means that we can charge merges to .
Notice that our merges are disjoint except for possible overlap at inner clusters. Assume that a merge of Ward invalidates two merges from our set. There are two ways how this can happen. Case one is that Ward’s merge is one of the two good merges that are invalidated. Say this merge is called . Then the second merges involves either or , say it involves . Thus, there is another cluster next to , and the merge invalidates itself and . This in particular means that is a good merge. Since Ward does not do inner-cluster merges, either or has to be -composed, since is a merge of Ward. If they are both -composed clusters, then and are in the same block, thus and cannot both be in . Thus, one is -composed and the other is an inner cluster, i.e., they form a T2 or T3 merge, since is supposed to be a good merge. If it is a T3 merge, then is not lopsided, and would have happened in phase . If it is a T2 merge, then it is either not lopsided (phase ), or it is lopsided, but has an inner cluster behind its inner cluster (phase . We conclude that a good merge cannot invalidate another good merge.
Case two is that the two good merges are disjoint, and Ward does a merge that overlaps with both of them. Thus, we have two good merges and , and Ward performs merge . Since Ward does not do inner-cluster merges, either or is -composed, w.l.o.g. say that is -composed. If is -composed as well, then and are in the same block, so they would not both be in . So is an inner cluster. If points to , then is not lopsided and would have happened in phase . Thus, points to . If is an inner cluster, then is a T2 merge and would have happened in phase . So say that is -composed. is a good merge. It is not a T2 merge since is -composed. It has to be a T3 merge, thus, points to . Thus, would have happened in phase : It is a lopsided merge with left of , and the -composed cluster left of points to .
We have seen that no merge of Ward can invalidate two merges from . Thus, we can now charge in the following way. The cost of the performed merge is bounded by the cost of any available merge. For each Ward step, we look whether it invalidates a merge from . If so, then we charge the performed merge to this good merge. If Ward’s merge does not invalidate any merge from , we just arbitrarily charge a merge in and mark it as invalid. In this manner, we can pay for merges, i.e., we can pay until the number of clusters is reduced to . That completes the proof of Theorem 24.
6 Conclusions
We have initiated the theoretical study of the approximation guarantee of Ward’s method. In particular, we have shown that Ward computes a 2-approximation on well-separated instances, which can be seen as the first theoretical explanation for its popularity in applications. We have also seen that its worst-case approximation guarantee increases exponentially with the dimension of the input and that it computes an -approximation on one-dimensional instances.
These results leave room for further research. It would be particularly interesting to better understand the worst-case behavior of Ward’s method. It is not clear, for example, if it computes a constant-factor approximation if the dimension is constant. Our analysis of the one-dimensional case is very complex and the factor hidden in the -notation is large. It would be interesting to simplify our analysis and to improve the approximation factor.
The reference list from the paper itself. Each links out to its DOI / PubMed record.
- 1[1] Marcel R. Ackermann, Johannes Blömer, Daniel Kuntze, and Christian Sohler. Analysis of agglomerative clustering. Algorithmica , 69(1):184–215, 2014.
- 2[2] Sara Ahmadian, Ashkan Norouzi-Fard, Ola Svensson, and Justin Ward. Better guarantees for k-means and euclidean k-median by primal-dual algorithms. In Proceedings of the 58th IEEE Annual Symposium on Foundations of Computer Science (FOCS) , pages 61–72, 2017.
- 3[3] Daniel Aloise, Amit Deshpande, Pierre Hansen, and Preyas Popat. NP-hardness of Euclidean sum-of-squares clustering. Machine Learning , 75(2):245–248, 2009.
- 4[4] David Arthur, Bodo Manthey, and Heiko Röglin. k 𝑘 k -means has polynomial smoothed complexity. In Proceedings of the 50th Annual IEEE Symposium on Foundations of Computer Science (FOCS) , pages 405–414, 2009.
- 5[5] David Arthur and Sergei Vassilvitskii. How slow is the k 𝑘 k -means method? In Proceedings of the 22nd International Symposium on Computational Geometry (So CG) , pages 144–153, 2006.
- 6[6] David Arthur and Sergei Vassilvitskii. k-means++: the advantages of careful seeding. In Proceedings of the 18th ACM-SIAM Symposium on Discrete Algorithms (SODA) , pages 1027–1035, 2007.
- 7[7] David Arthur and Sergei Vassilvitskii. Worst-case and smoothed analysis of the ICP algorithm, with an application to the k 𝑘 k -means method. SIAM Journal on Computing , 39(2):766–782, 2009.
- 8[8] Pranjal Awasthi, Avrim Blum, and Or Sheffet. Center-based clustering under perturbation stability. Information Processing Letters , 112(1-2):49–54, 2012.
