1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 24 Instructor: Paul Beame.

Slides:



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

Polynomial-time reductions We have seen several reductions:
NP-Completeness: Reductions
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.
1 NP-Complete Problems. 2 We discuss some hard problems:  how hard? (computational complexity)  what makes them hard?  any solutions? Definitions 
CSC5160 Topics in Algorithms Tutorial 2 Introduction to NP-Complete Problems Feb Jerry Le
Complexity 11-1 Complexity Andrei Bulatov NP-Completeness.
CS21 Decidability and Tractability
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.
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 21 Instructor: Paul Beame.
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.
Last class Decision/Optimization 3-SAT  Independent-Set Independent-Set  3-SAT P, NP Cook’s Theorem NP-hard, NP-complete 3-SAT  Clique, Subset-Sum,
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.
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 22 Instructor: Paul Beame.
Clique Cover Cook’s Theorem 3SAT and Independent Set
Lecture 22 More NPC problems
CSEP 521 Applied Algorithms Richard Anderson Lecture 10 NP Completeness.
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
NP-complete Problems SAT 3SAT Independent Set Hamiltonian Cycle
1 Computational Complexity Classify problems according to the amount of computational resources used by the best algorithms that solve them Recall: worst-case.
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.
CSCI-256 Data Structures & Algorithm Analysis Lecture Note: Some slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved. 33.
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.
May 9, New Topic The complexity of counting.
NP-Complete Problems. Running Time v.s. Input Size Concern with problems whose complexity may be described by exponential functions. Tractable problems.
Lecture 6 NP Class. P = ? NP = ? PSPACE They are central problems in computational complexity.
CS 3343: Analysis of Algorithms Lecture 25: P and NP Some slides courtesy of Carola Wenk.
CSCI 3130: Formal languages and automata theory Andrej Bogdanov The Chinese University of Hong Kong The Cook-Levin.
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.
CS6045: Advanced Algorithms NP Completeness. NP-Completeness Some problems are intractable: as they grow large, we are unable to solve them in reasonable.
Lecture 25 NP Class. P = ? NP = ? PSPACE They are central problems in computational complexity.
28.
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
NP-Completeness Note. Some illustrations are taken from (KT) Kleinberg and Tardos. Algorithm Design (DPV)Dasgupta, Papadimitriou, and Vazirani. Algorithms.
Complexity ©D.Moshkovits 1 2-Satisfiability NOTE: These slides were created by Muli Safra, from OPICS/sat/)
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.
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong NP-complete.
Prof. Busch - LSU1 Busch Complexity Lectures: More NP-complete Problems.
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.
Computability Examples. Reducibility. NP completeness. Homework: Find other examples of NP complete problems.
 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
CSE 332: NP Completeness, Part II Richard Anderson Spring 2016.
TU/e Algorithms (2IL15) – Lecture 10 1 NP-Completeness, II.
Richard Anderson Lectures NP-Completeness
Richard Anderson Lecture 26 NP-Completeness
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?
More NP-complete Problems
Richard Anderson Lecture 25 NP-Completeness
Richard Anderson Lecture 28 NP-Completeness
NP-Completeness Yin Tat Lee
NP-Completeness Yin Tat Lee
More on NP-completeness
CS21 Decidability and Tractability
Lecture 23 NP-Hard Problems
Presentation transcript:

1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 24 Instructor: Paul Beame

2 Steps to Proving Problem R is NP-complete  Show R is NP-hard:  State:`Reduction is from NP-hard Problem L’  Show what the map is  Argue that the map is polynomial time  Argue correctness: two directions Yes for L implies Yes for R and vice versa.  Show R is in NP  State what hint is and why it works  Argue that it is polynomial-time to check.

3 Problems we already know are NP-complete  Satisfiability  Independent-Set  Clique  Vertex Cover  There are 1000’s of practical problems that are NP-complete, e.g. scheduling, optimal VLSI layout etc.

4 A particularly useful problem for proving NP-completeness  3-SAT: Given a CNF formula F having precisely 3 variables per clause (i.e., in 3-CNF), is F satisfiable?  Claim: 3-SAT is NP-complete  Proof:  3-SAT  NP  Hint is a satisfying assignment  Just like Satisfiability it is polynomial-time to check the hint

5 Satisfiability  p 3-SAT  Reduction:  mapping CNF formula F to another CNF formula G that has precisely 3 variables per clause.  G has one or more clauses for each clause of F  G will have extra variables that don’t appear in F for each clause C of F there will be a different set of variables that are used only in the clauses of G that correspond to C

6 Satisfiability  p 3-SAT  Goal:  An assignment A to the original variables makes clause C true in F iff there is an assignment to the extra variables that together with the assignment A will make all new clauses corresponding to C true.  Define the reduction clause-by-clause  We’ll use variable names z j to denote the extra variables related to a single clause C to simplify notation  in reality, two different original clauses will not share z j

7 Satisfiability  p 3-SAT  For each clause C in F:  If C has 3 variables:  Put C in G as is  If C has 2 variables, e.g. C=(x 1   x 3 )  Use a new variable z and put two clauses in G (x 1   x 3  z)  (x 1   x 3   z)  If original C is true under assignment A then both new clauses will be true under A  If new clauses are both true under some assignment B then the value of z doesn’t help in one of the two clauses so C must be true under B

8 Satisfiability  p 3-SAT  If C has 1 variables: e.g. C=x 1  Use two new variables z 1, z 2 and put 4 new clauses in G (x 1   z 1   z 2 )  (x 1   z 1  z 2 )  (x 1  z 1   z 2 )  (x 1  z 1  z 2 )  If original C is true under assignment A then all new clauses will be true under A  If new clauses are all true under some assignment B then the values of z 1 and z 2 doesn’t help in one of the 4 clauses so C must be true under B

9 Satisfiability  p 3-SAT  If C has k  4 variables: e.g. C=(x 1 ...  x k )  Use k-3 new variables z 2,...,z k-2 and put k-2 new clauses in G (x 1  x 2  z 2 )  (  z 2  x 3  z 3 )  (  z 3  x 4  z 4 ) ...  (  z k-3  x k-2  z k-2 )  (  z k-2  x k-1  x k )  If original C is true under assignment A then some x i is true for i  k. By setting z j true for all j<i and false for all j  i, we can extend A to make all new clauses true.  If new clauses are all true under some assignment B then some x i must be true for i  k because z 2  (  z 2  z 3 ) ...  (  z k-3  z k-2 )   z k-2 is not satisfiable

10 Graph Colorability  Defn: Given a graph G=(V,E), and an integer k, a k-coloring of G is  an assignment of up to k different colors to the vertices of G so that the endpoints of each edge have different colors.  3-Color: Given a graph G=(V,E), does G have a 3-coloring?  Claim: 3-Color is NP-complete  Proof: 3-Color is in NP:  Hint is an assignment of red,green,blue to the vertices of G  Easy to check that each edge is colored correctly

11 3-SAT  p 3-Color  Reduction:  We want to map a 3-CNF formula F to a graph G so that  G is 3-colorable iff F is satisfiable

12 3-SAT  p 3-Color O T F Base Triangle

13 3-SAT  p 3-Color O T F x1x1 x1x1 x2x2 xnxn... x2x2 xnxn Variable Part: in 3-coloring, variable colors correspond to some truth assignment (same color as T or F)

14 3-SAT  p 3-Color O T F x1x1 x1x1 x2x2 xnxn... x2x2 xnxn Clause Part: Add one 6 vertex gadget per clause connecting its ‘outer vertices’ to the literals in the clause (  x 1  x 2  x n ) (x 1  x 3  x 6 )

15 3-SAT  p 3-Color O T F x1x1 x1x1 x2x2 xnxn... x2x2 xnxn (  x 1  x 2  x n ) (x 1  x 3  x 6 ) Any truth assignment satisfying the formula can be extended to a 3-coloring of the graph T F O O T F O

16 3-SAT  p 3-Color O T F x1x1 x1x1 x2x2 xnxn... x2x2 xnxn (  x 1  x 2  x n ) (x 1  x 3  x 6 ) Any 3-coloring of the graph colors each gadget triangle using each color O F T

17 3-SAT  p 3-Color O T F x1x1 x1x1 x2x2 xnxn... x2x2 xnxn (  x 1  x 2  x n ) (x 1  x 3  x 6 ) Any 3-coloring of the graph has an F opposite the O color in the triangle of each gadget O F T F

18 3-SAT  p 3-Color O T F x1x1 x1x1 x2x2 xnxn... x2x2 xnxn (  x 1  x 2  x n ) (x 1  x 3  x 6 ) Any 3-coloring of the graph has T at the other end of the blue edge connected to the F O F T F T

19 3-SAT  p 3-Color O T F x1x1 x1x1 x2x2 xnxn... x2x2 xnxn (  x 1  x 2  x n ) (x 1  x 3  x 6 ) Any 3-coloring of the graph yields a satisfying assignment to the formula O F T F T