


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Prof. Salil Vadhan, Computer Science, Computational Complexity, Savitch’s theorem, NSPACE vs. TIME, NSPACE vs. SPACE, NSPACE vs. co-NSPACE, Harvard, Lecture Notes
Typology: Study notes
1 / 4
This page cannot be seen from the preview
Don't miss anything!



CS221: Computational Complexity Prof. Salil Vadhan
10/9 Scribe: Nicholas Shiftan
1 Proving Reachability is NL-Complete 1
2 NSPACE vs. TIME 1
3 NSPACE vs. SPACE 2
4 NSPACE vs. co-NSPACE 3
First, we define the Reachability problem:
RCH = {(G, s, t) : ∃ a path from s to t in G}
where G is a directed graph.
Theorem 1 Reachability is NL-complete.
Proof: To prove that Reachability is NL-complete, we need prove that RCH ∈ NL and that RCH is NL-hard. We proved that RCH ∈ NL in the last lecture. To prove that RCH is NL-hard, we will attempt to reduce the problem of deciding any arbitrary language L ∈ NL to the question of Reachability. Given any language L ∈ NL, ∃ a logspace NTM which accepts L. Given an instance x, we can construct a 3-tuple (G, s, t) such that ∃ a path s √ t ⇔ x ∈ L. We construct this tuple as follows.
Let G = (V, E) be the configuration graph of M on x, where V represents all possible configurations of M on x. (Note that G is of size poly(|x|) because G because M is logspace.) As we could guess, we define E to represent all legal movements from one configuration to another. Formally, E = {(u, v) : one can get from config u to config v in one timestep}. In other words, this represents the transition table acting on configurations. We let s = the initial configuration of M on x, and we lot t = the accepting configuration. Without loss of generality, we assume that there is a unique accepting configuration; were there more than one, once could easily add 1 additional state and 1 additional transition such that they all ended up in the same final configuration.
There are a number of corollaries to Theorem 1.
Corollary 2 NL ⊆ P
Proof: RCH ∈ P (via a Breadth-First-Search), and P is closed under reductions.
Corollary 3 NSPACE(f (n)) ⊆
c TIME( cf (n)) for all proper f (n) ≥ log n
Proof: We can prove this via padding. Let g(n) = 2f^ (n). Then NSPACE(log g(n)) ⊆ TIME(g(n)c).
Recall: Breadth-First-Search takes Space Θ(n).
Theorem 4 (Savitch) RCH ∈ SPACE(log^2 n) def = L^2
Note: You can find this proof on page 149 of Papadimitriou
Proof: First, some definitions. Given a graph G = (V, E) and nodes x, y ∈ V , we define the predicate PATH as follows:
PATH(G, x, y, i) =
TRUE if ∃ a path of length ≤ 2 i^ from x to y FALSE otherwise
An immediate result of this definition is that we can now define the Reachability problem in terms of deciding PATH. After all, it follows that
(G, s, t) ∈ RCH ⇔ PATH(G, s, t, dlog ne) = TRUE.
So, how we do decide PATH(G, s, t, i) in Log Space? The answer lies in a simple fact: if ∃ a path s √ t, then there are two distinct possiblities. Either (s, t) ∈ E, or ∃ some vertex x ∈ V such that s √ x and x √ t. It should also be noted that if we’re looking for a path s √ t on length < 2 i, then we can also find an x such that both the path s √ x and the path x √ t are of length < 2 i−^1.
Thus, a we will use a recursive algorithm to decide PATH. Consider the following algorithm:
PATH(G, x, y, i) {
. if i = 0 { . if x = y return TRUE; . else return FALSE; . } . for each vertex z ∈ V { . if PATH(x, z, i − 1) ∧ PATH(z, y, i − 1) return TRUE; . } . return FALSE; }
A brief argument needs to be made to explain why this algorithm is, in fact, ∈ L^2. The logic is fairly straightforward. Suppose we have a 4-tape TM, with an input tape, an output tape, and
of length ≤ k}. Let Nk = |Sk|. Our goal is clearly to determine Nn− 1. We know that S 0 = {s}. Thus, given Nk, we will need to inductively compute Nk+1.
HowManyReachable(G, s) {
. N 0 = 0; . for k = 1, 2 , ..., n − 1 {; . Nk = 0; . for all vertices u { . reply = FALSE; . count = 0; . for all vertices v { . guess path p of length ≤ k + 1 from s; . if p ends at v, count ← count + 1; . if (v, u) ∈ E, reply = TRUE; . } . if reply = TRUE Nk ← Nk + 1; . if reply = FALSE && count < Nk− 1 , then HALT and "FAIL"; . } . } . return Nn− 1 ; }
Note: I highly recommend reading Papadimitrious’s explanation of the algorithm as he breaks the code down into four very simple subroutines.