Module prepona::graph::subgraph [−][src]
Subgraphs are views of graphs.
There are multiple types of subgraphs:
FrozenSubgraph
: Is a subgraph that can not get mutated(An immutable view of the graph).Subgraph
: Is a subgraph that can get mutated but you can not mutate the graph through this type of subgraph.MutSubgraph
: Is a subgraph that can get mutated and can mutate the graph it’s representing.
Each subgraph must at least implement AsFrozenSubgraph
trait.
This makes sure that from point of view of algorithms, there is no difference from graph and subgraphs.
A default Subgraph
and MutSubgraph
is defined so you can concentrate on additional functionalities that you want to provide.
For example ShortestPathSubgraph
is composed of a Subgraph
and a distance map.
So it just forwards every call of AsSubgraph
functions to the inner Subgraph
.
Structs
MultiRootSubgraph | A subgraph with some vertices elected as root. |
MutSubgraph | Default implementation of |
ShortestPathSubgraph | Subgraph containing edges and vertices that participate in the shortest path tree. |
Subgraph | Default implementation of |
Traits
AsFrozenSubgraph | Describes a subgraph that can not get mutated(Not itself nor the graph it’s representing). |
AsMutSubgraph | Describes a subgraph that can mutate and also can mutate the graph it’s representing. |
AsSubgraph | Describes a subgraph that can mutate but the graph that it represents, can not mutate. |