Boost logo

Boost Users :

Subject: [Boost-users] [BGL] setS as an edge container
From: Datalurkur (datalurkur_at_[hidden])
Date: 2010-12-28 14:02:01


I'm attempting to set up pathfinding using Dijkstra's algorithm, and decided to
use setS since I need to add/remove edges frequently and don't want to worry
about adding parallel edges. My typedefs are such:

typedef property<edge_weight_t, int> Weight;
typedef adjacency_list<vecS, setS, undirectedS, no_property, Weight> Graph;
typedef graph_traits<Graph>::vertex_descriptor VertexDescriptor;
typedef graph_traits<Graph>::edge_descriptor EdgeDescriptor;

However, when trying to actually call dijkstra_shortest_paths, like so:

std::vector<VertexDescriptor> predecessorMap(num_vertices(*_graph));
std::vector<int> distanceMap(num_vertices(*_graph));
dijkstra_shortest_paths(*_graph, startVertex,
predecessor_map(&predecessorMap[0]).distance_map(&distanceMap[0]));

I wind up with a bunch of compile errors within boost. Some examples:
.../Boost.framework/Headers/graph/dijkstra_shortest_paths.hpp:377: error: no
matching function for call to 'put(int*&, void* const&, int&)'
.../Boost.framework/Headers/graph/two_bit_color_map.hpp:77: error: invalid cast
from type 'boost::detail::error_property_not_found' to type 'size_t'
.../Boost.framework/Headers/graph/dijkstra_shortest_paths.hpp:139: error: no
matching function for call to 'get(int*&, void*)'

I suspect it has something to do with the index map, but I assumed that vertex
mappings that used vecS didn't need to be supplied with an index map. I
followed the dijkstra example as closely as possible, but since they have a
static set of edges and use vecS to store the edge map, I'm pretty certain
that's where the discrepancy lies. Any other examples, advice?


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