Topological sorting is the result you get when you sort the tree in order of decreasing finishing times. What this means is that you run the Depth First Search algorithm and once it’s complete, you’ll have two sets of values: discovery times and finishing times. Finishing times sorted in reverse will generate the topologically sorted list.
DFS starts traversing the tree at vertex A. Since it has been discovered, we’ll mark it with the number 1. Number 1 is used to indicate that it has been discovered first.

#sorting-algorithms #algorithms #computer-science #topological-sort #programming

Topological Sorting Visually Explained
1.25 GEEK