NP-Complete Problems CIT 596, Spring 2012. Problems that Cross the Line What if a problem has: o An exponential upper bound o A polynomial lower bound.

Slides:



Advertisements
Similar presentations
Analysis of Algorithms
Advertisements

P, NP, NP-Complete Problems
Problems and Their Classes
NP-Hard Nattee Niparnan.
JAYASRI JETTI CHINMAYA KRISHNA SURYADEVARA
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 Lecture for CS 302. Traveling Salesperson Problem You have to visit n cities You want to make the shortest trip How could you do this?
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
The Theory of NP-Completeness
CPE702 Complexity Classes Pruet Boonma Department of Computer Engineering Chiang Mai University Based on Material by Jenny Walter.
1 NP-Complete Problems. 2 We discuss some hard problems:  how hard? (computational complexity)  what makes them hard?  any solutions? Definitions 
Computability and Complexity 13-1 Computability and Complexity Andrei Bulatov The Class NP.
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
CSE 326: Data Structures NP Completeness Ben Lerner Summer 2007.
Analysis of Algorithms CS 477/677
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.
P, NP, and NP-Complete Suzan Köknar-Tezel.
The Theory of NP-Completeness 1. Nondeterministic algorithms A nondeterminstic algorithm consists of phase 1: guessing phase 2: checking If the checking.
Programming & Data Structures
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.
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.
Tonga Institute of Higher Education Design and Analysis of Algorithms IT 254 Lecture 8: Complexity Theory.
Problems you shouldn’t tackle. Problem Complexity.
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.
CSE 024: Design & Analysis of Algorithms Chapter 9: NP Completeness Sedgewick Chp:40 David Luebke’s Course Notes / University of Virginia, Computer Science.
CSE 3813 Introduction to Formal Languages and Automata Chapter 14 An Introduction to Computational Complexity These class notes are based on material from.
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.
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.
NP-COMPLETE PROBLEMS. Admin  Two more assignments…  No office hours on tomorrow.
Problem Complexity and NP-Complete Problems Presented by Ming-Tsung Hsu.
Limits to Computation How do you analyze a new algorithm? –Put it in the form of existing algorithms that you know the analysis. –For example, given 2.
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.
Chapter 11 Introduction to Computational Complexity Copyright © 2011 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1.
NPC.
CS216: Program and Data Representation University of Virginia Computer Science Spring 2006 David Evans Lecture 8: Crash Course in Computational Complexity.
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.
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.
1 Ch 10 - NP-completeness Tractable and intractable problems Decision/Optimization problems Deterministic/NonDeterministic algorithms Classes P and NP.
Optimization/Decision Problems Optimization Problems – An optimization problem is one which asks, “What is the optimal solution to problem X?” – Examples:
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.
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.
CSC 172 P, NP, Etc.
ICS 353: Design and Analysis of Algorithms NP-Complete Problems King Fahd University of Petroleum & Minerals Information & Computer Science Department.
Limitation of Computation Power – P, NP, and NP-complete
The NP class. NP-completeness
NP-Complete Problems.
8.1 Determine whether the following statements are correct or not
P & NP.
Richard Anderson Lecture 26 NP-Completeness
ICS 353: Design and Analysis of Algorithms
Richard Anderson Lecture 25 NP-Completeness
Computational Complexity
NP-Complete Problems.
NP-Completeness Reference: Computers and Intractability: A Guide to the Theory of NP-Completeness by Garey and Johnson, W.H. Freeman and Company, 1979.
CSE 589 Applied Algorithms Spring 1999
CSC 380: Design and Analysis of Algorithms
Hamiltonian Circuit (HC) problem
Presentation transcript:

NP-Complete Problems CIT 596, Spring 2012

Problems that Cross the Line What if a problem has: o An exponential upper bound o A polynomial lower bound We have only found exponential algorithms, so it appears to be intractable. But... we can ’ t prove that an exponential solution is needed, we can ’ t prove that a polynomial algorithm cannot be developed, so we can ’ t say the problem is intractable...

NP-Complete Problems The upper bound suggests the problem is intractable The lower bound suggests the problem is tractable The lower bound is linear: O(N) They are all reducible to each other o If we find a reasonable algorithm (or prove intractability) for one, then we can do it for all of them!

Traveling Salesman

5-Clique

Hamiltonian Path

Map Coloring

Vertex Cover (VC) Given a graph and an integer k, is there a collection of k vertices such that each edge is connected to one of the vertices in the collection?

Class Scheduling Problem With N teachers with certain hour restrictions M classes to be scheduled, can we: o Schedule all the classes o Make sure that no two teachers teach the same class at the same time o No teacher is scheduled to teach two classes at once

Pair Programming Problem With N students and K projects, where N is even, can we: o Assign pairs of students to each project o Every student works on every project o No student has the same partner more than once Is this an NP-complete problem?

Graph isomorphism Graph isomorphism is NP-hard; is it NP-complete?

NP and P What is NP? NP is the set of all decision problems (question with yes- or-no answer) for which the 'yes'-answers can be verified in polynomial time (O(n^k) where n is the problem size, and k is a constant) by a deterministic Turing machine. Polynomial time is sometimes used as the definition of fast or quickly.deterministic Turing machine What is P? P is the set of all decision problems which can be solved in polynomial time by a deterministic Turing machine. Since it can solve in polynomial time, it can also be verified in polynomial time. Therefore P is a subset of NP.

NP-Complete What is NP-Complete? A problem x that is in NP is also in NP-Complete if and only if every other problem in NP can be quickly (ie. in polynomial time) transformed into x. In other words: x is in NP, and Every problem in NP is reducible to x So what makes NP-Complete so interesting is that if any one of the NP-Complete problems was to be solved quickly then all NP problems can be solved quickly

NP-Hard What is NP-Hard? NP-Hard are problems that are at least as hard as the hardest problems in NP. Note that NP-Complete problems are also NP-hard. However not all NP-hard problems are NP (or even a decision problem), despite having 'NP' as a prefix. That is the NP in NP- hard does not mean 'non-deterministic polynomial time'. Yes this is confusing but its usage is entrenched and unlikely to change.

Certificates Returning true: in order to show that the schedule can be made, we only have to show one schedule that works o This is called a certificate. Returning false: in order to show that the schedule cannot be made, we must test all schedules.

Oracles If we could make the ‘ right decision ’ at all decision points, then we can determine whether a solution is possible very quickly! o If the found solution is valid, then True o If the found solution is invalid, then False If we could find the certificates quickly, NP- complete problems would become tractable – O(N) This (magic) process that can always make the right guess is called an Oracle.

Determinism vs. Nondeterminism Nondeterministic algorithms produce an answer by a series of “ correct guesses ” Deterministic algorithms (like those that a computer executes) make decisions based on information.

NP-Complete “ NP-Complete ” comes from: o Nondeterministic Polynomial o Complete - “ Solve one, Solve them all ” There are more NP-Complete problems than provably intractable problems.

Proving NP- Completeness Show that the problem is in NP. (i.e. Show that a certificate can be verified in polynomial time.) Assume it is not NP complete Show how to convert an existing NPC problem into the problem that we are trying to show is NP Complete (in polynomial time). If we can do it we ’ ve done the proof! Why? If we can turn an exisiting NP-complete problem into our problem in polynomial time... 

Become Famous! To get famous in a hurry, for any NP- Complete problem: o Raise the lower bound (via a stronger proof) o Lower the upper bound (via a better algorithm) They ’ ll be naming buildings after you before you are dead!

End ture29wdl/ ture29wdl/ heuristic/text/class/more-np.html heuristic/text/class/more-np.html an-np-complete-problem an-np-complete-problem Wikipedia