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 morePSPACE 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 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 IntegersIntroduction to ExponentsOrder of OperationsInteger Order of OperationsVariable ExpressionsThe Distributive PropertyVariables and Expressions ReviewIntroduction to PolynomialsAdding and Subtracting PolynomialsMultiplying PolynomialsFactorialPermutationsCombinationsCounting Principles: Addition and Multiplication RulesIntroduction to Graph TheoryPropositional Logic FoundationsLogical EquivalencesBoolean AlgebraBoolean Type and Truth ValuesComparison Operators and Boolean TestsLogical Operators and Boolean AlgebraBoolean Algebra and Fundamental LawsLogic Gates FundamentalsImplementing Boolean Functions with GatesKarnaugh Map SimplificationCombinational Circuit DesignFlip-Flops and LatchesFinite State Machines (FSMs)Deterministic Finite Automata (DFA)Nondeterministic Finite Automata (NFA)Two-Way Finite AutomataNFA to DFA Conversion (Subset Construction)DFA Properties and Minimization AlgorithmsRegular Languages: Definition and CharacterizationContext-Free Grammars (CFGs)Pushdown Automata (PDA)Equivalence of CFGs and Pushdown AutomataClosure Properties of Context-Free LanguagesLimitations of Context-Free LanguagesPumping Lemma for Context-Free LanguagesTuring MachinesVariants of Turing Machines and EquivalenceNondeterministic Time Complexity and NPThe P vs. NP ProblemComplexity Class P: Polynomial TimeComplexity Class NP: Nondeterministic Polynomial TimeNP-Completeness and Cook-Levin TheoremThe Cook-Levin TheoremBoolean Satisfiability, Cook-Levin, and ReductionsPolynomial Many-One ReductionsBPP: Bounded Error Probabilistic Polynomial TimeRP and coRP Complexity ClassesPSPACE Complexity ClassThe Polynomial Hierarchy

Longest path: 105 steps · 694 total prerequisite topics

Prerequisites (6)

Leads To (1)