Quetzal-CoaTL
The Coalescence Template Library
Loading...
Searching...
No Matches
quetzal::coalescence::detail::binary_tree_common< VertexProperty, EdgeProperty > Class Template Reference

Public Types

using vertex_descriptor = typename base::vertex_descriptor
 Vertex descriptor ("node ID" in other words).
 
using edge_descriptor = typename base::edge_descriptor
 Edge descriptor.
 
using degree_size_type = typename base::degree_size_type
 Degree size type.
 
using traversal_category = typename base::traversal_category
 The ways in which the vertices in the graph can be traversed.
 
using directed_category = typename base::directed_category
 The graph is bidirected.
 
using in_edge_iterator = typename base::in_edge_iterator
 Iterate through the in-edges.
 
using edge_parallel_category = typename base::edge_parallel_category
 

Public Member Functions

 binary_tree_common ()
 Default constructor.
 
 binary_tree_common (size_t n)
 Constructs a tree with \(n\) vertices.
 
Topology Lookup
bool is_isomorphic (binary_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\).
 
bool is_left_successor (vertex_descriptor u) const
 Evaluate if vertex \(u\) is a left successor.
 
bool is_right_successor (vertex_descriptor u) const
 Evaluate if vertex \(u\) is a right successor.
 
Iterators
std::pair< in_edge_iterator, in_edge_iteratorin_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 s, 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 s, 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 ()
 

Protected Types

using base = boost::binary_tree< true, std::size_t >
 Equivalent to bidirectional_binary_tree.
 

Protected Attributes

base _graph
 

Member Function Documentation

◆ degree()

template<class VertexProperty , class EdgeProperty >
degree_size_type quetzal::coalescence::detail::binary_tree_common< VertexProperty, EdgeProperty >::degree ( vertex_descriptor  u) const
inline

Returns the number of in-edges plus out-edges.

Parameters
uThe vertex \(u\)
Returns
Returns the number of in-edges plus out-edges.

◆ depth_first_search() [1/2]

template<class VertexProperty , class EdgeProperty >
template<typename DFSTreeVisitor >
void quetzal::coalescence::detail::binary_tree_common< VertexProperty, EdgeProperty >::depth_first_search ( vertex_descriptor  s,
DFSTreeVisitor &  vis 
)
inline

Performs a read-and-write depth-first traversal of the vertices starting at vertex \(s\).

Template Parameters
DFSTreeVisitor
Parameters
sThe vertex to start from.
visThe visitor to apply.

◆ depth_first_search() [2/2]

template<class VertexProperty , class EdgeProperty >
template<typename DFSTreeVisitor >
void quetzal::coalescence::detail::binary_tree_common< VertexProperty, EdgeProperty >::depth_first_search ( vertex_descriptor  s,
DFSTreeVisitor &  vis 
) const
inline

Performs a read-only depth-first traversal of the vertices starting at vertex \(s\).

Template Parameters
DFSTreeVisitor
Parameters
sThe vertex to start from.
visThe visitor to apply.

◆ find_root_from()

template<class VertexProperty , class EdgeProperty >
vertex_descriptor quetzal::coalescence::detail::binary_tree_common< VertexProperty, EdgeProperty >::find_root_from ( vertex_descriptor  u) const
inline

Finds the root of the tree graph starting from a vertex \(u\).

Parameters
uThe vertex to start from.
Remarks
This function will be an infinite loop if called on a recurrent tree (which is not a tree any more).

◆ has_predecessor()

template<class VertexProperty , class EdgeProperty >
bool quetzal::coalescence::detail::binary_tree_common< VertexProperty, EdgeProperty >::has_predecessor ( vertex_descriptor  u) const
inline

Evaluates if vertex \(u\) has a predecessor.

Parameters
uThe vertex to evaluate
Returns
True if u has a predecessor, false otherwise

◆ has_successors()

template<class VertexProperty , class EdgeProperty >
bool quetzal::coalescence::detail::binary_tree_common< VertexProperty, EdgeProperty >::has_successors ( vertex_descriptor  u) const
inline

Evaluates if vertex \(u\) has successors.

Parameters
uThe vertex to evaluate
Returns
True if u has successors, false otherwise

◆ in_degree()

template<class VertexProperty , class EdgeProperty >
degree_size_type quetzal::coalescence::detail::binary_tree_common< VertexProperty, EdgeProperty >::in_degree ( vertex_descriptor  u) const
inline

Returns the number of in-edges of vertex \(u\).

Parameters
uThe vertex \(u\)
Returns
The number of in-edges.

◆ in_edges()

template<class VertexProperty , class EdgeProperty >
std::pair< in_edge_iterator, in_edge_iterator > quetzal::coalescence::detail::binary_tree_common< VertexProperty, EdgeProperty >::in_edges ( vertex_descriptor  u) const
inline

Provides iterators to iterate over the in-going edges of vertex \(u\).

Parameters
uThe vertex \(u\).
Returns
A pair of iterators.

◆ is_isomorphic()

template<class VertexProperty , class EdgeProperty >
bool quetzal::coalescence::detail::binary_tree_common< VertexProperty, EdgeProperty >::is_isomorphic ( binary_tree_common< VertexProperty, EdgeProperty > const &  other) const
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.

Parameters
otherA binary tree graph.
Returns
true if there exists an isomorphism between the two graphs and false otherwise

◆ is_left_successor()

template<class VertexProperty , class EdgeProperty >
bool quetzal::coalescence::detail::binary_tree_common< VertexProperty, EdgeProperty >::is_left_successor ( vertex_descriptor  u) const
inline

Evaluate if vertex \(u\) is a left successor.

Parameters
uThe vertex to be evaluated
Returns
True if u is a left successoir, false otherwise.

◆ is_right_successor()

template<class VertexProperty , class EdgeProperty >
bool quetzal::coalescence::detail::binary_tree_common< VertexProperty, EdgeProperty >::is_right_successor ( vertex_descriptor  u) const
inline

Evaluate if vertex \(u\) is a right successor.

Parameters
uThe vertex to be evaluated
Returns
True if u is a right successoir, false otherwise.

◆ predecessor()

template<class VertexProperty , class EdgeProperty >
vertex_descriptor quetzal::coalescence::detail::binary_tree_common< VertexProperty, EdgeProperty >::predecessor ( vertex_descriptor  u) const
inline

The predecessor of vertex \(u\).

Parameters
uThe vertex
Returns
The vertex that is the predecessor of \(u\).

◆ successors()

template<class VertexProperty , class EdgeProperty >
auto quetzal::coalescence::detail::binary_tree_common< VertexProperty, EdgeProperty >::successors ( vertex_descriptor  u) const
inline

The successors of vertex \(u\).

Parameters
uThe vertex
Returns
A pair of iterators on the vertices that are the successors of \(u\).

The documentation for this class was generated from the following file: