A weighted graph: step through how weights change the goal, see why the cheapest route isn't the fewest hops, watch Dijkstra grow a frontier, or build your own in free play.

Weighted · edges carry a cost vertex current settled cheapest path
Path cost
Step 0 / 0

Press Play. Each edge now carries a cost, so the cheapest route is not always the one with the fewest hops.

Speed
Click two vertices to toggle an edge. Click an edge to cycle its weight (1→2→3→5→9→1). Drag a vertex to move it.
vertices
0
edges
0
path cost
hops