Graph:...al::DFS(3pm)
π Graph::Traversal::DFS π
ok so bestie, welcome to Graph::Traversal::DFS, a lil Perl module from the Graph:...al::DFS(3pm) corner of the User Contributed Perl Documentation universe. it does exactly one iconic thing and it does it flawlessly: depth-first traversal of graphs. no cap. π
β¨ NAME β¨
Graph::Traversal::DFS β depth-first traversal of graphs π¦
β¨ SYNOPSIS β¨
use Graph;
my $g = Graph->new;
$g->add_edge(...);
use Graph::Traversal::DFS;
my $d = Graph::Traversal::DFS->new($g, %opt);
$d->dfs; # Do the traversal.
like, that's it. that's the whole vibe. use it, make a graph, make a traverser, call dfs, slay. π
β¨ DESCRIPTION β¨
With this class one can traverse a Graph in depth-first order. π
lowkey the coolest way to walk a graph: go deep before you go wide. main character energy fr.
The callback parameters %opt are explained in Graph::Traversal. π
πΈ Methods πΈ
The following methods are available:
dfsβ Traverse the graph in depth-first order. Returns all vertices traversed in post-order. β¨
iykyk β post-order means the vertices come back to you <em>after</em> their subtrees have been handled. obsessed.
β¨ SEE ALSO β¨
Graph::TraversalπGraph::Traversal::BFSπΈGraphπ¦
and that's the whole page, bestie!! this one's running on perl v5.40.1, dated 2025-03-28, straight outta the User Contributed Perl Documentation. go traverse something gorgeous πβ¨π
π¦ where this page comes from
- debian trixie: libgraph-perl 1:0.9735-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libgraph-perl 1:0.9735-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libgraph-perl 1:0.9735-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms