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 more→→Alternating 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 Zero → The Number Zero → Counting to Five → Counting to 10 → Counting to 20 → Counting a Set of Objects Up to 20 → Cardinality: The Last Number Counted → Matching Numerals to Quantities → Subitizing Small Quantities → Addition Within 10 → Number Bonds to 10 → Addition Within 20 → Doubles and Near Doubles → Doubles Facts Within 10 → Near Doubles Facts Within 20 → Mental Math Strategies for Addition → Mental Math: Adding and Subtracting Tens → Addition Within 100 → Repeated Addition as Multiplication → Multiplication as Equal Groups → Multiplication: Arrays → Basic Multiplication Facts (0s, 1s, 2s, 5s, 10s) → Multiplication Facts Within 100 → Division as Equal Sharing → Division as Grouping (Measurement Division) → Division: Grouping (Repeated Subtraction) Model → Division: Fair Sharing Model → Division as Equal Sharing → Division as Grouping → Basic Division Facts → Division Facts Within 100 → Multiplication and Division Fact Families → Relationship Between Multiplication and Division → Division Facts as Inverse of Multiplication → Remainders and Quotients in Division → Division Word Problems → Multi-Step Word Problems → Solving Multi-Step Word Problems → Multiplication Word Problems → Division Word Problems → Introduction to Long Division → Factors and Multiples → Prime and Composite Numbers → Equivalent Fractions → Relating Fractions and Decimals → Decimal Place Value → Integers and the Number Line → Comparing and Ordering Integers → Absolute Value → Adding Integers → Subtracting Integers → Multiplying Integers → Dividing Integers → Unit Rates → Proportions → Percent Concept → Converting Between Fractions, Decimals, and Percents → Operations with Rational Numbers → Two-Step Equations → Solving Multi-Step Equations → Equations with Variables on Both Sides → Angle Pairs: Complementary, Supplementary, and Vertical → Parallel Lines and Transversals → Corresponding Angles → Alternate Interior Angles → Triangle Angle Sum Theorem → Exterior Angle Theorem → Triangle Inequality Theorem → Similar Triangles: AA Similarity → Similar Triangles: SSS and SAS Similarity → Proportions in Similar Triangles → Right Triangle Trigonometry Introduction → Sine, Cosine, and Tangent Ratios → Trigonometric Ratios Review → Radian Measure → Converting Between Degrees and Radians → The Unit Circle → Graphing Sine and Cosine → Graphing Tangent and Reciprocal Trigonometric Functions → Derivatives of Trigonometric Functions → Antiderivatives → Indefinite Integrals → Basic Integration Rules → Riemann Sums → Definite Integral Definition → Probability Density Functions and Continuous Distributions → Cumulative Distribution Functions → Continuous Random Variables → Probability Density Functions → Expected Value → Weak Law of Large Numbers → Probability Axioms and Rules → Conditional Probability → Probabilistic Computation and BPP → BPP and Randomized Complexity → Randomized Complexity: RP, co-RP, and ZPP → Complexity Classes and the Complexity Hierarchy → The P Versus NP Problem: Central Open Question → The Polynomial Time Hierarchy: Levels Beyond NP

Longest path: 99 steps · 588 total prerequisite topics

Prerequisites (3)

Leads To (2)