|
Boost Users : |
From: Stephan Höfer (yg-boost-users_at_[hidden])
Date: 2003-08-01 08:31:33
Hello,
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)
{
add_vertex(g);
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,
g);
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 >
p(num_vertices(tSubGraph));
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
Stephan
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net