On Mon, 22 Mar 2010, Rong She wrote:
I have declared CustomVertex and CustomEdge classes, each with a bunch of internal properties. class CustomVertex { int length; string name; bool ori; public: CustomVertex() {} ~CustomVertex() {} FlipVertex() { ori = !ori; } }; class CustomEdge { char type; int distance; bool src_ori; bool dst_ori; public: CustomEdge() {} ~CustomEdge() {} };
Tried to use bundled properties, the graph is defined as: typedef adjacency_list
myGraph; I want to read from a dot file (which contains all appropriate vertex, edge information) and populate the graph. I know I'm supposed to use dynamic_properties etc. Could someone show me how exactly? Thanks.
Please look at libs/graph/example/graphviz.cpp in your Boost source tree. The important part you need to change is the top of main() where the id and weight properties are registered. You should change those to your own property maps and names. You should then be able to do a read_graphviz call similar to the one in that example. -- Jeremiah Willcock