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

feat: add johnson algorithm for all pairs shortest paths #145

Merged
merged 4 commits into from
Jul 13, 2023

Conversation

caojoshua
Copy link
Contributor

No description provided.

Copy link
Contributor

@appgurueu appgurueu left a comment

Choose a reason for hiding this comment

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

Why are there Floyd-Warshall related changes in the Johnson PR now?

@caojoshua
Copy link
Contributor Author

Why are there Floyd-Warshall related changes in the Johnson PR now?

Oops. Must be wrong git commands. Ill fix it when i get the chance.

@caojoshua
Copy link
Contributor Author

PR now only contains johnson related code

Copy link
Contributor

@appgurueu appgurueu left a comment

Choose a reason for hiding this comment

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

At this point, you could start crosstesting shortest path algorithms: Simply generate random graphs (with positive weights) and check that a Bellman-Ford, Floyd-Warshall, Dijkstra, and Johnson's algorithm yield the same results. When testing negative weights, you can't test against Dijkstra alone, but you'll still have 3 algos to crosstest.

@raklaptudirm raklaptudirm merged commit e8a850c into TheAlgorithms:master Jul 13, 2023
2 checks passed
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.

4 participants