Boost logo

Boost Users :

Subject: Re: [Boost-users] read_graphviz with a simple graph
From: David Doria (daviddoria_at_[hidden])
Date: 2011-06-26 15:19:00


On Fri, Jun 24, 2011 at 2:50 PM, Jeremiah Willcock <jewillco_at_[hidden]> wrote:
> 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).

I think I figured out how this must be done. I read the graph, then
construct a new graph using the vertex names/ids that were in the file
to create edges on a sequentially labeled vertex set (a simple
adjacency_list(19) type of thing with vecS vertices). I then convert
the string properties to unsigned ints and use those as the new vertex
ids:

http://programmingexamples.net/index.php?title=CPP/Boost/BGL/RelabelInputVertices

Does this look reasonable?

Thanks,

David


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net