HomeOperations ResearchThe Facility Location Problem: Where to Place Resources for Maximum Coverage

📍 The Facility Location Problem: Where to Place Resources for Maximum Coverage

Explore the classic operations-research problem of choosing where to site a limited number of facilities, like EV charging stations, warehouses, or fire stations, to best serve a set of demand points, through the p-median and p-center formulations.

Operations Research3DModerate60 FPS
facility-location-problem-lab ↗ Open standalone

The simulation places a set of weighted demand points on a map and lets you open a limited number of facilities among candidate sites, visualizing in real time how the p-median total weighted distance and the p-center worst-case distance change as facilities are added, moved, or swapped.

🔬 What It Demonstrates

The simulation places a set of weighted demand points on a map and lets you open a limited number of facilities among candidate sites, visualizing in real time how the p-median total weighted distance and the p-center worst-case distance change as facilities are added, moved, or swapped.

🎮 How to Use

Set the number of facilities p with the slider, click candidate sites to open or close them, toggle between the p-median and p-center objective to see how the same demand points get served differently, and press the heuristic-solve button to watch greedy construction and swap-based local search improve the layout step by step.

💡 Did You Know?

The p-median problem was first formalized in the 1960s by operations researchers studying public facility siting, and it remains so computationally hard that even today, large real-world instances with thousands of candidate sites are typically solved with heuristics rather than exact optimization methods.

⚙ Under the hood

Watch a greedy-plus-swap heuristic relocate facilities across a plane of demand points, service regions shifting as total weighted travel cost trends downward.

facility location problemp-medianp-centeroperations researchspatial optimizationnetwork planning

3D · Three.js / WebGL renderer · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)