63#ifndef GENERATE_DF_TREE_H
64#define GENERATE_DF_TREE_H
93 return c1.key ==
c2.key;
128 return std::string(str);
145 return std::string(
buf);
170 return std::string(
buf);
190 nodo->get_info().low =
reinterpret_cast<long>(
nodo->cookie);
217template <
class GT,
class Key>
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.
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
GT find_depth_first_spanning_tree(const GT &g, typename GT::Node *gnode)
Build a depth-first spanning tree (mapped to the original graph).
DynList< T > maps(const C &c, Op op)
Classic map operation.
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