1 package Graph
::Traversal
::DFS
;
6 use base
'Graph::Traversal';
10 $self->{ order
}->[ -1 ];
15 pop @
{ $self->{ order
} };
18 *dfs
= \
&Graph
::Traversal
::postorder
;
26 Graph::Traversal::DFS - depth-first traversal of graphs
33 use Graph::Traversal::DFS;
34 my $d = Graph::Traversal::DFS->new(%opt);
35 $d->dfs; # Do the traversal.
39 With this class one can traverse a Graph in depth-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::BFS>, L<Graph>.