Boost logo

Boost Users :

Subject: Re: [Boost-users] [Graph] Difference between DF search and visit / Graph Printing
From: Andrew Sutton (asutton.list_at_[hidden])
Date: 2011-03-26 08:43:19


> I am struggling a little understanding the difference between the DF search
> and visit. I thought that the DF visit would revisit "back" nodes while the
> DF search would not. But as I just found out that does seem to be the
> difference.

Depth-first visit will only visit vertices that reachable for the
start vertex. Depth-first search will visit all vertices in the graph.

> I then apply the visitor with a call to boost::depth_first_visit() and my
> graph. However, the problem is, that the "End" node is only visited, and
> therefore printed, once.

DFS is guaranteed to visit each node exactly once.

> So what am I probably missing to print the graph in the fasion I want it?

Are you trying to print all paths from the root of the tree to leaves?
That's a little bit harder problem, I think.

Andrew


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net