2 # include <tpl_graph_utils.H>
3 # include <tpl_tree_node.H>
4 # include <generate_tree.H>
7 static long global_counter = 0;
20 const bool operator () (
const Clave & c1,
const Clave & c2)
const
22 return c1.key == c2.key;
31 Grafo::Node * gnode =
static_cast<Grafo::Node *
>(
NODE_COOKIE(tnode));
34 clave.key = tnode->get_info().clave;
35 clave.count = gnode->get_info().df;
36 clave.low = gnode->get_info().low;
43 static const size_t Buf_Size = 512;
57 static const size_t Buf_Size = 512;
63 snprintf(buf, Buf_Size,
"(%c,%ld)", p->
get_key().key, p->
get_key().count);
71 static const size_t Buf_Size = 512;
78 snprintf(buf, Buf_Size,
"%d,%ld,%ld",
81 snprintf(buf, Buf_Size,
"%d,%ld,-",
90 void visitar_df(Grafo &, Grafo::Node * nodo, Grafo::Arc *)
92 nodo->get_info().df = global_counter++;
95 void visitar_low(Grafo &, Grafo::Node * nodo, Grafo::Arc *)
97 nodo->get_info().low = (long) (nodo->cookie);
101 template <
class GT,
class Key>
102 void write_df_low_tree(GT & g,
typename GT::Node * src, ofstream & f)
115 find_depth_first_spanning_tree <GT> (g, src, tree);
119 generate_non_tree_arcs(g, arc_list);
121 typename GT::Node * td =
static_cast<typename GT::Node *
>(
NODE_COOKIE(src));
125 generate_tree <Tree_Node<Key>,
Write_Low> (rd, f);
127 write_non_tree_arcs(arc_list, rd, f);
Definition: generate_df_tree.H:55
Definition: generate_df_tree.H:69
#define NODE_COOKIE(p)
Definition: aleph-graph.H:248
size_t depth_first_traversal(GT &g, typename GT::Node *start_node, bool(*visit)(GT &g, typename GT::Node *, typename GT::Arc *), SA sa=SA())
Definition: tpl_graph_utils.H:66
Definition: generate_df_tree.H:41
Definition: tpl_tree_node.H:35
Definition: graph_to_tree.H:170
T & get_key()
retorna referencia modificable al contenido del nodo.
Definition: tpl_tree_node.H:76
void compute_cut_nodes(GT &g, typename GT::Node *start, DynDlist< typename GT::Node * > &list)
Definition: tpl_graph_utils.H:1638
Definition: generate_df_tree.H:10
Definition: generate_df_tree.H:27
Definition: generate_df_tree.H:18