complexitygraphs
A topological order can reveal a cycle
Anonymous
For a directed graph, repeatedly remove a node with indegree zero and reduce the indegree of its neighbors. If fewer than V nodes are removed, some nodes remain in cycles. The adjacency-list version takes O(V + E) time.
0