TExcelTAD
Home › Spectral Graph Theory & Modern Graph Algorithms › Constructing Expanders: Random, Ramanujan and Explicit

Constructing Expanders: Random, Ramanujan and Explicit

An expander family needs constant degree dd, a growing number of vertices, and λ/d\lambda/d bounded below 1. Do such graphs exist, how good can they be, and can we write them down? The answers, in order: random graphs work (Pinsker, 1973, for a combinatorial version; Friedman, 2008, spectrally almost optimal); no family beats λ≈2d−1\lambda \approx 2\sqrt{d-1} (Alon and Boppana); and explicit families exist, from Margulis (1973) through the Ramanujan graphs of Lubotzky, Phillips and Sarnak (1988) to the combinatorial zig-zag product (Reingold, Vadhan and Wigderson, 2002). This lesson states these results and checks the numbers on small examples. Notation: a dd-regular graph has adjacency eigenvalues d=μ1≥μ2≥⋯≥μnd = \mu_1 \ge \mu_2 \ge \cdots \ge \mu_n and λ=max⁡(∣μ2∣,∣μn∣)\lambda = \max(\lvert\mu_2\rvert, \lvert\mu_n\rvert), as in the expander mixing lemma.

The limit: Alon-Boppana

Theorem (Alon-Boppana; stated by Alon, 1986, proved in this form by Nilli, 1991). Let GG be dd-regular and suppose it has two edges at distance at least 2k+22k + 2 (the distance between two edges is the smallest distance between an endpoint of one and an endpoint of the other). Then

μ2≥2d−1−2d−1−1k+1.\mu_2 \ge 2\sqrt{d-1} - \frac{2\sqrt{d-1} - 1}{k + 1} .

Any two vertices at distance DD give two edges at distance at least D−2D - 2, so a diameter of at least 2k+42k + 4 suffices. Since the diameter of a dd-regular graph on nn vertices is at least log⁡d−1n−O(1)\log_{d-1} n - O(1), this gives μ2≥2d−1−o(1)\mu_2 \ge 2\sqrt{d-1} - o(1) as n→∞n \to \infty.

Where 2d−12\sqrt{d-1} comes from. Locally, a dd-regular graph with large girth looks like the infinite dd-regular tree Td\mathbb{T}_d, and 2d−12\sqrt{d-1} is the spectral norm of the tree's adjacency operator. A test vector that decays like (d−1)−j/2(d-1)^{-j/2} at distance jj from an edge, placed far from a second copy with opposite sign, has Rayleigh quotient close to 2d−12\sqrt{d-1} and is orthogonal to 1\mathbf{1}; Courant-Fischer does the rest. The program shows the convergence on finite balls of the tree: the largest eigenvalue of the ball of radius rr in T3\mathbb{T}_3 creeps up to 22≈2.82842\sqrt 2 \approx 2.8284 but never reaches it.

python · try it yourself
import numpy as np

def tree_ball(d, r):
    """Adjacency matrix of the ball of radius r in the infinite d-regular tree."""
    edges, frontier, n = [], [0], 1
    for depth in range(r):
        new = []
        for v in frontier:
            for _ in range(d if depth == 0 else d - 1):
                edges.append((v, n)); new.append(n); n += 1
        frontier = new
    A = np.zeros((n, n))
    for u, v in edges:
        A[u, v] = A[v, u] = 1
    return A

d = 3
print(f"2 sqrt(d - 1) = {2 * np.sqrt(d - 1):.4f}")
for r in [2, 4, 6, 8]:
    A = tree_ball(d, r)
    print(f"radius {r}: {len(A):4} vertices, largest eigenvalue {float(np.linalg.eigvalsh(A)[-1]):.4f}")
2 sqrt(d - 1) = 2.8284
radius 2:   10 vertices, largest eigenvalue 2.2361
radius 4:   46 vertices, largest eigenvalue 2.5616
radius 6:  190 vertices, largest eigenvalue 2.6723
radius 8:  766 vertices, largest eigenvalue 2.7247

A graph with λ≤2d−1\lambda \le 2\sqrt{d-1} is called Ramanujan: it is spectrally as good as a large graph can be.

Random regular graphs are almost Ramanujan

Theorem (Friedman, 2008; conjectured by Alon, 1986). For fixed d≥3d \ge 3 and ε>0\varepsilon > 0, a uniformly random dd-regular graph on nn vertices has λ≤2d−1+ε\lambda \le 2\sqrt{d-1} + \varepsilon with probability 1−o(1)1 - o(1) as n→∞n \to \infty.

Friedman's proof is over 100 pages; Bordenave (2020) gave a shorter one. Earlier, Broder and Shamir (1987) proved λ=O(d3/4)\lambda = O(d^{3/4}), already enough for constant-degree expanders. The theorem holds in the permutation model used below: for even dd, take d/2d/2 independent uniform permutations σi\sigma_i and join vv to σi(v)\sigma_i(v) and σi−1(v)\sigma_i^{-1}(v), giving a dd-regular multigraph that is easy to sample.

python · try it yourself
import numpy as np

def permutation_model(n, d, rng):
    A = np.zeros((n, n))
    for _ in range(d // 2):
        p = rng.permutation(n)
        A[np.arange(n), p] += 1
        A[p, np.arange(n)] += 1
    return A

rng = np.random.default_rng(1986)
for d in [4, 8]:
    bound = 2 * np.sqrt(d - 1)
    for n in [50, 200, 500]:
        lams = []
        for _ in range(3):
            mu = np.linalg.eigvalsh(permutation_model(n, d, rng))
            lams.append(max(abs(mu[-2]), abs(mu[0])))
        print(f"d = {d}, n = {n:3}: lambda over 3 samples = {np.round(lams, 3)},  2 sqrt(d-1) = {bound:.3f}")
d = 4, n =  50: lambda over 3 samples = [3.347 3.555 3.412],  2 sqrt(d-1) = 3.464
d = 4, n = 200: lambda over 3 samples = [3.423 3.418 3.42 ],  2 sqrt(d-1) = 3.464
d = 4, n = 500: lambda over 3 samples = [3.483 3.477 3.464],  2 sqrt(d-1) = 3.464
d = 8, n =  50: lambda over 3 samples = [5.273 5.059 5.152],  2 sqrt(d-1) = 5.292
d = 8, n = 200: lambda over 3 samples = [5.245 5.259 5.21 ],  2 sqrt(d-1) = 5.292
d = 8, n = 500: lambda over 3 samples = [5.265 5.328 5.282],  2 sqrt(d-1) = 5.292

Most samples are already within a few percent of 2d−12\sqrt{d-1}, some slightly above it (the ε\varepsilon in the theorem), none far above. Random graphs are excellent expanders, but storing one costs Θ(ndlog⁡n)\Theta(nd\log n) bits, and some applications (derandomization, error-correcting codes, log-space algorithms) need graphs on 21002^{100} vertices whose neighbours can be computed from a vertex's name in polynomial time. That is what explicit constructions provide.

Explicit constructions

Margulis-Gabber-Galil. On the vertex set Zm×Zm\mathbb{Z}_m \times \mathbb{Z}_m, join (x,y)(x, y) to

(x±2y, y),(x±(2y+1), y),(x, y±2x),(x, y±(2x+1))(modm),(x \pm 2y,\ y), \quad (x \pm (2y + 1),\ y), \quad (x,\ y \pm 2x), \quad (x,\ y \pm (2x + 1)) \pmod m ,

an 8-regular multigraph on n=m2n = m^2 vertices whose neighbours are computed with a few additions. Margulis (1973) proved that a family of this kind is an expander family without an explicit bound; Gabber and Galil (1981) gave an elementary Fourier-analytic proof with λ≤52≈7.07<8\lambda \le 5\sqrt 2 \approx 7.07 < 8 for this form (as presented in the survey of Hoory, Linial and Wigderson, 2006).

python · try it yourself
import numpy as np

def mgg(m):
    n = m * m
    A = np.zeros((n, n))
    idx = lambda x, y: (x % m) * m + (y % m)
    for x in range(m):
        for y in range(m):
            v = idx(x, y)
            for u in (idx(x + 2 * y, y), idx(x - 2 * y, y), idx(x + 2 * y + 1, y), idx(x - 2 * y - 1, y),
                      idx(x, y + 2 * x), idx(x, y - 2 * x), idx(x, y + 2 * x + 1), idx(x, y - 2 * x - 1)):
                A[v, u] += 1
    return A

for m in [5, 8, 11, 15, 20]:
    A = mgg(m)
    mu = np.linalg.eigvalsh((A + A.T) / 2)
    print(f"m = {m:2}, n = {m * m:3}: degree {int(A.sum(axis=1)[0])}, symmetric: {bool(np.array_equal(A, A.T))}, "
          f"lambda = {float(max(abs(mu[-2]), abs(mu[0]))):.4f}  (5 sqrt 2 = {5 * np.sqrt(2):.4f}, 2 sqrt 7 = {2 * np.sqrt(7):.4f})")
m =  5, n =  25: degree 8, symmetric: True, lambda = 5.3254  (5 sqrt 2 = 7.0711, 2 sqrt 7 = 5.2915)
m =  8, n =  64: degree 8, symmetric: True, lambda = 5.6231  (5 sqrt 2 = 7.0711, 2 sqrt 7 = 5.2915)
m = 11, n = 121: degree 8, symmetric: True, lambda = 5.9120  (5 sqrt 2 = 7.0711, 2 sqrt 7 = 5.2915)
m = 15, n = 225: degree 8, symmetric: True, lambda = 6.0532  (5 sqrt 2 = 7.0711, 2 sqrt 7 = 5.2915)
m = 20, n = 400: degree 8, symmetric: True, lambda = 6.1446  (5 sqrt 2 = 7.0711, 2 sqrt 7 = 5.2915)

The adjacency is symmetric because each map's inverse is in the list (x↦x+2yx \mapsto x + 2y is undone by x↦x−2yx \mapsto x - 2y, and x+2y+1x + 2y + 1 by x−2y−1x - 2y - 1). The bound 525\sqrt 2 holds with room to spare, but the graphs are not Ramanujan: λ\lambda is above 27≈5.292\sqrt 7 \approx 5.29, and further above it as mm grows.

Ramanujan graphs. Lubotzky, Phillips and Sarnak (1988) and independently Margulis (1988) constructed (p+1)(p + 1)-regular Ramanujan graphs for every prime p≡1(mod4)p \equiv 1 \pmod 4, as Cayley graphs of PSL(2,Zq)PSL(2, \mathbb{Z}_q) or PGL(2,Zq)PGL(2, \mathbb{Z}_q); the proof that λ≤2p\lambda \le 2\sqrt p uses Deligne's proof of the Ramanujan conjecture, which gives the graphs their name. Morgenstern (1994) extended this to degrees q+1q + 1 for prime powers qq. For other degrees, existence was settled by Marcus, Spielman and Srivastava (2015): for every d≥3d \ge 3 there are infinitely many dd-regular bipartite Ramanujan graphs (all eigenvalues other than ±d\pm d lie in [−2d−1,2d−1][-2\sqrt{d-1}, 2\sqrt{d-1}]), via the method of interlacing families applied to random signings of a 2-lift (Bilu and Linial's conjecture). Cohen (2016) made this a polynomial-time construction. Whether non-bipartite Ramanujan graphs exist for every degree is still open.

The zig-zag product. Reingold, Vadhan and Wigderson (2002) found a combinatorial route. Write λˉ=λ/d\bar\lambda = \lambda/d for the normalized second eigenvalue. If GG is DD-regular on NN vertices with λˉ(G)≤α\bar\lambda(G) \le \alpha and HH is dd-regular on DD vertices with λˉ(H)≤β\bar\lambda(H) \le \beta, the zig-zag product G (z) HG \text{ (z) } H replaces each vertex of GG by a copy of HH and has NDND vertices, degree d2d^2, and

λˉ(G (z) H)≤α+β+β2.\bar\lambda(G \text{ (z) } H) \le \alpha + \beta + \beta^2 .

Degree depends only on the small graph HH, while expansion degrades by an additive amount. Alternating zig-zag with squaring (λˉ(G2)=λˉ(G)2\bar\lambda(G^2) = \bar\lambda(G)^2, degree D2D^2) keeps the degree constant and the expansion bounded while the size grows: a fully explicit expander family from one constant-size seed graph. Reingold (2008) used the same product to prove that undirected ss-tt connectivity is in logarithmic space (SL = L).

Summary

Construction Degree λ\lambda Explicit?
random dd-regular (Friedman 2008) any d≥3d \ge 3 ≤2d−1+ε\le 2\sqrt{d-1} + \varepsilon w.h.p. no
Margulis-Gabber-Galil (1973, 1981) 8 ≤52\le 5\sqrt 2 yes, neighbours by arithmetic
LPS / Margulis (1988), Morgenstern (1994) q+1q + 1, qq a prime (power) ≤2d−1\le 2\sqrt{d-1} (Ramanujan) yes
Marcus-Spielman-Srivastava (2015) any d≥3d \ge 3 bipartite Ramanujan existence; polynomial-time by Cohen (2016)
zig-zag (Reingold-Vadhan-Wigderson 2002) constant λˉ<1\bar\lambda < 1 bounded yes, combinatorial
any family (Alon-Boppana) dd ≥2d−1−o(1)\ge 2\sqrt{d-1} - o(1) lower bound

Test yourself

What does the Alon-Boppana bound say about large dd-regular graphs?

  1. μ2≤2d−1\mu_2 \le 2\sqrt{d-1} always
  2. μ2≥2d−1−o(1)\mu_2 \ge 2\sqrt{d-1} - o(1) as n→∞n \to \infty
  3. λ=d\lambda = d for all large graphs
  4. μ2≥d/2\mu_2 \ge d/2

What is a Ramanujan graph?

  1. A graph with λ=0\lambda = 0
  2. A dd-regular graph with all nontrivial eigenvalues of absolute value at most 2d−12\sqrt{d-1}
  3. A Cayley graph of a cyclic group
  4. Any bipartite graph

Which statement about random dd-regular graphs did Friedman prove?

  1. They are disconnected with high probability
  2. For fixed d≥3d \ge 3 and ε>0\varepsilon > 0, λ≤2d−1+ε\lambda \le 2\sqrt{d-1} + \varepsilon with probability 1−o(1)1 - o(1)
  3. They are exactly Ramanujan
  4. They have λ=O(d3/4)\lambda = O(d^{3/4}) only

How does the zig-zag product change the normalized second eigenvalue and the degree?

  1. Degree DdD d, λˉ≤αβ\bar\lambda \le \alpha\beta
  2. Degree d2d^2, λˉ≤α+β+β2\bar\lambda \le \alpha + \beta + \beta^2
  3. Degree D2D^2, λˉ≤α2\bar\lambda \le \alpha^2
  4. Degree dd, λˉ\bar\lambda unchanged