Expanders and the Expander Mixing Lemma
Cheeger's inequality says a large spectral gap forces every cut to be large. For regular graphs with all nontrivial adjacency eigenvalues small in absolute value, much more is true: between any two vertex sets the number of edges is close to what a random graph of the same density would have. This is the expander mixing lemma. It makes "spectral expanders behave like random graphs" precise, and it is the tool behind most applications of expanders in algorithms and complexity: bounds on independent sets and chromatic numbers, logarithmic diameter, and the pseudorandom walks of Walks on Expanders.
Spectral expanders
Let be a -regular graph (multigraphs and loops allowed) with adjacency eigenvalues . The top eigenvalue is with eigenvector . Define
the largest nontrivial eigenvalue in absolute value. is an -graph; small means a good expander. This is a two-sided condition: a bipartite graph has and is never a good expander in this sense, even when its conductance is large. (One-sided expansion, small, is what Cheeger's inequality uses: .) In normalized terms, is the largest nontrivial absolute eigenvalue of the walk matrix .
The lemma
For let , counting edges inside twice. In a random graph of the same density each of the pairs would be an edge with probability .
Lemma (expander mixing lemma; Alon and Chung, 1988). For every ,
Proof. Decompose and with . Since and preserves , the cross terms vanish:
On , has eigenvalues of absolute value at most , so (expand and in the eigenbasis and apply Cauchy-Schwarz). Finally by Pythagoras, and likewise for .
The error term is small relative to the main term when : for (as in random and Ramanujan graphs) every pair of sets of size with spans almost exactly the "right" number of edges. A partial converse holds: Bilu and Linial (2006) showed that if for all disjoint , then .
import numpy as np
def random_regular(n, half_d, seed):
"""Random 2*half_d-regular multigraph: the union of half_d random permutations and their inverses."""
rng = np.random.default_rng(seed)
A = np.zeros((n, n))
for _ in range(half_d):
p = rng.permutation(n)
A[np.arange(n), p] += 1
A[p, np.arange(n)] += 1
return A
n, d = 80, 6
A = random_regular(n, d // 2, seed=4)
mu = np.sort(np.linalg.eigvalsh(A))[::-1]
lam = max(abs(mu[1]), abs(mu[-1]))
print(f"n = {n}, d = {d}: mu_1 = {float(mu[0]):.4f}, mu_2 = {float(mu[1]):.4f}, mu_n = {float(mu[-1]):.4f}, "
f"lambda = {float(lam):.4f}, 2 sqrt(d-1) = {2 * np.sqrt(d - 1):.4f}")
rng = np.random.default_rng(1)
worst = 0.0
for trial in range(5000):
a, b = rng.integers(1, n, size=2)
S = rng.choice(n, size=a, replace=False)
T = rng.choice(n, size=b, replace=False)
eST = A[np.ix_(S, T)].sum()
err = abs(eST - d * a * b / n)
bound = lam * np.sqrt(a * b * (1 - a / n) * (1 - b / n))
worst = max(worst, float(err / bound))
print(f"largest |e(S,T) - d|S||T|/n| / bound over 5000 random pairs: {worst:.4f} (the lemma says <= 1)")
# the bound is attained: S = T = the positive support of an eigenvector of mu_2 is a natural adversary
vals, vecs = np.linalg.eigh(A)
v2 = vecs[:, -2]
v2 = v2 if v2[np.flatnonzero(np.abs(v2) > 1e-9)[0]] > 0 else -v2 # fix the sign
S = np.flatnonzero(v2 > 0)
eSS = A[np.ix_(S, S)].sum()
print(f"S = positive part of the mu_2 eigenvector, |S| = {len(S)}: e(S,S) = {eSS:.0f}, "
f"random-graph value {d * len(S) ** 2 / n:.1f}, ratio to bound "
f"{abs(eSS - d * len(S) ** 2 / n) / (lam * len(S) * (1 - len(S) / n)):.4f}")n = 80, d = 6: mu_1 = 6.0000, mu_2 = 4.3315, mu_n = -4.1539, lambda = 4.3315, 2 sqrt(d-1) = 4.4721
largest |e(S,T) - d|S||T|/n| / bound over 5000 random pairs: 0.2669 (the lemma says <= 1)
S = positive part of the mu_2 eigenvector, |S| = 40: e(S,S) = 188, random-graph value 120.0, ratio to bound 0.7849
Random pairs of sets stay well inside the bound, while a set built from the second eigenvector comes much closer to it: eigenvectors are where the "non-randomness" of a graph lives.
Consequences
Independent sets (Hoffman-type bound). If is independent, , and the lemma with gives , that is
Hoffman's bound (1970) is the sharper one-sided version , which is exact for the Petersen graph: .
Logarithmic diameter. For vertices , by the same decomposition, which is positive once . So the diameter is at most , logarithmic for a family with bounded below 1.
Edge expansion. From Cheeger's easy side, , and the lemma gives a similar bound directly: a set with has .
import itertools
import numpy as np
from collections import deque
# Petersen graph: Hoffman's bound is attained
edges = [(i, (i + 1) % 5) for i in range(5)] + [(5 + i, 5 + (i + 2) % 5) for i in range(5)] + [(i, i + 5) for i in range(5)]
A = np.zeros((10, 10))
for u, v in edges:
A[u, v] = A[v, u] = 1
mu = np.sort(np.linalg.eigvalsh(A))[::-1]
d, lam = 3, max(abs(mu[1]), abs(mu[-1]))
alpha = max(len(S) for r in range(11) for S in itertools.combinations(range(10), r)
if all(not A[u, v] for u, v in itertools.combinations(S, 2)))
print(f"Petersen: alpha = {alpha}, Hoffman bound {float(-mu[-1] / (d - mu[-1]) * 10):.4f}, "
f"mixing-lemma bound {float(lam / (d + lam) * 10):.4f}")
# diameter of random regular multigraphs against ceil(ln n / ln(d / lambda))
def random_regular(n, half_d, seed):
rng = np.random.default_rng(seed)
A = np.zeros((n, n))
for _ in range(half_d):
p = rng.permutation(n)
A[np.arange(n), p] += 1
A[p, np.arange(n)] += 1
return A
def diameter(A):
n = len(A)
nbrs = [np.flatnonzero(A[v]) for v in range(n)]
best = 0
for s in range(n):
dist = [-1] * n; dist[s] = 0; q = deque([s])
while q:
u = q.popleft()
for v in nbrs[u]:
if dist[v] < 0:
dist[v] = dist[u] + 1; q.append(v)
best = max(best, max(dist))
return best
for n, d in [(200, 8), (400, 10)]:
A = random_regular(n, d // 2, seed=n)
mu = np.sort(np.linalg.eigvalsh(A))[::-1]
lam = max(abs(mu[1]), abs(mu[-1]))
print(f"n = {n}, d = {d}: lambda = {float(lam):.3f}, diameter {diameter(A)}, "
f"bound ceil(ln n / ln(d/lambda)) = {int(np.ceil(np.log(n) / np.log(d / lam)))}")Petersen: alpha = 4, Hoffman bound 4.0000, mixing-lemma bound 4.0000
n = 200, d = 8: lambda = 5.331, diameter 4, bound ceil(ln n / ln(d/lambda)) = 14
n = 400, d = 10: lambda = 6.008, diameter 4, bound ceil(ln n / ln(d/lambda)) = 12
Hoffman's bound and the mixing-lemma bound coincide for the Petersen graph because there . The diameter bound is valid but loose: a random -regular graph has diameter close to (Bollobás and Fernandez de la Vega, 1982), here about 3 to 4, while the spectral argument only uses .
Test yourself
For a -regular graph, which quantity is in the expander mixing lemma?
- only
- , the largest nontrivial adjacency eigenvalue in absolute value
- The smallest Laplacian eigenvalue
What does the expander mixing lemma bound?
- The diameter only
- , by
- The number of triangles
- in terms of conductance
Which bound on the independence number follows from the lemma with independent?
Why is a bipartite -regular graph never a good two-sided spectral expander?
- Its conductance is zero
- Its smallest adjacency eigenvalue is , so
- It has no cycles
- Its degree is not constant