ICML 2025

Modiﬁed K-means Algorithm with Local Optimality Guarantees
Mingyi Li 1 Michael R. Metel 2 Akiko Takeda 1 3
Abstract
The K-means algorithm is one of the most widely
studied clustering algorithms in machine learn-
ing.
While extensive research has focused on
its ability to achieve a globally optimal solution,
there still lacks a rigorous analysis of its local op-
timality guarantees. In this paper, we ﬁrst present
conditions under which the K-means algorithm
converges to a locally optimal solution. Based on
this, we propose simple modiﬁcations to the K-
means algorithm which ensure local optimality in
both the continuous and discrete sense, with the
same computational complexity as the original
K-means algorithm. As the dissimilarity mea-
sure, we consider a general Bregman divergence,
which is an extension of the squared Euclidean
distance often used in the K-means algorithm.
Numerical experiments conﬁrm that the K-means
algorithm does not always ﬁnd a locally optimal
solution in practice, while our proposed methods
provide improved locally optimal solutions with
reduced clustering loss. Our code is available at
https://github.com/lmingyi/LO-K-means.
1. Introduction
K-means clustering is one of the most widely recog-
nized methods for partitioning datasets into homogeneous
groups. The K-means clustering problem, formulated as
a nonconvex optimization problem in (P1), is NP-hard
(Aloise et al., 2009). The K-means algorithm, also known
as Lloyd’s algorithm, was ﬁrst proposed by Lloyd (1982) as
a quantization method for pulse-code modulation and has
since been widely applied and extensively studied across
various domains, including image recognition, text mining,
deep learning model weight quantization, healthcare, mar-
1Department of Mathematical Informatics, The University of
Tokyo, Tokyo, Japan 2Huawei Noah’s Ark Lab, Montr´eal, Canada
3Center for Advanced Intelligence Project, RIKEN, Tokyo, Japan.
Correspondence to:
Michael R. Metel <michael.metel@h-
partners.com>.
...