Boost logo

Boost Users :

Subject: Re: [Boost-users] dijkstra_shortest_paths with a graph with bundled edge properties
From: Jeremiah Willcock (jewillco_at_[hidden])
Date: 2011-10-26 15:15:27


On Wed, 26 Oct 2011, David Doria wrote:

> This example works fine:
>
> http://programmingexamples.net/index.php?title=CPP/Boost/BGL/DijkstraUndirected
>
> However, if I change
>
> typedef boost::property<boost::edge_weight_t, float> EdgeWeightProperty;
>
> to
>
> struct EdgeWeightProperty{float weight;};
>
> (and of course remove the lines adding the weights as properties:
> boost::add_edge(v1, v2, weight1, g); )

Did you change the weight map argument to dijkstra_shortest_paths to
&EdgeWeightProperty::weight? It appears that you might not have; the
error message is claiming that the weight map is error_property_not_found,
which is what is produced when an old-style property map looked up in a
graph doesn't exist.

-- Jeremiah Willcock


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