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

Return a unique id associated with a node.

Return the node associated with the given id.

The method panics if the id is invalid.

Return a unique id associated with an edge.

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

Return the edge associated with the given id.

The method returns the forward edge.

The method panics if the id is invalid.

Implementations on Foreign Types

Implementors