Undirected · Nonnegative weights

Two truths, one graph.

Compare a route with the fewest edges against one with the smallest total edge weight.

Solving both optimal routes…
Ready
Drag to orbit · Shift/right-drag to pan · Scroll to zoom · Click a node to move the start
Fewest hops
Breadth-first search
— hops
Path weight —
—
— Ignores weights; expands in edge-count layers.
Minimum cost
Dijkstra's algorithm
— cost
Route length —
—
— Correct for all edge weights ≥ 0.