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

Similar documents
CS 6505, Complexity and Algorithms Week 7: NP Completeness

Lecture 7: Polynomial time hierarchy

: Computational Complexity Lecture 3 ITCS, Tsinghua Univesity, Fall October 2007

BBM402-Lecture 11: The Class NP

CSE 555 HW 5 SAMPLE SOLUTION. Question 1.

The Class NP. NP is the problems that can be solved in polynomial time by a nondeterministic machine.

1 PSPACE-Completeness

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

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

Space and Nondeterminism

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

CS154, Lecture 13: P vs NP

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

Computability Theory

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

NP Completeness. CS 374: Algorithms & Models of Computation, Spring Lecture 23. November 19, 2015

CS154, Lecture 13: P vs NP

CSE200: Computability and complexity Space Complexity

Lecture 19: Finish NP-Completeness, conp and Friends

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

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

Theory of Computation Time Complexity

Computability and Complexity CISC462, Fall 2018, Space complexity 1

Ταουσάκος Θανάσης Αλγόριθμοι και Πολυπλοκότητα II 7 Φεβρουαρίου 2013

1 Deterministic Turing Machines

1 Deterministic Turing Machines

The Polynomial Hierarchy

Complexity Theory. Knowledge Representation and Reasoning. November 2, 2005

Lecture 22: PSPACE

Lecture 3: Nondeterminism, NP, and NP-completeness

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

NP Complete Problems. COMP 215 Lecture 20

Polynomial time reduction and NP-completeness. Exploring some time complexity limits of polynomial time algorithmic solutions

CSE 135: Introduction to Theory of Computation NP-completeness

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

Lecture 2: Relativization

Lecture 8: Complete Problems for Other Complexity Classes

SOLUTION: SOLUTION: SOLUTION:

Lecture 20: conp and Friends, Oracles in Complexity Theory

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

6.045: Automata, Computability, and Complexity (GITCS) Class 15 Nancy Lynch

6.045 Final Exam Solutions

ECS 120 Lesson 24 The Class N P, N P-complete Problems

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

CSCI 1590 Intro to Computational Complexity

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

CSCI 1590 Intro to Computational Complexity

Time and space classes

Introduction to Computational Complexity

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

INAPPROX APPROX PTAS. FPTAS Knapsack P

Principles of Knowledge Representation and Reasoning

Announcements. Friday Four Square! Problem Set 8 due right now. Problem Set 9 out, due next Friday at 2:15PM. Did you lose a phone in my office?

conp, Oracles, Space Complexity

Lecture 6: Oracle TMs, Diagonalization Limits, Space Complexity

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

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

Review of Basic Computational Complexity

Umans Complexity Theory Lectures

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

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

On the Computational Hardness of Graph Coloring

CSCI3390-Lecture 16: NP-completeness

6.840 Language Membership

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

Review of unsolvability

NP-Complete Reductions 1

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

Notes on Complexity Theory Last updated: October, Lecture 6

NP-Completeness. Until now we have been designing algorithms for specific problems

Lecture 2 (Notes) 1. The book Computational Complexity: A Modern Approach by Sanjeev Arora and Boaz Barak;

CS5371 Theory of Computation. Lecture 19: Complexity IV (More on NP, NP-Complete)

an efficient procedure for the decision problem. We illustrate this phenomenon for the Satisfiability problem.

Essential facts about NP-completeness:

Introduction to Complexity Theory

COSE215: Theory of Computation. Lecture 20 P, NP, and NP-Complete Problems

Chapter 7: Time Complexity

Advanced topic: Space complexity

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

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

Lecture 16: Time Complexity and P vs NP

Definition: conp = { L L NP } What does a conp computation look like?

Lecture 23: More PSPACE-Complete, Randomized Complexity

Umans Complexity Theory Lectures

Computational Complexity Theory

Complexity Classes V. More PCPs. Eric Rachlin

Complexity Theory VU , SS The Polynomial Hierarchy. Reinhard Pichler

Space Complexity. Huan Long. Shanghai Jiao Tong University

Outline. Complexity Theory EXACT TSP. The Class DP. Definition. Problem EXACT TSP. Complexity of EXACT TSP. Proposition VU 181.

Lecture 3: Reductions and Completeness

P and NP. Or, how to make $1,000,000.

Time to learn about NP-completeness!

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

NP-Complete Problems. More reductions

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

CISC 4090 Theory of Computation

CS21 Decidability and Tractability

Lecture 12: Interactive Proofs

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

Complexity Theory 112. Space Complexity

Transcription:

CS 6505: Computability & Algorithms Lecture Notes for Week 5, Feb 8-12 P, NP, PSPACE, and PH A deterministic TM is said to be in SP ACE (s (n)) if it uses space O (s (n)) on inputs of length n. Additionally, the TM is in T IME(t (n)) if it uses time O(t (n)) on such inputs. A language L is polynomial-time decidable if k and a TM M to decide L such that M T IME(n k ). (Note that k is independent of n.) For example, consider the langage P AT H, which consists of all graphsdoes there exist a path between A and B in a given graph G. The language P AT H has a polynomial-time decider. We can think of other problems with polynomial-time decider: finding a median, calculating a min/max weight spanning tree, etc. P is the class of languages with polynomial time TMs. In other words, P = k T IME(n k ) Now, do all decidable languages belong to P? Let s consider a couple of languages: HAM PATH: Does there exist a path from s to t that visits every vertex in G exactly once? SAT: Given a Boolean formula, does there exist a setting of its variables that makes the formula true? For example, we could have the following formula F : F = (x 1 x 2 x 3 ) (x 1 x 2 x 3 ) (x 1 x 2 x 3 ) The assignment x 1 = 1, x 2 = 0, x 3 = 0 is a satisfying assignment. No polynomial time algorithms are known for these problems such algorithms may or may not exist. They can be solved (i.e., decided) by polynomialtime Nondeterministic TMs (NTMs). The idea behind this polynomial time algorithm is that a nondeterministic TM guesses the correct path for the HAM P AT H language, and it guesses the correct assignment for the SAT language. Recall that an NTM accepts iff any one of its computation paths accepts. The path amounts to a verification of the YES answer. We have NSP ACE(s (n)) and NT IME(t (n)) NP is the class of languages that can be decided by polynomial-time NTMs: NP = k NT IME(n k ) 1

Alternately, NP is the class of languages with the property that the membership ( YES ) can be verified in polynomial-time using a polynomial-sized certificate. For example, consider SAT : if F is satisfiable, a valid assignment is the certicate. In HAMP AT H, if G has a Hamiltonian path, then the sequence of vertices visited is the certificate. Clearly P NP. From Savitch s theorem, NSP ACE = P SP ACE Since the space requirement for P SP ACE only squares that for NSP ACE. Also, we have NT IME (t (n)) DT IME(2{O(t (n)}) We define EXP or EXP T IME = Languages that can be decided in exponential time. So P NP P SP ACE EXP Amazingly, we do not know if any of these containments is strict. In other words, does there exist a language L such that L EXP and L P SP ACE or even L P? L NP NT M M s.t. L = {x accepting path in M on input x} The class of languages that are complements of languages in NP is called conp. L conp NT M M such that L = { x Every valid computation path of M is an accepting path for x }. L conp T NP T = {x x L}, L = {x x is not accepted by a TM for L on any path } In other words, L is rejected on every path. How do we verify membership of a language in conp? We need a short (polynomialsized) certificate that, if x L. For example, we need to show that a graph G does not belong in HAMP AT H, or we need to show that a formula F does not have a satisfying assignment. What is the hierarchy of P, NP, and conp? We know that every language that s in P can be solved in polynomial time. So we certainly have a certificate that shows that a language belongs to P it s the TM that decides the language! So P is in NP. Likewise, the same TM that decides a language L in P will also reject its input in polynomial time, so P is also in NP. What about NP and conp? Well, we don t know. Polynomial Hierarchy (PH) 2

We would like to construct a hierarchy of problems within PSPACE that are successively more difficult. First, let s revisit definitions for a couple of languages: SAT : { F x : F (x) = 1} SAT : {F x : F (x) = 0} So SAT is the set of all formulae such that there is some satisfying assignment for each formula, and is the set of all formulae such that all assignments are not satisfying (i.e., there are no satisfying assignments). We have used a computation tree to visualize finding a solution to a problem. We can imagine the same kind of computation tree for solving SAT : we can set x 1 to 0 or 1, then we can set x 2 to 0 or 1, and so on. Whenever we see, the existential quantifier, we are asking if one of those two settings will yield a satisfying assignment. So setting x 1 = 0, Whenever we see, we are asking if all of the branches yield a satisfying assignment. For example, we may ask that some satisfying exists for x 2 = 0 and x 2 = 1. If any of the branches under a universal quanitifer fail, then the quanitifier will fail. This gives us the concept for an Alternating Turing Machine. An Alternating Turing Machine is one that can, at each node of computation, accept if any one path emanating from the node accepts (i.e., we have an existential quantifier ) or if all paths accept (i.e., we have a universal quantifier). The Alternating Turing Machine must also alternate between and quantifiers. We will use this same idea to build a hierarchy of problems in PSPACE. Let s define the following: Σ i is an alternating Turing Machine that alternates i times between existentiallyquantified ( ) and universally-quantified ( ) stages, starting with an existentiallyquantified stage. Π i is an alternating Turing Machine that alternates i times between universallyquantified and existentially-quantified stages, starting with a universal quantifier. So Σ 2 SAT = { F x 1 x 2, F (x 1, x 2 ) = 1 }. That is, it is the set of all twovariable formulae such that there is some assignment to the first variable such that all assignments to the second variable will satisfy the formula. Similarly, Π 2 SAT = { F x 1 x 2, F (x 1, x 2 ) = 0}. We can also alternate up to as many 3

variables as we like: Σ i SAT = {F x 1 x 2 x 3 x 4..., F (x 1,..., x i ) = 1}, and we can have Π i SAT = {F x 1 x 2 x 3 x 4..., F (x 1,..., x i ) = 0 }. We define the Polynomial Hierarchy, PH, as follows: P H = i Σ i = k T IME ( n k) = i Π i k T IME(n k ) P H P SP ACE PSPACE Complete We have an idea of what s in PSPACE, but what are the hardest algorithms in PSPACE? We want to know if solving one problem in PSPACE will somehow yield a solution to another problem in PSPACE. For that, we have the notion of PSPACE-completeness: A language L is PSPACE-complete if it satisfies two conditions: 1. L is in P SP ACE; 2. All languages in P SP ACE are polynomial-time reducible to L. We know that all Turing Machines that use O(n k ) space for some k are in P SP ACE, but we don t have a PSPACE-complete language yet. For that, we will use the language T QBF : T QBF = { φ φ is a fully quantified Boolean formula }. A fully-quantified Boolean formula is a Boolean formula in which every variable has a quantifier. For example, the following formula is fully-quantified: φ = x 1 x 2 x 3 [ (x 1 x 2 x 3 ) (x 1 x 2 x 3 ) (x 1 x 2 x 3 ) Each variable, x 1, x 2, and x 3, has a quantifier that precedes it. We want to show that TQBF is PSPACE-complete. Again, we do not have any other languages that are PSPACE-complete, so we must turn the execution of any Turing Machine M with input w into a quantified Boolean formula. If M accepts w, then the quantified Boolean formula has a satisfying assignment. Otherwise, the quantified Boolean formula does not have a satisfying assignment. Here is a sketch of how we proceed: We construct a tableau that describes the Turing Machine s computation from a configuration A to a configuration B. We want to go from the starting configuration A to the accepting configuration B in at most t steps. Now we construct a Boolean formula for the Turing Machine such that each tape character and Turing Machine state corresponds to a literal. Each clause is equivalent to determining the possible values on the tape and the Turing Machine s state. The Boolean formula is true if the Turing Machine M will accept w in at most t steps. 4

We proceed recursively like we did in solving the PATH problem: we cut the distance from t to t/2 and look for a configuration C such that we can find a path from A to C in at most t/2 steps and another path from C to B in at most t/2 steps. So we can actually find a solution, but we may end up with an exponentially large formula. We avoid this by introducing quantifiers that help us cut down the size of the formula. (For a more detailed description, see Sipser section 8.3.) For more information on showing that TQBF is PSPACE-complete, see chapter 9 of Kleinberg/Tardos or see Sipser section 8.3. References 1. Sipser, Sections 7.3 (P and NP), 8.2 and 8.3 (PSPACE), and 10.3(PH) 2. Papadimitriou, chapter 7 (P, NP, and PSPACE), section 17.2 (PH) 3. Arora and Barak (Draft at http://www.cs.princeton.edu/theory/index.php/compbook/draft), Chapters 2 (NP and NP completeness) and 5 (PH) 4. Kleinberg and Tardos, chapter 9 (PSPACE). Kleinberg and Tardos present a more in-depth version of PSPACE that may be preferred by those who prefer a more conversational style. 5