Struct petgraph::algo::TarjanScc [−][src]
A reusable state for computing the strongly connected components using Tarjan's algorithm.
Implementations
impl<N> TarjanScc<N>
[src]
pub fn new() -> Self
[src]
Creates a new TarjanScc
pub fn run<G, F>(&mut self, g: G, f: F) where
G: IntoNodeIdentifiers<NodeId = N> + IntoNeighbors<NodeId = N> + NodeIndexable<NodeId = N>,
F: FnMut(&[N]),
N: Copy + PartialEq,
[src]
G: IntoNodeIdentifiers<NodeId = N> + IntoNeighbors<NodeId = N> + NodeIndexable<NodeId = N>,
F: FnMut(&[N]),
N: Copy + PartialEq,
[Generic] Compute the strongly connected components using Tarjan's algorithm.
Calls f
for each strongly strongly connected component (scc).
The order of node ids within each scc is arbitrary, but the order of
the sccs is their postorder (reverse topological sort).
For an undirected graph, the sccs are simply the connected components.
This implementation is recursive and does one pass over the nodes.
Trait Implementations
Auto Trait Implementations
impl<N> RefUnwindSafe for TarjanScc<N> where
N: RefUnwindSafe,
[src]
N: RefUnwindSafe,
impl<N> Send for TarjanScc<N> where
N: Send,
[src]
N: Send,
impl<N> Sync for TarjanScc<N> where
N: Sync,
[src]
N: Sync,
impl<N> Unpin for TarjanScc<N> where
N: Unpin,
[src]
N: Unpin,
impl<N> UnwindSafe for TarjanScc<N> where
N: UnwindSafe,
[src]
N: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,