# Combinatorics (Fall 2010)/Graph spectrum, expanders

## Graph Expansion

According to wikipedia:

"Expander graphs have found extensive applications in computer science, in designing algorithms, error correcting codes, extractors, pseudorandom generators, sorting networks and robust computer networks. They have also been used in proofs of many important results in computational complexity theory, such as SL=L and the PCP theorem. In cryptography too, expander graphs are used to construct hash functions."

We will not explore everything about expander graphs, but will focus on the performances of random walks on expander graphs.

### Expander graphs

Consider an undirected (multi)graph $\displaystyle{ G(V,E) }$, where the parallel edges between two vertices are allowed.

Some notations:

• For $\displaystyle{ S,T\subset V }$, let $\displaystyle{ E(S,T)=\{uv\in E\mid u\in S,v\in T\} }$.
• The Edge Boundary of a set $\displaystyle{ S\subset V }$, denoted $\displaystyle{ \partial S\, }$, is $\displaystyle{ \partial S = E(S, \bar{S}) }$.
 Definition (Graph expansion) The expansion ratio of an undirected graph $\displaystyle{ G }$ on $\displaystyle{ n }$ vertices, is defined as $\displaystyle{ \phi(G)=\min_{\overset{S\subset V}{|S|\le\frac{n}{2}}} \frac{|\partial S|}{|S|}. }$

Expander graphs are $\displaystyle{ d }$-regular (multi)graphs with $\displaystyle{ d=O(1) }$ and $\displaystyle{ \phi(G)=\Omega(1) }$.

This definition states the following properties of expander graphs:

• Expander graphs are sparse graphs. This is because the number of edges is $\displaystyle{ dn/2=O(n) }$.
• Despite the sparsity, expander graphs have good connectivity. This is supported by the expansion ratio.
• This one is implicit: expander graph is a family of graphs $\displaystyle{ \{G_n\} }$, where $\displaystyle{ n }$ is the number of vertices. The asymptotic order $\displaystyle{ O(1) }$ and $\displaystyle{ \Omega(1) }$ in the definition is relative to the number of vertices $\displaystyle{ n }$, which grows to infinity.

The following fact is directly implied by the definition.

An expander graph has diameter $\displaystyle{ O(\log n) }$.

The proof is left for an exercise.

For a vertex set $\displaystyle{ S }$, the size of the edge boundary $\displaystyle{ |\partial S| }$ can be seen as the "perimeter" of $\displaystyle{ S }$, and $\displaystyle{ |S| }$ can be seen as the "volume" of $\displaystyle{ S }$. The expansion property can be interpreted as a combinatorial version of isoperimetric inequality.

Vertex expansion
We can alternatively define the vertex expansion. For a vertex set $\displaystyle{ S\subset V }$, its vertex boundary, denoted $\displaystyle{ \delta S\, }$ is defined as that
$\displaystyle{ \delta S=\{u\not\in S\mid uv\in E \mbox{ and }v\in S\} }$,
and the vertex expansion of a graph $\displaystyle{ G }$ is $\displaystyle{ \psi(G)=\min_{\overset{S\subset V}{|S|\le\frac{n}{2}}} \frac{|\delta S|}{|S|} }$.

### Existence of expander graph

We will show the existence of expander graphs by the probabilistic method. In order to do so, we need to generate random $\displaystyle{ d }$-regular graphs.

Suppose that $\displaystyle{ d }$ is even. We can generate a random $\displaystyle{ d }$-regular graph $\displaystyle{ G(V,E) }$ as follows:

• Let $\displaystyle{ V }$ be the vertex set. Uniformly and independently choose $\displaystyle{ \frac{d}{2} }$ cycles of $\displaystyle{ V }$.
• For each vertex $\displaystyle{ v }$, for every cycle, assuming that the two neighbors of $\displaystyle{ v }$ in that cycle is $\displaystyle{ w }$ and $\displaystyle{ u }$, add two edges $\displaystyle{ wv }$ and $\displaystyle{ uv }$ to $\displaystyle{ E }$.

The resulting $\displaystyle{ G(V,E) }$ is a multigraph. That is, it may have multiple edges between two vertices. We will show that $\displaystyle{ G(V,E) }$ is an expander graph with high probability. Formally, for some constant $\displaystyle{ d }$ and constant $\displaystyle{ \alpha }$,

$\displaystyle{ \Pr[\phi(G)\ge \alpha]=1-o(1) }$.

By the probabilistic method, this shows that there exist expander graphs. In fact, the above probability bound shows something much stronger: it shows that almost every regular graph is an expander.

Recall that $\displaystyle{ \phi(G)=\min_{S:|S|\le\frac{n}{2}}\frac{|\partial S|}{|S|} }$. We call such $\displaystyle{ S\subset V }$ that $\displaystyle{ \frac{|\partial S|}{|S|}\lt \alpha }$ a "bad $\displaystyle{ S }$". Then $\displaystyle{ \phi(G)\lt \alpha }$ if and only if there exists a bad $\displaystyle{ S }$ of size at most $\displaystyle{ \frac{n}{2} }$. Therefore,

\displaystyle{ \begin{align} \Pr[\phi(G)\lt \alpha] &= \Pr\left[\min_{S:|S|\le\frac{n}{2}}\frac{|\partial S|}{|S|}\lt \alpha\right]\\ &= \sum_{k=1}^\frac{n}{2}\Pr[\,\exists \mbox{bad }S\mbox{ of size }k\,]\\ &\le \sum_{k=1}^\frac{n}{2}\sum_{S\in{V\choose k}}\Pr[\,S\mbox{ is bad}\,] \end{align} }

Let $\displaystyle{ R\subset S }$ be the set of vertices in $\displaystyle{ S }$ which has neighbors in $\displaystyle{ \bar{S} }$, and let $\displaystyle{ r=|R| }$. It is obvious that $\displaystyle{ |\partial S|\ge r }$, thus, for a bad $\displaystyle{ S }$, $\displaystyle{ r\lt \alpha k }$. Therefore, there are at most $\displaystyle{ \sum_{r=1}^{\alpha k}{k \choose r} }$ possible choices such $\displaystyle{ R }$. For any fixed choice of $\displaystyle{ R }$, the probability that an edge picked by a vertex in $\displaystyle{ S-R }$ connects to a vertex in $\displaystyle{ S }$ is at most $\displaystyle{ k/n }$, and there are $\displaystyle{ d(k-r) }$ such edges. For any fixed $\displaystyle{ S }$ of size $\displaystyle{ k }$ and $\displaystyle{ R }$ of size $\displaystyle{ r }$, the probability that all neighbors of all vertices in $\displaystyle{ S-R }$ are in $\displaystyle{ S }$ is at most $\displaystyle{ \left(\frac{k}{n}\right)^{d(k-r)} }$. Due to the union bound, for any fixed $\displaystyle{ S }$ of size $\displaystyle{ k }$,

\displaystyle{ \begin{align} \Pr[\,S\mbox{ is bad}\,] &\le \sum_{r=1}^{\alpha k}{k \choose r}\left(\frac{k}{n}\right)^{d(k-r)} \le \alpha k {k \choose \alpha k}\left(\frac{k}{n}\right)^{dk(1-\alpha)} \end{align} }

Therefore,

\displaystyle{ \begin{align} \Pr[\phi(G)\lt \alpha] &\le \sum_{k=1}^\frac{n}{2}\sum_{S\in{V\choose k}}\Pr[\,S\mbox{ is bad}\,]\\ &\le \sum_{k=1}^\frac{n}{2}{n\choose k}\alpha k {k \choose \alpha k}\left(\frac{k}{n}\right)^{dk(1-\alpha)} \\ &\le \sum_{k=1}^\frac{n}{2}\left(\frac{en}{k}\right)^k\alpha k \left(\frac{ek}{\alpha k}\right)^{\alpha k}\left(\frac{k}{n}\right)^{dk(1-\alpha)}&\quad (\mbox{Stirling formula }{n\choose k}\le\left(\frac{en}{k}\right)^k)\\ &\le \sum_{k=1}^\frac{n}{2}\exp(O(k))\left(\frac{k}{n}\right)^{k(d(1-\alpha)-1)}. \end{align} }

The last line is $\displaystyle{ o(1) }$ when $\displaystyle{ d\ge\frac{2}{1-\alpha} }$. Therefore, $\displaystyle{ G }$ is an expander graph with expansion ratio $\displaystyle{ \alpha }$ with high probability for suitable choices of constant $\displaystyle{ d }$ and constant $\displaystyle{ \alpha }$.

### Computation of graph expansion

Computation of graph expansion seems hard, because the definition involves the minimum over exponentially many subsets of vertices. In fact, the problem of deciding whether a graph is an expander is co-NP-complete. For a non-expander $\displaystyle{ G }$, the vertex set $\displaystyle{ S\subset V }$ which has low expansion ratio is a proof of the fact that $\displaystyle{ G }$ is not an expander, which can be verified in poly-time. However, there is no efficient algorithm for computing the $\displaystyle{ \phi(G) }$ unless NP=P.

The expansion ratio of a graph is closely related to the sparsest cut of the graph, which is the dual problem of the multicommodity flow problem, both NP-complete. Studies of these two problems revolutionized the area of approximation algorithms.

We will see right now that although it is hard to compute the expansion ratio exactly, the expansion ratio can be approximated by some efficiently computable algebraic identity of the graph.

## Graph spectrum

### Laplacian

The adjacency matrix of an $\displaystyle{ n }$-vertex graph $\displaystyle{ G }$, denoted $\displaystyle{ A = A(G) }$, is an $\displaystyle{ n\times n }$ matrix where $\displaystyle{ A(u,v) }$ is the number of edges in $\displaystyle{ G }$ between vertex $\displaystyle{ u }$ and vertex $\displaystyle{ v }$.

### Graph eigenvalues

Because adjacency matrix $\displaystyle{ A }$ is a symmetric matrix with real entries, due to the Perron-Frobenius theorem, it has real eigenvalues $\displaystyle{ \alpha_1\ge\alpha_2\ge\cdots\ge\alpha_n }$, which associate with an orthonormal system of eigenvectors $\displaystyle{ v_1,v_2,\ldots, v_n\, }$ with $\displaystyle{ Av_i=\alpha_i v_i\, }$. We call the eigenvalues of $\displaystyle{ A }$ the spectrum of the graph $\displaystyle{ G }$.

The spectrum of a graph contains a lot of information about the graph. For example, supposed that $\displaystyle{ G }$ is $\displaystyle{ d }$-regular, the following lemma holds.

 Lemma $\displaystyle{ |\alpha_i|\le d }$ for all $\displaystyle{ 1\le i\le n }$. $\displaystyle{ \alpha_1=d }$ and the corresponding eigenvector is $\displaystyle{ (\frac{1}{\sqrt{n}},\frac{1}{\sqrt{n}},\ldots,\frac{1}{\sqrt{n}}) }$. $\displaystyle{ G }$ is connected if and only if $\displaystyle{ \alpha_1\gt \alpha_2 }$. If $\displaystyle{ G }$ is bipartite then $\displaystyle{ \alpha_1=-\alpha_n }$.
Proof.
 Let $\displaystyle{ A }$ be the adjacency matrix of $\displaystyle{ G }$, with entries $\displaystyle{ a_{ij} }$. It is obvious that $\displaystyle{ \sum_{j}a_{ij}=d\, }$ for any $\displaystyle{ j }$. (1) Suppose that $\displaystyle{ Ax=\alpha x, x\neq \mathbf{0} }$, and let $\displaystyle{ x_i }$ be an entry of $\displaystyle{ x }$ with the largest absolute value. Since $\displaystyle{ (Ax)_i=\alpha x_i }$, we have $\displaystyle{ \sum_{j}a_{ij}x_j=\alpha x_i,\, }$ and so $\displaystyle{ |\alpha||x_i|=\left|\sum_{j}a_{ij}x_j\right|\le \sum_{j}a_{ij}|x_j|\le \sum_{j}a_{ij}|x_i| \le d|x_i|. }$ Thus $\displaystyle{ |\alpha|\le d }$. (2) is easy to check. (3) Let $\displaystyle{ x }$ be the nonzero vector for which $\displaystyle{ Ax=dx }$, and let $\displaystyle{ x_i }$ be an entry of $\displaystyle{ x }$ with the largest absolute value. Since $\displaystyle{ (Ax)_i=d x_i }$, we have $\displaystyle{ \sum_{j}a_{ij}x_j=d x_i.\, }$ Since $\displaystyle{ \sum_{j}a_{ij}=d\, }$ and by the maximality of $\displaystyle{ x_i }$, it follows that $\displaystyle{ x_j=x_i }$ for all $\displaystyle{ j }$ that $\displaystyle{ a_{ij}\gt 0 }$. Thus, $\displaystyle{ x_i=x_j }$ if $\displaystyle{ i }$ and $\displaystyle{ j }$ are adjacent, which implies that $\displaystyle{ x_i=x_j }$ if $\displaystyle{ i }$ and $\displaystyle{ j }$ are connected. For connected $\displaystyle{ G }$, all vertices are connected, thus all $\displaystyle{ x_i }$ are equal. This shows that if $\displaystyle{ G }$ is connected, the eigenvalue $\displaystyle{ d=\alpha_1 }$ has multiplicity 1, thus $\displaystyle{ \alpha_1\gt \alpha_2 }$. If otherwise, $\displaystyle{ G }$ is disconnected, then for two different components, we have $\displaystyle{ Ax=dx }$ and $\displaystyle{ Ay=dy }$, where the entries of $\displaystyle{ x }$ and $\displaystyle{ y }$ are nonzero only for the vertices in their components components. Then $\displaystyle{ A(ax+by)=d(ax+by) }$. Thus, the multiplicity of $\displaystyle{ d }$ is greater than 1, so $\displaystyle{ \alpha_1=\alpha_2 }$. (4) If $\displaystyle{ G }$ if bipartite, then the vertex set can be partitioned into two disjoint nonempty sets $\displaystyle{ V_1 }$ and $\displaystyle{ V_2 }$ such that all edges have one endpoint in each of $\displaystyle{ V_1 }$ and $\displaystyle{ V_2 }$. Algebraically, this means that the adjacency matrix can be organized into the form $\displaystyle{ P^TAP=\begin{bmatrix} 0 & B\\ B^T & 0 \end{bmatrix} }$ where $\displaystyle{ P }$ is a permutation matrix, which has no change on the eigenvalues. If $\displaystyle{ x }$ is an eigenvector corresponding to the eigenvalue $\displaystyle{ \alpha }$, then $\displaystyle{ x' }$ which is obtained from $\displaystyle{ x }$ by changing the sign of the entries corresponding to vertices in $\displaystyle{ V_2 }$, is an eigenvector corresponding to the eigenvalue $\displaystyle{ -\alpha }$. It follows that the spectrum of a bipartite graph is symmetric with respect to 0.
$\displaystyle{ \square }$

### The spectral gap

It turns out that the second largest eigenvalue of a graph contains important information about the graph's expansion parameter. The following theorem is the so-called Cheeger's inequality.

 Theorem (Cheeger's inequality) Let $\displaystyle{ G }$ be a $\displaystyle{ d }$-regular graph with spectrum $\displaystyle{ \alpha_1\ge\alpha_2\ge\cdots\ge\alpha_n }$. Then $\displaystyle{ \frac{d-\alpha_2}{2}\le \phi(G) \le \sqrt{2d(d-\alpha_2)} }$

The theorem was first stated for Riemannian manifolds, and was proved by Cheeger and Buser (for different directions of the inequalities). The discrete case is proved independently by Dodziuk and Alon-Milman.

For a $\displaystyle{ d }$-regular graph, the value $\displaystyle{ (d-\alpha_2) }$ is known as the spectral gap. The name is due to the fact that it is the gap between the first and the second eigenvalue in the spectrum of a graph. The spectral gap provides an estimate on the expansion ratio of a graph. More precisely, a $\displaystyle{ d }$-regular graph has large expansion ratio (thus being an expander) if the spectral gap is large.

We will not prove the theorem, but we will explain briefly why it works.

For the spectra of graphs, the Cheeger's inequality is proved by the Courant-Fischer theorem in linear algebra. The Courant-Fischer theorem is a fundamental theorem in linear algebra which characterizes the eigenvalues by a series of optimizations:

 Theorem (Courant-Fischer theorem) Let $\displaystyle{ A }$ be a symmetric matrix with eigenvalues $\displaystyle{ \alpha_1\ge\alpha_2\ge\cdots\ge\alpha_n }$. Then \displaystyle{ \begin{align} \alpha_k &=\max_{v_1,v_2,\ldots,v_{n-k}\in \mathbb{R}^n}\min_{\overset{x\in\mathbb{R}^n, x\neq \mathbf{0}}{x\bot v_1,v_2,\ldots,v_{n-k}}}\frac{x^TAx}{x^Tx}\\ &= \min_{v_1,v_2,\ldots,v_{k-1}\in \mathbb{R}^n}\max_{\overset{x\in\mathbb{R}^n, x\neq \mathbf{0}}{x\bot v_1,v_2,\ldots,v_{k-1}}}\frac{x^TAx}{x^Tx}. \end{align} }

For a $\displaystyle{ d }$-regular graph with adjacency matrix $\displaystyle{ A }$ and spectrum $\displaystyle{ \alpha_1\ge\alpha_2\ge\cdots\ge\alpha_n }$, its largest eigenvalue $\displaystyle{ \alpha_1=d }$ with eigenvector $\displaystyle{ A\cdot\mathbf{1}=d\mathbf{1} }$. According to the Courant-Fischer theorem, the second largest eigenvalue can be computed as

$\displaystyle{ \alpha_2=\max_{x\bot \mathbf{1}}\frac{x^TAx}{x^Tx}, }$

and

$\displaystyle{ d-\alpha_2=\min_{x\bot \mathbf{1}}\frac{x^T(dI-A)x}{x^Tx}. }$

The later is an optimization, which shares some resemblance of the expansion ratio $\displaystyle{ \phi(G)=\min_{\overset{S\subset V}{|S|\le\frac{n}{2}}}\frac{|\partial S|}{|S|}=\min_{\chi_S}\frac{\chi_S^T(dI-A)\chi_S}{\chi_S^T\chi_S} }$, where $\displaystyle{ \chi_S }$ is the characteristic vector of the set $\displaystyle{ S }$, defined as $\displaystyle{ \chi_S(i)=1 }$ if $\displaystyle{ i\in S }$ and $\displaystyle{ \chi_S(i)=0 }$ if $\displaystyle{ i\not\in S }$. It is not hard to verify that $\displaystyle{ \chi_S^T\chi_S=\sum_{i}\chi_S(i)=|S| }$ and $\displaystyle{ \chi_S^T(dI-A)\chi_S=\sum_{i\sim j}(\chi_S(i)-\chi_S(j))^2=|\partial S| }$.

Therefore, the spectral gap $\displaystyle{ d-\alpha_2 }$ and the expansion ratio $\displaystyle{ \phi(G) }$ both involve some optimizations with the similar forms. It explains why they can be used to approximate each other.

## Reference

• Shlomo Hoory, Nathan Linial, and Avi Wigderson. Expander Graphs and Their Applications. American Mathematical Society, 2006. [PDF]