NP-complete Languages

Slides:



Advertisements
Similar presentations
Cook’s Theorem The Foundation of NP-Completeness.
Advertisements

NP-Completeness: Reductions
Complexity 25-1 Complexity Andrei Bulatov #P-Completeness.
Complexity 12-1 Complexity Andrei Bulatov Non-Deterministic Space.
Complexity 11-1 Complexity Andrei Bulatov Space Complexity.
Computability and Complexity 14-1 Computability and Complexity Andrei Bulatov Cook’s Theorem.
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 )
Prof. Busch - LSU1 Decidable Languages. Prof. Busch - LSU2 Recall that: A language is Turing-Acceptable if there is a Turing machine that accepts Also.
Courtesy Costas Busch - RPI1 Non Deterministic Automata.
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY Read sections 7.1 – 7.3 of the book for next time.
NP-Completeness CS 51 Summer 2008 TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A AA A A AAA.
1 Polynomial Time Reductions Polynomial Computable function : For any computes in polynomial time.
NP-Complete Problems Problems in Computer Science are classified into
Computability and Complexity 20-1 Computability and Complexity Andrei Bulatov Class NL.
Fall 2006Costas Busch - RPI1 More NP-complete Problems.
Time Complexity.
NP-Completeness (2) NP-Completeness Graphs 4/17/2017 6:25 AM x x x x x
CS Master – Introduction to the Theory of Computation Jan Maluszynski - HT Lecture NP-Completeness Jan Maluszynski, IDA, 2007
Fall 2005Costas Busch - RPI1 Recursively Enumerable and Recursive Languages.
February 20, 2015CS21 Lecture 191 CS21 Decidability and Tractability Lecture 19 February 20, 2015.
Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.
1 The Cook-Levin Theorem Zeph Grunschlag. 2 Announcements Last HW due Thursday Please give feedback about course at oracle.seas.columbia.edu/wces oracle.seas.columbia.edu/wces.
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.
February 18, 2015CS21 Lecture 181 CS21 Decidability and Tractability Lecture 18 February 18, 2015.
Lecture 22 More NPC problems
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.
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.
Complexity 25-1 Complexity Andrei Bulatov Counting Problems.
CSC401 – Analysis of Algorithms Chapter 13 NP-Completeness Objectives: Introduce the definitions of P and NP problems Introduce the definitions of NP-hard.
NP-completeness Section 7.4 Giorgi Japaridze Theory of Computability.
CSCI 3130: Formal languages and automata theory Andrej Bogdanov The Chinese University of Hong Kong The Cook-Levin.
NP-completeness Class of hard problems. Jaruloj ChongstitvatanaNP-complete Problems2 Outline  Introduction  Problems and Languages Turing machines and.
CS 461 – Nov. 30 Section 7.5 How to show a problem is NP-complete –Show it’s in NP. –Show that it corresponds to another problem already known to be NP-complete.
Costas Busch - LSU1 Time Complexity. Costas Busch - LSU2 Consider a deterministic Turing Machine which decides a language.
CSE 6311 – Spring 2009 ADVANCED COMPUTATIONAL MODELS AND ALGORITHMS Lecture Notes – Feb. 3, 2009 Instructor: Dr. Gautam Das notes by Walter Wilson.
Chapter 11 Introduction to Computational Complexity Copyright © 2011 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1.
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.
CSCI 2670 Introduction to Theory of Computing December 2, 2004.
CSCI 2670 Introduction to Theory of Computing December 7, 2005.
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong NP-complete.
Given this 3-SAT problem: (x1 or x2 or x3) AND (¬x1 or ¬x2 or ¬x2) AND (¬x3 or ¬x1 or x2) 1. Draw the graph that you would use if you want to solve this.
Prof. Busch - LSU1 Busch Complexity Lectures: More NP-complete Problems.
Complexity ©D.Moshkovitz 1 Our First NP-Complete Problem The Cook-Levin theorem A B C.
COSC 3101A - Design and Analysis of Algorithms 14 NP-Completeness.
Prof. Busch - LSU1 Time Complexity. Prof. Busch - LSU2 Consider a deterministic Turing Machine which decides a language.
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.
1 Design and Analysis of Algorithms Yoram Moses Lecture 13 June 17, 2010
 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
Costas Busch - LSU 1 More NP-complete Problems. Costas Busch - LSU 2 Theorem: If: Language is NP-complete Language is in NP is polynomial time reducible.
NP-Completeness A problem is NP-complete if: It is in NP
The NP class. NP-completeness
More NP-complete Problems
Time Complexity Costas Busch - LSU.
Busch Complexity Lectures: Reductions
Reductions Costas Busch - LSU.
More NP-complete Problems
Theory of Computability
Non-Deterministic Finite Automata
Decidable Languages Costas Busch - LSU.
Space Complexity Costas Busch - LSU.
Theory of Computability
Undecidable problems:
CS154, Lecture 13: P vs NP.
Our First NP-Complete Problem
Presentation transcript:

NP-complete Languages Costas Busch - LSU

Polynomial Time Reductions Polynomial Computable function : There is a deterministic Turing machine such that for any string computes in polynomial time: Costas Busch - LSU

the length of is bounded Observation: the length of is bounded since, cannot use more than tape space in time Costas Busch - LSU

is polynomial time reducible to language Definition: Language is polynomial time reducible to language if there is a polynomial computable function such that: Costas Busch - LSU

Suppose that is polynomial reducible to . If then . Theorem: Suppose that is polynomial reducible to . If then . Proof: Let be the machine that decides in polynomial time Machine to decide in polynomial time: On input string : 1. Compute 2. Run on input 3. If acccept Costas Busch - LSU

Example of a polynomial-time reduction: We will reduce the 3CNF-satisfiability problem to the CLIQUE problem Costas Busch - LSU

Each clause has three literals 3CNF formula: variable or its complement literal clause Each clause has three literals Language: 3CNF-SAT ={ : is a satisfiable 3CNF formula} Costas Busch - LSU

A 5-clique in graph Language: CLIQUE = { : graph contains a -clique} Costas Busch - LSU

3CNF-SAT is polynomial time reducible to CLIQUE Theorem: 3CNF-SAT is polynomial time reducible to CLIQUE Proof: give a polynomial time reduction of one problem to the other Transform formula to graph Costas Busch - LSU

Transform formula to graph. Example: Clause 2 Create Nodes: Clause 3 Clause 1 Clause 4 Costas Busch - LSU

Add link from a literal to a literal in every other clause, except the complement Costas Busch - LSU

Resulting Graph Costas Busch - LSU

End of Proof The formula is satisfied if and only if the Graph has a 4-clique End of Proof Costas Busch - LSU

NP-complete Languages We define the class of NP-complete languages Decidable NP NP-complete Costas Busch - LSU

A language is NP-complete if: is in NP, and Every language in NP is reduced to in polynomial time Costas Busch - LSU

If a NP-complete language is proven to be in P then: Observation: If a NP-complete language is proven to be in P then: Costas Busch - LSU

Decidable NP P NP-complete ? Costas Busch - LSU

An NP-complete Language Cook-Levin Theorem: Language SAT (satisfiability problem) is NP-complete Proof: Part1: SAT is in NP (we have proven this in previous class) Part2: reduce all NP languages to the SAT problem in polynomial time Costas Busch - LSU

Take an arbitrary language We will give a polynomial reduction of to SAT Let be the NonDeterministic Turing Machine that decides in polyn. time For any string we will construct in polynomial time a Boolean expression such that: Costas Busch - LSU

All computations of on string depth … … … … (deepest leaf) accept reject accept (deepest leaf) reject Costas Busch - LSU

Consider an accepting computation depth … … … … (deepest leaf) accept reject accept (deepest leaf) reject Costas Busch - LSU

Computation path Sequence of Configurations initial state … accept state accept Costas Busch - LSU

Maximum working space area on tape during time steps Machine Tape Maximum working space area on tape during time steps Costas Busch - LSU

Tableau of Configurations …… Accept configuration indentical rows Costas Busch - LSU

Finite size (constant) Tableau Alphabet Finite size (constant) Costas Busch - LSU

For every cell position and for every symbol in tableau alphabet Define variable Such that if cell contains symbol Then Else Costas Busch - LSU

Examples: Costas Busch - LSU

is built from variables When the formula is satisfied, it describes an accepting computation in the tableau of machine on input Costas Busch - LSU

cell in the tableau contains exactly one symbol makes sure that every cell in the tableau contains exactly one symbol Every cell contains at least one symbol Every cell contains at most one symbol Costas Busch - LSU

Size of : Costas Busch - LSU

makes sure that the tableau starts with the initial configuration Describes the initial configuration in row 1 of tableau Costas Busch - LSU

Size of : Costas Busch - LSU

makes sure that the computation leads to acceptance Accepting states An accept state should appear somewhere in the tableau Costas Busch - LSU

Size of : Costas Busch - LSU

makes sure that the tableau gives a valid sequence of configurations is expressed in terms of legal windows Costas Busch - LSU

Tableau Window 2x6 area of cells Costas Busch - LSU

Possible Legal windows Legal windows obey the transitions Costas Busch - LSU

Possible illegal windows Costas Busch - LSU

all possible legal windows in position window (i,j) is legal: ((is legal) (is legal) (is legal)) all possible legal windows in position Costas Busch - LSU

(is legal) Formula: Costas Busch - LSU

Size of formula for a legal window in a cell i,j: Number of possible legal windows in a cell i,j: at most Number of possible cells: Costas Busch - LSU

it can also be constructed in time Size of : it can also be constructed in time polynomial in Costas Busch - LSU

we have that: Costas Busch - LSU

is polynomial-time reducible to SAT Since, and is constructed in polynomial time is polynomial-time reducible to SAT END OF PROOF Costas Busch - LSU

The formula can be converted to CNF (conjunctive normal form) formula Observation 1: The formula can be converted to CNF (conjunctive normal form) formula in polynomial time Already CNF NOT CNF But can be converted to CNF using distributive laws Costas Busch - LSU

Distributive Laws: Costas Busch - LSU

be converted to a 3CNF formula in polynomial time Observation 2: The formula can also be converted to a 3CNF formula in polynomial time convert Costas Busch - LSU

From Observations 1 and 2: CNF-SAT and 3CNF-SAT are NP-complete languages (they are known NP languages) Costas Busch - LSU

If: a. Language is NP-complete b. Language is in NP Theorem: If: a. Language is NP-complete b. Language is in NP c. is polynomial time reducible to Then: is NP-complete Proof: Any language in NP is polynomial time reducible to . Thus, is polynomial time reducible to (sum of two polynomial reductions, gives a polynomial reduction) Costas Busch - LSU

a. 3CNF-SAT is NP-complete Corollary: CLIQUE is NP-complete Proof: a. 3CNF-SAT is NP-complete b. CLIQUE is in NP (shown in last class) c. 3CNF-SAT is polynomial reducible to CLIQUE (shown earlier) Apply previous theorem with A=3CNF-SAT and B=CLIQUE Costas Busch - LSU