# 随机算法 (Fall 2011)/Graph Connectivity

USTCON stands for undirected ${\displaystyle s}$-${\displaystyle t}$ connectivity. It is the problem which asks whether there is a path from vertex ${\displaystyle s}$ to vertex ${\displaystyle t}$ in a given undirected graph ${\displaystyle G(V,E)}$. This problem is an abstraction of various search problems in graphs, and has theoretical significance in complexity theory.

The problem can be solved deterministically by traversing the graph ${\displaystyle G(V,E)}$, which takes ${\displaystyle \Omega (n)}$ extra space to keep track of which vertices have been visited, where ${\displaystyle n=|V|}$. And the following theorem is implied by the upper bound on the cover time.

 Theorem (Aleliunas-Karp-Lipton-Lovász-Rackoff 1979) USTCON can be solved by a polynomial time Monte Carlo randomized algorithm with bounded one-sided error, which uses ${\displaystyle O(\log n)}$ extra space.

The algorithm is a random walk starting at ${\displaystyle s}$. If the walk reaches ${\displaystyle t}$ in ${\displaystyle 4n^{3}}$ steps, then return "yes", otherwise return "no".

It is obvious that if ${\displaystyle s}$ and ${\displaystyle t}$ are disconnected, the random walk from ${\displaystyle s}$ can never reach ${\displaystyle t}$, thus the algorithm always returns "no".

We know that for an undirected ${\displaystyle G}$, the cover time is ${\displaystyle <4nm<2n^{3}}$. So if ${\displaystyle s}$ and ${\displaystyle t}$ are connected, the expected time to reach ${\displaystyle t}$ from ${\displaystyle s}$ is ${\displaystyle <2n^{3}}$. By Markov's inequality, the probability that it takes longer than ${\displaystyle 4n^{3}}$ steps to reach ${\displaystyle t}$ from ${\displaystyle s}$ is ${\displaystyle <1/2}$.

The random walk use ${\displaystyle O(\log n)}$ bits to store the current position, and another ${\displaystyle O(\log n)}$ bits to count the number of steps. So the total space used by the algorithm inaddition to the input is ${\displaystyle O(\log n)}$.

This shows that USTCON is in the complexity class RL (randomized log-space).

Story in complexity theory

If the randomness is forbidden, it is known that USTCON can be solved nondeterministically in logarithmic space, thus USTCON is in NL. In fact USTCON is complete for the symmetric version of nondeterministic log-space. That is, every problem in the class of SL can be solved by USTCON via log-space reductions. Therefore, USTCON${\displaystyle \in }$RL implies that SL${\displaystyle \subseteq }$RL.

In 2004, Reingold shows that USTCON can be solved deterministically in log-space, which proves SL=L. The deterministic algorithm for USTCON is by the derandomization of random walk.

It is conjectured that RL=L, but this is still open.