More NP-Complete Problems

Slides:



Advertisements
Similar presentations
Complexity ©D.Moshkovits 1 Where Can We Draw The Line? On the Hardness of Satisfiability Problems.
Advertisements

Complexity ©D.Moshkovitz 1 NPC More NP-Complete Problems.
Theory of Computing Lecture 18 MAS 714 Hartmut Klauck.
Lecture 23. Subset Sum is NPC
NP-Completeness: Reductions
CSC5160 Topics in Algorithms Tutorial 2 Introduction to NP-Complete Problems Feb Jerry Le
Complexity 11-1 Complexity Andrei Bulatov NP-Completeness.
Computability and Complexity 15-1 Computability and Complexity Andrei Bulatov NP-Completeness.
NP-Completeness (2) NP-Completeness Graphs 4/17/2017 6:25 AM x x x x x
Complexity ©D.Moshkovitz 1 Paths On the Reasonability of Finding Paths in Graphs.
Clique Cover Cook’s Theorem 3SAT and Independent Set
The Theory of NP-Completeness 1. What is NP-completeness? Consider the circuit satisfiability problem Difficult to answer the decision problem in polynomial.
Lecture 22 More NPC problems
EMIS 8373: Integer Programming NP-Complete Problems updated 21 April 2009.
NP-Complete Problems. Running Time v.s. Input Size Concern with problems whose complexity may be described by exponential functions. Tractable problems.
CS 3343: Analysis of Algorithms Lecture 25: P and NP Some slides courtesy of Carola Wenk.
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.
NPC.
Complexity ©D.Moshkovits 1 2-Satisfiability NOTE: These slides were created by Muli Safra, from OPICS/sat/)
NP-complete Languages
CSCI 2670 Introduction to Theory of Computing December 2, 2004.
CSCI 2670 Introduction to Theory of Computing December 7, 2005.
CSE 421 Algorithms Richard Anderson Lecture 27 NP-Completeness Proofs.
Complexity ©D.Moshkovitz 1 Our First NP-Complete Problem The Cook-Levin theorem A B C.
SUBSET-SUM Instance: A set of numbers denoted S and a target number t.
 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.
NP-Completeness (2) NP-Completeness Graphs 4/13/2018 5:22 AM x x x x x
More NP-Complete and NP-hard Problems
Chapter 10 NP-Complete Problems.
Richard Anderson Lectures NP-Completeness
Richard Anderson Lecture 26 NP-Completeness
Advanced Algorithms Analysis and Design
SUBSET-SUM Instance: A set of numbers denoted S and a target number t.
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
(xy)(yz)(xz)(zy)
NP-Completeness (36.4-5) P: yes and no in pt NP: yes in pt NPH  NPC
NP-Completeness Yin Tat Lee
Intro to Theory of Computation
Intro to Theory of Computation
CS154, Lecture 16: More NP-Complete Problems; PCPs
Where Can We Draw The Line?
ICS 353: Design and Analysis of Algorithms
NP-Completeness (2) NP-Completeness Graphs 11/23/2018 2:12 PM x x x x
Richard Anderson Lecture 25 NP-Completeness
NP-Completeness Proofs
Richard Anderson Lecture 28 NP-Completeness
Chapter 34: NP-Completeness
Additional NP-complete problems
Hardness of Approximation
NP-Complete Problems.
CS 3343: Analysis of Algorithms
NP-Completeness Yin Tat Lee
CS21 Decidability and Tractability
NP-Completeness Yin Tat Lee
Our First NP-Complete Problem
CS154, Lecture 16: More NP-Complete Problems; PCPs
CS21 Decidability and Tractability
Reductions Complexity ©D.Moshkovitz.
Reductions Complexity ©D.Moshkovitz.
Trevor Brown DC 2338, Office hour M3-4pm
Instructor: Aaron Roth
Lecture 24 Classical NP-hard Problems
NP-Completeness (2) NP-Completeness Graphs 7/9/2019 6:12 AM x x x x x
The Satisfiability Problem
Lecture 23 NP-Hard Problems
Presentation transcript:

More NP-Complete Problems Complexity ©D.Moshkovitz

Introduction Objectives: Overview: To introduce more NP-Complete problems. Overview: 3SAT CLIQUE & INDEPENDENT-SET SUBSET-SUM Complexity ©D.Moshkovitz

Method How to show a problem is in NPC? First show it’s in NP Then show it is NP-hard by reducing some NP-Hard problem to it. Complexity ©D.Moshkovitz

New Base Problems The only NP-Complete problem we currently know of is SAT. Unfortunately, it’s not very comfortable to work with. Thus we’ll start by introducing several useful variants of SAT. We’ll use them as our base problems. Complexity ©D.Moshkovitz

3SAT Instance: a 3CNF formula Problem: To decide if the formula is satisfiable. A satifiable 3CNF formula (xyz)(xyz) An unsatifiable 3CNF formula (xxx)(xxx) Complexity ©D.Moshkovitz

Why would that be enough? SIP 259-260 3SAT is NP-Complete 3SAT is a special case of SAT, and is therefore clearly in NP. In order to show it’s also NP-Complete, we’ll alter the proof of SAT’s NP-Completeness, so it produces 3CNF formulas. Why would that be enough? Complexity ©D.Moshkovitz

Revisiting SAT’s NP-Completeness Proof Given a TM and an input we’ve produced a conjunction of: Complexity ©D.Moshkovitz

Transforming the Formula into a CNF Formula All the sub-formulas, but move, form a CNF formula. Using the distributive law we can transform move into a conjunction of clauses. The formula stays succinct (check!). Complexity ©D.Moshkovitz

CNF  3CNF (xy)(x1x2... xt)... (xyx) clauses with 1 or 2 literals clauses with more than 3 literals replication split (xyx) (x1  x2  c11)(c11 x3 c12)... (c1t-3 xt-1xt) Complexity ©D.Moshkovitz

3SAT is NP-Complete Since we’ve shown a reduction from any NP problem to 3SAT, and 3SAT is in NP, 3SAT is NP-Complete.  Complexity ©D.Moshkovitz

CLIQUE Instance: A graph G=(V,E) and a threshold k. Problem: To decide if there is a set of nodes C={v1,...,vk}V, s.t for any u,vC: (u,v)E. Complexity ©D.Moshkovitz

CLIQUE is in NP On input G=(V,E),k: Guess C={v1,...,vk}V For any u,vC: verify (u,v)E Reject if one of the tests fail, accept otherwise. The length of the certificate: O(n) (n=|V|) Time complexity: O(n2) Complexity ©D.Moshkovitz

CLIQUE is NP-Complete k Proof: We’ll show 3SATpCLIQUE. SIP 251-253 ≤p Complexity ©D.Moshkovitz

|V| = formula’s length The Reduction for any clause () |V| = formula’s length    K= no. of clauses connected iff   Complexity ©D.Moshkovitz

a clique of size k must contain one node from every layer. Proof of Correctness NOT connected! 1 . k a clique of size k must contain one node from every layer. Complexity ©D.Moshkovitz

Correctness given a k-clique, assign x TRUE or FALSE according to whether x or x is in the clique; this satisfies the formula . given a satisfying assignment, a set comprising of one satisfied literal of each clause forms a k-clique. Complexity ©D.Moshkovitz

INDEPENDENT-SET Instance: A graph G=(V,E) and a goal k. Problem: To decide if there is a set of nodes I={v1,...,vk}V, s.t for any u,vI: (u,v)E. Complexity ©D.Moshkovitz

INDEPENDENT-SET  NP On input G=(V,E),k: Guess I={v1,...,vk}V For any u,vC: verify (u,v)E Reject if one of the tests fail, accept otherwise. The length of the certificate: O(n) (n=|V|) Time complexity: O(n2) Complexity ©D.Moshkovitz

INDEPENDENT-SET is NPC Proof: By the previous claim and a trivial reduction from CLIQUE.  there’s a clique of size k in a graph there’s an IS of size k in its complement IFF Complexity ©D.Moshkovitz

SUBSET-SUM Instance: A multi-set of numbers denoted S and a target number t. Problem: To decide if there exists a subset YS, s.t yYy=t. 13 16 8 21 1 3 6 11 Complexity ©D.Moshkovitz

SUBSET-SUM is in NP On input S,t: Guess YS Accept iff yYy=t. The length of the certificate: O(n) (n=|S|) Time complexity: O(n) Complexity ©D.Moshkovitz

SUBSET-SUM is NP-Complete SIP 269-271 SUBSET-SUM is NP-Complete Proof: We’ll show 3SATpSUBSET-SUM. ≤p t Complexity ©D.Moshkovitz

Satisfying Clauses c1 c2 …… ck yi zi digit per clause number per variable xi assigned true: yi number per variable xi assigned false: zi 1 if xi is in cj 0 otherwise 1 if xi is in cj 0 otherwise Complexity ©D.Moshkovitz

Achieving Target c1 c2 …… ck digit per clause 0<d<4 target: Complexity ©D.Moshkovitz

Achieving Target c1 c2 …… ck digit per clause 1 target: 3 Complexity ©D.Moshkovitz

make sure a good subset contains exactly one of yi and zi Achieving Target c1 c2 … ck y1 z1 … yl zl 1 . . . make sure a good subset contains exactly one of yi and zi 1 . . . 3 3 3 Complexity ©D.Moshkovitz

Imposing Consistency . . . . . . c1 c2 … ck y1 z1 … yl zl 1 1 1 1 3 3 1 . . . 1 . . . 1 3 3 3 Complexity ©D.Moshkovitz

Succinctness k l 2l 2k Complexity ©D.Moshkovitz

Completeness If there is a satisfying assignment, build the subset as follows: If the i-th variable is assigned TRUE, take yi, else take zi. Add as many auxiliary numbers as needed.  1 in the leftmost l digits satisfiability  3 in the rightmost k digits Complexity ©D.Moshkovitz

Soundness If there is a subset which sums up to the target, construct an assignment as follows: If yi is in the subset, assign TRUE to the i-th variable. If zi is in the subset, assign FALSE to the i-th variable. Complexity ©D.Moshkovitz

Observation: No Carry All digits are either 0 or 1. 1 3 y1 z1 … yl zl c1 c2 … ck All digits are either 0 or 1. Each column contains at most five 1’s. Hence, a “carry” into the next column never occurs. Complexity ©D.Moshkovitz

Consistency 1 3 y1 z1 … yl zl c1 c2 … ck Thus, to get 1 in the leftmost l digits, our subset necessarily contains either yi or zi (Not both!). Complexity ©D.Moshkovitz

Satisfiablity 1 3 y1 z1 … yl zl c1 c2 … ck In each column, at most 2 can come from the auxiliary numbers, so all clauses are satisfied. Complexity ©D.Moshkovitz

Summing Up SUBSET-SUM is in NP 3SATpSUBSET-SUM Thus SUBSET-SUM is NP-Complete Complexity ©D.Moshkovitz

Summary In this lecture we’ve added many new problems to our NPC “bank”. Interestingly, NPC contains over 1000 different problems !  Complexity ©D.Moshkovitz

Appendix Complexity ©D.Moshkovitz

Dictionary negation: not () conjunction: and () disjunction: or () literal: (negated or not) Boolean variable Examples: x, x clause: several literals connected with  Example: (xyz) CNF (Conjunctive Normal Form): several clauses connected with  Example: (x y)(xyz) 3CNF: a CNF formula with three literals in each clause. Example: (xyz)(xyz) Complexity ©D.Moshkovitz