1 package Graph
::Traversal
::BFS
;
6 use base
'Graph::Traversal';
10 $self->{ order
}->[ 0 ];
15 shift @
{ $self->{ order
} };
18 *bfs
= \
&Graph
::Traversal
::postorder
;
26 Graph::Traversal::BFS - breadth-first traversal of graphs
33 use Graph::Traversal::BFS;
34 my $b = Graph::Traversal::BFS->new(%opt);
35 $b->bfs; # Do the traversal.
39 With this class one can traverse a Graph in breadth-first order.
41 The callback parameters %opt are explained in L<Graph::Traversal>.
45 The following methods are available:
51 Traverse the graph in depth-first order.
57 L<Graph::Traversal>, L<Graph::Traversal::DFS>, L<Graph>.