Complexity ©D.Moshkovitz 1 NPC More NP-Complete Problems.

Slides:



Advertisements
Similar presentations
TWO STEP EQUATIONS 1. SOLVE FOR X 2. DO THE ADDITION STEP FIRST
Advertisements

Copyright © 2011, Elsevier Inc. All rights reserved. Chapter 5 Author: Julia Richards and R. Scott Hawley.
1 Copyright © 2010, Elsevier Inc. All rights Reserved Fig 2.1 Chapter 2.
By D. Fisher Geometric Transformations. Reflection, Rotation, or Translation 1.
Analysis of Algorithms
Business Transaction Management Software for Application Coordination 1 Business Processes and Coordination.
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Title Subtitle.
My Alphabet Book abcdefghijklm nopqrstuvwxyz.
0 - 0.
DIVIDING INTEGERS 1. IF THE SIGNS ARE THE SAME THE ANSWER IS POSITIVE 2. IF THE SIGNS ARE DIFFERENT THE ANSWER IS NEGATIVE.
MULT. INTEGERS 1. IF THE SIGNS ARE THE SAME THE ANSWER IS POSITIVE 2. IF THE SIGNS ARE DIFFERENT THE ANSWER IS NEGATIVE.
Addition Facts
ZMQS ZMQS
Reductions Complexity ©D.Moshkovitz.
ABC Technology Project
CSci 4011 INHERENT LIMITATIONS OF COMPUTER PROGRAMS.
© Charles van Marrewijk, An Introduction to Geographical Economics Brakman, Garretsen, and Van Marrewijk.
Cook-Levin Theorem Proof and Illustration
Squares and Square Root WALK. Solve each problem REVIEW:
1 P, NP, and NP-Complete Dr. Ying Lu RAIK 283 Data Structures & Algorithms.
1 Chapter 4 The while loop and boolean operators Samuel Marateck ©2010.
Chapter 5 Test Review Sections 5-1 through 5-4.
GG Consulting, LLC I-SUITE. Source: TEA SHARS Frequently asked questions 2.
Addition 1’s to 20.
25 seconds left…...
Complexity ©D.Moshkovits 1 Where Can We Draw The Line? On the Hardness of Satisfiability Problems.
Week 1.
We will resume in: 25 Minutes.
Less Than Matching Orgad Keller.
1 Unit 1 Kinematics Chapter 1 Day
Solution of a 20-Variable 3-SAT Problem on a DNA Computer R. S. Briach, N. Chelyapov, C. Johnson, P. W. K. Rothemund, L. Adleman 발표자 : 문승현.
How Cells Obtain Energy from Food
Theory of Computing Lecture 18 MAS 714 Hartmut Klauck.
Lecture 23. Subset Sum is NPC
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
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
CS Master – Introduction to the Theory of Computation Jan Maluszynski - HT Lecture NP-Completeness Jan Maluszynski, IDA, 2007
Lecture 22 More NPC problems
EMIS 8373: Integer Programming NP-Complete Problems updated 21 April 2009.
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.
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.
SUBSET-SUM Instance: A set of numbers denoted S and a target number t.
Computability Examples. Reducibility. NP completeness. Homework: Find other examples of NP complete problems.
The NP class. NP-completeness Lecture2. The NP-class The NP class is a class that contains all the problems that can be decided by a Non-Deterministic.
The NP class. NP-completeness
NP-Completeness (2) NP-Completeness Graphs 4/13/2018 5:22 AM x x x x x
Richard Anderson Lecture 26 NP-Completeness
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 Yin Tat Lee
CS21 Decidability and Tractability
Where Can We Draw The Line?
NP-Completeness (2) NP-Completeness Graphs 11/23/2018 2:12 PM x x x x
NP-Completeness Proofs
More NP-Complete Problems
NP-Completeness Yin Tat Lee
Trevor Brown DC 2338, Office hour M3-4pm
NP-Completeness (2) NP-Completeness Graphs 7/9/2019 6:12 AM x x x x x
Presentation transcript:

Complexity ©D.Moshkovitz 1 NPC More NP-Complete Problems

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

Complexity ©D.Moshkovitz 3 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 4 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 5 3SAT Instance: a 3CNF formula3CNF Problem: To decide if the formula is satisfiable. (x  y  z)  (x  y  z) (x  x  x)  (  x  x  x) A satifiable 3CNF formula An unsatifiable 3CNF formula

Complexity ©D.Moshkovitz 6 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? SIP

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

Complexity ©D.Moshkovitz 8 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 9 CNF  3CNF (x  y)  (x 1  x 2 ...  x t ) ... clauses with 1 or 2 literals (xyx)(xyx) replication clauses with more than 3 literals split (x 1  x 2  c 11 )  (  c 11  x 3  c 12 ) ...  (  c 1t-3  x t-1  x t )

Complexity ©D.Moshkovitz 10 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 11 CLIQUE Instance: A graph G=(V,E) and a threshold k. Problem: To decide if there is a set of nodes C={v 1,...,v k }  V, s.t for any u,v  C: (u,v)  E.

Complexity ©D.Moshkovitz 12 CLIQUE is in NP On input G=(V,E),k: Guess C={v 1,...,v k }  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(n 2 )

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

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

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

Complexity ©D.Moshkovitz 16 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 17 INDEPENDENT-SET Instance: A graph G=(V,E) and a goal k. Problem: To decide if there is a set of nodes I={v 1,...,v k }  V, s.t for any u,v  I: (u,v)  E.

Complexity ©D.Moshkovitz 18 INDEPENDENT-SET  NP On input G=(V,E),k: Guess I={v 1,...,v k }  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(n 2 )

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

Complexity ©D.Moshkovitz 20 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  Y y=t.

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

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

Complexity ©D.Moshkovitz 23 Satisfying Clauses c 1 c 2 …… c k digit per clause y i z i number per variable x i assigned true: number per variable x i assigned false: 1 if x i is in c j 0 otherwise 1 if  x i is in c j 0 otherwise

Complexity ©D.Moshkovitz 24 Achieving Target c 1 c 2 …… c k digit per clause target: 0<d<4

Complexity ©D.Moshkovitz 25 Achieving Target c 1 c 2 …… c k digit per clause target:3 1 1

Complexity ©D.Moshkovitz 26 Achieving Target c 1 c 2 … c k y1z1…ylzly1z1…ylzl make sure a good subset contains exactly one of y i and z i

Complexity ©D.Moshkovitz 27 Imposing Consistency c 1 c 2 … c k y1z1…ylzly1z1…ylzl

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

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

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

Complexity ©D.Moshkovitz 31 Observation: No Carry 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 32 Consistency Thus, to get 1 in the leftmost l digits, our subset necessarily contains either y i or z i (Not both!).

Complexity ©D.Moshkovitz 33 Satisfiablity In each column, at most 2 can come from the auxiliary numbers, so all clauses are satisfied.

Complexity ©D.Moshkovitz 34 Summing Up 1.SUBSET-SUM is in NP 2.3SAT  p SUBSET-SUM 3.Thus SUBSET-SUM is NP-Complete

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

Complexity ©D.Moshkovitz 36 Appendix

Complexity ©D.Moshkovitz 37 Dictionary 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) negation: not (  ) conjunction: and (  ) disjunction: or (  )