Trait fera_graph::choose::Choose [] [src]

pub trait Choose: WithEdge {
    fn choose_vertex<R: Rng>(&self, rng: R) -> Option<Vertex<Self>>;
fn choose_out_neighbor<R: Rng>(
        &self,
        v: Vertex<Self>,
        rng: R
    ) -> Option<Vertex<Self>>;
fn choose_edge<R: Rng>(&self, rng: R) -> Option<Edge<Self>>;
fn choose_out_edge<R: Rng>(
        &self,
        v: Vertex<Self>,
        rng: R
    ) -> Option<Edge<Self>>; fn choose_vertex_iter<R: Rng>(&self, rng: R) -> ChooseVertexIter<Self, R> { ... }
fn choose_out_neighbor_iter<R: Rng>(
        &self,
        v: Vertex<Self>,
        rng: R
    ) -> ChooseOutNeighborIter<Self, R> { ... }
fn choose_edge_iter<R: Rng>(&self, rng: R) -> ChooseEdgeIter<Self, R> { ... }
fn choose_out_edge_iter<R: Rng>(
        &self,
        v: Vertex<Self>,
        rng: R
    ) -> ChooseOutEdgeIter<Self, R> { ... }
fn random_walk<R: Rng>(&self, rng: R) -> RandomWalk<Self, R> { ... } }

A graph from which vertices and edges can be randomly selected.

See the module documentation for examples.

Required Methods

Returns a random vertex of this graph or None if the graph has no vertices.

Returns a random neighbor vertex of v or None if v has no neighbors.

Returns a random edge of this graph or None if the graph has no edges.

Returns a random out edge of v or None if v has no out edges.

Provided Methods

Returns an iterator that repeatedly calls choose_vertex.

Returns an iterator that repeatedly calls choose_out_neighbor(v).

Returns an iterator that repeatedly calls choose_edge.

Returns an iterator that repeatedly calls choose_out_edge(v).

Returns a iterator that produces a sequence of random edges that forms a walk, that is, the target vertex of the previous edge is the source vertex of the next edge.

Implementations on Foreign Types

impl<'a, G> Choose for &'a G where
    G: 'a + Choose
[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

Implementors