arXiv:2607.25190stat.MLJul 2026

Manuscript Offprint

arXiv:2607.25190

Lloyd's KK-Means Clustering Algorithm Is Frank-Wolfe in Disguise

Michael Pokojovy, J. Marcus Jobe, Simon Lacoste-Julien

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Lloyd’s KK-Means Clustering Algorithm Is Frank-Wolfe in Disguise

Michael Pokojovy J. Marcus Jobe Simon Lacoste-Julien

Department of Mathematics & Statistics and School of Data Science Old Dominion University Norfolk, VA 23529, USA mpokojovy@odu.edu Information Systems & Analytics Department Miami University Oxford, OH 45056, USA jobejm@miamioh.edu Canada CIFAR AI Chair Department of Computer Science and Operations Research & Mila Université de Montréal Montréal (QC) Canada

Abstract

Lloyd’s KK-means algorithm, also known as naïve KK-means, is a widely used ad hoc optimization heuristic, designed to minimize the sum of squared errors (SSE) across all KK-partitions of a dataset via iterative cluster refinement. In this work, we establish a novel connection between Lloyd’s algorithm and the Frank-Wolfe (FW) algorithm, a prominent first-order method for projection-free optimization. We demonstrate that Lloyd’s algorithm is a special case of FW. Leveraging recent advances in FW methods for concave objectives, we derive a non-asymptotic O(1/t)\mathcal{O}(1/t) convergence rate to a local minimum of the SSE objective. To account for empty clusters, an outcome possible under Lloyd’s greedy assignment, we develop an FW variant for semismooth objectives while retaining the same convergence rate that is solely controlled by the initial SSE value. We illustrate our findings with a simulation study for spherical Gaussian mixtures and a real-world image segmentation dataset.

1 INTRODUCTION

Cluster analysis is a branch of unsupervised machine learning focused on partitioning unlabeled data into meaningful groups, or clusters, based on similarity or other relevant criteria. KK-means clustering is one of the most popular and widely used clustering approaches. While KK-means clustering is an NP-hard optimization problem (Arthur and Vassilvitskii, 2006), a variety of heuristic solution approaches, most notably Lloyd’s algorithm (Lloyd, 1982), exist. While initialization and acceleration strategies can be quite nuanced and vary from algorithm to algorithm (Hamerly, 2010), the shared core of most implementations is the iterative reassignment strategy of Lloyd (1982). Regarded as one of the Top 10 algorithms in data mining (Wu et al., 2008), “the” KK-means algorithm has been extensively studied in the literature and is nearly ubiquitous across various application fields. See Blömer et al. (2016); Ikotun et al. (2023); Steinley (2006) for thorough review and synthesis of notable results.

As a multi-faceted topic, KK-means clustering has attracted significant attention from diverse communities including machine learning, data mining, computer science, statistics, optimization, etc. In this work, we are specifically interested in optimization aspects. A remarkable property of the minimization problem underlying KK-means clustering is that it can be equivalently formulated using the language of combinatorial programming, mixed integer nonlinear programming, expectation maximization (EM), smooth and nonsmooth optimization, matrix factorization, etc. (Bagirov and Mohebi, 2015; Bauckhage, 2016; Bottou and Bengio, 1995). These paradigms offer unique insights into the nature of the problem and provide instruments of theoretical and practical importance. Continuing this promising pursuit, the present paper reveals another notable connection: Lloyd’s KK-means algorithm is a special case of Frank-Wolfe (FW) algorithm. In addition to mathematical elegance, this fact offers a unique opportunity to leverage the techniques of projection-free concave optimization in studying the convergence of Lloyd’s KK-means algorithm. This strategy has recently been successfully applied to analyzing Gaussian trimmed likelihood estimation (Pokojovy and Jobe, 2022) and the convex-concave procedure (Yurtsever and Sra, 2022) through the lens of FW algorithm.

Motivated by the semismooth concave nature of the KK-means objective, we leveraged, adapted and improved some recent advancements in the field (Khamaru and Wainwright, 2019; Yurtsever and Sra, 2022) to address the challenges posed by Lloyd’s KK-means algorithm. The latter are specifically caused by empty clusters oftentimes resulting from Lloyd’s greedy allocation that necessitates semismooth extension of otherwise smooth objective to an appropriate convex set.