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

Similar documents
Principles of Knowledge Representation and Reasoning

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

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

conp, Oracles, Space Complexity

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

Lecture 20: conp and Friends, Oracles in Complexity Theory

Lecture 7: Polynomial time hierarchy

6-1 Computational Complexity

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

Complexity Theory VU , SS The Polynomial Hierarchy. Reinhard Pichler

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

Non-Deterministic Time

ITCS:CCT09 : Computational Complexity Theory Apr 8, Lecture 7

1 PSPACE-Completeness

Quantified Boolean Formulas Part 1

Umans Complexity Theory Lectures

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

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

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

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

NP-Completeness. f(n) \ n n sec sec sec. n sec 24.3 sec 5.2 mins. 2 n sec 17.9 mins 35.

CSCI 1590 Intro to Computational Complexity

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

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

Artificial Intelligence. 3 Problem Complexity. Prof. Dr. Jana Koehler Fall 2016 HSLU - JK

Database Theory VU , SS Complexity of Query Evaluation. Reinhard Pichler

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

The Polynomial Hierarchy

CS311 Computational Structures. NP-completeness. Lecture 18. Andrew P. Black Andrew Tolmach. Thursday, 2 December 2010

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

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

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

CS5371 Theory of Computation. Lecture 23: Complexity VIII (Space Complexity)

2. Notation and Relative Complexity Notions

Review of unsolvability

Lecture 4 : Quest for Structure in Counting Problems

Lecture 22: PSPACE

Turing Machines and Time Complexity

CSE 548: (Design and) Analysis of Algorithms

Complexity of domain-independent planning. José Luis Ambite

CS151 Complexity Theory. Lecture 1 April 3, 2017

Lecture 3: Reductions and Completeness

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

A An Overview of Complexity Theory for the Algorithm Designer

INAPPROX APPROX PTAS. FPTAS Knapsack P

satisfiability (sat) Satisfiability unsatisfiability (unsat or sat complement) and validity Any Expression φ Can Be Converted into CNFs and DNFs

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

Introduction. Pvs.NPExample

Essential facts about NP-completeness:

NP Complete Problems. COMP 215 Lecture 20

Theory of Computation CS3102 Spring 2014 A tale of computers, math, problem solving, life, love and tragic death

NP-Completeness. NP-Completeness 1

Computational Complexity

Lecture Notes 4. Issued 8 March 2018

Design and Analysis of Algorithms

Notes on Complexity Theory Last updated: October, Lecture 6

Could we potentially place A in a smaller complexity class if we consider other computational models?

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

Lecture 25: Cook s Theorem (1997) Steven Skiena. skiena

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

Non-Approximability Results (2 nd part) 1/19

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

NP-Completeness. Subhash Suri. May 15, 2018

Computability and Complexity CISC462, Fall 2018, Space complexity 1

NP-Completeness. Andreas Klappenecker. [based on slides by Prof. Welch]

Planning and Optimization

Lecture 8: Complete Problems for Other Complexity Classes

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

Theory of Computation CS3102 Spring 2015 A tale of computers, math, problem solving, life, love and tragic death

P vs. NP Classes. Prof. (Dr.) K.R. Chowdhary.

Complexity. Complexity Theory Lecture 3. Decidability and Complexity. Complexity Classes

Comparison of several polynomial and exponential time complexity functions. Size n

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

CS154, Lecture 13: P vs NP

Lecture 6: Oracle TMs, Diagonalization Limits, Space Complexity

Advanced topic: Space complexity

Lecture 19: Finish NP-Completeness, conp and Friends

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

Lecture 24: Randomized Complexity, Course Summary

CSE 555 HW 5 SAMPLE SOLUTION. Question 1.

CS154, Lecture 10: Rice s Theorem, Oracle Machines

About the relationship between formal logic and complexity classes

Introduction to Complexity Theory

NP Completeness and Approximation Algorithms

CSCI3390-Lecture 16: NP-completeness

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

Lecture 11: Proofs, Games, and Alternation

SOLUTION: SOLUTION: SOLUTION:

Economics and Computation

Theory of Computation CS3102 Spring 2014 A tale of computers, math, problem solving, life, love and tragic death

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

CS154, Lecture 13: P vs NP

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

Complexity and NP-completeness

Summer School on Introduction to Algorithms and Optimization Techniques July 4-12, 2017 Organized by ACMU, ISI and IEEE CEDA.

NP-Complete Problems. Complexity Class P. .. Cal Poly CSC 349: Design and Analyis of Algorithms Alexander Dekhtyar..

Search and Optimization Problems. CSE 548: (Design and) Analysis of Algorithms. Hard Problems: Where you find yourself...

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

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

Transcription:

Complexity Theory Knowledge Representation and Reasoning November 2, 2005 (Knowledge Representation and Reasoning) Complexity Theory November 2, 2005 1 / 22

Outline Motivation Reminder: Basic Notions Algorithms and Turing Machines Problems, Solutions, and Complexity Complexity Classes P and NP Upper and Lower Bounds Polynomial Reductions NP-Completeness Beyond NP The Class co-np The Class PSPACE Other Classes Oracle TMs and the Polynomial Hierarchy Oracle Turing-Machines Turing Reduction Complexity Classes Based on OTMs QBF (Knowledge Representation and Reasoning) Complexity Theory November 2, 2005 2 / 22

Motivation Motivation for Using Complexity Theory Complexity theory can answer us questions how easy or hard a problem is Gives hints on what appropriate algorithms could be,e.g., algorithms for polynomial-time problems are usually easy to design for NP-complete problems, backtracking and local search work well Gives us hint on what type of algorithms will (most probably) not work for problem that are believed to be harder than NP-complete ones, simple backtracking will not work Gives hint on what sub-problem might be interesting (Knowledge Representation and Reasoning) Complexity Theory November 2, 2005 3 / 22

Reminder: Basic Notions Algorithms and Turing Machines Algorithms and Turing Machines We use Turing machines as formal models of algorithms This is justified, because we assume that Turing machines can compute all computable functions the resource requirements (in term of time and memory) of a Turing machine are only polynomially worse than other models The regular type of Turing machine is the deterministic one: DTM or simply TM Often, however, we use the notion of nondeterministic TMs: NDTM (Knowledge Representation and Reasoning) Complexity Theory November 2, 2005 4 / 22

Reminder: Basic Notions Problems, Solutions, and Complexity Problems, Solutions, and Complexity A problem is a set of pairs (I,A) of strings in {0,1}. I: Instance A: Answer. If A {0,1}: decision problem A decision problem is the same as a formal language (namely the set of strings formed by the instances with answer 1) An algorithm decides (or solves) a problem if it computes the right answer for all instances. The complexity of an algorithm is a function T : N N, measuring the number of basic steps (or memory requirement) the algorithm needs to compute an answer depending on the size of the instance. The complexity of a problem is the complexity of the most efficient algorithm that solves this problem. (Knowledge Representation and Reasoning) Complexity Theory November 2, 2005 5 / 22

Reminder: Basic Notions Complexity Classes P and NP Complexity Classes P and NP Problems are categorized into complexity classes according to the requirements of computational resources: The class of problems decidable on deterministic Turing machines in polynomial time: P Problems in P are said to be efficiently solvable (although this might not be true if the exponent is very large) In practice, this notion appears to be more often reasonable than not The class of problems decidable on nondeterministic Turing machines in polynomial time: NP More classes are definable using other resource bounds on time and memory. (Knowledge Representation and Reasoning) Complexity Theory November 2, 2005 6 / 22

Reminder: Basic Notions Upper and Lower Bounds Upper and Lower Bounds Upper bounds (membership in a class) are usually easy to prove: provide an algorithm show that the resource bounds are respected. Lower bounds (hardness for a class) are usually difficult to show. the technical tool here is the polynomial reduction (or any other appropriate reduction). show that some hard problem can be reduced to the problem at hand (Knowledge Representation and Reasoning) Complexity Theory November 2, 2005 7 / 22

Reminder: Basic Notions Polynomial Reductions Polynomial Reductions Given two languages L 1 and L 2, L 1 can be polynomially reduced to L 2, written L 1 p L 2, iff there exists a polynomially computable function f such that x L 1 iff f(x) L 2 It cannot be harder to decide L 1 than L 2 L is hard for a class C (C-hard) iff all languages of this class reduce to it. L is complete for C (C-complete) iff it is hard and L C. (Knowledge Representation and Reasoning) Complexity Theory November 2, 2005 8 / 22

Reminder: Basic Notions NP-Completeness NP-complete Problems A problem is NP-complete iff it is NP-hard and in NP. Example: SAT the satisfiability problem for propositional logic is NP-complete (Cook/Karp) Membership is obvious, hardness follows because computations on a NDTM correspond to satisfying truth-assignments of certain formulae all problems NP-hard NP P NP-complete (Knowledge Representation and Reasoning) Complexity Theory November 2, 2005 9 / 22

Beyond NP The Class co-np The Complexity Class co-np Note that there is some asymmetry in the definition of NP. It is clear that we can decide SAT by using a NDTM with polynomially bounded computation There exists an accepting computation of polynomial length iff the formula is satisfiable What if we want to solve UNSAT, the complementary problem? It seems necessary to check all possible truth-assignments! Define co-c = {L Σ L C}, provided Σ is our alphabet co-np = {L Σ L NP} For example UNSAT, TAUT co-np! Note: P is closed under complement, i.e., P NP co-np (Knowledge Representation and Reasoning) Complexity Theory November 2, 2005 10 / 22

Beyond NP The Class PSPACE PSPACE There are problems even more difficult than NP and co-np. Definition ((N)PSPACE) PSPACE (NPSPACE) is the class of decision problems that can be decided on deterministic (non-deterministic) Turing machines using only polynomial many tape cells. Some facts about PSPACE: PSPACE is closed under complements (as all other deterministic classes) PSPACE is identical to NPSPACE (because non-deterministic Turing machines can be simulated on deterministic TMs using only quadratic space) NP PSPACE (because in polynomial time one can visit only polynomial space, i.e., NP NPSPACE) It is unknown whether NP PSPACE, but it is believed that this is true. (Knowledge Representation and Reasoning) Complexity Theory November 2, 2005 11 / 22

Beyond NP The Class PSPACE PSPACE-completeness Definition (PSPACE-completeness) A decision problem (or language) is PSPACE-complete, if it is in PSPACE and all other problems in PSPACE can be polynomially reduced to it. Intuitively, PSPACE-complete problems are the hardest problems in PSPACE (similar to NP-completeness). They appear to be harder than NP-complete problems from a practical point of view. An example for a PSPACE-complete problem is the NDFA equivalence problem: Instance: Two non-deterministic finite state automata A 1 and A 2. Question: Are the languages accepted by A 1 and A 2 identical? (Knowledge Representation and Reasoning) Complexity Theory November 2, 2005 12 / 22

Beyond NP Other Classes Other Complexity Classes... There are complexity classes above PSPACE (EXPTIME, EXPSPACE, NEXPTIME, DEXPTIME,... ), there are (infinitely many) classes between NP and PSPACE (the polynomial hierarchy defined by oracle machines) there are (infinitely many) classes inside P (circuit classes with different depths) and for most of the classes we do not know whether the containment relationships are strict (Knowledge Representation and Reasoning) Complexity Theory November 2, 2005 13 / 22

Oracle TMs and the Polynomial Hierarchy Oracle Turing-Machines Oracle Turing Machines An Oracle Turing machine ((N)OTM) is a Turing machine (DTM, NDTM) with the possibility to query an oracle, another Turing machine without resource restrictions, whether it accepts or reject a given string. Computation by the oracle does not cost anything! Formalization: a tape onto which strings for the oracle are written, a yes/no answer from the oracle depending on whether it accepts or rejects the input string. Usage of OTMs answers what-if questions: What if we could solve the oracle-problem efficiently? (Knowledge Representation and Reasoning) Complexity Theory November 2, 2005 14 / 22

Oracle TMs and the Polynomial Hierarchy Turing Reduction Turing Reductions OTMs allow us to define a more general type of reduction Idea: The classical reduction can be seen as calling a subroutine once. L 1 is Turing-reduced to L 2, symbolically L 1 T L 2 if there exists an OTM that decides L 1 by using an oracle for L 2. Polynomial reducibility implies Turing reducibility, but not vice versa! NP-completeness and co-np-completeness with respect to Turing reducibility are identical! Turing reducibility can also be applied to general search problems! (Knowledge Representation and Reasoning) Complexity Theory November 2, 2005 15 / 22

Oracle TMs and the Polynomial Hierarchy Complexity Classes Based on OTMs Complexity Classes Based on Oracle TMs 1. P NP = decision problems solved by poly-time DTMs with an oracle for a decision problem in NP. 2. NP NP = decision problems solved by poly-time NDTMs with an oracle for a decision problem in NP. 3. co-np NP = complements of decision problems solved by poly-time NDTMs with an oracle for a decision problem in NP. 4. NP NPNP =... and so on (Knowledge Representation and Reasoning) Complexity Theory November 2, 2005 16 / 22

Oracle TMs and the Polynomial Hierarchy Complexity Classes Based on OTMs Example Consider the Minimum Equivalent Expression (MEE) problem: Instance: A well-formed Boolean formula φ using the standard connectives (not ) and a nonnegative integer K. Question: Is there a well-formed Boolean formula φ that contains K or fewer literal occurrences and that is logical equivalent to φ? This problem is NP-hard (writ. to Turing reductions). It does not appear to be NP-complete We could guess a formula and then use a SAT-oracle MME NP NP. (Knowledge Representation and Reasoning) Complexity Theory November 2, 2005 17 / 22

Oracle TMs and the Polynomial Hierarchy Complexity Classes Based on OTMs The Polynomial Hierarchy The complexity classes based on OTMs form an infinite hierarchy. The polynomial hierarchy PH Σ p 0 = P Π p 0 = P p 0 = P Σ p i+1 = NP Σp i Π p i+1 = co-σ p i+1 p i+1 = P Σp i PH = i 0 (Σp i Πp i p i ) PSPACE NP = Σ p 1, co-np = Πp 1 (Knowledge Representation and Reasoning) Complexity Theory November 2, 2005 18 / 22

Oracle TMs and the Polynomial Hierarchy QBF Quantified Boolean Formulae: Definition If φ is a propositional formula, P is the set of Boolean variables used in φ and σ is a sequence of p and p, one for every p P, then σφ is a QBF. A formula xφ is true if and only if φ[ /x] φ[ /x] is true. (Equivalently, φ[ /x] is true or φ[ /x] is true.) A formula xφ is true if and only if φ[ /x] φ[ /x] is true. (Equivalently, φ[ /x] is true and φ[ /x] is true.) This definition directly leads to an AND/OR tree traversal algorithm for evaluating QBF. (Knowledge Representation and Reasoning) Complexity Theory November 2, 2005 19 / 22

Oracle TMs and the Polynomial Hierarchy QBF Quantified Boolean Formulae: Definition The evaluation problem of QBF generalizes both the satisfiability and validity/tautology problems of propositional logic. The latter are respectively NP-complete and co-np-complete whereas the former is PSPACE-complete. Example The formulae x y(x y) and x y(x y) are true. Example The formulae x y(x y) and x y(x y) are false. (Knowledge Representation and Reasoning) Complexity Theory November 2, 2005 20 / 22

Oracle TMs and the Polynomial Hierarchy QBF The Polynomial Hierarchy: Connection to QBF i {}}{ Truth of QBFs with prefix is Π p i -complete. i {}}{ Truth of QBFs with prefix is Σ p i -complete. Special cases corresponding to SAT and TAUT: The truth of QBFs with prefix x 1 1 x1 n is NP= Σp 1 -complete. The truth of QBFs with prefix x 1 1 x1 n is co-np= Πp 1 -complete. (Knowledge Representation and Reasoning) Complexity Theory November 2, 2005 21 / 22

Literature Literature M. R. Garey and D. S. Johnson. Computers and Intractability A Guide to the Theory of NP-Completeness. Freeman and Company, San Francisco, 1979. C. H. Papadimitriou. Computational Complexity. Addison-Wesley,Reading, MA, 1994. (Knowledge Representation and Reasoning) Complexity Theory November 2, 2005 22 / 22