P and NP Sipser 7.2-7.3 (pages 256-270). CS 311 Fall 2008 2 Polynomial time P = ∪ k TIME(n k ) … P = ∪ k TIME(n k ) … TIME(n 3 ) TIME(n 2 ) TIME(n)

Slides:



Advertisements
Similar presentations
Measuring Time Complexity
Advertisements

Part VI NP-Hardness. Lecture 23 Whats NP? Hard Problems.
1 Nondeterministic Space is Closed Under Complement Presented by Jing Zhang and Yingbo Wang Theory of Computation II Professor: Geoffrey Smith.
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
The class NP Section 7.3 Giorgi Japaridze Theory of Computability.
More NP-completeness Sipser 7.5 (pages ). CS 311 Fall NP’s hardest problems Definition 7.34: A language B is NP-complete if 1.B ∈ NP 2.A≤
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen.
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
The diagonalization method The halting problem is undecidable Decidability.
Measuring Time Complexity Sipser 7.1 (pages )
NP-completeness Sipser 7.4 (pages 271 – 283). CS 311 Mount Holyoke College 2 The classes P and NP NP = ∪ k NTIME(n k ) P = ∪ k TIME(n k )
NP-completeness Sipser 7.4 (pages 271 – 283). CS 311 Fall The classes P and NP NP = ∪ k NTIME(n k ) P = ∪ k TIME(n k )
More Turing Machines Sipser 3.2 (pages ). CS 311 Fall Multitape Turing Machines Formally, we need only change the transition function to.
More NP-completeness Sipser 7.5 (pages ).
More Turing Machines Sipser 3.2 (pages ).
Complexity ©D.Moshkovitz 1 Turing Machines. Complexity ©D.Moshkovitz 2 Motivation Our main goal in this course is to analyze problems and categorize them.
CS5371 Theory of Computation Lecture 11: Computability Theory II (TM Variants, Church-Turing Thesis)
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY Read sections 7.1 – 7.3 of the book for next time.
1 Other Models of Computation. 2 Models of computation: Turing Machines Recursive Functions Post Systems Rewriting Systems.
CS Master – Introduction to the Theory of Computation Jan Maluszynski - HT Lecture 8+9 Time complexity 1 Jan Maluszynski, IDA, 2007
CS 310 – Fall 2006 Pacific University CS310 P vs NP the steel cage death match Section 7.2 November 29, 2006.
CS Master – Introduction to the Theory of Computation Jan Maluszynski - HT Lecture NP-Completeness Jan Maluszynski, IDA, 2007
Fall 2004COMP 3351 Time Complexity We use a multitape Turing machine We count the number of steps until a string is accepted We use the O(k) notation.
CS 310 – Fall 2006 Pacific University CS310 Complexity Section 7.1 November 27, 2006.
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
CS 461 – Nov. 21 Sections 7.1 – 7.2 Measuring complexity Dividing decidable languages into complexity classes. Algorithm complexity depends on what kind.
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.
חישוביות וסיבוכיות Computability and Complexity Lecture 7 TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A AAAA.
Computer Language Theory
CSCI 2670 Introduction to Theory of Computing November 29, 2005.
Measuring complexity Section 7.1 Giorgi Japaridze Theory of Computability.
Computability Heap exercise. The class P. The class NP. Verifiers. Homework: Review RELPRIME proof. Find examples of problems in NP.
Automata & Formal Languages, Feodor F. Dragan, Kent State University 1 CHAPTER 7 Time complexity Contents Measuring Complexity Big-O and small-o notation.
Computability NP complete problems. Space complexity. Homework: [Post proposal]. Find PSPACE- Complete problems. Work on presentations.
Costas Busch - LSU1 Time Complexity. Costas Busch - LSU2 Consider a deterministic Turing Machine which decides a language.
Alternation Section 10.3 Giorgi Japaridze Theory of Computability.
1 Time Complexity We use a multitape Turing machine We count the number of steps until a string is accepted We use the O(k) notation.
Prof. Busch - LSU1 Time Complexity. Prof. Busch - LSU2 Consider a deterministic Turing Machine which decides a language.
 2005 SDU Lecture15 P,NP,NP-complete.  2005 SDU 2 The PATH problem PATH = { | G is a directed graph that has a directed path from s to t} s t
Theory of Computational Complexity TA : Junichi Teruyama Iwama lab. D3
CSCI 2670 Introduction to Theory of Computing November 15, 2005.
 2005 SDU Lecture14 Mapping Reducibility, Complexity.
CSE 105 theory of computation
CSC 4170 Theory of Computation The class P Section 7.2.
Part VI NP-Hardness.
CSC 4170 Theory of Computation The class P Section 7.2.
CSCI 2670 Introduction to Theory of Computing
Theory of Computational Complexity
Intro to Theory of Computation
Computational Complexity
Space Complexity Costas Busch - LSU.
Time Complexity We use a multitape Turing machine
CLASSES P AND NP.
CSC 4170 Theory of Computation The class NP Section 7.3.
CS154, Lecture 13: P vs NP.
Theory of Computability
CSC 4170 Theory of Computation Time complexity Section 7.1.
Theory of Computability
CS21 Decidability and Tractability
Time Complexity Classes
CSC 4170 Theory of Computation The class NP Section 7.3.
Instructor: Aaron Roth
CSE 105 theory of computation
CSC 4170 Theory of Computation Time complexity Section 7.1.
Theory of Computability
Theory of Computability
Intro to Theory of Computation
Presentation transcript:

P and NP Sipser (pages )

CS 311 Fall Polynomial time P = ∪ k TIME(n k ) … P = ∪ k TIME(n k ) … TIME(n 3 ) TIME(n 2 ) TIME(n)

CS 311 Fall “Practical” problems If n = 100 –n 3 = 1 billion –2 n > #atoms in the universe Polynomial time is generally considered “practical” for a computer P is the class of “solvable” or “tractable” problems

CS 311 Fall How many tapes? Definition 7.12: P is the class of languages that are decidable in polynomial time by a deterministic single-tape Turing machine. But remember… we can convert from single-tape to multi-tape! –What was the time complexity conversion?

CS 311 Fall Polynomially equivalent models # # # # M M a a a a a a b b a a S S a a a a a a # # 0 0 b b a a # #

CS 311 Fall Finding your way PATH = { | ∃ directed s to t path in G} s t

CS 311 Fall PATH ∈ P M = "On input : 1.Place a mark on node s. 2.Repeat until no additional nodes are marked: 3. Scan all edges of G. If (a,b) found from marked node to unmarked node, mark b. 4.If t is marked, accept. Otherwise, reject.

CS 311 Fall Hamiltonian paths HAMPATH = { | ∃ Hamiltonian path from s to t} s t

CS 311 Fall Hamiltonian paths HAMPATH = { | ∃ Hamiltonian path from s to t} s t

CS 311 Fall Checking for Hamiltonian paths Brute force method E = "On input : 1.Generate all orderings, p 1, p 2,..., p n, of the nodes of G 2.Check whether s = p 1 and t = p n 3.For each i=1 to n-1, check whether (p i, p i+1 ) is an edge of G. If any are not, reject. Otherwise, accept.”

CS 311 Fall Guessing a solution N = "On input : 1.Guess an orderings, p 1, p 2,..., p n, of the nodes of G 2.Check whether s = p 1 and t = p n 3.For each i=1 to n-1, check whether (p i, p i+1 ) is an edge of G. If any are not, reject. Otherwise, accept.”

CS 311 Fall Nondeterministic time complexity Definition 7.9: Let N be a NTM. The running time of N is a function f: N → N, where f(n) is the maximum number of steps that N uses on any branch of its computation on any input of length n f(n) Deterministic Nondeterministic f(n)

CS 311 Fall Nondeterministic time complexity classes Definition 7.21: NTIME(t(n)) = {L | L is decided in O(t(n)) time by an NTM}

CS 311 Fall Verifiers Definition 7.18: –A verifier for a language A is an algorithm V, where A = {w | V accepts for some string c} –A polynomial time verifier runs in polynomial time in the length of w –A language A is polynomially verifiable if it has a polynomial time verifier

CS 311 Fall The class NP Definition 7.19: NP is the class of languages that have polynomial time verifiers

CS 311 Fall Nondeterminism and verifiers Theorem 7.20: A language is in NP iff it is decided by some nondeterministic polynomial time Turing machine Corollary 7.19: NP = ∪ k NTIME(n k )

CS 311 Fall The classes P and NP NP = ∪ k NTIME(n k ) P = ∪ k TIME(n k )

CS 311 Fall The big question: P = NP ? P ⊆ NP ⊆ PSPACE = NPSPACE ⊆ EXPTIME proper containment