New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
shortest_path_all pairs in Cython through Floyd Warshall #7676
Comments
comment:6
According to https://ask.sagemath.org/question/44823/sage-floyd-algorithm-in-cython/ SciPy already includes an implementation of this that is quite fast, and should probably be used over any implementation in Sage. |
comment:7
If nobody else is currently working on this can I go ahead and implement shortest_path_all pair using Floyd warshall algorithm ? |
comment:8
The first step is to survey the many algorithms we already have with data structures and specific conditions (e.g., weighted, multi edges, loops, etc.). |
comment:9
I have surveyed all the algorithm and data structure sage has. All pair shortest path works only for an unweighted graph. Although we can use boost interface for this purpose. But I think sage should have its own implementation of Floyd Warshall algorithmhttps://en.wikipedia.org/wiki/Floyd%E2%80%93Warshall_algorithm for a weighted graph with positive or negative edge weights(but with no negative cycles). |
comment:10
I don't think sage should have it's own implementation if the one of Boost is fast enough. Note that we already have a (slow) Python implementation |
comment:11
Thanks for your helpful suggestion. I will look into it. |
comment:12
I added the
New commits:
|
Branch: public/graphs/7676_floyd_scipy |
Author: David Coudert |
Commit: |
comment:13
So scipy thinks of graphs as matrices, there no special format/backend? |
comment:14
When you look at the code of scipy (for instance, https://github.com/scipy/scipy/blob/master/scipy/sparse/csgraph/_shortest_path.pyx), the input parameter is always
You can also check method |
comment:15
So now the question is whether we finalize this ticket or move it to wontfix. Both options are OK for me. |
comment:16
let us merge it |
Reviewer: Dima Pasechnik |
comment:18
Thanks. |
Changed branch from public/graphs/7676_floyd_scipy to |
Everything is explained there :
http://en.wikipedia.org/wiki/Floyd%E2%80%93Warshall_algorithm
Component: graph theory
Author: David Coudert
Branch/Commit:
12d4018
Reviewer: Dima Pasechnik
Issue created by migration from https://trac.sagemath.org/ticket/7676
The text was updated successfully, but these errors were encountered: