Minimum spanning trees
Kruskal's algorithm takes the edges from lightest to heaviest and keeps each one that joins two pieces not yet connected, which builds the cheapest set of edges connecting every vertex, because the lightest edge across any split is always safe.