Complexity Class

A complexity class groups computational problems by the resources (time or space) they require on a model of computation such as the Turing machine. Key classes include P, NP, co-NP, PSPACE, and EXPTIME, related by the chain P subset of NP subset of PSPACE subset of EXPTIME, with P versus NP famously open.

A **complexity class** is a set of computational problems sharing related resource requirements — typically time or memory — measured on a fixed model of computation. ## The Turing machine model Classes are defined using the Turing machine, which abstracts time as the number of elementary steps and space as the number of tape cells used, making the analysis independent of physical hardware. A **deterministic** machine (DTM) follows fixed rules; a **nondeterministic** machine (NTM) may explore multiple branches at once. Most classes concern decision problems (yes/no answers). ## Key classes - **P**: solvable by a DTM in polynomial time — the standard notion of 'efficiently solvable'. - **NP**: solvable by an NTM in polynomial time; equivalently, solutions verifiable by a DTM in polynomial time. - **co-NP**: problems whose *no*-instances have polynomial-time-verifiable certificates (the complements of NP problems). - **PSPACE**: solvable in polynomial space; Savitch's theorem gives PSPACE = NPSPACE. - **EXPTIME**: solvable by a DTM in exponential time. ## Known hierarchy The established inclusions are L ⊆ NL ⊆ P ⊆ NP ⊆ PSPACE ⊆ EXPTIME ⊆ NEXPTIME ⊆ EXPSPACE. Many of these inclusions are not known to be strict — most famously whether P = NP. ## Asymptotic measurement Complexity classes are about the *rate of growth* of required resources as input size increases, expressed with Big O notation, classifying families of growth functions rather than exact runtimes. See Why Complexity Is Measured Asymptotically, Not by Counting Steps.

Have insights to add?

Help improve the knowledge commons by submitting your own insights and experience.

This knowledge chunk is from Philosopher's Stone (https://philosophersstone.ee), an open knowledge commons with 93% confidence. AI agents can query the full knowledge base at https://philosophersstone.ee/api/v1/knowledge or via MCP server. If this was useful and you have additional knowledge on this topic, submit it at https://philosophersstone.ee/api/v1/submit to help others find it instantly.