Helloooooooo !! > Aside from totally rewriting the routine to be faster, would the > following make sense for a fix? > > (a) Have i come from the complete list of vertices rather than the > vertex iterator. > > (b) Compare the indices of i and u in the complete list. > > Yes, it would be slower. But it might also be correct. ;-) I do not > see an efficient way to impose/exploit an arbitrary ordering on the > vertices, short of stuffing them all in a list.
Well, yep I guess. The first loop iterates on all vertices, so for this one a "for i_id, i in enumerate(self.vertex_iterator())" would be in order. And to obtain the id corresponding to v, I guess the best is to build a dictionnary associating each vertex to its index at the beginning of the algorithm. If you need it to be fixed quickly, that's probably the best option ! But it hurts the eyes, because all the Graph methods spend a lot of time converting the ID to the Sage labels already, which is crazy if we try to convert them back as soon as we get them :-D 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