np
NP, short for nondeterministic polynomial time, is the class of decision problems for which a given answer can be verified in polynomial time if a correct certificate is provided. In formal terms, a language is in NP if there exists a nondeterministic Turing machine that decides the language in time polynomial in the input length. Equivalently, there is a deterministic polynomial-time verifier V such that, for any input x, x is in the language if and only if there exists a certificate y of length polynomial in |x| with V(x, y) accepting.
NP is related to the class P, which consists of problems solvable in deterministic polynomial time. It
A problem is NP-complete if it lies in NP and is at least as hard as every
In practice, NP-completeness is used as a measure of problem difficulty: if a problem is NP-complete, no