Qiskit / rustworkx

A high performance Python graph library implemented in Rust.
https://www.rustworkx.org
Apache License 2.0
1.03k stars 145 forks source link

Add `reverse` argument to topological sorters #1108

Closed jakelishman closed 6 months ago

jakelishman commented 6 months ago

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.

Close #1105

coveralls commented 6 months ago

Pull Request Test Coverage Report for Build 8116939754

Details


Totals Coverage Status
Change from base Build 8105396148: 0.03%
Covered Lines: 16820
Relevant Lines: 17427

💛 - Coveralls
jakelishman commented 6 months ago

Sorry for disappearing for a while there. I've added the helper in 12a91ec.