![]() |
Quetzal-CoaTL
The Coalescence Template Library
|
Public Member Functions | |
k_ary_tree_common () | |
Default constructor. | |
k_ary_tree_common (size_t n) | |
Constructs a tree with \(n\) vertices. | |
Topology Lookup | |
bool | is_isomorphic (k_ary_tree_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 tree 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. | |
Iterators | |
std::pair< in_edge_iterator, in_edge_iterator > | in_edges (vertex_descriptor u) const |
Provides iterators to iterate over the in-going edges of vertex \(u\). | |
Algorithms | |
template<typename DFSTreeVisitor > | |
void | depth_first_search (vertex_descriptor start, DFSTreeVisitor &vis) |
Performs a read-and-write depth-first traversal of the vertices starting at vertex \(s\). | |
template<typename DFSTreeVisitor > | |
void | depth_first_search (vertex_descriptor start, DFSTreeVisitor &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 tree to the graphviz format. | |
Static Public Member Functions | |
static constexpr vertex_descriptor | null_vertex () |
Null vertex identifier. | |
template<typename Generator > | |
static std::tuple< CRTP, vertex_descriptor > | make_random_tree (int n_leaves, int k_max, Generator &rng) |
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 tree class. | |
Protected Attributes | |
base | _graph |
|
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\).
DFSTreeVisitor |
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\).
DFSTreeVisitor |
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 tree 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 iterators 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 k-ary tree graph. |
|
inlinestaticconstexpr |
Null vertex identifier.
|
inline |
The predecessor of vertex \(u\).
u | The vertex |
|
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 |