AlgoScope

Weighted Graph

Data structurebeginnerGraph Structures

Each edge carries a cost; the setting for shortest paths and spanning trees.

Decision · step 2 of 13Shortest Paths: Dijkstra from 0
412153001234u

Unsettled vertices with a known distance: 0 at 0. The smallest is 0, so settle it: 0 is final, because every other route into 0 would pass through something at least as far and edges never shorten a path.

Open in the player →or start at step 2

What you will see

Edge labels with weights; thicker or longer edges for larger weights where helpful.

How shortest paths works →

Cost

add edgeO(1)
edge weightO(deg)
SpaceO(V + E)

How you work with it here

play it through, step one change at a time, scrub to any step, run it on your own input, try operations in any order.

Screen readers: Each element is an accessibility element with position, value and state; structural changes are announced per step.

Reduced motion: Elements appear at their destination with a crossfade; no travel longer than the element's own size.

Before this

Leads to

Topics that need this one first.

Taught by the same lesson

Shortest Paths covers these too, in the same run.