#14056: Distance matrix
--------------------------------+-------------------------------------------
Reporter: azi | Owner: jason, ncohen, rlm
Type: enhancement | Status: needs_review
Priority: trivial | Milestone: sage-5.10
Component: graph theory | Resolution:
Keywords: | Work issues:
Report Upstream: N/A | Reviewers:
Authors: | Merged in:
Dependencies: | Stopgaps:
--------------------------------+-------------------------------------------
Changes (by ncohen):
* status: needs_info => needs_review
Comment:
Ok, nowwwwwwwww the review !
* Would be nice to add in the documentation that this method ignores edge
labels
* You can probably save some time by replacing
{{{
for i in xrange(n):
for j in xrange(i+1,n):
d = (dist[V[i]])[V[j]]
}}}
with
{{{
for i,Vi in enumerate(V.values()):
for j,dj in enumerate(Vi.values()):
d = dj
}}}
I think that you cannot trust the dictionary for returning its
elements in the same ordering on all architectures, but you probably can
trust it for always returning its elements in the same ordering on the
same machines. Especially when you have several dictionaries containing
the very same keys. Would be good to check, though. I'll ask on Sage-
devel.
* You do not have to import infinity, nor to test equality. If `d>n`
should be enough.
* Could you add a warning in the docstring saying that we do not expect
the ordering in the vertices of the matrix to correspond to anything
meaningful ? Unless we do expect it to correspond to something meaningul
that I can't guess right now ?
* Could you also add a "SEEALSO" field in this method and in
`distances_all_pairs` so that one points toward the other ?
Thinking about it again, if you replace the loop by what I just said, then
you cannot save some time by doing `ret[i,j] = ret[j,i] = d` anymore.
Hmmmm... `O_o`
Nathann
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/14056#comment:24>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.