
On Thu, 20 May 2010, Eric Fowler wrote:
I wish to run a breadth_first_search() on a graph where I am defining the priority queue (I have a hand-rolled sort order). Is there any reason I cannot use std::priority_queue<> to do this? Does anyone have an example, or know of one in the docs?
One easy place to find that code is in this function in boost/graph/dijkstra_shortest_paths.hpp: // Call breadth first search template <class Graph, class DijkstraVisitor, class PredecessorMap, class DistanceMap, class WeightMap, class IndexMap, class Compare, class Combine, class DistZero, class ColorMap> inline void dijkstra_shortest_paths_no_init (const Graph& g, typename graph_traits<Graph>::vertex_descriptor s, PredecessorMap predecessor, DistanceMap distance, WeightMap weight, IndexMap index_map, Compare compare, Combine combine, DistZero zero, DijkstraVisitor vis, ColorMap color); (note that there are other overloads that do not call breadth_first_search directly). That code creates a priority queue and uses it in BFS. I do not see any code in BGL that uses std::priority_queue in BFS. -- Jeremiah Willcock