NP-Completeness Note. Some illustrations are taken from (KT) Kleinberg and Tardos. Algorithm Design (DPV)Dasgupta, Papadimitriou, and Vazirani. Algorithms.

Slides:



Advertisements
Similar presentations
Polynomial-time reductions We have seen several reductions:
Advertisements

NP-Completeness: Reductions
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
1 Chapter 8 NP and Computational Intractability Slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved.
CSC5160 Topics in Algorithms Tutorial 2 Introduction to NP-Complete Problems Feb Jerry Le
CS21 Decidability and Tractability
February 23, 2015CS21 Lecture 201 CS21 Decidability and Tractability Lecture 20 February 23, 2015.
Graphs 4/16/2017 8:41 PM NP-Completeness.
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 23 Instructor: Paul Beame.
NP-Completeness (2) NP-Completeness Graphs 4/17/2017 6:25 AM x x x x x
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 24 Instructor: Paul Beame.
CSE 421 Algorithms Richard Anderson Lecture 27 NP Completeness.
Toward NP-Completeness: Introduction Almost all the algorithms we studies so far were bounded by some polynomial in the size of the input, so we call them.
Black-box (oracle) Feed me a weighted graph G and I will tell you the weight of the max-weight matching of G.
Prof. Swarat Chaudhuri COMP 482: Design and Analysis of Algorithms Spring 2013 Lecture 22.
1 Algorithm Design Patterns and Anti-Patterns Algorithm design patterns.Ex. n Greed.O(n log n) interval scheduling. n Divide-and-conquer. O(n log n) FFT.
11/3/10 A. Smith; based on slides by E. Demaine, C. Leiserson, S. Raskhodnikova, K. Wayne Adam Smith Algorithm Design and Analysis L ECTURES NP-completeness.
The Theory of NP-Completeness 1. What is NP-completeness? Consider the circuit satisfiability problem Difficult to answer the decision problem in polynomial.
1 The Theory of NP-Completeness 2012/11/6 P: the class of problems which can be solved by a deterministic polynomial algorithm. NP : the class of decision.
CSEP 521 Applied Algorithms Richard Anderson Lecture 10 NP Completeness.
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
NP-complete Problems SAT 3SAT Independent Set Hamiltonian Cycle
Prabhas Chongstitvatana1 NP-complete proofs The circuit satisfiability proof of NP- completeness relies on a direct proof that L  p CIRCUIT-SAT for every.
Summary  NP-hard and NP-complete  NP-completeness proof  Polynomial time reduction  List of NP-complete problems  Knapsack problem  Isomprphisim.
1 3-COLOURING: Input: Graph G Question: Does there exist a way to 3-colour the vertices of G so that adjacent vertices are different colours? 1.What could.
Polynomial-time reductions We have seen several reductions:
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.
EMIS 8373: Integer Programming NP-Complete Problems updated 21 April 2009.
CSC401 – Analysis of Algorithms Chapter 13 NP-Completeness Objectives: Introduce the definitions of P and NP problems Introduce the definitions of NP-hard.
1 Chapter 8 NP and Computational Intractability Slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved.
Sailesh Prabhu Prof. Swarat Chaudhuri COMP 482: Design and Analysis of Algorithms Spring 2013.
1 The Theory of NP-Completeness 2 Cook ’ s Theorem (1971) Prof. Cook Toronto U. Receiving Turing Award (1982) Discussing difficult problems: worst case.
NP-Complete Problems. Running Time v.s. Input Size Concern with problems whose complexity may be described by exponential functions. Tractable problems.
1 Chapter 34: NP-Completeness. 2 About this Tutorial What is NP ? How to check if a problem is in NP ? Cook-Levin Theorem Showing one of the most difficult.
30.
NP-Completeness (Nondeterministic Polynomial Completeness) Sushanth Sivaram Vallath & Z. Joseph.
CS 3343: Analysis of Algorithms Lecture 25: P and NP Some slides courtesy of Carola Wenk.
CSCI 3130: Formal languages and automata theory Andrej Bogdanov The Chinese University of Hong Kong The Cook-Levin.
CSCI-256 Data Structures & Algorithm Analysis Lecture Note: Some slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved. 29.
1 Suppose I construct a TM M f which: 1. Preserves its input u. 2. Simulates a machine M b on input ε. 3. If M b hangs on input ε, force an infinite loop.
CS6045: Advanced Algorithms NP Completeness. NP-Completeness Some problems are intractable: as they grow large, we are unable to solve them in reasonable.
NPC.
NP Completeness Piyush Kumar. Today Reductions Proving Lower Bounds revisited Decision and Optimization Problems SAT and 3-SAT P Vs NP Dealing with NP-Complete.
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.
CSE 421 Algorithms Richard Anderson Lecture 27 NP-Completeness Proofs.
TU/e Algorithms (2IL15) – Lecture 9 1 NP-Completeness NOT AND OR AND NOT AND.
SUBSET-SUM Instance: A set of numbers denoted S and a target number t.
COSC 3101A - Design and Analysis of Algorithms 14 NP-Completeness.
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.
34.NP Completeness. Computer Theory Lab. Chapter 34P.2.
CSE 332: NP Completeness, Part II Richard Anderson Spring 2016.
P, NP, NP-completeness 2 Reductions 1 Thu, July 7 th 1.
TU/e Algorithms (2IL15) – Lecture 10 1 NP-Completeness, II.
Data Structures and Algorithm Analysis Lecture 24
Richard Anderson Lecture 26 NP-Completeness
Polynomial-Time Reduction
Richard Anderson Lecture 26 NP-Completeness
NP-Completeness Yin Tat Lee
CS21 Decidability and Tractability
Intro to Theory of Computation
Intro to Theory of Computation
Richard Anderson Lecture 25 NP-Completeness
Richard Anderson Lecture 28 NP-Completeness
NP-Complete Problems.
Richard Anderson Lecture 26 NP-Completeness
NP-Completeness Yin Tat Lee
CS21 Decidability and Tractability
Lecture 23 NP-Hard Problems
Presentation transcript:

NP-Completeness Note. Some illustrations are taken from (KT) Kleinberg and Tardos. Algorithm Design (DPV)Dasgupta, Papadimitriou, and Vazirani. Algorithms

Decision problems Decision problem. X is a set of strings. Instance: string s. Algorithm A solves problem X: A(s) = yes iff s  X. Polynomial time. Algorithm A runs in poly-time if for every string s, A(s) terminates in at most p(|s|) "steps", where p(  ) is some polynomial.

NP Def. Algorithm C(s, t) is a certifier for problem X if for every string s, s  X iff there exists a string t such that C(s, t) = yes. NP. Decision problems for which there exists a poly-time certifier. Remark. NP stands for nondeterministic polynomial-time.

Polynomial transformations Def. Problem X polynomial transforms to problem Y if given any input x to X, we can construct in polynomial time an input y to Y such that x is a yes instance of X iff y is a yes instance of Y. Notation. X ≤ P Y Algorithm for X Algorithm for Y xy Transf. yes no

NP-completeness Def. Problem Y is NP-complete if Y is in NP and for every problem X in NP, X  P Y. Theorem. Suppose Y is an NP-complete problem. Then Y is solvable in polynomial time iff P = NP.

Circuit satisfiability      10??? output inputs hard-coded inputs yes: KT

Proving NP-completeness Fact (Transitivity of  p ). If X  P Y and Y  P Z, then X  P Z. Theorem. Problem Y is NP-complete if Y is in NP and There exists some NP-complete problem X such that X  P Y. Proof. By def. of NP and transitivity of  P.

Map of reductions CIRCUIT-SAT 3-SAT DIR-HAM-CYCLEINDEPENDENT SET VERTEX COVER 3-SAT reduces to INDEPENDENT SET GRAPH 3-COLOR HAM-CYCLE TSP SUBSET-SUM SCHEDULING PLANAR 3-COLOR SET COVER KT

3-SAT  P INDEPENDENT SET  DPV

3-SAT  P DIR-HAM-CYCLE s t clause node x1x1 x2x2 x3x3 3k + 3 KT

3-SAT  P 3-COLOR T B F true false base Variable gadgets. Ensure that i.each literal is T or F and ii.a literal and its negation are opposites. KT

3-SAT  P 3-COLOR Clause gadgets. Ensure that at least one literal in each clause is T. TF B 6-node gadget true false KT

3-SAT  P SUBSET SUM dummies to get clause columns to sum to 4 y x z xyzC1C1 C2C2 C3C  x x  y y  z z W KT

CIRCUIT SAT  P SAT For each gate g in the circuit, create a variable g. Model g using a few clauses: If g is the output gate, we force it to be true by adding the clause (g). DPV

 A  NP, A  P CIRCUIT SAT Since A  NP, there is an algorithm C(s,t) such that: C checks, given an instance s and a proposed solution t, whether or not t is a solution of s. C runs in polynomial time. In polynomial time, build a circuit D such that: Known inputs of D are the bits of s. Unknown inputs of D are the bits of t. C’s answer is given at the output gate of D. Size of D is polynomial in the number of inputs. D‘s output is true if and only if t is a solution of s.

Example: Does G have an independent set of size 2?   u-v  1 independent set of size 2? hard-coded inputs (graph description)    u-w 0  v-w 1  u ?  v ?  w ?   set of size 2? both endpoints of some edge have been chosen? independent set? u vw G = (V, E), n = 3 KT