The class \mathcal {NP} [00VT]
- December 2, 2026
Motivation [00VU]
- December 2, 2026
Now let’s formally define what it means to be able to verify the solution to a decision problem. The idea is that we need some sort of extra information to verify a positive answer to a decision problem. For example, given some large graph, if someone were to claim that there was an independent set of size \geq 20, you would challenge them to prove it to you by showing you the independent set. Given an actual set of vertices, it would be easy for you to check that the set has size \geq 20 and also that no two vertices in the set have an edge between them. Conversely, if there is no independent set of that size, then no one is going to be able to fool you by giving you some weird set of vertices. The extra information required to verify a solution is called a certificate.
Definition Polynomial-time certifier [00VV]
- December 2, 2026
An algorithm B is a polynomial-time certifier for a decision problem D if:
- B is a polynomial-time algorithm taking some inputs s and t
- There is a polynomial p such that for all bitstrings s, we have s \in D if and only if there is some bitstring t (called a certificate) with |t| \leq p(|s|) and B(s,t) = \mathsf {T}.
In other words, s \in D if and only if there is a (not too big) certificate “proving” it, which can be efficiently checked. That is, if the answer for the input s is supposed to be \mathsf {T}, then there is a certificate t that proves it: the certifier algorithm B, when run on s and t, will return \mathsf {T}. Conversely, if s \notin D, there is no t that works: B will never return \mathsf {T} for a certificate t unless s really is in D.
Example Polnomial-time certifier for IND-SET [00VW]
- December 2, 2026
For example, again thinking about IND-SET, s is of course a description of a graph G and a number k; a certificate t is simply a list of vertices S; the algorithm B checks whether |S| \geq k and whether each pair of vertices in S is not connected by an edge in G. This takes something like \Theta (|S|^2) time which is clearly polynomial in the size of the graph, since |S| \leq |V|.
Definition \mathcal {NP} [00VX]
- December 2, 2026
\mathcal {NP} is defined as the set of all decision problems which have a polynomial-time certifier.
Example \mathcal {NP} problems so far [00VZ]
- December 2, 2026
For example, 3-SAT, VERTEX-COVER, and IND-SET are all in \mathcal {NP} according to our discussion above.
Remark \mathcal {NP} = nondeterminism [00W0]
- December 2, 2026
\mathcal {NP} stands for “nondeterministic polynomial time”. The idea is that if we could make nondeterministic choices (i.e. choose multiple things at once and try them in parallel), we could solve any \mathcal {NP} problem in polynomial time: just nondeterministically make all possible choices for the certificate t and check them all at the same time.