1 NP-completeness Lecture 2: Jan 11. 2 P The class of problems that can be solved in polynomial time. e.g. gcd, shortest path, prime, etc. There are many.

Slides:



Advertisements
Similar presentations
NP-Hard Nattee Niparnan.
Advertisements

NP-Completeness: Reductions
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
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
Introduction to Approximation Algorithms Lecture 12: Mar 1.
Computability and Complexity 13-1 Computability and Complexity Andrei Bulatov The Class NP.
Graphs 4/16/2017 8:41 PM NP-Completeness.
NP and NP-completeness
NP-Complete Problems Reading Material: Chapter 10 Sections 1, 2, 3, and 4 only.
The Theory of NP-Completeness
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
NP-complete examples CSC3130 Tutorial 11 Xiao Linfu Department of Computer Science & Engineering Fall 2009.
NP-Completeness (2) NP-Completeness Graphs 4/17/2017 6:25 AM x x x x x
CSE 421 Algorithms Richard Anderson Lecture 27 NP Completeness.
Chapter 11: Limitations of Algorithmic Power
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 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.
MCS312: NP-completeness and Approximation Algorithms
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
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.
CSC401 – Analysis of Algorithms Chapter 13 NP-Completeness Objectives: Introduce the definitions of P and NP problems Introduce the definitions of NP-hard.
Techniques for Proving NP-Completeness Show that a special case of the problem you are interested in is NP- complete. For example: The problem of finding.
CSCI 3160 Design and Analysis of Algorithms Tutorial 10 Chengyu Lin.
Unit 9: Coping with NP-Completeness
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.
NP-COMPLETE PROBLEMS. Admin  Two more assignments…  No office hours on tomorrow.
CSE 421 Algorithms Richard Anderson Lecture 27 NP-Completeness and course wrap up.
1.1 Chapter 3: Proving NP-completeness Results Six Basic NP-Complete Problems Some Techniques for Proving NP-Completeness Some Suggested Exercises.
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.
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.
CSC 413/513: Intro to Algorithms
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.
Introduction to NP Instructor: Neelima Gupta 1.
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.
CSE 332: NP Completeness, Part II Richard Anderson Spring 2016.
ICS 353: Design and Analysis of Algorithms NP-Complete Problems King Fahd University of Petroleum & Minerals Information & Computer Science Department.
The Theory of NP-Completeness
NP-Completeness (2) NP-Completeness Graphs 4/13/2018 5:22 AM x x x x x
Introduction to Approximation Algorithms
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
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
Richard Anderson Lecture 28 NP-Completeness
Richard Anderson Lecture 26 NP-Completeness
NP-Completeness Yin Tat Lee
The Theory of NP-Completeness
NP-Completeness (2) NP-Completeness Graphs 7/9/2019 6:12 AM x x x x x
Hamiltonian Circuit (HC) problem
Presentation transcript:

1 NP-completeness Lecture 2: Jan 11

2 P The class of problems that can be solved in polynomial time. e.g. gcd, shortest path, prime, etc. There are many problems that we don’t know how to solve in polynomial time. e.g. factoring, polynomial identities, graph colouring, etc.

3 NP-completeness

4

5

6 Polynomial Time Reduction How to show that a problem R is not easier than a problem Q? Informally, if R can be solved efficiently, we can solve Q efficiently. Formally, we say Q polynomially reduces to R if: 1.Given an instance q of problem Q 2.There is a polynomial time transformation to an instance f(q) of R 3.q is a “yes” instance if and only if f(q) is a “yes” instance Then, if R is polynomial time solvable, then Q is polynomial time solvable. If Q is not polynomial time solvable, then R is not polynomial time solvable.

7 First Example Clique: a subset of vertices S so that for every two vertices u,v in S are joined by an edge. Instance: A graph G=(V,E) and a positive integer k. Question: Is there a clique of size k or more for G? Independent set: a subset of vertices S so that for every two vertices u,v in S are joined by an edge. Instance: A graph G=(V,E) and a positive integer k. Question: Is there an independent of size k or more for G?

8 First Example Instance: A set X and a size s(x) for each x in X. Question: Is there a subset X’ X such that Instance: A set X and a size s(x) for each x in X, and an integer B. Question: Is there a subset X’ X such that PARTITION SUBSET-SUM

9 First Example Instance: A graph G=(V,E). Question: Does G contains a Hamiltonian cycle, i.e. a cycle which visits every vertex exactly once? Instance: A graph G=(V,E). Question: Does G contains a Hamiltonian path, i.e. a path which visits every vertex exactly once? HAMILTONIAN CYCLE HAMILTONIAN PATH

10 NP Two equivalent definitions: Given a solution, we can check in polynomial time whether it is correct. There is a non-deterministic algorithm (a magic algorithm) that can guess the solution and check if it is correct in polynomial time. P is the class of problems that we can find a solution in polynomial time. NP (Non-deterministic polynomial time): A class of decision problems whose solutions can be “verified” in polynomial time. For each “yes” instance, there is a proof that can be checked in polynomial time.

11 Cook’s Theorem Instance: A set of boolean variables and a set of clauses. Question: Is there a truth assignment that satisfies all the clauses? Satisfiability (SAT) (Cook 1970) If one can solve satisfiability in polynomial time, then one can solve all problems in NP in polynomial time.

12 NP-completeness A problem Q is NP-complete if Q is in NP, and if Q can be solved in polynomial time => every problem in NP can be solved in polynomial time. Then Q is the “hardest” problem in NP. Cook’s theorem (1970): SAT is NP-complete. To show a problem Q is NP-complete: show that Q is in NP show that an NPc problem <= Q

13 3-SAT Instance: Collection C = {c1, c2, …, cm} of clauses on a set U of variables such that |ci| = 3 for all 1 <= i <= m. Question: Is there a truth assignment for U that satisfies all the clauses in C? SAT <= 3SAT

14 Vertex Cover Instance: A graph G=(V,E) and a positive integer k. Question: Is there a vertex cover of size k or less for G? Vertex cover: a subset of vertices S so that for every edge (u,v), at least one of u and v belongs to S. 3SAT <= VERTEX COVER

15 Clique Clique: a subset of vertices S so that for every two vertices u,v in S are joined by an edge. Instance: A graph G=(V,E) and a positive integer k. Question: Is there a clique of size k or more for G? VERTEX COVER <= CLIQUE

16 3D Matching Instance: A set M W x X x Y, where W, X, and Y are disjoint sets having the same number q of elements. Question: Does M contains a matching, a subset M’ M such that |M’|=q and no two elements of M’ agree in any coordinate? 3SAT <= 3DM

17 Partition Instance: A set X and a size s(x) for each x in X. Question: Is there a subset X’ X such that 3DM <= PARTITION

18 Hamiltonia Cycle Instance: A graph G=(V,E). Question: Does G contains a Hamiltonian cycle, i.e. a cycle which visits every vertex exactly once? VERTEX COVER <= HAMILTONIAN CYCLE

19 Techniques 1.Restriction Show that a special case is already NP-complete. 2.Local replacement Replace each basic unit by a different structure. 3.Component design Design “components” with specific functionality.

20 Minimum Cover Instance: Collection C of subsets of a set S, and a positive integer k. Question: Does C contains a cover for S of size k or less, that is, a subset C’ C with |C’| <= k and ? 3DM <= Minimum Cover

21 Subgraph Isomorphism Instance: Two graphs G = (V1,E1) and H = (V2,E2). Question: Does G contain a subgraph isomorphic to H? Two graphs G1 = (V1,E1) and G2 = (V2,E2) are isomorphic if  bijection f: V 1 → V 2 u —v in E 1 iff f (u)—f (v) in E 2 Clique <= Subgraph Isomorphism

22 Bounded Degree Spanning Tree Instance: A graph G=(V,E) and a positive integer k. Question: Is there a spanning tree for G in which no vertex has degree > k? A spanning tree is a connected subgraph with |V|-1 edges. Hamiltonian path <= Bounded degree spanning tree

23 Partition into Triangles Instance: A graph G=(V,E) with |V|=3q vertices. Question: Is there a partition of V into q disjoint sets V1, V2, …, Vq of three vertices so that each Vi is a triangle? 3DM <= Partition into Triangles

24 Sequencing within Intervals Instance: A set T of jobs, each has a release time r(t), a deadline d(t) and a length l(t). Question: Does there exist a feasible schedule for T? Partition <= Sequencing within Intervals

25 Open Problems Instance: Two graphs G = (V1,E1) and H = (V2,E2). Question: Is G isomorphic to H? Instance: Given a number k. Question: Is k = p x q for p > 1 and q > 1? Graph Isomorphism Composite Number

26 Conclusion Why people believe that P NP? I can appreciate good music (being able to verify solutions) doesn’t mean that I can compose good music (to find solutions). (from wikipedia) "Proof by contradiction. Assume P = NP. Let y be a proof that P = NP. The proof y can be verified in polynomial time by a competent computer scientist, the existence of which we assert. However, since P = NP, the proof y can be generated in polynomial time by such computer scientists. Since this generation has not yet occurred (despite attempts by such computer scientists to produce a proof), we have a contradiction."