Floyd–Warshall · Interactive Visualizer
PathNova
Build a weighted directed graph, then watch the algorithm relax every pair through every intermediate vertex — step by step.
Enter edge weights below. Leave a cell empty (or type inf) for no edge. Diagonal is always 0.
| 0 | 1 | 2 | 3 | 4 | |
|---|---|---|---|---|---|
| 0 | |||||
| 1 | |||||
| 2 | |||||
| 3 | |||||
| 4 |
Step 0 / 125
Graph (live)
Original weighted directed graph
Distance Matrix
| 0 | 1 | 2 | 3 | 4 | |
|---|---|---|---|---|---|
| 0 | 0 | 4 | 7 | 9 | 8 |
| 1 | ∞ | 0 | 3 | 5 | 10 |
| 2 | ∞ | ∞ | 0 | 2 | 7 |
| 3 | ∞ | ∞ | 12 | 0 | 5 |
| 4 | ∞ | ∞ | 7 | 9 | 0 |