rustworkx.topological_sort#

topological_sort(graph, /)#

Return the topological sort of node indices from the provided graph

Parameters:

graph (PyDiGraph) – The DAG to get the topological sort on

Returns:

A list of node indices topologically sorted.

Return type:

NodeIndices

Raises:

DAGHasCycle – if a cycle is encountered while sorting the graph