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

Floyd-Warshall #377

Merged
merged 5 commits into from
May 8, 2021
Merged

Floyd-Warshall #377

merged 5 commits into from
May 8, 2021

Conversation

maminrayej
Copy link
Contributor

Implements floyd_warshall algorithm

@iwahbe iwahbe mentioned this pull request Dec 7, 2020
@XVilka XVilka added this to the 0.6 milestone Jan 13, 2021
src/floyd_warshall.rs Outdated Show resolved Hide resolved
src/algo/mod.rs Outdated Show resolved Hide resolved
@maminrayej
Copy link
Contributor Author

I don't know why rustfmt check is failing.

@fanninpm
Copy link

(Coming from the Reddit post about prepona.) I tried running rustfmt on your branch, and I ran into the same problem you did. I'm wondering if a blank commit (e.g. git commit --allow-empty -m "Re-run CI") or a rebase/force-push will rectify the issue.

@ABorgna
Copy link
Member

ABorgna commented Apr 28, 2021

Hi! The rustfmt errors in master where fixed in 56feb0b. They should be fixed if you rebase.

@maminrayej
Copy link
Contributor Author

Hi! I'll do it today. Thanks for your help.

maminrayej and others added 2 commits April 29, 2021 06:06
put BoundedMeasure trait alongside Measure trait

implement BoundedMeasure trait for all numerical types.

add unit test for floyd_warshall algorithm

move floyd warshall tests into tests/floyd_wrashall.rs

replace panic with Result return type

handle overflow and underflow more elegantly

add quickcheck for floyd_warshall algorithm

add documentation for floyd_warshall algorithm

add link to wikipedia for floyd_warshall algorithm

use std types instead of primitives

update test and doc

update tests again!

Update src/floyd_warshall.rs

Co-authored-by: Lukas Abfalterer <labfalterer@gmail.com>

Update src/algo/mod.rs

Co-authored-by: Lukas Abfalterer <labfalterer@gmail.com>

apply cargo fmt
Copy link
Member

@ABorgna ABorgna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks nice, thanks!

It's a pity that it cannot be used with StableGraph (due to the compactness trait), but changing the index iteration to iterating over node indices would probably kill the efficiency.

Do you thing you could add a benchmark for this?
This can be merged as-is either way :)

@maminrayej
Copy link
Contributor Author

Sure. I'll add it till the end of this week.
I'm glad to hear it. :)

@ABorgna ABorgna merged commit cf7cd6f into petgraph:master May 8, 2021
teuron pushed a commit to teuron/petgraph that referenced this pull request Oct 9, 2022
* implement floyd_warshall algorithm and expose it via algo module

put BoundedMeasure trait alongside Measure trait

implement BoundedMeasure trait for all numerical types.

add unit test for floyd_warshall algorithm

move floyd warshall tests into tests/floyd_wrashall.rs

replace panic with Result return type

handle overflow and underflow more elegantly

add quickcheck for floyd_warshall algorithm

add documentation for floyd_warshall algorithm

add link to wikipedia for floyd_warshall algorithm

use std types instead of primitives

update test and doc

update tests again!

Update src/floyd_warshall.rs

Co-authored-by: Lukas Abfalterer <labfalterer@gmail.com>

Update src/algo/mod.rs

Co-authored-by: Lukas Abfalterer <labfalterer@gmail.com>

apply cargo fmt

* add benchmark for floyd warshall algorithm

* apply cargo fmt
teuron pushed a commit to teuron/petgraph that referenced this pull request Oct 9, 2022
* implement floyd_warshall algorithm and expose it via algo module

put BoundedMeasure trait alongside Measure trait

implement BoundedMeasure trait for all numerical types.

add unit test for floyd_warshall algorithm

move floyd warshall tests into tests/floyd_wrashall.rs

replace panic with Result return type

handle overflow and underflow more elegantly

add quickcheck for floyd_warshall algorithm

add documentation for floyd_warshall algorithm

add link to wikipedia for floyd_warshall algorithm

use std types instead of primitives

update test and doc

update tests again!

Update src/floyd_warshall.rs

Co-authored-by: Lukas Abfalterer <labfalterer@gmail.com>

Update src/algo/mod.rs

Co-authored-by: Lukas Abfalterer <labfalterer@gmail.com>

apply cargo fmt

* add benchmark for floyd warshall algorithm

* apply cargo fmt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants