On Clusterings: Good, Bad and Spectral

Transcription

1 On Clusterings: Good, Bad and Spectral RAVI KANNAN Yale University, New Haven, Connecticut AND SANTOSH VEMPALA AND ADRIAN VETTA M.I.T., Cambridge, Massachusetts Abstract. We motivate and develop a natural bicriteria measure for assessing the quality of a clustering that avoids the drawbacks of existing measures. A simple recursive heuristic is shown to have polylogarithmic worst-case guarantees under the new measure. The main result of the article is the analysis of a popular spectral algorithm. One variant of spectral clustering turns out to have effective worst-case guarantees; another finds a good clustering, if one exists. Categories and Subject Descriptors: F [Theory of Computation]: Analysis of Algorithms and Problem Complexity; H3 [Information Systems]: Information Storage and Retrieval General Terms: Algorithms, Theory Additional Key Words and Phrases: Clustering, graph algorithms, spectral methods 1. Introduction Clustering, or partitioning into dissimilar groups of similar items, is a problem with many variants in mathematics and the applied sciences. The availability of vast amounts of data has revitalized research on the problem. Over the years, several clever heuristics have been invented for clustering. While many of these heuristics are problem-specific, the method known as spectral clustering has been applied successfully in a variety of different situations. Roughly speaking, spectral clustering is the technique of partitioning the rows of a matrix according to their components in the top few singular vectors of the matrix (see Section 1.1 for a detailed R. Kannan was supported in part by NSF grant CCR S.Vempala was supported by NSF CAREER award CCR and a Sloan Foundation Fellowship. A.Vetta was supported in part by NSF CAREER award CCR and a Wolfe Foundation Fellowship. Author s addresses: R. Kannan, Computer Science Department, Yale University, New Haven, CT 06511, S. Vempala and A. Vetta, Mathematics Department, M.I.T., Cambridge, MA 0139, {vempala; Permission to make digital or hard copies of part or all of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or direct commercial advantage and that copies show this notice on the first page or initial screen of a display along with the full citation. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, to republish, to post on servers, to redistribute to lists, or to use any component of this work in other works requires prior specific permission and/or a fee. Permissions may be requested from Publications Dept., ACM, Inc., 1515 Broadway, New York, NY USA, fax: +1 (1) , or C 004 ACM /04/ $5.00 Journal of the ACM, Vol. 51, No. 3, May 004, pp

2 498 R. KANNAN ET AL. description). The main motivation of this article was to analyze the performance of spectral clustering. Such an evaluation, however, is inextricably linked to the question of how to measure the quality of a clustering. The justification provided by practitioners is typically case-by-case and experimental ( it works well on my data ). Theoreticians, meanwhile, have been busy studying quality measures that are seductively simple to define (e.g., k-median, minimum sum, minimum diameter, etc.). The measures thus far analyzed by theoreticians are easy to fool, that is, there are simple examples where the right clustering is obvious but optimizing these measures produces undesirable solutions (see Section ). Thus, neither approach has been entirely satisfactory. In this article we propose a new bicriteria measure of the quality of a clustering, based on expansion-like properties of the underlying pairwise similarity graph. The quality of a clustering is given by two parameters: α, the minimum conductance 1 of the clusters and, the ratio of the weight of inter-cluster edges to the total weight of all edges. The objective is to find an (α, )-clustering that maximizes α and minimizes. Note that the conductance provides a measure of the quality of an individual cluster (and thus of the overall clustering) whilst the weight of the inter-cluster edges provides a measure of the cost of the clustering. Hence, imposing a lower bound, α, on the quality of each individual cluster we strive to minimize the cost,, of the clustering; or conversely, imposing an upper bound on the cost of the clustering we strive to maximize its quality. In Section, we motivate the use of this more complex, bicriteria measure by showing that it does not have the obvious drawbacks of the simpler quality measures. While the new measure might be qualitatively attractive, it would be of little use if optimizing it were computationally intractable. In Section 3, we study a recursive heuristic designed to optimize the new measure. Although finding an exact solution is NP-hard, the algorithm is shown to have simultaneous polylogarithmic approximations guarantees for the two parameters in the bicriteria measure (Corollary 3.). In Section 4, we turn to spectral algorithms for clustering. These algorithms are popular in part because of their speed (see Section 5) and applicability in a variety of contexts [Alpert et al. 1999; Dhillon 001; Shi and Malik 000; Weiss 1999; Eigencluster]. However, while performing quite well in practice, they had hitherto eluded a rigorous worst-case analysis. This could be attributed to the fact that existing measures of quality have serious drawbacks, and did not capture the quality of the algorithm; even an exact algorithm for optimizing these measures might do poorly in many practical settings. We show that a simple recursive variant of spectral clustering has effective worst-case approximation guarantees with respect to the bicriteria measure (Corollary 4.). It is worth noting that both our worst-case guarantees follow from the same general theorem (see Theorem 3.1 in Section 3). Another variant of spectral clustering has the following guarantee: if the input data has a rather good clustering (i.e., α is large and is small), then the spectral algorithm will find a clustering that is close to the optimal clustering (Theorem 4.3) SPECTRAL CLUSTERING ALGORITHMS. Spectral clustering refers to the general technique of partitioning the rows of a matrix according to their components 1 Conductance will be defined precisely in Section ; it measures how well-knit a graph is.

3 On Clusterings: Good, Bad, and Spectral 499 in the top few singular vectors of the matrix. The underlying problem, that of clustering the rows of a matrix, is ubiquitous. We mention three special cases that are all of independent interest: The matrix encodes the pairwise similarities of vertices of a graph. The rows of the matrix are points in a d-dimensional Euclidean space. The columns are the coordinates. The rows of the matrix are documents of a corpus. The columns are terms. The (i, j) entry encodes information about the occurrence of the jth term in the ith document. Given a matrix A, the spectral algorithm for clustering the rows of A is given below. Spectral Algorithm I Find the top k right singular vectors v 1, v,...,v k. Let C be the matrix whose jth column is given by Av j. Place row i in cluster j if C ij is the largest entry in the ith row of C. The algorithm has the following interpretation. Suppose the rows of A are points in a high-dimensional space. Then the subspace defined by the top k right singular vectors of A is the rank-k subspace that best approximates A. The spectral algorithm projects all the points onto this subspace. Each singular vector then defines a cluster; to obtain a clustering we map each projected point to the (cluster defined by the) singular vector that is closest to it in angle. In Section 4, we study a recursive variant of this algorithm.. What is a Good Clustering? How good is the spectral algorithm? Intuitively, a clustering algorithm performs well if points that are similar are assigned the same cluster and points that are dissimilar are assigned to different clusters. Of course, this may not be possible to do for every pair of points, and so we compare the clustering found by the algorithm to the optimal one for the given matrix. This, though, leads to another question: what exactly is an optimal clustering? To provide a quantitative answer, we first need to define a measure of the quality of a clustering. In recent years, several combinatorial measures of clustering quality have been investigated in detail. These include minimum diameter, k-center, k-median, and minimum sum (e.g., Charikar et al. [1997, 1999], Dyer and Frieze [1985], Indyk [1999], and Jain and Vazirani [001], and others.) All these measures, although mathematically attractive due to their simplicity, are easy to fool. That is, one can construct examples with the property that the best clustering is obvious and yet an algorithm that optimizes one of these measures finds a clustering that is substantially different (and therefore unsatisfactory). Such examples are presented in Figures 1 and, where the goal is to partition the points Computationally, it is useful to note that the jth column of C is also given by λ j u j ; here λ j is the jth singular value of A and u j is the jth left singular vector.

4 500 R. KANNAN ET AL. FIG. 1. Optimizing the diameter produces B while A is clearly more desirable. FIG.. The inferior clustering B is found by optimizing the -median measure. into two clusters. Observe that all the measures given above seek to minimize some objective function. In the figures, nearby points (which represent highly similar points) induce low cost edges; points that are farther apart (and represent dissimilar points) induce high cost edges. Consider a clustering that minimizes the maximum diameter of the clusters; the diameter of a cluster being the largest distance, say, between two points in a cluster. It is NP-hard to find such a clustering, but this is not our main concern. What is worrisome about the example shown in Figure 1 is that the optimal solution (B) produces a cluster which contains points that should have been separated. Clustering with respect to the minimum sum and k-center measures will produce the same result. The reason such a poor cluster is produced is that although we have minimized the maximum dissimilarity between points in a cluster, this was at the expense of creating a cluster with many dissimilar points. The clustering (A) on the other hand, although it leads to a larger maximum diameter, say, is desirable since it better satisfies the goal of similar points together and dissimilar points apart. This problem also arises for the k-median measure (see, e.g., the case shown in Figure ); it may produce clusters of poor quality. We will find it more convenient to model the input as a similarity graph rather than as a distance graph. This is indeed often the case in practice. Thus the input is an edge-weighted complete graph whose vertices need to be partitioned. The weight of an edge a ij represents the similarity of the vertices (points) i and j. Thus, the graph for points in space would have high edge weights for points that are

5 On Clusterings: Good, Bad, and Spectral 501 FIG. 3. cut. The second subgraph is of higher quality as a cluster even though it has a smaller minimum close together and low edge weights for points that are far apart. So the graph is associated with an n n symmetric matrix A with entries a ij ; here we assume that the a ij are nonnegative. Let us now return to the question of what a good clustering is. The quality of a cluster should be determined by how similar the points within a cluster are. Note that each cluster is represented by a subgraph. In particular, if there is a cut of small weight that divides the cluster into two pieces of comparable size then the cluster has lots of pairs of vertices that are dissimilar and hence it is of low quality. This might suggest that the quality of a subgraph as a cluster is the minimum cut of the subgraph. However, this is misleading as is illustrated by Figure 3. In this example edges represent high-similarity pairs and non-edges represent pairs that are highly dissimilar. The minimum cut of the first subgraph is larger than that of the second subgraph. This is because the second subgraph has low degree vertices. However, the second subgraph is a higher quality cluster. This can be attributed to the fact that in the first subgraph there is a cut whose weight is small relative to the sizes of the pieces it creates. A quantity that measures the relative cut size is the expansion. The expansion of a graph is the minimum ratio over all cuts of the graph of the total weight of edges of the cut to the number of vertices in the smaller part created by the cut. Formally, we denote the expansion of a cut (S, S) by: i S, j S ψ(s) = a ij min( S, S ) We say that the expansion of a graph is the minimum expansion over all the cuts of the graph. Our first measure of quality of a cluster is the expansion of the subgraph corresponding to it. The expansion of a clustering is the minimum expansion of one of the clusters. The measure defined above gives equal importance to all the vertices of the given graph. This, though, may lead to a rather taxing requirement. For example, in order to accommodate a vertex i with very little similarity to all the other vertices combined (i.e., j a ij is small), then α will have to be very low. Arguably, it is more prudent to give greater importance to vertices that have many similar neighbors and lesser importance to vertices that have few similar neighbors. This can be done by a direct generalization of the expansion, called the conductance, in which subsets of vertices are weighted to reflect their importance. The conductance of a cut (S, S) ingis denoted by: i S, j S φ(s) = a ij min(a(s), a( S)).

6 50 R. KANNAN ET AL. FIG. 4. Assigning the outliers leads to poor quality clusters. Here a(s) = a(s, V ) = i S j V a ij. The conductance of a graph is the minimum conductance over all the cuts of the graph; φ(g) = min S V φ(s). In order to quantify the quality of a clustering, we generalize the definition of conductance further. Take a cluster C V and a cut (S, C\S) within C, where S C. Then we say that the conductance of S in C is: i S, j C\S φ(s, C) = a ij min(a(s), a(c \ S)). The conductance φ(c) of a cluster C will then be the smallest conductance of a cut within the cluster. The conductance of a clustering is the minimum conductance of its clusters. This conductance measure seems extremely well suited to achieve our intuitive goal, that is, clustering similar points and separating dissimilar points. We then obtain the following optimization problem: given a graph and an integer k, find a k-clustering with the maximum conductance. Notice that optimizing the expansion/conductance gives the right clustering in the examples of Figures 1 and. To see this assume, for example, that the points induce an unweighted graph (i.e. zero-one edge weights). Thus, a pair of vertices induces an edge if and only if the two vertices are close together. Clustering (A) will then be obtained in each example. There is still a problem with the above clustering measure. The graph might consist mostly of clusters of high quality and maybe a few points that create clusters of very poor quality, so that any clustering necessarily has a poor overall quality (since we have defined the quality of a clustering to be the minimum over all the clusters). In fact, to boost the overall quality, the best clustering might create many clusters of relatively low quality so that the minimum is as large as possible. Such an example is shown in Figure 4. One way to handle the problem might be to avoid restricting the number of clusters. But this could lead to a situation where many points are in singleton (or extremely small) clusters. Instead, we measure the quality of a clustering using two criteria, the first is the minimum quality of the clusters (called α), and the second is the fraction of the total weight of edges that are not covered by the clusters (called ). Definition.1. We call a partition {C 1, C,...,C l } of V an (α, )-clustering if : (1) The conductance of each C i is at least α. () The total weight of intercluster edges is at most an fraction of the total edge weight.

7 On Clusterings: Good, Bad, and Spectral 503 Thus, we obtain a bicriteria measure of the quality of a clustering. Associated with this bicriteria measure is the following optimization problem (note that the number of clusters is not restricted). Problem 1. Given α, find an (α, )-clustering that minimizes (alternatively, given, find an (α, )-clustering that maximizes α). It is not hard to see that optimizing this measure of cluster quality, does well on the earlier bad examples. While it is impossible for any measure to be universally the right measure, an important question is to find the class of applications for which the proposed measure is suitable. Empirical results suggest that the bicriteria measure seems natural for a variety of applications. The focus of the rest of this paper, however, is to consider the measure from a theoretical standpoint and to examine in detail the performance of spectral clustering algorithms. It may be noted that there is a monotonic function f that represents the optimal (α, ) pairings. For example, for each α there is a minimum value of, equal to f (α), such that an (α, )-clustering exists. In the following sections, we present two approximation algorithms for the clustering property. One nice characteristic of these algorithms is that in a single application they can be used to obtain an approximation f for the entire function f, not just for f evaluated at a single point. Thus the user need not specify a desired value of α or a priori. Rather, the desired conductance/cost trade-off may be determined after consideration of the approximation function f. 3. Approximation Algorithms Problem 1 is NP-hard. To see this, consider maximizing α whilst setting to zero. This problem is equivalent to finding the conductance of a given graph, which is well known to be NP-hard [Garey and Johnson 1979]. Here, we present a simple heuristic and provide worst-case approximation guarantees for it. Approximate-Cluster Algorithm Find a cut that approximates the minimum conductance cut in G. Recurse on the pieces induced by the cut. The idea behind our algorithm is simple. Given G, find a cut (S, S) of minimum conductance. Then, recurse on the subgraphs induced by S and S. Finding a cut of minimum conductance is hard, and hence we need to use an approximately minimum cut. There are two well-known approximations for the minimum conductance cut, one is based on a linear programming relaxation and the other is derived from the second eigenvector of the graph. Before we discuss these approximations, we prove a general theorem for general approximation heuristics. Let A be an approximation algorithm that produces a cut of conductance at most Kx ν if the minimum conductance is x, where K is independent of x (e.g., K could be a function of n) and ν is a fixed constant between between 0 and 1. The following theorem (which is the main theorem of this article) provides a guarantee for the approximate-cluster algorithm using A as a subroutine.

8 504 R. KANNAN ET AL. THEOREM 3.1. If G has an (α, )-clustering, then the approximate-cluster algorithm will find a clustering of quality ( ( ) ) α 1/ν 6K log n, (1K + ) ν log n. PROOF. Let the cuts produced by the algorithm be (S 1, T 1 ), (S, T ),..., where we adopt the convention that S j is the smaller side (i.e., a(s j ) a(t j )). Let C 1, C,...C l be an (α, )-clustering. We use the termination condition of α = α. We will assume that we apply the recursive step in the algorithm only if 6 log n the conductance of a given piece as detected by the heuristic for the minimum conductance cut is less than α. In addition, purely for the sake of analysis we consider a slightly modified algorithm. If at any point we have a cluster C t with the property that a(c t ) < n a(v ) then we split C t into singletons. The conductance of singletons is defined to be 1. Then, upon termination, each cluster has conductance at least ( α ) 1/ν ( ) α 1/ν = K 6K log n. Thus, it remains to bound the weight of the intercluster edges. Observe that a(v ) is twice the total edge weight in the graph, and so W = a(v ) is the weight of the intercluster edges in this optimal solution. Now we divide the cuts into two groups. The first group, H, consists of cuts with high conductance within clusters. The second group consists of the remaining cuts. We will use the notation w(s j, T j ) = u S j,v T j a uv. In addition, we denote by w I (S j, T j ) the sum of the weights of the intracluster edges of the cut (S j, T j ), that is, w I (S j, T j ) = l i=1 w(s j C i, T j C i ). We then set { } l H = j : w I (S j, T j ) α min(a(s j C i ), a(t j C i )). i=1 We now bound the cost of the high conductance group. For all j H, wehave, α a(s j ) w(s j,t j ) w I (S j,t j ) α min(a(s j C i ), a(t j C i )). i Consequently, we observe that min(a(s j C i ), a(t j C i )) 1 a(s j) i From the algorithm s cuts, {(S j, T j )}, and the optimal clustering, {C i }, we define a new clustering via a set of cuts {(S j, T j )} as follows: For each j H, we define a cluster-avoiding cut (S j, T j )ins j T j in the following manner: For each i, 1 i l,ifa(s j C i ) a(t j C i ), then place all of (S j T j ) C i into S j.if a(s j C i )<a(t j C i ), then place all of (S j T j ) C i into T j. An example is given in Figure 5, where the original cut is shown by the solid line and the cluster-avoiding cut by the dashed line. Notice that, since a(s j ) a(s j ) 1 a(s j), we have that min(a(s j ), a(t j )) 1 a(s j). Now we will use the approximation guarantee for the

10 506 R. KANNAN ET AL. FIG. 6. Proof of Claim 1. This proves the second statement in the claim (since u S j implies that u S j or u S j \ S j). These concepts are shown pictorially in Figure 6, where the cuts (S j, T j ) and (S k, T k ) are represented by solid lines and the cuts (S j, T j ) and (S k, T k ) by dashed lines. Using this claim, we can bound the overall cost of the group of cuts with high conductance within clusters with respect to the cost of the optimal clustering as follows: w(s j, T j ) K ( w(p(s j ))) ν a(s j ) 1 ν j H all j ( K ) ν ( ) 1 ν w(p(s j )) a(s j ) all j j K ( log n ) ν ( a(v ) log n ) 1 ν a(v ) K ν log n a(v ). () Here, we used Hölder s inequality. Next, we deal with the group of cuts with low conductance within clusters that is, those j not in H. First, suppose that all the cuts together induce a partition of C i into P1 i, Pi,...,Pi r i. Every edge between two vertices in C i that belongs to different sets of the partition must be cut by some cut (S j, T j ) and, conversely, every edge of every cut (S j C i, T j C i ) must have its two end points in different sets of the partition. So, given that C i has conductance α, we obtain w I (S j C i, T j C i ) = 1 r i w(ps i, C i \ Ps i ) all j s=1 1 α s min(a(p i s ), a(c i \ P i s )). For each vertex u C i there can be at most log n values of j such that u belongs to the smaller (according to a( )) of the two sets S j C i and T j C i. So, we have

11 On Clusterings: Good, Bad, and Spectral 507 that r i s=1 min(a(p i s ), a(c i \ P i s )) 1 log n min(a(s j C i ), a(t j C i )). j Thus, w I (S j, T j ) all j α log n l min(a(s j C i ), a(t j C i )). i=1 j Therefore, from the definition of H, wehave I (S j,t j ) α j/ Hw l min(a(s j C i ), a(t j C i )) w I (S j, T j ). 3 all j i=1 all j Thus, we are able to bound the intracluster cost of the low conductance group of cuts in terms of the intracluster cost of the high conductance group. Applying () then gives w I (S j, T j ) w I (S j, T j ) 4K ν log n a(v ). (3) j / H j H In addition, since each intercluster edge belongs to at most one cut S j, T j,wehave that (w(s j, T j ) w I (S j, T j )) a(v ). (4) j / H We then sum up (), (3) and (4). To get the total cost, we note that splitting up all the V t with a(v t ) n a(v ) into singletons costs us at most a(v ) on the whole. Substituting a(v ) as twice the total sum of edge weights gives the bound on the cost of intercluster edge weights. This completes the proof of Theorem 3.1. The Leighton Rao algorithm for approximating the conductance finds a cut of conductance at most log n times the minimum [Leighton and Rao 1999]. In our terminology, it is an approximation algorithm with K = log n and ν = 1. Applying Theorem 3.1 leads to the following guarantee. COROLLARY 3.. If the input has an (α, )-clustering, then, using the Leighton Rao heuristic, the approximate cluster algorithm finds an ( α 1 log n log n, 6 log n log n ) -clustering. We now assess the running time of the algorithm using this heuristic. The fastest implementation for this heuristic, due to Benczur and Karger [1996], runs in Õ(n ) time (where the Õ notation suppresses factors of log n). Since the algorithm makes less than n cuts, the total running time is Õ(n 3 ). This might be slow for some realworld applications. We discuss a potentially more practical algorithm in the next section.

12 508 R. KANNAN ET AL. 4. Performance Guarantees for Spectral Clustering In this section, we describe and analyse a recursive variant of the spectral algorithm. This algorithm, outlined below, has been used in the field of computer vision [Shi and Malik 000] and also in the field of web search engines [Eigencluster]. Note that the algorithm is a special case of the approximate-cluster algorithm described in the previous section; here we use a spectral heuristic to approximate the minimum conductance cut. Spectral Algorithm II Normalize A and find its nd right eigenvector v. Find the best ratio cut wrt v. Recurse on the pieces induced by the cut. Thus, we find a clustering by repeatedly solving a one-dimensional clustering problem. Since the latter is easy to solve, the algorithm is efficient. The fact that it also has worst-case quality guarantees is less obvious. We now elaborate upon the basic description of this variant of the spectral algorithm. Initially, we normalize our matrix A by scaling the rows so that the row sums are all equal to one. At any later stage in the algorithm we have a partition {C 1, C,...,C s }. For each C t, we consider the C t C t submatrix B of A restricted to C t. We normalize B by setting b ii to 1 j C t, j i b ij. As a result, B is also nonnegative with row sums equal to one. Observe that upon normalization of the matrix, our conductance measure corresponds to the familiar Markov Chain conductance measure, that is, φ(s) = i S, j S a ij min(a(s), a( S)) = i S, j S π ib ij min(π(s),π( S)) where π is the stationary distribution of the Markov Chain. We then find the second eigenvector of B. This is the right eigenvector v corresponding to the second largest eigenvalue λ, that is, Bv = λ v. Then order the elements (rows) of C t decreasingly with respect to their component in the direction of v. Given this ordering, say {u 1, u,...,u r }, find the minimum ratio cut in C t. This is the cut that minimizes φ({u 1, u,...,u j },C t ) for some j, 1 j r 1. We then recurse on the pieces {u 1,...,u j }and C t \{u 1,...,u j } WORST-CASE GUARANTEES. We will use the following theorem to prove a worst-case guarantee for the algorithm. This result was essentially proved by Sinclair and Jerrum [1989] (in their proof of Lemma 3.3, although not mentioned in the statement of the lemma). For completeness, and due to the fact that Theorem 4.1 is usually not explicitly stated in the Markov Chain literature (or usually includes some other conditions which are not relevant here), we include a proof of this result. Observe that, via the use of the second eigenvalue, the theorem bounds the conductance of the cut found by the heuristic with respect to that of the optimal cut. THEOREM 4.1. Suppose B is a N N matrix with nonnegative entries with each row sum equal to 1 and suppose there are positive real numbers π 1,π,...π N summing to 1 such that π i b ij = π j b ji for all i, j. If v is the right eigenvector of B

15 On Clusterings: Good, Bad, and Spectral 511 As a result, we have, ( )( ) i< j π ib ij (z i z j ) i<j π ib ij ( z i + z j ) E(v, v) i π iv i ( i π ) ( ) izi i<j π ib ij ( z i + z j ) ( i<j π ) j 1 ib ij k=i zk+1 z k ( i π ) i zi. Set S k ={1,,...,k},C k ={(i,j):i k< j}and (i, j) C ˆα = min k π i b ij k,1 k N min ( i:i k π i, i:i>k π ). i Since z r = 0, we obtain j 1 N 1 π i b ij zk+1 z k = zk+1 z k i< j k=i ˆα = ˆα = ˆα k=1 ( r 1 π i b ij (i,j) C k ) ( z k zk+1 ) N 1( π(sk ) + z k+1 zk ) (1 π(sk )) k=1 ( N 1 k=1 N π k zk. k=1 Consequently, if π T y = 0, then 1 λ = k=r ( z k zk+1 ) π(sk ) + ( z N ) ) z r E(v, v) i π iv i ˆα. 4.. IN THE PRESENCE OF AGOOD BALANCED CLUSTERING. In this section, we consider the situation in which a given input matrix A has a particularly good clustering. Here the matrix can be partitioned into blocks such that the conductance of each block as a cluster is high and the total weight of inter-cluster edges is small. We present a result which shows that, in such a circumstance, the spectral algorithm will find a clustering that is close to the optimal clustering; that is, only a small number of rows will be placed in the incorrect cluster. First, we show how to model this situation. We will use the following terminology. Denote by x the -norm (length) of a vector x. The -norm of an n m matrix A is max Ax. x R m, x =1 We assume that A can be written as B + E, where B is a block diagonal matrix with row sums equal to 1. The blocks of B, say B 1, B,...,B k, induce the clusters of the optimal clustering, and E corresponds to the set of edges that run between clusters.

16 51 R. KANNAN ET AL. Rather than conductance, it will be easier to state the result in terms of the minimum eigenvalue gap of the blocks B 1, B,...,B k. The eigenvalue gap of a matrix is β = 1 λ λ 1. and is closely related to the conductance ( φ β φ). Ideally, we would like to show that if A = B + E where β is large for each block in B and the total weight of edges in E is small then the spectral algorithm works. While this might be expected for a typical input, it is possible to construct examples where applying spectral algorithm I does not work. So we consider the following slightly modified version of spectral algorithm I. As before, project the points onto the space spanned by the top k singular right vectors (eigenvectors). Let C be the n k matrix obtained. For each row c i of C, we define a set S i as follows: { c i c j S i = j : c i c j 3 }. 4 Observe that these sets are clearly not disjoint. Now, to define the final clustering, pick the largest S i, then delete all its elements from C. Repeat in this greedy manner on the remaining sets until all the elements are covered. Theorem 4.3 shows that if the -norm of E and the k + 1st eigenvalue of B are small then this spectral algorithm finds a clustering very close to the optimal one. For analyses in a similar spirit, see Papadimitriou et al. [000] and Azar et al. [001]. The condition below requires a gap between the kth and k +1st eigenvalues of the input matrix. Intuitively, this also corresponds to the gap between the top two eigenvalues of any block, and thus captures the fact that each block has high conductance. THEOREM 4.3. Suppose the input matrix A can be written as B + E, where B satisfies the following conditions: (1) it is block-diagonal matrix with k blocks, () the largest block size is O( n ), (3) it has all row sums equal to 1, and (4) k λ k+1 (B) + E δ<1/. Then the spectral clustering algorithm applied to A misclassifies O(δ n) rows. PROOF. Since B is block-diagonal with k blocks, its top k eigenvalues are all 1 (the top eigenvalue of each block is 1). Let the blocks of B be B 1, B,...,B k and let their sizes be n 1, n,...,n k. The ith eigenvector of B has support corresponding to the rows of B i, and each entry in its support has value 1/ n i. Let Y k be the n k matrix whose columns are these eigenvectors. So B = B k + B n k where B k = Y k Yk T. Therefore, A = B k + B n k + E = B k + E where, by assumption, E B n k + E =λ k+1 (B n )+ E δ. Let X k be the matrix whose columns are the top k eigenvectors of A. By Stewart s theorem Stewart [1973, Theorem 4.11, page 745] applied to A, B k and E, X k = Y k (I + P T P) 1 is an invariant subspace for A, that is, X k = X k U for some orthonormal matrix U, and P E 1 E.

17 On Clusterings: Good, Bad, and Spectral 513 It follows that where X k = Y k U + F, F δ 1 δ. The matrix we use for clustering is C = AX k. Let us compare this with Y k U. C Y k U = (B k +E )(Y k U + F) Y k U = B k F+E Y k U+E F F + E + E F δ 1 δ +δ+ δ 1 δ = 3δ 1 δ. This means that C is close to a rotated version of Y k! The bound on the -norm also implies a bound on the Frobenius norm: C Y k U F k C Y ku 9δ k (1 δ). (6) Let y 1, y,...,y n be the rows of Y k U. Each y i that belongs to block j has y i =1/ n j (rotation preserves lengths). Note that for any i, j from the same block of B, y i = y j and for i, j from different blocks, y i y j = 0. Let c 1, c,...,c n be the rows of C. We will next show that for most i, c i is close to y i. Call an element i distorted if c i y i y i /9. Let the set of distorted rows be D. Suppose m rows are distorted. Then i D c i y i 1 81 i D y i m 81n. where n is the size of the largest block. However, using (6), Hence, m 81 c n i y i 81 C Y k U F 36 δ k (1 δ). i D m 36 δ kn (1 δ) = O(δ n) with our assumptions that n = (n/k) and δ<1/. Next, consider the set that is not distorted. For any i, j such that i, j D, c i c j = (y i + c i y i ) (y j + c j y j ) = y i y j + (c i y i ) y j + (c j y j ) y i + (c i y i ) (c j y j ).

18 514 R. KANNAN ET AL. Hence, c i c j y i y j = (c i y i ) y j +(c j y j ) y i +(c i y i ) (c j y j ) (c i y i ) y j + (c j y j ) y i + (c i y i ) (c j y j ) 9 y i y j y i y j c i c j < 1 4 c i c j. Here, we have used the fact that for i D, y i c i + y i c i c i y i and hence y i c i. This implies that for two undistorted rows i, j, wehave c i c j > 3 4 c i c j if i, j are from the same block of B, and c i c j < 1 4 c i c j otherwise. The theorem follows (the key observation is that two undistorted rows from different clusters stay in different clusters). 5. Conclusion There are two basic aspects to analyzing a clustering algorithm Quality: how good is the clustering produced? Speed: how fast can it be found? In this article, we have mostly dealt with the former issue while taking care that the algorithms are polynomial time. The spectral algorithms depend on the time it takes to find the top (or top k) singular vector(s). While this can be done in polynomial time, it might still too expensive for applications such as information retrieval. The work of Frieze et al. [1998] and Drineas et al. [1999] on randomized algorithms for low-rank approximation addresses this problem. The running time of their first algorithm depends only on the quality of the desired approximation and not on the size of the matrix, but it assumes that the entries of the matrix can be sampled in a specific manner. Their second algorithm needs no assumptions and has a running time that is linear in the number of nonzero entries. More recently, Cheng et al. [003] describes an efficient implementation of spectral algorithm II that maintains sparsity, and also gives experimental evidence that it performs favorably compared to other well-known clustering algorithms. ACKNOWLEDGMENT. version. REFERENCES We thank Anna Karlin for pointing out an error in an earlier ALPERT, C., KAHNG, A., AND YAO, Z Spectral partitioning: The more eigenvectors the better. Discr. Appl. Math. 90, 3 6. AZAR, Y., FIAT, A., KARLIN, A., MCSHERRY F., AND SAIA, J Spectral analysis of data. In Proceedings of 33rd Symposium on Theory of Computing, ACM, New York,

CSE 291: Geometric algorithms Spring 2013 Lecture 4 Online and streaming algorithms for clustering 4.1 On-line k-clustering To the extent that clustering takes place in the brain, it happens in an on-line

Approximation Algorithms 11 Approximation Algorithms Q Suppose I need to solve an NP-hard problem What should I do? A Theory says you're unlikely to find a poly-time algorithm Must sacrifice one of three

CSE 291: Unsupervised learning Spring 2008 Lecture 6 Online and streaming algorithms for clustering 6.1 On-line k-clustering To the extent that clustering takes place in the brain, it happens in an on-line

Approximation Algorithms Chapter Approximation Algorithms Q. Suppose I need to solve an NP-hard problem. What should I do? A. Theory says you're unlikely to find a poly-time algorithm. Must sacrifice one

Approximation Algorithms Chapter Approximation Algorithms Q Suppose I need to solve an NP-hard problem What should I do? A Theory says you're unlikely to find a poly-time algorithm Must sacrifice one of

Mathematics Course 111: Algebra I Part IV: Vector Spaces D. R. Wilkins Academic Year 1996-7 9 Vector Spaces A vector space over some field K is an algebraic structure consisting of a set V on which are

Stationary random graphs on Z with prescribed iid degrees and finite mean connections Maria Deijfen Johan Jonasson February 2006 Abstract Let F be a probability distribution with support on the non-negative

Constant Factor Approximation Algorithm for the Knapsack Median Problem Amit Kumar Abstract We give a constant factor approximation algorithm for the following generalization of the k-median problem. We

(67902) Topics in Theory and Complexity Nov 2, 2006 Lecturer: Irit Dinur Lecture 7 Scribe: Rani Lekach 1 Lecture overview This Lecture consists of two parts In the first part we will refresh the definition

On the k-path cover problem for cacti Zemin Jin and Xueliang Li Center for Combinatorics and LPMC Nankai University Tianjin 300071, P.R. China zeminjin@eyou.com, x.li@eyou.com Abstract In this paper we

LINEAR ALGEBRA W W L CHEN c W W L Chen, 1997, 2008 This chapter is available free to all individuals, on understanding that it is not to be used for financial gain, and may be downloaded and/or photocopied,

Lecture 11 The Lovász ϑ Function 11.1 Perfect graphs We begin with some background on perfect graphs. graphs. First, we define some quantities on Definition 11.1. Given a graph G on n vertices, we define

NEW VERSION OF DECISION SUPPORT SYSTEM FOR EVALUATING TAKEOVER BIDS IN PRIVATIZATION OF THE PUBLIC ENTERPRISES AND SERVICES Silvija Vlah Kristina Soric Visnja Vojvodic Rosenzweig Department of Mathematics

Orthogonal Projection Given any nonzero vector v, it is possible to decompose an arbitrary vector u into a component that points in the direction of v and one that points in a direction orthogonal to v

A simpler and better derandomization of an approximation algorithm for Single Source Rent-or-Buy David P. Williamson Anke van Zuylen School of Operations Research and Industrial Engineering, Cornell University,

Lecture Topic: Low-Rank Approximations Low-Rank Approximations We have seen principal component analysis. The extraction of the first principle eigenvalue could be seen as an approximation of the original

An Impossibility Theorem for Clustering Jon Kleinberg Department of Computer Science Cornell University Ithaca NY 14853 Abstract Although the study of clustering is centered around an intuitively compelling

Massachusetts Institute of Technology Handout 6 18.433: Combinatorial Optimization February 20th, 2009 Michel X. Goemans 3. Linear Programming and Polyhedral Combinatorics Summary of what was seen in the

COMBINATORIAL PROPERTIES OF THE HIGMAN-SIMS GRAPH ZACHARY ABEL 1. Introduction In this survey we discuss properties of the Higman-Sims graph, which has 100 vertices, 1100 edges, and is 22 regular. In fact

CS787: Advanced Algorithms Lecture 5: Applications of Network Flow In the last lecture, we looked at the problem of finding the maximum flow in a graph, and how it can be efficiently solved using the Ford-Fulkerson

6.3 Orthogonal Matrices 1 Chapter 6. Orthogonality 6.3 Orthogonal Matrices Definition 6.4. An n n matrix A is orthogonal if A T A = I. Note. We will see that the columns of an orthogonal matrix must be

Large induced subgraphs with all degrees odd A.D. Scott Department of Pure Mathematics and Mathematical Statistics, University of Cambridge, England Abstract: We prove that every connected graph of order

.6 Data Mining: Algorithms and Applications Matrix Math Review The purpose of this document is to give a brief review of selected linear algebra concepts that will be useful for the course and to develop

LINEAR ALGEBRA MATH 27.6 SPRING 23 (COHEN) LECTURE NOTES Sets and Set Notation. Definition (Naive Definition of a Set). A set is any collection of objects, called the elements of that set. We will most

Math 571 Inner Product Spaces 1. Preliminaries An inner product space is a vector space V along with a function, called an inner product which associates each pair of vectors u, v with a scalar u, v, and

Chapter 3 Linear Codes In order to define codes that we can encode and decode efficiently, we add more structure to the codespace. We shall be mainly interested in linear codes. A linear code of length

The Singular Value Decomposition in Symmetric (Löwdin) Orthogonalization and Data Compression The SVD is the most generally applicable of the orthogonal-diagonal-orthogonal type matrix decompositions Every

Solving LPs: The Simplex Algorithm of George Dantzig. Simplex Pivoting: Dictionary Format We illustrate a general solution procedure, called the simplex algorithm, by implementing it on a very simple example.

B490 Mining the Big Data 2 Clustering Qin Zhang 1-1 Motivations Group together similar documents/webpages/images/people/proteins/products One of the most important problems in machine learning, pattern

Section 6.1 - Inner Products and Norms Definition. Let V be a vector space over F {R, C}. An inner product on V is a function that assigns, to every ordered pair of vectors x and y in V, a scalar in F,

A Negative Result Concerning Explicit Matrices With The Restricted Isometry Property Venkat Chandar March 1, 2008 Abstract In this note, we prove that matrices whose entries are all 0 or 1 cannot achieve

Compact Representations and Approximations for Compuation in Games Kevin Swersky April 23, 2008 Abstract Compact representations have recently been developed as a way of both encoding the strategic interactions

DETERMINANTS IN THE KRONECKER PRODUCT OF MATRICES: THE INCIDENCE MATRIX OF A COMPLETE GRAPH CHRISTOPHER RH HANUSA AND THOMAS ZASLAVSKY Abstract We investigate the least common multiple of all subdeterminants,

MATH022 Linear Algebra Brief lecture notes 48 Similarity and Diagonalization Similar Matrices Let A and B be n n matrices. We say that A is similar to B if there is an invertible n n matrix P such that

Mean Ramsey-Turán numbers Raphael Yuster Department of Mathematics University of Haifa at Oranim Tivon 36006, Israel Abstract A ρ-mean coloring of a graph is a coloring of the edges such that the average

IRREDUCIBLE OPERATOR SEMIGROUPS SUCH THAT AB AND BA ARE PROPORTIONAL R. DRNOVŠEK, T. KOŠIR Dedicated to Prof. Heydar Radjavi on the occasion of his seventieth birthday. Abstract. Let S be an irreducible

Finding and counting given length cycles Noga Alon Raphael Yuster Uri Zwick Abstract We present an assortment of methods for finding and counting simple cycles of a given length in directed and undirected

1 VECTOR SPACES AND SUBSPACES What is a vector? Many are familiar with the concept of a vector as: Something which has magnitude and direction. an ordered pair or triple. a description for quantities such