96# ifndef GRAPH_TO_TREE_H
97# define GRAPH_TO_TREE_H
106 template <
class GT,
typename Key,
class Convert>
static
108 template <
class GT,
typename Key,
class Convert>
static void
112 template <
class GT,
typename Key,
typename Convert,
class SA>
static inline
158 template <
class GT,
typename Key,
163 <<
"Graph is not a tree (not acyclique)";
208 template <
class GT,
typename Key,
224 Arc * arc = it.get_current_arc_ne();
245 <<
"Graph is not a tree (not acyclique)";
286 template <
class GT,
typename Key,
typename Convert,
class SA>
static inline
296 Arc * arc = it.get_current_arc_ne();
Exception handling system with formatted messages for Aleph-w.
#define ah_domain_error_if(C)
Throws std::domain_error if condition holds.
WeightedDigraph::Node Node
List_Graph< Graph_Node< Node_Info >, Graph_Arc< Arc_Info > > GT
void next_ne() noexcept
Advances the iterator to the next filtered element (noexcept version).
Functor class to convert a tree graph to Tree_Node structure.
Tree_Node< Key > * operator()(GT &g, typename GT::Node *groot, Convert &&conv=Convert())
Convert a tree graph to Tree_Node structure.
void graph_to_tree(typename GT::Node *groot, Tree_Node< Key > *troot)
Graph_To_Tree_Node(SA __sa=SA())
Tree_Node< Key > * graph_to_tree(GT &g, typename GT::Node *groot, Convert &conv)
void insert_rightmost_child(Tree_Node *p) noexcept
Inserts p as the rightmost child of this.
#define ARC_BITS(p)
Return the control bits of arc p.
#define IS_ARC_VISITED(p, bit)
Determine whether the bit field is or not set to one.
Main namespace for Aleph-w library functions.
static Tree_Node< Key > * graph_to_tree_node(GT &g, typename GT::Node *groot)
Divide_Conquer_DP_Result< Cost > divide_and_conquer_partition_dp(const size_t groups, const size_t n, Transition_Cost_Fn transition_cost, const Cost inf=dp_optimization_detail::default_inf< Cost >())
Optimize partition DP using divide-and-conquer optimization.
static void __graph_to_tree_node(GT &g, typename GT::Node *groot, Tree_Node< Key > *troot)
Default filter for filtered iterators on arcs.
Filtered iterator of adjacent arcs of a node.
Generic graph and digraph implementations.
Utility algorithms and operations for graphs.
General tree (n-ary tree) node.