\documentclass[11pt]{article}

\usepackage{amsmath,amssymb,complexity}
\usepackage{graphicx}

\textwidth=6in
\oddsidemargin=0.25in
\evensidemargin=0.25in
\topmargin=-0.1in
\footskip=0.8in
\parindent=0.0cm
\parskip=0.3cm
\textheight=8.00in
\setcounter{tocdepth} {3}
\setcounter{secnumdepth} {2}
\sloppy


\newtheorem{example}{Example}
\newtheorem{open-problem}{Open Problem}

\newcommand{\ATIME}{\ComplexityFont{ATIME}}
\newcommand{\ASPACE}{\ComplexityFont{ASPACE}}
\newcommand{\defeq}{\stackrel{\text{\tiny def}}{=}}

\begin{document}
\input{preamble.tex}
\lecture{18}{May 13, 2009}{Jayalal Sarma M.N.}{Hao Song}

In the first half of this lecture, we will present a randomized log space algorithm for
the connectivity problem on undirected graphs. In the second
half, we will introduce the concept of expander graphs, and illustrate its applications through
some examples.

\section{$\lang{USTCON}$ is in $\RL$}
First, let's state the undirected $u$-$t$ connectivity problem, or $\lang{USTCON}$ for short. In this problem,
we are given an undirected graph $G=(V, E)$ as represented by its adjacency matrix, and two vertices $u$
and $v$ of the graph, which are given as two indices into the vertex set $V$ of $G$. Let $n=|V|$.

To begin with, it is known that the $\lang{USTCON}$ problem is known
to characterise a complexity class called Symmetric Logspace
($\SL$). We will skip the details of this, as we will later prove a
stronger result that $\SL = \L$, namely that we will give a log-space
algorithm to test undirected connectivity.

But now, we will present a very simple randomized algorithm for
$\lang{USTCON}$ which is basically just a plain random walk, and
analyse its complexity.
\begin{enumerate}
  \item start a random walk from $s$
  \item if the current vertex is $t$, then stop and accept; otherwise, choose a random neighbor of the current
    vertex and set the curret vertex to that neighbor
  \item repeat the previous step $k$ times
  \item after that, stop and reject
\end{enumerate}

We will prove in a minute that
\begin{proposition}
There is a positive constant $c$ such that if $k\geq cn^{4}\log{n}$, and $s$ and $t$ are actually connected, 
then $$Pr[\mbox{the above algorithm rejects}]<\frac{1}{2}$$.
\label{prop:rw-error-bound}
\end{proposition}

And it's trivial to show that if $s$ and $t$ are not connected, then the above algorithm will always reject,
which means that
\begin{theorem}
$\lang{USTCON}\in\RL$
\end{theorem}

Now all we need to do is to justify proposition~\ref{prop:rw-error-bound}. In order to do that, we need to introduce
some results about random walks on graphs.

To make things simpler, we assume, without loss of generality, that the graph $G$ we are talking about is 3-regular.
Actually, by performing the transformation illustrated below on every vertex of the graph, we can transform every
graph into a 3-regular graph without affecting the connectivity of any pair of vertices in this graph. And it's easy
to see that the size of the graph won't blow up too much because of this transformation.

\begin{figure}
\centering
\includegraphics[width=7cm]{any_to_3-regular.eps}
\end{figure}

Suppose $A$ is the \emph{normalized} adjacency matrix of $G$ (because we are talking about a 3-regular graph, $A$ is
different from
the adjacency matrix of $G$ we commonly talk about only by a constant factor, namely, $1/3$), then starting from
an initial probability distribution on the vertex set $V$, represented by a $n$-dimensional vector $w$, after $k$
steps, the final distribution is $A^{k}w$.

An important fact about random walks on regular graphs is that the uniform distribution $u$ is stationary. This means
that $Au=u$, which is trivial to verify. And more importantly, any random walk on a non-bipartite\footnote{normally 
we don't care about this because every graph can be made non-bipartite by adding self-loops on every vertex},
connected, regular graph will converge towards this uniform distribution. And we can define the term \emph{mixing time}
informally to mean the upper limit of the time it takes for a random walk from an arbitrary initial distribution to get
 ``close enough'' to this uniform distribution.

We can prove that for the normalized adjacency matrix of a non-bipartite, connected graph, except for a simple eigenvalue
of 1 with eigenvector $u$, all its other eigenvalues will have absolute values less than 1. And we 
define the \emph{spectral gap} $\lambda$ to
be the difference between 1 and the maximum absolute value of the eigenvalues other than 1. This \emph{spectral gap} 
of a graph
 is closely related to the \emph{mixing time} of the random walks on the graph. Actually, we can prove the following
proposition
\begin{proposition}
For any positive integer $k$ and any distribution vector $w$, ${\lVert A^{k}w-u \rVert}_{2}\leq (1-\lambda)^{k}$
\end{proposition}
\begin{proof}
It's easy to show that for any distribution vector $w$, $w\cdot u=\frac{1}{n}$, thus $(w-u)\cdot u=0$, that is $w-u \perp u$.

Since $A$ has a simple eigenvalue 1, with corresponding eigenvector $u$, and $\lambda$ is the spectral gap. By
definition, we have 
$$
{\lVert Aw-u\rVert}_{2}={\lVert A(w-u)\rVert}_{2}\leq (1-\lambda){\lVert w-u\rVert}_{2}
$$

Apply this $k$ times, we get
$$
{\lVert A^{k}w-u\rVert}_{2}={\lVert A^{k}(w-u)\rVert}_{2}\leq (1-\lambda)^{k}{\lVert w-u\rVert}_{2}
$$
and
$$
{\lVert w-u\rVert}_{2}^{2}=(w-u)^{2}=w^{2}-2wu+u^{2}=w^{2}-\frac{1}{n}\leq 1
$$
thus
$$
{\lVert A^{k}w-u\rVert}_{2}\leq (1-\lambda)^{k}{\lVert w-u\rVert}_{2}\leq (1-\lambda)^{k}
$$
\end{proof}

We will prove in the next lecture that
\begin{claim}
For a $d$-regular, $n$-vertex graph $G$, its spectral gap is bounded from below, that is $\lambda\geq\frac{1}{8dn^{3}}$.
\end{claim}

This means that if we set $k$ to be $16dn^{3}\log{n}$, we will get
\begin{eqnarray*}
  {\lVert A^{k}w-u\rVert}_{2} & \leq & (1-\lambda)^{k} \\
                             & \leq & (1-\frac{1}{8dn^{3}})^{16dn^{3}\log{n}} \\
                             & = & \left[(1-\frac{1}{8dn^{3}})^{8dn^{3}}\right]^{2\log{n}} \\
                             & \leq & \left(\frac{1}{e}\right)^{2\log{n}} \\
                             & = & n^{-2}
\end{eqnarray*}

Thus we can start a random walk from an arbitrary initial distribution, and after some $O(n^{3}\log{n})$ steps, the
chance that we hit our desired destination $t$ (assuming that $t$ is reachable) is at least $n^{-1}-n^{-2}$. If we
repeat that $O(n)$ times, or, equivalently, just walk $O(n^{4}\log{n})$ steps, we will have a constant probability
(say, at least $\frac{1}{2}$) of hitting $t$. This completes the proof for proposition~\ref{prop:rw-error-bound}.

\section{Towards a Deterministic Logspace Algorithm for $\lang{USTCON}$}
In this section we will introduce expander graphs and Reingold's idea about showing that $\lang{USTCON}\in\L$ with
the help of those special graphs.
\subsection{Expander Graphs}
We have two essentially equivalent ways to define expander graphs. They are called spectral expansion and combinatorial
expansion
\begin{definition}
A graph $G$ is called a $(n, d, \lambda)$-spectral expander if it has $n$ vertices, is $d$-regular, and has a spectral
gap $\lambda$.
\end{definition}
\begin{definition}
A graph $G=(V, E)$ is called a $(n, d, \alpha)$-combinatorial expander if it has $n$ vertices, is $d$-regular, and
for any subset of the vertices $S\subseteq V$, if $|S|\leq\frac{1}{2}|V|$, then $|N(S)|=|\{u\in V\setminus S~:~u
\mbox{ has at least one neighbor in }S\}|\geq \alpha|S|$
\end{definition}

We will prove the equivalence of these two definitions in the coming lectures. And we can generalize the second 
definition above by replacing $\frac{1}{2}$ by an arbitrary positive constant $\beta\leq \frac{1}{2}$.

It's easy to see that
\begin{claim}
The diameter of a combinatorial expander graph $G$ is in $O(\log{n})$.
\end{claim}

\subsection{Reingold's Idea about $\lang{USTCON}\in\L$}
In 2004, Reingold proved that $\lang{USTCON}$ can actually be solved in $\L$. The intuitive idea is based on the 
following fact
\begin{claim}
The \lang{Reachability} problem can be solved in $\L$ for constant-degree expander graphs.
\end{claim}

With this fact in mind, all we need to do now is to come up with a transformation scheme that can take an arbitrary
graph and turn it into an appropriate expander graph, without blowing its size up too much, and preserve its
connectivity properties. This is exactly what Reingold did in his 2004 paper. We will talk about the details of
the proof in the next lecture.
\end{document}
