Trait rs_graph::traits::IndexGraph
source · pub trait IndexGraph: Graph {
// Required methods
fn node_id(&self, u: Self::Node<'_>) -> usize;
fn id2node(&self, id: usize) -> Self::Node<'_>;
fn edge_id(&self, e: Self::Edge<'_>) -> usize;
fn id2edge(&self, id: usize) -> Self::Edge<'_>;
}
Expand description
Associates nodes and edges with unique ids.
Required Methods§
sourcefn id2node(&self, id: usize) -> Self::Node<'_>
fn id2node(&self, id: usize) -> Self::Node<'_>
Return the node associated with the given id.
The method panics if the id is invalid.