Boost logo

Boost Users :

Subject: [Boost-users] Using metric_tsp_approx with bundled properties
From: Alexis Praga (alexispraga_at_[hidden])
Date: 2014-04-13 17:02:08


I am trying to use metric_tsp_approx on a graph defined as :

typedef adjacency_list<vecS, vecS, undirectedS, City, Road> Graph;

City contains the vertex id and Road the edge weight.
After reading the documentation, I arrived to :

      weight_map(get(&Road::length, g_init)).
      vertex_index_map(get(&City::id, g_init)),

I have compilation errors however. The relevant part seems to be :

/usr/include/boost/property_map/property_map.hpp:382:58: error: no
type named ‘key_type’ in ‘struct
boost::vecS, boost::undirectedS, City, Road>, long unsigned int, City,
int>, boost::vertex_index_t, boost::no_property> >’

Any help appreciated, thanks.

Alexis Praga, PhD Student (CERFACS)
GPG key : AD4A AF6D BB5C 042F 9422  1223 06E1 C1BF E287 65D0

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at