title: should I keep track of vertex descriptors in boost graph library?
body: <p>I have a graph instantiated with the following:</p>
  
  <pre><code>typedef boost::property&lt;boost::edge_weight_t, uint32_t&gt; EdgeWeightProperty;
  typedef boost::property&lt;boost::vertex_index_t, uint32_t&gt; VertexProperty;
  typedef boost::adjacency_list&lt;boost::vecS, boost::setS,
                                boost::undirectedS, VertexProperty,
                                EdgeWeightProperty, boost::setS&gt; Graph;
  </code></pre>
  
  <p>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:</p>
  
  <pre><code>unordered_map&lt;uint32_t, Vertex_Descriptor&gt;
  </code></pre>
  
  <p>That maps my indexes to vertices descriptors, so I can then later access directly in BGL, this approach works but adds this map overhead.</p>
  
  <p>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?</p>
  
  <p>Full example at <a href="http://coliru.stacked-crooked.com/a/fe8e0f49a474d7fd" rel="nofollow noreferrer">coliru</a></p>