What is required for a custom BGL graph to work with topological sort?

As you correctly surmised, the error novel is telling you that there is no index map. That is required for the default color map: UTIL/OUT: color_map(ColorMap color) This is used by the algorithm to keep track of its progress through the graph. The type ColorMap must be a model of Read/Write Property Map and its … Read more

how provide a vertex_index property for my graph

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: typedef map<NodeID, size_t> IndexMap; IndexMap mapIndex; associative_property_map<IndexMap> propmapIndex(mapIndex); 2) In the code, index all vertices as following: int i=0; BGL_FORALL_VERTICES(v, g, Graph) { put(propmapIndex, v, i++); } 3) … Read more