CS154, Lecture 13: P vs NP.

Slides:



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

INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
The class NP Section 7.3 Giorgi Japaridze Theory of Computability.
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
The diagonalization method The halting problem is undecidable Decidability.
Computability and Complexity 13-1 Computability and Complexity Andrei Bulatov The Class NP.
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 )
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY Read sections 7.1 – 7.3 of the book for next time.
1 Polynomial Time Reductions Polynomial Computable function : For any computes in polynomial time.
NP-Complete Problems Problems in Computer Science are classified into
Time Complexity.
CS Master – Introduction to the Theory of Computation Jan Maluszynski - HT Lecture NP-Completeness Jan Maluszynski, IDA, 2007
February 20, 2015CS21 Lecture 191 CS21 Decidability and Tractability Lecture 19 February 20, 2015.
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
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.
Theory of Computing Lecture 17 MAS 714 Hartmut Klauck.
CSCI 2670 Introduction to Theory of Computing November 29, 2005.
Complexity 25-1 Complexity Andrei Bulatov Counting Problems.
NP-Complete Problems. Running Time v.s. Input Size Concern with problems whose complexity may be described by exponential functions. Tractable problems.
CS 3343: Analysis of Algorithms Lecture 25: P and NP Some slides courtesy of Carola Wenk.
NP-completeness Class of hard problems. Jaruloj ChongstitvatanaNP-complete Problems2 Outline  Introduction  Problems and Languages Turing machines and.
Chapter 11 Introduction to Computational Complexity Copyright © 2011 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1.
NPC.
NP-complete Languages
CSCI 2670 Introduction to Theory of Computing December 2, 2004.
CSCI 2670 Introduction to Theory of Computing December 7, 2005.
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.
 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
ICS 353: Design and Analysis of Algorithms NP-Complete Problems King Fahd University of Petroleum & Minerals Information & Computer Science Department.
NP-Completeness A problem is NP-complete if: It is in NP
The NP class. NP-completeness
Chapter 10 NP-Complete Problems.
Computational Complexity Theory
Richard Anderson Lecture 26 NP-Completeness
Advanced Algorithms Analysis and Design
CS154, Lecture 7: Turing Machines.
CS154, Lecture 13: P vs NP.
NP-Completeness Yin Tat Lee
CS21 Decidability and Tractability
Intro to Theory of Computation
Intro to Theory of Computation
CS154, Lecture 16: More NP-Complete Problems; PCPs
ICS 353: Design and Analysis of Algorithms
Intro to Theory of Computation
Automata and Formal Languages (Final Review)
CS21 Decidability and Tractability
Chapter 34: NP-Completeness
NP-Complete Problems.
CS21 Decidability and Tractability
CSC 4170 Theory of Computation The class NP Section 7.3.
CS154, Lecture 12: Time Complexity
CS21 Decidability and Tractability
CSC 4170 Theory of Computation The class NP Section 7.3.
NP-Completeness Yin Tat Lee
Umans Complexity Theory Lectures
CS154, Lecture 16: More NP-Complete Problems; PCPs
NP-Completeness Lecture for CS 302.
CSE 589 Applied Algorithms Spring 1999
Instructor: Aaron Roth
Instructor: Aaron Roth
Instructor: Aaron Roth
Theory of Computability
Intro to Theory of Computation
Presentation transcript:

CS154, Lecture 13: P vs NP

The EXTENDED Church-Turing Thesis  Polynomial-Time Turing Machines Everyone’s Intuitive Notion of Efficient Algorithms More generally: TM can simulate every “reasonable” model of computation with only polynomial increase in time A controversial thesis! Potential counterexamples: quantum algorithms

Nondeterministic Turing Machines …are just like standard TMs, except: 1. The machine may proceed according to several possible transitions (like an NFA) 2. The machine accepts an input string if there exists an accepting computation history for the machine on the string

Definition: A nondeterministic TM is a 7-tuple T = (Q, Σ, Γ, , q0, qaccept, qreject), where: Q is a finite set of states Σ is the input alphabet, where   Σ Γ is the tape alphabet, where   Γ and Σ  Γ  : Q  Γ → 2(Q  Γ  {L,R}) q0  Q is the start state qaccept  Q is the accept state qreject  Q is the reject state, and qreject  qaccept

Defining Acceptance for NTMs Let N be a nondeterministic Turing machine An accepting computation history for N on w is a sequence of configurations C0,C1,…,Ct where 1. C0 is the start configuration q0w, 2. Ct is an accepting configuration, 3. Each configuration Ci yields Ci+1 Def. N(w) accepts in t time  Such a history exists N has time complexity T(n) if for all n, for all inputs of length n and for all histories, N halts in T(n) time

TIME(t(n))  NTIME(t(n)) Is TIME(t(n)) = NTIME(t(n)) for all t(n)? Definition: NTIME(t(n)) = { L | L is decided by a O(t(n)) time nondeterministic Turing machine } TIME(t(n))  NTIME(t(n)) Is TIME(t(n)) = NTIME(t(n)) for all t(n)?

What problems can we efficiently solved nondeterministically, but not

The Clique Problem k-clique = complete subgraph on k nodes a d f c b e

The Clique Problem Find a clique of 1 million nodes?

Assume a reasonable encoding of graphs (example: the adjacency matrix is reasonable) CLIQUE = { (G,k) | G is an undirected graph with a k-clique } Theorem: CLIQUE  NTIME(nc) for some c > 1 N((V,E),k): Nondeterministically guess a subset S of V with |S| = k For all u, v in S, if (u,v) is not in E then reject Accept

The Hamiltonian Path Problem c d f h i g A Hamiltonian path traverses through each node exactly once

HAMPATH = { (G,s,t) | G is a directed graph with HAMPATH = { (G,s,t) | G is a directed graph with a Hamiltonian path from s to t } Theorem: HAMPATH  NTIME(nc) for some c > 1 N((V,E),s,t): Nondeterministically guess a sequence v1, …, v|V| of vertices If vi = vj for some i ≠ j, reject For all i = 1,…,|V|-1, if (vi,vi+1) is not in E then reject If (v1 = s & vn = t) then accept else reject

Nondeterministic Polynomial Time NP = NTIME(nk)  k  N

L = { x |  y ϵ Σ* [|y| ≤ |x|k and V(x,y) accepts ] } Theorem: L  NP  There is a constant k and polynomial-time TM V such that L = { x |  y ϵ Σ* [|y| ≤ |x|k and V(x,y) accepts ] } Proof: If L = { x | y |y| ≤ |x|k and V(x,y) accepts } then L  NP Define the NTM N(x): Guess y of length at most |x|k Run V(x,y) and output answer Then, L(N) is the set of x s.t. [|y| ≤ |x|k & V(x,y) accepts] (2) If L  NP then L = { x | y |y| ≤ |x|k and V(x,y) accepts } Suppose N is a poly-time NTM that decides L. Define V(x,y) to accept iff y encodes an accepting computation history of N on x

there are polynomial-length proofs A language L is in NP if and only if there are polynomial-length proofs (aka. certificates or witnesses) for membership in L CLIQUE = { (G,k) |  subset of nodes S such that S is a k-clique in G } HAMPATH = { (G,s,t) |  Hamiltonian path in graph G from node s to node t }

Boolean Formula Satisfiability logical operations  recedes  precedes  parentheses  = (x  y)  z Boolean variables (0 or 1)

Boolean Formula Satisfiability  = (x  y)  z A satisfying assignment is a setting of the variables that makes the formula true x = 1, y = 1, z = 1 is a satisfying assignment for  (in fact, any assignment with z = 1 is satisfying)  = (x  y)  (z  x) 1

A Boolean formula is satisfiable if there is a true/false setting to the variables that makes the formula true a  b  c  d YES (x  y)  x NO SAT = {  |  is a satisfiable Boolean formula }

A 3cnf-formula has the form: (x1  x2  x3)  (x4  x2  x5)  (x3  x2  x1) clauses literals 3SAT = {  |  is a satisfiable 3cnf-formula }

3SAT = {  |  is a satisfiable 3cnf-formula } Theorem: 3SAT  NP We can express 3SAT as 3SAT = {  |  is in 3cnf and  string y that encodes a satisfying assignment to  } The number of variables of  is at most ||, so |y| ≤ ||. Then, argue that the language 3SAT-CHECK = {(,y) |  is in 3cnf and y is a satisfying assignment to } is in P. (Similarly, SAT  NP)

NP = Problems with the property that, once you have the solution, it is “easy” to verify the solution When  ϵ SAT, or (G, k) ϵ CLIQUE, or (G,s,t) ϵ HAMPATH, Can prove that with a short proof that can easily been verified What if  ∉ SAT? (G, k) ∉ CLIQUE? Or (G,s,t) ∉ HAMPATH?

P = the problems that can be efficiently solved NP = the problems where proposed solutions can be efficiently verified Is P = NP? can problem solving be automated? Clay Math Institute in the year 2000: “millennium problems”

If P = NP: Mathematicians may be out of a job Cryptography as we know it may be impossible In principle, every aspect of life could be efficiently and globally optimized … life as we know it would be different! Conjecture: P  NP

Polynomial Time Reducibility f : Σ*  Σ* is a polynomial time computable function if there is a poly-time Turing machine M that on every input w, halts with just f(w) on its tape Language A is poly-time reducible to language B, written as A P B, if there is a poly-time computable f : Σ*  Σ* so that: w  A  f(w)  B f is a polynomial time reduction from A to B Note there is a k such that for all w, |f(w)| ≤ |w|k

f converts any string w into a string f(w) such that w  A  f(w)  B nc n w f(w) f n nc f converts any string w into a string f(w) such that w  A  f(w)  B

Theorem: If A P B and B P C, then A P C g C n nc ncd

Theorem: If A P B and B  P, then A  P Proof: Let MB be a poly-time TM that decides B. Let f be a poly-time reduction from A to B. We build a machine MA that decides A as follows: MA = On input w, 1. Compute f(w) 2. Run MB on f(w), output its answer w  A  f(w)  B

Theorem: If A P B and B  NP, then A  NP Proof: Analogous…

Theorem: If A P B and B  P, then A  P Theorem: If A P B and B  NP, then A  NP Corollary: If A P B and A ∉ P, then B ∉ P

Definition: A language B is NP-complete if: 1. B  NP 2. Every A in NP is poly-time reducible to B That is, A ≤P B When this is true, we say “B is NP-hard” On homework, you showed A language L is recognizable iff L ≤m ATM ATM is “complete for recognizable languages”: ATM is recognizable, and for all recognizable L, L ≤m ATM

Suppose L is NP-Complete… If L  P, then P = NP If L ∉ P, then P ≠ NP

Suppose L is NP-Complete… Then assuming the conjecture P  NP, L is not decidable in nk time, for every k

The Cook-Levin Theorem: SAT and 3SAT are NP-complete 3SAT  NP A satisfying assignment is a “proof” that a 3cnf formula is satisfiable 3SAT is NP-hard Every language in NP can be polynomial-time reduced to 3SAT (complex logical formula) Corollary: 3SAT  P if and only if P = NP