
Polynomial-Time Computability 147
Example: The set of three-colorable graphs (as a set of binary strings) is in NP. A
graph w is three-colorable iff there exists some three-coloring y, such that w is properly
colored by y (that is, adjacent vertices are always different colors).
Similarly, the set of Hamiltonian graphs is in NP. Here, the evidence y is a Hamil-
tonian cycle in the graph w.
Another example of a language in NP is SAT, the set of satisfiable formulas of sen-
tential logic. The truth-table method taught in logic courses for determining whether
a formula with n sentence symbols is satisfiable involves forming all 2
n
lines of the
formula’s truth ...