pub struct Components<V> { /* private fields */ }Expand description
Strongly connected components.
Implementations§
Source§impl<V> Components<V>
impl<V> Components<V>
Sourcepub fn iter(&self) -> Iter<'_, V> ⓘ
pub fn iter(&self) -> Iter<'_, V> ⓘ
Returns an iterator over the strongly connected components.
Sourcepub fn vertex_component_index(&self, v: &V) -> Option<usize>
pub fn vertex_component_index(&self, v: &V) -> Option<usize>
Returns the index of the given vertex’s strongly connected component.
Sourcepub fn get_by_index(&self, i: usize) -> Option<&[V]>
pub fn get_by_index(&self, i: usize) -> Option<&[V]>
Returns the component with the given index i.
Sourcepub fn get(&self, v: &V) -> Option<&[V]>
pub fn get(&self, v: &V) -> Option<&[V]>
Return the given vertex’s strongly connected component.
pub fn successors(&self, i: usize) -> Option<impl '_ + Iterator<Item = usize>>
pub fn is_cyclic(&self, i: usize) -> bool
pub fn direct_successors(&self, i: usize) -> Option<HashSet<usize>>
Sourcepub fn depths(&self) -> Vec<usize>
pub fn depths(&self) -> Vec<usize>
Returns the depth of each component.
The depth of a component is the maximum of the depth of its predecessors plus 1. A component with no predecessors has depth 0.
pub fn predecessors(&self) -> Vec<HashSet<usize>>
Sourcepub fn order_by_depth(&self) -> Vec<usize>
pub fn order_by_depth(&self) -> Vec<usize>
Order components by depth.
The depth of a component is the maximum of the depth of its predecessors plus 1. A component with no predecessors has depth 0.
Trait Implementations§
Auto Trait Implementations§
impl<V> Freeze for Components<V>
impl<V> RefUnwindSafe for Components<V>where
V: RefUnwindSafe,
impl<V> Send for Components<V>where
V: Send,
impl<V> Sync for Components<V>where
V: Sync,
impl<V> Unpin for Components<V>where
V: Unpin,
impl<V> UnwindSafe for Components<V>where
V: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more