Graph Theory37 sections · 1633 units
Open in Course

Lessons from Min Cost Connect

(Implicit vs explicit graphs)

Three lessons from this problem:

1.1. MST algorithms work on complete graphs if you generate edges on demand

2.2. Prim is better when generating all edges upfront is expensive in time or space

3.3. You can compute edge weights on the fly to save memory If you solved this, you understand how to apply MST to geometric problems. This pattern appears in many clustering and network design tasks. The on-demand edge generation is a useful technique.