Module traitgraph::interface [−][src]
The graph traits.
The traits are roughly split up by different access types:
- immutable reference (
ImmutableGraphContainer
) - mutable reference (
MutableGraphContainer
) - immutable reference that must outlive the return value (
TraversableGraph
)
As it happens, the access types match well to common graph use cases, i.e. queries for nodes and edges, adding and removing nodes and edges as well as iterating over the neighbors of a node.
Modules
subgraph | A set of traits for subgraphs. A subgraph is a graph that is backed by an actual graph implementation, but that filters out some nodes or edges. |
Structs
Edge | An edge represented as a pair of node indices. |
Neighbor | The neighbor of a node, given as the edge used to reach the neighbor node as well as the neighbor node itself. |
Enums
NodeOrEdge | An enum encoding an index that can either be a node index or an edge index. |
Traits
DynamicGraph | A graph implementing all common graph traits, including those requiring mutable access. This is a useful shortcut for generic type bounds when the graph should be mutated. |
GraphBase | Contains the associated types of a graph. |
ImmutableGraphContainer | A container that contains a set of nodes and edges. |
MutableGraphContainer | A container that allows adding and removing nodes and edges. |
NavigableGraph | A graph that can be navigated, i.e. that can iterate the neighbors of its nodes. |
StaticGraph | A graph implementing all common graph traits that do not require mutable access. This is a useful shortcut for generic type bounds when the graph should not be mutated. |
WalkableGraph | A helper trait to get the correct walk type from a graph. This is the factory pattern, where a graph is a factory for walks. |