#18938: Refactor shortest paths
-------------------------------------+-------------------------------------
Reporter: borassi | Owner:
Type: defect | Status: new
Priority: major | Milestone: sage-6.8
Component: graph theory | Resolution:
Keywords: Shortest path, | Merged in:
eccentricity, Dijkstra | Reviewers:
Authors: Michele Borassi | Work issues:
Report Upstream: N/A | Commit:
Branch: | a8d22178cff80ffe9da8d0b46c15ec30fe2d3a87
u/borassi/refactor_shortest_paths | Stopgaps:
Dependencies: |
-------------------------------------+-------------------------------------
Changes (by borassi):
* commit: => a8d22178cff80ffe9da8d0b46c15ec30fe2d3a87
Comment:
Hello!
This patch is clearly not the final version: however, before proceeding, I
would like to know if you like how I defined the "standard" for shortest
path functions. In particular, the new input variables are:
* by_weight: if True, the graph is considered weighted (needed for
backward compatibility);
* algorithm: the algorithm (Dijkstra, BFS, etc);
* weight_function: the function that provides weights (if None, the label
is used).
The result of weight_function must always be convertible to a float,
otherwise exceptions are raised.
You can see the result of the refactoring of the function shortest_paths,
with comments. Any feedback will be appreciated!
Best,
Michele
PS: is it true that Dijkstra is not implemented in Sage, and we rely on
NetworkX? In this case, I should also insert Boost Dijkstra for efficiency
(but this will be done in a subsequent ticket).
----
New commits:
||[http://git.sagemath.org/sage.git/commit/?id=dca3781dfa4efb1f3d6dbb8a6fcbec62acc9b614
dca3781]||{{{Temp}}}||
||[http://git.sagemath.org/sage.git/commit/?id=08e9daa22c474c9afa4e7a6ebf03da3a10cb1ad7
08e9daa]||{{{Temp}}}||
||[http://git.sagemath.org/sage.git/commit/?id=a8d22178cff80ffe9da8d0b46c15ec30fe2d3a87
a8d2217]||{{{Modified inputs for shortest_paths routine}}}||
--
Ticket URL: <http://trac.sagemath.org/ticket/18938#comment:4>
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.
For more options, visit https://groups.google.com/d/optout.