
8 Oct
2007
8 Oct
'07
3:42 a.m.
my code to use transitive_closure(): Graph tc; VertexIndexMap index_map = get(&VertexProp::id, g); vector<Vertex> to_tc_vec(num_vertices(g)); iterator_property_map<Vertex*, VertexIndexMap, Vertex, Vertex&> g_to_tc_map(&to_tc_vec[0], index_map); transitive_closure(graph, tc, g_to_tc_map, (index_map)); I use print_graph(tc, get(&VertexProp::id, tc) to print the transitive graph, then it shows: 0 --> 0 0 0 0 0 0 0 0 0 --> 0 0 0 --> 0 --> 0 0 0 0 0 0 0 0 0 --> 0 --> 0 --> 0 0 0 0 --> 0 0 0 0 0 0 0 0 the result miss the id of vertex, what 's the problem. my original graph g is correcet: 0 --> 1 2 3 1 --> 4 5 2 --> 3 --> 6 7 4 --> 5 --> 6 --> 1 7 --> 0