On 05/30/2011 04:18 PM, Sebastian Weber wrote:
I just discovered a quite strange behavior of graph-tool. I want to keep only the largest component of my network and the following code
comp = label_largest_component(G) lc = comp.a == 1 Gv = Graph(GraphView(G, vfilt=lc), prune=True)
simply gives wrong results. It deletes vertices which are in the LC and have comp[v]==1 !!!
I cannot reproduce this problem. Do you have a concrete (and simple) example of where this happens? With "prune=True", the filtered vertices are not deleted, but rather only the non-filtered vertices are copied. So in order for this to somehow fail, there must be something wrong with the filtered graph you are trying to copy. BTW, why do you use 'lc' as the vfilt parameter of GraphView, instead of 'comp' directly? Cheers, Tiago -- Tiago de Paula Peixoto <tiago@skewed.de>