This allows lexicographical_topological_sort and TopologicalSorter to produce a topological sort that would have been found if the edges in the graph had reversed directions, without constructing the edge-flipped graph.
This is useful for graphs where we might want to do topological analysis from both ends of the data flow, for example in Qiskit where we occasionally want to find the "final" operations topologically.
This allows
lexicographical_topological_sort
andTopologicalSorter
to produce a topological sort that would have been found if the edges in the graph had reversed directions, without constructing the edge-flipped graph.This is useful for graphs where we might want to do topological analysis from both ends of the data flow, for example in Qiskit where we occasionally want to find the "final" operations topologically.
Close #1105