Boost logo

Boost Users :

From: Stephan Höfer (yg-boost-users_at_[hidden])
Date: 2003-08-01 08:31:33


I try to use prim_minimum_spanning_tree to find rings in subgraphs doing

the following:

typedef subgraph< adjacency_list<vecS, vecS, undirectedS,
  VertexProperty, EdgeProperty> > Graph;

/... building Graph g with some vertices and edges
 for(int i=0; i<7; ++i)
  LAMath::Vec3_f tVec((float)i, (float)(6-i), .0);
  put(vertex_point_t(), g, i, tVec);

 property_map<Graph, edge_weight_t>::type weightmap = get(edge_weight,
 Edge e; bool inserted;

 tie(e, inserted) = add_edge(0, 1, g);
 weightmap[e] = 1;
 tie(e, inserted) = add_edge(1, 2, g);
 weightmap[e] = 1;
 tie(e, inserted) = add_edge(2, 3, g);

Graph tSubGraph = g.create_subgraph();

 add_vertex(1, tSubGraph);
 add_vertex(3, tSubGraph);
 add_vertex(4, tSubGraph);
 add_vertex(6, tSubGraph);

 std::vector < graph_traits < Graph >::vertex_descriptor >

 prim_minimum_spanning_tree(tSubGraph, &p[0]);

After having created the graph g, I call the create_subgraph member
function to get an induced subgraph of it. Trying to use the
prim_minimum_spanning_tree function it crashes in dijkstra_dispatch1 by
trying to delete the local variable std::vector<D> distance_map(n).
Is there something missing in my code which leads to that crash?
It works for the root graph but not for any new created subgraph.

Help would be appreciated.
Thanks in advance

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at