An NP-completeness Example. The graph CLIQUE problem Undirected Graph G = (V, E) –a clique is a complete subgraph of G Subset V’ of vertices that are.

Slides:



Advertisements
Similar presentations
Max Cut Problem Daniel Natapov.
Advertisements

Theory of Computing Lecture 18 MAS 714 Hartmut Klauck.
Polynomial-time reductions We have seen several reductions:
Lecture 23. Subset Sum is NPC
Vertex Cover Dominating Set These slides are based on the Lecture Notes by David Mount for the course CMSC 451 at the University of Maryland. The Copyright.
NP-Completeness: Reductions
NP-Completeness More Reductions. Definitions P: is the class of all decision problems which can be solved in polynomial time, O(n^k) for some constant.
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
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.
Approximation Algorithms Lecture for CS 302. What is a NP problem? Given an instance of the problem, V, and a ‘certificate’, C, we can verify V is in.
NP-Complete Problems Reading Material: Chapter 10 Sections 1, 2, 3, and 4 only.
NP-Complete Problems Problems in Computer Science are classified into
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 23 Instructor: Paul Beame.
Fall 2006Costas Busch - RPI1 More NP-complete Problems.
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.
Clique Cover Cook’s Theorem 3SAT and Independent Set
MCS312: NP-completeness and Approximation Algorithms
Lecture 22 More NPC problems
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.
1 NP-Completeness Poly time algorithm: input size n (in some encoding), worst case running time – O(n c ) for some constant c. Three classes of problems.
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.
NP-COMPLETENESS PRESENTED BY TUSHAR KUMAR J. RITESH BAGGA.
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.
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.
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.
Complete Graphs A complete graph is one where there is an edge between every two nodes A C B G.
Instructor Neelima Gupta Table of Contents Class NP Class NPC Approximation Algorithms.
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.
CS 3343: Analysis of Algorithms Lecture 25: P and NP Some slides courtesy of Carola Wenk.
NP-Algorithms Tractable vs Intractable Some problems are intractable: as they grow large, we are unable to solve them in reasonable time.
CSE 6311 – Spring 2009 ADVANCED COMPUTATIONAL MODELS AND ALGORITHMS Lecture Notes – Feb. 3, 2009 Instructor: Dr. Gautam Das notes by Walter Wilson.
NPC.
CSC 413/513: Intro to Algorithms
CSCI 2670 Introduction to Theory of Computing December 7, 2005.
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.
NP Hard Problems Instructor Neelima Gupta Presentation Edited by Sapna Grover.
Prof. Busch - LSU1 Busch Complexity Lectures: More NP-complete Problems.
COSC 3101A - Design and Analysis of Algorithms 14 NP-Completeness.
34.NP Completeness. Computer Theory Lab. Chapter 34P.2.
 2005 SDU Lecture15 P,NP,NP-complete.  2005 SDU 2 The PATH problem PATH = { | G is a directed graph that has a directed path from s to t} s t
TU/e Algorithms (2IL15) – Lecture 10 1 NP-Completeness, II.
Costas Busch - LSU 1 More NP-complete Problems. Costas Busch - LSU 2 Theorem: If: Language is NP-complete Language is in NP is polynomial time reducible.
ICS 353: Design and Analysis of Algorithms NP-Complete Problems King Fahd University of Petroleum & Minerals Information & Computer Science Department.
NP-Completeness (2) NP-Completeness Graphs 4/13/2018 5:22 AM x x x x x
More NP-Complete and NP-hard Problems
More NP-complete problems
Richard Anderson Lecture 26 NP-Completeness
Advanced Algorithms Analysis and Design
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 Yin Tat Lee
CS154, Lecture 16: More NP-Complete Problems; PCPs
NP-Completeness (2) NP-Completeness Graphs 11/23/2018 2:12 PM x x x x
NP-Complete Problems.
NP-Completeness Yin Tat Lee
CS21 Decidability and Tractability
CS154, Lecture 16: More NP-Complete Problems; PCPs
NP-Completeness (2) NP-Completeness Graphs 7/9/2019 6:12 AM x x x x x
Lecture 23 NP-Hard Problems
Presentation transcript:

An NP-completeness Example

The graph CLIQUE problem Undirected Graph G = (V, E) –a clique is a complete subgraph of G Subset V’ of vertices that are all connected to each other CLIQUE = {(G,k) : G is a graph with a clique of size k} For a general graph, and large-enough |V|, k, straightforward (naïve) algorithm for CLIQUE takes factorial time –OMEGA(k 2 * C(|V|, k) ) 1. CLIQUE is in NP –Exercise: Given encoding of G, and a certificate V’, come up with a poly-time verification algorithm to check that V’ is a clique of size k for G 2. CLIQUE is NP-hard –3-CNF-SAT  P CLIQUE implies CLIQUE is NP-complete

CLIQUE is NP-hard 3-CNF-SAT  P CLIQUE From instance I_3_CNF_SAT of 3-CNF-SAT, generate an instance I_CLIQUE of CLIQUE in polynomial time –I_CLIQUE returns true exactly whenever I_3_CNF_SAT returns true I_CLIQUE includes a graph G = (V, E) and a vertex subset V’ Build the graph G to do the mapping I_CLIQUE –  = C1 AND C2 AND … Ck C1 = lit_11 OR lit_12 OR lit_13. –Lit_11 = x or NOT x Similarly for C2, C3, … Ck Build Graph G = (V, E) as follows –Take the r-th clause in I_3_CNF_SAT –For lit_1r OR lit_2r OR lit_3r, place vertices vert_1r, vert_2r, vert_3r in V –put an edge from vertices vert_ir to vert_js (i = 1, 2, 3; j = 1, 2, 3) if r != s (I.e., the vertices correspond to different triples in the formula) AND lit_ir != NOT lit_js –don’t put an edge from x to (NOT x) even if they are in different triples –CAN DO THIS IN POLY TIME!

 = (x1 OR (NOT x2) OR (NOT x3)) AND ((NOT x1) OR x2 OR x3) AND (x1 OR x2 OR x3) true when x2 =0 and x3 = 1 GRAPH (Fig 34.14) HERE Suppose  is TRUE for some values of the variables. –Then each Cr is true => at least one of lit_r1, lit_r2, lit_r3 is true. –Select one such “true” vertex from each Cr (e.g., if lit_r2 and lit_r3 are both true, select vert_r2 at random from vert_r2 and vert_r3) Call this a subset V’ –V’ has k elements (one from each Cr) and is a clique Take any two vertices in V’, and there is an edge between them by construction. –By the selection method, they are in different triples –They are both 1’s by selection method, so they are not negations of each other. –We mapped from a satisfying assignment for  to a graph with a clique of size k (vert_12, vert_23, vert_33) Suppose G has a clique V’ of size k (vert_12, vert_23, vert_33) –Each vertex in V’ belongs to a different triple and cover all triples between them there cannot be an edge in G if two vertices belong to the same triple. –If vert_ri is in V’, assign lit_ri = 1 there cannot be an assignment like { xi = 1; (NOT xi) =1 } –there cannot be an edge in G if two vertices are negations of each other –Each clause has one TRUE literal by the mapping –We mapped from a graph with clique of size k to a satisfying assignment for 

CLIQUE is NP hard for the “special” kind of graphs –CLIQUE is “harder” for general kind of graph –CLIQUE is NP-hard for general kind of graph. CLIQUE IS NP-COMPLETE.

VERTEX COVER Vertex cover of an undirected graph G = (V, E) is a subset V’ of V such that –if (u, v) is in E, then either u or v or both is in V’ –The vertices in V’ together ‘cover’ all the edges of E –|V’| is the size of a vertex cover. VERTEX_COVER = { (G, k) : graph G has a vertex cover of size k}. VERTEX_COVER is NP-complete VERTEX_COVER is in NP –exercise given (G, k) and certificate c = V’, find a poly algorithm to verify c VERTEX_COVER is NP-hard –CLIQUE  p VERTEX_COVER

Complement of a graph –COMP_G = (V, COMP_E) COMP_E = { (u, v) : u, v are in V, u != v, and (u, v) not in E } edges that are not in E FIG HERE Reduction algorithm from CLIQUE to VERTEX_COVER –from I_CLIQUE = (G, k) Compute COMP_G (poly) –Claim: we now have I_VERTEX_COVER = (COMP_G, |V| - k) G has a clique of size k if and only if COMP_G has a vertex cover of size |V| - k

If part: Suppose G has a clique V’ of size k. Claim: V-V’ is a vertex cover in COMP_G proof: suppose (u, v) is an edge in COMP_E. –Then (u, v) is not in E –So, either u or v is not in V’ since if both u and v are in V’, there must be an edge between them. –That is, either u or v is in V-V’ –if (u, v) is an edge in COMP_E, then V-V’ covers that edge, hence V-V’ is a vertex cover in COMP_G. and V-V’ has size |V| -k Only-if part: Suppose COMP_G has a vertex cover V’ of size |V| -k –claim: V-V’ is a clique in G –proof: for all u, v in V, if (u, v) is in COMP_E, then u is in V’ or v is in V’ or both by contrapositive, for all u, v in V, if u is not in V’ and v is not in V’, then (u, v) is in E. I.e., V-V’ is a clique.