
On Jul 4, 2006, at 7:49 PM, sean yang wrote:
My question is: (1) is there an easy (some API, sorry I am not familar with the library) way to reverse edge direction?
Yes, the "reverse_graph" adaptor reverses the edge direction.
(2) is there an easy way to add a 'printf()' during BFS?
You can write your own BFS visitor, which has an "examine_vertex" method that printf()'s the current vertex as it is processed. The whole thing will look something like this: struct print_visitor : boost::bfs_visitor<> { template<typename Graph, typename Vertex> void examine_vertex(Vertex u, const Graph& g) { printf(...); } }; breadth_first_search(boost::make_reverse_graph(travel), target_2, boost::visitor(print_visitor())); Doug