01Chapter 1: Problems as Yes/No QuestionsComplexity theory sorts problems by how hard they are. To compare problems fairly, it first puts each one in the same shape: a question with a yes or no answer. This chapter explains that shape and why it is used.2 min read
02Chapter 2: Why Polynomial Time Means TractableThis chapter assumes you can read Big-O notation and simple Python. It explains why complexity theory draws its main line between polynomial and exponential running times.2 min read
03Chapter 3: P: Problems We Can Solve EfficientlyThis chapter assumes you know Big-O notation, can read Python, and know basic graph terms such as vertices, edges, and adjacency lists. It builds on the two previous chapters: problems stated as yes/no questions, and polynomial running time as the test for tractability.2 min read
04Chapter 4: Checking an Answer Versus Finding OneThis chapter assumes you can read Python, know Big-O notation, and have met decision problems and polynomial time in the earlier chapters. Here we separate two tasks that are easy to confuse: finding a solution and checking a proposed one.2 min read
05Chapter 5: NP: Problems Whose Answers We Can Check EfficientlyThis chapter assumes you know the class P, Big-O notation, and the idea of a certificate from the previous chapter. Here we turn the certificate idea into a precise definition of NP.2 min read
06Chapter 6: The Nondeterministic Definition of NPThis chapter assumes you already know the verifier definition of NP from the previous chapter, and that you have a rough idea of what a Turing machine is. Here we look at the original definition of NP, the one its name comes from, and show that it describes the same class.2 min read
07Chapter 7: Reductions: Comparing the Difficulty of ProblemsThis chapter assumes you know what decision problems are, what the class P is, and basic graph terms such as vertices, edges, and complement graphs. A reduction lets you say "problem A is no harder than problem B" without knowing how to solve either one.2 min read
08Chapter 8: What It Means to Be NP-HardThis chapter assumes you already know what the class NP is and what a polynomial-time many-one reduction is. It also assumes that, when we write A ≤p B, you read it as "A reduces to B in polynomial time."2 min read
09Chapter 9: NP-Complete: The Hardest Problems in NPThis chapter assumes you know the definitions of P and NP from earlier chapters. It also assumes you know what a polynomial-time many-one reduction is and what NP-hard means. If you write A ≤p B, that means A reduces to B in polynomial time.2 min read
10Chapter 10: Cook-Levin: SAT Is NP-CompleteThis chapter assumes you know the definitions of NP, polynomial-time reductions, and NP-hardness from the earlier chapters. You should also be comfortable with Boolean formulas in conjunctive normal form (CNF). A CNF formula is an AND of clauses, where each clause is an OR of literals.2 min read
11Chapter 11: A Tour of Classic NP-Complete ProblemsThis chapter assumes you know the definitions of NP and NP-completeness and the Cook-Levin result that SAT is NP-complete. You should also be able to read simple Python and basic graph terminology.2 min read
12Chapter 12: Worked Reduction: Independent Set to Vertex CoverThis chapter assumes you know what a polynomial-time many-one reduction is, that you have seen the definitions of NP-hard and NP-complete, and that you can read basic graph code in Python. It builds on the previous chapter's tour of classic NP-complete problems, where Independent Set appeared.3 min read
13Chapter 13: From Optimization Problems to Decision ProblemsThis chapter assumes you know Big-O notation, can read short Python functions, and remember the Vertex Cover problem from the earlier tour of classic NP-complete problems.2 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 know that SAT is NP-complete by the Cook-Levin theorem.2 min read
15Chapter 15: co-NP: Efficiently Checkable No AnswersThis chapter assumes you already know the definition of NP from the verifier chapter, what a certificate is, and the SAT problem from the Cook-Levin chapter.2 min read
16Chapter 16: Between P and NP-Complete: NP-Intermediate ProblemsThis chapter assumes you already know the definitions of P, NP, polynomial-time reductions, and NP-completeness from earlier chapters. It also assumes you have seen the P vs NP question. Here we ask whether every problem in NP must be either easy (in P) or as hard as possible (NP-complete).2 min read
17Chapter 17: Pseudo-Polynomial Time and Subset SumThis chapter assumes you know the Subset Sum problem from the tour of classic NP-complete problems. You should also know Big-O notation and the rule that "polynomial time" means polynomial in the input size.2 min read
18Chapter 18: Handling NP-Hard Problems in Real SystemsThis chapter assumes you know what NP-hard and NP-complete mean, that you have seen Vertex Cover and SAT, and that you understand the difference between pseudo-polynomial and polynomial time. An NP-hardness proof does not mean you should stop working on the problem. It means you should stop looking 2 min read