Blog60.5K views1,889 votes0 replies4,754 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.