Trait GraphAlgorithms

Source
pub trait GraphAlgorithms {
    // Required methods
    fn components(&self) -> Vec<VertexSet> ;
    fn degeneracy(&self) -> (u32, u32, Vec<Vertex>, VertexMap<u32>);
    fn is_bipartite(&self) -> BipartiteWitness;
}
Expand description

Implements various basic graph algorithms for the Graph trait.

Required Methods§

Source

fn components(&self) -> Vec<VertexSet>

Returns the connected components of this graph.

Source

fn degeneracy(&self) -> (u32, u32, Vec<Vertex>, VertexMap<u32>)

Computes the degeneracy (approximate), core-numbers and a degeneracy-ordering of this graph. The return value contains four values:

  1. A lower bound on the degeneracy,
  2. an upper bound on the degeneracy,
  3. the computed degeneracy ordering, and
  4. the core-numbers of each vertex in this ordering.
Source

fn is_bipartite(&self) -> BipartiteWitness

Tests whether the graph is bipartite and returns a witness.

Implementors§

Source§

impl<G> GraphAlgorithms for G
where G: Graph,