Depot Placement on a Map: p-Median Service Areas and Heuristic Steps (2D)
The same p-median problem as a top-down map with service areas coloured by the nearest depot, flow lines from every town, and the objective after each greedy or swap step against the exact optimum.
Choose where to open p depots so that the total demand-weighted distance to the towns is smallest. Watch a greedy construction followed by Teitz-Bart swaps, compare it with the exact optimum found by enumerating every subset, and see how the total falls as you open more depots. Change the town layout, the distance rule (straight line or street grid), the demand variation and p. The Blender-built town and depots come with numerical checks: brute-force optimality, local-optimum test, a binomial count and the Weiszfeld continuous median as a lower bound.
The same p-median problem as a top-down map with service areas coloured by the nearest depot, flow lines from every town, and the objective after each greedy or swap step against the exact optimum.
2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install