Chapter 7 · Time Complexity

P and NP

Computability asks whether a problem can be solved. Complexity asks whether it can be solved efficiently — in time polynomial in the input size.

Definition · P and NP

P is the class of languages decidable in polynomial time on a deterministic TM. NPis the class whose “yes” answers can be verified in polynomial time given a certificate.

P ⊆ NP · (P = NP?) is open

Sudoku, the traveling salesman decision problem, and Boolean satisfiability all live in NP: a proposed solution is easy to check, even if finding one seems hard.

Check your understanding

1. NP is the class of languages whose membership can be…

2. A problem is NP-complete if it is in NP and…

answer all 2 to submit