TExcelTAD
Home › Spectral Graph Theory & Modern Graph Algorithms › Edge Expansion and Conductance

Edge Expansion and Conductance

A graph is "well connected" if every set of vertices has many edges leaving it, relative to its size. Two numbers make this precise. Edge expansion measures the boundary against the number of vertices, conductance against the number of edge endpoints (the volume). They are the combinatorial quantities that Cheeger's inequality ties to λ2\lambda_2, and graphs where they stay bounded away from 0 are expanders. Conductance and the Cheeger Bound met conductance for Markov chains; this lesson sets up the graph version used for the rest of the course and fixes its normalization.

Definitions

Let G=(V,E,w)G = (V, E, w) be a weighted graph, S⊆VS \subseteq V, and S‾=V∖S\overline S = V \setminus S. Write

∂S={{u,v}∈E:u∈S, v∉S},w(∂S)=∑e∈∂Swe,vol⁡(S)=∑v∈Sdv.\partial S = \{\{u, v\} \in E : u \in S,\ v \notin S\}, \qquad w(\partial S) = \sum_{e \in \partial S} w_e, \qquad \operatorname{vol}(S) = \sum_{v \in S} d_v .

Edge expansion (also the isoperimetric number, or Cheeger constant of the graph):

h(S)=w(∂S)∣S∣,h(G)=min⁡0<∣S∣≤n/2h(S).h(S) = \frac{w(\partial S)}{\lvert S \rvert}, \qquad h(G) = \min_{0 < \lvert S \rvert \le n/2} h(S).

Conductance (the normalization used in this course):

ϕ(S)=w(∂S)min⁡(vol⁡(S),vol⁡(S‾)),ϕ(G)=min⁡∅≠S⊊Vϕ(S).\phi(S) = \frac{w(\partial S)}{\min(\operatorname{vol}(S), \operatorname{vol}(\overline S))}, \qquad \phi(G) = \min_{\emptyset \ne S \subsetneq V} \phi(S).

vol⁡(S)+vol⁡(S‾)=2m\operatorname{vol}(S) + \operatorname{vol}(\overline S) = 2m (with weights, ∑vdv\sum_v d_v), so the minimum in the denominator picks the side with at most half the volume, and 0≤ϕ(G)≤10 \le \phi(G) \le 1. Conductance is the natural measure for the normalized Laplacian and the random walk: ϕ(S)\phi(S) is the probability that one step of the walk started from the stationary distribution restricted to SS (the smaller side) leaves SS.

Relations.

  • For a dd-regular graph vol⁡(S)=d∣S∣\operatorname{vol}(S) = d\lvert S \rvert, so ϕ(G)=h(G)/d\phi(G) = h(G)/d.
  • The lazy-walk conductance Φ∗\Phi_* of the randomized-algorithms course equals ϕ(G)/2\phi(G)/2: laziness halves every transition probability.
  • Shi and Malik's normalized cut Ncut⁡(S)=w(∂S)vol⁡(S)+w(∂S)vol⁡(S‾)\operatorname{Ncut}(S) = \frac{w(\partial S)}{\operatorname{vol}(S)} + \frac{w(\partial S)}{\operatorname{vol}(\overline S)} satisfies ϕ(S)≤Ncut⁡(S)≤2ϕ(S)\phi(S) \le \operatorname{Ncut}(S) \le 2\phi(S), so minimizing either is the same problem up to a factor 2.
  • Sparsity w(∂S)∣S∣∣S‾∣\frac{w(\partial S)}{\lvert S \rvert \lvert \overline S \rvert} is h(S)h(S) divided by ∣S‾∣∈[n/2,n]\lvert \overline S \rvert \in [n/2, n], so it is within a factor 2 of h(S)/nh(S)/n.

Computing conductance is hard

Computing ϕ(G)\phi(G) or h(G)h(G) exactly is NP-hard (it contains the minimum bisection-type problems; see Matula and Shahrokhi, 1990, for sparsest cut). The best polynomial-time approximations are O(log⁡n)O(\log n) by multicommodity flows (Leighton and Rao, 1988, 1999) and O(log⁡n)O(\sqrt{\log n}) by semidefinite programming (Arora, Rao and Vazirani, 2004). Spectral methods give something different: not a constant or logarithmic factor, but a square-root guarantee ϕ≤2λ2\phi \le \sqrt{2\lambda_2} that is excellent when ϕ\phi is large (expanders) and weak when it is tiny, computed in nearly linear time. For small graphs we can simply try every subset.

python · try it yourself
import numpy as np

def all_cut_stats(n, edges):
    """phi(G) and h(G) by trying all 2^n - 2 proper subsets (vectorized over subsets)."""
    masks = np.arange(1, 2 ** n - 1)
    S = ((masks[:, None] >> np.arange(n)) & 1).astype(bool)
    deg = np.zeros(n)
    for u, v in edges:
        deg[u] += 1; deg[v] += 1
    cut = np.zeros(len(masks))
    for u, v in edges:
        cut += S[:, u] != S[:, v]
    vol = S @ deg
    size = S.sum(axis=1)
    phi = cut / np.minimum(vol, deg.sum() - vol)
    h = np.where(size <= n / 2, cut / size, np.inf)
    return float(phi.min()), float(h.min())

graphs = {
    "path P_12": (12, [(i, i + 1) for i in range(11)]),
    "cycle C_12": (12, [(i, (i + 1) % 12) for i in range(12)]),
    "complete K_8": (8, [(i, j) for i in range(8) for j in range(i + 1, 8)]),
    "hypercube Q_4": (16, [(x, x ^ (1 << i)) for x in range(16) for i in range(4) if x < x ^ (1 << i)]),
    "barbell 2 x K_6": (12, [(a + s, b + s) for s in (0, 6) for a in range(6) for b in range(a + 1, 6)] + [(5, 6)]),
}
print("graph             phi(G)    h(G)")
for name, (n, edges) in graphs.items():
    phi, h = all_cut_stats(n, edges)
    print(f"{name:16} {phi:7.4f}  {h:6.4f}")
graph             phi(G)    h(G)
path P_12         0.0909  0.1667
cycle C_12        0.1667  0.3333
complete K_8      0.5714  4.0000
hypercube Q_4     0.2500  1.0000
barbell 2 x K_6   0.0323  0.1667

The cycle's best cut is two opposite edges: ϕ=2/12\phi = 2/12, h=2/6h = 2/6. The hypercube's best cuts are the "dimension cuts" {x:xi=0}\{x : x_i = 0\} with 8 crossing edges, h=1h = 1 and ϕ=1/4=1/d\phi = 1/4 = 1/d. That no set does better is the edge-isoperimetric inequality of the hypercube (Harper, 1964; Bernstein, 1967): every SS with ∣S∣≤2d−1\lvert S \rvert \le 2^{d-1} has ∣∂S∣≥∣S∣(d−log⁡2∣S∣)\lvert \partial S \rvert \ge \lvert S \rvert (d - \log_2 \lvert S \rvert). The barbell's single bridge gives ϕ=1/31\phi = 1/31, since each side has volume 2⋅15+1=312 \cdot 15 + 1 = 31.

Expander families

A sequence of dd-regular graphs G1,G2,…G_1, G_2, \ldots with ni→∞n_i \to \infty is an expander family if h(Gi)≥εh(G_i) \ge \varepsilon (equivalently ϕ(Gi)≥ε/d\phi(G_i) \ge \varepsilon/d) for a constant ε>0\varepsilon > 0 independent of ii. Paths, cycles and grids are not: their expansion decays like 1/n1/n or 1/n1/\sqrt n. Hypercubes are not either (with growing degree, ϕ(Qd)=1/d→0\phi(Q_d) = 1/d \to 0). Complete graphs have huge expansion but degree n−1n - 1. The interesting fact, proved later in the course, is that constant-degree expander families exist, and in fact almost every random dd-regular graph with d≥3d \ge 3 is a good expander (Constructing Expanders).

Exhaustive search in C++

For later lessons we need the true conductance of graphs with about 20 vertices to compare heuristics against. A Gray-code walk over the 2n−12^{n-1} subsets that exclude the last vertex (each cut is counted once) updates the cut size and the volume in O(deg⁡v)O(\deg v) time when one vertex vv changes sides.

cpp · try it yourself
#include <algorithm>
#include <bit>
#include <cstdint>
#include <cstdio>
#include <vector>

struct Best { double phi; std::uint32_t set; };

// Exact conductance by a Gray-code walk over all subsets S of {0, ..., n-2}.
Best min_conductance(const std::vector<std::vector<int>>& adj) {
    int n = (int)adj.size();
    long total = 0;
    for (auto& nb : adj) total += (long)nb.size();
    std::vector<char> in(n, 0);
    long cut = 0, vol = 0;
    std::uint32_t set = 0;
    Best best{2.0, 0};
    for (std::uint32_t g = 1; g < (1u << (n - 1)); ++g) {
        int v = std::countr_zero(g);                  // vertex v switches sides
        int inside = 0;
        for (int u : adj[v]) inside += in[u];
        int deg = (int)adj[v].size();
        if (!in[v]) { cut += deg - 2 * inside; vol += deg; }
        else        { cut -= deg - 2 * inside; vol -= deg; }
        in[v] ^= 1;
        set ^= 1u << v;
        double phi = double(cut) / double(std::min(vol, total - vol));
        if (phi < best.phi) best = {phi, set};
    }
    return best;
}

int main() {
    // a 4 x 5 grid: 20 vertices
    const int R = 4, C = 5, n = R * C;
    std::vector<std::vector<int>> adj(n);
    auto add = [&](int a, int b) { adj[a].push_back(b); adj[b].push_back(a); };
    for (int i = 0; i < R; ++i)
        for (int j = 0; j < C; ++j) {
            if (j + 1 < C) add(i * C + j, i * C + j + 1);
            if (i + 1 < R) add(i * C + j, (i + 1) * C + j);
        }
    Best b = min_conductance(adj);
    std::printf("%u subsets checked, phi(G) = %.4f\n", (1u << (n - 1)) - 1, b.phi);
    for (int i = 0; i < R; ++i) {
        for (int j = 0; j < C; ++j) std::printf("%c", (b.set >> (i * C + j)) & 1 ? 'S' : '.');
        std::printf("\n");
    }
}
524287 subsets checked, phi(G) = 0.1613
SSSSS
SSSSS
.....
.....

The optimum cuts the 5 vertical edges between the second and third rows, and each half has volume 31, so ϕ=5/31\phi = 5/31. Cutting across the long side between the second and third columns would cross only 4 edges, but the sides would be unbalanced (volumes 24 and 38) and 4/24≈0.1674/24 \approx 0.167 is worse. Conductance rewards balance as well as a small boundary. The search took 2192^{19} steps; at n=40n = 40 it would take about half a trillion, which is why the next lessons look for a spectral shortcut.

Test yourself

What is the conductance ϕ(S)\phi(S) of a set SS in this course?

  1. w(∂S)/∣S∣w(\partial S)/\lvert S \rvert
  2. w(∂S)/min⁡(vol⁡(S),vol⁡(S‾))w(\partial S)/\min(\operatorname{vol}(S), \operatorname{vol}(\overline S))
  3. w(∂S)/(∣S∣∣S‾∣)w(\partial S)/(\lvert S \rvert \lvert \overline S \rvert)
  4. vol⁡(S)/2m\operatorname{vol}(S)/2m

For a dd-regular graph, how are ϕ(G)\phi(G) and h(G)h(G) related?

  1. ϕ=h\phi = h
  2. ϕ=h/d\phi = h/d
  3. ϕ=dh\phi = d h
  4. ϕ=h2\phi = h^2

Why are hypercubes QdQ_d not an expander family in the sense of this lesson?

  1. They are disconnected
  2. Their degree dd grows, and their conductance 1/d1/d tends to 0
  3. Their edge expansion tends to 0
  4. They are not regular

What is the conductance of two copies of K6K_6 joined by a single edge?

  1. 1/61/6
  2. 1/311/31
  3. 1/301/30
  4. 1/121/12