Since my graph use setS for vertex, I have to either provide a vertex_index property map for my graph, or give an explicit vertex_id argument to write_graphviz, to be able to use write_graphviz.
My graph is defined as: typedef adjacency_list<setS, setS, undirectedS, NodeData, EdgeData> Graph;
Where NodeData and EdgeData are structures.
Can you please give me a very simple example of how to provide a vertex_index property map for my graph ? or how to give an explicit vertex_id argument to write_graphviz ?
Thanks
The solution is just to:
1) Say the vertex descriptor is defined as
typedef Graph::vertex_descriptor NodeID;then you need to define an associative property map as following:2) In the code, index all vertices as following:
3) You can now use graphvize to drow/visualize your graph as following:
The graph will be described in example.txt, you can visualize it using graphviz.