Graphs 0/61

Union-find (DSU): merging disjoint sets · 2 of 2

Minimum spanning trees

Connect every vertex for the lowest total weight with Kruskal’s algorithm and union-find, see why each lightest edge is safe to take, and use Prim’s algorithm when the graph is dense.

2,370 words · 11 min read