1 How to prove that a problem is NPC. 2 Cook Cook showed the first NPC problem: SAT Cook received Turing Award in 1982.

Slides:



Advertisements
Similar presentations
Theory of Computing Lecture 18 MAS 714 Hartmut Klauck.
Advertisements

Polynomial-time reductions We have seen several reductions:
1 NP-completeness Lecture 2: Jan P The class of problems that can be solved in polynomial time. e.g. gcd, shortest path, prime, etc. There are many.
NP-Completeness: Reductions
NP and NP Complete. Definitions A problem is in the class P if there is a polynomial time solution to the problem A problem is in the class NP if there.
The Theory of NP-Completeness
1 NP-Complete Problems. 2 We discuss some hard problems:  how hard? (computational complexity)  what makes them hard?  any solutions? Definitions 
© The McGraw-Hill Companies, Inc., Chapter 8 The Theory of NP-Completeness.
CSC5160 Topics in Algorithms Tutorial 2 Introduction to NP-Complete Problems Feb Jerry Le
Computability and Complexity 15-1 Computability and Complexity Andrei Bulatov NP-Completeness.
Transitivity of  poly Theorem: Let ,  ’, and  ’’ be three decision problems such that   poly  ’ and  ’  poly  ’’. Then  poly  ’’. Proof:
NP-Complete Problems Reading Material: Chapter 10 Sections 1, 2, 3, and 4 only.
1 Polynomial Time Reductions Polynomial Computable function : For any computes in polynomial time.
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 23 Instructor: Paul Beame.
88- 1 Chapter 8 The Theory of NP-Completeness P: the class of problems which can be solved by a deterministic polynomial algorithm. NP : the class.
Fall 2006Costas Busch - RPI1 More NP-complete Problems.
NP-complete examples CSC3130 Tutorial 11 Xiao Linfu Department of Computer Science & Engineering Fall 2009.
NP-Completeness (2) NP-Completeness Graphs 4/17/2017 6:25 AM x x x x x
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.
Clique Cover Cook’s Theorem 3SAT and Independent Set
1 The Theory of NP-Completeness 2 NP P NPC NP: Non-deterministic Polynomial P: Polynomial NPC: Non-deterministic Polynomial Complete P=NP? X = P.
The Theory of NP-Completeness 1. Nondeterministic algorithms A nondeterminstic algorithm consists of phase 1: guessing phase 2: checking If the checking.
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.
Lecture 22 More NPC problems
NP-complete Problems SAT 3SAT Independent Set Hamiltonian Cycle
Summary  NP-hard and NP-complete  NP-completeness proof  Polynomial time reduction  List of NP-complete problems  Knapsack problem  Isomprphisim.
Polynomial-time reductions We have seen several reductions:
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.
The Theory of Complexity for Nonpreemptive Scheduling 1.
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.
Design and Analysis of Algorithms - Chapter 101 Our old list of problems b Sorting b Searching b Shortest paths in a graph b Minimum spanning tree b Primality.
CS 3343: Analysis of Algorithms Lecture 25: P and NP Some slides courtesy of Carola Wenk.
CSE 589 Part V One of the symptoms of an approaching nervous breakdown is the belief that one’s work is terribly important. Bertrand Russell.
CS6045: Advanced Algorithms NP Completeness. NP-Completeness Some problems are intractable: as they grow large, we are unable to solve them in reasonable.
1 CPSC 320: Intermediate Algorithm Design and Analysis July 30, 2014.
CSE 6311 – Spring 2009 ADVANCED COMPUTATIONAL MODELS AND ALGORITHMS Lecture Notes – Feb. 3, 2009 Instructor: Dr. Gautam Das notes by Walter Wilson.
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.
CSC 413/513: Intro to Algorithms
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.
CSE 421 Algorithms Richard Anderson Lecture 27 NP-Completeness Proofs.
The Theory of NP-Completeness 1. Nondeterministic algorithms A nondeterminstic algorithm consists of phase 1: guessing phase 2: checking If the checking.
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.
1 The Theory of NP-Completeness 2 Review: Finding lower bound by problem transformation Problem X reduces to problem Y (X  Y ) iff X can be solved by.
CSE 332: NP Completeness, Part II Richard Anderson Spring 2016.
ICS 353: Design and Analysis of Algorithms NP-Complete Problems King Fahd University of Petroleum & Minerals Information & Computer Science Department.
The Theory of NP-Completeness
NP-Completeness A problem is NP-complete if: It is in NP
NP-Completeness (2) NP-Completeness Graphs 4/13/2018 5:22 AM x x x x x
Richard Anderson Lectures NP-Completeness
Richard Anderson Lecture 26 NP-Completeness
NP-Completeness (2) NP-Completeness Graphs 7/23/ :02 PM x x x x
NP-Completeness (2) NP-Completeness Graphs 7/23/ :02 PM x x x x
NP-Completeness Proofs
Richard Anderson Lecture 26 NP-Completeness
NP-Completeness (36.4-5) P: yes and no in pt NP: yes in pt NPH  NPC
ICS 353: Design and Analysis of Algorithms
NP-Completeness (2) NP-Completeness Graphs 11/23/2018 2:12 PM x x x x
More NP-complete Problems
Richard Anderson Lecture 25 NP-Completeness
Richard Anderson Lecture 28 NP-Completeness
The Theory of NP-Completeness
NP-Complete Problems.
CS 3343: Analysis of Algorithms
Richard Anderson Lecture 26 NP-Completeness
The Theory of NP-Completeness
NP-Completeness (2) NP-Completeness Graphs 7/9/2019 6:12 AM x x x x x
Presentation transcript:

1 How to prove that a problem is NPC

2 Cook Cook showed the first NPC problem: SAT Cook received Turing Award in 1982.

3 Karp R. Karp showed several NPC problems, such as 3-STA, node (vertex) cover, and Hamiltonian cycle, etc. Karp received Turing Award in 1985

4 NP-Completeness Proof: Reduction Vertex Cover Clique3-SAT SAT Chromatic Number Dominating Set All NP problems

13 NPC Problems CLIQUE(k): Does G=(V,E) contain a clique of size  k? Definition:  A clique in a graph is a set of vertices such that any pair of vertices are joined by en edge.

14 NPC Problems Vertex Cover(k): Given a graph G=(V, E) and an integer k, does G have a vertex cover with  k vertices? Definition: A vertex cover of G=(V, E) is V ’  V such that every edge in E is incident to some v  V ’.

15 Dominating Set(k): Given an graph G=(V, E) and an integer k, does G have a dominating set of size  k ? Definition:  A dominating set D of G=(V, E) is D  V such that every v  V is either in D or adjacent to at least one vertex of D. NPC Problems

16 SAT: Give a Boolean expression (formula) in DNF (conjunctive normal form), determine if it is satisfiable. 3SAT: Give a Boolean expression in DNF such that each clause has exactly 3 variables (literals), determine if it is satisfiable. NPC Problems

17 Chromatic Coloring(k): Given a graph G=(V, E) and an integer k, does G have a coloring for k Definition A coloring of a graph G=(V, E) is a function f : V  { 1, 2, 3, …, k }  if (u, v)  E, then f(u)  f(v). NPC Problems

18 3-Satisfiability Problem (3-SAT) Def: Each clause contains exactly three literals. (I) 3-SAT is an NP problem (obviously) (II) SAT  3-SAT Proof: (1) One literal L 1 in a clause in SAT: In 3-SAT: L 1 v y 1 v y 2 L 1 v -y 1 v y 2 L 1 v y 1 v -y 2 L 1 v -y 1 v -y 2

19 (2) Two literals L 1, L 2 in a clause in SAT: In 3-SAT: L 1 v L 2 v y 1 L 1 v L 2 v -y 1 (3) Three literals in a clause: remain unchanged. (4) More than 3 literals L 1, L 2, …, L k in a clause: in 3-SAT: L 1 v L 2 v y 1 L 3 v -y 1 v y 2  L k-2 v -y k-4 v y k-3 L k-1 v L k v -y k-3

20 The instance S in 3-SAT: x 1 v x 2 v y 1 x 1 v x 2 v -y 1 -x 3 v y 2 v y 3 -x 3 v -y 2 v y 3 -x 3 v y 2 v -y 3 -x 3 v -y 2 v -y 3 x 1 v -x 2 v y 4 x 3 v -y 4 v y 5 -x 4 v x 5 v -y 5 An instance S in SAT: x 1 v x 2 -x 3 x 1 v -x 2 v x 3 v -x 4 v x 5 SAT transform 3-SAT S S Example of Transforming a 3-SAT Instance to an SAT Instance

21 Chromatic Number Decision Problem (CN) Def: A coloring of a graph G = (V, E) is a functionf: V  { 1, 2, 3, …, k } such that if (u, v)  E, then f(u)  f(v). The CN problem is to determine if G has a coloring for k. E.g. Satisfiability with at most 3 literals per clause (SATY)  CN. 3-colorable f(a)=1, f(b)=2, f(c)=1 f(d)=2, f(e)=3

22 Set Cover Decision Problem Def: F = { S 1, S 2, …, S k } S i = { u 1, u 2, …, u n } T is a set cover of F if T  F and S i = S i The set cover decision problem is to determine if F has a cover T containing no more than c sets. Example: c=3. F = {(a 1, a 3 ), (a 2, a 4 ), (a 2, a 3 ), (a 4 ), (a 1, a 3, a 4 )} s 1 s 2 s 3 s 4 s 5 T = { s 1, s 3, s 4 } set cover T = { s 1, s 2 } another set cover

23 Exact Cover Problem Def: To determine if F has an exact cover T, which is a cover of F and the sets in T are pairwise disjoint. CN  exact cover

24 Sum of Subsets Problem Def: A set of positive numbers A = { a 1, a 2, …, a n } a constant C Determine if  A  A  a i = C e.g. A = { 7, 5, 19, 1, 12, 8, 14 } C = 21, A = { 7, 14 } C = 11, no solution Exact cover  sum of subsets.

25 Exact Cover  Sum of Subsets Proof: Instance of exact cover: F = { S 1, S 2, …, S n } Instance of sum of subsets: A = { a 1, a 2, …, a n } where

26 Partition Problem Def: Given a set of positive numbers A = { a 1,a 2, …,a n }, determine if  a partition P,   a i =  a i i  p i  p e.g. A = {3, 6, 1, 9, 4, 11} partition: {3, 1, 9, 4} and {6, 11} sum of subsets  partition

27 Bin Packing Problem Def: n items, each of size c i, c i > 0, a positive number k and bin capacity C, determine if we can assign the items into k bins such that the sum of c i ’ s assigned to each bin does not exceed C. partition  bin packing.

28 Q&A