Space Complexity. Reminder: P, NP classes P NP is the class of problems for which: –Guessing phase: A polynomial time algorithm generates a plausible.

Slides:



Advertisements
Similar presentations
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
Advertisements

Techniques for Dealing with Hard Problems Backtrack: –Systematically enumerates all potential solutions by continually trying to extend a partial solution.
Department of Computer Science & Engineering
NP-complete and NP-hard problems Transitivity of polynomial-time many-one reductions Concept of Completeness and hardness for a complexity class Definition.
The Theory of NP-Completeness
1 NP-Complete Problems. 2 We discuss some hard problems:  how hard? (computational complexity)  what makes them hard?  any solutions? Definitions 
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen.
Search Strategies.  Tries – for word searchers, spell checking, spelling corrections  Digital Search Trees – for searching for frequent keys (in text,
Alternation Alternation: generalizes non-determinism, where each state is either “existential” or “universal”: Old: existential states New: universal states.
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
© The McGraw-Hill Companies, Inc., Chapter 8 The Theory of NP-Completeness.
Minimax and Alpha-Beta Reduction Borrows from Spring 2006 CS 440 Lecture Slides.
Complexity 11-1 Complexity Andrei Bulatov Space Complexity.
This time: Outline Game playing The minimax algorithm
NP-complete and NP-hard problems Transitivity of polynomial-time many-one reductions Definition of complexity class NP –Nondeterministic computation –Problems.
1 NP-Completeness Objectives: At the end of the lesson, students should be able to: 1. Differentiate between class P, NP, and NPC 2. Reduce a known NPC.
CS151 Complexity Theory Lecture 12 May 6, CS151 Lecture 122 Outline The Polynomial-Time Hierarachy (PH) Complete problems for classes in PH, PSPACE.
NP-complete and NP-hard problems
88- 1 Chapter 8 The Theory of NP-Completeness P: the class of problems which can be solved by a deterministic polynomial algorithm. NP : the class.
Analysis of Algorithms CS 477/677
Chapter 11: Limitations of Algorithmic Power
Ref: Pfleeger96, Ch.31 NP-Complete Problems Reference: Pfleeger, Charles P., Security in Computing, 2nd Edition, Prentice Hall, 1996.
Game Playing State-of-the-Art  Checkers: Chinook ended 40-year-reign of human world champion Marion Tinsley in Used an endgame database defining.
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
The Theory of NP-Completeness 1. Nondeterministic algorithms A nondeterminstic algorithm consists of phase 1: guessing phase 2: checking If the checking.
The Theory of NP-Completeness 1. What is NP-completeness? Consider the circuit satisfiability problem Difficult to answer the decision problem in polynomial.
Game Playing. Introduction Why is game playing so interesting from an AI point of view? –Game Playing is harder then common searching The search space.
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.
1 Chapter 9 PSPACE: A Class of Problems Beyond NP Slides by Kevin Wayne Pearson-Addison Wesley. All rights reserved.
Theory of Computation, Feodor F. Dragan, Kent State University 1 NP-Completeness P: is the set of decision problems (or languages) that are solvable in.
Computational Complexity Theory Lecture 2: Reductions, NP-completeness, Cook-Levin theorem Indian Institute of Science.
Cs3102: Theory of Computation Class 24: NP-Completeness Spring 2010 University of Virginia David Evans.
CSCI 2670 Introduction to Theory of Computing November 29, 2005.
Week 10Complexity of Algorithms1 Hard Computational Problems Some computational problems are hard Despite a numerous attempts we do not know any efficient.
EMIS 8373: Integer Programming NP-Complete Problems updated 21 April 2009.
CSCI 3160 Design and Analysis of Algorithms Tutorial 10 Chengyu Lin.
1 The Theory of NP-Completeness 2 Cook ’ s Theorem (1971) Prof. Cook Toronto U. Receiving Turing Award (1982) Discussing difficult problems: worst case.
Aaron Bloomfield CS 4102 Spring 2011
NP-Complete Problems. Running Time v.s. Input Size Concern with problems whose complexity may be described by exponential functions. Tractable problems.
Adversarial Search Chapter Games vs. search problems "Unpredictable" opponent  specifying a move for every possible opponent reply Time limits.
A Problem That Is Complete for PSPACE (Polynomial Space) BY TEJA SUDHA GARIGANTI.
1 CSE 326: Data Structures: Graphs Lecture 24: Friday, March 7 th, 2003.
1 CPSC 320: Intermediate Algorithm Design and Analysis July 30, 2014.
Chapter 11 Introduction to Computational Complexity Copyright © 2011 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1.
NPC.
Adversarial Search. Regular Tic Tac Toe Play a few games. –What is the expected outcome –What kinds of moves “guarantee” that?
Homework 8 Solutions Problem 1. Draw a diagram showing the various classes of languages that we have discussed and alluded to in terms of which class.
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.
The Theory of NP-Completeness 1. Nondeterministic algorithms A nondeterminstic algorithm consists of phase 1: guessing phase 2: checking If the checking.
Theory of Computational Complexity Yuji Ishikawa Avis lab. M1.
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.
Chapter 5 Adversarial Search. 5.1 Games Why Study Game Playing? Games allow us to experiment with easier versions of real-world situations Hostile agents.
Complexity of Compositional Model Checking of Computation Tree Logic on Simple Structures Krishnendu Chatterjee Pallab Dasgupta P.P. Chakrabarti IWDC 2004,
The Theory of NP-Completeness
Complexity Classes.
The NP class. NP-completeness
PENGANTAR INTELIJENSIA BUATAN (64A614)
Game Playing.
NP-Completeness Yin Tat Lee
Artificial Intelligence
Game playing.
Kevin Mason Michael Suggs
Artificial Intelligence
Section 14.3 Complexity Classes
NP-Complete Problems.
NP-Completeness Yin Tat Lee
The Theory of NP-Completeness
Instructor: Aaron Roth
LECTURE 2-9 PSPACE-Complete
Presentation transcript:

Space Complexity

Reminder: P, NP classes P NP is the class of problems for which: –Guessing phase: A polynomial time algorithm generates a plausible solution S –Checking phase: A polynomial time algorithm certifies that if S is correct A problem npc is NP-complete if: –npc is in NP –For every other problem np in NP, there is a polynomial time algorithm that transforms np into npc (polynomial reduction)

P is a subset of NP If a problem p is in P, there is an algorithm A solving p and A runs in polynomial time How do we show that it is in NP?  Make A the generation phase  Construct an algorithm that always returns “true” as the checking phase: check(P,S) return true

A new Problem WIN: Generate a winning strategy for a 2-person, turn- based, perfect information, deterministic game. Example? Suppose that the game is finite. Example? The “n” for making complexity analysis is: –For example: Chess –Winning strategy: “policy” on JuKeCB – Chess, we assume that if it reaches 100 moves then the game ends with a tide The number of moves made during a game

A Solution: Minimax Concepts: State: node in search space Operator: valid move Terminal test: game over Utility function: value for outcome of the game MAX: 1 st player, maximizing its own utility MIN: 2 nd player, minimizing Max’s utility

Let us examine the complexity Is minimax polynomial? Can we show that it is in NP? (think certification phase) So is WIN not in NP? No. This requires exploring exponential many branches No. The minimax tree itself is exponential. So certifying it by using the minimax tree will require exponential time We do not know. Likely it is not in NP  No one has been able to proof that is in NP (or P)  No one has been able to proof that it is not in NP (or P)

PSPACE PSPACE is the class of all problems that can be solved with algorithms that use a polynomial amount of memory (regardless of the time they take to run) Examples:  SAT.  ((x  y)  ¬x)  y  We systematically try every combination:  0010, 0111, 1000, 1101  2 n possible combinations  But only O(n) space used  Same trick is use to show that NP is a subset of PSPACE:  Systematically generate each potential solution (need polynomial space only to keep track)  Check if it is a solution

PSPACE-complete A problem psc is PSPACE-complete if:  psc is in PSPACE  For every other problem ps in PSPACE, there is a polynomial time algorithm that transforms ps into psc (polynomial reduction) Example:  QBF: Satisfaction of quantified Boolean formulas:  x  y((x  y)  ¬x)  y

QBF: Quantified Boolean Formulas Qx 1 Qx 2 Qx 3 …Qx n f(x 1, x 2, …, x n ) Where –Each x i is a variable –f(x 1, x 2, …, x n ) is a Boolean formula without quantifiers –x 1, x 2, …, x n are the only variables in f –Qx i can be either  x i or  x i (QSAT) Decision problem: Given a QBF, is it true? false? Observation 1: Seems difficult to prove that QSAT is in NP Observation 2: It is easy to prove that QSAT is in PSPACE

Transforming WIN into QSAT (Example illustrating QSAT PSPACE-completeness) QBF Formula for indicating if a winning formula exists: –Suppose x 1, x 2, x 3, … x n are variables for 1 st, 2 nd, 3 rd,.. moves by Player 1 –Suppose y 1, y 2, y 3, … y n are variables for 1 st, 2 nd, 3 rd,.. moves by Player 2 –Suppose that winPlayer1(x 1, y 1, x 2, y 2,…, y n ) indicates that Player 1 wins when the game sequence is x 1, y 1, x 2, y 2,…, y n –Under this circumstances a winning strategy for Player 1 can be represented as the QBF Formula :  x 1  y 1  x 2  y 2 …  y n win(x 1, y 1, …, y n )

EXP-Classes EXPTIME is the class of problems that can be solved with algorithms that runs in exponential time –Usual definition for EXPTIME-complete –Example: Go EXPSPACE is the class of all problems that can be solved with algorithms that use an exponential amount of memory –Usual definition for ESPSPACE-complete –Example: HTN Planning with “regularity” We know: P  NP  PSPACE  EXPTIME  EXPSPACE