Yes, that is correct. Both vertex and edge index maps exist, though, so it
is easy to use external properties for both of those (unlike edge properties
for adjacency_list).
Hm, I've been playing with this for a while now and I don't seem to
understand how to add something to the vertex index map.
This compiles, but I think it is creating a new map:
#include <iostream>
#include
#include
int main(int argc, char* argv[])
{
typedef boost::grid_graph<2> GraphType;
const unsigned int dimension = 5;
boost::array lengths = { { dimension, dimension } };
GraphType graph(lengths);
boost::graph_traits<GraphType>::vertex_descriptor v = { { 0, 1 } };
std::vector<float> vertexData(dimension * dimension, 0);
boost::grid_graph_index_map
myMap(graph);
float retrieved = get(myMap, v);
std::cout << "Retrieved: " << retrieved << std::endl;
}
Could you demonstrate how to do this? We should really add this to the
grid_graph documentation :)
Thanks,
David