Consequences of DFS (cont.)
Lemma : Suppose run DFSTopoSort on graph G which is a DAG. If Number(v) < Number(w), then (w,v) not in E.
Number(v) < Number(w) => RDFS(w) completes first.
At that time, either:
Enc(v) = false ----> no edge (w,v) ; search of w would have followed it.
Enc(v) == true ----> exploration of v in progress => path from v to w; edge (w,v) would imply cycle.