Edge List
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
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.
What you will see
The same graph shown as picture and as a sortable table of edges.
Cost
| edge lookup | O(E) |
|---|---|
| add edge | O(1) |
| sort edges | O(E log E) |
| Space | O(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.