Computational Complexity
Computational complexity classifies problems by the resources required to solve them as input size grows. It defines classes like P, NP, and PSPACE, giving a framework for understanding which problems are tractable, which are hard, and what that hardness means in practice.
itComputer fundamentals | OpenSkills.info
Course pathWalk it in order
Look it upDip in anytime
Go furtherLeaves this page
Don't Panic
Don't Panic — Computational Complexity
Computational complexity is the part of computer science that asks what a calculation costs as its input grows. It is not a stopwatch with academic robes. A stopwatch tells you what one program did on one machine. Complexity asks what an algorithm must spend under a stated model, which is less relaxing and more useful.
The first trap is the word “size.” An integer that looks enormous may take few bits to write down. A graph has vertices and edges. Until the input encoding is named, an expression such as O(n²) has brought a variable to a meeting without introducing it. The second trap is the resource: time is familiar, but memory, randomness, communication, and circuit size also take turns being expensive.
Asymptotic analysis studies growth after inputs become large. Big O supplies an upper bound; Big Omega supplies a lower bound; Big Theta says the two meet. These labels do not tell you whether the claim is worst case, average case, or best case. Nor do they promise that a polynomial is quick or that an exponential method is useless. Constants, degree, structure, and actual input range all insist on being invited back in.
Then comes P and NP, two labels that have acquired more folklore than they requested. P holds decision problems that a deterministic algorithm solves in polynomial time. NP holds those whose yes answers have certificates that can be checked in polynomial time. P sits inside NP. Whether the two are equal remains open, so no one has permission to write “NP means impossible” on the whiteboard.
A reduction is the arrow that keeps the map honest. To show a target problem is hard, transform a known hard problem into that target. A fast target solver would then solve the source quickly too. Reverse the arrow and you may have found an algorithmic route, which is good news, but it is not a hardness proof. The arrow has standards.
When exact worst-case work is too costly, the course does not hand you a ceremonial resignation letter. Restrict the input family, isolate a small parameter, use an approximation with a stated guarantee, or use a measured heuristic. The Cheatsheet holds compact rules; Slides show the map; Reference continues into reductions and lower bounds. Start by naming the input, model, resource, and case. The notation becomes less mysterious once it has something precise to describe.
Where this skill leads
Relevant careers
See how this topic contributes to broader role-level skill maps.
Sources
- https://xlinux.nist.gov/dads/HTML/bigOnotation.html
Supports
- Big-O is an asymptotic upper bound defined by fixed positive constants beyond a threshold
- Complexity measures depend on a model of computation and can cover time, memory, or other operations
- Constant factors and lower-order terms do not determine eventual growth
- https://xlinux.nist.gov/dads/HTML/asymptoticTimeComplexity.html
Supports
- Asymptotic time complexity describes limiting execution-time behavior as problem size grows
- https://xlinux.nist.gov/dads/HTML/npcomplete.html
Supports
- NP-complete decision problems belong to NP and are no easier than other NP problems under polynomial comparison
- NP membership can be described through polynomial-time certificate verification
- SAT and decision versions of several optimization problems are NP-complete examples
- https://xlinux.nist.gov/dads/HTML/nphard.html
Supports
- NP-hardness and NP-completeness are different labels
- An optimization problem can be NP-hard when its related decision problem is NP-complete
- https://ocw.mit.edu/courses/6-006-introduction-to-algorithms-fall-2011/216b0252d29c797488da497a761716a4_MIT6_006F11_lec23.pdf
Supports
- P, NP, EXP, decision problems, certificates, hardness, completeness, and reductions form a basic complexity map
- P is contained in NP and P versus NP is open
- Reductions convert one problem into another and can transfer algorithms or hardness
- NP-complete problems are interreducible through polynomial-time reductions
- https://www.ocw.mit.edu/courses/6-046j-design-and-analysis-of-algorithms-spring-2015/resources/lecture-16-complexity-p-np-np-completeness-reductions/
Supports
- The MIT lecture and notes provide intermediate study of P, NP, NP-completeness, and reductions
- https://www.claymath.org/millennium/p-vs-np/
Supports
- P versus NP asks whether solutions that are quick to check are also quick to find
- P versus NP remains an outstanding unresolved problem
- Brute-force search can be infeasible even when a proposed solution is easy to verify
- https://www.claymath.org/library/monographs/MPPc.pdf
Supports
- P and NP are formally defined using deterministic and nondeterministic Turing machines and polynomial bounds in input length
- The P versus NP problem asks whether every language accepted nondeterministically in polynomial time is accepted deterministically in polynomial time
- Input length and the computation model are essential parts of a formal complexity statement
- https://cs.stanford.edu/~trevisan/cs254-10/
Supports
- Advanced complexity study includes P versus NP, hierarchy theorems, circuits, randomized classes, space classes, counting, pseudorandomness, and lower bounds
- https://cs.stanford.edu/people/trevisan/pcp/
Supports
- Approximation is one response to NP-hard optimization problems
- PCP results and reductions support proofs of inapproximability
- https://www.cs.virginia.edu/~robins/Turing_Paper_1936.pdf
Supports
- Turing described a general computation model in 1936.
- https://doi.org/10.1007/978-3-642-87457-9_5
Supports
- Cobham associated feasible computation with polynomial bounds in 1965.
- https://www.cs.toronto.edu/~sacook/homepage/1971.pdf
Supports
- Cook introduced polynomial reducibility in 1971.
- https://doi.org/10.1007/978-1-4684-2001-2_9
Supports
- Karp used polynomial reductions across combinatorial decision problems in 1972.
- https://doi.org/10.1016/S0022-0000(70)80006-X
Supports
- Savitch established a deterministic-space simulation result in 1970.
- https://doi.org/10.1016/0022-0000(79)90044-6
Supports
- Valiant introduced #P and #P-completeness in 1979.
- https://doi.org/10.1145/146585.146609
Supports
- Shamir proved IP equals PSPACE in 1992.
- https://doi.org/10.1145/278298.278306
Supports
- The PCP theorem connected probabilistically checkable proofs to hardness of approximation in 1998.
- https://doi.org/10.4007/annals.2004.160.781
Supports
- The AKS paper gave a deterministic polynomial-time primality test in 2004.
- https://www.gurobi.com/documentation/
Supports
- Gurobi documents mathematical programming and mixed-integer optimization.
- https://www.ibm.com/products/ilog-cplex-optimization-studio
Supports
- IBM offers ILOG CPLEX Optimization Studio for optimization modeling and solving.
- https://developers.google.com/optimization
Supports
- OR-Tools provides constraint programming, mixed-integer programming, routing, and graph optimization tools.
- https://www.scipopt.org/
Supports
- SCIP is an optimization framework for mixed-integer and constraint integer programming.
- https://microsoft.github.io/z3guide/
Supports
- Z3 checks satisfiability of logical formulas over supported theories.
