![]() |
Quetzal-CoaTL
The Coalescence Template Library
|
Public Member Functions | |
network_common () | |
Default constructor. | |
network_common (size_t n) | |
Constructs a network with \(n\) vertices. | |
Topology Lookup | |
bool | is_isomorphic (network_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. | |
vertex_descriptor | find_root_from (vertex_descriptor u) const |
Finds the root of the network graph starting from a vertex \(u\). | |
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\). | |
bool | has_predecessor (vertex_descriptor u) const |
Evaluates if vertex \(u\) has a predecessor. | |
vertex_descriptor | predecessor (vertex_descriptor u) const |
The predecessor of vertex \(u\). | |
bool | has_successors (vertex_descriptor u) const |
Evaluates if vertex \(u\) has successors. | |
auto | successors (vertex_descriptor u) const |
The successors of vertex \(u\). | |
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. | |
Algorithms | |
template<typename DFSVisitor > | |
void | depth_first_search (vertex_descriptor start, DFSVisitor &vis) |
Performs a read-and-write depth-first traversal of the vertices starting at vertex \(s\). | |
template<typename DFSVisitor > | |
void | depth_first_search (vertex_descriptor start, DFSVisitor &vis) const |
Performs a read-only depth-first traversal of the vertices starting at vertex \(s\). | |
Input/Output | |
void | to_graphviz (std::ostream &out) const |
Print the graph to the graphviz format. | |
Static Public Member Functions | |
static constexpr vertex_descriptor | null_vertex () |
Null vertex identifier. | |
Protected Types | |
using | base = tree_traits::model< tree_traits::out_edge_list_type, tree_traits::vertex_list_type, tree_traits::directed_type, VertexProperty, EdgeProperty > |
The type of graph hold by the network class. | |
Protected Attributes | |
base | _graph |
|
protected |
The type of graph hold by the network class.
|
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 |
Performs a read-and-write depth-first traversal of the vertices starting at vertex \(s\).
DFSVisitor |
start | The vertex to start from. |
vis | The visitor to apply. |
|
inline |
Performs a read-only depth-first traversal of the vertices starting at vertex \(s\).
DFSVisitor |
start | The vertex to start from. |
vis | The visitor to apply. |
|
inline |
Returns the edge between two vertices of the graph if the edge exists.
u | The first vertex |
u | The second vertex |
|
inline |
Finds the root of the network graph starting from a vertex \(u\).
u | The vertex to start from. |
|
inline |
Evaluates if vertex \(u\) has a predecessor.
u | The vertex to evaluate |
|
inline |
Evaluates if vertex \(u\) has successors.
u | The vertex to evaluate |
|
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 network graph. |
|
inlinestaticconstexpr |
Null vertex identifier.
|
inline |
Provides a range to iterate over the out-going edges of vertex \(u\).
u | The vertex \(u\). |
|
inline |
The predecessor of vertex \(u\).
u | The vertex |
|
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 |
The successors of vertex \(u\).
u | The vertex |
|
inline |
Returns the target vertex of a directed edge.
e | The edge |
|
inline |
Provides a range to iterate over the vertices of the graph.