Mental Model
Pick the smallest edges one by one without making loops until all points connect.
Analogy: Imagine connecting cities with roads. You want to build roads with the least total cost but still connect all cities without any circle of roads.
Graph:
(1)---2---(2)
| |
3 1
| |
(3)---4---(4)
Edges sorted by weight:
[1] (2-4), [2] (1-2), [3] (1-3), [4] (3-4)
Sets:
{1}, {2}, {3}, {4}