the original graph looks like that
0--1--2--3
| | | |
7--6--5--4
the subgraph looks like that
0--1--2
| |
6--5
typedef boost::property >
VertexProperty;
typedef boost::property > > EdgeProperty;
typedef boost::subgraph< boost::adjacency_list > Graph;
void main()
{
Graph g(7);
boost::property_map::type weightmap =
boost::get(boost::edge_weight, g);
Edge e; bool inserted;
boost::tie(e, inserted) = boost::add_edge(0, 1, g); weightmap[e] = 1;
boost::tie(e, inserted) = boost::add_edge(1, 2, g); weightmap[e] = 1;
boost::tie(e, inserted) = boost::add_edge(2, 3, g); weightmap[e] = 1;
boost::tie(e, inserted) = boost::add_edge(3, 4, g); weightmap[e] = 1;
boost::tie(e, inserted) = boost::add_edge(4, 5, g); weightmap[e] = 1;
boost::tie(e, inserted) = boost::add_edge(5, 2, g); weightmap[e] = 1;
boost::tie(e, inserted) = boost::add_edge(5, 6, g); weightmap[e] = 1;
boost::tie(e, inserted) = boost::add_edge(6, 1, g); weightmap[e] = 1;
boost::tie(e, inserted) = boost::add_edge(6, 7, g); weightmap[e] = 1;
boost::tie(e, inserted) = boost::add_edge(7, 0, g); weightmap[e] = 1;
Graph& tSubGraph = g.create_subgraph();
add_vertex(0,tSubGraph); add_vertex(1,tSubGraph); add_vertex(2,tSubGraph);
add_vertex(5,tSubGraph); add_vertex(6,tSubGraph);
std::vector < boost::graph_traits < Graph >::vertex_descriptor>
p(boost::num_vertices(tSubGraph));
boost::prim_minimum_spanning_tree(tSubGraph, &p[0]);
}
The crash happens after having added for instance the 6th point of the Graph
g to the subgraph. Before it worked.
Jeremy Siek schrieb:
I haven't been following the thread, but if you post a small (less than
one page) but complete
example program that exhibits the crash I'd be willing to take a look.
Cheers,
Jeremy
On Tuesday, August 5, 2003, at 02:21 AM, Stephan Höfer wrote:
Thank you for the hint. I've overseen that. But beside that there must
be another mistake, because it crashes again
after that slight change of the code.
Info: http://www.boost.org
Wiki: http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl
Unsubscribe: mailto:boost-users-unsubscribe@yahoogroups.com
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/