The document contains a Java implementation of the Floyd-Warshall algorithm, which calculates the shortest paths between all pairs of vertices in a weighted graph. It initializes a distance matrix with given values, applies the algorithm to update the distances, and then prints the final distance matrix. The code uses a large number to represent infinity for unreachable paths.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
9 views1 page
Floyd Wars Halal Go Using Matrix
The document contains a Java implementation of the Floyd-Warshall algorithm, which calculates the shortest paths between all pairs of vertices in a weighted graph. It initializes a distance matrix with given values, applies the algorithm to update the distances, and then prints the final distance matrix. The code uses a large number to represent infinity for unreachable paths.