pub trait Graph<NI>where
NI: Idx,{
// Required methods
fn node_count(&self) -> NI;
fn edge_count(&self) -> NI;
}
Expand description
A graph is a tuple (N, E)
, where N
is a set of nodes and E
a set of
edges. Each edge connects exactly two nodes.
Graph
is parameterized over the node index type Node
which is used to
uniquely identify a node. An edge is a tuple of node identifiers.
Required Methods§
sourcefn node_count(&self) -> NI
fn node_count(&self) -> NI
Returns the number of nodes in the graph.
sourcefn edge_count(&self) -> NI
fn edge_count(&self) -> NI
Returns the number of edges in the graph.