On the implementation of a swap-based local search procedure for the p -median problem ∗

We present a new implementation of a widely used swap-based local search procedure for the p-median problem. It produces the same output as the best implementation described in the literature and has the same worst-case complexity, but, through the use of extra memory, it can be significantly faster in practice: speedups of up to three orders of magnitude were observed.