Trait fera_graph::builder::WithBuilder [] [src]

pub trait WithBuilder: WithEdge {
    type Builder: Builder<Graph = Self>;
    fn builder(num_vertices: usize, num_edges: usize) -> Self::Builder { ... }
fn new_with_edges<I>(n: usize, edges: I) -> Self
    where
        I: IntoIterator<Item = (usize, usize)>
, { ... }
fn new_empty(n: usize) -> Self { ... }
fn new_complete(n: usize) -> Self
    where
        Self: WithEdge<Kind = Undirected>
, { ... }
fn new_complete_binary_tree(h: u32) -> Self
    where
        Self: WithEdge<Kind = Undirected>
, { ... }
fn new_random_tree<R: Rng>(n: usize, rng: R) -> Self { ... }
fn new_random_tree_with_diameter<R: Rng>(
        n: u32,
        d: u32,
        rng: R
    ) -> Option<Self> { ... }
fn new_gn<R>(n: usize, rng: R) -> Self
    where
        Self::Kind: UniformEdgeKind,
        R: Rng
, { ... }
fn new_gn_connected<R: Rng>(n: usize, rng: R) -> Self
    where
        Self::Kind: UniformEdgeKind
, { ... }
fn new_gnm<R>(n: usize, m: usize, rng: R) -> Option<Self>
    where
        Self::Kind: UniformEdgeKind,
        R: Rng
, { ... }
fn new_gnm_connected<R: Rng>(n: usize, m: usize, rng: R) -> Option<Self>
    where
        Self::Kind: UniformEdgeKind
, { ... } }

A graph that has a Builder.

See the module documentation for examples.

Associated Types

The builder for this graph type.

Provided Methods

Creates a new builder for a graph of this type with n vertices and initial capacity for m edges.

Creates a new graph with n vertices from edges iterator.

Panics

If some edges is not valid.

Creates a graph with n vertices and no edges.

Creates a complete graph with n vertices.

A complete graph has an edge between each pair of vertices.

Creates a graph that is a complete binary tree with height h.

In complete binary tree all interior vertices have two children an all leaves have the same depth.

Creates a graph with n vertices that is a tree, that is, is connected and acyclic.

The graph has n - 1 edges if n > 0 or zero edges if n = 0.

See https://doi.org/10.1109/SFCS.1989.63516.

Similar to [new_random_tree] but creates a tree with diameter d. Returns None if the diameter is invalid.

Creates a random graph with n vertices.

Creates a random connected graph with n vertices.

Creates a random graph with n vertices and m edges.

Returns None with m exceeds the maximum number of edges.

Creates a random connected graph (weakly connected if Self is a digraph) with n vertices and m edges.

Returns None if m exceeds the maximum number of edges or if m is less than n - 1.

Implementors