Boost logo

Boost Users :

Subject: Re: [Boost-users] read_graphviz with a simple graph
From: Jeremiah Willcock (jewillco_at_[hidden])
Date: 2011-06-28 13:26:03

On Sun, 26 Jun 2011, David Doria wrote:

> 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:
> Does this look reasonable?

I think (but am not sure) that backslash-newlines inside strings are not
portable. You might want to put it onto one line, or use a separate
string constant for each line (which will be joined automatically). You
might also want to use boost::lexical_cast for the various string
conversions you do in the code.

-- Jeremiah Willcock

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