
Graph::Traversal - graph traversal

use Graph::Traversal;

new
$s = Graph::Traversal->new($G, %param)Returns a new graph search object for the graph $G and the parameters %param.
Usually not used directly but instead via frontends like Graph::DFS for depth-first searching and Graph::BFS for breadth-first searching:
$dfs = Graph::DFS->new($G, %param) $bfs = Graph::BFS->new($G, %param)%param documentation to be written
reset
$S->resetResets a graph search object $S to its initial state.
next_preorder
$v = $s->next_preorderReturns the next vertex in preorder of the graph encapsulated within the search object $s.
next_postorder
$v = $S->next_postorderReturns the next vertex in postorder of the graph encapsulated within the search object $S.
next_edge
($u, $v) = $s->next_edgeReturns the vertices of the next edge of the graph encapsulated within the search object $s.
preorder
@V = $S->preorderReturns all the vertices in preorder of the graph encapsulated within the search object $S.
postorder
@V = $S->postorderReturns all the vertices in postorder of the graph encapsulated within the search object $S.
edges
@V = $S->edgesReturns all the edges of the graph encapsulated within the search object $S.
roots
@R = $S->rootsReturns all the root vertices of the trees of the graph encapsulated within the search object $S. "The root vertices" is ambiguous: what really happens is that either the roots from the previous search made on the $s are returned; or a preorder search is done and the roots of this search are returned.
_vertex_roots
%R = $S->_vertex_rootsReturns as a hash of ($vertex, index) pairs where index is an index into the vertex_root list of the traversal.
"The root vertices" is ambiguous; see the documentation of the roots() method for more details.
(This is the old vertex_roots().)
vertex_roots
%R = $S->vertex_rootsReturns as a hash of ($vertex, $root) pairs all the vertices and the root vertices of their search trees of the graph encapsulated within the search object $S.
"The root vertices" is ambiguous; see the documentation of the roots() method for more details.
(See also _vertex_roots()).

Copyright 1999, O'Reilly & Associates.
This code is distributed under the same copyright terms as Perl itself.