Shortest paths for a given graph by the Floyd-Warshall algorithm
Enter the weight matrix of a directed graph. An empty cell means there is no edge,
and the diagonal is treated as 0. After calculation, select the start and end vertices:
the shortest path will be highlighted on the right with red lines.
Graph and shortest path
Enter the matrix and run the calculation.
For step-by-step mode, click "Step by step": the tool will sequentially check options
for improving distances through intermediate vertices. The distance matrix is updated after each improvement.
The Floyd-Warshall algorithm finds shortest paths between all pairs of vertices in a weighted graph. At each step it checks whether the path from i to j can be improved through an intermediate vertex k.
Comments