Time to learn about NP-completeness!

Similar documents
Time to learn about NP-completeness!

TIME COMPLEXITY AND POLYNOMIAL TIME; NON DETERMINISTIC TURING MACHINES AND NP. THURSDAY Mar 20

Lecture 17: Cook-Levin Theorem, NP-Complete Problems

CS154, Lecture 15: Cook-Levin Theorem SAT, 3SAT

Computability Theory

6.045: Automata, Computability, and Complexity (GITCS) Class 15 Nancy Lynch

Theory of Computation Time Complexity

SOLUTION: SOLUTION: SOLUTION:

NP-Completeness. A language B is NP-complete iff B NP. This property means B is NP hard

CSC 373: Algorithm Design and Analysis Lecture 18

an efficient procedure for the decision problem. We illustrate this phenomenon for the Satisfiability problem.

15.1 Proof of the Cook-Levin Theorem: SAT is NP-complete

Lecture 24: Randomized Complexity, Course Summary

CS 6505, Complexity and Algorithms Week 7: NP Completeness

Complexity (Pre Lecture)

CS311 Computational Structures. NP-completeness. Lecture 18. Andrew P. Black Andrew Tolmach. Thursday, 2 December 2010

The Cook-Levin Theorem

Cook-Levin Theorem. SAT is NP-complete

BBM402-Lecture 11: The Class NP

Chapter 3: The Church-Turing Thesis

CSCI3390-Lecture 16: NP-completeness

Chapter 7: Time Complexity

Lecture 25: Cook s Theorem (1997) Steven Skiena. skiena

CS256 Applied Theory of Computation

Notes for Lecture 3... x 4

Week 3: Reductions and Completeness

CS151 Complexity Theory. Lecture 1 April 3, 2017

CS 151 Complexity Theory Spring Solution Set 5

Lecture 22: PSPACE

Polynomial time reduction and NP-completeness. Exploring some time complexity limits of polynomial time algorithmic solutions

1 Computational Problems

Space Complexity. Huan Long. Shanghai Jiao Tong University

Computer Sciences Department

Announcements. Friday Four Square! Problem Set 8 due right now. Problem Set 9 out, due next Friday at 2:15PM. Did you lose a phone in my office?

Computability Theory

POLYNOMIAL SPACE QSAT. Games. Polynomial space cont d

Notes for Lecture Notes 2

The Class NP. NP is the problems that can be solved in polynomial time by a nondeterministic machine.

CS 301. Lecture 17 Church Turing thesis. Stephen Checkoway. March 19, 2018

Advanced topic: Space complexity

NP, polynomial-time mapping reductions, and NP-completeness

Complexity Theory VU , SS The Polynomial Hierarchy. Reinhard Pichler

Outline. Complexity Theory EXACT TSP. The Class DP. Definition. Problem EXACT TSP. Complexity of EXACT TSP. Proposition VU 181.

Complexity. Complexity Theory Lecture 3. Decidability and Complexity. Complexity Classes

Turing Machines A Turing Machine is a 7-tuple, (Q, Σ, Γ, δ, q0, qaccept, qreject), where Q, Σ, Γ are all finite

PSPACE COMPLETENESS TBQF. THURSDAY April 17

CSE 135: Introduction to Theory of Computation NP-completeness

COMPLEXITY THEORY. PSPACE = SPACE(n k ) k N. NPSPACE = NSPACE(n k ) 10/30/2012. Space Complexity: Savitch's Theorem and PSPACE- Completeness

1 Circuit Complexity. CS 6743 Lecture 15 1 Fall Definitions

CSCI3390-Lecture 14: The class NP

Non-Approximability Results (2 nd part) 1/19

CS 154 Introduction to Automata and Complexity Theory

Lecture 4 : Quest for Structure in Counting Problems

Applied Computer Science II Chapter 7: Time Complexity. Prof. Dr. Luc De Raedt. Institut für Informatik Albert-Ludwigs Universität Freiburg Germany

Theory of Computation

On the Computational Hardness of Graph Coloring

Boolean circuits. Lecture Definitions

Lecture 23: More PSPACE-Complete, Randomized Complexity

Umans Complexity Theory Lectures

Time Complexity. CS60001: Foundations of Computing Science

HW8. Due: November 1, 2018

CS294: Pseudorandomness and Combinatorial Constructions September 13, Notes for Lecture 5

Theory of Computation

Intro to Theory of Computation

Theory of Computation

CS154, Lecture 13: P vs NP

6.840 Language Membership

6.045: Automata, Computability, and Complexity Or, Great Ideas in Theoretical Computer Science Spring, Class 8 Nancy Lynch

P = k T IME(n k ) Now, do all decidable languages belong to P? Let s consider a couple of languages:

Logarithmic space. Evgenij Thorstensen V18. Evgenij Thorstensen Logarithmic space V18 1 / 18

Theory of Computation. Ch.8 Space Complexity. wherein all branches of its computation halt on all

Theory of Computation CS3102 Spring 2014 A tale of computers, math, problem solving, life, love and tragic death

Lecture 7: Polynomial time hierarchy

Automata Theory CS S-18 Complexity Theory II: Class NP

Computability and Complexity

CS154, Lecture 13: P vs NP

Complexity: moving from qualitative to quantitative considerations

Lecture 6: Oracle TMs, Diagonalization Limits, Space Complexity

CSE 105 THEORY OF COMPUTATION

Lecture 19: Finish NP-Completeness, conp and Friends

CSC373: Algorithm Design, Analysis and Complexity Fall 2017

Space Complexity. The space complexity of a program is how much memory it uses.

CSCI3390-Second Test with Solutions

Griffith University 3130CIT Theory of Computation (Based on slides by Harald Søndergaard of The University of Melbourne) Turing Machines 9-0

MTAT Complexity Theory October 13th-14th, Lecture 6

CSE 105 THEORY OF COMPUTATION

Week 2: Defining Computation

6.045J/18.400J: Automata, Computability and Complexity. Quiz 2. March 30, Please write your name in the upper corner of each page.

Computational Complexity

Friday Four Square! Today at 4:15PM, Outside Gates

Lecture 7: The Polynomial-Time Hierarchy. 1 Nondeterministic Space is Closed under Complement

Algorithmic Model Theory SS 2016

Turing Machines and Time Complexity

3 Probabilistic Turing Machines

Computability Theory

Complexity Classes V. More PCPs. Eric Rachlin

Lecture 20: conp and Friends, Oracles in Complexity Theory

Quiz 3. Please write your name in the upper corner of each page. Problem Points Grade. Total 100 Q3-1

COL 352 Introduction to Automata and Theory of Computation Major Exam, Sem II , Max 80, Time 2 hr. Name Entry No. Group

Transcription:

Time to learn about NP-completeness! Harvey Mudd College March 19, 2007

Languages A language is a set of strings Examples The language of strings of all a s with odd length The language of strings with the same number of a s and b s

Languages A language is a set of strings Examples The language of strings of all a s with odd length The language of strings with the same number of a s and b s If we can figure out whether to accept or reject any particular string as part of a language, we say that that language is decidable.

Turing Machines One convenient computation model: The Turing Machine Tape containing symbols from an alphabet States Transition rules Example: a Turing Machine that decides the language of strings of a s with odd length. # a a a a a #...

Non-Deterministic Turing Machines Instead of a having just one transition rule per state per symbol read on the tape, it may have many Allows branching (like running many machines in parallel) If any branch reaches the accepting state, then the machine accepts the string

Time Complexity Big-Oh notation Counting your toes takes O(number of toes) time. Adding two n bit numbers takes O(n) time. Multiplying two n n matrices takes O(n 3 ) time. Language is polynomial time decidable if any string is either accepted or rejected in time proportional to some polynomial in the size of the string

Polynomial Time Reducibility Language A is reducible to language B if there is some mapping from strings to strings such the first string is in language A iff the mapping of that string is in language B. Silly Example: the language of strings of odd length can be reduced to the language of strings of even length Complicated Example: From the last talk, 3-SAT can be reduced to Graph 3-Colorability

Polynomial Time Reducibility Language A is reducible to language B if there is some mapping from strings to strings such the first string is in language A iff the mapping of that string is in language B. Silly Example: the language of strings of odd length can be reduced to the language of strings of even length Complicated Example: From the last talk, 3-SAT can be reduced to Graph 3-Colorability If you can perform this reduction in polynomial time, A is polynomial time reducible to B.

P vs N P P is the class of languages which can be decided in polynomial time by a deterministic Turing Machine N P is the class of languages which can be decided in polynomial time by a non-deterministic Turing Machine Equivalently, N P is the class of languages which can be verified in polynomial time P N P

P vs N P P is the class of languages which can be decided in polynomial time by a deterministic Turing Machine N P is the class of languages which can be decided in polynomial time by a non-deterministic Turing Machine Equivalently, N P is the class of languages which can be verified in polynomial time P N P P = N P? Worth $1,000,000

Two requirements for a language to be N P-complete The language must be in N P Any other language in N P is polynomial time reducible to that language

Two requirements for a language to be N P-complete The language must be in N P Any other language in N P is polynomial time reducible to that language Implications of N P-completeness Polynomial time algorithm for any N P-complete language yields a polynomial time algorithm for all languages in N P and means that P = N P.

SAT Review Variables may either be true or false. Variables may be NOTed (with ), ORed (with ), or ANDed (with ). Example formula: (a b c d) ( a c d) SAT is the language which is a collection of formulas such that there is some assignment of variables that makes the formula true.

- SAT is N P-complete SAT N P: easy to verify given a correct assignment of variables Need to show that any language B in NP can be reduced in polynomial time to SAT Language B can be decided by a non-deterministic Turing Machine in n k time for some constant k. We can build a huge formula to simulate a Turing Machine running on a string to decide whether it s in language B.

Tableau # q start w 1 w 2... w l... # starting config. # # second config. # # n k th config. Essentially a similates of the tape and state of the Turing Machine at different steps Doesn t need to be more than n k wide

Formula Overview Variables for each possible symbol in cell of tableau: x i,j,c i and j correspond to the row and column of the tableau c [(alphabet of TM) (states of TM) #] correspond to different things which may be in cells Variable is true if there that particular cell contains that particular symbol Will make one massive SAT formula φ corresponding to tableau for an instance φ = φ cell φ start φ accept φ transition

Cell Subformula φ cell = 1 i,j n k ( ) x i,j,s s C s,t C(s t) (x i,j,s x i,j,t ) In English: Every cell in the tableau must have exactly one symbol.

Start and Accept Subformulas Start subformula x 1,1,# x 1,2,qstart x 1,3,w0 x 1,l,wl x 1,l+1, x 1,nk 1, x 1,nk,# In English: The first row in the tableau must correspond to the input. Accept subformula 1 i,j n k x i,j,qaccept In English: Somewhere in our tableau, we have record of being in an accepting state.

Transition Subformula Ensures that our transitions from one row to another are legal Since TM can only move one cell at a time, enough to look at all 2 3 windows.

Transition Subformula (cont.) Legal Windows # q even a # a q odd # a q even # a a φ transition = Illegal Windows # q even a # a q even # q even a a a q odd 1<i n k,1<j<n k (the window centered at i, j is ok) In English: Make sure that all of the windows in our tableau jive with our transition states.

Reduction takes Polynomial Time φ = φ cell φ start φ accept φ transition Size of formula φ start is size O(n k ) φ cell, φ cell, and φ accept are all of size O(n k n k ) Formation of formula The formation of the formula is very repetitive

Proof Review SAT is in N P Any language in N P is polynomial time reducible to SAT Languages in N P are decidable by a non-deterministic Turing Machine in polynomial time Can reduce this machine s running into a formula Formula φ = φ start φ cell φ transition φ accept is satisfiable iff Turing Machine can run to acceptance Reduction in polynomial time

Proof Review SAT is in N P Any language in N P is polynomial time reducible to SAT Languages in N P are decidable by a non-deterministic Turing Machine in polynomial time Can reduce this machine s running into a formula Formula φ = φ start φ cell φ transition φ accept is satisfiable iff Turing Machine can run to acceptance Reduction in polynomial time So, SAT is N P-complete!

3-SAT N P-Complete Now that we know SAT is N P-complete, to show that another is N P-complete, we only have to show that it s in N P and that we can reduce SAT to it in polynomial time 3-SAT is N P-Complete 3-SAT is verifiable in polynomial time For every clause (a 1 a 2 a l ) in SAT, make the clauses (a 1 a 2 z 1 ) ( z 1 a 3 z 2 ) ( z l 3 a l 1 a l ) in 3-SAT

Presentation based on the proof from Prof. Pippenger s Complexity Theory class and in Michael Sipser s Introduction to the Theory of Compuation 2nd ed. 2006.