Constructing Expanders: Random, Ramanujan and Explicit
An expander family needs constant degree , a growing number of vertices, and 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 (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 -regular graph has adjacency eigenvalues and , 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 be -regular and suppose it has two edges at distance at least (the distance between two edges is the smallest distance between an endpoint of one and an endpoint of the other). Then
Any two vertices at distance give two edges at distance at least , so a diameter of at least suffices. Since the diameter of a -regular graph on vertices is at least , this gives as .
Where comes from. Locally, a -regular graph with large girth looks like the infinite -regular tree , and is the spectral norm of the tree's adjacency operator. A test vector that decays like at distance from an edge, placed far from a second copy with opposite sign, has Rayleigh quotient close to and is orthogonal to ; Courant-Fischer does the rest. The program shows the convergence on finite balls of the tree: the largest eigenvalue of the ball of radius in creeps up to but never reaches it.
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 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 and , a uniformly random -regular graph on vertices has with probability as .
Friedman's proof is over 100 pages; Bordenave (2020) gave a shorter one. Earlier, Broder and Shamir (1987) proved , already enough for constant-degree expanders. The theorem holds in the permutation model used below: for even , take independent uniform permutations and join to and , giving a -regular multigraph that is easy to sample.
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 , some slightly above it (the in the theorem), none far above. Random graphs are excellent expanders, but storing one costs bits, and some applications (derandomization, error-correcting codes, log-space algorithms) need graphs on 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 , join to
an 8-regular multigraph on 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 for this form (as presented in the survey of Hoory, Linial and Wigderson, 2006).
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 ( is undone by , and by ). The bound holds with room to spare, but the graphs are not Ramanujan: is above , and further above it as grows.
Ramanujan graphs. Lubotzky, Phillips and Sarnak (1988) and independently Margulis (1988) constructed -regular Ramanujan graphs for every prime , as Cayley graphs of or ; the proof that uses Deligne's proof of the Ramanujan conjecture, which gives the graphs their name. Morgenstern (1994) extended this to degrees for prime powers . For other degrees, existence was settled by Marcus, Spielman and Srivastava (2015): for every there are infinitely many -regular bipartite Ramanujan graphs (all eigenvalues other than lie in ), 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 for the normalized second eigenvalue. If is -regular on vertices with and is -regular on vertices with , the zig-zag product replaces each vertex of by a copy of and has vertices, degree , and
Degree depends only on the small graph , while expansion degrades by an additive amount. Alternating zig-zag with squaring (, degree ) 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 - connectivity is in logarithmic space (SL = L).
Summary
| Construction | Degree | Explicit? | |
|---|---|---|---|
| random -regular (Friedman 2008) | any | w.h.p. | no |
| Margulis-Gabber-Galil (1973, 1981) | 8 | yes, neighbours by arithmetic | |
| LPS / Margulis (1988), Morgenstern (1994) | , a prime (power) | (Ramanujan) | yes |
| Marcus-Spielman-Srivastava (2015) | any | bipartite Ramanujan | existence; polynomial-time by Cohen (2016) |
| zig-zag (Reingold-Vadhan-Wigderson 2002) | constant | bounded | yes, combinatorial |
| any family (Alon-Boppana) | lower bound |
Test yourself
What does the Alon-Boppana bound say about large -regular graphs?
- always
- as
- for all large graphs
What is a Ramanujan graph?
- A graph with
- A -regular graph with all nontrivial eigenvalues of absolute value at most
- A Cayley graph of a cyclic group
- Any bipartite graph
Which statement about random -regular graphs did Friedman prove?
- They are disconnected with high probability
- For fixed and , with probability
- They are exactly Ramanujan
- They have only
How does the zig-zag product change the normalized second eigenvalue and the degree?
- Degree ,
- Degree ,
- Degree ,
- Degree , unchanged