63#ifndef GENERATE_DF_TREE_H
64#define GENERATE_DF_TREE_H
95 return c1.key ==
c2.key;
130 return std::string(str);
147 return std::string(buf);
172 return std::string(buf);
192 nodo->get_info().low =
reinterpret_cast<long>(
nodo->cookie);
219template <AlephGraph GT,
class Key>
C++20 concepts for the protocol shared by graph algorithms.
Generic directed graph (digraph) wrapper template.
typename BaseGraph::Arc Arc
typename BaseGraph::Node Node
Dynamic doubly linked list with O(1) size and bidirectional access.
Functor class to convert a tree graph to Tree_Node structure.
Forward declaration used by CRTP helpers before the full node definition.
T & get_key() noexcept
Returns a modifiable reference to the node contents.
static long global_counter
void visitar_df(Grafo &, Grafo::Node *nodo, Grafo::Arc *)
DFS visitor that assigns discovery numbers.
void visitar_low(Grafo &, Grafo::Node *nodo, Grafo::Arc *)
DFS visitor that copies low-link values from cookies.
Tree visualization and output generation.
size_t depth_first_traversal(const GT &g, typename GT::Node *start_node, bool(*visit)(const GT &g, typename GT::Node *, typename GT::Arc *))
Depth-first traversal starting from a given node.
void write_df_low_tree(GT &g, typename GT::Node *src, std::ofstream &f)
Generate a DFS tree picture with low-link values.
DynList< typename GT::Node * > compute_cut_nodes(const GT &g, typename GT::Node *start)
Compute articulation points (cut vertices) of an undirected graph.
#define NODE_COOKIE(p)
Return the node cookie
size_t blossom_maximum_cardinality_matching(const GT &g, DynDlist< typename GT::Arc * > &matching, SA sa=SA())
Alias of compute_maximum_cardinality_general_matching().
GT find_depth_first_spanning_tree(const GT &g, typename GT::Node *gnode)
Build a depth-first spanning tree (mapped to the original graph).
Equality comparator for Clave structures.
bool operator()(const Clave &c1, const Clave &c2) const
Key structure for DFS tree nodes.
int key
Original node identifier.
long count
DFS discovery number (pre-order)
long low
Low-link value (minimum reachable via back edges)
Converter from graph node to Tree_Node<Clave>.
void operator()(Grafo::Node *tnode, Tree_Node< Clave > *t)
Writer that outputs node key and DFS number.
static const size_t Buf_Size
std::string operator()(Tree_Node< Clave > *p)
Writer that outputs node key, DFS number, and low-link value.
std::string operator()(Tree_Node< Clave > *p)
static const size_t Buf_Size
Writer that outputs only the node key.
std::string operator()(Tree_Node< Clave > *p)
static const size_t Buf_Size
Utility algorithms and operations for graphs.
General tree (n-ary tree) node.
List_Digraph< Node_Nodo, Arco_Arco > Grafo