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