01Chapter 1: Problems as Yes/No QuestionsComplexity theory classifies problems by how hard they are. Before it can do that, it needs a precise definition of "problem." This chapter gives that definition. It explains why the theory works with questions that have only two possible answers, and it shows how to separate a problem from its indi6 min read
02Chapter 2: Why Polynomial Time Means TractableThis chapter assumes you can read Python, know Big-O notation, and are comfortable with logarithms and exponents. The goal is to explain why complexity theory draws its main line between polynomial and exponential running time, and why that line stays put when you change hardware, programming langua5 min read
03Chapter 3: P: Problems We Can Solve EfficientlyThis chapter assumes you already know what a decision problem is and why we treat polynomial running time as "efficient". Both ideas were covered in the previous two chapters. You should also be comfortable with Big-O notation, adjacency lists, and reading short Python programs.6 min read
04Chapter 4: Checking an Answer Versus Finding OneThis chapter assumes you can read Python, use Big-O notation, and know what a decision problem and a polynomial-time algorithm are from the earlier chapters. You should also know the basic graph terms: vertex, edge, and adjacency list.4 min read
05Chapter 5: NP: Problems Whose Answers We Can Check EfficientlyThis chapter assumes you already know four things from earlier chapters. A decision problem is a question whose answer for each input is yes or no. P is the class of decision problems solvable in polynomial time. A certificate is a piece of evidence that supports a yes answer. A verifier is an algor5 min read
06Chapter 6: The Nondeterministic Definition of NPThe previous chapter defined NP with verifiers. A problem is in NP when a polynomial-time algorithm can check a short certificate for every yes-instance. This chapter covers the original definition, which uses nondeterministic Turing machines, and shows that the two definitions describe the same cla5 min read
07Chapter 7: Reductions: Comparing the Difficulty of ProblemsThis chapter assumes you know what a decision problem is, what the classes P and NP are, and how to read Big-O running times. It also assumes you are comfortable with basic graph terms: vertices, edges, and subsets of vertices.6 min read
08Chapter 8: What It Means to Be NP-HardThis chapter assumes you already know three things from earlier chapters. You should know the definition of NP through polynomial-time verifiers. You should know what a polynomial-time many-one reduction is, written A ≤p B. You should also be comfortable reading short Python code that uses `itertool6 min read
09Chapter 9: NP-Complete: The Hardest Problems in NPThis chapter assumes you already know three things from earlier chapters. NP is the class of decision problems whose "yes" answers can be checked in polynomial time using a certificate. A polynomial-time many-one reduction from A to B, written A ≤p B, turns every instance of A into an instance of B 5 min read
10Chapter 10: Cook-Levin: SAT Is NP-CompleteThis chapter assumes you know the definitions of NP, polynomial-time many-one reductions, and NP-completeness from earlier chapters. It also assumes you can read Boolean formulas and simple Python. Here we look at the theorem that showed NP-complete problems exist at all, and at why its proof works.5 min read
11Chapter 11: A Tour of Classic NP-Complete ProblemsThis chapter assumes you know the definitions of P, NP, NP-hard, and NP-complete from earlier chapters. It also assumes you know that SAT is NP-complete by the Cook-Levin theorem, and that you can read Python and basic graph terminology. The goal here is recognition. When a problem from work lands o5 min read
12Chapter 12: Worked Reduction: Independent Set to Vertex CoverThis chapter works through one reduction from start to finish. It assumes you have read the earlier chapters on polynomial-time many-one reductions, NP-hardness, and NP-completeness. It also assumes you can read Python and know basic graph terms such as vertex, edge, and adjacency. Throughout, graph5 min read
13Chapter 13: From Optimization Problems to Decision ProblemsMost problems engineers care about ask for the best answer: the shortest route, the smallest set of servers, the cheapest schedule. The theory of P and NP, as defined in earlier chapters, covers only yes/no questions. This chapter connects the two. It shows how an optimization problem turns into a d5 min read
14Chapter 14: The P vs NP Question and Why It MattersThis chapter assumes you already know the definitions of P, NP, polynomial-time reductions, and NP-completeness from earlier chapters. It also assumes you can read short Python programs and know the Cook-Levin theorem's statement that SAT is NP-complete. Here those pieces come together in one open q5 min read
15Chapter 15: co-NP: Efficiently Checkable No AnswersThis chapter assumes you know the definitions of P and NP from earlier chapters, can read a polynomial-time verifier written in Python, and know what an NP-complete problem is. It also uses SAT and 2-coloring from earlier chapters.5 min read
16Chapter 16: Between P and NP-Complete: NP-Intermediate ProblemsThis chapter assumes you already know the definitions of P, NP, NP-hard, and NP-complete. It also assumes you know what a polynomial-time many-one reduction is and what co-NP means. We now ask whether every problem in NP falls into one of two groups: easy (in P) or hardest (NP-complete).5 min read
17Chapter 17: Pseudo-Polynomial Time and Subset SumThis chapter assumes you already know three things from earlier chapters: Subset Sum is NP-complete, a polynomial-time algorithm runs in time bounded by a polynomial in the input size, and a reduction carries hardness from one problem to another. You should also be comfortable reading Big-O bounds a5 min read
18Chapter 18: Handling NP-Hard Problems in Real SystemsThis chapter assumes you know what NP-hard and NP-complete mean, that you can read Python, and that you know basic graph terms and Big-O notation. Earlier chapters showed that no polynomial-time algorithm is known for any NP-complete problem. This chapter covers what engineers do when a real system 4 min read