toposort-scc
An implementation of Kahn's algorithm for topological sorting and Kosaraju's algorithm for strongly connected components.
This crate provides:
O(V + E)
time and O(V)
additional space (Kahn's algorithm)O(V + E)
time and O(V)
additional space (Kosaraju's algorithm)The id-arena
feature adds an additional wrapper type that allows topological
sorting and finding of strongly connected components on arbitrary graph
structures built with the id-arena
crate by creating a proxy graph that is
sorted and returning a list of indices into the original graph.
Documentation is provided via rustdoc, and can be built with cargo doc
, or
viewed online at
docs.rs/toposort-scc/.
Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.