retworkx.topological_sort¶
- topological_sort(graph, /)¶
Return the topological sort of node indexes 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
- Raises
DAGHasCycle – if a cycle is encountered while sorting the graph