Why can k-medoids work with arbitrary distance metrics while k-means cannot?
Last updated
k-means' mean update minimizes the objective only for squared Euclidean distance. With other metrics the mean may raise the cost, and for non-vector data a mean may not exist.
k-medoids picks centers from the data via discrete search, needing only pairwise dissimilarities. Each accepted step lowers the cost for any dissimilarity, so it converges, even on a precomputed distance matrix.
The price of this flexibility is a far more expensive search over candidate medoids.