TExcelTAD
Home › Spectral Graph Theory & Modern Graph Algorithms › Expanders and the Expander Mixing Lemma

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 GG be a dd-regular graph (multigraphs and loops allowed) with adjacency eigenvalues d=μ1≥μ2≥⋯≥μnd = \mu_1 \ge \mu_2 \ge \cdots \ge \mu_n. The top eigenvalue is dd with eigenvector 1\mathbf{1}. Define

λ(G)=max⁡(∣μ2∣,∣μn∣)=max⁡x⊥1, x≠0∣xTAx∣xTx,\lambda(G) = \max(\lvert \mu_2 \rvert, \lvert \mu_n \rvert) = \max_{x \perp \mathbf{1},\ x \ne 0} \frac{\lvert x^{\mathsf{T}} A x \rvert}{x^{\mathsf{T}} x},

the largest nontrivial eigenvalue in absolute value. GG is an (n,d,λ)(n, d, \lambda)-graph; small λ/d\lambda/d means a good expander. This is a two-sided condition: a bipartite graph has μn=−d\mu_n = -d and is never a good expander in this sense, even when its conductance is large. (One-sided expansion, μ2\mu_2 small, is what Cheeger's inequality uses: λ2(L)=d−μ2\lambda_2(L) = d - \mu_2.) In normalized terms, λ/d\lambda/d is the largest nontrivial absolute eigenvalue of the walk matrix A/dA/d.

The lemma

For S,T⊆VS, T \subseteq V let e(S,T)=∣{(u,v)∈S×T:{u,v}∈E}∣=1STA 1Te(S, T) = \lvert \{(u, v) \in S \times T : \{u, v\} \in E\} \rvert = \mathbf{1}_S^{\mathsf{T}} A\, \mathbf{1}_T, counting edges inside S∩TS \cap T twice. In a random graph of the same density each of the ∣S∣∣T∣\lvert S \rvert \lvert T \rvert pairs would be an edge with probability d/nd/n.

Lemma (expander mixing lemma; Alon and Chung, 1988). For every S,T⊆VS, T \subseteq V,

∣e(S,T)−d ∣S∣∣T∣n∣≤λ∣S∣∣T∣(1−∣S∣n)(1−∣T∣n)≤λ∣S∣∣T∣.\left\lvert e(S, T) - \frac{d\,\lvert S \rvert \lvert T \rvert}{n} \right\rvert \le \lambda \sqrt{\lvert S \rvert \lvert T \rvert \Big(1 - \frac{\lvert S \rvert}{n}\Big)\Big(1 - \frac{\lvert T \rvert}{n}\Big)} \le \lambda\sqrt{\lvert S \rvert \lvert T \rvert} .

Proof. Decompose 1S=∣S∣n1+s\mathbf{1}_S = \frac{\lvert S \rvert}{n}\mathbf{1} + s and 1T=∣T∣n1+t\mathbf{1}_T = \frac{\lvert T \rvert}{n}\mathbf{1} + t with s,t⊥1s, t \perp \mathbf{1}. Since A1=d1A\mathbf{1} = d\mathbf{1} and AA preserves 1⊥\mathbf{1}^\perp, the cross terms vanish:

e(S,T)=1STA 1T=∣S∣∣T∣n2 1TA1+sTAt=d∣S∣∣T∣n+sTAt.e(S, T) = \mathbf{1}_S^{\mathsf{T}} A\, \mathbf{1}_T = \frac{\lvert S \rvert \lvert T \rvert}{n^2}\, \mathbf{1}^{\mathsf{T}} A \mathbf{1} + s^{\mathsf{T}} A t = \frac{d\lvert S \rvert \lvert T \rvert}{n} + s^{\mathsf{T}} A t .

On 1⊥\mathbf{1}^\perp, AA has eigenvalues of absolute value at most λ\lambda, so ∣sTAt∣≤λ∥s∥∥t∥\lvert s^{\mathsf{T}} A t \rvert \le \lambda \lVert s \rVert \lVert t \rVert (expand ss and tt in the eigenbasis and apply Cauchy-Schwarz). Finally ∥s∥2=∣S∣−∣S∣2n\lVert s \rVert^2 = \lvert S \rvert - \frac{\lvert S \rvert^2}{n} by Pythagoras, and likewise for tt. □\square

The error term is small relative to the main term when ∣S∣∣T∣≫(nλ/d)2\lvert S \rvert \lvert T \rvert \gg (n\lambda/d)^2: for λ=O(d)\lambda = O(\sqrt d) (as in random and Ramanujan graphs) every pair of sets of size εn\varepsilon n with d≫1/ε2d \gg 1/\varepsilon^2 spans almost exactly the "right" number of edges. A partial converse holds: Bilu and Linial (2006) showed that if ∣e(S,T)−d∣S∣∣T∣/n∣≤α∣S∣∣T∣\lvert e(S, T) - d\lvert S \rvert\lvert T \rvert/n \rvert \le \alpha\sqrt{\lvert S \rvert\lvert T \rvert} for all disjoint S,TS, T, then λ=O(α(1+log⁡(d/α)))\lambda = O(\alpha(1 + \log(d/\alpha))).

python · try it yourself
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 SS is independent, e(S,S)=0e(S, S) = 0, and the lemma with S=TS = T gives d∣S∣2n≤λ∣S∣(1−∣S∣n)\frac{d\lvert S \rvert^2}{n} \le \lambda\lvert S \rvert(1 - \frac{\lvert S \rvert}{n}), that is

α(G)≤λd+λ n,χ(G)≥nα(G)≥d+λλ.\alpha(G) \le \frac{\lambda}{d + \lambda}\, n, \qquad \chi(G) \ge \frac{n}{\alpha(G)} \ge \frac{d + \lambda}{\lambda} .

Hoffman's bound (1970) is the sharper one-sided version α(G)≤−μnd−μnn\alpha(G) \le \frac{-\mu_n}{d - \mu_n} n, which is exact for the Petersen graph: 25⋅10=4\frac{2}{5}\cdot 10 = 4.

Logarithmic diameter. For vertices u,vu, v, (Ak)uv=euTAkev≥dkn−λk(A^k)_{uv} = \mathbf{e}_u^{\mathsf{T}} A^k \mathbf{e}_v \ge \frac{d^k}{n} - \lambda^k by the same decomposition, which is positive once k>ln⁡nln⁡(d/λ)k > \frac{\ln n}{\ln(d/\lambda)}. So the diameter is at most ⌈ln⁡nln⁡(d/λ)⌉\left\lceil \frac{\ln n}{\ln(d/\lambda)} \right\rceil, logarithmic for a family with λ/d\lambda/d bounded below 1.

Edge expansion. From Cheeger's easy side, h(G)≥d−μ22h(G) \ge \frac{d - \mu_2}{2}, and the lemma gives a similar bound directly: a set with ∣S∣≤n/2\lvert S \rvert \le n/2 has ∣∂S∣=d∣S∣−e(S,S)≥(d−λ)∣S∣(1−∣S∣n)\lvert \partial S \rvert = d\lvert S \rvert - e(S, S) \ge (d - \lambda)\lvert S \rvert(1 - \frac{\lvert S \rvert}{n}).

python · try it yourself
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 λ=∣μn∣\lambda = \lvert \mu_n \rvert. The diameter bound is valid but loose: a random dd-regular graph has diameter close to log⁡d−1n\log_{d-1} n (Bollobás and Fernandez de la Vega, 1982), here about 3 to 4, while the spectral argument only uses λ\lambda.

Test yourself

For a dd-regular graph, which quantity is λ(G)\lambda(G) in the expander mixing lemma?

  1. μ2\mu_2 only
  2. max⁡(∣μ2∣,∣μn∣)\max(\lvert \mu_2 \rvert, \lvert \mu_n \rvert), the largest nontrivial adjacency eigenvalue in absolute value
  3. d−μ2d - \mu_2
  4. The smallest Laplacian eigenvalue

What does the expander mixing lemma bound?

  1. The diameter only
  2. ∣e(S,T)−d∣S∣∣T∣/n∣\lvert e(S,T) - d\lvert S \rvert \lvert T \rvert / n \rvert, by λ∣S∣∣T∣\lambda\sqrt{\lvert S \rvert \lvert T \rvert}
  3. The number of triangles
  4. λ2\lambda_2 in terms of conductance

Which bound on the independence number follows from the lemma with S=TS = T independent?

  1. α≤n/d\alpha \le n/d
  2. α≤λd+λn\alpha \le \frac{\lambda}{d + \lambda} n
  3. α≤λn\alpha \le \lambda n
  4. α≥nd+1\alpha \ge \frac{n}{d+1}

Why is a bipartite dd-regular graph never a good two-sided spectral expander?

  1. Its conductance is zero
  2. Its smallest adjacency eigenvalue is −d-d, so λ=d\lambda = d
  3. It has no cycles
  4. Its degree is not constant