topSort(D)
topSort(D,S)
This method outputs a HashTable with keys digraph, map and newDigraph, where digraph is the original digraph, map is the relation between old ordering and the new ordering of vertices and newDigraph is the Digraph with topologically sorted vertices. This method needs the input to be directed acyclic graph (DAG). S provides the preference given to the vertices in order to break ties and provide unique topological sorting to the DAG.
Permissible values of S are: "random", "max", "min", "degree".
S = "random" randomly sort the vertices of graph which have same precedence at any instance of the algorithm to break the ties.
S = "min" sort the vertices according to their indices (from low to high) to break the ties.
S = "max" sort the vertices according to their indices (from high to low) to break the ties.
S = "degree" sort the vertices according to their degree (from low to high) to break the ties.








The object topSort is a method function.