Boost logo

Boost Users :

Subject: Re: [Boost-users] read_graphviz with a simple graph
From: Jeremiah Willcock (jewillco_at_[hidden])
Date: 2011-06-24 14:50:23

On Fri, 24 Jun 2011, David Doria wrote:

>> Did you need the vertex IDs from the Graphviz file?  If so, you will need a
>> "real" property map as node_id (either internal to the graph or an external
>> one).
> Hm, but then I won't be able to access the vertices like "normal"
> (with graph[my_vertex_descriptor]) with the vertex_descriptor
> corresponding to the vertex ID (in the vecS case), right? That would
> be pretty awkward - to have to use one method to access nodes if the
> graph was constructed programmatically, and another if it was read
> from a file.

Since the vecS vertex descriptors must be contiguous integers, you
probably can't use the IDs from the graph directly. You would need a
custom graph type for that, or (if you allow messier syntax) an std::map
or similar as a lookup table mapping IDs to descriptors.

-- Jeremiah Willcock

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at