Boost logo

Boost Users :

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


On Wed, 22 Jun 2011, David Doria wrote:

> If I have a graph with no vertex properties or edge properties:
>
> adjacency_list<vecS, vecS, undirectedS>
>
> can I read a .dot file into it with read_graphviz?
>
> I tried:
>
> dynamic_properties dp;
> Graph g;
> read_graphviz(fileinput, g, dp);
>
> but it throws an exception "Property not found: node_id".
>
> I tried to add
>
> property_map<Graph, vertex_name_t>::type name = get(vertex_name, g);
> dp.property("node_id",name);
>
> but I get a compiler error "No match for operator<<"

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


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