I have a graph instantiated with the following:
typedef boost::property<boost::edge_weight_t, uint32_t> EdgeWeightProperty;
typedef boost::property<boost::vertex_index_t, uint32_t> VertexProperty;
typedef boost::adjacency_list<boost::vecS, boost::setS,
boost::undirectedS, VertexProperty,
EdgeWeightProperty, boost::setS> Graph;
I need to update this graph, e.g. add or remove edges. Since I'm using a set to store the vertices, I can't use their index, but I can keep a map:
unordered_map<uint32_t, Vertex_Descriptor>
That maps my indexes to vertices descriptors, so I can then later access directly in BGL, this approach works but adds this map overhead.
Can I somehow specify a custom index or what to compare when getting/putting vertices in the BGL? Or keeping vertices descriptors in a map is the best approach?
Full example at coliru