Skip to content
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

Time complexity of Johnson's algorithm wrongly stated in documentation #401

Open
graidl opened this issue Sep 26, 2024 · 1 comment
Open
Labels
documentation Improvements or additions to documentation

Comments

@graidl
Copy link

graidl commented Sep 26, 2024

Description of bug
Describe the bug clearly and concisely.

The documentation to Johnson's all-pairs shortest path algorithm is stated as O(|V||E|). This cannot be true, in particular if Dijkstra's algorithm is finally called for weighted graphs. If Dijkstra's algorithm uses a Fibonacci heap (I didn't look if this is the case here), the runtime is O(|V|^2 log |V|+|V|⋅|E|), which is a big difference for sparse graphs.
Only in case of an unweighted graph, one can achieve time O(|V|
|E|) by calling breadth first search from each node.

@graidl graidl added the bug Something isn't working label Sep 26, 2024
@gdalle gdalle added documentation Improvements or additions to documentation and removed bug Something isn't working labels Sep 28, 2024
@gdalle gdalle changed the title [BUG] Time complexity of Johnson's algorithm wrongly stated in documentation Time complexity of Johnson's algorithm wrongly stated in documentation Sep 28, 2024
@gdalle
Copy link
Member

gdalle commented Oct 7, 2024

Hi, thanks for pointing this out! Do you want to submit a docs PR fixing it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants