PSPACE-Completeness & Savitch's Theorem 1 Recap
Total Page:16
File Type:pdf, Size:1020Kb
CSE 200 Computability and Complexity Wednesday, April 24, 2013 Lecture 8: PSPACE-Completeness & Savitch's Theorem Instructor: Professor Shachar Lovett Scribe: Dongcai Shen 1 Recap: Space Complexity Recall the following definitions on space complexity we learned in the last class: SPACE(S(n))def= \languages computable by a TM where input tape is readonly and work tape size S(n)" LOGSPACEdef= SPACE(O(log n)) def c PSPACE = [c≥1 SPACE(n ) For example, nowadays, people are interested in streaming algorithms, whose space requirements are low. So researching on space complexity can have real-world influence, especially in instructing people the way an algorithm should be designed and directing people away from some impossible attempts. Definition 1 (Nondeterministic Space NSPACE) The nondeterministic space NSPACE(S(n))def= • Input tape, read-only. • Proof tape, read-only & read-once. • Work tape size S(n). So, we can define • NLdef= NSPACE(O(log n)). def c • NPSPACE = [c≥1 NSPACE(n ). def Theorem 2 PATH = f(G; s; t): G directed graph, s; t vertices, there is a path s t in Gg is NL-complete un- der logspace reduction. Corollary 3 If we could find a deterministic algorithm for PATH in SPACE(O(log n)), then NL = L. Remark. Nondeterminism is pretty useless w.r.t. space. We don't know whether NL = L yet. 2 Outline of Today Definition 4 (Quantified Boolean formula) A quantified Boolean formula is 8x19x28x39x4 ··· φ(x1; ··· ; xn) def where φ is a CNF. Let TQBF = fA true QBFg. Theorem 5 TQBF is PSPACE-complete under poly-time reduction (and actually under logspace reductions). 2 Theorem 6 (Savitch's Theorem [4]) NSPACE(S(n)) ⊆ SPACE(S (n)). Savitch's Theorem has two important direct implications concerning the relationship between deterministic space and nondeterministic space. Surprisingly, nondeterministic poly-space is the same as deterministic poly-space, while nondeterministic logspace can be solved in deterministic logspace square.1. 1 c c Notice L is not defined as [c≥1SPACE(log n) and NL is not defined as [c≥1NSPACE(log n). The log polynomial version def def c is called Steve's Class in honor of Steve Cook: polyL = SC = [c≥1 SPACE(log n) (See the text [1] Page 94 Exercise 4.12). 8-1 Corollary 7 • NL ⊆ SPACE(O(log(n)2)). • NPSPACE = PSPACE. On the other hand, people know the following related results: • UNDIRECTED-PATH (PATH in undirected graphs) is in L (Reingold [2]). • Randomized logspace ⊆ L3=2 (Saks and Zhou [3]). Definition 8 (co-NSPACE(·)) co-NSPACE(S(n))def= fL : Lc 2 NSPACE(S(n))g. Complete problem for co-NL is f(G; s; t): G directed graph, s; t vertices, there is no path s tg. 3 TQBF is PSPACE-Complete Theorem 9 ([5]) TQBF is PSPACE-complete under poly-time reduction. Proof =Q1 =Q2 =Q3 z}|{ z}|{ z}|{ Step #1: TQBF 2 PSPACE. Let = 9 x1 8 x2 9 x38x4 ··· φ(x1; ··· ; xn). Need to compute in def poly-space. Let = Q1x1Q2x2 ··· φ(x1; ··· ; xn) where Qi 2 f9; 8g. For 1 ≤ i ≤ n and values a1; ··· ; ai 2 f0; 1g define fi(a1; ··· ; ai) = Qi+1xi+1 ··· Qnxnφ(a1; ··· ; ai; xi+1; ··· ; xn). We have that • If Qi+1 = 9, then fi(a1; ··· ; ai) = fi+1(a1; ··· ; ai; 0) _ fi+1(a1; ··· ; ai; 1). • If Qi+1 = 8, then fi(a1; ··· ; ai) = fi+1(a1; ··· ; ai; 0) ^ fi+1(a1; ··· ; ai; 1). We want to compute φ = f0 and we know how to compute fn(a1; ··· ; an) = φ(a1; ··· ; an). The intuition is that we will compute f0 by exploring the tree of possible partial assignments by a DFS-like process. Formally, in order to compute fi(a1; : : : ; ai) we need to run two instances of fi+1. Note that we can run them using the same space, and we will need O(log n) overhead to remember indices, etc. So, if we compute fi+1 is space Si+1 then we can compute fi in space Si = Si+1 + O(log n). Overall, we can compute in space O(n log n), which is polynomial space. Step #2: TQBF is PSPACE-hard. Fix any language L 2 PSPACE. Consider its configuration graph G. c The number of nodes in G is N = exp(n ) for some c > 0. We need to know if there is a path vstart vaccept between the start and accept configurations of L. We note that to check if an edge (u; v) 2 G can be expressed by CNF φ(u; v) of size poly(n). A na¨ıve try. To check if there is a path vstart vaccept we write an exponential-sized formula: 9v19v2; · · · 9vN φ(vstart; v1) ^ φ(v1; v2) ^ · · · ^ φ(ui−1; uN ) ^ φ(uN ; vaccept): This is problematic since the formula is of exponential size, and we would like a polynomial size formula. def i Attempt to reduce size. Let reachi(u; v) = "there is a path u v of length ≤ 2 ". Then reachi+1(u; v) = 9w reachi(u; w) ^ reachi(w; v): However, it's still of exponential size. The trick to get polynomial size is to use the 8 quantifier. Polynomial size: We can write reachi+1(u; v) as reachi+1(u; v) = 9w8a8b((a = u ^ b = w) _ (a = w ^ b = v)) ) reachi(a; b): Note that this way, the size of the formula for reachi+1 is only a constant size larger then then of reachi. Apply this log N = nc times, we get a QBF of size O(nc) which is true iff x 2 L. Note that we obviously did a poly-time reduction. A careful examination of the proof shows that the reduction runs in fact in logspace. 8-2 4 Savitch's Theorem We prove Savitch's Theorem: NSPACE(S(N)) ⊂ SPACE(S2(n)). We will prove it for S(n) = O(log n), and it is a simple exercise to see this implies the theorem for all S(n) ≥ log(n). 2 Theorem 10 (Savich's Theorem [4]) NL ⊆ SPACE(log n). Proof Need to show: given a directed graph G on n vertices; s; t are vertices in G; can check if there is 2 def i a path s t using only O(log n) space. Let reachi(u; v) = \there exists a path u v of length ≤ 2 ". As before, we will use the fact that reachi+1(u; v) = 9w reachi(u; w) ^ reachi(w; v): Note that if we can solve reachi in space Si then we can solve reachi+1 in space Si+1 = Si + O(log n), since we need O(log n) memory to enumerate w, and we can run the two instances of reachi sequentially using the same space for both. Formally, to solve reachi+1 we run the following algorithm: • run over all w = 1; ··· ; n. { α = reachi(u; w). { β = reachi(w; v). { If α = β = 1, output \Yes". • Output \No". 2 The total space we use is Slog n = O(log n). References [1] Sanjeev Arora and Boaz Barak. Computational Complexity - A Modern Approach. Cambridge University Press, 2009. [2] Omer Reingold. Undirected st-connectivity in log-space. In STOC, pages 376{385, 2005. 3/2 [3] Michael E. Saks and Shiyu Zhou. Bp hspace(s) subseteq dspace(s ). J. Comput. Syst. Sci., 58(2):376{ 403, 1999. [4] Walter J. Savitch. Relationships between nondeterministic and deterministic tape complexities. Journal of Computer and System Sciences, 4(2):177 { 192, 1970. [5] L. J. Stockmeyer and A. R. Meyer. Word problems requiring exponential time(preliminary report). In Proceedings of the fifth annual ACM symposium on Theory of computing, STOC '73, pages 1{9, New York, NY, USA, 1973. ACM. 8-3.