Struct smol_graph::Graph [−][src]
pub struct Graph<Node, EdgeData> {
pub nodes: HashMap<NodeIndex, Node>,
pub edges: HashMap<EdgeIndex, Edge<EdgeData>>,
}
Expand description
A graph generic over node and edge data.
Nodes and edges are public because this graph makes no guarantees as to its structure beyond being a graph.
The graph does provide convenience functions for some simple operations over its data.
Fields
nodes: HashMap<NodeIndex, Node>
edges: HashMap<EdgeIndex, Edge<EdgeData>>
Implementations
Create a new graph with empty nodes and edges.
To initialize with capacity or other pre-defined settings, create it using public fields.
An iterator over this graph’s nodes, in no particular order.
An iterator over this graph’s edges, in no particular order.
A convenience function to insert an edge at a new index.
Attempt to remove an edge from this graph, returning it if it existed.
A convenience function to insert a node at a new index.