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 through BFS computations. #10905
Comments
This comment has been minimized.
This comment has been minimized.
comment:2
You can... see the following patch |
apply after trac_10905.patch |
comment:3
Attachment: trac10905-efficiency_improvment.patch.gz apply both trac_10905.patch and trac10905-efficiency_improvment.patch |
comment:4
It could even be around 25% faster using 'out_neighbors_unsafe'. |
comment:6
Something needs to be done about that though :
Pretty... unpleasant Nathann |
comment:7
And most probably the weight of dictionary d in which I store the result of the method. Sorry for that Nathann |
comment:8
Now that I stopped playing making it faster some remarks for the review:
otherwise sounds good |
This comment has been minimized.
This comment has been minimized.
comment:10
This patch addresses all the comments, except the by_weight stuff which is already tested in the large block of outputs :
Nathann |
comment:11
last patch missing... |
Attachment: trac_10905-doctests.patch.gz |
comment:12
I ran some last "sage -t" and forgot it last time... Sorry Nathann |
Reviewer: Yann Laigle-Chapuy |
comment:13
Sounds good to me now. Positive review. |
This comment has been minimized.
This comment has been minimized.
comment:15
attachment: trac_10905.patch needs a proper commit message (use |
comment:16
Done ! Nathann |
Attachment: trac_10905.patch.gz |
Merged: sage-4.7.alpha5 |
I do not think I can make them faster than that... Perhaps multithreading ? :-p
And for larger values ...
Method
distance_all_pairs
Even improved, it still does not beat Floyd Warshall for small graphs... So for the moment, I made the
distance_all_pairs
method use BFS for graphs on more than 20 vertices and Floyd Warshall otherwise. Tell me if you think it sound.Perhaps the reason is that this new method still computes both paths and distances while it is not required for distance_all_pairs...
Nathann
Depends on :
Apply :
CC: @sagetrac-ylchapuy @sagetrac-mvngu @jasongrout @rlmill
Component: graph theory
Author: Nathann Cohen
Reviewer: Yann Laigle-Chapuy
Merged: sage-4.7.alpha5
Issue created by migration from https://trac.sagemath.org/ticket/10905
The text was updated successfully, but these errors were encountered: