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§
Sourcefn components(&self) -> Vec<VertexSet> ⓘ
fn components(&self) -> Vec<VertexSet> ⓘ
Returns the connected components of this graph.
Sourcefn degeneracy(&self) -> (u32, u32, Vec<Vertex>, VertexMap<u32>)
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:
- A lower bound on the degeneracy,
- an upper bound on the degeneracy,
- the computed degeneracy ordering, and
- the core-numbers of each vertex in this ordering.
Sourcefn is_bipartite(&self) -> BipartiteWitness
fn is_bipartite(&self) -> BipartiteWitness
Tests whether the graph is bipartite and returns a witness.