On Dec 31, 12:21 pm, Nathann Cohen <nathann.co...@gmail.com> wrote: > 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.
OK, thanks for the advice. I'll put a link here if I get around to writing a patch. > 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 Well, I "need" it for Tuesday. ;-) But not desperately. Would the backends for graphs easily/efficiently support something like G.index(u) to get the integer behind a vertex u quickly and easily? It seems this would be useful for all the places where the code assumes vertices are integers (or at least ordered). Thanks, Rob -- 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