Scc

Trait Scc 

Source
pub trait Scc {
    type Vertex: Copy + Eq + Hash;

    // Required methods
    fn vertices(&self) -> impl '_ + IntoIterator<Item = Self::Vertex>;
    fn successors(
        &self,
        v: Self::Vertex,
    ) -> impl '_ + IntoIterator<Item = Self::Vertex>;

    // Provided method
    fn strongly_connected_components(&self) -> Components<Self::Vertex> { ... }
}
Expand description

Graph on which strongly connected components can be computed.

Required Associated Types§

Source

type Vertex: Copy + Eq + Hash

Graph vertex reference type.

Required Methods§

Source

fn vertices(&self) -> impl '_ + IntoIterator<Item = Self::Vertex>

Returns an iterator over the vertices of the graph.

Source

fn successors( &self, v: Self::Vertex, ) -> impl '_ + IntoIterator<Item = Self::Vertex>

Returns an iterator over the successors of the given vertex.

Provided Methods§

Source

fn strongly_connected_components(&self) -> Components<Self::Vertex>

Computes the strongly connected components of the graph.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl Scc for Vec<HashSet<usize>>

Source§

type Vertex = usize

Source§

fn vertices(&self) -> impl '_ + IntoIterator<Item = Self::Vertex>

Source§

fn successors( &self, v: Self::Vertex, ) -> impl '_ + IntoIterator<Item = Self::Vertex>

Source§

impl<T: Copy + Eq + Hash> Scc for HashMap<T, HashSet<T>>

Source§

type Vertex = T

Source§

fn vertices(&self) -> impl '_ + IntoIterator<Item = Self::Vertex>

Source§

fn successors( &self, v: Self::Vertex, ) -> impl '_ + IntoIterator<Item = Self::Vertex>

Implementors§