[vtkusers] vtkBoostBreadthFirstSearch?

Jeff Baumes jeff.baumes at kitware.com
Mon Oct 26 08:29:43 EDT 2009


>
> 1) how do you do that (without writing your

own tree traversal recursive functions) and 2) what does this class

do?


1) Currently there is a vtkTreeDFSIterator which allows you to traverse a
tree pre-order or post-order depth-first, but no BFS iterator.

If you need to iterate breadth-first, you can include vtkBoostGraphAdapter.h
and use boost's breadth_first_search object to iterate over the vtkTree:

http://www.boost.org/doc/libs/1_40_0/libs/graph/doc/breadth_first_search.html

This is what vtkBoostBreadthFirstSearch does in its implementation. Even
better, you can implement a VTK iterator class to do this.

2) vtkBoostBreadthFirstSearch is simply a filter that inputs a graph and
outputs a graph with a vtkIntArray appended that contains the distance
(number of hops) from the origin vertex.

Jeff
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20091026/12dbbc9d/attachment.htm>


More information about the vtkusers mailing list