Given a directed, acyclic graph, a *topological ordering*
of the vertices is an ordering of the vertices
v_{1},v_{2},…,v_{n} such that every edge (v_{i}, v_{j})
in the graph goes forward in the ordering (that is, i < j).

We defined the DFS *post-order* number of the vertices
of the digraph to be the numbering that numbers the vertices
in the order in which DFS finishes exploring them.

In a DAG, the DFS produces no back edges (see CyclesByDFS and DFSInDiGraphs).

For any edge (U,W), it must be that the DFS finishes exploring W before it finishes exploring U. Thus, the post-order numbering of the vertices, reversed, gives a topological ordering of the vertices.

Thus, DFS can be used to do topological sorting in linear time.

- GoodrichAndTomassia section 6.4.4 describes a different linear-time algorithm