Analyze node pairs with matrix-based path calculations. Compare direct routes, improved routes, distances, and reachability. Save clean outputs for review, sharing, documentation, and verification.
This sample shows a four-node weighted graph. Use it to test the calculator quickly.
| From \ To | A | B | C | D |
|---|---|---|---|---|
| A | 0 | 3 | INF | 7 |
| B | 8 | 0 | 2 | INF |
| C | 5 | INF | 0 | 1 |
| D | 2 | INF | INF | 0 |
An all-pairs paths calculator finds the best route between every ordered pair of nodes in a weighted graph. In practical physics work, this idea supports path analysis across state transitions, lattice steps, transport links, detector channels, optical routing, and other structured systems.
This page accepts a weighted adjacency matrix. Each row and column represents a node. A number means a direct connection exists. An infinity token means there is no direct edge between those two positions. After submission, the page computes the shortest distance matrix and a pair-by-pair route summary.
The output is useful when direct paths are not always optimal. A route from one node to another may become shorter after passing through one or more intermediate nodes. The calculator checks every possible intermediate node combination and updates the current best distance whenever an improvement appears.
The page also provides a next-hop matrix, which is helpful for route reconstruction. This matrix tells you the first move to make when traveling from a chosen start node to a chosen destination. The pair summary table then presents the final path string and hop count for every ordered pair.
The heatmap offers a fast visual review. Lower values represent shorter paths, while blank entries indicate unreachable pairs. You can export the pair summary as CSV for spreadsheet work and save a PDF when you need a portable report.
The calculator uses the Floyd-Warshall recurrence.
Base value: d(i,j) = direct edge weight from i to j
Update rule: d(i,j) = min(d(i,j), d(i,k) + d(k,j))
Here, d(i,j) is the best known distance from node i to node j. The index k is an allowed intermediate node. The algorithm tests whether passing through k improves the current distance.
If a diagonal result becomes negative, a negative cycle exists. In that case, route reconstruction becomes unreliable.
It means finding the best path between every ordered pair of nodes in one graph. The result includes distances for all start and end combinations.
It uses the Floyd-Warshall algorithm. This method updates distances by checking whether each node improves routes between every other pair.
Yes. You can enter INF or any tokens you define in the infinity token field. Those entries are treated as unreachable direct edges.
It shows the first node to visit on the shortest path from one node to another. It helps rebuild full routes after distance optimization.
Yes. Choose the undirected option, and the page will normalize opposite edge directions into one symmetric weighted matrix before solving.
The page warns you when a negative cycle is detected. Distances may become unreliable for route reconstruction in that situation.
Blank heatmap cells indicate unreachable pairs. They mean no valid path exists from the selected source node to the selected destination node.
You can export the pair summary as CSV and PDF. This is useful for validation, reporting, documentation, or later analysis.
Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.