Skip to content

Implementing Johnson's Algorithm #608

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

Merged
merged 4 commits into from
Mar 10, 2025
Merged

Conversation

prex03
Copy link
Contributor

@prex03 prex03 commented Mar 8, 2025

Implementing Johnson's Algorithm for the All Pair Shortest Paths Problem

Johnson's Algorithm [https://en.wikipedia.org/wiki/Johnson's_algorithm] is more efficient for the All Pair Shortest Path Problem as compared to the currently implemented Floyd-Warshall Algorithm.

Changes in this PR -

  1. Implementation of Johnson's Algorithm for Adjacency List Graphs.
  2. Adds test for Johnson's Algorithm.
  3. Fixes the existing tests for Floyd-Warshall Algorithm.
  4. Fixes the implementation of Dijkstra to work for graphs having 0 edge weights.

@czgdp1807 czgdp1807 enabled auto-merge (squash) March 10, 2025 05:06
@czgdp1807 czgdp1807 merged commit f4c1677 into codezonediitj:main Mar 10, 2025
7 checks passed
@prex03 prex03 deleted the johnson branch March 12, 2025 10:32
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.

2 participants