Hello everybody !!! I was looking at patch http://trac.sagemath.org/sage_trac/ticket/7184 when I read again the usual lines :
n = G.vertices()[G.order()-1] + 1 G.add_vertex(n) This, because the author wants to add a vertex to the graph, and this can only be done by knowing the name of the vertex, which is 'n' in this case. If one tries to add a vertex without knowing its name, the name chosen by Sage is the first integer which is not already a vertex, and the user has no way to know which one... Is there any good reason why the function g.add_vertex does not return the name of the newly created vertex ? Besides, I can read this in the manual : As it is implemented now, if a graph `G` has a large number of vertices with numeric labels, then G.add_vertex() could potentially be slow, if name is None What is meant by "slow" ? Why should looking for the smallest integer not in the graph be "slow" ? Thank you ! Nathann --~--~---------~--~----~------------~-------~--~----~ To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---