[bgl] write_graphviz without vertex_id

Hello, I have a graph that does not have vertex_id. Each node in my graph might be uniquely identified, because I have a property map to some objects which have a unique id. However, when I try to write the graph to graphviz, it requires this vertex_id property. I bother me to add a vertex_id property to my graph just for this purpose, and I wonder if it could be possible to extend the write_graphviz in order to allow the user to customize the vertex id that is written in the dot file. Regards, -- Loïc

Hello Loïc I might be wrong, but since vertex descriptors are usually integers (and therefore its value type can be written to a stream), using identity_property_map as your vertex_id property map might do the trick. See http://www.boost.org/libs/property_map/identity_property_map.html for more information. Hope this helps ! Benoît

Hello, On Sep 28, 2006, at 5:21 AM, Loïc Joly wrote:
However, when I try to write the graph to graphviz, it requires this vertex_id property. I bother me to add a vertex_id property to my graph just for this purpose, and I wonder if it could be possible to extend the write_graphviz in order to allow the user to customize the vertex id that is written in the dot file.
Yes, this was a problem with Boost 1.33.1 and previous. The CVS version of Boost has an extra overload of write_graphviz that accepts a vertex id property map parameter. You can probably use the latest graphviz.hpp directly from CVS: http://www.boost-consulting.com/boost/boost/graph/graphviz.hpp This change will be present in Boost 1.34.0. Cheers, Doug
participants (3)
-
Benoit
-
Doug Gregor
-
Loïc Joly