Boost logo

Boost Users :

Subject: Re: [Boost-users] boost::graph subgraph + write_graphviz()
From: Jeremiah Willcock (jewillco_at_[hidden])
Date: 2012-08-01 11:33:51


On Wed, 1 Aug 2012, Chris Cooper wrote:

> Hi,
>
> I'm trying to output an image showing subgraphs [0] using
> write_graphviz() in boost 1.48.0. I've tried to modify an example [1]
> by adding a write_graphviz() call. eg...
>
> std::ofstream ofs("out.dot");
> const char* names[] = { "A", "B", "C", "D", "E", "F" };
> write_graphviz(ofs, G0.m_graph, make_label_writer(names));
>
> This works fine for displaying the underlying graph, but no subgraphs
> are shown. When I do the following...
>
> write_graphviz(ofs, G0, make_label_writer(names));
>
> I get a host of errors including...
>
> include/boost/graph/graphviz.hpp:377: error: no matching function
> for call to ‘get(boost::label_writer<const char**>&, Vertex&)’

Can you please try using write_graphviz_dp instead of write_graphviz?
That might work better, and allows you to specify properties to write more
easily.

> I notice a comment in graphviz.hpp [2] 'requires graph_name graph
> property' so I had a look at the subgraph_properties.cpp example [3].
> This seemed to only be showing vertex properties but didn't compile
> out of the box. Is it possible for someone experienced in
> boost::graph to post a modified version of [1] that can produce
> something like image [0], or point me in the right direction?

I just committed a fixed version of subgraph_properties.cpp to the trunk,
so that one should compile now.

-- 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