SlideServe
Menu
Préférences
© SlideServe · v2026

NP-Complete Problems

malloren-rasmussen avatar
15 diapositives · 277 Views · Oct 31, 2014

Learn about NP, P, NP-Complete, NP-Hard, tractable, intractable problems, reductions, and examples of NP-Complete problems such as Traveling Salesman and Vertex Cover.

NP-Complete Problems - slide 1
01 / 15NP-Complete Problems
1 / 17

Télécharger la présentation

NP-Complete Problems
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation

Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement. Téléchargez la présentation en cliquant sur ce lien. Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.

F I N

Plus de contenu associé

Transcription de la présentation
  1. NP-Complete Problems

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

  3. Class of “P” Problems • Class P consists of (decision) problems that are solvable in polynomial time • Polynomial-time algorithms • Worst-case running time is O(nk), for some constant k • Examples of polynomial time: • O(n2), O(n3), O(1), O(n lg n) • Examples of non-polynomial time: • O(2n), O(nn), O(n!)

  4. Class of “NP” Problems • Class NP consists of problems that could be solved by NP algorithms • i.e., verifiable in polynomial time • If we were given a “certificate” of a solution, we could verify that the certificate is correct in time polynomial to the size of the input • Warning: NP does not mean “non-polynomial”

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

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

  7. Tractable/Intractable Problems • Problems in P are also called tractable • Problems not in P are intractable or unsolvable • Can be solved in reasonable time only for small inputs • Or, can not be solved at all • Are non-polynomial algorithms always worst than polynomial algorithms? - n1,000,000 is technically tractable, but really impossible - nlog log log n is technically intractable, but easy

  8. Reductions yes yes   f Problem B no no Problem A • Reduction is a way of saying that one problem is “easier” than another. • We say that problem A is easier than problem B, (i.e., we write “A  B”) if we can solve A using the algorithm that solves B. • Idea:transform the inputs of A to inputs of B

  9. Polynomial Reductions • Given two problems A, B, we say that A is polynomially reducible to B (A p B) if: • There exists a function f that converts the input of A to inputs of B in polynomial time • A(i) = YES  B(f(i)) = YES

  10. NP-Complete Problems

  11. Traveling Salesman

  12. 5-Clique

  13. Hamiltonian Path

  14. Map Coloring

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