-
-
Notifications
You must be signed in to change notification settings - Fork 342
Add Floyd–Warshall All-Pairs Shortest Path Algorithm Implementation in R #203
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
Add Floyd–Warshall All-Pairs Shortest Path Algorithm Implementation in R #203
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds a new R6-based implementation of the Floyd–Warshall all-pairs shortest paths algorithm, including utilities for path reconstruction, negative-cycle detection, and demonstration examples.
- Implements core O(V^3) Floyd–Warshall with distance and predecessor matrices
- Provides path reconstruction and negative cycle detection APIs
- Includes a demonstration function with multiple example graphs
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 4 comments.
This PR introduces a complete and well-documented implementation of the Floyd–Warshall algorithm in R using an R6 class structure.
Overview
The
FloydWarshallclass computes shortest paths between all pairs of vertices in a weighted directed graph.It supports positive and negative edge weights, detects negative cycles, and allows full path reconstruction.
Features
Complexity
Demonstration
Run
demonstrate_floyd_warshall()to execute sample graphs and visualize results.This implementation enhances the R graph algorithms module with a core dynamic programming algorithm widely used in routing, optimization, and network analysis.