lib/rgl/traversal.rb in rgl-0.5.1 vs lib/rgl/traversal.rb in rgl-0.5.2
- old
+ new
@@ -167,9 +167,13 @@
# Do a recursive DFS search on the whole graph. If a block is passed,
# it is called on each _finish_vertex_ event. See
# strongly_connected_components for an example usage.
#
+ # Note that this traversal does not garantee, that roots are at the top of
+ # each spanning subtree induced by the DFS search on a directed graph (see
+ # also the discussion in issue #20[https://github.com/monora/rgl/issues/20]).
+ #
def depth_first_search(vis = DFSVisitor.new(self), &b)
each_vertex do |u|
unless vis.finished_vertex?(u)
vis.handle_start_vertex(u)
depth_first_visit(u, vis, &b)