Derive Savitch's Space Bound
Analyze recursive bounded reachability without charging for the whole recursion tree.
Assignment sources
Problem
A configuration graph has vertices, each encoded in bits. Analyze a deterministic recursive test for reachability within steps and show it uses space.
Hint 1
Test a path of length at most by trying each midpoint and making two recursive calls with parameter .
Hint 2
The two calls and the different midpoint trials run sequentially. Charge one stack frame per recursion depth, not one per recursion-tree node.
Full solution
Define . At , accept exactly when or one edge leads from to . Otherwise enumerate each configuration and accept if both and accept.
An induction proves that accepts exactly when a path of length at most exists: split any such path at its midpoint, and concatenate the two recursively witnessed half-paths in the converse direction.
Choose . One frame stores a constant number of configurations, a midpoint counter, and , totaling bits. Memory is reused after each recursive return, so
At depth , this gives .
Checkpoint
The algorithm may take enormous time. Savitch's theorem is a space simulation, and sequential exploration is what keeps space small.
Provenance note
This is an original walkthrough of the standard Savitch recurrence; student submissions are not evidence for correctness.
Common mistakes
- Skipping a direction of correctness or an input-format edge case.
- Measuring resources against a numeric value rather than encoded input length.
- Treating an informal intuition as a proof of the stated bound.
Sources and verification
- Merged summary, pp. 124-127
- Sipser 3e, sec. 8.1
- Arora-Barak draft, sec. 4.2
- Catalog mapping:
data/exercises.json; statements and solutions are independently written; personal submissions are non-authoritative.