NP, PSPACE, P
Where some problems live (and we don't know the boundaries)
Complexity classes group problems by the resources needed to solve them.
Three crucial classes:
P — Polynomial time. Decision problems solvable by a deterministic
Turing machine in time for some .
Examples: reachability in graphs, primality (in P since 2002), shortest path,
sorting verification, satisfiability of Horn formulas.
NP — Nondeterministic Polynomial time. Decision problems whose YES
instances have a certificate verifiable in polynomial time. Equivalently,
solvable by a nondeterministic TM in polynomial time.
Examples: SAT (satisfiability), Hamiltonian cycle, graph coloring, TSP
(decision version), subset sum, clique.
PSPACE — Polynomial space. Problems solvable using memory,
regardless of time. By Savitch's theorem, PSPACE = NPSPACE (nondeterministic
polynomial space).
Examples: quantified Boolean formula (QBF), game tree evaluation, regular
expression equivalence.
The chain:
The big open question: ? Is every problem whose solution is
quickly verifiable also quickly solvable? Most experts believe ,
but no proof is known — and a proof would change mathematics, cryptography,
and AI forever.
A reward of $1,000,000 from the Clay Mathematics Institute awaits a
solution. The question is one of seven Millennium Prize Problems.
Why this matters for AI. Many AI tasks — planning, scheduling, reasoning,
constraint satisfaction — are NP-complete or PSPACE-complete in the worst
case. Practical algorithms use heuristics, approximations, or special-case
structure to dodge the worst case.
- 0.0sComplexity classes
- 1.0sOuter green rounded box draws: PSPACE, polynomial space
- 2.0sMiddle amber box draws inside: NP, polynomial-time verifiable
- 3.0sInner cyan box draws: P, polynomial time
- 4.4sThree lines list canonical problems for each class
- 6.3sP subset NP subset PSPACE, inclusions are conjectured strict