GraphAlgorithms.hh
Go to the documentation of this file.
T empty(T... args)
const EdgeRef_M< EdgeType > IncidentsFrom(const VertexId &_vertex) const
Get the set of outgoing edges from a given vertex.
Definition: Graph.hh:423
Vertex< V > & AddVertex(const std::string &_name, const V &_data, const VertexId &_id=kNullId)
Add a new vertex to the graph.
Definition: Graph.hh:135
T front(T... args)
A generic graph class. Both vertices and edges can store user information. A vertex could be created ...
Definition: Graph.hh:100
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: GraphAlgorithms.hh:285
T endl(T... args)
T top(T... args)
const Vertex< V > & VertexFromId(const VertexId &_id) const
Get a reference to a vertex using its Id.
Definition: Graph.hh:607
T end(T... args)
STL class.
static const VertexId kNullId
Represents an invalid Id.
Definition: Vertex.hh:48
T push_back(T... args)
STL class.
STL class.
T make_pair(T... args)
STL class.
const VertexRef_M< V > Vertices() const
The collection of all vertices in the graph.
Definition: Graph.hh:179
T find(T... args)
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: Graph.hh:289
static const double MAX_D
Double maximum value. This value will be similar to 1.79769e+308.
Definition: Helpers.hh:247
EdgeType & AddEdge(const VertexId_P &_vertices, const E &_data, const double _weight=1.0)
Add a new edge to the graph.
Definition: Graph.hh:208
std::pair< double, VertexId > CostInfo
Definition: GraphAlgorithms.hh:43
Definition: Angle.hh:39
T pop_front(T... args)
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: GraphAlgorithms.hh:104
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: GraphAlgorithms.hh:208
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: GraphAlgorithms.hh:52
const EdgeRef_M< EdgeType > Edges() const
The collection of all edges in the graph.
Definition: Graph.hh:263