1 / 50

NP-complete Problems

Lecture 30. 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''.

altessa
Télécharger la présentation

NP-complete Problems

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


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

  2. 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?

  3. 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. P: Polynomial algorithms - These include all the sorting algorithms we've seen, with running times on the order of nlgn and n2. Running times like n3 and 4, though considerably slower, are also polynomial time.

  4. 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?

  5. 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?

  6. 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?

  7. 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.)

  8. 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.)

  9. 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.

More Related