Warning
The documentation for retworkx has migrated to:
https://qiskit.org/documentation/retworkx
These docs will no longer be updated.
retworkx.lexicographical_topological_sort¶
- lexicographical_topological_sort(dag, key, /)¶
Get the lexicographical topological sorted nodes from the provided DAG
This function returns a list of nodes data in a graph lexicographically topologically sorted using the provided key function.
- Parameters
dag (PyDiGraph) – The DAG to get the topological sorted nodes from
key (callable) – key is a python function or other callable that gets passed a single argument the node data from the graph and is expected to return a string which will be used for sorting.
- Returns
A list of node’s data lexicographically topologically sorted.
- Return type
list