Why can k-medoids work with arbitrary distance metrics while k-means cannot?

Last updated 11 November 2026

  • 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.

  • https://en.wikipedia.org/wiki/K-medoids
  • https://medium.com/@avantika10roy/understanding-k-medoids-a-robust-alternative-to-k-means-c6f8b98caf3c
  • https://jq0112358.medium.com/customer-personality-analysis-ii-cluster-analysis-and-customer-ranking-bdad75000b33
All Clustering interview questions