NP ("nondeterministic polynomial") is a complexity class of decision problems that can be solved by a nondeterministic Turing machine in polynomial time. Equivalently, it is the set of decision problems for which an answer can be verified in polynomial time by a deterministic Turing machine.

NP (nondeterministic polynomial-time) is a complexity class of decision problems that can be solved by a nondeterministic Turing machine in polynomial time. Equivalently, it is the set of decision problems for which an answer can be verified in polynomial time by a deterministic Turing machine.

For example:

  • 3-Colorability: Given a graph, can each vertex be colored red, green, or blue so that no two neighboring vertices have the same color?
  • Hamiltonian Cycle: Given a graph, is there a cycle that visits each vertex exactly once?
  • Traveling Salesperson: Given a set of n cities, and the distance between each pair of cities, is there a route that visits each city exactly once before returning to the starting city, and has length at most T?
  • Maximum Clique: Given a graph, are there k vertices all of which are neighbors of each other?
  • Subset Sum: Given a collection of integers, is there a subset of the integers that sums to exactly

References