id,summary,reporter,owner,description,type,status,priority,milestone,component,resolution,keywords,cc,merged,author,reviewer,upstream,work_issues,branch,commit,dependencies,stopgaps
27027,graph relabel() assumes sortable vertices,jdemeyer,,"There are several cases in `relabel()` which assume sorting of vertices.
The following cases are fixed:
1. `perm=None`. This should just relabel with integers from 0 to N-1 in an arbitrary order (as the documentation already says).
2. `perm` is a callable. This is easy to avoid, as the ordering of the vertices is not used in the code:
{{{
elif callable(perm):
perm = dict( [ i, perm(i) ] for i in self.vertices() )
complete_partial_function = False
}}}
This broke several functions which did assume a particular ordering for `G.relabel(perm=None)`. Those are fixed by using `G.relabel(perm=range(G.order()))` instead.
Furthermore, we allow arbitrary iterables to be given for relabeling instead of only `list` and `tuple`. This improves things with Python 3 where `range()` becomes an iterator.",defect,closed,major,sage-8.7,graph theory,fixed,"py3, graph",dcoudert,,Jeroen Demeyer,David Coudert,N/A,,a7eaec9a42dbdc6839fca59d2f42c8e1f07e6c07,a7eaec9a42dbdc6839fca59d2f42c8e1f07e6c07,,