1 Chapter 9 PSPACE: A Class of Problems Beyond NP Slides by Kevin Wayne. 2005 Pearson-Addison Wesley. All rights reserved.

Slides:



Advertisements
Similar presentations
Complexity Classes: P and NP
Advertisements

NP-Hard Nattee Niparnan.
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
Lecture 23. Subset Sum is NPC
Department of Computer Science & Engineering
1 NP-Complete Problems. 2 We discuss some hard problems:  how hard? (computational complexity)  what makes them hard?  any solutions? Definitions 
Complexity 11-1 Complexity Andrei Bulatov NP-Completeness.
Complexity 12-1 Complexity Andrei Bulatov Non-Deterministic Space.
Complexity 11-1 Complexity Andrei Bulatov Space Complexity.
Computability and Complexity 15-1 Computability and Complexity Andrei Bulatov NP-Completeness.
CS151 Complexity Theory Lecture 12 May 6, CS151 Lecture 122 Outline The Polynomial-Time Hierarachy (PH) Complete problems for classes in PH, PSPACE.
1 Chapter 8 NP and Computational Intractability Slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved.
CSE 421 Algorithms Richard Anderson Lecture 27 NP Completeness.
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
PSPACE-Completeness Section 8.3 Giorgi Japaridze Theory of Computability.
Definition: Let M be a deterministic Turing Machine that halts on all inputs. Space Complexity of M is the function f:N  N, where f(n) is the maximum.
1 Chapter 8 NP and Computational Intractability Slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved.
1 The Theory of NP-Completeness 2012/11/6 P: the class of problems which can be solved by a deterministic polynomial algorithm. NP : the class of decision.
Nattee Niparnan. Easy & Hard Problem What is “difficulty” of problem? Difficult for computer scientist to derive algorithm for the problem? Difficult.
Tonga Institute of Higher Education Design and Analysis of Algorithms IT 254 Lecture 8: Complexity Theory.
February 18, 2015CS21 Lecture 181 CS21 Decidability and Tractability Lecture 18 February 18, 2015.
The Complexity of Optimization Problems. Summary -Complexity of algorithms and problems -Complexity classes: P and NP -Reducibility -Karp reducibility.
CSEP 521 Applied Algorithms Richard Anderson Lecture 10 NP Completeness.
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
Space Complexity. Reminder: P, NP classes P NP is the class of problems for which: –Guessing phase: A polynomial time algorithm generates a plausible.
1 Chapter 10 Extending the Limits of Tractability Slides by Kevin Wayne Pearson-Addison Wesley. All rights reserved.
CSCI-256 Data Structures & Algorithm Analysis Lecture Note: Some slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved. 33.
Week 10Complexity of Algorithms1 Hard Computational Problems Some computational problems are hard Despite a numerous attempts we do not know any efficient.
CSE 024: Design & Analysis of Algorithms Chapter 9: NP Completeness Sedgewick Chp:40 David Luebke’s Course Notes / University of Virginia, Computer Science.
EMIS 8373: Integer Programming NP-Complete Problems updated 21 April 2009.
Techniques for Proving NP-Completeness Show that a special case of the problem you are interested in is NP- complete. For example: The problem of finding.
1 Chapter 8 NP and Computational Intractability Slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved.
1 The Theory of NP-Completeness 2 Cook ’ s Theorem (1971) Prof. Cook Toronto U. Receiving Turing Award (1982) Discussing difficult problems: worst case.
1 Chapter 8 NP and Computational Intractability Slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved.
Aaron Bloomfield CS 4102 Spring 2011
1 Chapter 34: NP-Completeness. 2 About this Tutorial What is NP ? How to check if a problem is in NP ? Cook-Levin Theorem Showing one of the most difficult.
NP-Completeness (Nondeterministic Polynomial Completeness) Sushanth Sivaram Vallath & Z. Joseph.
CSCI-256 Data Structures & Algorithm Analysis Lecture Note: Some slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved. 29.
1 Suppose I construct a TM M f which: 1. Preserves its input u. 2. Simulates a machine M b on input ε. 3. If M b hangs on input ε, force an infinite loop.
CS6045: Advanced Algorithms NP Completeness. NP-Completeness Some problems are intractable: as they grow large, we are unable to solve them in reasonable.
28.
NPC.
CSC 413/513: Intro to Algorithms
NP-Completeness Note. Some illustrations are taken from (KT) Kleinberg and Tardos. Algorithm Design (DPV)Dasgupta, Papadimitriou, and Vazirani. Algorithms.
COMPLEXITY. Satisfiability(SAT) problem Conjunctive normal form(CNF): Let S be a Boolean expression in CNF. That is, S is the product(and) of several.
Complexity ©D.Moshkovits 1 2-Satisfiability NOTE: These slides were created by Muli Safra, from OPICS/sat/)
NP-complete Languages
Space Complexity. Reminder: P, NP classes P is the class of problems that can be solved with algorithms that runs in polynomial time NP is the class of.
CSCI 2670 Introduction to Theory of Computing December 2, 2004.
CSCI 2670 Introduction to Theory of Computing December 7, 2005.
CSE 421 Algorithms Richard Anderson Lecture 27 NP-Completeness Proofs.
TU/e Algorithms (2IL15) – Lecture 9 1 NP-Completeness NOT AND OR AND NOT AND.
COSC 3101A - Design and Analysis of Algorithms 14 NP-Completeness.
The NP class. NP-completeness Lecture2. The NP-class The NP class is a class that contains all the problems that can be decided by a Non-Deterministic.
Construction We constructed the following graph: This graph has several nice properties: Diameter Two Graph Pebbling Tim Lewis 1, Dan Simpson 1, Sam Taggart.
Chapter 9 PSPACE: A Class of Problems Beyond NP
Richard Anderson Lecture 26 NP-Completeness
Polynomial-Time Reduction
Richard Anderson Lecture 26 NP-Completeness
NP-Completeness Yin Tat Lee
Intro to Theory of Computation
Intro to Theory of Computation
Geography Game Geography. Amy names capital city c of country she is in. Bob names a capital city c' that starts with the letter on which c ends. Amy.
Richard Anderson Lecture 25 NP-Completeness
Chapter 8 NP and Computational Intractability
NP-Completeness Yin Tat Lee
CSE 6408 Advanced Algorithms.
CS21 Decidability and Tractability
Theory of Computability
Instructor: Aaron Roth
Presentation transcript:

1 Chapter 9 PSPACE: A Class of Problems Beyond NP Slides by Kevin Wayne Pearson-Addison Wesley. All rights reserved.

2 Geography Game Geography. Amy names capital city c of country she is in. Bob names a capital city c' that starts with the letter on which c ends. Amy and Bob repeat this game until one player is unable to continue. Does Alice have a forced win? Ex. Budapest  Tokyo  Ottawa  Ankara  Amsterdam  Moscow  Washington  Nairobi  … Geography on graphs. Given a directed graph G = (V, E) and a start node s, two players alternate turns by following, if possible, an edge out of the current node to an unvisited node. Can first player guarantee to make the last legal move? Remark. Some problems (especially involving 2-player games and AI) defy classification according to P, EXPTIME, NP, and NP-complete.

9.1 PSPACE

4 PSPACE P. Decision problems solvable in polynomial time. PSPACE. Decision problems solvable in polynomial space. Observation. P  PSPACE. poly-time algorithm can consume only polynomial space

5 PSPACE Binary counter. Count from 0 to 2 n - 1 in binary. Algorithm. Use n bit odometer. Claim. 3-SAT is in PSAPCE. Pf. n Enumerate all 2 n possible truth assignments using counter. n Check each assignment to see if it satisfies all clauses. ▪ Theorem. NP  PSPACE. Pf. Consider arbitrary problem Y in NP. n Since Y  P 3-SAT, there exists algorithm that solves Y in poly-time plus polynomial number of calls to 3-SAT black box. n Can implement black box in poly-space. ▪

9.3 Quantified Satisfiability

7 QSAT. Let  (x 1, …, x n ) be a Boolean CNF formula. Is the following propositional formula true? Intuition. Amy picks truth value for x 1, then Bob for x 2, then Amy for x 3, and so on. Can Amy satisfy  no matter what Bob does? Ex. Yes. Amy sets x 1 true; Bob sets x 2 ; Amy sets x 3 to be same as x 2. Ex. No. If Amy sets x 1 false; Bob sets x 2 false; Amy loses; No. if Amy sets x 1 true; Bob sets x 2 true; Amy loses. Quantified Satisfiability  x 1  x 2  x 3  x 4 …  x n-1  x n  (x 1, …, x n ) assume n is odd

8 QSAT is in PSPACE Theorem. QSAT  PSAPCE. Pf. Recursively try all possibilities. n Only need one bit of information from each subproblem. n Amount of space is proportional to depth of function call stack.   x 1 = 0  x 2 = 0 x 3 = 0 x 2 = 1 x 3 = 1   x 1 = 1  (0, 0, 0)  (0, 0, 1)  (0, 1, 0)  (0, 1, 1)  (1, 0, 0)  (1, 0, 1)  (1, 1, 0)  (1, 1, 1) return true iff both subproblems are true return true iff either subproblem is true

9.4 Planning Problem

10 15-Puzzle 8-puzzle, 15-puzzle. [Sam Loyd 1870s] n Board: 3-by-3 grid of tiles labeled 1-8. n Legal move: slide neighboring tile into blank (white) square. n Find sequence of legal moves to transform initial configuration into goal configuration initial configurationgoal configuration move ?

11 Planning Problem Conditions. Set C = { C 1, …, C n }. Initial configuration. Subset c 0  C of conditions initially satisfied. Goal configuration. Subset c*  C of conditions we seek to satisfy. Operators. Set O = { O 1, …, O k }. n To invoke operator O i, must satisfy certain prereq conditions. n After invoking O i certain conditions become true, and certain conditions become false. PLANNING. Is it possible to apply sequence of operators to get from initial configuration to goal configuration? Examples. n 15-puzzle. n Rubik's cube. n Logistical operations to move people, equipment, and materials.

12 Planning Problem: 8-Puzzle Planning example. Can we solve the 8-puzzle? Conditions. C ij, 1  i, j  9. Initial state. c 0 = {C 11, C 22, …, C 66, C 78, C 87, C 99 }. Goal state. c* = {C 11, C 22, …, C 66, C 77, C 88, C 99 }. Operators. n Precondition to apply O i = {C 11, C 22, …, C 66, C 78, C 87, C 99 }. n After invoking O i, conditions C 79 and C 97 become true. n After invoking O i, conditions C 78 and C 99 become false. Solution. No solution to 8-puzzle or 15-puzzle! C ij means tile i is in square j OiOi

13 Diversion: Why is 8-Puzzle Unsolvable? 8-puzzle invariant. Any legal move preserves the parity of the number of pairs of pieces in reverse order (inversions) inversions 1-3, 2-3, inversions 1-3, 2-3, 7-8, 5-8, inversions 1-3, 2-3, inversions inversion: 7-8

14 Planning Problem: Binary Counter Planning example. Can we increment an n-bit counter from the all- zeroes state to the all-ones state? Conditions. C 1, …, C n. Initial state. c 0 = . Goal state. c* = {C 1, …, C n }. Operators. O 1, …, O n. n To invoke operator O i, must satisfy C 1, …, C i-1. n After invoking O i, condition C i becomes true. n After invoking O i, conditions C 1, …, C i-1 become false. Solution. {C 1 }  {C 2 }  {C 1, C 2 }  {C 3 }  {C 3, C 1 }  … Observation. Any solution requires at least 2 n - 1 steps. C i corresponds to bit i = 1 all 0s all 1s i-1 least significant bits are 1 set bit i to 1 set i-1 least significant bits to 0

15 Planning Problem: In Exponential Space Configuration graph G. n Include node for each of 2 n possible configurations. n Include an edge from configuration c' to configuration c'' if one of the operators can convert from c' to c''. PLANNING. Is there a path from c 0 to c* in configuration graph? Claim. PLANNING is in EXPTIME. Pf. Run BFS to find path from c 0 to c* in configuration graph. ▪ Note. Configuration graph can have 2 n nodes, and shortest path can be of length = 2 n - 1. binary counter

16 Planning Problem: In Polynomial Space Theorem. PLANNING is in PSPACE. Pf. n Suppose there is a path from c 1 to c 2 of length L. n Path from c 1 to midpoint and from c 2 to midpoint are each  L/2. n Enumerate all possible midpoints. n Apply recursively. Depth of recursion = log 2 L. ▪ boolean hasPath(c 1, c 2, L) { if (L  1) return correct answer foreach configuration c' { boolean x = hasPath(c 1, c', L/2) boolean y = hasPath(c 2, c', L/2) if (x and y) return true } return false } enumerate using binary counter

9.5 PSPACE-Complete

18 PSPACE-Complete PSPACE. Decision problems solvable in polynomial space. PSPACE-Complete. Problem Y is PSPACE-complete if (i) Y is in PSPACE and (ii) for every problem X in PSPACE, X  P Y. Theorem. [Stockmeyer-Meyer 1973] QSAT is PSPACE-complete. Theorem. PSPACE  EXPTIME. Pf. Previous algorithm solves QSAT in exponential time, and QSAT is PSPACE-complete. ▪ Summary. P  NP  PSPACE  EXPTIME. it is known that P  EXPTIME, but unknown which inclusion is strict; conjectured that all are

19 PSPACE-Complete Problems More PSPACE-complete problems. n Competitive facility location. n Natural generalizations of games. – Othello, Hex, Geography, Rush-Hour, Instant Insanity – Shanghai, go-moku, Sokoban n Given a memory restricted Turing machine, does it terminate in at most k steps? n Do two regular expressions describe different languages? n Is it possible to move and rotate complicated object with attachments through an irregularly shaped corridor? n Is a deadlock state possible within a system of communicating processors?

20 Competitive Facility Location Input. Graph with positive edge weights, and target B. Game. Two competing players alternate in selecting nodes. Not allowed to select a node if any of its neighbors has been selected. Competitive facility location. Can second player guarantee at least B units of profit? Yes if B = 20; no if B = 25.

21 Competitive Facility Location Claim. COMPETITIVE-FACILITY is PSPACE-complete. Pf. n To solve in poly-space, use recursion like QSAT, but at each step there are up to n choices instead of 2. n To show that it's complete, we show that QSAT polynomial reduces to it. Given an instance of QSAT, we construct an instance of COMPETITIVE-FACILITY such that player 2 can force a win iff QSAT formula is true.

22 Competitive Facility Location Construction. Given instance  (x 1, …, x n ) = C 1  C 1  … C k of QSAT. n Include a node for each literal and its negation and connect them. – at most one of x i and its negation can be chosen n Choose c  k+2, and put weight c i on literal x i and its negation; set B = c n-1 + c n-3 + … + c 4 + c – ensures variables are selected in order x n, x n-1, …, x 1. n As is, player 2 will lose by 1 unit: c n-1 + c n-3 + … + c 4 + c n assume n is odd

23 Competitive Facility Location Construction. Given instance  (x 1, …, x n ) = C 1  C 1  … C k of QSAT. n Give player 2 one last move on which she can try to win. n For each clause C j, add node with value 1 and an edge to each of its literals. n Player 2 can make last move iff truth assignment defined alternately by the players failed to satisfy some clause. ▪ n