Computational Complexity Savitch's Theorem, Lecture Notes - Computer Science, Study notes of Computational Methods

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

2010/2011

Uploaded on 10/28/2011

thecoral
thecoral 🇺🇸

4.5

(30)

395 documents

1 / 4

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CS221: Computational Complexity Prof. Salil Vadhan
Lecture 9: Savitch’s theorem, NL =co-NL
10/9 Scribe: Nicholas Shiftan
Contents
1 Proving Reachability is NL-Complete 1
2 NSPACE vs. TIME 1
3 NSPACE vs. SPACE 2
4 NSPACE vs. co-NSPACE 3
1 Proving Reachability is NL-Complete
First, we define the Reachability problem:
RCH ={(G, s, t) : a path from sto tin 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 LNL to the question
of Reachability . Given any language LNL,a logspace NTM which accepts L. Given an
instance x, we can construct a 3-tuple (G, s, t) such that a path sÃtxL. We construct
this tuple as follows.
Let G= (V, E ) be the configuration graph of Mon x, where Vrepresents all possible configurations
of Mon x. (Note that Gis of size poly(|x|) because Gbecause Mis logspace.) As we could guess,
we define Eto represent all legal movements from one configuration to another. Formally, E=
{(u, v) : one can get from config uto config vin one timestep}. In other words, this represents the
transition table acting on configurations. We let s= the initial configuration of Mon 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.
2 NSPACE vs. TIME
There are a number of corollaries to Theorem 1.
1
pf3
pf4

Partial preview of the text

Download Computational Complexity Savitch's Theorem, Lecture Notes - Computer Science and more Study notes Computational Methods in PDF only on Docsity!

CS221: Computational Complexity Prof. Salil Vadhan

Lecture 9: Savitch’s theorem, NL = co-NL

10/9 Scribe: Nicholas Shiftan

Contents

1 Proving Reachability is NL-Complete 1

2 NSPACE vs. TIME 1

3 NSPACE vs. SPACE 2

4 NSPACE vs. co-NSPACE 3

1 Proving Reachability is NL-Complete

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.

2 NSPACE vs. TIME

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).

3 NSPACE vs. SPACE

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.