The class NP Section 7.3 Giorgi Japaridze Theory of Computability.

Slides:



Advertisements
Similar presentations
1 Nondeterministic Space is Closed Under Complement Presented by Jing Zhang and Yingbo Wang Theory of Computation II Professor: Geoffrey Smith.
Advertisements

INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
NP-complete and NP-hard problems Transitivity of polynomial-time many-one reductions Concept of Completeness and hardness for a complexity class Definition.
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
NL equals coNL Section 8.6 Giorgi Japaridze Theory of Computability.
Probabilistic algorithms Section 10.2 Giorgi Japaridze Theory of Computability.
The diagonalization method The halting problem is undecidable Decidability.
Complexity 15-1 Complexity Andrei Bulatov Hierarchy Theorem.
Computability and Complexity 13-1 Computability and Complexity Andrei Bulatov The Class NP.
1 Introduction to Computability Theory Lecture12: Decidable Languages Prof. Amos Israeli.
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)
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 )
Complexity ©D.Moshkovitz 1 Turing Machines. Complexity ©D.Moshkovitz 2 Motivation Our main goal in this course is to analyze problems and categorize them.
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY Read sections 7.1 – 7.3 of the book for next time.
NP-Complete Problems Problems in Computer Science are classified into
Computability and Complexity 20-1 Computability and Complexity Andrei Bulatov Class NL.
Analysis of Algorithms CS 477/677
CS 310 – Fall 2006 Pacific University CS310 P vs NP the steel cage death match Section 7.2 November 29, 2006.
Time Complexity.
CS Master – Introduction to the Theory of Computation Jan Maluszynski - HT Lecture NP-Completeness Jan Maluszynski, IDA, 2007
Computability and Complexity 17-1 Computability and Complexity Andrei Bulatov Strong NP-Completeness.
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
חישוביות וסיבוכיות Computability and Complexity Lecture 7 TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A AAAA.
Computational Complexity Theory Lecture 2: Reductions, NP-completeness, Cook-Levin theorem Indian Institute of Science.
NP-complete Problems SAT 3SAT Independent Set Hamiltonian Cycle
Computer Language Theory
CSCI 2670 Introduction to Theory of Computing November 23, 2004.
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.
Additional NP-complete problems
Interactive proof systems Section 10.4 Giorgi Japaridze Theory of Computability.
1 Design and Analysis of Algorithms Yoram Moses Lecture 11 June 3, 2010
The Class NP Lecture 39 Section 7.3 Mon, Nov 26, 2007.
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.
NP-completeness Section 7.4 Giorgi Japaridze Theory of Computability.
Automata & Formal Languages, Feodor F. Dragan, Kent State University 1 CHAPTER 7 Time complexity Contents Measuring Complexity Big-O and small-o notation.
Hierarchy theorems Section 9.1 Giorgi Japaridze Theory of Computability.
CSCI 2670 Introduction to Theory of Computing November 17, 2005.
Donghyun (David) Kim Department of Mathematics and Computer Science North Carolina Central University 1 Chapter 7 Time Complexity Some slides are in courtesy.
CS 461 – Nov. 18 Section 7.1 Overview of complexity issues –“Can quickly decide” vs. “Can quickly verify” Measuring complexity Dividing decidable languages.
Alternation Section 10.3 Giorgi Japaridze Theory of Computability.
Lecture. Today Problem set 9 out (due next Thursday) Topics: –Complexity Theory –Optimization versus Decision Problems –P and NP –Efficient Verification.
NP-complete Languages
CSCI 2670 Introduction to Theory of Computing December 2, 2004.
April 13 th Class Notes Hw# 5 will be worth 50 points and it will be posted tonight or tomorrow.
Computability Examples. Reducibility. NP completeness. Homework: Find other examples of NP complete problems.
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.
Theory of Computational Complexity TA : Junichi Teruyama Iwama lab. D3
NP-Completeness A problem is NP-complete if: It is in NP
The NP class. NP-completeness
CSE 105 theory of computation
Time complexity Here we will consider elements of computational complexity theory – an investigation of the time (or other resources) required for solving.
Theory of Computability
CSC 4170 Theory of Computation The class NP Section 7.3.
CS154, Lecture 13: P vs NP.
CSC 4170 Theory of Computation Time complexity Section 7.1.
Theory of Computability
Time Complexity Classes
CSC 4170 Theory of Computation The class NP Section 7.3.
Theory of Computability
CSE 589 Applied Algorithms Spring 1999
Instructor: Aaron Roth
Instructor: Aaron Roth
CSE 105 theory of computation
CSC 4170 Theory of Computation Time complexity Section 7.1.
Theory of Computability
Theory of Computability
Presentation transcript:

The class NP Section 7.3 Giorgi Japaridze Theory of Computability

The HAMPATH problem 7.3.a Giorgi Japaridze Theory of Computability A Hamiltonian path in a directed graph G is a directed path that goes through each node exactly once. We consider a special case of this problem where the start node and target node are fixed. HAMPATH = { | G is a directed graph with a Hamiltonian path from s to t} s t s t  PATH?  HAMPATH?

Polynomial verifiability 7.3.b Giorgi Japaridze Theory of Computability s t Does this graph have a Hamiltonian path?

The COMPOSITES problem 7.3.c Giorgi Japaridze Theory of Computability COMPOSITES = {x | x=pq for some integers p,q>1} 15  COMPOSITES ? 17  COMPOSITES ? 77  COMPOSITES ?  COMPOSITES ? 997,111,111,911,111,119,131,119,871  COMPOSITES ? COMPOSITES is very easily seen to be verifiable in polynomial time. But only a few years ago it was proven that it is also decidable in polynomial time. The same question, however, remains open for HAMPATH --- one of the seven $1,000,000 questions!

Definition of a verifier 7.3.d Giorgi Japaridze Theory of Computability Definition 7.18 A verifier for a language A is an algorithm V, where A = {w | V accepts for some string c}. We measure the time of a verifier only in terms of the length of w, so 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. The above string c, used as additional information to verify that w  A, is called a certificate, or proof, of membership in A. What is a certificate for  HAMPATH? What is a verifier for HAMPATH? Observe that, for polynomial verifiers, the certificate has polynomial length (in the length of w) because that is all the verifier can access in its time bound. What is a certificate for x  COMPOSITES? What is a verifier for COMPOSITES?

Definition of NP 7.3.e Giorgi Japaridze Theory of Computability Definition 7.19 NP is the class of languages that have polynomial time verifiers. A very important class, because many natural and important problems are in it! NP stand for “nondeterministic polynomial”. As it turns out (Theorem 7.20), an alternative characterization of NP is to say that this is the class of languages decidable by polynomial-time nondeterministic Turing machines. Here is such a machine for HAMPATH: N1 = “On input, where G is a directed graph with nodes s and t: 1. Write a list on m members p 1,…,p m, where m is the number of nodes of G. Each number in the list is nondeterministically selected to be between 1 and m. 2. Check for repetitions in the list. If any are found, reject. 3. Check whether s=p 1 and t=p m. If either fail, reject. 4. For each i between 1 and m-1, check whether (p i,p i+1 ) is an edge of G. If any are not, reject. Otherwise, all tests have been passed, so accept.”

NP in terms of nondeterministic Turing machines 7.3.f Giorgi Japaridze Theory of Computability Theorem 7.20 A language is in NP iff it is decided by some nondeterministic polynomial time Turing machine. Proof. The idea is to show how to convert a polynomial time verifier into a polynomial time NTM, and vice versa. The NTM simulates the verifier by guessing the certificate. The verifier simulates the NTM by using the accepting branch as the certificate. (  ) Assume A  NP. Let V be a verifier for A with V  TIME(n k ), which, by the definition of NP, exists. Construct N as follows: N = “On input w of length n: 1. Nondeterministically select a string c of length at most n k. 2. Run V on input. 3. If V accepts, accept; otherwise reject.” (  ) Assume A is decided by a polynomial time NTM N. Construct a verifier V as follows: V = “On input, where w and c are strings: Check whether c is (encodes) an accepting computation branch of N on input w. If yes, accept; otherwise reject.”

Definition of NTIME(t(n)) 7.3.g Giorgi Japaridze Theory of Computability Definition 7.21 Let t(n) be a function. NTIME(t(n)) is defined as {L | L is a language decided by some O(t(n)) time NTM}. Corollary 7.22 NP = NTIME(n 1 )  NTIME(n 2 )  NTIME(n 3 )  NTIME(n 4 )  … Just like P, the class NP is insensitive to the choice of the reasonable underlying computational model because all such models are polynomially equivalent. So, when describing and analyzing nondeterministic polynomial algorithms, we can follow the preceding (lazy man’s) conventions for deterministic polynomial time algorithms.

The CLIQUE problem 7.3.h Giorgi Japaridze Theory of Computability A k-clique in an undirected graph is a subgraph with k nodes, wherein every two nodes are connected by an edge. On the right we see a 5-clique CLIQUE = { | G is an undirected graph with a k-clique} Theorem 7.24 CLIQUE  NP. Proof. Here is a polynomial time verifier V for CLIQUE: V = “On input,c>: 1. Test whether c is a set of k nodes in G. 2. Test whether G contains all edges connecting nodes in c. 3. If both pass, accept; otherwise reject.” Idea: The clique is the certificate. Alternative proof. Here is a polynomial time NTM N deciding CLIQUE: N = “On input : 1. Nondeterministically select a subset c of k nodes of G. 2. Test whether G contains all edges connecting nodes in c. 3. If yes, accept; otherwise reject.”

The SUBSET-SUM problem 7.3.i Giorgi Japaridze Theory of Computability SUBSET-SUM = { | S is a multiset of integers and, for some R  S, the sum of all elements of R equals t} Theorem 7.25 SUBSET-SUM  NP. Proof. Here is a polynomial time verifier V for SUBSET-SUM: V = “On input,c>: 1. Test whether c is a collection of numbers that sum to t. 2. Test whether S contains all the numbers in c. 3. If both pass, accept; otherwise reject.” Idea: The subset is the certificate. Alternative proof. Here is a polynomial time NTM N deciding SUBSET-SUM: N = “On input : 1. Nondeterministically select a subset c of S. 2. Test whether the elements of c sum up to t. 3. If yes, accept; otherwise reject.”

P vs. NP vs. coNP vs. EXPTIME 7.3.j Giorgi Japaridze Theory of Computability Definitions coNP = {L | L is the complement of some language in NP} EXPTIME = TIME(2 n 1 )  TIME(2 n 2 )  TIME(2 n 3 )  … This is what we know : P NP coNP EXPTIME NP  coNP ≠ EXPTIME This is what we do not know: P = NP? NP = coNP? P = NP  coNP? P: membership can be decided quickly NP: membership can be verified quickly coNP: membership can be refuted quickly EXPTIME: none of the above