Cycles in Graphs
- A cycle in a directed graph
is a path such that is also an edge. - We call
cyclic if it has a cycle, otherwise acyclic.
CYCLICITY
Given: A directed graph
Return: YES if
- Topological Sort solves CYCLICITY in linear time
Lemma: Let
Proof: Let there be a vertex