Solve vs Verify: P vs NP Made Concrete
Checking an answer can be instant while finding one takes forever. Watch a DPLL solver grind through an exponential search tree while a checker verifies any solution in a glance: the gap behind P vs NP.
Solve vs Verify
Here is one Boolean formula in conjunctive normal form: a stack of clauses, each a group of three literals joined by or, all clauses joined by and. Two questions look almost identical. Solving asks whether any assignment of true and false to the variables makes the whole formula true. Verifying asks whether one specific assignment you are handed actually works. The first can take an exponential search. The second is a quick scan. That gap is what P vs NP is about.
NP is the class of verify-fast problems. A decision problem is in NP when every yes-instance has a certificate that a polynomial-time checker can confirm. SAT fits: the certificate is a satisfying assignment, and the verifier above reads each clause once. P is the class of problems you can solve in polynomial time. Every problem in P is also in NP, because solving fast is at least as good as checking fast.
SAT is NP-complete. It is in NP, and every other NP problem can be rewritten as a SAT instance in polynomial time. That reduction is why these problems travel together: a fast algorithm for SAT would give a fast algorithm for every problem in NP, from graph colouring to the travelling salesman decision problem. They are all the same hardness in disguise.
P vs NP asks whether solving is really harder than verifying. For SAT and the thousands of other NP-complete problems, no polynomial-time solver is known: the best general methods still search a tree that can blow up exponentially, exactly as you saw above. But nobody has proved that a fast solver cannot exist. P = NP would mean every quickly-checkable problem is also quickly solvable; P ≠ NP would mean some are genuinely harder to solve than to check. Which one is true is still open. The exponential search you watched is the best we currently know how to do, not a proof that nothing better exists.
Real 3-SAT at clause-to-variable ratio 4.2, instances seeded by mulberry32 so they are reproducible. DPLL with unit propagation drives the search; the verifier is a single linear pass over the clauses.