11.21 Implementation Patterns
11.21 Implementation Patterns Problem After studying cut properties, union-find, Kruskal, Prim, Borůvka, clustering, network design, and complexity analysis, a practical question remains: How should MST algorithms actually be implemented? Many algorithm failures are not caused by incorrect theory. They are caused by small implementation mistakes: incorrect edge sorting bad union-find duplicate edge handling disconnected graph assumptions overflow bugs This section collects implementation patterns that appear repeatedly in production-quality MST code....