gz/math/graph/Graph.hh
VertexId Id() const
Get the vertex Id.
Definition: gz/math/graph/Vertex.hh:88
static const uint64_t MAX_UI64
64bit unsigned integer maximum value
Definition: gz/math/Helpers.hh:339
Definition: gz/math/AdditivelySeparableScalarField3.hh:27
STL class.
A directed edge represents a connection between two vertices. The connection is unidirectional,...
Definition: gz/math/graph/Edge.hh:267
A vertex of a graph. It stores user information, an optional name, and keeps an internal unique Id....
Definition: gz/math/graph/Vertex.hh:54
friend std::ostream & operator<<(std::ostream &_out, const Graph< VV, EE, EEdgeType > &_g)
Stream insertion operator. The output uses DOT graph description language.
A generic graph class. Both vertices and edges can store user information. A vertex could be created ...
Definition: gz/math/graph/Graph.hh:102
T move(T... args)
std::ostream & operator<<(std::ostream &_out, const Graph< VV, EE, DirectedEdge< EE >> &_g)
Partial template specification for directed edges.
Definition: gz/math/graph/Graph.hh:772
const EdgeRef_M< EdgeType > IncidentsFrom(const Vertex< V > &_vertex) const
Get the set of outgoing edges from a given vertex.
Definition: gz/math/graph/Graph.hh:451
STL class.
T find(T... args)
const VertexRef_M< V > Vertices(const std::string &_name) const
The collection of all vertices in the graph with name == _name.
Definition: gz/math/graph/Graph.hh:193
Vertex< V > & VertexFromId(const VertexId &_id)
Get a mutable reference to a vertex using its Id.
Definition: gz/math/graph/Graph.hh:623
T emplace(T... args)
size_t InDegree(const VertexId &_vertex) const
Get the number of edges incident to a vertex.
Definition: gz/math/graph/Graph.hh:392
VertexId nextEdgeId
The next edge Id to be assigned to a new edge.
Definition: gz/math/graph/Graph.hh:723
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
VertexId nextVertexId
The next vertex Id to be assigned to a new vertex.
Definition: gz/math/graph/Graph.hh:720
bool RemoveEdge(const EdgeId &_edge)
Remove an existing edge from the graph. After the removal, it won't be possible to reach any of the v...
Definition: gz/math/graph/Graph.hh:572
size_t RemoveVertices(const std::string &_name)
Remove all vertices with name == _name.
Definition: gz/math/graph/Graph.hh:553
static const VertexId kNullId
Represents an invalid Id.
Definition: gz/math/graph/Vertex.hh:48
size_t InDegree(const Vertex< V > &_vertex) const
Get the number of edges incident to a vertex.
Definition: gz/math/graph/Graph.hh:400
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
Graph(const std::vector< Vertex< V >> &_vertices, const std::vector< EdgeInitializer< E >> &_edges)
Constructor.
Definition: gz/math/graph/Graph.hh:110
An undirected edge represents a connection between two vertices. The connection is bidirectional,...
Definition: gz/math/graph/Edge.hh:204
const EdgeRef_M< EdgeType > Edges() const
The collection of all edges in the graph.
Definition: gz/math/graph/Graph.hh:266
bool RemoveVertex(const VertexId &_vertex)
Remove an existing vertex from the graph.
Definition: gz/math/graph/Graph.hh:504
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
T erase(T... args)
Used in the Graph constructors for uniform initialization.
Definition: gz/math/graph/Edge.hh:44
STL class.
VertexRef_M< V > AdjacentsTo(const Vertex< V > &_vertex) const
Get all vertices that are directly connected with one edge to a given vertex. In other words,...
Definition: gz/math/graph/Graph.hh:384
bool RemoveVertex(Vertex< V > &_vertex)
Remove an existing vertex from the graph.
Definition: gz/math/graph/Graph.hh:545
T equal_range(T... args)
VertexRef_M< V > AdjacentsTo(const VertexId &_vertex) const
Get all vertices that are directly connected with one edge to a given vertex. In other words,...
Definition: gz/math/graph/Graph.hh:351
size_t OutDegree(const VertexId &_vertex) const
Get the number of edges incident from a vertex.
Definition: gz/math/graph/Graph.hh:408
T endl(T... args)
T begin(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
EdgeType & LinkEdge(const EdgeType &_edge)
Links an edge to the graph. This function verifies that the edge's two vertices exist in the graph,...
Definition: gz/math/graph/Graph.hh:235
T insert(T... args)
VertexRef_M< V > AdjacentsFrom(const Vertex< V > &_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:331
T count(T... args)
size_t OutDegree(const Vertex< V > &_vertex) const
Get the number of edges incident from a vertex.
Definition: gz/math/graph/Graph.hh:416
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 EdgeId
The unique Id for an edge.
Definition: gz/math/graph/Edge.hh:40
bool RemoveEdge(EdgeType &_edge)
Remove an existing edge from the graph. After the removal, it won't be possible to reach any of the v...
Definition: gz/math/graph/Graph.hh:601
const EdgeRef_M< EdgeType > IncidentsTo(const VertexId &_vertex) const
Get the set of incoming edges to a given vertex.
Definition: gz/math/graph/Graph.hh:462
bool Empty() const
Get whether the graph is empty.
Definition: gz/math/graph/Graph.hh:496
const EdgeType & EdgeFromId(const EdgeId &_id) const
Get a reference to an edge using its Id.
Definition: gz/math/graph/Graph.hh:675
const EdgeRef_M< EdgeType > IncidentsTo(const Vertex< V > &_vertex) const
Get the set of incoming edges to a given vertex.
Definition: gz/math/graph/Graph.hh:487
uint64_t VertexId
The unique Id of each vertex.
Definition: gz/math/graph/Vertex.hh:41
std::ostream & operator<<(std::ostream &_out, const Graph< VV, EE, UndirectedEdge< EE >> &_g)
Partial template specification for undirected edges.
Definition: gz/math/graph/Graph.hh:745
const EdgeType & EdgeFromVertices(const VertexId _sourceId, const VertexId _destId) const
Get a reference to an edge based on two vertices. A NullEdge object reference is returned if an edge ...
Definition: gz/math/graph/Graph.hh:640
STL class.
T cref(T... args)
const VertexRef_M< V > Vertices() const
The collection of all vertices in the graph.
Definition: gz/math/graph/Graph.hh:181