logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Graph::Traversal::BFS - breadth-first traversal of graphs

Description

       With this class one can traverse a Graph in breadth-first order.

       The callback parameters %opt are explained in Graph::Traversal.

   Methods
       The following methods are available:

       bfs Traverse the graph in breadth-first order.  Returns all vertices traversed in post-order.

Name

       Graph::Traversal::BFS - breadth-first traversal of graphs

See Also

       Graph::Traversal, Graph::Traversal::DFS, Graph.

perl v5.40.1                                       2025-03-28                         Graph::Traversal::BFS(3pm)

Synopsis

           use Graph;
           my $g = Graph->new;
           $g->add_edge(...);
           use Graph::Traversal::BFS;
           my $b = Graph::Traversal::BFS->new($g, %opt);
           $b->bfs; # Do the traversal.

See Also