NP-complete Problems SAT 3SAT Independent Set Hamiltonian Cycle

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.
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
NP-complete and NP-hard problems Transitivity of polynomial-time many-one reductions Concept of Completeness and hardness for a complexity class Definition.
The Theory of NP-Completeness
CSC5160 Topics in Algorithms Tutorial 2 Introduction to NP-Complete Problems Feb Jerry Le
Complexity 11-1 Complexity Andrei Bulatov NP-Completeness.
February 23, 2015CS21 Lecture 201 CS21 Decidability and Tractability Lecture 20 February 23, 2015.
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.
Computability and Complexity 16-1 Computability and Complexity Andrei Bulatov NP-Completeness.
NP-Complete Problems Problems in Computer Science are classified into
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.
Clique Cover Cook’s Theorem 3SAT and Independent Set
The Theory of NP-Completeness 1. Nondeterministic algorithms A nondeterminstic algorithm consists of phase 1: guessing phase 2: checking If the checking.
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.
Nattee Niparnan. Easy & Hard Problem What is “difficulty” of problem? Difficult for computer scientist to derive algorithm for the problem? Difficult.
MCS 312: NP Completeness and Approximation algorithms Instructor Neelima Gupta
Lecture 22 More NPC problems
CSEP 521 Applied Algorithms Richard Anderson Lecture 10 NP Completeness.
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:
CSE 024: Design & Analysis of Algorithms Chapter 9: NP Completeness Sedgewick Chp:40 David Luebke’s Course Notes / University of Virginia, Computer Science.
NP-COMPLETENESS PRESENTED BY TUSHAR KUMAR J. RITESH BAGGA.
EMIS 8373: Integer Programming NP-Complete Problems updated 21 April 2009.
Techniques for Proving NP-Completeness Show that a special case of the problem you are interested in is NP- complete. For example: The problem of finding.
1 How to prove that a problem is NPC. 2 Cook Cook showed the first NPC problem: SAT Cook received Turing Award in 1982.
Unit 9: Coping with NP-Completeness
NP-Complete Problems. Running Time v.s. Input Size Concern with problems whose complexity may be described by exponential functions. Tractable problems.
1.1 Chapter 3: Proving NP-completeness Results Six Basic NP-Complete Problems Some Techniques for Proving NP-Completeness Some Suggested Exercises.
NP-Completeness (Nondeterministic Polynomial Completeness) Sushanth Sivaram Vallath & Z. Joseph.
NP-Algorithms Tractable vs Intractable Some problems are intractable: as they grow large, we are unable to solve them in reasonable time.
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.
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.
CSE 6311 – Spring 2009 ADVANCED COMPUTATIONAL MODELS AND ALGORITHMS Lecture Notes – Feb. 3, 2009 Instructor: Dr. Gautam Das notes by Walter Wilson.
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.
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.
CSCI 2670 Introduction to Theory of Computing December 7, 2005.
CSE 421 Algorithms Richard Anderson Lecture 27 NP-Completeness Proofs.
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.
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.
TU/e Algorithms (2IL15) – Lecture 10 1 NP-Completeness, II.
ICS 353: Design and Analysis of Algorithms NP-Complete Problems King Fahd University of Petroleum & Minerals Information & Computer Science Department.
Richard Anderson Lectures NP-Completeness
Richard Anderson Lecture 26 NP-Completeness
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
CS21 Decidability and Tractability
ICS 353: Design and Analysis of Algorithms
Richard Anderson Lecture 25 NP-Completeness
Richard Anderson Lecture 28 NP-Completeness
NP-Complete Problems.
Richard Anderson Lecture 26 NP-Completeness
CS21 Decidability and Tractability
CSE 589 Applied Algorithms Spring 1999
Presentation transcript:

NP-complete Problems SAT 3SAT Independent Set Hamiltonian Cycle Stephen Cook 1971 SAT Richard Karp 1972 3SAT Independent Set Hamiltonian Cycle Vertex Cover CLIQUE Traveling-Salesman Problem(TSP) Subset-Sum …… …… About 1000 NP-complete problems have been discovered since.

Independent Set Let G be an undirected graph. A  V(G) is an independent set if no two vertices in A share an edge.  u, v  A, (u, v)  E(G) Ex. b d g f c a e e d a g A = { a, d, e, g } is an independent set. B = { a, c, f } is not

The Independent-Set Problem IND-SET Input: Graph G, integer K  1. Q: Does G have an independent set of size  K ? Theorem IND-SET is NP-complete. Proof  IND-SET  NP. Below is a non-deterministic algorithm: a) Pick K vertices from V(G) to form a subset A  V. non-deterministic O(K) time certificate b) Check if  u, v  A, (u, v)  E(G). If so answer Yes; otherwise, answer No. deterministic O(K ) time 2

3SAT ≤ IND SET P Therefore IND-SET is NP-complete. Proof (cont’d)  We show that 3SAT is polynomial-time reducible to IND-SET. Construct (G , K) such that   3SAT  (G , K)  IND-SET.   This will follow from Lemma 1. Therefore IND-SET is NP-complete.

Constructing G  x  x  One vertex for each literal. Ex.  = ( x  x   x )  ( x  x  x )  ( x  x   x ) 1 2 3 1 3 4 2 3 4 x  x 1 2 3 4  One vertex for each literal.  Literals in the same clause form a triangle.  Opposite literals share edges.

Satisfiability vs. Independent Set Lemma 1  satisfiable  G has an independent set of size K (= #clauses in ). Proof (  ) Suppose  is satisfiable. Then at least one literal from every clause is true. Pick exactly one such literal from each clause and pick its corresponding vertex.  K vertices are picked  For two of these vertices to share an edge, the corresponding literals would be  either in the same clause Impossible given the way these vertices are picked  or opposite literals. Impossible given that  is satisfiable. So none of the K vertices are adjacent. Thus the K vertices form an independent set.

Cont’d (  ) Suppose G has an independent set of size K.  Then the vertices in the set  must be in different triangles.  do not include a pair of opposite literals. Now we assign T to the corresponding literals in , which will be true under the induced truth value assignment to the variables.

Vertex Cover G = K |C|  |V| – 1 Let G be an undirected graph. C  V(G) is a vertex cover if for every edge (u, v)  E(G) either u  C or v  C a c d b e a G = K n |C|  |V| – 1 complete graph with n vertices d { a, d } is a vertex cover.

The Vertex Cover Problem Vertex Cover (VC) Input: Graph G = (V, E), positive integer K  | V |. Q: Does G have a vertex cover of size  K ? Lemma C is a vertex cover  V – C is an independent set. a c d b e Proof () Let C be a vertex cover. Suppose V – C is not an independent set. Then there exists two vertices u, v  V – C such that (u, v)  E. {a, d}: vertex cover So edge (u, v) has both vertices not in C and C is not a vertex cover. a c d b e ( ) Similarly. {b, c, e}: independent set

VC is NP-complete Corollary IND-SET  VC It is easy to show that VC  NP. Theorem VC  NPC.

CLIQUE A clique Q is a subset of vertices such that (u, v) is an edge for every u, v  Q. b a d e c f g cliques: { a, b, c, d } { e, f, g } { d, e } { g }, … The subgraph induced by Q is a complete graph.

Complement of a Graph The complement G of a graph G = (V, E) has  the same vertex set V  edge set E such that (u, v)  E  (u, v)  E Complement: Original graph: b a d e c f g b a d e c f g

The CLIQUE Problem Input: Graph G = (V, E), positive integer K  | V |. Q: Does G have a clique of size  K ? Lemma Q is a clique in G  Q is an independent set in the complement G . IND-SET  CLIQUE P Theorem CLIQUE  NPC.