rustworkx
rustworkx copied to clipboard
Add `reverse` argument to topological sorters
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
Pull Request Test Coverage Report for Build 8116939754
Details
- 18 of 18 (100.0%) changed or added relevant lines in 2 files are covered.
- No unchanged relevant lines lost coverage.
- Overall coverage increased (+0.03%) to 96.517%
| Totals | |
|---|---|
| Change from base Build 8105396148: | 0.03% |
| Covered Lines: | 16820 |
| Relevant Lines: | 17427 |
💛 - Coveralls
Sorry for disappearing for a while there. I've added the helper in 12a91ec.