NP-complete Problem Prof. S M Lee Department of Computer Science.

Slides:



Advertisements
Similar presentations
Problems and Their Classes
Advertisements

What is Intractable? Some problems seem too hard to solve efficiently. Question 1: Does an efficient algorithm exist?  An O(a ) algorithm, where a > 1,
NP-complete and NP-hard problems Transitivity of polynomial-time many-one reductions Concept of Completeness and hardness for a complexity class Definition.
Great Theoretical Ideas in Computer Science for Some.
Computability and Complexity 13-1 Computability and Complexity Andrei Bulatov The Class NP.
Computational problems, algorithms, runtime, hardness
CSE332: Data Abstractions Lecture 27: A Few Words on NP Dan Grossman Spring 2010.
CPSC 411, Fall 2008: Set 12 1 CPSC 411 Design and Analysis of Algorithms Set 12: Undecidability Prof. Jennifer Welch Fall 2008.
Hardness Results for Problems P: Class of “easy to solve” problems Absolute hardness results Relative hardness results –Reduction technique.
NP-complete and NP-hard problems Transitivity of polynomial-time many-one reductions Definition of complexity class NP –Nondeterministic computation –Problems.
Graphs 4/16/2017 8:41 PM NP-Completeness.
1 Introduction to Linear and Integer Programming Lecture 9: Feb 14.
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.
The Theory of NP-Completeness
NP-complete and NP-hard problems
Analysis of Algorithms CS 477/677
NP-Completeness NP-Completeness Graphs 4/17/2017 4:10 AM x x x x x x x
Computational Complexity, Physical Mapping III + Perl CIS 667 March 4, 2004.
Chapter 11: Limitations of Algorithmic Power
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 22 Instructor: Paul Beame.
Halting Problem. Background - Halting Problem Common error: Program goes into an infinite loop. Wouldn’t it be nice to have a tool that would warn us.
1.1 Chapter 1: Introduction What is the course all about? Problems, instances and algorithms Running time v.s. computational complexity General description.
Programming & Data Structures
MCS312: NP-completeness and Approximation Algorithms
CMPS 3223 Theory of Computation Automata, Computability, & Complexity by Elaine Rich ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Slides provided.
Nattee Niparnan. Easy & Hard Problem What is “difficulty” of problem? Difficult for computer scientist to derive algorithm for the problem? Difficult.
Complexity Classes (Ch. 34) The class P: class of problems that can be solved in time that is polynomial in the size of the input, n. if input size is.
Theory of Computing Lecture 15 MAS 714 Hartmut Klauck.
Tonga Institute of Higher Education Design and Analysis of Algorithms IT 254 Lecture 8: Complexity Theory.
The Complexity of Optimization Problems. Summary -Complexity of algorithms and problems -Complexity classes: P and NP -Reducibility -Karp reducibility.
Integer Programming I.5. Computational Complexity  Nemhauser and Wolsey, p Ref: Computers and Intractability: A Guide to the Theory of NP-
Approximation Algorithms
CSC 413/513: Intro to Algorithms NP Completeness.
CSC 172 P, NP, Etc. “Computer Science is a science of abstraction – creating the right model for thinking about a problem and devising the appropriate.
Week 10Complexity of Algorithms1 Hard Computational Problems Some computational problems are hard Despite a numerous attempts we do not know any efficient.
Complexity Non-determinism. NP complete problems. Does P=NP? Origami. Homework: continue on postings.
CSE 3813 Introduction to Formal Languages and Automata Chapter 14 An Introduction to Computational Complexity These class notes are based on material from.
EMIS 8373: Integer Programming NP-Complete Problems updated 21 April 2009.
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.
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.
Lecture 6 NP Class. P = ? NP = ? PSPACE They are central problems in computational complexity.
NP-complete Problems Prof. Sin-Min Lee Department of Computer Science.
NP-Complete Problems Algorithm : Design & Analysis [23]
Automata & Formal Languages, Feodor F. Dragan, Kent State University 1 CHAPTER 7 Time complexity Contents Measuring Complexity Big-O and small-o notation.
Strings Basic data type in computational biology A string is an ordered succession of characters or symbols from a finite set called an alphabet Sequence.
CPS Computational problems, algorithms, runtime, hardness (a ridiculously brief introduction to theoretical computer science) Vincent Conitzer.
CS6045: Advanced Algorithms NP Completeness. NP-Completeness Some problems are intractable: as they grow large, we are unable to solve them in reasonable.
Donghyun (David) Kim Department of Mathematics and Computer Science North Carolina Central University 1 Chapter 7 Time Complexity Some slides are in courtesy.
NP-Completness Turing Machine. Hard problems There are many many important problems for which no polynomial algorithms is known. We show that a polynomial-time.
NP-Completeness  For convenience, the theory of NP - Completeness is designed for decision problems (i.e. whose solution is either yes or no).  Abstractly,
Chapter 11 Introduction to Computational Complexity Copyright © 2011 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1.
Chapter 15 P, NP, and Cook’s Theorem. 2 Computability Theory n Establishes whether decision problems are (only) theoretically decidable, i.e., decides.
Young CS 331 D&A of Algo. NP-Completeness1 NP-Completeness Reference: Computers and Intractability: A Guide to the Theory of NP-Completeness by Garey and.
Lecture. Today Problem set 9 out (due next Thursday) Topics: –Complexity Theory –Optimization versus Decision Problems –P and NP –Efficient Verification.
Introduction to NP Instructor: Neelima Gupta 1.
1 1. Which of these sequences correspond to Hamilton cycles in the graph? (a) (b) (c) (d) (e)
1 P and NP. 2 Introduction The Traveling Salesperson problem and thousands of other problems are equally hard in the sense that if we had an efficient.
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.
Great Theoretical Ideas in Computer Science.
The NP class. NP-completeness
Chapter 10 NP-Complete Problems.
RAJALAKSHMI ENGINEERING COLLEGE
Analysis and design of algorithm
1. for (i=0; i < n; i+=2) if (A[i] > A[i+1]) swap(A[i], A[i+1])
NP-Completeness Reference: Computers and Intractability: A Guide to the Theory of NP-Completeness by Garey and Johnson, W.H. Freeman and Company, 1979.
4-9问题的形式化描述.
The Polynomial Hierarchy Enumeration Problems 7.3.3
Presentation transcript:

NP-complete Problem Prof. S M Lee Department of Computer Science

Decision Problems To keep things simple, we will mainly concern ourselves with decision problems. These problems only require a single bit output: ``yes'' and ``no''. How would you solve the following decision problems? Is this directed graph acyclic? Is there a spanning tree of this undirected graph with total weight less than w? Does this bipartite graph have a perfect (all nodes matched) matching? Does the pattern p appear as a substring in text t?

P P is the set of decision problems that can be solved in worst-case polynomial time: If the input is of size n, the running time must be O(nk). Note that k can depend on the problem class, but not the particular instance. All the decision problems mentioned above are in P.

Nice Puzzle The class NP (meaning non-deterministic polynomial time) is the set of problems that might appear in a puzzle magazine: ``Nice puzzle.'' What makes these problems special is that they might be hard to solve, but a short answer can always be printed in the back, and it is easy to see that the answer is correct once you see it. Example... Does matrix A have an LU decomposition? No guarantee if answer is ``no''.

NP Technically speaking: A problem is in NP if it has a short accepting certificate. An accepting certificate is something that we can use to quickly show that the answer is ``yes'' (if it is yes). Quickly means in polynomial time. Short means polynomial size. This means that all problems in P are in NP (since we don't even need a certificate to quickly show the answer is ``yes''). But other problems in NP may not be in P. Given an integer x, is it composite? How do we know this is in NP?

Good Guessing Another way of thinking of NP is it is the set of problems that can solved efficiently by a really good guesser. The guesser essentially picks the accepting certificate out of the air (Non-deterministic Polynomial time). It can then convince itself that it is correct using a polynomial time algorithm. (Like a right-brain, left-brain sort of thing.) Clearly this isn't a practically useful characterization: how could we build such a machine?

Exponential Upperbound Another useful property of the class NP is that all NP problems can be solved in exponential time (EXP). This is because we can always list out all short certificates in exponential time and check all O(2nk) of them. Thus, P is in NP, and NP is in EXP. Although we know that P is not equal to EXP, it is possible that NP = P, or EXP, or neither. Frustrating!

NP-hardness As we will see, some problems are at least as hard to solve as any problem in NP. We call such problems NP-hard. How might we argue that problem X is at least as hard (to within a polynomial factor) as problem Y? If X is at least as hard as Y, how would we expect an algorithm that is able to solve X to behave?

HARD AND EASY PROBLEMS (a very informal introduction) Good starting points for precise definitions and formal introduction are Papadimitriou: Computational Complexity, Adison-Wesley, 1994 Garey and Johnson: Computers and Intractability, Freeman 1979 Schrijver: Theory of Linear and Integer Programming, Wiley, 1986, (Chapter 2) P: Collection Z of problems is in P (polynomial-time solvable) if there exists a polynomial-time algorithm that solves any problem in Z, i.e, the algorithm that requires at most f(s) basic steps where s=size of the input and f is a polynomial. NP: Collection Z of decision problems is in NP (nondeterministic polynomial- time solvable) if there exists a polynomial time algorithm to check the correctness of the YES answer. co-NP: replace YES by NO in the above definition.

One of the central (and widely and intensively studied 30 years) problems of (theoretical) computer science is to prove that (a) P  NP (b) NP  co-NP.  All evidence indicates that these conjectures are true.  Disproving any of these two conjectures would not only be considered truly spectacular, but would also come as a tremendous surprise (with a variety of far- reaching counterintuitive consequences). NP-complete: Collection Z of problems is NP-complete if (a) it is NP and (b) if polynomial-time algorithm existed for solving problems in Z, then P=NP. P NP co-NP

Theorem. (Karp-Papadimitriou, ‘80) If collection Z of membership problems is NP-complete, then either (1) NP=co-NP or (2) CLDs for Z cannot be described (in terms of giving a finite number of classes/rules for defining halfspaces from CLD). Precise definitions of what form of description is ruled out (unless NP=co-NP) by the theorem can be found in Karp and Papadimitriou: “On linear characterization of combinatorial optimization problems”, SIAM Journal on Computing 11(1982), Also, Chapter 18 of Schrijver’s Theory of Linear and Integer Programming (Wiley, 1986) has a discussion of the result. (The result is often stated in terms of the class of all possible “rational” polyhedra. However, focusing on any NP-complete class is equivalent to studying the general class.)

Membership Problem for S Linear Optimization Problem for S INPUT: y  R d INPUT: w  R d  Is y  S ?  Find max { w ·s | s  S }. Theorem. (Groetschel, Lovasz, Schrijver ‘88) The complexity class of any collection Z M of membership problems is equal to the complexity class of the collection Z LO of the corresponding linear optimization problems. The details can be found in Groetschel, Lovasz,Schrijver: Geometric Algorithms and Combinatorial Optimization, Springer- Verlag, 1998, Also, see Chapter 14 of Schrijver’s Theory of Linear and Integer Programming (Wiley, 1986) for the overview of the result and its widespread implications.

EXAMPLE: BINARY CHOICE  D= { {a  b} | {a,b}  C } (note that d=|D|=n(n- 1 )/ 2 )  Binary Choice Polytope P BC (n) = the convex hull of { x i | i=1,…,n! } Define Z={P BC (n), n =1,2,3,… } Theorem. The collection Z LO of linear optimization problems on polytopes from Z is NP- complete.  Thus, by GLS Theorem, Z M is NP-complete.  Thus, by KP Theorem, There is no hope for finding CLD for Binary Choice Polytope.

EXAMPLE: MULTIPLE CHOICE  D= { {a  b: b  B\{a}} | (a,B) such that a  B  C } (note that d = |D| = n2 n-1 )  Multiple Choice Polytope P MC (n) = the convex hull of { x i | i=1,…,n! } Define Z={P MC (n), n =1,2,3,… } Theorem. The collection Z LO of linear optimization problems on polytopes from Z is in P.  Thus, by GLS Theorem, Z M is in P.  Thus, KP Theorem is not restrictive in this case. (In fact, CLD given by Falmagne ‘79)

Linear Optimization on P MC (n) is easy. INPUT: w  R d Find max { f(s)= w ·s | s  P MC (n) }.  max attained at some extreme point of P MC (n), i.e., at some x i (that represents R i ). 

Dynamic Programming: For every a  C do Value({a}): = w (a,{a}) For i=2…n, do For every B such that |B|=i, do Find  Value(C ) is the solution to the linear optimization problem.  Inside loop requires at most Ki2 i steps for some const. K.  There are <2 n repetitions of the inside loop. Thus the algorithm needs at most K’(n2 n ) 2 steps.  In terms of the input size d=n2 n-1 : The algorithm requires at most Ld 2 steps for some const. L. (These are very crude estimates, but we don’t have to be precise for our purpose here)  Linear Optimization on P MC (n) can be done in polynomial time

The prob.distr. over the set of all n! rankings explains the data Given the set of queries D:  If the number of queries d < f(n) for some polynomial f, finding CLD for the corresponding polytope is likely to be hopeless.  If the number of queries d > Ka n, there is hope. Exercise: Show that the linear optimization problem corresponding to the membership problem for the Approval Voting Polytope is easy (i.e., can be solved in polynomial time). Hint: What is the input size? Hint: Devise a dynamic programming algorithm for finding a max. weight maximal chain.

 Note that the rankings played no conceptual role. General Model Claim: “Given any data set, there is a probability distribution over the finite set of alternatives (states of nature) that explains the data.”  The finite set of queries/questions:   Then, for any Q, the probability that Q holds is  Get polytopal representation of the model. How to choose D?

Possible States of Nature S 1,…,S s Queries (d of them) Polytope (in [0,1] d ) Model Characterization LinearOptimization

NP-Complete Problems