Boost logo

Boost :

From: Douglas Paul Gregor (gregod_at_[hidden])
Date: 2003-03-20 14:14:56


The handling of attributes in write_graphviz differs greatly depending on
whether the graph given to write_graphviz is a subgraph or not. With
normal graphs, one can (optionally) specify vertex, edge, and graph
writers that write the entire attribute string in graphviz format. If a
particular writer is not specified, we fall back on default_writer (which
does nothing). This method makes it very easy to write a new writer that
just picks out a particular property and dumps it to the output stream.
For instance, label_writer is very useful and very trivial.

With subgraphs, there is no option to pass writers directly. Instead, we
use properties with tags vertex_attribute_t and edge_attribute_t to output
attributes: the value type for these properties is a container of pairs
(n,v) where n is the name of the attribute and v is the value. This works
well when we can have a pair of strings lying around for each graph, but
it's a lot of work to simulate the simple label_writer usage.

I don't mind fixing this, but I would like to hear some comments on the
reasons for the existing implementations, and would like to discuss how we
can do this better.

For instance, I think we should keep subgraph<>'s use of
vertex_attribute_t and edge_attribute_t for the attribute list, but
introduce an easy way to use values in a property map. It shouldn't be
harder than:
  make_property_writer("label", property_map)

        Doug


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk