Space and Nondeterminism

Similar documents
Lecture 8. MINDNF = {(φ, k) φ is a CNF expression and DNF expression ψ s.t. ψ k and ψ is equivalent to φ}

CSE200: Computability and complexity Space Complexity

6.841/18.405J: Advanced Complexity Wednesday, February 12, Lecture Lecture 3

Lecture 3. 1 Terminology. 2 Non-Deterministic Space Complexity. Notes on Complexity Theory: Fall 2005 Last updated: September, 2005.

Polynomial Time Computation. Topics in Logic and Complexity Handout 2. Nondeterministic Polynomial Time. Succinct Certificates.

Space is a computation resource. Unlike time it can be reused. Computational Complexity, by Fu Yuxi Space Complexity 1 / 44

CSC 5170: Theory of Computational Complexity Lecture 4 The Chinese University of Hong Kong 1 February 2010

1 PSPACE-Completeness

Lecture 20: PSPACE. November 15, 2016 CS 1010 Theory of Computation

Lecture 8: Complete Problems for Other Complexity Classes

P = k T IME(n k ) Now, do all decidable languages belong to P? Let s consider a couple of languages:

U.C. Berkeley CS278: Computational Complexity Professor Luca Trevisan 9/6/2004. Notes for Lecture 3

Lecture 7: The Polynomial-Time Hierarchy. 1 Nondeterministic Space is Closed under Complement

Notes on Space-Bounded Complexity

CSCI 1590 Intro to Computational Complexity

CS151 Complexity Theory. Lecture 4 April 12, 2017

Notes on Space-Bounded Complexity

Lecture 22: PSPACE

Space Complexity. The space complexity of a program is how much memory it uses.

Lecture 5: The Landscape of Complexity Classes

NP-Completeness I. Lecture Overview Introduction: Reduction and Expressiveness

Lecture 21: Space Complexity (The Final Exam Frontier?)

Notes on Complexity Theory Last updated: October, Lecture 6

Lecture 11: Proofs, Games, and Alternation

Lecture 4 : Quest for Structure in Counting Problems

Outline. Complexity Theory. Example. Sketch of a log-space TM for palindromes. Log-space computations. Example VU , SS 2018

Space Complexity. Master Informatique. Université Paris 5 René Descartes. Master Info. Complexity Space 1/26

The space complexity of a standard Turing machine. The space complexity of a nondeterministic Turing machine

MTAT Complexity Theory October 13th-14th, Lecture 6

Advanced topic: Space complexity

Lecture 8: Alternatation. 1 Alternate Characterizations of the Polynomial Hierarchy

Lecture 9: Polynomial-Time Hierarchy, Time-Space Tradeoffs

The Polynomial Hierarchy

6.045 Final Exam Solutions

1 More finite deterministic automata

INAPPROX APPROX PTAS. FPTAS Knapsack P

Notes for Lecture 3... x 4

CSCI 1590 Intro to Computational Complexity

Lecture Notes Each circuit agrees with M on inputs of length equal to its index, i.e. n, x {0, 1} n, C n (x) = M(x).

Introduction to Computational Complexity

Undirected ST-Connectivity in Log-Space. Omer Reingold. Presented by: Thang N. Dinh CISE, University of Florida, Fall, 2010

Theory of Computation Space Complexity. (NTU EE) Space Complexity Fall / 1

NP, polynomial-time mapping reductions, and NP-completeness

De Morgan s a Laws. De Morgan s laws say that. (φ 1 φ 2 ) = φ 1 φ 2, (φ 1 φ 2 ) = φ 1 φ 2.

Lecture 23: More PSPACE-Complete, Randomized Complexity

COMPLEXITY THEORY. PSPACE = SPACE(n k ) k N. NPSPACE = NSPACE(n k ) 10/30/2012. Space Complexity: Savitch's Theorem and PSPACE- Completeness

Time and space classes

PSPACE, NPSPACE, L, NL, Savitch's Theorem. More new problems that are representa=ve of space bounded complexity classes

CS154, Lecture 17: conp, Oracles again, Space Complexity

Lecture 9: PSPACE. PSPACE = DSPACE[n O(1) ] = NSPACE[n O(1) ] = ATIME[n O(1) ]

Apropos of an errata in ÜB 10 exercise 3

CSCI 1590 Intro to Computational Complexity

Complete problems for classes in PH, The Polynomial-Time Hierarchy (PH) oracle is like a subroutine, or function in

Umans Complexity Theory Lectures

CS Lecture 29 P, NP, and NP-Completeness. k ) for all k. Fall The class P. The class NP

6.840 Language Membership

MTAT Complexity Theory October 20th-21st, Lecture 7

Definition: Alternating time and space Game Semantics: State of machine determines who

POLYNOMIAL SPACE QSAT. Games. Polynomial space cont d

Circuits. Lecture 11 Uniform Circuit Complexity

SOLUTION: SOLUTION: SOLUTION:

Logarithmic space. Evgenij Thorstensen V18. Evgenij Thorstensen Logarithmic space V18 1 / 18

Complexity Theory 112. Space Complexity

Review of Basic Computational Complexity

Lecture 3: Reductions and Completeness

Umans Complexity Theory Lectures

Lecture 23: Alternation vs. Counting

CS278: Computational Complexity Spring Luca Trevisan

Lecture 6: Oracle TMs, Diagonalization Limits, Space Complexity

Polynomial Space. The classes PS and NPS Relationship to Other Classes Equivalence PS = NPS A PS-Complete Problem

/633 Introduction to Algorithms Lecturer: Michael Dinitz Topic: NP-Completeness I Date: 11/13/18

More Complexity. Klaus Sutner Carnegie Mellon University. Fall 2017

COMPLEXITY THEORY. Lecture 17: The Polynomial Hierarchy. TU Dresden, 19th Dec Markus Krötzsch Knowledge-Based Systems

Notes for Lecture 3... x 4

20.1 2SAT. CS125 Lecture 20 Fall 2016

Time-Space Tradeoffs for SAT

Essential facts about NP-completeness:

Computability and Complexity CISC462, Fall 2018, Space complexity 1

Introduction to Complexity Theory. Bernhard Häupler. May 2, 2006

Lecture 14: IP = PSPACE

U.C. Berkeley CS278: Computational Complexity Professor Luca Trevisan August 30, Notes for Lecture 1

1 Computational Problems

Lecture 22: Counting

Computability and Complexity Theory: An Introduction

conp, Oracles, Space Complexity

1 Reductions and Expressiveness

Notes for Lecture Notes 2

Announcements. Problem Set 7 graded; will be returned at end of lecture. Unclaimed problem sets and midterms moved!

Chapter 4: Computation tree logic

CSC 5170: Theory of Computational Complexity Lecture 9 The Chinese University of Hong Kong 15 March 2010

Theory of Computation. Ch.8 Space Complexity. wherein all branches of its computation halt on all

CSE 555 HW 5 SAMPLE SOLUTION. Question 1.

P P P NP-Hard: L is NP-hard if for all L NP, L L. Thus, if we could solve L in polynomial. Cook's Theorem and Reductions

1 Primals and Duals: Zero Sum Games

(Refer Slide Time: 0:21)

CS151 Complexity Theory. Lecture 13 May 15, 2017

CS154, Lecture 15: Cook-Levin Theorem SAT, 3SAT

Definition: Alternating time and space Game Semantics: State of machine determines who

Lecture 22: Quantum computational complexity

Chapter 2. Reductions and NP. 2.1 Reductions Continued The Satisfiability Problem (SAT) SAT 3SAT. CS 573: Algorithms, Fall 2013 August 29, 2013

Transcription:

CS 221 Computational Complexity, Lecture 5 Feb 6, 2018 Space and Nondeterminism Instructor: Madhu Sudan 1 Scribe: Yong Wook Kwon Topic Overview Today we ll talk about space and non-determinism. For some context, we have the crude inclusions: T IM E(t) N T IM E(t) SP ACE(t) N SP ACE(t) T IM E(2t ) (1) The first and third inclusions are obvious. The second inclusion follows as one cannot consume space faster than the actual run-time. The final inclusion follows from envisioning the total possible states (2t ) and modelling the algorithm as a walk on the directed graph of these states (from the start state to the end-state). The crude bounds above can be summarized in the following diagram. As the diagram suggests, the main goal of this lecture is to prove the following: 1. Equality between NSPACE, PSPACE, and CoNPSPACE 2. Equality between NL and Co-NL While the former result essentially follows from Savitch s theorem and the work we did for the first problem set, the latter result is much more surprising. It is yet unknown whether NL and L are equal or not, and the fact that we can prove equality between the NL and CoNL without going through L is striking. After we are done proving these identities, we will describe the formalism of QBFs and games, which will give us a description of an illustrative PSPACE-complete problem. 2 PSPACE = NPSPACE = CoNPSPACE First, we shall describe the Path Problem, which is NL-complete. Definition 1. The Path Problem takes as input a directed graph G and two vertices s and t, and determines whether there exists a path in G from s to t. Theorem 2. Path is NL-complete under log-space reductions. Proof. One can represent any non-deterministic log-space algorithm using a configuration graph of size 2log n = n. Then, the machine M accepting an input x is equivalent to there being a path from the start state to the accepting state in the configuration graph GM,x. Next, as review, we shall state and prove Savitch s Theorem: CS 221 Computational Complexity, Lecture 5-1

Theorem 3 (Savitch). NL L 2 (SPACE(log 2 n)) Proof. This is what we did in the problem set. First, we showed that given a boolean matrix A, one can compute A n (boolean multiplication) in log 2 n space by recursively squaring the matrix. Now, let A be the adjacency matrix of the directed graph G. Suppose that we also add self-loops for each vertex, representing the possiblity that the algorithm may do nothing (this corresponds to having the diagonal be 1). Then, it is easy to see that there exists a path from s to t in k steps if and only if A k [s, t] = 1. As we added self-loops, A k [s, t] = 1 if and only if there is a path from s to t of at most length k. As any connected points have path of length at most n, suffices to compute A n, which takes log 2 n space, and as we showed that the NL-complete problem PATH was in L 2, we are done. Corollary 4. Padding arguments will thus imply that SPACE(s(n)) is contained in SPACE(s(n) 2 ). Exercise 5. Make the explicit padding argument. Corollary 6. NPSPACE is contained in PSPACE, and hence we have equality. Also, as PSPACE is closed under complement, NPSPACE = PSPACE = CoNPSPACE Remark The idea behind the proof of Savitch s theorem, where we can compute powers via repeated squaring with low space, will be useful later on. 3 NL = CoNL Immerman 87 and Szelepcsenyi 88 gave the following proof for NL = CoNL. Essentially, they give a non-deterministic algorithm (log space) for P ath, i.e. the complement of the Path problem. In other words, the set-up is as follows: 1. An input tape that contains the directed graph G, etc 2. The output tape, as usual 3. The proof tape π: interestingly, the log space constraint implies that we cannot read the proof tape in both directions, and only have one-directional access. 4. The memory tape, which can store log n bits. As is common, we can reduce to the problem Path(s, t, k), i.e. whether no paths exist from s to t of length at most k. Thus, suffices to prove that there exists such a proof π, which we can check using log space, that allows us to answer this problem. The key idea is as follows: we can non-deterministically prove that no paths from s to k of length at most k exist given N k. Definition 7. N k is the number of vertices reachable from s in k steps. Lemma 8. There exists a proof such that conditional on knowing N k, one can determine the above question. Proof. The proof π consists of the pairs (i, b i, p i ), where i ranges over the vertices of G. b i = 1 iff i is reachable from s in k steps. If b i = 1, p i is such a path from s to i, and if b i = 0, p i is arbitrary. Given π and N k, one can solve the problem using log space. Simply read through b i, and count i b i, and verify the authenticity of p i for which b i = 1. Finally, if i b i = N k, and b t 1, we have a proof. In fact, we can go further: Lemma 9. There exists a proof, denoted as Π k, such that conditional on knowing N k 1, one can determine the above question. CS 221 Computational Complexity, Lecture 5-2

Proof. Now, the proof π consists of the pairs (i, b i, p i ) with i ranging over the vertices of G such that b i = 1 iff i is reachable from s in k 1 steps. p i is then such a path, which one can verify easily. The key now is for us to check that i is then not connected to t. This is simple combinatorics: if t does not have a neighbor (including itself) not reachable in k 1 steps, it certainly is not reachable in k steps. We conclude checking the proof by verifying i b i = N k 1. Alright. But how do we obtain N k 1? One can obtain N k 1, and hence the proof for the original problem, via inductive counting. In other words, conditional on knowing the value of N k 1, we can give a proof for the value of N k. We start at N 0 = 1. Next is the inductive step: Π k is a proof for the value of N k given the value for N k 1. Π k consists of the triplet (i, b i, Π ± i,k ), where i ranges over the vertices of G. b i is 1 iff there is a path from s to i in at most k steps. If b i = 1, it is followed by Π + i,k, which is the proof, i.e. the said path. On the other hand, if b i = 0, it is followed by Π i,k, which is the proof that there is no such path! By our lemma, as long as we know the value of N k 1, there is such a valid proof Π i,k. We conclude our verification by checking i b i = N k. Hence, we have given you a proof Π, which starts from N 0, and inductively proves the value of N k, which then yields the answer to P ath, as desired. Thus, the proof is complete, and our proof is also complete. Remark Just to clarify, the algorithm is nondeterministic, but the proof itself (Π) is deterministic. The proof is also called a witness among cryptographers. To reiterate, proofs capture the essence of nondeterminism. A problem can be nondeterministically solved if and only if I can verify the solution in the same complexity. Remark There is no explicit limit to the length of the proof, although a bound is possible as we are traversing along all possible configurations of the machine with log n memory. Exercise 10. From the description of Π above, give a more explicit computation of the length of Π. Remark Note that if one can give a log-space verifiable proof of an NP statement (such as a threecolorability of a graph), this will imply via NL P that P = NP! Hence, we probably cannot do this. However, one can come close - there is a randomized log space algorithm which can verify three-colorability with high probability. So we reduced CoNL to NL. What about the other direction, to complete the proof? We shall show in this week s problem set that there is an appropriate log space reduction: Exercise 11. Given (G, s, t), a directed graph G and two vertices s, t, show that there is a (G, s, t ) such that there is a path from s to t in G iff there is no path from s to t in G. 4 Polynomial Space Complete Problems: QBF and Games Leaving the space of NL, let us move up a hierarchy and focus on PSPACE complexity. Naturally, we wish to describe a PSPACE complete problem, just as we have Path for NL. One way is to find an appropriate generalization of Path: Definition 12. The Succinct Path problem takes as input a circuit C : {0, 1} n {0, 1} n (0, 1). One can define the corresponding adjacency matrix of a graph of size 2 n, where A[s, t] = C(s, t). SUCCPATH(s, t) asks whether there is a path from s to t. Exercise 13. Prove that SUCCPATH is PSPACE-complete. Succinct path, however, does not give us a good structural understanding of PSPACE. Instead, let us introduce the notion of QBF (quantified boolean formulas). Suppose there is a fixed formula (say, 3CNF) φ, and inputs x 1, x 2,... x n. Let n be even. The question we are trying to answer is not satisfiability, but a stronger one. CS 221 Computational Complexity, Lecture 5-3

Definition 14. QBF asks whether there exists x i such that there exists an x 1 such that for all x 2, there exists x 3 such that for all x 4... there exists x n 1 such that for all x n φ(x 1, x 2,...x n ) = 1. ( x 1 x 2... x n 1 x n such that φ(x) = 1) Theorem 15. QBF is NPSPACE (and hence PSPACE) complete. Before we describe the proof, it is helpful to get a better picture of what QBF is. Think of the process as a game between the existential player and the universal player. The existential player wins if φ(x 1, x 2,...x n ) = 1 (which we can easily verify). Then, QBF asks whether there is a winning strategy by the existential player (characterized by (x 1, x 3, x 5,..., x n 1 )) such that no matter what the universal player plays, player 1 will win. One can generalize QBFs to games: Definition 16. Now, x i need not be bits, but general inputs. Then, suppose there is a polynomial time input verification predicate V (x 1,...x n ). The associated game question asks whether there exist (x 1, x 3,...x n 1 ) such that player 1 guarantees a win regardless of player 2 s input. Obviously, QBF reduces to games, but really, they can be seen as equivalent. Formally, one can have player 2 choose to ignore each bit of the transmission of x 1 until its completion, and similarly for player 1, etc. Before we prove that QBF is PSPACE complete, we first need to show that QBF is in fact in PSPACE. Theorem 17. QBF and GAMES are both in PSPACE. Proof. Let us give a sketch of the proof. We shall prove this only for QBF. One can think about the associated game tree, which is a binary tree, with the leaves being the value of φ(x 1, x 2,...x n ), where x is the history of the game play. One can then reduce the original QBF problem into finding the value at the base of the tree, where player 2 nodes (universal nodes) compute the AND of their children, while the player 1 nodes (existential nodes) compute the OR of their children. Then, one can compute this in PSPACE by essentially doing a depth-first search. At each search, remember all the left node children of the vertices belonging to the path, which only requires polynomial space. This is sufficient to compute the value at the base. Exercise 18. Fill out the details of the above proof. In particular, verify that QBF is equivalent to computing the base value of the associated game tree, explicitly spell out the DFS algorithm, and finally confirm that this takes polynomial space. Now, let us finally prove that QBF is NPSPACE complete. Suppose we have a general NPSPACE problem. Given, say, a space of n, there exists 2 n total possible configurations. Let the initial configuration be C I and the final accepting configuration be C F. Any algorithm reduces to proving there exists a path from C I to C F in 2 n steps. We shall reduce that problem to GAMES. 1. First, player 1 gives the state C M, and claims that there is a path from C I to C 1 M in 2n 1 steps, and a path from C 1 M to C F in 2 n 1 steps. 2. Player 2 then casts doubt on one of the two assertions. 3. Suppose WLOG that player 2 chose the first half. Then, player 1 furbishes C 2 M between C I and C 1 M, with a path connecting C I to C 2 M and a path connecting C2 M to C1 M in both 2n 2 steps. 4. Player 2 then casts doubt on one of the two assertions, and so forth. 5. Repeat the process until player 1 communicates D, E. 6. Player 1 wins if D and E are indeed adjacent, which can be easily verified in polynomial space. CS 221 Computational Complexity, Lecture 5-4

One can easily see that the GAME described above has a winning strategy for player 1 if and only if there is indeed such a path of length 2 n from the initial state to the end state. If there does not exist such a path, the player 2 can pinpoint the error in the assertion and win. Furthermore, the game terminates after n rounds, or alternations, and hence the total computation is polynomial time. Furthermore, each communication takes up n space (the second player only uses one bit per round, of course). Finally, one can verify that the game was played legally (i.e. player 1 conformed with player 2 s moves,), and the outcome of the game (whether the final states are adjacent) using only polynomial space, as desired. Consequently, we have shown that PSPACE reduces to games, which reduces to QBF. Hence, the best way of thinking about PSACE is via QBFs. 5 Looking ahead What we have seen in the discussion of the previous section is that PSPACE can be represented by a game with n-length quantifiers, n verification time, and n alternations (rounds of the game). Alternations itself is an interesting concept. We can formulate the following complexity class: Definition 19. ATISP(a(n), t(n), s(n)) is defined to be the type of problems solvable via games using t(n) time, s(n) space, and a(n) rounds. a(n) need not even be a function: what can you do with, say, 10 alternations, with polynomial space and time? These questions are difficult. Even a single iteration of the existential player yields the class NP (using 3SAT, for example), and a single iteration of a universal player yields the class conp. One can think about QBF for two rounds: x yφ(x, y) contains MINDNF: there exists an x such that for no shorter y φ(x, y) is satisfied. We shall investigate the complexity ATISP in future lectures in more detail. CS 221 Computational Complexity, Lecture 5-5