1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 23 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:
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
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
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.
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-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.
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 22 Instructor: Paul Beame.
Clique Cover Cook’s Theorem 3SAT and Independent Set
1 The Theory of NP-Completeness 2 NP P NPC NP: Non-deterministic Polynomial P: Polynomial NPC: Non-deterministic Polynomial Complete P=NP? X = P.
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.
Lecture 22 More NPC problems
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.
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.
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.
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-256 Data Structures & Algorithm Analysis Lecture Note: Some slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved. 29.
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.
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.
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.
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.
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.
Prof. Busch - LSU1 Busch Complexity Lectures: More NP-complete Problems.
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.
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.
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
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
NP-Completeness (36.4-5) P: yes and no in pt NP: yes in pt NPH  NPC
NP-Completeness Yin Tat Lee
CS21 Decidability and Tractability
Richard Anderson Lecture 28 NP-Completeness
Richard Anderson Lecture 26 NP-Completeness
NP-Completeness Yin Tat Lee
CS21 Decidability and Tractability
CSE 6408 Advanced Algorithms.
NP-Completeness Yin Tat Lee
CSE 589 Applied Algorithms Spring 1999
Instructor: Aaron Roth
Presentation transcript:

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

2 Polynomial-time reduction L  p R inputs for Linputs for R x y T computable by a program in polynomial-time yes no L answers yes to x  R answers yes to T(x)

3 e.g., Independent-Set  p Clique  Define reduction T, that maps to, where G is the complement graph of G, i.e. G has an edge exactly when G doesn’t.  Clearly polynomial time.  Correctness  is a YES for Independent-Set  iff there is a subset U of the vertex set of G with |U|  k such that no two vertices in U are joined by an edge in G  iff there is a subset U of the vertex set of G with |U|  k such that every pair of vertices in U is joined by an edge in G  iff is a YES for Clique

4 NP-hardness & NP-completeness  Definition: A problem R is NP-hard iff every problem L  NP satisfies L  p R  Definition: A problem R is NP-complete iff R is NP-hard and R  NP  Not obvious that such problems even exist!

5 Properties of polynomial-time reductions  Theorem: If L  p R and R is in P then L is also in P  Theorem: If L  p R and R  p S then L  p S  Proof idea:  Compose the reduction T from L to R with the reduction T’ from R to S to get a new reduction T’’(x)=T’(T(x)) from L to S.

6 Cook’s Theorem& implications  Theorem (Cook 1971): Satisfiability is NP-complete  Corollary: R is NP-hard iff Satisfiability  p R (or Q  p R for any NP-complete problem Q)  Proof:  If R is NP-hard then every problem in NP polynomial- time reduces to R, in particular Satisfiability does since it is in NP  For any problem L in NP, L  p Satisfiability and so if Satisfiability  p R we have L  p R.  therefore R is NP-hard if Satisfiability  p R

7 Another NP-complete problem: Satisfiability  p Independent-Set  Reduction:  mapping CNF formula F to a pair  Let m be the number of clauses of F  Create a vertex in G for each literal in F  Join two vertices u, v in G by an edge iff  u and v correspond to literals in the same clause of F, (green edges) or  u and v correspond to literals x and  x (or vice versa) for some variable x. (red edges).  Set k=m  Clearly polynomial-time

8 Satisfiability  p Independent-Set F: (x 1   x 3  x 4 )  ( x 2   x 4  x 3 )  ( x 2   x 1  x 3 ) x1x1 x3x3 x4x4 x1x1 x2x2 x2x2 x4x4 x3x3 x3x3

9 Satisfiability  p Independent-Set  Correctness:  If F is satisfiable then there is some assignment that satisfies at least one literal in each clause.  Consider the set U in G corresponding to the first satisfied literal in each clause.  |U|=m  Since U has only one vertex per clause, no two vertices in U are joined by green edges  Since a truth assignment never satisfies both x and  x, U doesn’t contain vertices labeled both x and  x and so no vertices in U are joined by red edges  Therefore G has an independent set, U, of size at least m  Therefore is a YES for independent set.

10 Satisfiability  p Independent-Set F: (x 1   x 3  x 4 )  ( x 2   x 4  x 3 )  ( x 2   x 1  x 3 ) x1x1 x3x3 x4x4 x1x1 x2x2 x2x2 x4x4 x3x3 x3x Given assignment x 1 =x 2 =x 3 =x 4 =1, U is as circled U

11 Satisfiability  p Independent-Set  Correctness continued:  If is a YES for Independent-Set then there is a set U of m vertices in G containing no edge.  Therefore U has precisely one vertex per clause because of the green edges in G.  Because of the red edges in G, U does not contain vertices labeled both x and  x  Build a truth assignment A that makes all literals labeling vertices in U true and for any variable not labeling a vertex in U, assigns its truth value arbitrarily.  By construction, A satisfies F  Therefore F is a YES for Satisfiability.

12 Satisfiability  p Independent-Set F: (x 1   x 3  x 4 )  ( x 2   x 4  x 3 )  ( x 2   x 1  x 3 ) x1x1 x3x3 x4x4 x1x1 x2x2 x2x2 x4x4 x3x3 x3x3 Given U, satisfying assignment is x 1 =x 3 =x 4 =0, x 2 =0 or ? 1 0 ? 1 0

13 Independent-Set is NP- complete  We just showed that Independent-Set is NP- hard and we already knew Independent-Set is in NP.  Corollary: Clique is NP-complete  We showed already that Independent-Set  p Clique and Clique is in NP.

14 Vertex Cover  Given an undirected graph G=(V,E) and an integer k is there a subset W of V of size at most k such that every edge of G has at least one endpoint in W? (i.e. W covers all vertices of G).  Observation:  W is a vertex cover of G iff every vertex in V-W has at most one endpoint of any edge in G, i.e. V-W is independent. W is a vertex cover V-W is an independent set

15 Independent-Set  p Vertex Cover  Reduction:  Map to.  Correctness follows from Observation  Polynomial-time  Vertex Cover is in NP  Hint is the cover set W.  Polynomial-time to check.  Vertex Cover is NP-complete

16 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.