p-median location

Solves the p-median problem: picks p facilities minimising the weighted sum of distances for weighted demand points.