how provide a vertex_index property for my graph

The solution is just to: 1) Say the vertex descriptor is defined as typedef Graph::vertex_descriptor NodeID; then you need to define an associative property map as following: typedef map<NodeID, size_t> IndexMap; IndexMap mapIndex; associative_property_map<IndexMap> propmapIndex(mapIndex); 2) In the code, index all vertices as following: int i=0; BGL_FORALL_VERTICES(v, g, Graph) { put(propmapIndex, v, i++); } 3) … Read more