A topic in the Open Knowledge Graph — a free, open map of 15,290 topics and the order to learn them in.

The Polynomial Time Hierarchy: Levels Beyond NP

Graduate Depth 98 in the knowledge graph I know this Set as goal
3topics build on this
588prerequisites beneath it
See this on the map →
Complexity Classes and the Complexity HierarchyNondeterministic Polynomial Time and NP+1 moreAlternating Turing Machines and the Polynomial HierarchyThe Polynomial Hierarchy Beyond NP
polynomial-hierarchy quantified-formulas complexity-levels

Core Idea

The polynomial time hierarchy (PH) extends beyond P and NP by iterating quantification: Σ₁P = NP, Π₁P = coNP, Σ₂P allows alternating quantifiers, and so on. If P = NP, then PH collapses to P; proving hierarchy separation is an open problem. PH captures the complexity of problems with multiple levels of existential and universal quantification.

How It's Best Learned

Use quantified Boolean formulas (QBF) as examples: existential quantifiers give Σ classes, universal give Π classes. Compare TQBF (true QBF) at different levels.

Common Misconceptions

Explainer

You know that NP captures problems where a solution can be *verified* in polynomial time — equivalently, problems with an existential polynomial-time witness: "does there exist a certificate y such that V(x, y) accepts?" And coNP captures the complementary problems: "for all certificates y, V(x, y) accepts?" The polynomial hierarchy (PH) generalizes this by stacking alternating existential and universal quantifiers, each ranging over polynomially bounded witnesses.

Define the levels inductively. Σ₀P = Π₀P = P is the base. Σ₁P = NP: there exists a polynomial-time verifiable witness. Π₁P = coNP: for all witnesses, the condition holds. Σ₂P adds another layer: there exists a y₁ such that for all y₂, a polynomial-time condition holds. The canonical example is the problem "does formula φ have a satisfying assignment that remains satisfying even after an adversary flips one variable?" — existential outer quantifier, universal inner quantifier. Π₂P flips the order: for all y₁, there exists y₂ such that... Each level Σₖ₊₁P = NPΣₖP, meaning it is NP with an oracle for the previous level. Intuitively, each step up the hierarchy adds one more round of alternating "guessing and checking."

The hierarchy models a wide class of problems that appear in practice. Minimizing circuit size (minimum circuit size problem) is in Σ₂P. Questions about the existence of Nash equilibria with certain properties, or about second-level optimization (minimize over what remains after an adversary chooses), typically land in Σ₂P or Π₂P. PSPACE, which you will study next, sits above the entire hierarchy: PH ⊆ PSPACE, because TQBF (true quantified Boolean formulas with any number of alternations) is PSPACE-complete, and the hierarchy is exactly the restriction of TQBF to formulas with a bounded number of quantifier blocks.

The key structural fact is the collapse theorem: if any two adjacent levels coincide — if Σₖ = Πₖ for any k, equivalently if Σₖ = Σₖ₊₁ — then the entire hierarchy collapses to that level. In particular, if P = NP, then Σ₁ = Π₁ = Σ₀ = P, and the whole hierarchy collapses to P. This is the sense in which proving P ≠ NP is equivalent to proving the hierarchy does not immediately collapse. Complexity theorists widely believe the hierarchy is strict (infinitely many distinct levels), but no separations have been proved. The hierarchy serves as a refined map of the complexity landscape between P and PSPACE, and placing a problem at a specific level is a precise statement about how much alternating nondeterminism it requires.

Practice Questions 5 questions

Prerequisite Chain

Understanding ZeroThe Number ZeroCounting to FiveCounting to 10Counting to 20Counting a Set of Objects Up to 20Cardinality: The Last Number CountedMatching Numerals to QuantitiesSubitizing Small QuantitiesAddition Within 10Number Bonds to 10Addition Within 20Doubles and Near DoublesDoubles Facts Within 10Near Doubles Facts Within 20Mental Math Strategies for AdditionMental Math: Adding and Subtracting TensAddition Within 100Repeated Addition as MultiplicationMultiplication as Equal GroupsMultiplication: ArraysBasic Multiplication Facts (0s, 1s, 2s, 5s, 10s)Multiplication Facts Within 100Division as Equal SharingDivision as Grouping (Measurement Division)Division: Grouping (Repeated Subtraction) ModelDivision: Fair Sharing ModelDivision as Equal SharingDivision as GroupingBasic Division FactsDivision Facts Within 100Multiplication and Division Fact FamiliesRelationship Between Multiplication and DivisionDivision Facts as Inverse of MultiplicationRemainders and Quotients in DivisionDivision Word ProblemsMulti-Step Word ProblemsSolving Multi-Step Word ProblemsMultiplication Word ProblemsDivision Word ProblemsIntroduction to Long DivisionFactors and MultiplesPrime and Composite NumbersEquivalent FractionsRelating Fractions and DecimalsDecimal Place ValueIntegers and the Number LineComparing and Ordering IntegersAbsolute ValueAdding IntegersSubtracting IntegersMultiplying IntegersDividing IntegersUnit RatesProportionsPercent ConceptConverting Between Fractions, Decimals, and PercentsOperations with Rational NumbersTwo-Step EquationsSolving Multi-Step EquationsEquations with Variables on Both SidesAngle Pairs: Complementary, Supplementary, and VerticalParallel Lines and TransversalsCorresponding AnglesAlternate Interior AnglesTriangle Angle Sum TheoremExterior Angle TheoremTriangle Inequality TheoremSimilar Triangles: AA SimilaritySimilar Triangles: SSS and SAS SimilarityProportions in Similar TrianglesRight Triangle Trigonometry IntroductionSine, Cosine, and Tangent RatiosTrigonometric Ratios ReviewRadian MeasureConverting Between Degrees and RadiansThe Unit CircleGraphing Sine and CosineGraphing Tangent and Reciprocal Trigonometric FunctionsDerivatives of Trigonometric FunctionsAntiderivativesIndefinite IntegralsBasic Integration RulesRiemann SumsDefinite Integral DefinitionProbability Density Functions and Continuous DistributionsCumulative Distribution FunctionsContinuous Random VariablesProbability Density FunctionsExpected ValueWeak Law of Large NumbersProbability Axioms and RulesConditional ProbabilityProbabilistic Computation and BPPBPP and Randomized ComplexityRandomized Complexity: RP, co-RP, and ZPPComplexity Classes and the Complexity HierarchyThe P Versus NP Problem: Central Open QuestionThe Polynomial Time Hierarchy: Levels Beyond NP

Longest path: 99 steps · 588 total prerequisite topics

Prerequisites (3)

Leads To (2)