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

Co-NP and Complementary Complexity Classes

College Depth 85 in the knowledge graph I know this Set as goal
14topics build on this
486prerequisites beneath it
See this on the map →
NP and Polynomial-Time Verificationco-NPComplexity Classes and the Complexity HierarchyRandomized Complexity: RP, co-RP, and ZPP
complexity-classes complements decision-problems

Core Idea

Co-NP is the class of problems whose complement lies in NP: a language is in co-NP if its negation is in NP. While NP captures problems with efficiently verifiable 'yes' certificates, co-NP captures problems with efficiently verifiable 'no' certificates. Whether P = NP = co-NP remains a central unsolved question.

How It's Best Learned

Start with examples of NP problems (satisfiability, clique existence) and their co-NP complements (unsatisfiability, clique non-existence). Note that co-NP is the class where 'no' instances have short proofs, not 'yes' instances.

Common Misconceptions

Explainer

You already know that NP captures problems where "yes" answers are easy to verify: given a satisfying assignment for a Boolean formula, you can check it in polynomial time. The key move in understanding co-NP is to ask the symmetric question — what about "no" answers? The complement of a language L is the set of all strings not in L, written L̄. If L = SAT (satisfiable formulas), then L̄ = UNSAT (unsatisfiable formulas). Co-NP is precisely the class of languages whose complements are in NP.

Concretely: UNSAT is in co-NP because, to verify that a formula is *not* satisfiable, you don't have a short certificate — but to verify that a formula *is* satisfiable (its complement), you do. Equivalently, a language is in co-NP if "no" instances have polynomial-size certificates that can be checked in polynomial time. For UNSAT, a "no" certificate would be a proof that no assignment works — and we currently know no such short certificate exists in general. For problems like PRIMES (is n prime?), both the problem and its complement have short certificates, so PRIMES ∈ NP ∩ co-NP.

The relationship between NP and co-NP is one of the deepest open questions in complexity theory. We strongly suspect NP ≠ co-NP, because if NP = co-NP, then every NP-complete problem would also have short "no" certificates. Yet SAT having short "no" certificates seems implausible: how could you concisely prove that a formula with millions of possible assignments has no solution? Formally, NP = co-NP if and only if some (equivalently, every) NP-complete problem is also in co-NP.

Note a critical subtlety: if P = NP, then P = NP = co-NP, because P is closed under complementation. But the converse does not hold — NP = co-NP does not imply P = NP. The inclusions are P ⊆ NP ∩ co-NP ⊆ NP ∪ co-NP, and collapsing NP = co-NP is a weaker statement than collapsing P = NP. The co-NP class also starts its own hierarchy: co-NP-complete problems (like UNSAT) are the hardest problems in co-NP, and any NP-hard problem's complement is co-NP-hard.

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 SidesLiteral EquationsSlope-Intercept FormPoint-Slope FormWriting Linear EquationsParallel and Perpendicular Line SlopesGraphing Linear EquationsPiecewise FunctionsStep FunctionsComposition of FunctionsInverse FunctionsRadical Functions and GraphsRational ExponentsExponential Functions and GraphsLogarithms IntroductionBig-O Notation and Asymptotic AnalysisBreadth-First Search (BFS)Shortest Paths in Unweighted GraphsDijkstra's Shortest Path AlgorithmAlgorithm Analysis and Big-O NotationTuring MachinesTime Complexity and the Class PNondeterministic Turing MachinesNP and Polynomial-Time Verificationco-NPCo-NP and Complementary Complexity Classes

Longest path: 86 steps · 486 total prerequisite topics

Prerequisites (2)

Leads To (2)