title: Boost Graph read_graphml & dynamic vertex properties
body: <p>I have use the boost graph library and read in a graph from a graphml such as this: </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;graphml xmlns="http://graphml.graphdrawing.org/xmlns"  
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns
     http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd"&gt;
      &lt;graph id="G" edgedefault="directed"&gt;
          &lt;node id="A"/&gt;
          &lt;node id="B"/&gt;
          &lt;edge id="0" source="A" target="B"&gt;
      &lt;/graph&gt;
  &lt;/graphml&gt;
  </code></pre>
  
  <p>I have the following C++ function:</p>
  
  <pre><code>using namespace boost;
  typedef adjacency_list&lt;vecS, vecS, directedS&gt; BoostGraphType;
  typedef dynamic_properties BoostDynamicProperties;
  
  BoostGraphType&amp; g = ...;
  BoostDynamicProperties&amp; dp = ...;
  read_graphml(is, g, dp);
  
  // get the property map for vertex indices
  typedef property_map&lt;BoostGraphType, vertex_index_t&gt;::type IndexMap;
  IndexMap index_map = get(vertex_index, g);
  
  typedef graph_traits&lt;BoostGraphType&gt;::vertex_iterator vertex_iter;
  for (auto vp = vertices(g); vp.first != vp.second; ++vp.first)
  {
      size_t index = index_map[*vp.first];
      // How do I get the id of the node?
  }
  </code></pre>
  
  <p>How can I extract the id of each node, resp. associate the boost vertex_index and "id"-graphml-tag?</p>
  
  <p>Alternatively, how can I identify or map the vertices in my boost graph structure to the vertices in my GraphML file?</p>