CSCI 1010 Models of Computa3on. Lecture 11 Proving Languages NP-Complete

Size: px
Start display at page:

Download "CSCI 1010 Models of Computa3on. Lecture 11 Proving Languages NP-Complete"

Transcription

1 CSCI 1010 Models of Computa3on Lecture 11 Proving Languages NP-Complete

2 Overview P-3me reduc3ons Composi3on of P-3me reduc3ons Reduc3on from CIRCUIT SAT to SAT SAT is NP-complete. 3-SAT is NP-complete. NAESAT is NP-complete. Reduc3on from 3-SAT to INDEPENDENT SET Reduc3on from NAESAT to 3-COLORING John E. Savage CSCI 1010 Lect 11 2

3 Polynomial-Time Reduc3on Defini6on: A polynomial-6me reduc6on (P- 6me) from language L 1 Γ * to language L 2 Σ * is a reduc6on f : Γ * Σ * (x ε L 1 iff f(x) ε L 2 ) computable by a DTM in 3me polynomial in the length of its input. (f P-6me translates L 1 to L 2 ) w PPP f w R Recognizer R for L 2. The Recognizer for L 1 invokes the recognizer R for L 2. John E. Savage CSCI 1010 Lect 11 3

4 NP-Complete Language L Γ * is NP-complete if L ϵ NP and L is NP-hard. L is NP-hard if for every L 0 Γ * in NP, we can decide membership in L 0 by invoking a P-3me reduc3on f 0 from L 0 to L. If L is NP-complete and L in P, then P = NP. w PPP f 0 w R Recognizer R for L Recognizer for L 0 in NP invokes recognizer R for L. John E. Savage CSCI 1010 Lect 11 4

5 Cook and Karp Reduc3ons A Karp reduc3on makes one invoca3on of a P-3me reduc3on from one language to another. Such reduc3ons are called transla6ons. A Cook reduc3on uses a P-3me oracle Turing machine to decide membership in a language. An oracle TM runs, writes a string on the oracle tape, and enters the oracle state. The oracle writes an answer on the oracle tape in one step and the TM resumes. This can be repeated mul3ple 3mes. John E. Savage CSCI 1010 Lect 11 5

6 Cook Versus Karp Reduc3ons The Cook reduc3on may be more general than the Karp reduc3on although every reduc3on so far is Karp reduc3on. John E. Savage CSCI 1010 Lect 11 6

7 Composi3on of P-Time Transla3ons Defini6on: Let f 1 : Γ * Σ * and f 2 : Γ * Σ * be transla3ons. The composi6on of f 2 with f 1 computes f 2 ( f 1 (x)). Theorem The composi3on of two P-3me transla3ons is a P-3me transla3on. Proof On input x, DTM compu3ng f 1 generates output f 1 (x) whose length, f 1 (x),is polynomial in x. This is the input to f 2 so its running 3me is polynomial in f 1 (x) which is polynomial in x, the input to the composi3on. John E. Savage CSCI 1010 Lect 11 7

8 Proving New Languages NP-Complete Theorem Let L a be NP-complete. Let g be a P- 3me transla3on of L a to L b and let L b be in NP. Then, L b is NP-complete. Proof Because L a is NP-complete, for each L 0 in NP there exists an f 0 transla3ng L 0 to L a in P-3me. The composi3on of g with f 0 is a P-3me transla3on. Thus, for each L 0 in NP there exists a P-3me f(x) = g(f 0 (x)) transla3ng L 0 to L b. (L b is NPhard.) Since L b is also in NP, it is NP-complete. John E. Savage CSCI 1010 Lect 11 8

9 Circuit Sa3sfiability A circuit is sa6sfiable if its nondeterminis3c inputs can be chosen so that the output is 1. CIRCUIT SAT is the set of sa3sfiable circuits. CIRCUIT SAT has been shown NP-complete. We reduce it in P-3me to other problems to show that they are also NP-hard. John E. Savage CSCI 1010 Lect 11 9

10 Sa6sfiability (SAT) Instance: A set of literals X = {x 1, x 1,..., x n, x n } and clauses C = (c 1,...,c n ), each c i is a subset of X. Yes Instance: There exists an assignment to variables over {0,1} such that each clause has a literal with value 1. No Instance: There is no assignment to variables over {0,1} such that each clause has a literal with value 1. We show that SAT is NP-complete. John E. Savage CSCI 1010 Lect 11 10

11 Transla3ng CIRCUIT SAT to SAT Consider circuit in SLP form: (1 READ x) g 1 := x; (2 READ y) g 2 := y; (3 NOT 1) g 3 := NOT(g 1 ); (4 NOT 2) g 4 := NOT(g 2 ); (5 AND 1 4) g 5 := g 1 AND g 4 ; (6 AND 3 2) g 6 := g 3 AND g 2 ; (7 OR 5 6) g 7 := g 5 OR g 6 ; (g 7 is the output) John E. Savage CSCI 1010 Lect 11 11

12 Transla3ng CIRCUIT SAT to SAT These clauses simulate gates. denotes NOT. That is, the clauses are all sa6sfied only when the func6on on the lek is computed. John E. Savage CSCI 1010 Lect 11 12

13 Transla3ng CIRCUIT SAT to SAT Tables showing why these mappings work. Both clauses sa3sfied when g = x. (g = h ᴠ k) All three clauses sa3sfied when g = h k Note that not all literals in the third clause are True when all clauses sa3sfied. John E. Savage CSCI 1010 Lect 11 13

14 Transla3ng CIRCUIT SAT to SAT g 1 := x; g 2 := y; (g 1 x) (g 1 x) (g 2 y) (g 2 y) g 3 := NOT(g 1 ); (g 3 g 1 ) (g 3 g 1 ) g 4 := NOT(g 2 ); (g 4 g 2 ) (g 4 g 2 ) g 5 := g 1 AND g 4 ; (g 5 g 1 ) (g 5 g 4 ) (g 5 g 1 g 4 ) g 6 := g 3 AND g 2 ; (g 6 g 3 ) (g 6 g 2 ) (g 6 g 3 g 2 ) g 7 := g 5 OR g 6 ; (g 7 g 5 ) (g 7 g 6 ) (g 7 g 5 g 6 ) (g 7 is the output) (g 7 ) John E. Savage CSCI 1010 Lect _ Form AND of all the clauses

15 SAT is NP-complete Theorem SAT is NP-complete. Proof The above reduc3on from CIRCUIT SAT to SAT maps an instance of CIRCUIT SAT to a instance of SAT. The former is sa3sfied if and only if the laper is sa3sfied. Why? The reduc3on takes 3me polynomial in the length of the input. Thus, SAT is NP-hard. Why is SAT is in NP? It follows that SAT is NP-complete. John E. Savage CSCI 1010 Lect 11 15

16 3-SAT Instance: Set of literals X = {x 1,x 1,..., x n, x n } & clauses C = (c 1,...,c n ), each c i is a subset of X, c i 3. Yes Instance: There exists an assignment to variables over {0,1} such that each clause has a literal with value 1. No Instance: There is no assignment to variables over {0,1} such that each clause has a literal with value 1. The same proof shows that 3-SAT is NP-complete because each clause has at most three literals. John E. Savage CSCI 1010 Lect 11 16

17 Not All Equal SAT (NAESAT) NAESAT Instance: An instance of 3-SAT Yes Instance: Each clause is sa3sfied with not all literals being equal (one has value 1, another has value 0). No Instance: Cannot sa3sfy each clause with not all literals being equal. John E. Savage CSCI 1010 Lect 11 17

18 On Reduc3ons To show that NAESAT is NP-complete, we make the following observa3on: Let f be a transla3on of problem A to problem B, that is, that it maps a Yes instance of A to one of B and a No instance of A to one of B. Instead of showing that f translates a No instance of A to a No instance of B, it suffices to show that the pre-image of f from a Yes instance of B is a Yes instance of A. Then, a No instance of A does not map to a Yes of B. See the following. John E. Savage CSCI 1010 Lect 11 18

19 Proving Reduc3ons A B Yes A f : A B Yes B No A No B If we show that every element mapping to Yes B is in Yes A, then every element in No A must map to an instance in No B We use this idea to show several problems NP-complete. John E. Savage CSCI 1010 Lect 11 19

20 NAESAT is NP-Complete Theorem NAESAT is NP-complete. Proof The 3-literal clauses in the reduc3on to 3- SAT have the requisite property (check this). Add a new literal y to the other clauses. We claim that this reduc3on is sa3sfied with not all equal literals iff CIRCUIT SAT is sa3sfied. a) If CIRCUIT SAT is sa3sfied, at least one literal is 1 in each clause. Set y = 0! John E. Savage CSCI 1010 Lect 11 20

21 NAESAT is NP-Complete Proof (cont.) b) If the instance of NAESAT produced by the reduc3on is a Yes instance, then each clause is sa3sfied with the NAE property. Thus, if we complement all variables, the same property holds. In one of these cases y =0. Choose this case. Then, the values of variables is such as to cause the original instance of CIRCUIT SAT to be sa3sfied. Thus, the instance CIRCUIT SAT is sa3sfied iff the instance of NAESAT is sa3sfied. John E. Savage CSCI 1010 Lect 11 21

22 Independent Set (IS) Instance: A graph G = (V,E) and integer k. Yes Instance: (G,k) such that there is a set of k ver3ces with no edges between them. Let G be the following graph. Is (G,3) in Independent Set (IS)? If so, why? Is (G,4) in IS? John E. Savage CSCI 1010 Lect 11 22

23 Independent Set in NP-Complete Theorem Independent Set is NP-complete. Proof We reduce 3-SAT to Independent Set. Modify 3-SAT so that each clause contains three literals and no clause iden3cally true. E.g. if (a+b) exists, add (a+b+z) and (a+b+z), z is new. (a+b) is sa3sfied iff (a+b+z) (a+b+z) is sa3sfied. If a clause contains one variable, create four clauses with all four combina3ons of literals in new variables u and v. This is a P-3me reduc3on. John E. Savage CSCI 1010 Lect 11 23

24 Independent Set in NP-Complete Proof (cont.) Given an instance of 3-SAT, construct graph G by crea3ng a triangle for each clause. The ver3ces of a triangle are labeled by the literals in a corresponding clause. Add edge between ver3ces in different clauses if one is the NOT of another. Let k = number of clauses. (G,k) an instance of IS. This reduc3on is P-3me. John E. Savage CSCI 1010 Lect 11 24

25 Example of Reduc3on Example: (x 1 +x 2 +x 3 )(x 1 +x 2 +x 3 )(x 1 +x 2 +x 3 ) maps to (G,3) below. It is sa3sfied by x 1 =x 2 =x 3 =1. John E. Savage CSCI 1010 Lect 11 25

26 Independent Set in NP-Complete Given a Yes instance of 3-SAT, we show that (G,k) is a Yes instance of IS. Pick one True literal per clause. No edges exist between corresponding ver3ces in (G,k) so they form a Yes instance of IS. John E. Savage CSCI 1010 Lect 11 26

27 Independent Set in NP-Complete Given a Yes instance (G,k) of IS, we construct a Yes instance of 3-SAT. IS of (G,k) must have one vertex from each triangle. Since labels are not complements, assign value 1 to corresponding literals to obtain a Yes instance of 3- SAT. John E. Savage CSCI 1010 Lect 11 27

28 3-COLORING Instance: A graph G = (V,E). Yes Instance: G such that three colors can be assigned to ver3ces so that adjacent ver3ces have different colors. Theorem 3-COLORING is NP-complete. Proof By reduc3on from NAESAT. Consider an instance of NAESAT that has three literals in each clause. John E. Savage CSCI 1010 Lect 11 28

29 3-COLORING Construct a graph G from clauses as follows: Create a variable triangle (ν, x j, x j ) for each j. Create a triangle for each clause. If the r th clause has literals λ 1, λ 2, λ 3 let (r, λ 1 ), (r, λ 1 ), (r, λ 1 ) be labels for the three ver3ces in the rth triangle. Insert edge between (r, λ i ) in a clause triangle and λ i in a variable triangle. John E. Savage CSCI 1010 Lect 11 29

30 3-COLORING John E. Savage CSCI 1010 Lect 11 30

31 3-COLORING Given a Yes instance of 3-COLORING, we show it corresponds to a Yes instance of NAESAT. Let colors be {0,1,2}. Let the root ν have color 2. Assign colors in {0,1} to (r, λ i ) and λ i. To the third vertex in clause triangle, assign color 2 If (r, λ i ) has color c in {0,1}, assign value c to λ i. This means that in each clause not all literals have the same value and we have Yes instance of NAESAT. John E. Savage CSCI 1010 Lect 11 31

32 3-COLORING Given a Yes instance of NAESAT, we show it corresponds to a Yes instance of 3-COLORING. Let ν have color 2 and x j and x j have values that sa3sfy the clauses in the Yes instance. ~ Consider two unequal literals in a clause. If (r, x j ) is one of these, give it a complementary color in ~ {0,1} to x j in the variable triangle. Give the third vertex in clause triangle color 2. This is a 3- COLORING. John E. Savage CSCI 1010 Lect 11 32

33 Review P-3me reduc3ons Composi3on of P-3me reduc3ons Reduc3on from CIRCUIT SAT to SAT SAT is NP-complete. 3-SAT is NP-complete. NAESAT is NP-complete. Reduc3on from 3-SAT to INDEPENDENT SET Reduc3on from NAESAT to 3-COLORING John E. Savage CSCI 1010 Lect 11 33

CSCI 1590 Intro to Computational Complexity

CSCI 1590 Intro to Computational Complexity CSCI 1590 Intro to Computational Complexity NP-Complete Languages John E. Savage Brown University February 2, 2009 John E. Savage (Brown University) CSCI 1590 Intro to Computational Complexity February

More information

Algorithms, Lecture 3 on NP : Nondeterminis7c Polynomial Time

Algorithms, Lecture 3 on NP : Nondeterminis7c Polynomial Time Algorithms, Lecture 3 on NP : Nondeterminis7c Polynomial Time Last week: Defined Polynomial Time Reduc7ons: Problem X is poly 7me reducible to Y X P Y if can solve X using poly computa7on and a poly number

More information

CS256 Applied Theory of Computation

CS256 Applied Theory of Computation CS256 Applied Theory of Computation Compleity Classes III John E Savage Overview Last lecture on time-bounded compleity classes Today we eamine space-bounded compleity classes We prove Savitch s Theorem,

More information

CS21 Decidability and Tractability

CS21 Decidability and Tractability CS21 Decidability and Tractability Lecture 20 February 23, 2018 February 23, 2018 CS21 Lecture 20 1 Outline the complexity class NP NP-complete probelems: Subset Sum NP-complete problems: NAE-3-SAT, max

More information

Theory of Computation Chapter 9

Theory of Computation Chapter 9 0-0 Theory of Computation Chapter 9 Guan-Shieng Huang May 12, 2003 NP-completeness Problems NP: the class of languages decided by nondeterministic Turing machine in polynomial time NP-completeness: Cook

More information

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

CS154, Lecture 15: Cook-Levin Theorem SAT, 3SAT CS154, Lecture 15: Cook-Levin Theorem SAT, 3SAT 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

More information

Essential facts about NP-completeness:

Essential facts about NP-completeness: CMPSCI611: NP Completeness Lecture 17 Essential facts about NP-completeness: Any NP-complete problem can be solved by a simple, but exponentially slow algorithm. We don t have polynomial-time solutions

More information

Lecture 7: Polynomial time hierarchy

Lecture 7: Polynomial time hierarchy Computational Complexity Theory, Fall 2010 September 15 Lecture 7: Polynomial time hierarchy Lecturer: Kristoffer Arnsfelt Hansen Scribe: Mads Chr. Olesen Recall that adding the power of alternation gives

More information

NP Completeness. Richard Karp, 1972.

NP Completeness. Richard Karp, 1972. NP Completeness In this paper we give theorems that suggest, but do not imply, that these problems as well as many others, will remain intractable perpetually. Richard Karp, 1972. Reductions At the heart

More information

CSCI 1010 Models of Computa3on. Lecture 02 Func3ons and Circuits

CSCI 1010 Models of Computa3on. Lecture 02 Func3ons and Circuits CSCI 1010 Models of Computa3on Lecture 02 Func3ons and Circuits Overview Func3ons and languages Designing circuits from func3ons Minterms and the DNF Maxterms and CNF Circuit complexity Algebra of Boolean

More information

NP-Complete Problems. More reductions

NP-Complete Problems. More reductions NP-Complete Problems More reductions Definitions P: problems that can be solved in polynomial time (typically in n, size of input) on a deterministic Turing machine Any normal computer simulates a DTM

More information

Lecture 18: More NP-Complete Problems

Lecture 18: More NP-Complete Problems 6.045 Lecture 18: More NP-Complete Problems 1 The Clique Problem a d f c b e g Given a graph G and positive k, does G contain a complete subgraph on k nodes? CLIQUE = { (G,k) G is an undirected graph with

More information

CS 161: Design and Analysis of Algorithms

CS 161: Design and Analysis of Algorithms CS 161: Design and Analysis of Algorithms NP- Complete I P, NP Polynomial >me reduc>ons NP- Hard, NP- Complete Sat/ 3- Sat Decision Problem Suppose there is a func>on A that outputs True or False A decision

More information

Intro to Theory of Computation

Intro to Theory of Computation Intro to Theory of Computation LECTURE 25 Last time Class NP Today Polynomial-time reductions Adam Smith; Sofya Raskhodnikova 4/18/2016 L25.1 The classes P and NP P is the class of languages decidable

More information

NP-Complete Reductions 2

NP-Complete Reductions 2 x 1 x 1 x 2 x 2 x 3 x 3 x 4 x 4 12 22 32 CS 447 11 13 21 23 31 33 Algorithms NP-Complete Reductions 2 Prof. Gregory Provan Department of Computer Science University College Cork 1 Lecture Outline NP-Complete

More information

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

Polynomial time reduction and NP-completeness. Exploring some time complexity limits of polynomial time algorithmic solutions Polynomial time reduction and NP-completeness Exploring some time complexity limits of polynomial time algorithmic solutions 1 Polynomial time reduction Definition: A language L is said to be polynomial

More information

CS154, Lecture 13: P vs NP

CS154, Lecture 13: P vs NP CS154, Lecture 13: P vs NP The EXTENDED Church-Turing Thesis Everyone s Intuitive Notion of Efficient Algorithms Polynomial-Time Turing Machines More generally: TM can simulate every reasonable model of

More information

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

Lecture 25: Cook s Theorem (1997) Steven Skiena.   skiena Lecture 25: Cook s Theorem (1997) Steven Skiena Department of Computer Science State University of New York Stony Brook, NY 11794 4400 http://www.cs.sunysb.edu/ skiena Prove that Hamiltonian Path is NP

More information

SAT, NP, NP-Completeness

SAT, NP, NP-Completeness CS 473: Algorithms, Spring 2018 SAT, NP, NP-Completeness Lecture 22 April 13, 2018 Most slides are courtesy Prof. Chekuri Ruta (UIUC) CS473 1 Spring 2018 1 / 57 Part I Reductions Continued Ruta (UIUC)

More information

Lecture 4: NP and computational intractability

Lecture 4: NP and computational intractability Chapter 4 Lecture 4: NP and computational intractability Listen to: Find the longest path, Daniel Barret What do we do today: polynomial time reduction NP, co-np and NP complete problems some examples

More information

NP-Complete Reductions 1

NP-Complete Reductions 1 x x x 2 x 2 x 3 x 3 x 4 x 4 CS 4407 2 22 32 Algorithms 3 2 23 3 33 NP-Complete Reductions Prof. Gregory Provan Department of Computer Science University College Cork Lecture Outline x x x 2 x 2 x 3 x 3

More information

NP Completeness. CS 374: Algorithms & Models of Computation, Spring Lecture 23. November 19, 2015

NP Completeness. CS 374: Algorithms & Models of Computation, Spring Lecture 23. November 19, 2015 CS 374: Algorithms & Models of Computation, Spring 2015 NP Completeness Lecture 23 November 19, 2015 Chandra & Lenny (UIUC) CS374 1 Spring 2015 1 / 37 Part I NP-Completeness Chandra & Lenny (UIUC) CS374

More information

COMP 382. Unit 10: NP-Completeness

COMP 382. Unit 10: NP-Completeness COMP 382 Unit 10: NP-Completeness Time complexity 1 log n n n 2 n 3 2 n n n Space complexity 1 log n n n 2 n 3 2 n n n Complexity theory Focus on decidability (yes/no) problems What is P? Deterministic,

More information

CS154, Lecture 13: P vs NP

CS154, Lecture 13: P vs NP CS154, Lecture 13: P vs NP The EXTENDED Church-Turing Thesis Everyone s Intuitive Notion of Efficient Algorithms Polynomial-Time Turing Machines More generally: TM can simulate every reasonable model of

More information

P is the class of problems for which there are algorithms that solve the problem in time O(n k ) for some constant k.

P is the class of problems for which there are algorithms that solve the problem in time O(n k ) for some constant k. Complexity Theory Problems are divided into complexity classes. Informally: So far in this course, almost all algorithms had polynomial running time, i.e., on inputs of size n, worst-case running time

More information

Lecture 2. 1 More N P-Compete Languages. Notes on Complexity Theory: Fall 2005 Last updated: September, Jonathan Katz

Lecture 2. 1 More N P-Compete Languages. Notes on Complexity Theory: Fall 2005 Last updated: September, Jonathan Katz Notes on Complexity Theory: Fall 2005 Last updated: September, 2005 Jonathan Katz Lecture 2 1 More N P-Compete Languages It will be nice to find more natural N P-complete languages. To that end, we ine

More information

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

Theory of Computation CS3102 Spring 2014 A tale of computers, math, problem solving, life, love and tragic death Theory of Computation CS3102 Spring 2014 A tale of computers, math, problem solving, life, love and tragic death Nathan Brunelle Department of Computer Science University of Virginia www.cs.virginia.edu/~njb2b/theory

More information

UC Berkeley CS 170: Efficient Algorithms and Intractable Problems Handout 22 Lecturer: David Wagner April 24, Notes 22 for CS 170

UC Berkeley CS 170: Efficient Algorithms and Intractable Problems Handout 22 Lecturer: David Wagner April 24, Notes 22 for CS 170 UC Berkeley CS 170: Efficient Algorithms and Intractable Problems Handout 22 Lecturer: David Wagner April 24, 2003 Notes 22 for CS 170 1 NP-completeness of Circuit-SAT We will prove that the circuit satisfiability

More information

Lecture 20: conp and Friends, Oracles in Complexity Theory

Lecture 20: conp and Friends, Oracles in Complexity Theory 6.045 Lecture 20: conp and Friends, Oracles in Complexity Theory 1 Definition: conp = { L L NP } What does a conp computation look like? In NP algorithms, we can use a guess instruction in pseudocode:

More information

CS21 Decidability and Tractability

CS21 Decidability and Tractability CS21 Decidability and Tractability Lecture 18 February 16, 2018 February 16, 2018 CS21 Lecture 18 1 Outline the complexity class NP 3-SAT is NP-complete NP-complete problems: independent set, vertex cover,

More information

P P P NP-Hard: L is NP-hard if for all L NP, L L. Thus, if we could solve L in polynomial. Cook's Theorem and Reductions

P P P NP-Hard: L is NP-hard if for all L NP, L L. Thus, if we could solve L in polynomial. Cook's Theorem and Reductions Summary of the previous lecture Recall that we mentioned the following topics: P: is the set of decision problems (or languages) that are solvable in polynomial time. NP: is the set of decision problems

More information

Complexity Classes V. More PCPs. Eric Rachlin

Complexity Classes V. More PCPs. Eric Rachlin Complexity Classes V More PCPs Eric Rachlin 1 Recall from last time Nondeterminism is equivalent to having access to a certificate. If a valid certificate exists, the machine accepts. We see that problems

More information

CSCI 1590 Intro to Computational Complexity

CSCI 1590 Intro to Computational Complexity CSCI 1590 Intro to Computational Complexity PSPACE-Complete Languages John E. Savage Brown University February 11, 2009 John E. Savage (Brown University) CSCI 1590 Intro to Computational Complexity February

More information

Chapter 7: Time Complexity

Chapter 7: Time Complexity Chapter 7: Time Complexity 1 Time complexity Let M be a deterministic Turing machine that halts on all inputs. The running time or time complexity of M is the function f: N N, where f(n) is the maximum

More information

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

Non-Approximability Results (2 nd part) 1/19 Non-Approximability Results (2 nd part) 1/19 Summary - The PCP theorem - Application: Non-approximability of MAXIMUM 3-SAT 2/19 Non deterministic TM - A TM where it is possible to associate more than one

More information

CSC 373: Algorithm Design and Analysis Lecture 15

CSC 373: Algorithm Design and Analysis Lecture 15 CSC 373: Algorithm Design and Analysis Lecture 15 Allan Borodin February 13, 2013 Some materials are from Stephen Cook s IIT talk and Keven Wayne s slides. 1 / 21 Announcements and Outline Announcements

More information

6.080 / Great Ideas in Theoretical Computer Science Spring 2008

6.080 / Great Ideas in Theoretical Computer Science Spring 2008 MIT OpenCourseWare http://ocw.mit.edu 6.080 / 6.089 Great Ideas in Theoretical Computer Science Spring 2008 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.

More information

Complexity Classes IV

Complexity Classes IV Complexity Classes IV NP Optimization Problems and Probabilistically Checkable Proofs Eric Rachlin 1 Decision vs. Optimization Most complexity classes are defined in terms of Yes/No questions. In the case

More information

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

Lecture 17: Cook-Levin Theorem, NP-Complete Problems 6.045 Lecture 17: Cook-Levin Theorem, NP-Complete Problems 1 Is SAT solvable in O(n) time on a multitape TM? Logic circuits of 6n gates for SAT? If yes, then not only is P=NP, but there would be a dream

More information

Algorithm Design and Analysis

Algorithm Design and Analysis Algorithm Design and Analysis LECTURE 26 Computational Intractability Polynomial Time Reductions Sofya Raskhodnikova S. Raskhodnikova; based on slides by A. Smith and K. Wayne L26.1 What algorithms are

More information

NP-Complete Reductions 3

NP-Complete Reductions 3 x 1 x 1 x 2 x 2 x 3 x 3 x 4 x 4 12 22 32 CS 4407 1 13 21 23 31 33 Algorithms NP-Complete Reductions 3 Prof. Gregory Provan Department of Computer Science University College Cork 1 HARDEST PROBLEMS IN NP

More information

NP Complete Problems. COMP 215 Lecture 20

NP Complete Problems. COMP 215 Lecture 20 NP Complete Problems COMP 215 Lecture 20 Complexity Theory Complexity theory is a research area unto itself. The central project is classifying problems as either tractable or intractable. Tractable Worst

More information

NP-Complete problems

NP-Complete problems NP-Complete problems NP-complete problems (NPC): A subset of NP. If any NP-complete problem can be solved in polynomial time, then every problem in NP has a polynomial time solution. NP-complete languages

More information

NP and Computational Intractability

NP and Computational Intractability NP and Computational Intractability 1 Review Basic reduction strategies. Simple equivalence: INDEPENDENT-SET P VERTEX-COVER. Special case to general case: VERTEX-COVER P SET-COVER. Encoding with gadgets:

More information

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

COL 352 Introduction to Automata and Theory of Computation Major Exam, Sem II , Max 80, Time 2 hr. Name Entry No. Group COL 352 Introduction to Automata and Theory of Computation Major Exam, Sem II 2015-16, Max 80, Time 2 hr Name Entry No. Group Note (i) Write your answers neatly and precisely in the space provided with

More information

CS 6505, Complexity and Algorithms Week 7: NP Completeness

CS 6505, Complexity and Algorithms Week 7: NP Completeness CS 6505, Complexity and Algorithms Week 7: NP Completeness Reductions We have seen some problems in P and NP, and we ve talked about space complexity. The Space Hierarchy Theorem showed us that there are

More information

NP-Completeness. Algorithmique Fall semester 2011/12

NP-Completeness. Algorithmique Fall semester 2011/12 NP-Completeness Algorithmique Fall semester 2011/12 1 What is an Algorithm? We haven t really answered this question in this course. Informally, an algorithm is a step-by-step procedure for computing a

More information

Polynomial-Time Reductions

Polynomial-Time Reductions Reductions 1 Polynomial-Time Reductions Classify Problems According to Computational Requirements Q. Which problems will we be able to solve in practice? A working definition. [von Neumann 1953, Godel

More information

BBM402-Lecture 11: The Class NP

BBM402-Lecture 11: The Class NP BBM402-Lecture 11: The Class NP Lecturer: Lale Özkahya Resources for the presentation: http://ocw.mit.edu/courses/electrical-engineering-andcomputer-science/6-045j-automata-computability-andcomplexity-spring-2011/syllabus/

More information

1 Non-deterministic Turing Machine

1 Non-deterministic Turing Machine 1 Non-deterministic Turing Machine A nondeterministic Turing machine is a generalization of the standard TM for which every configuration may yield none, or one or more than one next configurations. In

More information

The Cook-Levin Theorem

The Cook-Levin Theorem An Exposition Sandip Sinha Anamay Chaturvedi Indian Institute of Science, Bangalore 14th November 14 Introduction Deciding a Language Let L {0, 1} be a language, and let M be a Turing machine. We say M

More information

NP-COMPLETE PROBLEMS. 1. Characterizing NP. Proof

NP-COMPLETE PROBLEMS. 1. Characterizing NP. Proof T-79.5103 / Autumn 2006 NP-complete problems 1 NP-COMPLETE PROBLEMS Characterizing NP Variants of satisfiability Graph-theoretic problems Coloring problems Sets and numbers Pseudopolynomial algorithms

More information

NP-Hardness reductions

NP-Hardness reductions NP-Hardness reductions Definition: P is the class of problems that can be solved in polynomial time, that is n c for a constant c Roughly, if a problem is in P then it's easy, and if it's not in P then

More information

CSCI 1590 Intro to Computational Complexity

CSCI 1590 Intro to Computational Complexity CSCI 1590 Intro to Computational Complexity Space Complexity John E. Savage Brown University February 11, 2008 John E. Savage (Brown University) CSCI 1590 Intro to Computational Complexity February 11,

More information

Umans Complexity Theory Lectures

Umans Complexity Theory Lectures Umans Complexity Theory Lectures Lecture 12: The Polynomial-Time Hierarchy Oracle Turing Machines Oracle Turing Machine (OTM): Deterministic multitape TM M with special query tape special states q?, q

More information

Lecture 2 (Notes) 1. The book Computational Complexity: A Modern Approach by Sanjeev Arora and Boaz Barak;

Lecture 2 (Notes) 1. The book Computational Complexity: A Modern Approach by Sanjeev Arora and Boaz Barak; Topics in Theoretical Computer Science February 29, 2016 Lecturer: Ola Svensson Lecture 2 (Notes) Scribes: Ola Svensson Disclaimer: These notes were written for the lecturer only and may contain inconsistent

More information

Theory of Computation Time Complexity

Theory of Computation Time Complexity Theory of Computation Time Complexity Bow-Yaw Wang Academia Sinica Spring 2012 Bow-Yaw Wang (Academia Sinica) Time Complexity Spring 2012 1 / 59 Time for Deciding a Language Let us consider A = {0 n 1

More information

CSCI3390-Lecture 16: NP-completeness

CSCI3390-Lecture 16: NP-completeness CSCI3390-Lecture 16: NP-completeness 1 Summary We recall the notion of polynomial-time reducibility. This is just like the reducibility we studied earlier, except that we require that the function mapping

More information

NP and NP Completeness

NP and NP Completeness CS 374: Algorithms & Models of Computation, Spring 2017 NP and NP Completeness Lecture 23 April 20, 2017 Chandra Chekuri (UIUC) CS374 1 Spring 2017 1 / 44 Part I NP Chandra Chekuri (UIUC) CS374 2 Spring

More information

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

6.045: Automata, Computability, and Complexity (GITCS) Class 15 Nancy Lynch 6.045: Automata, Computability, and Complexity (GITCS) Class 15 Nancy Lynch Today: More Complexity Theory Polynomial-time reducibility, NP-completeness, and the Satisfiability (SAT) problem Topics: Introduction

More information

Approximation Preserving Reductions

Approximation Preserving Reductions Approximation Preserving Reductions - Memo Summary - AP-reducibility - L-reduction technique - Complete problems - Examples: MAXIMUM CLIQUE, MAXIMUM INDEPENDENT SET, MAXIMUM 2-SAT, MAXIMUM NAE 3-SAT, MAXIMUM

More information

CSCI 1590 Intro to Computational Complexity

CSCI 1590 Intro to Computational Complexity CSCI 1590 Intro to Computational Complexity Complement Classes and the Polynomial Time Hierarchy John E. Savage Brown University February 9, 2009 John E. Savage (Brown University) CSCI 1590 Intro to Computational

More information

Complexity Theory. Knowledge Representation and Reasoning. November 2, 2005

Complexity Theory. Knowledge Representation and Reasoning. November 2, 2005 Complexity Theory Knowledge Representation and Reasoning November 2, 2005 (Knowledge Representation and Reasoning) Complexity Theory November 2, 2005 1 / 22 Outline Motivation Reminder: Basic Notions Algorithms

More information

Lecture 16: Time Complexity and P vs NP

Lecture 16: Time Complexity and P vs NP 6.045 Lecture 16: Time Complexity and P vs NP 1 Time-Bounded Complexity Classes Definition: TIME(t(n)) = { L there is a Turing machine M with time complexity O(t(n)) so that L = L(M) } = { L L is a language

More information

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

MTAT Complexity Theory October 13th-14th, Lecture 6 MTAT.07.004 Complexity Theory October 13th-14th, 2011 Lecturer: Peeter Laud Lecture 6 Scribe(s): Riivo Talviste 1 Logarithmic memory Turing machines working in logarithmic space become interesting when

More information

Algorithms and Theory of Computation. Lecture 22: NP-Completeness (2)

Algorithms and Theory of Computation. Lecture 22: NP-Completeness (2) Algorithms and Theory of Computation Lecture 22: NP-Completeness (2) Xiaohui Bei MAS 714 November 8, 2018 Nanyang Technological University MAS 714 November 8, 2018 1 / 20 Set Cover Set Cover Input: a set

More information

Chapter 2. Reductions and NP. 2.1 Reductions Continued The Satisfiability Problem (SAT) SAT 3SAT. CS 573: Algorithms, Fall 2013 August 29, 2013

Chapter 2. Reductions and NP. 2.1 Reductions Continued The Satisfiability Problem (SAT) SAT 3SAT. CS 573: Algorithms, Fall 2013 August 29, 2013 Chapter 2 Reductions and NP CS 573: Algorithms, Fall 2013 August 29, 2013 2.1 Reductions Continued 2.1.1 The Satisfiability Problem SAT 2.1.1.1 Propositional Formulas Definition 2.1.1. Consider a set of

More information

Lecture 19: Finish NP-Completeness, conp and Friends

Lecture 19: Finish NP-Completeness, conp and Friends 6.045 Lecture 19: Finish NP-Completeness, conp and Friends 1 Polynomial Time Reducibility f : Σ* Σ* is a polynomial time computable function if there is a poly-time Turing machine M that on every input

More information

More Completeness, conp, FNP,etc. CS254 Chris Pollett Oct 30, 2006.

More Completeness, conp, FNP,etc. CS254 Chris Pollett Oct 30, 2006. More Completeness, conp, FNP,etc. CS254 Chris Pollett Oct 30, 2006. Outline A last complete problem for NP conp, conp NP Function problems MAX-CUT A cut in a graph G=(V,E) is a set of nodes S used to partition

More information

CS Lecture 29 P, NP, and NP-Completeness. k ) for all k. Fall The class P. The class NP

CS Lecture 29 P, NP, and NP-Completeness. k ) for all k. Fall The class P. The class NP CS 301 - Lecture 29 P, NP, and NP-Completeness Fall 2008 Review Languages and Grammars Alphabets, strings, languages Regular Languages Deterministic Finite and Nondeterministic Automata Equivalence of

More information

SD & Turing Enumerable. Lecture 33: Reductions and Undecidability. Lexicographically Enumerable. SD & Turing Enumerable

SD & Turing Enumerable. Lecture 33: Reductions and Undecidability. Lexicographically Enumerable. SD & Turing Enumerable SD & Turing Lecture 33: Reductions and Undecidability CSCI 81 Spring, 2012 Kim Bruce Theorem: A language is SD iff it is Turing enumerable. Proof: Spose L is Turing enumerable. Show L is SD. Let w be input.

More information

NP and NP-Completeness

NP and NP-Completeness 0/2/206 Algorithms NP-Completeness 7- Algorithms NP-Completeness 7-2 Efficient Certification NP and NP-Completeness By a solution of a decision problem X we understand a certificate witnessing that an

More information

Lecture 6: Oracle TMs, Diagonalization Limits, Space Complexity

Lecture 6: Oracle TMs, Diagonalization Limits, Space Complexity CSE 531: Computational Complexity I Winter 2016 Lecture 6: Oracle TMs, Diagonalization Limits, Space Complexity January 22, 2016 Lecturer: Paul Beame Scribe: Paul Beame Diagonalization enabled us to separate

More information

NP-Completeness I. Lecture Overview Introduction: Reduction and Expressiveness

NP-Completeness I. Lecture Overview Introduction: Reduction and Expressiveness Lecture 19 NP-Completeness I 19.1 Overview In the past few lectures we have looked at increasingly more expressive problems that we were able to solve using efficient algorithms. In this lecture we introduce

More information

Comparison of several polynomial and exponential time complexity functions. Size n

Comparison of several polynomial and exponential time complexity functions. Size n Comparison of several polynomial and exponential time complexity functions Time complexity function n n 2 n 3 n 5 2 n 3 n Size n 10 20 30 40 50 60.00001.00002.00003.00004.00005.00006 second second second

More information

Introduction to Complexity Theory

Introduction to Complexity Theory Introduction to Complexity Theory Read K & S Chapter 6. Most computational problems you will face your life are solvable (decidable). We have yet to address whether a problem is easy or hard. Complexity

More information

Design and Analysis of Algorithms

Design and Analysis of Algorithms Design and Analysis of Algorithms CSE 5311 Lecture 25 NP Completeness Junzhou Huang, Ph.D. Department of Computer Science and Engineering CSE5311 Design and Analysis of Algorithms 1 NP-Completeness Some

More information

Complexity Theory VU , SS The Polynomial Hierarchy. Reinhard Pichler

Complexity Theory VU , SS The Polynomial Hierarchy. Reinhard Pichler Complexity Theory Complexity Theory VU 181.142, SS 2018 6. The Polynomial Hierarchy Reinhard Pichler Institut für Informationssysteme Arbeitsbereich DBAI Technische Universität Wien 15 May, 2018 Reinhard

More information

NP-Complete Problems

NP-Complete Problems NP-Complete Problems Max Bisection Is NP-Complete max cut becomes max bisection if we require that S = V S. We shall reduce the more general max cut to max bisection. Add V isolated nodes to G to yield

More information

Lecture 13, Fall 04/05

Lecture 13, Fall 04/05 Lecture 13, Fall 04/05 Short review of last class NP hardness conp and conp completeness Additional reductions and NP complete problems Decision, search, and optimization problems Coping with NP completeness

More information

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

Outline. Complexity Theory EXACT TSP. The Class DP. Definition. Problem EXACT TSP. Complexity of EXACT TSP. Proposition VU 181. Complexity Theory Complexity Theory Outline Complexity Theory VU 181.142, SS 2018 6. The Polynomial Hierarchy Reinhard Pichler Institut für Informationssysteme Arbeitsbereich DBAI Technische Universität

More information

CS 151 Complexity Theory Spring Solution Set 5

CS 151 Complexity Theory Spring Solution Set 5 CS 151 Complexity Theory Spring 2017 Solution Set 5 Posted: May 17 Chris Umans 1. We are given a Boolean circuit C on n variables x 1, x 2,..., x n with m, and gates. Our 3-CNF formula will have m auxiliary

More information

U.C. Berkeley CS278: Computational Complexity Professor Luca Trevisan August 30, Notes for Lecture 1

U.C. Berkeley CS278: Computational Complexity Professor Luca Trevisan August 30, Notes for Lecture 1 U.C. Berkeley CS278: Computational Complexity Handout N1 Professor Luca Trevisan August 30, 2004 Notes for Lecture 1 This course assumes CS170, or equivalent, as a prerequisite. We will assume that the

More information

max bisection max cut becomes max bisection if we require that It has many applications, especially in VLSI layout.

max bisection max cut becomes max bisection if we require that It has many applications, especially in VLSI layout. max bisection max cut becomes max bisection if we require that S = V S. It has many applications, especially in VLSI layout. c 2011 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 330 max bisection

More information

Complexity (Pre Lecture)

Complexity (Pre Lecture) Complexity (Pre Lecture) Dr. Neil T. Dantam CSCI-561, Colorado School of Mines Fall 2018 Dantam (Mines CSCI-561) Complexity (Pre Lecture) Fall 2018 1 / 70 Why? What can we always compute efficiently? What

More information

NP Completeness and Approximation Algorithms

NP Completeness and Approximation Algorithms Winter School on Optimization Techniques December 15-20, 2016 Organized by ACMU, ISI and IEEE CEDA NP Completeness and Approximation Algorithms Susmita Sur-Kolay Advanced Computing and Microelectronic

More information

Show that the following problems are NP-complete

Show that the following problems are NP-complete Show that the following problems are NP-complete April 7, 2018 Below is a list of 30 exercises in which you are asked to prove that some problem is NP-complete. The goal is to better understand the theory

More information

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

The Class NP. NP is the problems that can be solved in polynomial time by a nondeterministic machine. The Class NP NP is the problems that can be solved in polynomial time by a nondeterministic machine. NP The time taken by nondeterministic TM is the length of the longest branch. The collection of all

More information

NP and Computational Intractability

NP and Computational Intractability NP and Computational Intractability 1 Polynomial-Time Reduction Desiderata'. Suppose we could solve X in polynomial-time. What else could we solve in polynomial time? don't confuse with reduces from Reduction.

More information

COP 4531 Complexity & Analysis of Data Structures & Algorithms

COP 4531 Complexity & Analysis of Data Structures & Algorithms COP 4531 Complexity & Analysis of Data Structures & Algorithms Lecture 18 Reductions and NP-completeness Thanks to Kevin Wayne and the text authors who contributed to these slides Classify Problems According

More information

Lecture 3: Nondeterminism, NP, and NP-completeness

Lecture 3: Nondeterminism, NP, and NP-completeness CSE 531: Computational Complexity I Winter 2016 Lecture 3: Nondeterminism, NP, and NP-completeness January 13, 2016 Lecturer: Paul Beame Scribe: Paul Beame 1 Nondeterminism and NP Recall the definition

More information

ITCS:CCT09 : Computational Complexity Theory Apr 8, Lecture 7

ITCS:CCT09 : Computational Complexity Theory Apr 8, Lecture 7 ITCS:CCT09 : Computational Complexity Theory Apr 8, 2009 Lecturer: Jayalal Sarma M.N. Lecture 7 Scribe: Shiteng Chen In this lecture, we will discuss one of the basic concepts in complexity theory; namely

More information

Lecture 24 : Even more reductions

Lecture 24 : Even more reductions COMPSCI 330: Design and Analysis of Algorithms December 5, 2017 Lecture 24 : Even more reductions Lecturer: Yu Cheng Scribe: Will Wang 1 Overview Last two lectures, we showed the technique of reduction

More information

Complexity Theory. Jörg Kreiker. Summer term Chair for Theoretical Computer Science Prof. Esparza TU München

Complexity Theory. Jörg Kreiker. Summer term Chair for Theoretical Computer Science Prof. Esparza TU München Complexity Theory Jörg Kreiker Chair for Theoretical Computer Science Prof. Esparza TU München Summer term 2010 Lecture 4 NP-completeness Recap: relations between classes EXP PSPACE = NPSPACE conp NP conp

More information

Computability and Complexity Theory: An Introduction

Computability and Complexity Theory: An Introduction Computability and Complexity Theory: An Introduction meena@imsc.res.in http://www.imsc.res.in/ meena IMI-IISc, 20 July 2006 p. 1 Understanding Computation Kinds of questions we seek answers to: Is a given

More information

CSCI3390-Second Test with Solutions

CSCI3390-Second Test with Solutions CSCI3390-Second Test with Solutions April 26, 2016 Each of the 15 parts of the problems below is worth 10 points, except for the more involved 4(d), which is worth 20. A perfect score is 100: if your score

More information

CSI 4105 MIDTERM SOLUTION

CSI 4105 MIDTERM SOLUTION University of Ottawa CSI 4105 MIDTERM SOLUTION Instructor: Lucia Moura Feb 6, 2010 10:00 am Duration: 1:50 hs Closed book Last name: First name: Student number: There are 4 questions and 100 marks total.

More information

6.045 Final Exam Solutions

6.045 Final Exam Solutions 6.045J/18.400J: Automata, Computability and Complexity Prof. Nancy Lynch, Nati Srebro 6.045 Final Exam Solutions May 18, 2004 Susan Hohenberger Name: Please write your name on each page. This exam is open

More information

Time to learn about NP-completeness!

Time to learn about NP-completeness! 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 zeros with odd length The language of strings with

More information

Welcome to... Problem Analysis and Complexity Theory , 3 VU

Welcome to... Problem Analysis and Complexity Theory , 3 VU Welcome to... Problem Analysis and Complexity Theory 716.054, 3 VU Birgit Vogtenhuber Institute for Software Technology email: bvogt@ist.tugraz.at office: Inffeldgasse 16B/II, room IC02044 slides: http://www.ist.tugraz.at/pact17.html

More information