NP-complete Problems Prof. Sin-Min Lee Department of Computer Science.

Slides:



Advertisements
Similar presentations
Analysis of Algorithms
Advertisements

NP-Hard Nattee Niparnan.
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.
Lecture 21 NP-complete problems
The Theory of NP-Completeness
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.
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 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 Problems Problems in Computer Science are classified into
CSE 326: Data Structures NP Completeness Ben Lerner Summer 2007.
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
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 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 22 Instructor: Paul Beame.
Complexity Issues Mark Allen Weiss: Data Structures and Algorithm Analysis in Java Lydia Sinapova, Simpson College.
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.
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.
Difficult Problems. Polynomial-time algorithms A polynomial-time algorithm is an algorithm whose running time is O(f(n)), where f(n) is a polynomial A.
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.
1 1. Draw the machine schema for a TM which when started with input 001 halts with abbb on the tape in our standard input format. 2. Suppose you have an.
CSE 326: Data Structures NP Completeness Ben Lerner Summer 2007.
TECH Computer Science NP-Complete Problems Problems  Abstract Problems  Decision Problem, Optimal value, Optimal solution  Encodings  //Data Structure.
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.
CSCI 2670 Introduction to Theory of Computing November 29, 2005.
NP-complete Problem Prof. S M Lee Department of Computer Science.
Week 10Complexity of Algorithms1 Hard Computational Problems Some computational problems are hard Despite a numerous attempts we do not know any efficient.
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.
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.
NP-Complete problems.
CSE332: Data Abstractions Lecture 27: A Few Words on NP Tyler Robison Summer
NP-Complete Problems Algorithm : Design & Analysis [23]
CS 3343: Analysis of Algorithms Lecture 25: P and NP Some slides courtesy of Carola Wenk.
2101INT – Principles of Intelligence Systems Lecture 3.
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.
NPC.
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.
1 1. Which of these sequences correspond to Hamilton cycles in the graph? (a) (b) (c) (d) (e)
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 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.
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.
Great Theoretical Ideas in Computer Science.
CSE 332: NP Completeness, Part II Richard Anderson Spring 2016.
The NP class. NP-completeness
Graphs 4/13/2018 5:25 AM Presentation for use with the textbook, Algorithm Design and Applications, by M. T. Goodrich and R. Tamassia, Wiley, 2015 NP-Completeness.
NP-Completeness NP-Completeness Graphs 5/7/ :49 PM x x x x x x x
Computational problems, algorithms, runtime, hardness
NP-Completeness NP-Completeness Graphs 11/16/2018 2:32 AM x x x x x x
RAJALAKSHMI ENGINEERING COLLEGE
NP-Completeness NP-Completeness Graphs 12/3/2018 2:46 AM x x x x x x x
1. for (i=0; i < n; i+=2) if (A[i] > A[i+1]) swap(A[i], A[i+1])
RAIK 283 Data Structures & Algorithms
Presentation transcript:

NP-complete Problems Prof. Sin-Min 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(n k ). Note that k can depend on the problem class, but not the particular instance. All the decision problems mentioned above are in P. P: Polynomial algorithms - These include all the sorting algorithms we've seen, with running times on the order of nlgn and n 2. Running times like n 3 and 4, though considerably slower, are also polynomial time.

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? NP-Completeness Basically, computer scientists have used computer theory to prove that some of the problems we want to solve are members of a group of problems called NP-Complete. A problem can be included in this group by proving its similarity to other problems in the group. By similarity, we mean that if one member of the group can be solved in polynomial time, we can translate the solution appropriately to solve any other problem in the group in polynomial time. So, this is a very important group. A solution for any of these problems that is polynomial proves that P=NP (not just P-NP-complete.)

Cook's Theorem The Satisfiability problem x = ((A+B)C)((ABC')+C)(ABC') Can you assign boolean (true or false) values to each of A, B, and C so that x is true? If so, we say that the circuit is 'satisfiable.' This circuit (which could also be drawn with AND/OR/NOT gates) is unsatisfiable. (Make sure you review how to draw an AND/OR/NOT circuit from a boolean equation. You've usually seen the equations written with x, y, and z instead of A, B, and C.)

Implications of NP-Completeness Most people don't believe that P=NP, because so many computer scientists have tried to solve so many of the problems in the NP-Complete group of problems that it's unlikely that they all weren't capable. So, once you prove that a problem is NP-Complete, conventional wisdom tells you to stop trying to solve the problem.