Ok, thanks
Best Regards.

2014-03-14 0:00 GMT+09:00 Tiago de Paula Peixoto <tiago@skewed.de>:
On 03/13/2014 11:45 AM, ξΙΛΟΜΑΚ λΙΞΑΫ wrote:
>
> Hello.
>
> import sys, os
> from pylab import *
> from numpy.random import *
> from graph_tool.all import *
> g = Graph(directed=False);
>
> N = 10;
> v = g.add_vertex();
> vlist = [v];
> for i in range(1, N):
> š š š š v = g.add_vertex()
> š š š š c = randint(0, len(vlist))
> š š š š target = vlist[c]
> š š š š g.add_edge(v, target)
> š š š š vlist.append(v)
> š š š š if randint(0, 2) == 1:
> š š š š š š š š rem = randint(0, len(vlist))
> š š š š š š š š g.remove_vertex( vlist[rem] );
>
> graph_tool.stats.remove_self_loops(g);
> pos = sfdp_layout(g, cooling_step=0.99);
> graph_draw(g, pos, output_size=(1000, 1000),vertex_size=10, edge_pen_width=2.2, output="graph" + str(i) + ".png")
> l = graph_tool.topology.label_largest_component(g);
> print(l.a);
> u = graph_tool.topology.GraphView(g, vfilt=l);
> print(u.num_vertices());
>
>
> =============out=======
> python test_graph.py
> [0 1 1 0 0]
> 2
>
> but in image i see 4 vertex in largest connected component.
>
> I try it over and over, and always see that 1 or 2 vertex missed.

This is actually a bug in vertex removal which happens in some corner
cases. I've fixed this now in git. Thanks for pointing this out!

I'll make a bugfix release soon. As a temporary workaround you can make
g.set_fast_edge_removal(True) before removing vertices from the graph.

Best,
Tiago

--
Tiago de Paula Peixoto <tiago@skewed.de>


_______________________________________________
graph-tool mailing list
graph-tool@skewed.de
http://lists.skewed.de/mailman/listinfo/graph-tool