[G11] Kahn's algorithm and directed cycles (2 pts) [00NV]

In class we explored Kahn's algorithm, which can be used to find a topological ordering of any DAG. Explain how we could extend Kahn's algorithm to find a directed cycle in directed graphs which are not a DAG.

Context

Graph problems [00LW]

Related

Algorithm. Kahn's Algorithm [00NI]

Lemma. DAG \to indegree 0 [00NE]

Definition. Topological ordering [00NB]

Definition. DAG [00N9]

DAGs and topological ordering [00N8]

Remark. Generalizing from undirected to directed graphs [00N7]