Boost logo

Boost Users :

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

On Thu, 23 Jun 2011, Jeremiah Willcock wrote:

> On Wed, 22 Jun 2011, David Doria wrote:
>>> I think you will need some kind of property to store the vertex names from
>>> Graphviz; you might be able to use null_property_map for that (from
>>> <boost/graph/property_maps/null_property_map.hpp>) though.
>>> -- Jeremiah Willcock
>> The following works, but it seems very confusing. I tried the two
>> commented lines separately but they don't compile. Is this the
>> recommended method?
> You don't need to modify the graph definition at all. I think this will
> work:
> graph_t graph;
> boost::dynamic_properties dp;
>"node_id", boost::make_null_property<vertex_descriptor, string>);

Sorry -- that needs to be make_null_property<...>().

> bool status = boost::read_graphviz(stream,graph,dp,"node_id");

-- Jeremiah Willcock

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