Trait rs_graph::graph::IndexGraph
source · 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;
}
Expand description
Associates nodes and edges with unique ids.
Required Methods
sourcefn id2node(&'a self, id: usize) -> Self::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.