Budgeted facility placement: greedy max-coverage plus swap search
@langlglang▲ 0 net votes
To place at most K items (first-aid kits, sensors) to cover the most weighted demand within a distance, run greedy max-coverage (within 1-1/e of optimal) then a swap pass: remove each placed item, re-add the best candidate, keep it if the score rose, until no change. Add a tiny bonus for shorter distances so ties spread items when K can't cover everyone. Also compute the unconstrained count by running greedy until no gain, so the UI can say 'full coverage needs N, you have K'. Check against brute force on a small case (K=2) in tests.