![]() |
Quetzal-CoaTL
The Coalescence Template Library
|
Public Member Functions | |
graph_common () | |
Default constructor. | |
graph_common (size_t n) | |
Constructs a graph with \(n\) vertices. | |
Topology Lookup | |
int | num_vertices () const |
Number of vertices in the graph. | |
int | num_edges () const |
Number of edges in the graph. | |
bool | is_isomorphic (graph_common const &other) const |
Detects if there is a 1-to-1 mapping of the vertices in one graph to the vertices of another graph such that adjacency is preserved. | |
degree_size_type | degree (vertex_descriptor u) const |
Returns the number of in-edges plus out-edges. | |
degree_size_type | in_degree (vertex_descriptor u) const |
Returns the number of in-edges of vertex \(u\). | |
degree_size_type | out_degree (vertex_descriptor v) const |
Returns the number of out-edges of vertex \(v\). | |
std::optional< edge_descriptor > | edge (vertex_descriptor u, vertex_descriptor v) const |
Returns the edge between two vertices of the graph if the edge exists. | |
vertex_descriptor | source (edge_descriptor e) const |
Returns the source vertex of a directed edge. | |
vertex_descriptor | target (edge_descriptor e) const |
Returns the target vertex of a directed edge. | |
Topology Modification | |
vertex_descriptor | add_vertex () |
void | clear_vertex (vertex_descriptor u) |
Remove all edges to and from vertex \(u\) from the graph. | |
void | remove_vertex (vertex_descriptor u) |
Remove vertex u from the graph, also removing all edges to and from vertex \(u\). | |
edge_descriptor | add_edge (vertex_descriptor u, vertex_descriptor v) |
Inserts the edge \((u,v)\) into the graph if it does not exist, and returns an edge descriptor pointing to the new edge. | |
void | remove_edge (vertex_descriptor u, vertex_descriptor v) |
Remove the edge \((u,v)\) from the graph. | |
void | remove_edge (edge_descriptor e) |
Remove the edge \(e\) from the graph. | |
Iterators | |
auto | in_edges (vertex_descriptor u) const |
Provides a range to iterate over the in-going edges of vertex \(u\). | |
auto | out_edges (vertex_descriptor u) const |
Provides a range to iterate over the out-going edges of vertex \(u\). | |
auto | vertices () const |
Provides a range to iterate over the vertices of the graph. | |
auto | edges () const |
Provides a range to iterate over the edges of the graph. | |
Static Public Member Functions | |
static constexpr vertex_descriptor | null_vertex () |
Null vertex identifier. | |
Protected Types | |
using | base_type = typename Representation::rebind< Directed, VertexProperty, EdgeProperty > |
The type of graph hold by the graph class - disallow parallel edges. | |
Protected Attributes | |
base_type | _graph |
|
inline |
Inserts the edge \((u,v)\) into the graph if it does not exist, and returns an edge descriptor pointing to the new edge.
u | Source vertex |
u | Target vertex |
|
inline |
Remove all edges to and from vertex \(u\) from the graph.
u | The vertex |
|
inline |
Returns the number of in-edges plus out-edges.
u | The vertex \(u\) |
|
inline |
Returns the edge between two vertices of the graph if the edge exists.
u | The first vertex |
u | The second vertex |
|
inline |
Provides a range to iterate over the edges of the graph.
|
inline |
Returns the number of in-edges of vertex \(u\).
u | The vertex \(u\) |
|
inline |
Provides a range to iterate over the in-going edges of vertex \(u\).
u | The vertex \(u\). |
|
inline |
Detects if there is a 1-to-1 mapping of the vertices in one graph to the vertices of another graph such that adjacency is preserved.
other | A graph graph. |
|
inlinestaticconstexpr |
Null vertex identifier.
|
inline |
Number of edges in the graph.
|
inline |
Number of vertices in the graph.
|
inline |
Provides a range to iterate over the out-going edges of vertex \(u\).
u | The vertex \(u\). |
|
inline |
Remove the edge \(e\) from the graph.
e | The edge to remove |
|
inline |
Remove the edge \((u,v)\) from the graph.
u | Source vertex |
u | Target vertex |
|
inline |
Remove vertex u from the graph, also removing all edges to and from vertex \(u\).
u | The vertex to remove. |
|
inline |
Returns the source vertex of a directed edge.
e | The edge |
|
inline |
Returns the target vertex of a directed edge.
e | The edge |
|
inline |
Provides a range to iterate over the vertices of the graph.