This function outputs a list of vertices in a topologically sorted order of a 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 topologicalSort is a method function.