P
Decision languages decidable by a deterministic Turing machine in time polynomial in the encoded input length.
REFERENCE SHEET
Ask what can be computed efficiently after establishing that it can be computed at all.
Before this Turing machines, deciders & recognizers, Asymptotics & recurrences, Boolean logic, circuits & satisfiability
Decision languages decidable by a deterministic Turing machine in time polynomial in the encoded input length.
Decision languages with polynomial-length certificates whose validity can be checked by a deterministic polynomial-time verifier. Equivalently, nondeterministic polynomial time.
B is NP-hard if every language in NP polynomial-time many-one reduces to B. It is NP-complete if it is also in NP.
P⊆NP: a verifier can ignore the certificate and run the polynomial-time decider.
Boolean satisfiability is NP-complete. In particular, polynomial-time SAT would imply P=NP.
To prove B NP-complete, prove B∈NP and reduce a known NP-complete language A to B with a polynomial-time membership-preserving transformation.
NP-hardness motivates approximation, parameterized algorithms, special cases, or exact exponential methods rather than a promised general polynomial-time solution.
A proposed solution may be quick to check even when no efficient general discovery algorithm is known.
01 / Verify
List the proposed vertices and check all pairs.
The certificate lists k distinct vertices. Check membership, distinctness, and the existence of all k(k−1)/2 edges. This is polynomial in the graph encoding length (reject immediately if k exceeds the vertex count).
02 / Reduce
Complement the graph while keeping k.
Map (G,k) to (the complement graph of G,k). A set of k vertices has every pair joined in G exactly when it has no pair joined in the complement. Constructing the complement takes polynomial time.
Further reading and full-length treatments: