Hi,
I try to write my graph to std::cout with boost::write_graphviz.
In the example boost/libs/graph/example/graphviz.cpp,
the graph used is a
boost::adjacency_list,
property >
and all work fine.
my graph is a
boost::adjacency_list,
property,
property ,
listS >
If a do "write_graphviz(std::cout, g);"
I have a very big error. (why BGL didn't use boost concept check ???)
I search in boost code and i found !!!
In the file boost/graph/graphviz.hpp line 257 (boost 1.34)
"out << get(vertex_id, *i);"
so write_graphviz function get the vertex property with the tag of type
vertex_id.
By default, the type vertex_id is the enum boost::vertex_index
which do reference to the type boost::vertex_index_t;
This property is intrinsically in the type boost::adjacency_list
because the vertex_descriptor is the index of the vertex. And so all
work fine with
the function write_graphviz
With the type boost::adjacency_list, this property is not
available. TOOOOOO
In the complete signature function :
void write_graphviz(std::ostream &, const VertexListGraph & g
vertexPropertyWrite vpw,
EdgePropertyWriter epw,
GraphPropertyWriter gpw,
VertexID vertex_id);
I can give the property_tag to used in the function.
But, In opposition to other BGL algorithm which accept an external
PropertyMap,
this property must be in the graph. And I don't want to add a index
property.
Question :
How to use write_graphviz algorithm with boost::adjacency_list ?
Is there a magic boost property tag to use with a
boost::adjacency_list
like the boost::vertex_index_t tag and the boost::adjacency_list
is there another solution ??
Thank
David Callu