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:05:57


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;
dp.property("node_id", boost::make_null_property<vertex_descriptor, string>);

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

-- Jeremiah Willcock


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