Logspace Computability 29
(ii) MAZE ∈ NLOGSPACE.
Part (ii) is easy, because we can trace our way through the given graph using
finitely many fingers, guessing the path from s to t nondeterministically.
To show (i), let A be an arbitrary element of NLOGSPACE .Wemust
show that A ≤
log
m
MAZE. Suppose M is a nondeterministic logspace-
bounded TM accepting A.Letstart and accept be the start and accept
configurations of M, respectively. We can assume without loss of generality
that accept is unique by making M erase its worktape and move its heads
all the way to the left before accepting. We build a graph G =(V, E), where
V is a finite set of configurations of M containing all configurations of M
on input x,andE is the next-configuration relation on input x.ThenM
accepts x iff there is a path from start to accept in G.
Recall that a configuration of M consists of the current state, the cur-
rent head positions, and the current contents of the worktape. For an input
x of length n, all this information takes only log n space to record, say as
astringoflengthlogn over an alphabet ∆ of size d. We can thus take
V =∆
log n
. This set is of size d
log n
= n
log d
. We take the edges E to be the
pairs (α, β) such that α and β are encodings of configurations of M and β
follows from α in one step on input x according to the transition rules of
M.
It remains to argue that this graph can be produced by a logspace
transducer on input x. The transducer first outputs the set of vertices
∆
log n
. This is easy: it lays off log n space on its worktape, then cycles
through all strings in ∆
log n
lexicographically, outputting them all. For the
edges, it writes down all pairs α, β in lexicographic order. For each pair,
it checks that they both encode configurations of M and that α goes to
β in one step on input x. It has to read the ith symbol of its input x to
determine this, where i is the position of the input head specified by α.If
so, it outputs the edge (α, β). Finally, it outputs the two strings encoding
the configurations start and accept.
Although the output (V,E, start, accept) is polynomial in length, only
logarithmic workspace was used to produce it, because there were only at
most two configurations of M written down on the transducer’s worktape
at any time. Thus the map x → (V,E,start, accept) is computable in
logspace and constitutes a reduction from A to MAZE. 2
Corollary 5.7 MAZE ∈ LOGSPACE iff LOGSPACE = NLOGSPACE.
Proof. Lemmas 5.1 and 5.2 and Theorem 5.6. 2
Omer Reingold [101] has very recently shown that the undirected graph
reachability problem is solvable in deterministic LOGSPACE .