AlgoScope

Directed Graph

Data structurebeginnerGraph Structuresalso called digraph

Edges have a direction; in-degree and out-degree differ.

Decision · step 2 of 13Shortest Paths: Dijkstra on directed edges
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

Arrowheads on edges; a traversal only follows arrows forward.

How shortest paths works →

Cost

add edgeO(1)
out neighboursO(out-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

Taught by the same lesson

Shortest Paths covers these too, in the same run.