# Randomized Algorithms (Spring 2010)/Expander graphs and rapid mixing random walks

## 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|\leq {\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|\leq {\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)\geq \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|\leq {\frac {n}{2}}}{\frac {|\partial S|}{|S|}}}$. We call such ${\displaystyle S\subset V}$ that ${\displaystyle {\frac {|\partial S|}{|S|}}<\alpha }$ a "bad ${\displaystyle S}$". Then ${\displaystyle \phi (G)<\alpha }$ if and only if there exists a bad ${\displaystyle S}$ of size at most ${\displaystyle {\frac {n}{2}}}$. Therefore,

{\displaystyle {\begin{aligned}\Pr[\phi (G)<\alpha ]&=\Pr \left[\min _{S:|S|\leq {\frac {n}{2}}}{\frac {|\partial S|}{|S|}}<\alpha \right]\\&=\sum _{k=1}^{\frac {n}{2}}\Pr[\,\exists {\mbox{bad }}S{\mbox{ of size }}k\,]\\&\leq \sum _{k=1}^{\frac {n}{2}}\sum _{S\in {V \choose k}}\Pr[\,S{\mbox{ is bad}}\,]\end{aligned}}}

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|\geq r}$, thus, for a bad ${\displaystyle S}$, ${\displaystyle r<\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{aligned}\Pr[\,S{\mbox{ is bad}}\,]&\leq \sum _{r=1}^{\alpha k}{k \choose r}\left({\frac {k}{n}}\right)^{d(k-r)}\leq \alpha k{k \choose \alpha k}\left({\frac {k}{n}}\right)^{dk(1-\alpha )}\end{aligned}}}

Therefore,

{\displaystyle {\begin{aligned}\Pr[\phi (G)<\alpha ]&\leq \sum _{k=1}^{\frac {n}{2}}\sum _{S\in {V \choose k}}\Pr[\,S{\mbox{ is bad}}\,]\\&\leq \sum _{k=1}^{\frac {n}{2}}{n \choose k}\alpha k{k \choose \alpha k}\left({\frac {k}{n}}\right)^{dk(1-\alpha )}\\&\leq \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}\leq \left({\frac {en}{k}}\right)^{k})\\&\leq \sum _{k=1}^{\frac {n}{2}}\exp(O(k))\left({\frac {k}{n}}\right)^{k(d(1-\alpha )-1)}.\end{aligned}}}

The last line is ${\displaystyle o(1)}$ when ${\displaystyle d\geq {\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 }$.

### Explicit constructions

We have shown that a random ${\displaystyle d}$-regular graph is an expander with high probability. This gives us a probabilistic way to construct expander graphs. For some applications, this is good enough. However, some applications of expander graphs in complexity theory ask for explicit constructions of expander graphs. In particular, we need a polynomial time deterministic algorithm which given a vertex ${\displaystyle v}$ and a integer ${\displaystyle k}$ as input, returns the ${\displaystyle k}$th neighbor of ${\displaystyle v}$.

• The old way: constructions based on algebraic structures, e.g. Cayley graphs which are based on groups.
• The new way: combinatorial constructions which are based on graph operations, e.g. the zig-zag product.

This course will not cover these materials.

### 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

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}$. Because ${\displaystyle A}$ is a symmetric matrix with real entries, due to the Perron-Frobenius theorem, it has real eigenvalues ${\displaystyle \lambda _{1}\geq \lambda _{2}\geq \cdots \geq \lambda _{n}}$, which associate with an orthonormal system of eigenvectors ${\displaystyle v_{1},v_{2},\ldots ,v_{n}\,}$ with ${\displaystyle Av_{i}=\lambda _{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 |\lambda _{i}|\leq d}$ for all ${\displaystyle 1\leq i\leq n}$. ${\displaystyle \lambda _{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 \lambda _{1}>\lambda _{2}}$. If ${\displaystyle G}$ is bipartite then ${\displaystyle \lambda _{1}=-\lambda _{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=\lambda 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}=\lambda x_{i}}$, we have ${\displaystyle \sum _{j}a_{ij}x_{j}=\lambda x_{i},\,}$ and so ${\displaystyle |\lambda ||x_{i}|=\left|\sum _{j}a_{ij}x_{j}\right|\leq \sum _{j}a_{ij}|x_{j}|\leq \sum _{j}a_{ij}|x_{i}|\leq d|x_{i}|.}$ Thus ${\displaystyle |\lambda |\leq 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}=dx_{i}}$, we have ${\displaystyle \sum _{j}a_{ij}x_{j}=dx_{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}>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=\lambda _{1}}$ has multiplicity 1, thus ${\displaystyle \lambda _{1}>\lambda _{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(\alpha x+\beta y)=d(\alpha x+\beta y)}$. Thus, the multiplicity of ${\displaystyle d}$ is greater than 1, so ${\displaystyle \lambda _{1}=\lambda _{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^{T}AP={\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 \lambda }$, 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 -\lambda }$. 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 \lambda _{1}\geq \lambda _{2}\geq \cdots \geq \lambda _{n}}$. Then ${\displaystyle {\frac {d-\lambda _{2}}{2}}\leq \phi (G)\leq {\sqrt {2d(d-\lambda _{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-\lambda _{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.

If we write ${\displaystyle \alpha =1-{\frac {\lambda _{2}}{d}}}$ (sometimes it is called the normalized spectral gap), the Cheeger's inequality is turned into a nicer form:

${\displaystyle {\frac {\alpha }{2}}\leq {\frac {\phi }{d}}\leq {\sqrt {2\alpha }}}$ or equivalently ${\displaystyle {\frac {1}{2}}\left({\frac {\phi }{d}}\right)^{2}\leq \alpha \leq 2\left({\frac {\phi }{d}}\right)}$.

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 \lambda _{1}\geq \lambda _{2}\geq \cdots \geq \lambda _{n}}$. Then {\displaystyle {\begin{aligned}\lambda _{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^{T}Ax}{x^{T}x}}\\&=\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^{T}Ax}{x^{T}x}}.\end{aligned}}}

For a ${\displaystyle d}$-regular graph with adjacency matrix ${\displaystyle A}$ and spectrum ${\displaystyle \lambda _{1}\geq \lambda _{2}\geq \cdots \geq \lambda _{n}}$, its largest eigenvalue ${\displaystyle \lambda _{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 \lambda _{2}=\max _{x\bot \mathbf {1} }{\frac {x^{T}Ax}{x^{T}x}},}$

and

${\displaystyle d-\lambda _{2}=\min _{x\bot \mathbf {1} }{\frac {x^{T}(dI-A)x}{x^{T}x}}.}$

The later is an optimization, which shares some resemblance of the expansion ratio ${\displaystyle \phi (G)=\min _{\overset {S\subset V}{|S|\leq {\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-\lambda _{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.

### The expander mixing lemma

Given a ${\displaystyle d}$-regular graph ${\displaystyle G}$ on ${\displaystyle n}$ vertices with the spectrum ${\displaystyle d=\lambda _{1}\geq \lambda _{2}\geq \cdots \geq \lambda _{n}}$, we denote ${\displaystyle \lambda _{\max }=\max(|\lambda _{2}|,|\lambda _{n}|)\,}$, which is the largest absolute value of an eigenvalue other than ${\displaystyle \lambda _{1}=d}$. Sometimes, the value of ${\displaystyle (d-\lambda _{\max })}$ is also referred as the spectral gap, because it is the gap between the largest and the second largest absolute values of eigenvalues.

The next lemma is the so-called expander mixing lemma, which states a fundamental fact about expander graphs.

 Lemma (expander mixing lemma) Let ${\displaystyle G}$ be a ${\displaystyle d}$-regular graph with ${\displaystyle n}$ vertices. Then for all ${\displaystyle S,T\subseteq V}$, ${\displaystyle \left||E(S,T)|-{\frac {d|S||T|}{n}}\right|\leq \lambda _{\max }{\sqrt {|S||T|}}}$

The left-hand side measures the deviation between two quantities: one is ${\displaystyle |E(S,T)|}$, the number of edges between the two sets ${\displaystyle S}$ and ${\displaystyle T}$; the other is the expected number of edges between ${\displaystyle S}$ and ${\displaystyle T}$ in a random graph of edge density ${\displaystyle d/n}$, namely ${\displaystyle d|S||T|/n}$. A small ${\displaystyle \lambda _{\max }}$ (or large spectral gap) implies that this deviation (or discrepancy as it is sometimes called) is small, so the graph looks random everywhere although it is deterministic.

### Random walks on expander graphs

Given a ${\displaystyle d}$-regular graph ${\displaystyle G}$ on ${\displaystyle n}$ vertices with the spectrum ${\displaystyle d=\lambda _{1}\geq \lambda _{2}\geq \cdots \geq \lambda _{n}}$, we denote ${\displaystyle \lambda _{\max }=\max(|\lambda _{2}|,|\lambda _{n}|)\,}$, which is the largest absolute value of eigenvalues except ${\displaystyle \lambda _{1}=d}$.

Let ${\displaystyle A}$ be the adjacency matrix of ${\displaystyle G}$ and let ${\displaystyle P={\frac {1}{d}}A}$. We know that ${\displaystyle P}$ defines a transition matrix of a random walk on ${\displaystyle G}$, such that

${\displaystyle P(u,v)={\begin{cases}{\frac {1}{d}}&u\sim v,\\0&u\not \sim v.\end{cases}}}$

Let ${\displaystyle \rho _{1}\geq \rho _{2}\geq \cdots \geq \rho _{n}}$ be the spectrum of ${\displaystyle P}$. Since ${\displaystyle P={\frac {1}{d}}A}$, it is obvious that

${\displaystyle \rho _{i}={\frac {\lambda _{i}}{d}}}$.

Similarly, let ${\displaystyle \rho _{\max }=\max(|\rho _{2}|,|\rho _{n}|)\,}$.

 Lemma Let ${\displaystyle \pi =({\frac {1}{n}},\ldots ,{\frac {1}{n}})}$ be the uniform distribution. For any stochastic vector ${\displaystyle q}$, ${\displaystyle \|qP-\pi \|_{2}\leq \rho _{\max }}$.
Proof.
 Since ${\displaystyle G}$ is ${\displaystyle d}$-regular, the uniform distribution ${\displaystyle \pi }$ is stationary for ${\displaystyle P}$, i.e. ${\displaystyle \pi P=\pi }$. Then ${\displaystyle \|qP-\pi \|_{2}=\|qP-\pi P\|_{2}=\|(q-\pi )P\|_{2}}$ and because ${\displaystyle (q-\pi )\cdot \mathbf {1} =0}$, i.e. ${\displaystyle (q-\pi )}$ is orthogonal to ${\displaystyle \mathbf {1} }$, its ${\displaystyle \ell _{2}}$-norm is shrinking by a factor of ${\displaystyle \rho _{\max }}$ under the action of ${\displaystyle P}$. Consequently, ${\displaystyle \|(q-\pi )P\|_{2}\leq \rho _{\max }\|(q-\pi )\|_{2}\leq \rho _{\max }.}$ The last inequality is due to the fact that both ${\displaystyle q}$ and ${\displaystyle \pi }$ are stochastic vectors.
${\displaystyle \square }$

Using this lemma, we can prove the following theorem.

 Theorem Let ${\displaystyle A}$ be the adjacency matrix of a ${\displaystyle d}$-regular graph ${\displaystyle G}$ with the spectrum ${\displaystyle d=\lambda _{1}\geq \lambda _{2}\geq \cdots \geq \lambda _{n}}$, and let ${\displaystyle \lambda _{\max }=\max(|\lambda _{2}|,|\lambda _{n}|)\,}$. Let ${\displaystyle P={\frac {1}{d}}A}$ be the transition matrix of the random walk on ${\displaystyle G}$, and ${\displaystyle \pi =({\frac {1}{n}},\ldots ,{\frac {1}{n}})}$ be the uniform distribution. For any initial distribution ${\displaystyle q}$, ${\displaystyle \|qP^{t}-\pi \|_{2}\leq \rho _{\max }^{t}=\left({\frac {\lambda _{\max }}{d}}\right)^{t}}$.
Proof.
 Prove by induction on ${\displaystyle t}$ with the lemma.
${\displaystyle \square }$

The next corollary follows immediately (due to Cauchy-Schwartz theorem) from the above theorem.

 Corollary Let ${\displaystyle \pi =({\frac {1}{n}},\ldots ,{\frac {1}{n}})}$ be the uniform distribution. For any initial distribution ${\displaystyle q}$, ${\displaystyle \|qP^{t}-\pi \|_{1}\leq {\sqrt {n}}\|qP^{t}-\pi \|_{2}\leq {\sqrt {n}}\cdot \left({\frac {\lambda _{\max }}{d}}\right)^{t}}$.

So the random walk on a graph converges exponentially fast if ${\displaystyle {\frac {\lambda _{\max }}{d}}}$ is a constant ${\displaystyle <1}$. This is true when ${\displaystyle \lambda _{2}\geq |\lambda _{n}|}$ and the spectral gap ${\displaystyle (d-\lambda _{2})}$ is a constant. This seems not a very nice condition. This situation can be changed by considering the lazy random walk.

Lazy random walk

Recall that for the lazy random walk, at each step, we first flip a fair coin to decide whether to walk or to stay. The corresponding transition matrix is

${\displaystyle Q={\frac {1}{2}}(I+P)={\frac {1}{2}}\left(I+{\frac {1}{d}}A\right).}$

The spectrum of ${\displaystyle Q}$ is given by

${\displaystyle \rho '_{i}={\frac {1+{\frac {1}{d}}\lambda _{i}}{2}}}$

where ${\displaystyle \lambda _{i}}$ is the ${\displaystyle i}$th largest eigenvalue of the adjacency matrix ${\displaystyle A}$. For ${\displaystyle d}$-regular graph, it holds that

${\displaystyle 1=\rho _{1}'\geq \rho _{2}'\geq \cdots \geq \rho _{n}'\geq 0.}$

The last inequality is due to that ${\displaystyle |\lambda _{i}|\leq d}$.

Therefore, for the lazy walk, it always holds that ${\displaystyle \rho _{\max }'=\max(|\rho _{2}'|,|\rho _{n}'|)=\rho _{2}'={\frac {1+{\frac {1}{d}}\lambda _{2}}{2}}}$.

 Theorem (lazy random walk on expander) Given a ${\displaystyle d}$-regular graph ${\displaystyle G}$ with the spectrum ${\displaystyle d=\lambda _{1}\geq \lambda _{2}\geq \cdots \geq \lambda _{n}}$, let ${\displaystyle Q}$ be the transition matrix of the lazy random walk on ${\displaystyle G}$, and ${\displaystyle \pi =({\frac {1}{n}},\ldots ,{\frac {1}{n}})}$ be the uniform distribution. For any initial distribution ${\displaystyle q}$, ${\displaystyle \|qQ^{t}-\pi \|_{1}\leq {\sqrt {n}}\left({\frac {1+{\frac {1}{d}}\lambda _{2}}{2}}\right)^{t}}$. In particular, the lazy random walk converges exponentially fast when the spectral gap ${\displaystyle (d-\lambda _{2})}$ is a constant ${\displaystyle >0}$.

Due to the Cheeger's inequality, expander graphs have constant spectral gap, thus the lazy random walk on an expander graph converges exponentially fast.

## Rapid Mixing of Random Walks

We see that the mixing performance of a random walk on an undirected graph is determined by the expansion ratio of the graph. We now consider the random walks in a more general setting, and study the mixing performance of a general class of Markov chains.

### Mixing Time

The mixing time of a Markov chain gives the time of the chain to approach the stationary distribution. To formally define the mixing time, we need a notion of the distance between two probability distributions.

Let ${\displaystyle p}$ and ${\displaystyle q}$ be two probability distributions over the same finite state space ${\displaystyle {\mathcal {S}}}$, the total variation distance between ${\displaystyle p}$ and ${\displaystyle q}$ is defined as

${\displaystyle {\frac {1}{2}}\sum _{i\in {\mathcal {S}}}|p_{i}-q_{i}|}$,

which we can express as the ${\displaystyle \ell _{1}}$-distance ${\displaystyle {\frac {1}{2}}\|p-q\|_{1}.}$

You may have encountered the concept of total variation before, and it might be defined differently, as

${\displaystyle \max _{A\subset {\mathcal {S}}}|p(A)-q(A)|.}$

It is not hard to see that the two definitions are equivalent and

${\displaystyle \max _{A\subset {\mathcal {S}}}|p(A)-q(A)|={\frac {1}{2}}\sum _{i\in {\mathcal {S}}}|p_{i}-q_{i}|={\frac {1}{2}}\|p-q\|_{1}.}$

Here we prefer to use our version, because it is convenient to use the tools for norms to analyze it.

 Definition (mixing time) For a Markov chain with finite state space ${\displaystyle {\mathcal {S}}}$, transition matrix ${\displaystyle P}$, and stationary distribution ${\displaystyle \pi }$, the total variation distance at time ${\displaystyle t}$ with initial state ${\displaystyle i\in {\mathcal {S}}}$ is defined as ${\displaystyle \Delta _{i}(t)={\frac {1}{2}}\sum _{j\in {\mathcal {S}}}|P^{t}(i,j)-\pi (j)|={\frac {1}{2}}\|{\boldsymbol {e}}_{i}P^{t}-\pi \|_{1}}$ where ${\displaystyle {\boldsymbol {e}}_{i}}$ is the vector that ${\displaystyle {\boldsymbol {e}}_{i}(i)=1}$ and ${\displaystyle {\boldsymbol {e}}_{i}(j)=0}$ for ${\displaystyle j\neq i}$. We define that ${\displaystyle \tau _{i}(\epsilon )=\min\{t\mid \Delta _{i}(t)\leq \epsilon \}}$ and ${\displaystyle \tau (\epsilon )=\max _{i\in {\mathcal {S}}}\tau _{i}(\epsilon )}$.

${\displaystyle \tau _{i}(\epsilon )}$ is the first time that a chain starting from state ${\displaystyle i}$ approaches its stationary distribution within a total variation distance of ${\displaystyle \epsilon }$, and ${\displaystyle \tau (\epsilon )}$ is the maximum of these values over all states. While ${\displaystyle \tau (\epsilon )}$ is described as a function of ${\displaystyle \epsilon }$, it is generally referred as the mixing time of the Markov chain.

For the efficiency of randomized algorithms, we are interested in the random walks that converges "fast". Measured by the mixing time, we need the mixing time to be "small". Recall that the mixing time ${\displaystyle \tau (\epsilon )}$ is a function. So what we really mean is that as a function, the mixing time grows slowly as its input become larger.

The mixing time ${\displaystyle \tau (\epsilon )}$ has an input ${\displaystyle \epsilon }$ which is the distance to the stationary distribution, and there is another hidden parameter for ${\displaystyle \tau (\epsilon )}$, namely, the size of the state space ${\displaystyle N=|{\mathcal {S}}|}$. The parameter ${\displaystyle \epsilon }$ gives the error bound, and ${\displaystyle N}$ reflects the size of the problem.

A random walk is called rapid mixing if its mixing time ${\displaystyle \tau (\epsilon )}$ is poly-logarithmic of both ${\displaystyle N}$ and ${\displaystyle {\frac {1}{\epsilon }}}$, i.e. when

${\displaystyle \tau (\epsilon )=O((\log N+\log(1/\epsilon ))^{C})\,}$

for some constant ${\displaystyle C}$.

### The eigenvalue approach

Let ${\displaystyle P}$ be the transition matrix of a Markov chain, and let ${\displaystyle \pi }$ be the stationary distribution, such that ${\displaystyle \pi P=\pi }$. For any initial distribution ${\displaystyle q}$, the distribution of the chain at time ${\displaystyle t}$ is give by ${\displaystyle qP^{t}}$. The total variation at time ${\displaystyle t}$ is governed by the ${\displaystyle \ell _{1}}$-distance

${\displaystyle \|qP^{t}-\pi \|_{1}}$.

But how to estimate this? Not surprisingly, it can be answered by looking at the eigenvalues of ${\displaystyle P}$.

Let ${\displaystyle \lambda _{1}\geq \lambda _{2}\geq \cdots \geq \lambda _{n}}$ be the eigenvalues of ${\displaystyle P}$.

Remark:
The eigenvalues are now of the transition matrix ${\displaystyle P}$ instead of the adjacency matrix of a graph. With the same argument as the spectrum of graphs, we can show that ${\displaystyle \lambda _{1}=1}$ and ${\displaystyle |\lambda _{i}|\leq 1}$ for all ${\displaystyle i}$, and for irreducible chains, ${\displaystyle \lambda _{1}>\lambda _{2}}$. Therefore, for irreducible Markov chains,
${\displaystyle 1=\lambda _{1}>\lambda _{2}\geq \cdots \geq \lambda _{n}\geq -1}$.

Why should we care about eigenvalues of ${\displaystyle P}$? Recall that ${\displaystyle \lambda \neq 0}$ is an eigenvalue of ${\displaystyle P}$ if for some vector ${\displaystyle v}$,

${\displaystyle Pv=\lambda v}$,

where ${\displaystyle v}$ is called an eigenvector. The eigenvalues are the solutions to the ${\displaystyle \det(A-\lambda I)=0}$.

For our purpose, we are interested in the left-eigenvalues and left-eigenvectors, such that

${\displaystyle vP=\lambda v}$.

Note that the left-eigenvalues are equal to the right-eigenvalues, because

${\displaystyle \det(A-\lambda I)=\det(A^{T}-\lambda I)}$,

however, the left-eigenvectors may be different from right-eigenvectors.

Let ${\displaystyle v_{1},v_{2},\ldots ,v_{n}}$ be the (left)eigenvectors corresponds to the eigenvalues ${\displaystyle \lambda _{1}\geq \lambda _{2}\geq \cdots \geq \lambda _{n}}$. A key observation is that if ${\displaystyle P}$ is symmetric (that is, ${\displaystyle P^{T}=P}$), the eigenvectors are orthogonal to each other, thus can be treated as orthogonal basis, which means that any vector ${\displaystyle q}$ can be uniquely represented as

${\displaystyle q=c_{1}v_{1}+c_{2}v_{2}+\cdots +c_{n}v_{n}}$,

for some scalars ${\displaystyle c_{1},c_{2},\ldots ,c_{n}}$. Furthermore, we can choose the first component as ${\displaystyle c_{1}v_{1}=\pi }$, because we know that ${\displaystyle \pi }$ is the left-eigenvector with the largest eigenvalue ${\displaystyle 1}$. Thus,

${\displaystyle q=\pi +c_{2}v_{2}+\cdots +c_{n}v_{n}}$.

Then by the linearity, an action of ${\displaystyle P}$ can be computed by

${\displaystyle qP=\left(\pi +\sum _{i=2}^{n}c_{i}v_{i}\right)P=\pi P+\sum _{i=2}^{n}(c_{i}v_{i}P)=\pi +\sum _{i=2}^{n}\lambda _{i}c_{i}v_{i}.}$

Thus, multiplying ${\displaystyle P}$ corresponds to multiplying an eigenvalue to the scalar corresponding to each basis. Repeating this process, we have

${\displaystyle qP^{t}=\pi +\sum _{i=2}^{n}\lambda _{i}^{t}c_{i}v_{i}.}$

So the difference between the distribution of the chain and the stationary distribution is shrinking by a factor of ${\displaystyle \lambda _{\max }=\max(|\lambda _{2}|,|\lambda _{n}|)}$ at each step. This explain why we care about ${\displaystyle \lambda _{\max }}$, because it dominates the rate at which the difference shrinks.

However, right now this beautiful theory holds only when the transition matrix ${\displaystyle P}$ is symmetric. In some special case, such as the random walk on a ${\displaystyle d}$-regular graph, the transition matrix is indeed symmetric, but for various applications of Markov chains, the transition matrix is not necessarily symmetric. We will see that there is a more general class of Markov chains for which we can apply the similar technique as when the transition matrix is symmetric.

### Reversibility

We restrict ourselves to a special class of Markov chains call time-reversible Markov chains.

 Definition (time-reversible) A Markov chain with finite state space ${\displaystyle {\mathcal {S}}}$, transition matrix ${\displaystyle P}$, and stationary distribution ${\displaystyle \pi }$ is said to be time-reversible if for all ${\displaystyle i,j\in {\mathcal {S}}}$ ${\displaystyle \pi _{i}P_{i,j}=\pi _{j}P_{j,i}.\,}$

For reversible chains, its stationary distribution shows a stronger equilibrium property: not only the stationary is unchanged under the action of transition, but also when the chain is stationary, it has equal chance to move from ${\displaystyle i}$ to ${\displaystyle j}$ and from ${\displaystyle j}$ to ${\displaystyle i}$.

Example
• A symmetric random walk (${\displaystyle P}$ is symmetric) is time-reversible.
• Random walks on undirected graphs (not necessarily ${\displaystyle d}$-regular) are time-reversible.

The name "time-reversible" is due to the following fact:

Let ${\displaystyle X_{0},X_{1},\ldots ,X_{n}}$ be a time-reversible Markov chain whose initial distribution is the stationary distribution ${\displaystyle \pi }$, then the distribution of the reversed sequence ${\displaystyle X_{n},X_{n-1},\ldots ,X_{0}}$ is exactly the same as ${\displaystyle X_{0},X_{1},\ldots ,X_{n}}$, formally, for any states ${\displaystyle x_{0},x_{1},\ldots ,x_{n}}$,
${\displaystyle \Pr[X_{0}=x_{0}\wedge X_{1}=x_{1}\wedge \ldots \wedge X_{n}=x_{n}]=\Pr[X_{0}=x_{n}\wedge X_{1}=x_{n-1}\wedge \ldots \wedge X_{n}=x_{0}]}$.

Although for a time-reversible Markov chain, the transition matrix ${\displaystyle P}$ is not necessarily symmetric, we can make a symmetric matrix out of it.

### Mixing time of reversible chains

For a time-reversible ${\displaystyle P}$ and stationary distribution ${\displaystyle \pi }$, it holds that ${\displaystyle \pi _{i}P_{i,j}=\pi _{j}P_{j,i}}$. Divide both sides by ${\displaystyle {\sqrt {\pi _{i}\pi _{j}}}}$, we have

${\displaystyle {\sqrt {\frac {\pi _{i}}{\pi _{j}}}}P_{i,j}={\sqrt {\frac {\pi _{j}}{\pi _{i}}}}P_{j,i}.}$

This shows that the matrix ${\displaystyle S}$ with entries

${\displaystyle S_{i,j}={\sqrt {\frac {\pi _{i}}{\pi _{j}}}}P_{i,j},}$

is symmetric. Let ${\displaystyle \Pi }$ be the diagonal matrix given by ${\displaystyle \Pi _{i,i}={\sqrt {\pi _{i}}}}$. Then ${\displaystyle S}$ can be written as ${\displaystyle S=\Pi P\Pi ^{-1}\,}$, therefore, for any time-reversible Markov chain, its transition matrix ${\displaystyle P}$ can be written as

${\displaystyle P=\Pi ^{-1}S\Pi \,}$

where ${\displaystyle S}$ is symmetric, and has the same eigenvalues as ${\displaystyle P}$ (although the eigenvectors may be different), and for any initial distribution ${\displaystyle q}$,

${\displaystyle qP^{t}=q(\Pi ^{-1}S\Pi )^{t}=q\Pi ^{-1}S^{t}\Pi \,}$.

Because ${\displaystyle S}$ is symmetric, its eigenvectors are orthogonal basis and the same spectral technique works. This again will give us a nice characterization of the mixing time by ${\displaystyle \lambda _{\max }=\max(|\lambda _{2}|,|\lambda _{n}|)}$ of ${\displaystyle P}$, and prove the following theorem (the details of the proof are omitted).

 Theorem For a time-reversible Markov chain with finite state space ${\displaystyle {\mathcal {S}}}$ and transition matrix ${\displaystyle P}$, let ${\displaystyle \lambda _{1}\geq \lambda _{2}\geq \cdots \geq \lambda _{n}}$ be the eigenvalues of ${\displaystyle P}$. For any state ${\displaystyle i\in {\mathcal {S}}}$, ${\displaystyle \Delta _{i}(t)\leq {\frac {1}{2}}\lambda _{\max }^{t}{\sqrt {\frac {1-\pi _{i}}{\pi _{i}}}}}$, where ${\displaystyle \lambda _{\max }=\max(|\lambda _{2}|,|\lambda _{n}|)}$ is the largest absolute value of eigenvalues other than ${\displaystyle \lambda _{1}=1}$.

The theorem about the mixing time of random walks on expander graphs is a special case of the above theorem.

It is convenient to express the mixing rate as a function in the form of ${\displaystyle \exp(\cdot )}$, so its natural logarithm looks nicer. We observe that

${\displaystyle \lambda _{\max }=1-(1-\lambda _{\max })\leq e^{-(1-\lambda _{\max })},}$

and thus

${\displaystyle \lambda _{\max }^{t}\leq e^{-(1-\lambda _{\max })t}.}$

The theorem is turned to

${\displaystyle \Delta _{i}(t)\leq {\frac {1}{2}}e^{-(1-\lambda _{\max })t}{\sqrt {\frac {1-\pi _{i}}{\pi _{i}}}}.}$

Solving the ${\displaystyle \Delta _{i}(t)=\epsilon }$ gives us the mixing time:

 Corollary (mixing time of reversible chain) For a time-reversible Markov chain, ${\displaystyle \tau _{i}(\epsilon )=O\left({\frac {\ln(1/\pi _{i})+\ln(1/\epsilon )}{1-\lambda _{\max }}}\right)}$

For a lazy random walk, where the transition matrix is ${\displaystyle Q={\frac {1}{2}}(I+P)}$, it is easy to see that ${\displaystyle Q}$ is also time-reversible and has the same stationary distribution and ${\displaystyle P}$, and the eigenvalues of ${\displaystyle Q}$ are all nonnegative, thus ${\displaystyle \lambda _{\max }=\lambda _{2}}$.

From now on, we only consider lazy random walks and always assume that ${\displaystyle \lambda _{\max }=\lambda _{2}}$.

 Theorem (mixing time of reversible lazy random walk) For a time-reversible lazy random walk, that is, for a time-reversible Markov chain whose transition matrix ${\displaystyle P\,}$ has ${\displaystyle P_{i,i}\geq {\frac {1}{2}}}$ for all ${\displaystyle i\in {\mathcal {S}}}$, ${\displaystyle \tau _{i}(\epsilon )=O\left({\frac {\ln(1/\pi _{i})+\ln(1/\epsilon )}{1-\lambda _{2}}}\right)}$. In particular, when the stationary distribution is uniform, the mixing time ${\displaystyle \tau (\epsilon )=O\left({\frac {\ln N+\ln(1/\epsilon )}{1-\lambda _{2}}}\right)}$, where ${\displaystyle N=|{\mathcal {S}}|}$.

The random walk is rapid mixing if the spectral gap ${\displaystyle (1-\lambda _{2})}$ is larger than ${\displaystyle {\frac {1}{(\log N)^{c}}}}$ for some constant ${\displaystyle c}$.

## Reference

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