gz/math/graph/GraphAlgorithms.hh
Definition: gz/math/AdditivelySeparableScalarField3.hh:27
STL class.
A generic graph class. Both vertices and edges can store user information. A vertex could be created ...
Definition: gz/math/graph/Graph.hh:102
std::vector< VertexId > BreadthFirstSort(const Graph< V, E, EdgeType > &_graph, const VertexId &_from)
Breadth first sort (BFS). Starting from the vertex == _from, it traverses the graph exploring the nei...
Definition: gz/math/graph/GraphAlgorithms.hh:52
T pop_front(T... args)
STL class.
T find(T... args)
std::map< VertexId, CostInfo > Dijkstra(const Graph< V, E, EdgeType > &_graph, const VertexId &_from, const VertexId &_to=kNullId)
Dijkstra algorithm. Find the shortest path between the vertices in a graph. If only a graph and a sou...
Definition: gz/math/graph/GraphAlgorithms.hh:213
STL class.
VertexRef_M< V > AdjacentsFrom(const VertexId &_vertex) const
Get all vertices that are directly connected with one edge from a given vertex. In other words,...
Definition: gz/math/graph/Graph.hh:292
static const VertexId kNullId
Represents an invalid Id.
Definition: gz/math/graph/Vertex.hh:48
T front(T... args)
EdgeType & AddEdge(const VertexId_P &_vertices, const E &_data, const double _weight=1.0)
Add a new edge to the graph.
Definition: gz/math/graph/Graph.hh:211
T push_back(T... args)
const EdgeRef_M< EdgeType > Edges() const
The collection of all edges in the graph.
Definition: gz/math/graph/Graph.hh:266
std::pair< double, VertexId > CostInfo
Used in Dijkstra. For a given source vertex, this pair represents the cost (first element) to reach a...
Definition: gz/math/graph/GraphAlgorithms.hh:43
T top(T... args)
Vertex< V > & AddVertex(const std::string &_name, const V &_data, const VertexId &_id=kNullId)
Add a new vertex to the graph.
Definition: gz/math/graph/Graph.hh:137
std::vector< VertexId > DepthFirstSort(const Graph< V, E, EdgeType > &_graph, const VertexId &_from)
Depth first sort (DFS). Starting from the vertex == _from, it visits the graph as far as possible alo...
Definition: gz/math/graph/GraphAlgorithms.hh:104
std::vector< UndirectedGraph< V, E > > ConnectedComponents(const UndirectedGraph< V, E > &_graph)
Calculate the connected components of an undirected graph. A connected component of an undirected gra...
Definition: gz/math/graph/GraphAlgorithms.hh:290
STL class.
STL class.
UndirectedGraph< V, E > ToUndirectedGraph(const DirectedGraph< V, E > &_graph)
Copy a DirectedGraph to an UndirectedGraph with the same vertices and edges.
Definition: gz/math/graph/GraphAlgorithms.hh:335
T endl(T... args)
const EdgeRef_M< EdgeType > IncidentsFrom(const VertexId &_vertex) const
Get the set of outgoing edges from a given vertex.
Definition: gz/math/graph/Graph.hh:426
static const double MAX_D
Double maximum value. This value will be similar to 1.79769e+308.
Definition: gz/math/Helpers.hh:257
T empty(T... args)
const Vertex< V > & VertexFromId(const VertexId &_id) const
Get a reference to a vertex using its Id.
Definition: gz/math/graph/Graph.hh:610
T make_pair(T... args)
T end(T... args)
uint64_t VertexId
The unique Id of each vertex.
Definition: gz/math/graph/Vertex.hh:41
const VertexRef_M< V > Vertices() const
The collection of all vertices in the graph.
Definition: gz/math/graph/Graph.hh:181