AlgoScope

Edge List

Data structurebeginnerGraph Representations

A flat list of (u, v, weight) triples, the natural input for Kruskal, which sorts it by weight.

Decision · step 2 of 9Minimum Spanning Tree: Kruskal, cheapest edges first
43124265001222334455

Edge 1-2, weight 1. 1 is in component 1 and 2 in component 2, different, so take it: they merge and the total is 1.

Open in the player →or start at step 2

What you will see

The same graph shown as picture and as a sortable table of edges.

How minimum spanning tree works →

Cost

edge lookupO(E)
add edgeO(1)
sort edgesO(E log E)
SpaceO(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

Related

Taught by the same lesson

Minimum Spanning Tree covers these too, in the same run.