Skip to Content
Chapter 9

Expander graphs: Manufactured randomness

Tomas Reimers 11 minute read

In 1975, Leslie Valiant had a promising plan for proving circuit lower bounds. Certain problems seemed to require circuits whose wiring must route many signals through few wires — and if one could show that such “superconcentrator” networks need super-linearly many edges, lower bounds would follow for concrete problems. The plan died in the most instructive way possible: Valiant himself proved superconcentrators with linearly many edges exist , building them from a gadget that Soviet mathematicians (Pinsker, and Margulis with the first explicit construction) had just introduced: graphs that are simultaneously sparse and impossible to choke. The lower-bound strategy was dead — connectivity, it turns out, is nearly free. But the gadget escaped the crime scene and infiltrated everything: Chapter 8’s hard formulas are built on it, a whole family of error-correcting codes is built from it, and the strongest known strengthening of Cook–Levin is proven by it (the PCP theorem, this chapter’s finale). This chapter is about that gadget, because you cannot read the literature around P vs NP (and you could not referee a claimed resolution) without recognizing expander graphs on sight.

Three steps:

  1. What expansion is — sparse graphs with no cheap cuts, seen three equivalent ways (cuts, eigenvalues, random walks), with each measured live on a real pair of graphs.
  2. The existence paradox — random graphs are excellent expanders and explicit ones took number theory: Chapter 7’s “hay everywhere, no straw nameable” problem again, except here it got solved.
  3. The payoffs — the three appearances that matter for this book: hard proof-complexity instances, cheap derandomization, and the PCP theorem, which turns “approximately solving SAT” back into the full P vs NP question.

Sparse, but unchokeable

Take 32 nodes in a ring: every node has 2 neighbors, and the graph hangs together by threads — cut any 2 edges and a whole arc falls off. Now add just one more edge per node: a random perfect matching across the ring. Degree 3 instead of 2 (still as sparse as graphs meaningfully get) but try to sever 16 nodes from the rest:

cycle: 2 edges cutexpander: 12 edges cut
solid nodes = the set S being separated · heavy edges = the boundary
Cut each graph into its best-case halves (16 nodes each, dashed line) and count the edges you must sever — they're highlighted. The cycle: 2 edges; whole halves hang by threads. The expander: 12 edges (2 cycle + 10 matching chords, counted from the actual graph). "No cheap cuts anywhere" is the definition of expansion — and it's exactly the property Chapter 8's hard Tseitin formulas require.

The counts in that figure are measured on the actual graphs: halving the cycle costs 2 edges; halving the cycle-plus-matching costs 12 — and every way of cutting it is comparably expensive, not just the one drawn. That’s edge expansion: a graph is an expander if every subset SS (up to half the nodes) has boundary proportional to its size,

∣∂S∣  ≥  h⋅∣S∣\tip{edges leaving the set S}{|\partial S|} \;\ge\; \tip{the expansion constant of the graph}{h} \cdot \tip{the number of nodes inside S}{|S|}

with hh bounded away from zero — across a whole family of ever-larger graphs — while the degree stays constant. Sparse like a cycle, connected like a clique — supposedly you can’t have both, and this graph does.

The same property wears two other uniforms, and all three show up in applications. Spectral: order the adjacency matrix’s eigenvalues. The gap between the first and second (λ1−λ2\lambda_1 - \lambda_2, the spectral gap) is, by Cheeger’s inequality , a two-sided proxy for expansion: our matching graph has gap ≈ 0.12 after normalizing by the degree (computed numerically), while the cycle’s vanishes as 1/n21/n^2. Probabilistic: drop a token on one node and let it walk randomly. On the cycle, position diffuses — after tt steps you’ve strayed only ∼t\sim\sqrt{t}; mixing takes Θ(n2)\Theta(n^2) steps. On an expander, every step forgets a constant fraction of the past, and the walk is indistinguishable from uniform in O(log⁡n)O(\log n) steps. Watch both live:

steps:
cycledistance from uniform: 0.704cycle + random matchingdistance from uniform: 0.404
A lazy random walk from one starting node, computed live. Left: the 32-cycle (2-regular) — probability oozes around the rim, still far from uniform after 64 steps (distance 0.347). Right: add one fixed random perfect matching (3-regular, chords shown) and the walk is nearly perfectly mixed by 64 steps (distance 0.011). One extra edge per node, exponentially faster mixing: that's the spectral gap working.

After 64 steps (computed in the figure, not stylized): the cycle’s walk still sits at total-variation distance 0.347 from uniform (total variation: the largest gap, over any set of nodes, between the walk’s probability of being there and uniform’s) (you can basically still see where it started) while the expander’s is at 0.011. One extra edge per node. The field’s slogan: an expander walk is a cheap substitute for independent randomness — step t+1t+1 costs only log⁡2d≈1.6\log_2 d \approx 1.6 fresh random bits (dd the degree, 3 here: picking one of dd neighbors uniformly), yet the sequence of visited nodes behaves, for many purposes, like fully independent samples.

The existence paradox, resolved for once

How do you get an expander? The 1973 answer (Pinsker) is Chapter 7’s counting argument wearing graph clothing: a random dd-regular graph (every node exactly dd neighbors) is, with overwhelming probability, a near-optimal expander. Randomness manufactures expansion for free — but unverifiably and unnameably, the haystack problem verbatim: to use an expander inside a theorem, a code, or a hard formula, you need a specific, deterministic, certified one.

Unlike the circuit version of this problem — still open: Chapter 7’s scoreboard has no explicit function provably needing even 4n4n gates — this one got solved, three times, each solution a landmark:

  • Margulis 1973 : the first explicit family, via group representation theory — a fixed algebraic rule (“connect (x,y)(x,y) to (x±2y,y)(x \pm 2y, y)…” on a torus) provably expands.
  • Ramanujan graphs  (Lubotzky–Phillips–Sarnak, Margulis; 1988): explicit graphs with the optimal spectral gap (matching the bound random graphs approach) built from quaternion arithmetic, with the proof leaning on Ramanujan’s conjecture from number theory. Deterministic constructions don’t just approximate randomness here; they match the best that random graphs achieve, with a certificate.
  • Zig-zag products  (Reingold–Vadhan–Wigderson, 2000): expanders by recursive combination of small ones (no number theory, just a composition lemma) which mattered because the technique exported: five years later Reingold used it to settle a complexity question directly (below).

This progression (property held by almost all objects, then held explicitly) is called derandomization, and expanders are its clearest success. The program’s thesis is that whatever randomness can do, determinism can simulate: pseudorandomness is real and constructible. Chapter 12 will reveal the dark twin of that thesis — pseudorandomness strong enough to fool all small circuits is precisely the thing that blocks every known route to proving P ≠ NP. The same concept funds both armies in this war.

Three payoffs

1. The hard formulas of Chapter 8. Urquhart’s exponentially-resolution-hard Tseitin formulas put one Boolean variable on every edge of a graph and a 0/1 “charge” on every node, then demand, node by node, that the incident edge variables XOR to the node’s charge. Sum every node’s demand and each edge is counted twice (once per endpoint, so the total is always even) which makes odd total charge a contradiction:

e₁e₂e₃e₄e₅e₆e₇e₈10000
node constraints: e₁⊕e₂⊕e₃ = 1 (the charged node) · e₁⊕e₄⊕e₅ = 0 · e₂⊕e₆⊕e₈ = 0 · e₃⊕e₄⊕e₆⊕e₇ = 0 · e₅⊕e₇⊕e₈ = 0 — each a handful of CNF clauses
A Tseitin formula: one Boolean variable per edge, and each node demands its incident edges XOR to its charge (shown inside the node). Total charge here is 1 — odd — so the formula is unsatisfiable: summing all constraints counts every edge twice (always even) yet must equal the odd total. For resolution to need exponential size on these, the graph must be an expander: no small cut can quarantine the contradiction (Urquhart 1987).

The contradiction is global — spread over the whole graph, detectable only by summing every node’s constraint. Resolution can only chip at it piece by piece, and the Ben-Sasson–Wigderson width machinery makes the consequence precise. Track, for each clause a refutation derives, how many of the formula’s node-constraints it depends on: the axioms start at one, the final empty clause ⊥ depends on all of them, and a resolution step’s output depends on at most what its two parents did — so the measure at most doubles per step, and somewhere mid-proof a clause depends on a medium-sized set of nodes.

By expansion, a medium set of nodes has many boundary edges, and each boundary edge’s variable is forced to appear in that clause: the edge’s two endpoint constraints sit on opposite sides of the dependency split, so flipping that one variable changes what the depended-on side can satisfy — a clause silent about the variable couldn’t register a difference it provably depends on. Medium dependency means wide clause, and wide everywhere means, by Chapter 8’s short-proofs-are-narrow theorem, exponentially long. A poorly connected graph, by contrast, has cheap cuts that let resolution quarantine and kill the contradiction locally. The hardness is the expansion. This is the book’s clearest specimen of a pattern now three chapters old (Chapter 5’s decision diagrams forced to remember multiplication’s carries across a cut, Chapter 8’s pigeonhole refutations forced wide, and here): nearly every lower bound in this book works by forcing information across a bottleneck and proving the bottleneck wide. Expanders are how you build the wide bottleneck on purpose. (And notice the question hiding underneath: every solver trick in Part II exploited some non-randomness — polarity skew, locality, modules, thin implication chains — and expansion is the statement that there is none to exploit. Whether exploitable structure nonetheless hides inside every expander-draped formula is, more or less, P vs NP restated as geometry.)

2. Randomness recycling. Chapter 1 parked the claim that randomized algorithms likely add no fundamental power (P = BPP, conjecturally); expanders are a main engine of the evidence. The flagship primitive: amplification. A randomized algorithm with error ⅓ using rr random bits, repeated kk times independently with a majority vote over the runs, costs krkr bits for error 2−Θ(k)2^{-\Theta(k)}. Instead, take one random rr-bit seed and a O(k)O(k)-step expander walk over the space of seeds (explicit constructions compute a node’s neighbors on the fly, so the 2r2^r-node graph never has to exist — exactly why explicitness mattered above), running the algorithm at each node visited and taking the same majority: error still 2−Θ(k)2^{-\Theta(k)}, cost r+O(k)r + O(k) bits — the walk’s samples are random enough, by the mixing you watched above. This line of work peaks with Reingold’s 2005 result  that undirected maze-solving needs only O(log⁡n)O(\log n) memory (SL = L: “symmetric log-space” collapses into plain log-space): his algorithm uses zig-zag products to convert any maze into an expander while walking it, so that fast mixing becomes a replacement for remembering where you’ve been.

3. Cook–Levin, the director’s cut. The PCP theorem — probabilistically checkable proofs; Arora–Lund–Motwani–Safra–Sudan–Szegedy, 1992 — says every NP statement has a proof format in which a verifier, reading a constant number of randomly chosen bits (three, in the strongest versions) catches any false claim with constant probability. (Compare Chapter 2’s verifier, which read the whole certificate.) Proofs, in other words, can be made locally testable: error anywhere becomes error almost everywhere. If that sounds like an expander property — local probes detecting global inconsistency, the Tseitin story inverted into a feature — it is, and in Irit Dinur’s 2006 proof  (now the standard one) expanders carry the construction: the proof is repeatedly “powered” along expander walks, amplifying any inconsistency’s visibility at each round, and an inner layer of error-correcting codes shrinks the proof’s alphabet back down after each round.

The PCP theorem is exactly equivalent to the statement that approximation is NP-hard — a PCP for SAT is a reduction producing formulas either fully satisfiable or far from it (gap instances), so distinguishing “satisfiable” from “can’t satisfy 99%” is as hard as SAT itself (the hidden step: each of the verifier’s possible 3-bit checks becomes a clause — a true claim satisfies all of them, a false one breaks a constant fraction). Sharpest form, for MAX-3SAT — satisfy as many 3-clauses as you can (Håstad 2001 ): a random assignment satisfies ⅞ of 3-clauses on average (a 3-literal OR is false on exactly 1 of the 8 assignments to its variables) — and doing any constant better than that trivial ⅞, on satisfiable instances, is already NP-hard. Remember Chapter 2’s consolation menu for the NP-stuck engineer — “approximate instead”? For MAX-3SAT the menu has a printed floor, and the floor is Cook–Levin’s theorem wearing armor. P vs NP was never just about exact answers.

The battlefield is circuits (7); the war has real victories on restricted fronts — parity, monotone circuits, resolution, cutting planes (7, 8) — and the victories share an identifiable engine: find the bottleneck, prove it wide, with expanders as the certified-width construction kit (5, 8, 9). Circa 1990, a reasonable observer (and most of the field) expected this engine, suitably industrialized, to grind forward through ACC⁰ and TC⁰, Chapter 7’s next circuit classes, and onward to P/poly and the main theorem. That engine deserves its true name before we learn why the observer was wrong. The next chapter isolates that engine (communication: the mathematics of what must cross a cut, with the computation on both sides handed out for free). It runs the engine through everything this part has proven, then takes it to its summit: an exact identity converting circuit depth into a two-player conversation, carrying the most concrete live plan anyone has for separating famous classes. Then Part IV, and the theorems that explain the stall.

Further reading

Last updated on