Savitch's Theorem
Savitch's Theorem
Savitch's Theorem
Theorem 1. NL P
Coniguration graphs of space-bounded TMs are a very useful tool for analyzing
space- bounded computation. As the next theorem shows a reachability problem for
graphs exactly captures the complexity of the class NL.
Deine ST - CON = {(G,s,t) | G is a directed graph with a path from s to t}.
1
it has only one accepting coniguration: after entering qaccept , the machine will
erase all of its work- tapes, and go to the irst non-blank symbol of its input
tape.)
Another representation of NL, which suggested to Immerman the idea of the proof
of NL = coNL (which we will do later today), is irst-order logic with a transitive
closure operator. Transitive closure is essentially reachability: a pair of vertices (s,t)
is in the
1
transitive closure of a graph if t is reachable from s. In the logic form, transitive closure
of a relation E is X satisfying the following:
X 0 (u,v) —E(u,v) Λ u = v
Xi+1 (u,v) —二 z < nXi (u,z) V Xi (z, v)
That is, it is the smallest value of X such that Xi+1 = Xi. In a more general case,
instead of the edge relation E we can put any irst-order formula φ, which may have X
as a free variable.
Recall from the proof of Fagin’s theorem that the correctness of a run of a Turing
ma- chine can be described by a irst-order formula (with arithmetic operators). Now,
together with the fact that a computation of an NL machine can be thought of as a
reachability in its coniguration graph, it is easy to see that FO(TC) (irst-order with
transitive closure) captures NL.
2. NPSPACE = PSPACE.
2
Proof of Savitch’s Theorem. We will design a log n-space algorithm that, given a
directed graph G = (V, E) with |V | = n nodes, and s,t e V , will accept if t is
reachable from s. (For convenience, we assume that (u,u) e E for every node u e V.)
The idea of the proof is similar to the second line of the deinition of transitive closure.
We design algorithm Path(x,y, i) which accepts if there is a path from x to y of
length at most 2i. Note that t is reachable from s if Path(s,t,log n) accepts. (Do you
see why?)
Algo Path(x,y, i)
if i = 0 then
Accept if (x,y) e E
end if
for every z e V
if Path(x,z, i 一 1) accepts AND
Path(z,y, i 一 1) accepts % we re-use space here!
then Accept
end if
end for
2
Reject % if no “middle” point z was found, we reject
end Algo
It is not hard to see that algorithm Path is correct. To analyze the space used,
note that the depth of the recursion is log n, and that the size of each“stack record”
during the
recursion is the size of (x,y, i) e O(log n). Thus, the total space used is O(log2 n).
2
It is still a big open problem to decide if NL = L. To show this, it would su 伍 ce to
give a deterministic logspace algorithm for ST-CON, the problem of st-connectivity for
directed graphs on n vertices. Interestingly, Reingold has recently showed that the st-
connectivity problem for undirected graphs is solvable in detereministic logspace! The
algorithm for doing this is highly nontrivial and not at all obvious; it is based on the
algebraic characterization of connectivity in graphs (in terms of the so-called eigenvalue
gap, the diference between the two largest eigenvalues of the adjacency matrix of a
given graph). This algorithmic success renewed the interest in the NL vs. L question.
Next we will see another surprising result showing that NL = coNL, something we
don’t expect to be true in the setting of time complexity classes. (This might be taken
as another piece of evidence pointing to the possibility of NL = L...)