Trait rs_graph::graph::IndexGraph
[−]
[src]
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.
Implementors
impl<'a, G, Gx, Nx, Ex, Ax> IndexGraph<'a> for Attributed<G, Gx, Nx, Ex, Ax> where
G: IndexGraph<'a>,
Gx: Default,
Nx: Default,
Ex: Default,
Ax: Default,impl<'a, T> IndexGraph<'a> for T where
T: WrappedGraph,
T::Graph: IndexGraph<'a>,impl<'a, ID> IndexGraph<'a> for LinkedListGraph<ID> where
ID: 'a + PrimInt + Unsigned,