can provide an answer in polynomial time NP: questions for which an answer can be verified in polynomial time Subset sum problem {-7, -3, -2, 5, 8} -> {-3, -2, 5} 34
set of inputs NP-hard: a decision problem H in NP-hard when for any problem L in NP, there is polynomial-time reduction from L to H at least as hard as the hardest problems in NP 37
if a depth-first search of G yields no back edges. Back edge: edge (u, v) connecting vertex u to an ancestor v in depth-first tree (v ↝ u → v) =>: back edge exists then cycle exists <=: cycle exists then back edge exists 42
v ∈ V, if there is an edge in G from u to v, then f[v] < f[u]. Consider edge (u, v) explored by DFS, v cannot be gray since then that edge would be back edge. Therefore v must be white or black. If v is white, v is descendant of u, and so f[v] < f[u] If v is black, it has already been finished, so that f[v] < f[u] 43
graph G = (V, E), let u, v ∈ C, let u’, v’ ∈ C’, and suppose that there is a path u ↝ u’ in G. Then there cannot also be a path v’ ↝ v in G. if v’ ↝ v exists then both u ↝ u’ ↝ v’ and v’ ↝ v ↝ u exist C and C’ are not distinct SCCs 49
graph G = (V, E). Suppose that there is an edge (u, v) ∈ E, where u ∈ C and v ∈ C’. Then f(C) > f(C’) from x ∈ C to w ∈ C’ from y ∈ C’ cannot reach any vertex in C 50