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

The P vs. NP Problem

Graduate Depth 94 in the knowledge graph I know this Set as goal
102topics build on this
495prerequisites beneath it
See this on the map →
Nondeterministic Time Complexity and NPComplexity Class P: Polynomial Time
P-vs-NP open-problem complexity foundations

Core Idea

The P vs. NP problem asks whether every problem whose solution can be verified in polynomial time can also be solved in polynomial time: does P = NP? It is one of the seven Millennium Prize Problems and widely considered the most important open question in computer science. Most researchers believe P ≠ NP — that some problems are intrinsically harder to solve than to verify — but no proof exists. A P = NP proof would imply efficient algorithms for optimization, cryptography, and AI problems; P ≠ NP underpins the security of virtually all modern cryptographic systems.

How It's Best Learned

Study why the question is hard to resolve: both directions require proving a lower bound (that no polynomial algorithm exists) or an algorithm, both of which have resisted all attempts. Examine the philosophical and practical consequences of each outcome.

Common Misconceptions

Explainer

From your study of nondeterministic complexity, you know that the class NP consists of decision problems where a "yes" answer can be *verified* in polynomial time given a suitable certificate. The class P consists of problems that can be *solved* in polynomial time. Every problem in P is also in NP — if you can solve it quickly, you can certainly verify a solution quickly. The P vs. NP question asks whether the reverse is also true: can every efficiently verifiable problem also be efficiently solved?

Consider the Boolean satisfiability problem (SAT): given a logical formula, is there an assignment of true/false to its variables that makes the formula true? If someone hands you a candidate assignment, you can plug in the values and check in polynomial time — so SAT is in NP. But finding a satisfying assignment from scratch seems to require searching through exponentially many possibilities. No one has found a polynomial-time algorithm for SAT, nor has anyone proved that no such algorithm exists. This is the essence of the P vs. NP problem.

The reason the question is so hard to resolve is that it demands something unusual from mathematics. Proving P = NP would require discovering a single clever algorithm — but proving P ≠ NP requires showing that *no possible algorithm*, no matter how ingenious, can solve certain problems in polynomial time. This is a lower bound proof, and lower bounds are notoriously difficult in complexity theory. Decades of attempts have produced barrier results (relativization, natural proofs, algebrization) showing that most known proof techniques are fundamentally incapable of resolving the question.

The practical stakes are enormous. If P = NP, then problems in scheduling, protein folding, circuit design, and artificial intelligence would all have efficient solutions — and modern cryptography, which relies on the assumed hardness of problems like integer factorization and discrete logarithms, would collapse. If P ≠ NP (the consensus belief), it would confirm that verification is fundamentally easier than discovery — a principle that resonates far beyond computer science. It would mean that creativity in finding solutions is genuinely harder than the mechanical task of checking them, providing a formal foundation for the security guarantees that underpin digital commerce, communication, and trust.

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 Problem

Longest path: 95 steps · 495 total prerequisite topics

Prerequisites (1)

Leads To (1)