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.

Slides:



Advertisements
Similar presentations
NP-Hard Nattee Niparnan.
Advertisements

JAYASRI JETTI CHINMAYA KRISHNA SURYADEVARA
Polynomial-time reductions We have seen several reductions:
 2004 SDU Lecture17-P,NP, NPC.  2004 SDU 2 1.Decision problem and language decision problem decision problem and language 2.P and NP Definitions of.
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.
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
Graphs 4/16/2017 8:41 PM NP-Completeness.
NP-Complete Problems Reading Material: Chapter 10 Sections 1, 2, 3, and 4 only.
1 Polynomial Time Reductions Polynomial Computable function : For any computes in polynomial time.
The Theory of NP-Completeness
NP-Complete Problems Problems in Computer Science are classified into
Analysis of Algorithms CS 477/677
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.
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.
Approximation Algorithms Department of Mathematics and Computer Science Drexel University.
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.
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.
CSC401 – Analysis of Algorithms Chapter 13 NP-Completeness Objectives: Introduce the definitions of P and NP problems Introduce the definitions of NP-hard.
CSCI 3160 Design and Analysis of Algorithms Tutorial 10 Chengyu Lin.
1 The Theory of NP-Completeness 2 Cook ’ s Theorem (1971) Prof. Cook Toronto U. Receiving Turing Award (1982) Discussing difficult problems: worst case.
CSE 589 Part VI. Reading Skiena, Sections 5.5 and 6.8 CLR, chapter 37.
NP-Complete Problems. Running Time v.s. Input Size Concern with problems whose complexity may be described by exponential functions. Tractable problems.
NP-COMPLETE PROBLEMS. Admin  Two more assignments…  No office hours on tomorrow.
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.
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.
Chapter 11 Introduction to Computational Complexity Copyright © 2011 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1.
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
1 Ch 10 - NP-completeness Tractable and intractable problems Decision/Optimization problems Deterministic/NonDeterministic algorithms Classes P and NP.
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.
1 The Theory of NP-Completeness 2 Review: Finding lower bound by problem transformation Problem X reduces to problem Y (X  Y ) iff X can be solved by.
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.
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
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
NP-Completeness Proofs
Richard Anderson Lecture 26 NP-Completeness
Hard Problems Introduction to NP
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
Chapter 11 Limitations of Algorithm Power
NP-Complete Problems.
CS 3343: Analysis of Algorithms
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
Presentation transcript:

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

Reading Skiena, chapter 6 CLR, chapter 36

Easy vs. Hard Problems The standard definition of a tractable problem is one that can be solved in time that is polynomial in the size of the input. Why? Very few practical problems require time which is high-degree polynomial equivalent on different models of computation nice closure properties This class of problems called P. NP -- class of problems whose solution can be verified in polynomial time. Framed as “decision problems”. Many many many many many many many many many many important problems are in NP (in fact, NP-complete.)

Hardest problems in NP are NP- complete Provably NP-complete problems -- If any one can be solved in polynomial time, then all of them can. Right now, no known efficient algorithm known. Biggest open problem in CS: P = NP? Heuristics/approximation algorithms typically used. Sometimes solved exactly too -- depends on the application area.

Most notorious hard graph problem Traveling Salesman Problem Input description: A weighted graph G, B >= 0 Output description: Is there a cycle going through each of the vertices once of total cost at most B? Example: optimization of tool path for manufacturing equipment. E.g., robot arm assigned to solder all connections on printed circuit board.

Essence of NP-completeness We haven’t a clue, so when we’re given a problem we can’t solve efficiently, we try to find whether it is equivalent to other problems we can’t solve efficiently. Hundreds (thousands?) of equivalently hard NP-complete problems of immense practical importance. (scheduling, resource allocation, hardware design and test,……..)

Polynomial Time Reductions Let R and Q be two problems. We say that R is polynomially reducible to Q if there is a polynomial time algorithm that converts each input r to R to another input q to Q such that r is a yes-instance of R if and only if q is a yes- instance of Q. Theorem: If R is polynomially reducible to Q and there is a polynomial time algorithm for Q, then there is a polynomial time algorithm for R. Other Factoid: Polynomial reducibility is transitive.

Definitions, etc. NP : class of problems whose solutions can be verified in polynomial time. A problem Q is NP-hard if every problem in NP is polynomially reducible to Q. A problem Q is NP-complete if Q belongs to NP Q is NP-hard

Proving a Problem is NP-complete Cook proved that there exist NP-complete problems (satisfiability). Once we have one, can start blazing. To prove a problem Q is NP-complete show Q is in NP show R is polynomially reducible to Q, for some NP- complete problem R.

Remarkable Theorem of Steve Cook (1971) Proved that there exist NP-complete problems The Satisfiability problem is NP-complete. Satisfiability: Given a boolean formula in conjunctive normal form (and of ors), is there an assignment of the variables to 0’s and 1’s so that the resulting formula evaluates to 1? Example: (y 1 + y 3 + y 4 ) (y 2 + y 3 + y 4 ) (y 1 + y 2 + y 4 )

Idea of Proof In NP: easy. If a problem is in NP, there is a nondeterministic Turing machine that recognizes yes-instances. A Turing machine and all its operations on a given input can be described by a Boolean expression such that: Expression is satisfiable if and only if the Turing machine will terminate at an accepting state for given input. => any NP algorithm can be described by an instance of SAT

Some NP-complete Problems

Satisfiability Input description: Given a boolean formula in conjunctive normal form Problem description: Is there a truth assignment for the variables that causes the formula to evaluate to 1. Special case where every clause is disjunction of exactly 3 literals also NP complete (called 3-SAT) Example: digital design, hardware testing,….

Traveling Salesman Problem Input description: A weighted graph G, L Output description: Is there a tour of length at most L that visits each of the vertices exactly once. Optimization version: minimize the length of the tour.

Clique Input description: A graph G=(V,E), k Problem description: Is there a subset S of V of size at least k such that for all x,y in S, (x,y) in E. Optimization Version: Find maximum sized subset S.

Vertex Coloring Input description: A graph G=(V,E), k Problem description: Is it possible to color the vertices of the graph using at most k colors such that for each edge (i,j) in E, vertices i and j have different colors Optimization version: minimize the number of colors used. Example: Register allocation for compilers.

Independent Set Input description: A graph G=(V,E), k Problem description: Is there a subset S of V of size at least k such that no pair of vertices in S has an edge between them. Example: Identifying location for a new franchise service such that no two locations are close enough to compete with each other. Highest capacity code for given communication channel.

Hamiltonian Cycle Input description: A graph G=(V,E) Problem description: Is there an ordering of the vertices such that adjacent vertices in the ordering are connected by an edge and each vertex is visited exactly once. Example: Triangle strip problem.

Graph Partition Input description: A weighted graph G=(V,E) and integers j,k Problem description: Is there a partition of the vertices into two subsets such that each subset has size at most j, and the weight of edges connecting the two subsets is at most k. Example: VLSI layout

Steiner Tree Input description: A graph G=(V,E), a subset T of the vertices V, and a bound B Problem description: Is there a tree connecting all the vertices of T of total weight at most B? Example: Network design and wiring layout.

Integer Linear Programming Input description: A linear functional cx, a set of linear constraints Ax >= b, a set of non-negative variables x that can take on only integer values, say 0 or 1, a value V. Problem description: Are there 0/1 integer values for the variables x satisfying the linear constraints such that the linear functional cx <= V. Optimization version: minimize V. Example: absolutely everything

How you prove a problem Q is NP- complete. 1. Prove it’s in NP 2. Select a known NP-complete problem R. 3. Describe a polynomial time computable algorithm that computes a function f mapping every instance of R to some instance of Q. 4. Prove that for every yes-instance of R maps to a yes-instance of Q, and every no-instance of R maps to a no-instance of Q.

Remember showing a problem A is NP-complete is showing that you can use A to solve a known NP-complete problem

Let’s do some NP-completeness proofs Suppose somebody else has already shown that the following problems are NP-complete 3SAT Hamiltonian Cycle Vertex Cover

Let’s show the following problems are NP-complete Clique Independent Set Travelling Salesman Problem

Comments on NP-completeness proofs hardest part -- choosing a good problem from which to do reduction must do reduction from arbitrary instance common error -- backwards reduction. Remember that you are using your problem as a black box for solving known NPC problem freedom in reduction: if problem includes parameter, can set it in a convenient way size of problem can change as long as it doesn’t increase by more than polynomial

Comments cont. if problem is generalization of known NP-complete problem, reduction is usually easy. Example: Set Cover given U, set of elements, and collection S1, S2,.., Sn of subsets of U, and an integer k determine if there is a subset W of U of size at most k that intersects ever set Si Reduction from Vertex Cover U set of vertices Si is ith edge