Boost logo

Boost Users :

Subject: [Boost-users] Bundled properties with boyer_myrvold_planarity_test
From: Nick Wiggill (nick.wiggill_at_[hidden])
Date: 2009-12-13 14:47:40

Can't seem to get this working. I'm not sure if there was something I
missed in the docs, but as soon as I use bundled properties
boyer_myrvold_planarity_test falls over.

void SomeClass::create()
typedef adjacency_list<listS, listS, undirectedS,
    property <vertex_index_t, int>,
    property <edge_index_t, int> > Graph;

typedef graph_traits<Graph>::vertex_descriptor Vertex;
typedef graph_traits<Graph>::edge_descriptor Edge;
typedef graph_traits<Graph>::vertex_iterator VertexIterator;


//Create graph
const int NUM_VERTICES = 5;
Graph graph(NUM_VERTICES);

//Create vertices and edges

Vertex u, v;
u = vertex(0, graph);
v = vertex(4, graph);
//add_edge(u, v, graph); //BAD line!

//Other attempted/failed way of adding edges
//Edge e;
//e = edge(u, v, graph);

//Another attempt, doesn't seem to work with
//bundled props, unsurprisingly.
//add_edge(0, 4, graph);

cout << "Vertex and edge additions complete." << endl;

//iterate through vertices
VertexIterator vItr, vItrEnd;

for (tie(vItr, vItrEnd) = vertices(graph); vItr != vItrEnd; ++vItr)
    cout << "#"<< endl; //<< graph[*vItr] << endl;

cout << "Vertex iteration complete." << endl;

if (boyer_myrvold_planarity_test(graph))
    cout << "Test claims graph is planar" << endl;
    cout << "Test claims graph is non-planar" << endl;

cout << "Planarity testing complete." << endl;

The line commented "BAD line!" causes an exit on calling
boyer_myrvold_planarity_test. With the test commented
out, the program will run to its normal completion.

What am I failing to grasp?



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