Feature/floyd warshall clean#363
Feature/floyd warshall clean#363Abdullah-Shah-26 wants to merge 5 commits intoPradeepsingh61:mainfrom Abdullah-Shah-26:feature/floyd_warshall_clean
Conversation
💎 Code Quality Check Results❌ Missing Complexity AnalysisThese files don't include time/space complexity:
Required: Add comments explaining time and space complexity (e.g., ❌ Missing Algorithm DescriptionThese files don't explain what the algorithm does:
Required: Add a description explaining the algorithm, its purpose, and how it works
|
|
🎉 Welcome to Hacktoberfest 2025, @Abdullah-Shah-26! 🎃 Thank you for your first contribution to our DSA repository! Here's what happens next: 🔍 Automatic Checks
📋 Next Steps🎁 What You Get
💡 Tips for Success
Welcome to the community! 🚀 |
🤖 Automated PR Status🔍 Code Validation✅ Passed - File naming and structure look good! 🧪 Compilation Tests❌ Failed - Please fix compilation errors and try again. 📋 Overall Status
This comment was generated automatically. Checks will re-run when you push new commits. |
Floyd–Warshall Algorithm — All-Pairs Shortest Path
Problem: Compute shortest distances between every pair of vertices in a weighted graph (directed/undirected, supports negative edges but no negative cycles).
Approach:
Represent the graph as an adjacency matrix.
Initialize distances: 0 for self-loops, edge weight for direct edges, INF otherwise.
Triple loop over vertices: for each intermediate k, update dist[i][j] = min(dist[i][j], dist[i][k] + dist[k][j]).
Complexity:
Time: O(V³)
Space: O(V²)
Input: Number of vertices, number of edges, edge list {u, v, w}.
Output: Matrix of shortest distances between all vertex pairs.