[−][src]Trait graphrepresentations::graph::Graph
A basic graph.
Graphs defining this trait can act as containers for nodes and edges. Their functionality is very limited though, as not even navigation is defined.
Associated Types
type NodeIdIterator: Iterator<Item = NodeId>
An iterator over all node ids of a graph.
type EdgeIdIterator: Iterator<Item = EdgeId>
An iterator over all edge ids of a graph.
Required methods
fn node_len(&self) -> IdType
The amount of nodes in the graph.
fn edge_len(&self) -> IdType
The amount of edges in the graph.
fn node_id_iter(&self) -> Self::NodeIdIterator
Returns an iterator over all node ids in the graph.
fn edge_id_iter(&self) -> Self::EdgeIdIterator
Returns an iterator over all edge ids in the graph.
fn node_data(&self, id: NodeId) -> &N
Returns a reference to a nodes data, identified by the given id.
fn edge_data(&self, id: EdgeId) -> &E
Returns a reference to an edges data, identified by the given id.
fn edge(&self, id: EdgeId) -> EdgeRef<E>
Returns an edge instance, identified by the given id.
fn edge_start(&self, id: EdgeId) -> NodeId
Returns the start node of the edge identified by the given id.
fn edge_end(&self, id: EdgeId) -> NodeId
Returns the end node of the edge identified by the given id.
fn is_node_id_valid(&self, id: NodeId) -> bool
Returns true if the given NodeId
refers to a node in this graph.
fn is_edge_id_valid(&self, id: EdgeId) -> bool
Returns true if the given EdgeId
refers to an edge in this graph.