Why can't I use boost graph write_graphviz with OutEdgeList=listS and VertexList=listS
Hi
Why can't I compile the following simple app. If I changes listS to
vecS every thing works just fine. (I'am using boost 1.46.1 and gcc
4.4.5)
#include <iostream>
#include
On Mon, 25 Apr 2011, Allan Nielsen wrote:
Hi
Why can't I compile the following simple app. If I changes listS to vecS every thing works just fine. (I'am using boost 1.46.1 and gcc 4.4.5)
#include <iostream> #include
#include int main(int argc, const char *argv[]) { boost::adjacency_list< boost::listS, boost::listS, boost::bidirectionalS > g;
boost::write_graphviz(std::cout, g);
return 0; }
The write_graphviz function requires a vertex_index map, which is not provided by default by graphs with listS as the vertex container. You can add that property explicitly to a listS graph, and fill it in before the write_graphviz call (after any changes to the graph vertices). -- Jeremiah Willcock
Hi
The write_graphviz function requires a vertex_index map, which is not provided by default by graphs with listS as the vertex container. You can add that property explicitly to a listS graph, and fill it in before the write_graphviz call (after any changes to the graph vertices).
Thanks.... But it is not clear to me how to do this (sorry, i'am quite new to BGL) If I would just like to use the vertes_descriptor pointers as lables, what would that look like?? Do you know about an example I could look at?? -- Allan
On Mon, 25 Apr 2011, Allan Nielsen wrote:
Hi
The write_graphviz function requires a vertex_index map, which is not provided by default by graphs with listS as the vertex container. You can add that property explicitly to a listS graph, and fill it in before the write_graphviz call (after any changes to the graph vertices).
Thanks.... But it is not clear to me how to do this (sorry, i'am quite new to BGL)
If I would just like to use the vertes_descriptor pointers as lables, what would that look like??
Try something like this (not tested):
#include
Do you know about an example I could look at??
No, I don't. -- Jeremiah Willcock
participants (2)
-
Allan Nielsen
-
Jeremiah Willcock