In which we analyze a nearly-linear time algorithm for finding an approximate eigenvector for the second eigenvalue of a graph adjacency matrix, to be used in the spectral partitioning algorithm.
In past lectures, we showed that, if G=(V,E) is a d-regular graph, and M is its normalized adjacency matrix with eigenvalues 1=λ1≥λ2…≥λn, given an eigenvector of λ2, the algorithm SpectralPartition finds, in nearly-linear time O(∣E∣+∣V∣log∣V∣), a cut (S,V−S) such that h(S)≤2h(G).
More generally, if, instead of being given an eigenvector x such that Mx=λ2x, we are given a vector x⊥1 such that xTMx≥(λ2−ϵ)xTx, then the algorithm finds a cut such that h(S)≤4h(G)+2ϵ. In this lecture we describe and analyze an algorithm that computes such a vector using O((∣V∣+∣E∣)⋅ϵ1⋅logϵ∣V∣) arithmetic operations.
A symmetric matrix is positive semi-definite (abbreviated PSD) if all its eigenvalues are nonnegative. We begin by describing an algorithm that approximates the largest eigenvalue of a given symmetric PSD matrix. This might not seem to help very much because the adjacency matrix of a graph is not PSD, and because we want to compute the second largest, not the largest, eigenvalue. We will see, however, that the algorithm is easily modified to approximate the second eigenvalue of a PSD matrix (if an eigenvector of the first eigenvalue is known), and that the adjacency matrix of a graph can easily be modified to be PSD.
1. The Power Method to Approximate the Largest Eigenvalue
The algorithm works as follows
Algorithm Power
Input: PSD symmetric matrix M∈Rn×n, positive integer t
Pick uniformly at random x0∼{−1,1}n
for i:=1 to t
xi:=Mxi−1
return xt
That is, the algorithm simply picks uniformly at random a vector x with ±1 coordinates, and outputs Mtx.
Note that the algorithm performs O(t⋅(n+m)) arithmetic operations, where m is the number of non-zero entries of the matrix M.
Theorem 1 For every PSD matrix M, positive integer t and parameter ϵ>0, with probability ≥3/16 over the choice of x0, the algorithm Power outputs a vector xt such that
xtTxtxtTMxt≥λ1⋅(1−ϵ)⋅1+4n(1−ϵ)2t1
where λ1 is the largest eigenvalue of M.
Note that, in particular, we can have t=O(logn/ϵ) and xtTxtxtTMxt≥(1−O(ϵ))⋅λ1.
Let λ1≥⋯λn be the eigenvalues of M, with multiplicities, and v1,…,vn be a system of orthonormal eigenvectors such that Mvi=λivi. Theorem 1 is implied by the following two lemmas
Lemma 2 Let v∈Rn be a vector such that ∣∣v∣∣=1. Sample uniformly x∼{−1,1}n. Then
P[∣⟨x,v⟩∣≥21]≥163
Lemma 3 Let x∈Rn be a vector such that ∣⟨x,v1⟩∣≥21. Then, for every positive integer t and positive ϵ>0, if we define y:=Mtx, we have
yTyyTMy≥λ1⋅(1−ϵ)⋅1+4∣∣x∣∣2(1−ϵ)2t1
It remains to prove the two lemmas.
Proof: (Of Lemma 2) Let v=(v1,…,vn). The inner product ⟨x,v⟩ is the random variable
S:=i∑xivi
Let us compute the first, second, and fourth moment of S.
ES=0
ES2=i∑vi2=1
ES4=3(i∑vi2)−2i∑vi4≤3
Recall that the Paley-Zygmund inequality states that if Z is a non-negative random variable with finite variance, then, for every 0≤δ≤1, we have
P[Z≥δEZ]≥(1−δ)2⋅EZ2(EZ)2(1)
which follows by noting that
EZ=E[Z⋅1Z<δEZ]+E[Z⋅1Z≥δEZ,
that
E[Z⋅1Z<δEZ]≤δEZ,
and that
E[Z⋅1Z≥δEZ]≤EZ2⋅E1Z≥δEZ
=EZ2P[Z≥δEZ]
We apply the Paley-Zygmund inequality to the case Z=S2 and δ=1/4, and we derive
P[S2≥41]≥(43)2⋅31=163
□
Remark 1The proof of Lemma 2 works even if x∼{−1,1}n is selected according to a 4-wise independent distribution. This means that the algorithm can be derandomized in polynomial time.
Proof: (Of Lemma 3) Let us write x as a linear combination of the eigenvectors
x=a1v1+⋯+anvn
where the coefficients can be computed as ai=⟨x,vi⟩. Note that, by assumption, ∣a1∣≥.5, and that, by orthonormality of the eigenvectors, ∣∣x∣∣2=∑iai2.
We have
y=a1λ1tv1+⋯+anλntvn
and so
yTMy=i∑ai2λi2t+1
and
yTy=i∑ai2λi2t
We need to prove a lower bound to the ratio of the above two quantities. We will compute a lower bound to the numerator and an upper bound to the denominator in terms of the same parameter.
Let k be the number of eigenvalues larger than λ1⋅(1−ϵ). Then, recalling that the eigenvalues are sorted in non-increasing order, we have
yTMy≥i=1∑kai2λi2t+1≥λ1(1−ϵ)i=1∑kai2λi2t
We also see that
i=k+1∑nai2λi2t
≤λ12t⋅(1−ϵ)2ti=k+1∑nai2
≤λ12t⋅(1−ϵ)2t⋅∣∣x∣∣2
≤4a12λ12t(1−ϵ)2t∣∣x∣∣2
≤4∣∣x∣∣2(1−ϵ)2ti=1∑kai2λi2t
So we have
yTy≤(1+4∣∣x∣∣2(1−ϵ)2t)⋅i=1∑kai2
giving
yTyyTMy≥λ1⋅(1−ϵ)⋅1+4∣∣x∣∣2(1−ϵ)2t1
□
Remark 2Where did we use the assumption that M is positive semidefinite? What happens if we apply this algorithm to the adjacency matrix of a bipartite graph?
2. Approximating the Second Eigenvalue
If M is a PSD matrix, and if we know a unit-length eigenvector v1 of the largest eigenvalue of M, we can approximately find the second eigenvalue with the following adaption of the algorithm from the previous section.
If v1,…,vn is an orthonormal basis of eigenvectors for the eigenvalues λ1≥⋯≥λn of M, then, at the beginning, we pick a random vector
x=a1v1+a2v2+⋯anvn
that, with probability at least 3/16, satisfies ∣a2∣≥1/2. (Cf. Lemma 2.) Then we compute x0, which is the projection of x on the subspace orthogonal to v1, that is
x0=a2v2+⋯anvn
Note that ∣∣x∣∣2=n and that ∣∣x0∣∣2≤n.
The output is the vector xt
xt=a2λ2tv2+⋯anλntvn
If we apply Lemma 3 to subspace orthogonal to v1, we see that when ∣a2∣≥1/2 we have that, for every 0<ϵ<1,
xtTxtxtTMxt≥λ2⋅(1−ϵ)⋅4n(1−ϵ)2t1
We have thus established the following analysis.
Theorem 4For every PSD matrix M, positive integer t and parameter ϵ>0, if v1 is a length-1 eigenvector of the largest eigenvalue of M, then with probability ≥3/16 over the choice of x0, the algorithm Power2 outputs a vector xt⊥v1 such that
xtTxtxtTMxt≥λ2⋅(1−ϵ)⋅1+4n(1−ϵ)2t1
where λ2 is the second largest eigenvalue of M, counting multiplicities.
Finally, we come to the case in which M is the normalized adjacency matrix of a regular graph.
We know that M has eigenvalues 1=λ1≥⋯λn≥−1 and that n1⋅1 is an eigenvector of λ1.
Consider now the matrix M+I. Every eigenvector of M with eigenvalue λ is clearly also an eigenvector of M+I with eigenvalue 1+λ, and vice versa, thus M+I has eigenvalues 2=1+λ1≥1+λ2≥⋯≥1+λn≥0 and it is PSD.
This means that we can run algorithm Power2 on the matrix I+M using the vector v1=n11 and a parameter t=O(ϵ−1logn/ϵ)). The algorithm finds, with probability ≥3/16, a vector xt⊥1 such that