This example works fine:
http://programmingexamples.net/index.php?title=CPP/Boost/BGL/DijkstraUndirec...
However, if I change
typedef boost::property EdgeWeightProperty;
to
struct EdgeWeightProperty{float weight;};
(and of course remove the lines adding the weights as properties:
boost::add_edge(v1, v2, weight1, g); )
I get crazy template errors:
/usr/include/boost/graph/dijkstra_shortest_paths.hpp: In member
function ‘void boost::detail::dijkstra_bfs_visitor::examine_edge(Edge, Graph&) [with
Edge = boost::detail::edge_desc_impl, Graph = const boost::adjacency_list,
UniformCostVisitor = boost::dijkstra_visitor<>, UpdatableQueue =
boost::d_ary_heap_indirect,
unsigned int, unsigned int&>, int*, std::less<int>,
std::vector<unsigned int> >, WeightMap =
boost::adj_list_edge_property_map, boost::edge_weight_t>, PredecessorMap = unsigned
int*, DistanceMap = int*, BinaryFunction = boost::closed_plus<int>,
BinaryPredicate = std::less<int>]’:
/usr/include/boost/graph/breadth_first_search.hpp:77:47:
instantiated from ‘void boost::breadth_first_visit(const
IncidenceGraph&, typename
boost::graph_traits<IncidenceGraph>::vertex_descriptor, Buffer&,
BFSVisitor, ColorMap) [with IncidenceGraph =
boost::adjacency_list, Buffer =
boost::d_ary_heap_indirect,
unsigned int, unsigned int&>, int*, std::less<int>,
std::vector<unsigned int> >, BFSVisitor =
boost::detail::dijkstra_bfs_visitor,
boost::d_ary_heap_indirect,
unsigned int, unsigned int&>, int*, std::less<int>,
std::vector<unsigned int> >,
boost::adj_list_edge_property_map, boost::edge_weight_t>, unsigned int*, int*,
boost::closed_plus<int>, std::less<int> >, ColorMap =
boost::two_bit_color_map >, typename
boost::graph_traits<IncidenceGraph>::vertex_descriptor = unsigned
int]’
/usr/include/boost/graph/dijkstra_shortest_paths.hpp:332:5:
instantiated from ‘void boost::dijkstra_shortest_paths_no_init(const
Graph&, typename boost::graph_traits<Graph>::vertex_descriptor,
PredecessorMap, DistanceMap, WeightMap, IndexMap, Compare, Combine,
DistZero, DijkstraVisitor, ColorMap) [with Graph =
boost::adjacency_list, DijkstraVisitor =
boost::dijkstra_visitor<>, PredecessorMap = unsigned int*, DistanceMap
= int*, WeightMap =
boost::adj_list_edge_property_map, boost::edge_weight_t>, IndexMap =
boost::vec_adj_list_vertex_id_map,
Compare = std::less<int>, Combine = boost::closed_plus<int>, DistZero
= int, ColorMap =
boost::two_bit_color_map >, typename
boost::graph_traits<Graph>::vertex_descriptor = unsigned int]’
/usr/include/boost/graph/dijkstra_shortest_paths.hpp:383:5:
instantiated from ‘void boost::dijkstra_shortest_paths(const
VertexListGraph&, typename
boost::graph_traits<VertexListGraph>::vertex_descriptor,
PredecessorMap, DistanceMap, WeightMap, IndexMap, Compare, Combine,
DistInf, DistZero, DijkstraVisitor, ColorMap) [with VertexListGraph =
boost::adjacency_list, DijkstraVisitor =
boost::dijkstra_visitor<>, PredecessorMap = unsigned int*, DistanceMap
= int*, WeightMap =
boost::adj_list_edge_property_map, boost::edge_weight_t>, IndexMap =
boost::vec_adj_list_vertex_id_map,
Compare = std::less<int>, Combine = boost::closed_plus<int>, DistInf =
int, DistZero = int, ColorMap =
boost::two_bit_color_map >, typename
boost::graph_traits<VertexListGraph>::vertex_descriptor = unsigned
int]’
/usr/include/boost/graph/dijkstra_shortest_paths.hpp:353:5:
instantiated from ‘void boost::dijkstra_shortest_paths(const
VertexListGraph&, typename
boost::graph_traits<VertexListGraph>::vertex_descriptor,
PredecessorMap, DistanceMap, WeightMap, IndexMap, Compare, Combine,
DistInf, DistZero, DijkstraVisitor, const boost::bgl_named_params&, typename
boost::enable_if_c::value,
boost::graph::detail::no_parameter>::type) [with VertexListGraph =
boost::adjacency_list, DijkstraVisitor =
boost::dijkstra_visitor<>, PredecessorMap = unsigned int*, DistanceMap
= int*, WeightMap =
boost::adj_list_edge_property_map, boost::edge_weight_t>, IndexMap =
boost::vec_adj_list_vertex_id_map,
Compare = std::less<int>, Combine = boost::closed_plus<int>, DistInf =
int, DistZero = int, T = int*, Tag = boost::vertex_distance_t, Base =
boost::bgl_named_params, typename
boost::graph_traits<VertexListGraph>::vertex_descriptor = unsigned
int, typename boost::enable_if_c::value,
boost::graph::detail::no_parameter>::type =
boost::graph::detail::no_parameter]’
/usr/include/boost/graph/dijkstra_shortest_paths.hpp:423:7:
instantiated from ‘void boost::detail::dijkstra_dispatch2(const
VertexListGraph&, typename
boost::graph_traits<VertexListGraph>::vertex_descriptor, DistanceMap,
WeightMap, IndexMap, const Params&) [with VertexListGraph =
boost::adjacency_list, DistanceMap = int*, WeightMap
= boost::adj_list_edge_property_map, boost::edge_weight_t>, IndexMap =
boost::vec_adj_list_vertex_id_map,
Params = boost::bgl_named_params >, typename
boost::graph_traits<VertexListGraph>::vertex_descriptor = unsigned
int]’
/usr/include/boost/graph/dijkstra_shortest_paths.hpp:455:7:
instantiated from ‘void boost::detail::dijkstra_dispatch1(const
VertexListGraph&, typename
boost::graph_traits<VertexListGraph>::vertex_descriptor, DistanceMap,
WeightMap, IndexMap, const Params&) [with VertexListGraph =
boost::adjacency_list, DistanceMap = int*, WeightMap
= boost::adj_list_edge_property_map, boost::edge_weight_t>, IndexMap =
boost::vec_adj_list_vertex_id_map,
Params = boost::bgl_named_params >, typename
boost::graph_traits<VertexListGraph>::vertex_descriptor = unsigned
int]’
/usr/include/boost/graph/dijkstra_shortest_paths.hpp:473:5:
instantiated from ‘void boost::dijkstra_shortest_paths(const
VertexListGraph&, typename
boost::graph_traits<IncidenceGraph>::vertex_descriptor, const
boost::bgl_named_params&) [with VertexListGraph =
boost::adjacency_list, Param = int*, Tag =
boost::vertex_distance_t, Rest = boost::bgl_named_params, typename
boost::graph_traits<IncidenceGraph>::vertex_descriptor = unsigned
int]’
Any chance anyone can interpret these?
Thanks,
David