Boost logo

Boost Users :

Subject: [Boost-users] boost::graph subgraph + write_graphviz()
From: Chris Cooper (rallycoops_at_[hidden])
Date: 2012-08-01 06:57:22


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&)’

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?

Thanks,
Chris

[0] http://www.boost.org/doc/libs/1_48_0/libs/graph/doc/figs/subgraph.gif
[1] http://www.boost.org/doc/libs/1_48_0/libs/graph/example/subgraph.cpp
[2] http://www.boost.org/doc/libs/1_48_0/boost/graph/graphviz.hpp
[3] http://www.boost.org/doc/libs/1_48_0/libs/graph/example/subgraph_properties.cpp


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