EKM: An Exact, Polynomial-Time Divide-and-Conquer Algorithm for the K-Medoids Problem
Abstract
The $K$-medoids problem is a challenging combinatorial clustering task, widely used in data analysis applications. While numerous algorithms have been proposed to solve this problem, none of these are able to obtain an exact (globally optimal) solution for the problem in polynomial time. In this paper, we present EKM: a novel algorithm for solving this problem exactly with worst-case $O\left(N^{K+1}\right)$ time complexity. The algorithm is provably correct by construction, obtained using formal program derivation steps. We demonstrate the effectiveness of our algorithm by comparing it against various approximate methods and a state-of-the-art, exact branch-and-bound (BnB) algorithm on numerous real-world datasets. Our algorithm can not only provide provably exact solutions but also consume much less time over all datasets compared with the BnB algorithm. We also show that the wall-clock time of our algorithm aligns with its worst-case time complexity analysis on synthetic datasets. In contrast, a state-of-the-art BnB algorithm not only exhibits exponential time complexity even for fixed $K$ but also frequently produces erroneous solutions. This highlights the importance of employing formal, correct derivation steps when constructing exact algorithms.
BibTeX
@misc{he2025ekm,
author = {Xi He and Max A Little},
title = {{EKM: An Exact, Polynomial-Time Divide-and-Conquer Algorithm for the K-Medoids Problem}},
year = {2025},
url = {https://openreview.net/forum?id=FgttKcRbQO},
howpublished = {OpenReview},
note = {Submitted to ICML 2025},
}Ask Althea to put this paper to the test.