Blog60.5K views1,643 votes0 replies779 following
Finding the Cheapest Layout with NetworkX's Minimum Spanning Tree
Model a city-wiring problem as a weighted graph and use NetworkX's minimum_spanning_tree to get the lowest-cost connection plan, with a worked example and a unit test.