nisbweb / Code-Alchemy

Repository for Hacktoberfest 2024
2 stars 33 forks source link

Add Floyd-Warshall Algorithm Implementation in C++ #61

Closed s-a-n-19 closed 1 month ago

s-a-n-19 commented 1 month ago

Overview: The Floyd-Warshall algorithm is a classic graph algorithm used to find the shortest paths between all pairs of vertices in a weighted graph. It is particularly useful for dense graphs where Dijkstra’s algorithm might not be efficient.

Task: Add the Floyd-Warshall algorithm implementation in C++ under the appropriate directory for graph algorithms.

Requirements: The code should efficiently handle graphs with positive or negative edge weights (but no negative cycles). Include meaningful comments explaining the logic and each step. Provide a sample graph as input and print the shortest distance matrix as output. Expected Time Complexity: O(V³), where V is the number of vertices in the graph.

s-a-n-19 commented 1 month ago

i would like to work upon this issue..so can you please assign me this issue along with the hacktoberfest-accepted label?

Haripriya-1212 commented 1 month ago

Hi! Yeah Sure! you can work on this. Add your code file in DSA folder and make a pull request. Will review and merge.