[][src]Trait rs_graph::traits::IndexGraph

pub trait IndexGraph<'a>: Graph<'a> {
    fn node_id(&self, u: Self::Node) -> usize;
fn id2node(&'a self, id: usize) -> Self::Node;
fn edge_id(&self, e: Self::Edge) -> usize;
fn id2edge(&'a self, id: usize) -> Self::Edge; }

Associates nodes and edges with unique ids.

Required methods

fn node_id(&self, u: Self::Node) -> usize

Return a unique id associated with a node.

fn id2node(&'a self, id: usize) -> Self::Node

Return the node associated with the given id.

The method panics if the id is invalid.

fn edge_id(&self, e: Self::Edge) -> usize

Return a unique id associated with an edge.

The returned id is the same for the edge and its reverse edge.

fn id2edge(&'a self, id: usize) -> Self::Edge

Return the edge associated with the given id.

The method returns the forward edge.

The method panics if the id is invalid.

Loading content...

Implementations on Foreign Types

impl<'a, 'g: 'a, G> IndexGraph<'a> for &'g G where
    G: IndexGraph<'g>, 
[src]

Loading content...

Implementors

impl<'a, G> IndexGraph<'a> for Network<G> where
    G: Digraph<'a> + IndexGraph<'a>, 
[src]

impl<'a, G> IndexGraph<'a> for ReverseDigraph<G> where
    G: IndexGraph<'a>, 
[src]

impl<'a, G, Gx, Nx, Ex> IndexGraph<'a> for Attributed<G, Gx, Nx, Ex> where
    G: IndexGraph<'a>,
    Gx: Default,
    Nx: Default,
    Ex: Default
[src]

impl<'a, ID, N: 'a, E: 'a> IndexGraph<'a> for LinkedListGraph<ID, N, E> where
    ID: 'a + PrimInt + Unsigned
[src]

Loading content...