A simple SVD algorithm for finding hidden partitions

Van Vu

The problem and a new algorithm

The hidden partition problem is the following: let XX be a set of nn vertices with a partition X=∪i=1kXiX=\cup_{i=1}^{k}X_{i}; for all 1≤i≤j≤n1\leq i\leq j\leq n and any x∈Xi,y∈Xjx\in X_{i},y\in X_{j}, we put a random edge between xx and yy with probability pijp_{ij}. Given one such random graph, the goal is to recover the sets XiX_{i}. This problem is of importance in computer science and statistics and contains as special cases several well-studied problems such as the hidden clique, hidden bisection, hidden coloring, clustering etc (see, for instance, and the references therein). In what follows, we refer to XiX_{i} as clusters.

In an influential paper , Mc Sherry provided a (randomized) polynomial time algorithm that solves the general hidden partition problem for a large range of parameters. As corollary, he derived several earlier results obtained for special cases.

The general idea (and in many earlier works on clustering) is to find a good geometric representation of the vertices. We say that a representation is perfect if there is a number r>0r>0 such that

Vertices in the same cluster have distance at most rr from each other.

Vertices from different clusters have distance at least 4r4r from each other.

Once a perfect representation is obtained, it is easy to find the clusters. If rr is known, then the solution is obvious. If rr is not known, then there are several simple algorithms. For instance, one can create a minimal spanning tree (with respect to the distances) on the vertices and then remove the largest k−1k-1 edges. In what follows, we put all these simple algorithms under a subroutine called Clustering by Distances and the reader can choose his/her favorite to implement. Our main goal is to present a simple way to obtain a perfect representation.

In the rest of the paper, let su:=∣Xi∣s_{u}:=|X_{i}| if u∈Xiu\in X_{i} and s:=min⁡u∈Xsu=min⁡i∣Xi∣s:=\min_{u\in X}s_{u}=\min_{i}|X_{i}|. We assume that nn is sufficiently large, whenever needed. Asymptotic notation are used under the assumption n→∞n\rightarrow\infty. All explicit constants (such as the 44 above) are adhoc and we make no attempt to optimize them.

Let PP be the probability matrix (pij)1≤i,j≤n(p_{ij})_{1\leq i,j\leq n}. For a vertex u∈Xu\in X, u{\mathbf{u}} denotes the corresponding column in PP. Define

where the minimum is taken over all pairs u,vu,v belonging to different clusters. Mc Sherry proved

Assume that σ2≫log⁡6n/n\sigma^{2}\gg\log^{6}n/n is an upper bound on the variances of the entries. There is a constant C>0C>0 such that if

the above algorithm (with a proper choice of the threshold τ\tau) recovers the partition with probability 1−ϵ1-\epsilon with respect to the random graph and k−1k^{-1} with respect to the auxiliary random bits.

The main open question raised by Mc Sherry in is to find a more natural and simpler algorithm, which does not involve the subroutine CPROJ (see [24, Section 4.4]). The goal of this paper is to answer this question.

To this end, MkM_{k} denotes the subspace spanned by the first kk left singular vectors of a matrix MM. Let P^\hat{P} be our input, namely the adjacency matrix of a random graph generated by PP. Arguably, the most natural choice for HH would be P^k\hat{P}_{k} (SVD), which leads to the algorithm below

While SVD I could well win the contest for being the simplest algorithm, it is not easy to analyze in the general case. In what follows, we analyze a slightly more technical alternative, SVD II, which is a variant of an algorithm proposed in [24, Section 1].

Compared to SVD I, the extra steps in SVD II are the random partitions in Step (0)(0) done in order to reduce the correlation. (A careful reading of reveals that one also need an extra partition in Algorithm 2 to make the analysis go through.)

Notice that SVD II gives a partition of Y2Y_{2}, not XX. There are many ways to extend it to a partition of XX. For instance, we can run the algorithm ll times (for some small ll) and find partitions of Y21,…,Y2lY_{2}^{1},\dots,Y_{2}^{l}, where Y2iY_{2}^{i} are random subsets of XX with density 1/41/4 (the input graph is the same, only the random partitions are different). If a cluster CC in Y2iY_{2}^{i} and a cluster C′C^{\prime} in Y2i′Y_{2}^{i^{\prime}} intersect, then they must belong to the same cluster in XX and we can merge them. If we choose l=3log⁡nl=3\log n, say, then with probability 1−o(n−1)1-o(n^{-1}), all vertices of XX must belong to some Y2iY_{2}^{i} and we recover the clusters X1,…,XkX_{1},\dots,X_{k} at the end. We can also first find the partitions of Y1,Y2Y_{1},Y_{2} and Z1,Z2Z_{1},Z_{2} by reversing the role of Y1Y_{1} and Y2Y_{2} and YY and ZZ and find which four clusters must belong to an original cluster by looking at the edge densities; we omit the details.

Beside being simple, SVD II is also very convenient to implement, as its main step, the computation of the projection onto A^k\hat{A}_{k} (given A^\hat{A} as input) is a routine operation (SVD) which appears in most standard mathematical packages.

Let us now analyze SVD II. For convenience, we assume that PP has rank kk. The general case when PP can have a smaller rank is discussed later. Let λ\lambda be the least non-trivial singular value of PP.

There is a constant C>0C>0 such that the following holds. Assume that σ2≥Clog⁡nn\sigma^{2}\geq C\frac{\log n}{n} and s≥Clog⁡n,k=o((n/log⁡n)1/2)s\geq C\log n,k=o((n/\log n)^{1/2}). Then SVD II clusters Y2Y_{2} correctly with probability 1−o(n−1)1-o(n^{-1}) if one of the following two conditions is satisfied

Condition 1. Δ≥C(σns+log⁡n).\Delta\geq C(\sigma\sqrt{\frac{n}{s}}+\sqrt{\log n}).

Condition 2. Δ≥C(σns+σklog⁡n+σnkλ)\Delta\geq C(\sigma\sqrt{\frac{n}{s}}+\sigma\sqrt{k\log n}+\frac{\sigma\sqrt{nk}}{\lambda})

If we omit the assumption s≥Clog⁡ns\geq C\log n, the statement still holds but with probability

The lower bound σ2≥Clog⁡n/n\sigma^{2}\geq C\log n/n is optimal, up to the value of CC. If σ2<log⁡n/n\sigma^{2}<\log n/n, then there are many isolated points, which can be assigned to any cluster.

We can reduce the failure probability O(n−1)O(n^{-1}) to O(n−K)O(n^{-K}) for any constant KK at the cost of increasing the constant CC.

Let us now consider the performance of SVD II on various subproblems. We allow the value of CC to be flexible in order to omit smaller order terms for convenience. It is instructive to compare the corollaries below with Corollaries 1,2,3 from .

Hidden clique. In this problem, k=2k=2, ss is the size of the clique, and Δ=(1−p)s\Delta=(1-p)\sqrt{s}, where pp is the density of the random graph. Condition 1 becomes

which is satisfied if s≥C(np+log⁡n)s\geq C(\sqrt{np}+\sqrt{\log n}). As np=Θ(σ2n)=Θ(log⁡n)np=\Theta(\sigma^{2}n)=\Theta(\log n), this simplifies to s≥Cnps\geq C\sqrt{np}.

There is a constant CC such that for any p≥Clog⁡nnp\geq C\frac{\log n}{n} and s≥Cnps\geq C\sqrt{np}, SVD II finds the hidden clique of size ss with probability 1−o(1)1-o(1).

Hidden Coloring. Here kk is the number of color classes, each has size n/kn/k; Δ=p2n/k\Delta=p\sqrt{2n/k}; s=n/ks=n/k; σ2=p(1−p)\sigma^{2}=p(1-p). The singular values of PP are k−1kn,1kn,…,1kn\frac{k-1}{k}n,\frac{1}{k}n,\dots,\frac{1}{k}n. If p≥1/kp\geq 1/k, Condition 1 is

which is satisfied for k=o((n/log⁡n))1/3)k=o((n/\log n))^{1/3}).

If p<1/kp<1/k, then the bound λ≥σns\lambda\geq\sigma\sqrt{ns} holds, and the Δ\Delta bound in Condition 2 is

which is satisfied if p≥Ck3/2log⁡nnp\geq C\frac{k^{3/2}\log n}{n}.

There is a constant CC such that the following holds. For any k=o((n/log⁡n)1/3k=o((n/\log n)^{1/3} and edge density .99>p≥Ck3/2log⁡nn.99>p\geq C\frac{k^{3/2}\log n}{n}, SVD II finds the hidden kk-coloring with probability 1−O(n−1)1-O(n^{-1}).

Hidden Bipartition. Let the two densities be .99≥p>q>0.99\geq p>q>0. We have k=2k=2, Δ=∣p−q∣n1/2\Delta=|p-q|n^{1/2}, s=n/2s=n/2, σ2=Θ(p)\sigma^{2}=\Theta(p). The two singular values of PP are (p+q)n(p+q)n and (p−q)n(p-q)n. Condition 2 requires p−qp1/4≥Clog⁡nn.\frac{p-q}{p^{1/4}}\geq C\sqrt{\frac{\log n}{n}}.

There is a constant CC such that the following holds Let .99>p>q≥Clog⁡n/n.99>p>q\geq C\log n/n be edge densities such that p−qp1/4≥Clog⁡nn\frac{p-q}{p^{1/4}}\geq C\sqrt{\frac{\log n}{n}} then SVD II finds the hidden bipartition with probability 1−o(n−1)1-o(n^{-1}).

One can replace p1/4p^{1/4} in the denominator by a better term p1/2p^{1/2} by considering an approximate algorithm; see Corollary 11.

The rest of the paper is organized as follows. In the next section, we present a few technical lemmas and prove Theorem 2 and Theorem 10 in Section 3. In Section 4, we discuss variants of SVD II, including an approximate version which works under weaker assumptions.

Technical lemmas

Furthermore, if HH has an orthornormal bases v1,…,vdv_{1},\dots,v_{d} such that max⁡1≤i≤d∥vi∥∞≤α\max_{1\leq i\leq d}\|v_{i}\|_{\infty}\leq\alpha, then

There is a constant C0>0C_{0}>0 such that the following holds. Let EE be a symmetric matrix whose upper diagonal entries eije_{ij} are independent random variables where eij=1−pije_{ij}=1-p_{ij} or −pij-p_{ij} with probabilities pijp_{ij} and 1−pij1-p_{ij}, respectively, where 0≤pij≤10\leq p_{ij}\leq 1. Let σ2:=max⁡ijpij(1−pij\sigma^{2}:=\max_{ij}p_{ij}(1-p_{ij}. If σ2≥C0log⁡n/n\sigma^{2}\geq C_{0}\log n/n, then

If σ2≥log⁡4nn\sigma^{2}\geq\frac{\log^{4}n}{n}, the statement is a corollary of [26, Theorem 1.4]. For smaller σ\sigma, one can prove this lemma using the ϵ\epsilon-net approach by Kahn and Szemeredi . We omit the details, which is very similar to the proof of Feige and Ofek for [14, Theorem 1.1].

Let M,NM,N be matrices where δ:=λk(M)−λk+1M>0\delta:=\lambda_{k}(M)-\lambda_{k+1}M>0. Then

This lemma is a well known result in numerical linear algebra, known as Davis-Kahan-Wedin theorem; see .

Proof of Theorems 2

Let AA be the probability matrix pijp_{ij} corresponding to A^\hat{A}. As AA is a large random submatrix of PP, it is not hard to show that λk(A)=Θ(λk(P))\lambda_{k}(A)=\Theta(\lambda_{k}(P)) with high probability (we provide a verification of this fact at the end of the proof). In the rest of this proof, we assume

We view the adjacency matrix A^\hat{A} (between Y1Y_{1} and ZZ) as a random perturbation of AA, A^:=A+E\hat{A}:=A+E, where the entries eije_{ij} of EE are independent and eij=1−pije_{ij}=1-p_{ij} with probability pijp_{ij} and −pij-p_{ij} with probability 1−pij1-p_{ij}. We denote by u^,u,eu\hat{\mathbf{u}},{\mathbf{u}},e_{u} the columns corresponding to a vertex uu in A^,A,E\hat{A},A,E, respectively. All matrices are of size approximately n/2×n/4n/2\times n/4 by the definitions of Y,ZY,Z and Y1,Y2Y_{1},Y_{2}.

Our leading idea is that the random perturbation EE does not change AkA_{k} too much, thus hopefully the projections onto A^k\hat{A}_{k} and AkA_{k} differ by only a small amount. The heart of the matter, of course, is to bound this error term. While inviting, a straightforward application of Lemma 9 is too crude in the general case (it does lead to some simple solution for some subproblems in certain range of parameters). We will still make use of this lemma, but for a quite different purpose.

For simplicity, we assume in the rest of the proof that s≥Clog⁡ns\geq C\log n. For a sufficiently large CC, this implies that with probability 1−o(n−1)1-o(n^{-1}), each cluster XiX_{i} intersects ZZ in at least ∣Xi∣/3|X_{i}|/3 elements. Thus, the distance between two columns (belonging to different clusters) in AA is at least Δ/3\Delta/3. We aim to show that with high probability ∥PA^ku^−u∥<Δ/12\|P_{\hat{A}_{k}}\hat{\mathbf{u}}-{\mathbf{u}}\|<\Delta/12 for all u∈Y2u\in Y_{2}; this will provide a perfect geometric representation. If there is no lower bound on ss, then the probability that the random partition has this property is at least 1−c∑i=1ke−∣Xi∣/c1-c\sum_{i=1}^{k}e^{-|X_{i}|/c} for some constant c>0c>0.

For a fixed uu, by the triangle inequality

To bound the second term, we follow an argument from and consider

The spectral norm of the first term is λk+1(Ak)≤λk+1(A)+∥E∥=∥E∥\lambda_{k+1}(A_{k})\leq\lambda_{k+1}(A)+\|E\|=\|E\|, as AA has rank at most kk. The spectral norm of the second term is also at most ∥E∥\|E\|. Thus, by Lemma 8, by probability at least 1−n−31-n^{-3}

Let χu\chi_{u} be the unit vector su−1/2Ius_{u}^{-1/2}{\mathbf{I}}_{u} where Iu{\mathbf{I}}_{u} is the indicator vector for the cluster containing uu, we have

Combining the last two inequalities and using the union bound, we conclude that with probability at least 1−n−21-n^{-2}

Now we tend to the first term, whose analysis is more involved. By the first part of Lemma 7,

with probability 1−o(n−2)1-o(n^{-2}), for a properly chosen constant C1C_{1}. As sk≤nsk\leq n, the term σk1/2\sigma k^{1/2} is at most σn/s\sigma\sqrt{n/s} and can be omitted. This yields that if

then the algorithm succeeds with probability at least 1−o(n−1)1-o(n^{-1}). This proves the first part of the theorem concerning Condition 1.

To prove the second part of the theorem, let us reconsider the distance PA^keuP_{\hat{A}_{k}}e_{u}. Notice that if s≤10klog⁡ns\leq 10k\log n, then Condition 2 implies Condition 1 (with some modification on the value of CC). Thus, in what follows, we can assume s≥10klog⁡ns\geq 10k\log n.

Rewrite A^=A+E\hat{A}=A+E and let vv be a singular vector of AA. Recall that ∣Xi∩Z∣≥13∣Xi∣=si/3|X_{i}\cap Z|\geq\frac{1}{3}|X_{i}|=s_{i}/3 for all ii By symmetry, each coordinate in vv is repeated at least s/3s/3 times, thus ∥v∥∞≤2s−1/2\|v\|_{\infty}\leq 2s^{-1/2}. Furthermore, by Lemma 9 and Lemma 8, we have with probability 1−o(n−2)1-o(n^{-2}) that

which implies that for any unit vector v∈A^kv\in\hat{A}_{k},

by the condition on λ\lambda, with some properly chosen constant C0′C_{0}^{\prime}. Using the second part of Lemma 7, we conclude that with probability 1−o(n−2)1-o(n^{-2}), ∥PA^keu∥≤C(σk1/2+s−1/2log⁡n)\|P_{\hat{A}_{k}}e_{u}\|\leq C(\sigma k^{1/2}+s^{-1/2}\log n) for all uu and some properly chosen constant CC, concluding the proof.

To make the argument precise, we need to remove the assumption ∣Xi∩Y∣=∣Xi∣/2|X_{i}\cap Y|=|X_{i}|/2. Using (3), we can create a matrix P′P^{\prime} such that

Variants

In the case rank⁡A=l<k\operatorname{rank}A=l<k, it makes more sense to project onto A^l\hat{A}_{l} rather than onto A^k\hat{A}_{k}; the rest of the algorithm and analysis remains the same.

If we do not know either kk or ll in advance. we can modify SVD II slightly as follows. The idea is to define the essential rank of A^\hat{A} to be the largest index ll such that λl(A^)≥C3σn1/2\lambda_{l}(\hat{A})\geq C_{3}\sigma n^{1/2}, for a properly chosen C3C_{3}, and replace the projection onto A^k\hat{A}_{k} by the projection onto A^l\hat{A}_{l}. After redefining λ:=λlP\lambda:=\lambda_{l}P, the content of Theorem 2 remains the same. Its proof also remains the same, expect few nominal changes. The error term caused by smaller singular values is not going to effect the final conclusion.

The only information we need in SVD II (using essential dimension) is the value of σ\sigma. Even if this information is not known, we can still solve the problem by considering a sequence of O(log⁡n)O(\log n) trials with σ1=log⁡nn,σi=2σi−1\sigma_{1}=\frac{\log n}{\sqrt{n}},\sigma_{i}=2\sigma_{i-1} and run SVD II in each case. Each trial will output a clustering and it is easy to decide which one is correct by considering the degree densities of the vertices from one cluster to the others.

2. An approximate Solution.

In practice, one is often satisfied with an approximate solution. We say that a partition X=∪i=1kXi′X=\cup_{i=1}^{k}X_{i}^{\prime} is ϵ\epsilon-correct if ∣Xi\Xi′∣≤ϵ∣Xi∣|X_{i}\backslash X_{i}^{\prime}|\leq\epsilon|X_{i}|. Similarly, we say that a geometric representation of XX is ϵ\epsilon-perfect if there are points x1,…,xkx_{1},\dots,x_{k} with distance at least 4r4r from each other so that at least (1−ϵ)∣Xi∣(1-\epsilon)|X_{i}| points from XiX_{i} has distance at most rr to xix_{i}. One can use an ϵ\epsilon-perfect representation to find an ϵ\epsilon-correct partition.

Given ϵ>0\epsilon>0, there is a constant C>0C>0 such that the following holds. If σ2≥Clog⁡nn\sigma^{2}\geq C\frac{\log n}{n} and

then with probability 1−o(n−1)1-o(n^{-1}) the projection in SVD II produce an (1−ϵ)(1-\epsilon)-perfect representation of the point sin Y2Y_{2}.

It is worth mentioning that in various situations, an ϵ\epsilon-correct partition can be upgraded to a fully correct one by a simple “correction” procedure, as shown in the following example:

Hidden bipartition. Assume p>qp>q. Let X=X1′∪X2′X=X_{1}^{\prime}\cup X_{2}^{\prime} be an ϵ\epsilon-correct partition, for some small ϵ\epsilon (say ϵ=.1\epsilon=.1). Then both Xi′X_{i}^{\prime} have size at most 12(1−ϵ)n\frac{1}{2}(1-\epsilon)n. Assume ∣Xi\Xi′∣≤ϵn/2|X_{i}\backslash X_{i}^{\prime}|\leq\epsilon n/2; it follows that ∣X1′\X1∣≤ϵn|X_{1}^{\prime}\backslash X_{1}|\leq\epsilon n. With probability 1−n−21-n^{-2}, the following holds. For any u∈Xu\in X, let dud_{u} be the number of its neighbors in X1′X_{1}^{\prime}. If u∈X1u\in X_{1}, then

It is clear that if (p−q)≥30plog⁡nn(p-q)\geq 30\sqrt{\frac{p\log n}{n}}, then D1>D2D_{1}>D_{2}. Thus, one can correct the partition by defining X1X_{1} be the set of n/2n/2 vertices uu with largest dud_{u}.

There is a constant CC such that the following holds Let .99>p>q≥Clog⁡n/n.99>p>q\geq C\log n/n be edge densities such that p−qp1/2≥Clog⁡nn\frac{p-q}{p^{1/2}}\geq C\sqrt{\frac{\log n}{n}} then the approximation algorithm with correction finds the hidden bipartition with probability 1−o(n−1)1-o(n^{-1}).

Proof of Theorem 10. We first bound ∥PA^keu∥\|P_{\hat{A}_{k}}e_{u}\|. Recall that

By Markov’s inequality, it follows that P(∥PA^keu∥≥Kσk1/2)≤K−2{\mathbf{P}}(\|P_{\hat{A}_{k}}e_{u}\|\geq K\sigma k^{1/2})\leq K^{-2}. We call a vertex uu good if ∥PA^keu∥≤Kσk1/2\|P_{\hat{A}_{k}}e_{u}\|\leq K\sigma k^{1/2}. For a sufficiently large CC (depending on KK), all good vertices will be clustered correctly. Moreover, choosing K≥2ϵ−1/2K\geq 2\epsilon^{-1/2}, the probability for uu being good is at least 1−ϵ/41-\epsilon/4, thus the expectation of the number of good elements in XiX_{i} is at least ∣Xi∣(1−ϵ/4)|X_{i}|(1-\epsilon/4). As the good events are independent, Chernoff’s bound implies that with probability 1−n−21-n^{-2}, at least ∣Xi∣(1−ϵ)|X_{i}|(1-\epsilon) points from XiX_{i} are good. This completes the proof.

Appendix A Proof of Lemma 7

Notice that the function ΠH(X)\Pi_{H}(X) is 11-Lipschitz and convex, thus by Talagrand’s inequality for any t>0t>0

where μ\mu is the mean of ΠH(X)\Pi_{H}(X). We do not know μ\mu; however, we can bound from above. Slightly abusing the notation, let Π:=(πij)\Pi:=(\pi_{ij}) denote the projection matrix onto HH, then

Combining this with the concentration inequality, it is not hard to show that μ≤σd1/2+O(1)\mu\leq\sigma d^{1/2}+O(1), concluding the proof of the first part of the lemma.

Let (a1,…,an)(a_{1},\dots,a_{n}) be real numbers such that ∑iai2=1\sum_{i}a_{i}^{2}=1 and ∣ai∣≤α|a_{i}|\leq\alpha for all ii. Let ξi\xi_{i} be independent random variables with mean 0 and E∣ξi∣k≤σ2{\mathbf{E}}|\xi_{i}|^{k}\leq\sigma^{2} for all k≥2k\geq 2. Let S:=∑i=1naiξiS:=\sum_{i=1}^{n}a_{i}\xi_{i}. Then

To prove Claim 12, notice that for any 0<t≤α−10<t\leq\alpha^{-1} we have

Since Eξik≤σ2{\mathbf{E}}\xi_{i}^{k}\leq\sigma^{2} for all k≥2k\geq 2 and t∣ai∣≤1t|a_{i}|\leq 1, the right most formula is

To optimize the RHS, let us consider two cases

Case 1. σ≥αlog⁡n\sigma\geq\alpha\sqrt{\log n}. Take T=4σlog⁡nT=4\sigma\sqrt{\log n} and t=log⁡nσ≤α−1t=\frac{\sqrt{\log n}}{\sigma}\leq\alpha^{-1}. With this setting −tT+t2σ2=−3log⁡n-tT+t^{2}\sigma^{2}=-3\log n.

Case 2. σ<αlog⁡n\sigma<\alpha\sqrt{\log n}. Take T=4αlog⁡nT=4\alpha\log n and t=α−1t=\alpha^{-1}. In this setting, −tT+t2σ2≤−4log⁡n+log⁡n=−3log⁡n-tT+t^{2}\sigma^{2}\leq-4\log n+\log n=-3\log n.

One can bound P(−S≤T){\mathbf{P}}(-S\leq T) the same way.

Acknowledgement. The author would like to thank NSF and AFORS for their support and K. Luh for his careful proof reading.

References