![]() |
Elementa v8.0.0
Minimalistic library for any C++ application (C++11 and up)
|
Types and functionality of paths in graphs.

Classes | |
| struct | elementa::adts::graphs::GPathKindType< KIND > |
| A type corresponding to each constant value of the kind of a path. More... | |
| class | elementa::adts::graphs::GPath< Vertex, Edge, KIND > |
| A path in a graph whose vertices are of type Vertex and edges of type Edge. More... | |
Typedefs | |
| template<class Vertex , class Edge , GPathKind KIND> | |
| using | elementa::adts::graphs::GPathElement = typename std::conditional< KIND==GPathKind::kVertexPath, typename Graph< Vertex, Edge >::viterator, typename Graph< Vertex, Edge >::eiterator >::type |
| Type of the elements of a path, according to its kind. More... | |
| template<class Vertex , class Edge , class Weight = double> | |
| using | elementa::adts::graphs::EdgeWeightFunction = std::function< Weight(const typename Graph< Vertex, Edge >::eiterator &) > |
| A family of functions that return the weight of an edge. More... | |
Functions | |
| elementa::adts::graphs::ELE_CLASS_ENUM (GPathKind, kVertexPath, kEdgePath) | |
| Kinds of paths. | |
| constexpr GPathKind | elementa::adts::graphs::kOtherGPathKind (GPathKind kid) |
| The kind opposite to a given one. More... | |
| template<class Vertex , class Edge > | |
| constexpr double | elementa::adts::graphs::trivial_edge_weight (const typename Graph< Vertex, Edge >::eiterator &) noexcept |
| A family of functions that return 1.0 as the weight of any edge. More... | |
| template<class Vertex , class Edge > | |
| constexpr double | elementa::adts::graphs::value_edge_weight (const typename Graph< Vertex, Edge >::eiterator &eit) noexcept |
| A family of functions that return the edge value as the weight. More... | |
| struct elementa::adts::graphs::GPathKindType |
A type corresponding to each constant value of the kind of a path.
Definition at line 62 of file graph_paths.h.
| class elementa::adts::graphs::GPath |
A path in a graph whose vertices are of type Vertex and edges of type Edge.
Definition at line 78 of file graph_paths.h.


Public Attributes | |
| T | elements |
| STL member. | |
Public Member Functions | |
Methods | |
| GPath< Vertex, Edge, kOtherGPathKind(KIND) > | other (const BaseGraph &g, const typename BaseGraph::EPred &epred=BaseGraph::trivial_epred) const |
| Construct a path of the other kind equivalent to this one. More... | |
| std::string | to_string (const BaseGraph &g, const std::function< std::string(const Vertex &vd)> &vtostr=[](const Vertex &vd) ->std::string { return(std::to_string(vd));}, const std::function< std::string(const Edge &ed)> &etostr=[](const Edge &ed) ->std::string { return(std::to_string(ed));}) const |
| Return a text version of the path. More... | |
Types, consts., etc. | |
| using | VectorElem = GPathElement< Vertex, Edge, KIND > |
| The type of the elements of the vector. More... | |
| using | BasePath = std::vector< VectorElem > |
| Base type of the path. More... | |
| using | BaseGraph = Graph< Vertex, Edge > |
| The graph class on which the path is defined. More... | |
| using | Collection = std::vector< GPath > |
| A collection of paths. More... | |
| static const GPathKind | kKind = KIND |
| The kind of the path. More... | |
| using elementa::adts::graphs::GPath< Vertex, Edge, KIND >::VectorElem = GPathElement<Vertex,Edge,KIND> |
The type of the elements of the vector.
Definition at line 89 of file graph_paths.h.
| using elementa::adts::graphs::GPath< Vertex, Edge, KIND >::BasePath = std::vector<VectorElem> |
Base type of the path.
Definition at line 92 of file graph_paths.h.
| using elementa::adts::graphs::GPath< Vertex, Edge, KIND >::BaseGraph = Graph<Vertex,Edge> |
The graph class on which the path is defined.
Definition at line 95 of file graph_paths.h.
| using elementa::adts::graphs::GPath< Vertex, Edge, KIND >::Collection = std::vector<GPath> |
A collection of paths.
Definition at line 98 of file graph_paths.h.
|
inline |
Construct a path of the other kind equivalent to this one.
If the conversion is from vertex to edge path, this is O(M * L), where M is the maximum fanout of any vertex involved in the path and L the length of the path (as long as iterating on leaving edges of a vertex is O(1)). If the conversion is from edge to vertex path, it is O(L) (as long as getting the vertices of an edge is O(1)).
| epred | is only used if we are getting an edge path from a vertex path, in order to select which edges to use from the possibly several that join two given vertices. |
Definition at line 124 of file graph_paths.h.
|
inline |
Return a text version of the path.
| g | is the graph on which the path has been defined. |
| vtostr | is a converter from vertex data to string. |
| etostr | is a converter from edge data to string. |
Definition at line 133 of file graph_paths.h.
|
static |
The kind of the path.
Definition at line 86 of file graph_paths.h.
| using elementa::adts::graphs::GPathElement = typedef typename std::conditional< KIND == GPathKind::kVertexPath, typename Graph<Vertex,Edge>::viterator, typename Graph<Vertex,Edge>::eiterator >::type |
#include <elementa/adts/graphs/graph_paths.h>
Type of the elements of a path, according to its kind.
Definition at line 71 of file graph_paths.h.
| using elementa::adts::graphs::EdgeWeightFunction = typedef std::function< Weight(const typename Graph<Vertex,Edge>::eiterator &) > |
#include <elementa/adts/graphs/graph_paths.h>
A family of functions that return the weight of an edge.
Definition at line 187 of file graph_paths.h.
|
constexpr |
#include <elementa/adts/graphs/graph_paths.h>
The kind opposite to a given one.
Definition at line 65 of file graph_paths.h.
|
constexprnoexcept |
#include <elementa/adts/graphs/graph_paths.h>
A family of functions that return 1.0 as the weight of any edge.
Definition at line 192 of file graph_paths.h.
|
constexprnoexcept |
#include <elementa/adts/graphs/graph_paths.h>
A family of functions that return the edge value as the weight.
Definition at line 199 of file graph_paths.h.