topo_sort
A "cycle-safe" topological sort for a set of nodes with dependencies in Rust.
Basically, it allows sorting a list by its dependencies while checking for
cycles in the graph. If a cycle is detected, a CycleError is returned from the
iterator.
Usage
[]
= "0.1"
A basic example:
use TopoSort;
...or using iteration:
use TopoSort;
Cycle detected:
use TopoSort;
Algorithm
This is implemented using Kahn's algorithm. While basic caution was taken not to do anything too egregious performance-wise, the author's use cases are not performance sensitive, and it has not been optimized in any way.
Maintenance
The crate currently meets the needs of the author and probably will not see significant new features. It will, however, continue to be updated if required for future compatibility/etc.
License
This project is licensed optionally under either:
- Apache License, Version 2.0, (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or https://opensource.org/licenses/MIT)