dsagraphs
What should a topological ordering tell you?
Anonymous
For a directed acyclic graph, each edge should point from an earlier vertex to a later one in the ordering. Repeatedly add a vertex with indegree zero, then reduce the indegree of its outgoing neighbors. If some vertices remain, the graph contains a cycle.
0