Directed Graphs and Topological Sorting