With a read-only input tape, deterministic space complexity class consists of languages decidable by deterministic Turing machines using work-tape cells. The nondeterministic space complexity class uses Nondeterministic Turing machines, with the bound holding on every computation path and acceptance meaning that some path accepts. Input storage is not charged. We use the standard finite-state, fixed-alphabet model.
The Savitch theorem isFirst suppose a work-space budget is available. A configuration graph for computations restricted to cells has configurations encoded in bits: work contents, control state and head positions, including bits for the input head. Its size is at most for a machine-dependent constant . Add accept and exit sinks if needed; the size bound merely changes . A reachable configuration has a simple path of length smaller than the number of configurations.
For encoded configurations , define to ask whether a path of length at most exists. At , test equality or one transition. For , enumerate every candidate middle configuration and testAny path of the given length can be split into two halves of length at most ; conversely concatenation gives a path of length at most . This proves the recursion. Taking suffices. Depth is , and each recursive frame stores only its endpoints, the current middle configuration and counters in bits. The two recursive calls are made sequentially and reuse their space. The total is , even though the time can be very large.
The printed hypothesis does not say that is computable. The space-bound discovery by exit reachability removes that issue. Begin with and use the preceding recursion to test both whether an accepting state is reachable within the budget and whether a reachable state has a transition leaving the budget. Accept in the first case. If acceptance is absent and an exit is reachable, double and repeat. If neither is reachable, reject: all computations remain within this finite configuration graph, and none accepts.
Every path of the original machine uses at most cells. Once reaches that bound there can be no reachable exit, so this procedure terminates. The final budget is by doubling, and all stages reuse the same storage. Hence its deterministic space is without requiring a machine that first computes . This proves the stated general form.
Here a directed cycle has at least one edge. If zero-length paths were treated as cycles, an edgeless one-vertex graph would already satisfy the predicate; that convention would give the trivial nonempty-graph predicate instead of the intended directed cycle detection problem.
For NL membership, guess a starting vertex , follow a guessed directed walk for between one and edges, and accept if it returns to . Store only the start, current vertex and step counter. A graph with a nonempty closed walk contains a simple directed cycle of at most edges, including a self-loop if present. Thus the algorithm uses logarithmic space and is complete for the predicate.
For hardness, reduce the directed graph reachability problem to cycle detection. Form and add the single backward arcAll layering arcs advance exactly one layer, including the waiting arcs , so the layered graph alone is a Directed acyclic graph. Any cycle in the augmented graph must contain the backward arc and therefore contains a path from to .
If is reachable from in , use a simple path of length at most and pad it with waits to exactly steps. It becomes the required layered path and closes to a cycle. Conversely, projecting such a layered path and deleting waits gives a walk from to in . This includes the case , where reachability has a zero-length witness but the augmented graph has a genuinely positive-length cycle.
There are vertices and polynomially many arcs. A transducer enumerates pairs/layers and checks old adjacency by scanning its input, using only bits. Hence this is a logspace many-one reduction, proving
Articles by others on the same topic
There are currently no matching articles.