Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
generate_df_tree.H File Reference

Depth-first tree visualization with DFS numbering. More...

#include <tpl_graph_utils.H>
#include <tpl_tree_node.H>
#include <generate_tree.H>
Include dependency graph for generate_df_tree.H:

Go to the source code of this file.

Classes

struct  Clave
 Key structure for DFS tree nodes. More...
 
struct  Clave_Igual
 Equality comparator for Clave structures. More...
 
struct  Convertir
 Converter from graph node to Tree_Node<Clave>. More...
 
struct  Write_Node
 Writer that outputs only the node key. More...
 
struct  Write_Df
 Writer that outputs node key and DFS number. More...
 
struct  Write_Low
 Writer that outputs node key, DFS number, and low-link value. More...
 

Functions

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.
 
template<class GT , class Key >
void write_df_low_tree (GT &g, typename GT::Node *src, std::ofstream &f)
 Generate a DFS tree picture with low-link values.
 

Variables

static long global_counter = 0
 

Detailed Description

Depth-first tree visualization with DFS numbering.

This file provides utilities for generating visual representations of depth-first spanning trees, including DFS discovery numbers and low-link values used in cut-vertex (articulation point) detection.

Key Features

  • Generate tree pictures showing DFS traversal order
  • Display low-link values for cut-vertex analysis
  • Support for non-tree arcs (back edges) visualization

Data Structure

The Clave struct stores per-node information:

  • key: Original node identifier
  • count: DFS discovery number (df)
  • low: Low-link value for cut-vertex detection
Warning
This file uses a static global counter and is NOT thread-safe. Do not use these functions concurrently from multiple threads.
See also
tpl_cut_nodes.H For cut-vertex (articulation point) algorithms
generate_tree.H For general tree visualization
Author
Leandro Rabindranath Leon

Definition in file generate_df_tree.H.

Function Documentation

◆ visitar_df()

void visitar_df ( Grafo ,
Grafo::Node nodo,
Grafo::Arc  
)
inline

DFS visitor that assigns discovery numbers.

Increments the global counter and assigns it to the node's df field.

Warning
Uses global state - NOT thread-safe.

Definition at line 179 of file generate_df_tree.H.

References global_counter, and Aleph::maps().

Referenced by write_df_low_tree().

◆ visitar_low()

void visitar_low ( Grafo ,
Grafo::Node nodo,
Grafo::Arc  
)
inline

DFS visitor that copies low-link values from cookies.

Retrieves the low-link value stored in the node's cookie field.

Definition at line 188 of file generate_df_tree.H.

References Aleph::maps().

Referenced by write_df_low_tree().

Variable Documentation

◆ global_counter

long global_counter = 0
static

Definition at line 71 of file generate_df_tree.H.

Referenced by visitar_df().