A directed graph
with vertex set
and edge set
is acyclic if there is no directed cycle.
Develop a linear-time algorithm, base on the depth-first search, to discern whether a given directed graph
is acyclic or not and further execute a topological sort.
See [SED00] for a detailed answer.