the computational cost of converting from centroids to medoids