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

The Polynomial Hierarchy

Research Depth 104 in the knowledge graph ☐ I know this ☆ Set as goal
3topics build on this
694prerequisites beneath it
See this on the map →
Complexity Class NP: Nondeterministic Polynomial TimeComplexity Classes and the Complexity Hierarchy+4 more→→PSPACE and PSPACE-Completeness
complexity-classes quantified-formulas hierarchy

Core Idea

The polynomial hierarchy (PH) generalizes P and NP by permitting multiple alternations of existential (∃) and universal (∀) quantifiers in polynomial time. Σ₁^P = NP (∃-quantified), Π₁^P = coNP (∀-quantified), Σ₂^P adds ∃∀ conditions. The hierarchy is believed infinite and contained in PSPACE. If any level collapses (Σᵢ^P = Πᵢ^P), the entire hierarchy collapses to that level. PH captures all polynomial-time problems expressible with bounded quantifier depth.

Explainer

From your study of NP, you know that NP problems have a characteristic structure: there exists a certificate that a polynomial-time verifier can check. Satisfiability asks "does there exist an assignment that makes this formula true?" The answer is verified deterministically once the certificate is provided. CoNP flips this to a universal quantifier: "for all assignments, is the formula true?" The polynomial hierarchy extends this pattern by asking: what happens when you stack these quantifiers?

The Σ₂^P level captures problems of the form "does there exist an x such that for all y, some polynomial-time predicate holds?" A concrete example: minimum equivalent expression asks whether a Boolean formula can be simplified to size at most k. This requires showing that a small formula exists (∃) and that it agrees with the original on all inputs (∀). Neither a single NP oracle call nor a single coNP oracle call suffices — you need both quantifier types working together. Each new level of the hierarchy adds another quantifier alternation: Σ₃^P has ∃∀∃ structure, Π₃^P has ∀∃∀, and so on.

A useful way to think about the hierarchy is through oracle machines. Σ₂^P is exactly the class of problems solvable in polynomial time by a nondeterministic Turing machine with access to an NP oracle — it can ask "is this subproblem in NP?" as a single step. Each level uses the previous level as its oracle, building a tower of increasingly powerful computational resources. The hierarchy sits entirely inside PSPACE, because a machine with polynomial space can simulate any bounded number of quantifier alternations by exhaustive search.

The most striking structural property of PH is its fragility under collapse. If any two adjacent levels turn out to be equal — say Σ₂^P = Π₂^P — then the entire hierarchy collapses to that level, meaning every higher level equals it too. This is analogous to how P = NP would collapse the entire hierarchy to P. The widespread belief that PH is infinite (no level collapses) is one of the strongest structural conjectures in complexity theory, and it serves as evidence for many separation results. When a complexity theorist shows that some assumption implies a collapse of PH, that assumption is generally considered unlikely — the polynomial hierarchy acts as a barometer for the plausibility of complexity-theoretic claims.

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 → Introduction to Exponents → Order of Operations → Integer Order of Operations → Variable Expressions → The Distributive Property → Variables and Expressions Review → Introduction to Polynomials → Adding and Subtracting Polynomials → Multiplying Polynomials → Factorial → Permutations → Combinations → Counting Principles: Addition and Multiplication Rules → Introduction to Graph Theory → Propositional Logic Foundations → Logical Equivalences → Boolean Algebra → Boolean Type and Truth Values → Comparison Operators and Boolean Tests → Logical Operators and Boolean Algebra → Boolean Algebra and Fundamental Laws → Logic Gates Fundamentals → Implementing Boolean Functions with Gates → Karnaugh Map Simplification → Combinational Circuit Design → Flip-Flops and Latches → Finite State Machines (FSMs) → Deterministic Finite Automata (DFA) → Nondeterministic Finite Automata (NFA) → Two-Way Finite Automata → NFA to DFA Conversion (Subset Construction) → DFA Properties and Minimization Algorithms → Regular Languages: Definition and Characterization → Context-Free Grammars (CFGs) → Pushdown Automata (PDA) → Equivalence of CFGs and Pushdown Automata → Closure Properties of Context-Free Languages → Limitations of Context-Free Languages → Pumping Lemma for Context-Free Languages → Turing Machines → Variants of Turing Machines and Equivalence → Nondeterministic Time Complexity and NP → The P vs. NP Problem → Complexity Class P: Polynomial Time → Complexity Class NP: Nondeterministic Polynomial Time → NP-Completeness and Cook-Levin Theorem → The Cook-Levin Theorem → Boolean Satisfiability, Cook-Levin, and Reductions → Polynomial Many-One Reductions → BPP: Bounded Error Probabilistic Polynomial Time → RP and coRP Complexity Classes → PSPACE Complexity Class → The Polynomial Hierarchy

Longest path: 105 steps · 694 total prerequisite topics

Prerequisites (6)

Leads To (1)