Boost logo

Boost :

Subject: [boost] Boost Parallel Graph Library: remove_vertex gives unexpected results
From: Alok Kumbhare (kumbhare_at_[hidden])
Date: 2014-04-08 14:42:26

Hi All,
i need some help with parallel boost graph library. Sorry if this is not
the right list to post. Posting here since it looks like it might be a but.

In particular, i am trying to modify the structure of the graph
(distributed adjacency list) after it is loaded. The code snippet is at

The problem is that clear_vertex(v,g) and remove_vertex(v,g) does not seem
to operate on the same vertex in the graph.

Here is a sample graph in metis format: (I use
the default vertex distribution for this example)

The graph_viz output is available here for different scenarios:!20818&authkey=!AJqEFl3B71RMcaM&v=3&ithint=photo%2c.png>

As you can see in the above figure:

The first image is the original graph split into two partitions (mpirun -np
2 ./test)

The second image is after clear_vertex is called for one of the vertices.
Notice vertex "0". All the edges are removed as expected.

The third image is after remove_vertex is called (which is called after
clear_vertex, as mentioned in the documentation here:
Notice here that the vertex "2" is removed instead of vertex "0" even when
using the same vertex descriptor for both calls.

One thing i noted is that the remove_vertex seems to remove the "last"
vertex in that partition irrespective of the input. e.g. if i use v =
vertex(1,g) in the above code, i still see that the vertex "2" is removed
and the edges rearranged for that.

Is this a bug or am i doing something wrong.

Your help will be greatly appreciated.

Alok Kumbhare

Boost list run by bdawes at, gregod at, cpdaniel at, john at