CSC5160 Topics in Algorithms Tutorial 2 Introduction to NP-Complete Problems Feb 8 2007 Jerry Le

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
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 
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.
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.
Analysis of Algorithms CS 477/677
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,
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 24 Instructor: Paul Beame.
CSE 421 Algorithms Richard Anderson Lecture 27 NP Completeness.
CS Master – Introduction to the Theory of Computation Jan Maluszynski - HT Lecture NP-Completeness Jan Maluszynski, IDA, 2007
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.
The Theory of NP-Completeness 1. Nondeterministic algorithms A nondeterminstic algorithm consists of phase 1: guessing phase 2: checking If the checking.
The Theory of NP-Completeness 1. What is NP-completeness? Consider the circuit satisfiability problem Difficult to answer the decision problem in polynomial.
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.
Nattee Niparnan. Easy & Hard Problem What is “difficulty” of problem? Difficult for computer scientist to derive algorithm for the problem? Difficult.
Lecture 22 More NPC problems
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
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.
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.
CSCI 3160 Design and Analysis of Algorithms Tutorial 10 Chengyu Lin.
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.
1 Chapter 34: NP-Completeness. 2 About this Tutorial What is NP ? How to check if a problem is in NP ? Cook-Levin Theorem Showing one of the most difficult.
Lecture 6 NP Class. P = ? NP = ? PSPACE They are central problems in computational complexity.
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.
CSE 589 Part V One of the symptoms of an approaching nervous breakdown is the belief that one’s work is terribly important. Bertrand Russell.
CSCI-256 Data Structures & Algorithm Analysis Lecture Note: Some slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved. 29.
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.
1 CPSC 320: Intermediate Algorithm Design and Analysis July 30, 2014.
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
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.
The Theory of NP-Completeness 1. Nondeterministic algorithms A nondeterminstic algorithm consists of phase 1: guessing phase 2: checking If the checking.
COSC 3101A - Design and Analysis of Algorithms 14 NP-Completeness.
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.
TU/e Algorithms (2IL15) – Lecture 10 1 NP-Completeness, II.
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
NP-completeness Ch.34.
Richard Anderson Lectures NP-Completeness
Richard Anderson Lecture 26 NP-Completeness
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
Richard Anderson Lecture 26 NP-Completeness
NP-Completeness Yin Tat Lee
CS21 Decidability and Tractability
ICS 353: Design and Analysis of Algorithms
NP-Completeness (2) NP-Completeness Graphs 11/23/2018 2:12 PM x x x x
More NP-complete Problems
Richard Anderson Lecture 25 NP-Completeness
NP-Completeness Yin Tat Lee
NP-Completeness (2) NP-Completeness Graphs 7/9/2019 6:12 AM x x x x x
Lecture 23 NP-Hard Problems
Presentation transcript:

CSC5160 Topics in Algorithms Tutorial 2 Introduction to NP-Complete Problems Feb Jerry Le

Outline General definitions - P, NP, NP-hard, NP-easy, and NP-complete... - Polynomial-time reduction Examples of NP-complete problems

General Definitions P, NP, NP-hard, NP-easy, and NP-complete Problems - Decision problems (yes/no) - Optimization problems (solution with best score) P - Decision problems (decision problems) that can be solved in polynomial time - can be solved “efficiently” NP - Decision problems whose “YES” answer can be verified in polynomial time, if we already have the proof (or witness) co-NP - Decision problems whose “NO” answer can be verified in polynomial time, if we already have the proof (or witness)

General Definitions P, NP, NP-hard, NP-easy, and NP-complete e.g. The satisfiability problem (SAT) - Given a boolean formula is it possible to assign the input x 1...x 9, so that the formula evaluates to TRUE? - If the answer is YES with a proof (i.e. an assignment of input value), then we can check the proof in polynomial time (SAT is in NP) - We may not be able to check the NO answer in polynomial time (Nobody really knows.)

General Definitions P, NP, NP-hard, NP-easy, and NP-complete NP-hard - A problem is NP-hard iff an polynomial-time algorithm for it implies a polynomial-time algorithm for every problem in NP - NP-hard problems are at least as hard as NP problems NP-complete - A problem is NP-complete if it is NP-hard, and is an element of NP (NP-easy) Cook’s Theorem SAT is NP-hard SAT is NP-complete we knew SAT is in NP

General Definitions P, NP, NP-hard, NP-easy, and NP-complete Relationship between decision problems and optimization problems - every optimization problem has a corresponding decision problem - optimization: minimize x, subject to constraints - yes/no: is there a solution, such that x is less than c? - an optimization problem is NP-hard (NP-complete) if its corresponding decision problem is NP-hard (NP- complete)

General Definitions Polynomial-time reductions How to know another problem, A, is NP-complete? - To prove that A is NP-complete, reduce a known NP-complete problem to A Requirement for Reduction - Polynomial time - YES to A also implies YES to SAT, while NO to A also implies No to SAT (Note that A must also have short proof for YES answer) SATA solve A reduction in P(n) YES/NO

General Definitions Polynomial-time reductions An example of reduction - 3CNF - 3SAT: is a boolean formula in 3CNF has a feasible assignment of inputs so that it evaluates to TRUE? - reduction from 3SAT to SAT (3SAT is NP-complete) clause literal SAT3SAT solve 3SAT change into 3CNF (in polynomial time, without changing function value) YES/NO

Outline General definitions Examples of NP-complete problems - Vertex cover - Independent set - Set cover - Steiner tree...

Examples of NP-complete problems Vertex cover Vertex cover - given a graph G=(V,E), find the smallest number of vertexes that cover each edge - Decision problem: is the graph has a vertex cover of size K? - reduction: 3SAT with n variables and c clauses A constructive graph G YES/NO O(n) does G has a vertex cover of size n+2c?

Examples of NP-complete problems Vertex cover Vertex cover - an example of the constructive graph clause gadget variable gadget clause literal

Examples of NP-complete problems Vertex cover Vertex cover - we must prove: the graph has a n+2c vertex cover, if and only if the 3SAT is satisfiable (to make the two problem has the same YES/NO answer!) clause gadget variable gadget

Examples of NP-complete problems Vertex cover Vertex cover - if the graph has a n+2c vertex cover 1) there must be 1 vertex per variable gadget, and 2 per clause gadget 2) in each clause gadget, set the remaining one literal to be true clause gadget variable gadget

Examples of NP-complete problems Vertex cover Vertex cover - if the 3SAT is satisfiable 1) choose the TURE literal in each variable gadget 2) choose the remaining two literal in each clause gadget clause gadget variable gadget we are done

Examples of NP-complete problems Independent set Independent set - independent set: a set of vertices in the graph with no edges between each pair of nodes. - given a graph G=(V,E), find the largest independent set - reduction from vertex cover: smallest vertex cover S largest independent set V/S

Examples of NP-complete problems Independent set Independent set - if G has a vertex cover S, then V/S is an independent set proof: consider two nodes in V/S: if there is an edge connecting them, then one of them must be in S, which means one of them is not in V/S - if G has an independent set I, then V/I is a vertex cover proof: consider one edge in G: if it is not covered by any node in V/I, then its two end vertices must be both in I, which means I is not an independent set

Examples of NP-complete problems Set cover Set cover - given a universal set U, and several subsets S 1,...S n - find the least number of subsets that contains each elements in the universal set - vertex cover is a special case of set cover: 1) the universal set contains all the edges 2) each vertex corresponds to a subset, containing the edges it covers Vertex coverSet cover trivial

Examples of NP-complete problems Steiner tree Steiner tree - given a graph G=(V,E), and a subset C of V - find the minimum tree to connect each vertex in C - reduction Vertex cover for Graph GSteiner tree for graph G’ G’ (only edges with distance 1 are shown) G

Examples of NP-complete problems Steiner tree Steiner tree - G’ is a complete graph - for every node u in G, creat a node u in G’ - for every edge (u,v) in G, create a node (u,v) in G’ - in G’, every node (u,v) is connected to u and v with distance 1 - in G’, every node u and v is connected with distance 1 - other edges in G’ are of distance 2 G’ (only edges with distance 1 are shown) G

Examples of NP-complete problems Steiner tree Steiner tree - in the Steiner tree problem for G’, choose C to be the set of all nodes (u,v) - G’ has a minimum Steiner tree of cose m+k-1 iff G has a minimum vertex cover of size k G’ (only edges with distance 1 are shown) G

Examples of NP-complete problems Summary of some NPc problems SAT 3SAT Vertex cover Independent set Set cover Graph coloring Maximum clique size Minimum Steiner tree Hamiltonian cycle Maximum cut find more NP-complete problems in

Acknowledgement Some materials in these slides are from Dr. Jeff Erickson’s Lecture notes: algorithms/notes/21-nphard.pdfalgorithms/notes/21-nphard.pdf, which are the most intuitive and interesting lecture notes on NP-hardness I have ever seen.