Measure shortest paths across graphs with node inputs. Inspect weighted routes, centers, diameters, and radii. Turn raw connections into clear distance insights for decisions.
| Edge | Weight | Meaning |
|---|---|---|
| A - B | 4 | Distance between A and B equals 4 units. |
| A - C | 2 | Node A connects to C with low cost. |
| C - D | 1 | C to D is the cheapest intermediate step. |
| D - E | 3 | Final leg from D to E adds 3 units. |
In graph theory, the distance between two vertices is the minimum total edge cost across all valid paths connecting them.
d(u, v) = min Σ w(e)
For unweighted graphs, each edge has cost 1, so the distance becomes the minimum number of edges:
d(u, v) = min number of edges in a path from u to v
The calculator applies Dijkstra-style relaxation for nonnegative weighted edges. It also builds an all-pairs distance matrix, eccentricity values, graph radius, and graph diameter.
Graph distance converts a collection of nodes and edges into measurable separation. In routing, each value represents either travel cost, transfer count, latency, or dependency depth. A shortest path gives the minimum feasible total among all candidate routes. Raw connectivity alone does not show which sequence is efficient.
Unweighted graphs treat every edge as one unit, so the answer is the fewest hops. Weighted graphs assign a cost to each edge, and the answer becomes the smallest total weight. The distinction matters in transport, communication, and process mapping because two-hop routes may still be more expensive than longer low-cost alternatives.
The main result contains the shortest distance, the hop count, and the actual node sequence. Together, these measures support planning decisions. Distance measures resource burden, hops indicate structural complexity, and the route itself shows the exact chain of movement. Professionals compare these outputs when testing redundancy and bottlenecks.
The all-pairs matrix extends one route calculation to every source-target combination. This reveals which nodes are central and which are remote. Eccentricity records the farthest reachable node from a given vertex. Radius is the smallest eccentricity, while diameter is the largest finite separation observed anywhere in the graph. In operational studies, these measures help rank access quality across the full network.
Dense graphs often produce multiple competitive routes and smaller diameters. Sparse graphs usually show larger eccentricity and more isolated zones. If disconnected pairs appear, the matrix includes infinite values, signaling that some destinations cannot be reached. That finding is often as important as the shortest path itself during design reviews. Repeated tests with updated weights also reveal how sensitive route quality is to changing conditions.
A plotted network helps analysts verify whether the computed path matches graph structure. When the highlighted route passes through high-value connector nodes, it may indicate dependence on a few critical links. Combining visual structure with matrix data, radius, and diameter creates a stronger professional assessment of accessibility, reach, and overall network efficiency. It also improves communication because technical and nontechnical stakeholders can review the same result without reading a full adjacency table first.
Graph distance is the minimum cost or minimum hop count needed to travel from one node to another through valid edges.
Use weighted mode when edges represent different costs such as time, length, price, latency, or resistance instead of equal steps.
A route with more edges can still have a lower total weight if each edge is inexpensive compared with a shorter but costlier alternative.
It means no valid path exists between those two nodes under the current graph structure and direction settings.
Radius helps identify central nodes, while diameter shows the widest finite separation in the graph and summarizes overall spread.
No. The current method assumes nonnegative edge weights, so negative values are rejected to keep shortest-path results valid.
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.