Boost logo

Boost Users :

Subject: Re: [Boost-users] [BGL] dijkstra_shortest_paths with listS
From: gast128 (gast128_at_[hidden])
Date: 2010-01-09 16:14:31


> I don't think you need an adaptor. You can have the edge weight as a
> member in the property bundle and then use boost::get(&EdgeProps::weight,
> g) to get a property map for it. Is there something else you might need
> to adapt?

Yes this is what I call 'adapt'. If the edge type was only weight, e.g.:

typedef boost::adjacency_list<boost::listS,
                              boost::listS,
                              boost::bidirectionalS,
                              std::string,
                              int> Graph;

then Dijkstra becomes something like:

boost::dijkstra_shortest_paths(graph, vA, boost::weight_map(boost::get
(boost::edge_bundle, graph)).vertex_index_map(pmVertexIndex).distance_map
(pmDistance).predecessor_map(pmPredecessor));


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