
On 13/07/2012 19:24, Jeremiah Willcock wrote:
On Fri, 13 Jul 2012, Alex Hagen-Zanker wrote:
I placed the BGL algorithm of the dijkstra_shortest_path in a class, with the creation and initialization part separate from the main algorithm. This allows interrupting, resetting and resuming the algorithm. Would this be of interest to anybody?
Yes, definitely.
The implementation requires C++11, because of auto and lambda's, it also relies on the following patch: https://svn.boost.org/trac/boost/ticket/7130.
It would be nicer to have it be C++03, since nothing else in BGL requires C++11 yet.
There now is a new version that only requires C++03: http://people.pwf.cam.ac.uk/ahh34/dijkstra_test_v2.zip Using the class without auto takes some of the fun away, as: auto dijkstra = make_dijkstra(g, boost::distance_map(distance).vertex_index_map(indexmap).visitor(vis) ); becomes: typedef boost::bgl_named_params<DistanceMap, boost::vertex_distance_t, boost::bgl_named_params<IndexMap, boost::vertex_index_t, boost::bgl_named_params<DistanceVisitor, boost::graph_visitor_t> > >Params; typedef boost::dijkstra_traits<Graph, Params>::dijkstra_type dijkstra_type; dijkstra_type dijkstra = make_dijkstra(g, boost::distance_map(distance).vertex_index_map(indexmap).visitor(vis) );
I haven't had a chance to look at it yet, but I'm definitely interested in putting it in when it's ready.
Thanks, please let me know what you think once you have taken a look.