cs.DSJul 15, 2024

Faster and Simpler Greedy Algorithm for k-Median and k-Means

Authors: Max Dupré la TourDavid Saulpic

Abstract

Clustering problems such as kk-means and kk-median are staples of unsupervised learning, and many algorithmic techniques have been developed to tackle their numerous aspects. In this paper, we focus on the class of greedy approximation algorithm, that attracted less attention than local-search or primal-dual counterparts. In particular, we study the recursive greedy algorithm developed by Mettu and Plaxton [SIAM J. Comp 2003]. We provide a simplification of the algorithm, allowing for faster implementation, in graph metrics or in Euclidean space, where our algorithm matches or improves the state-of-the-art.

Explore similar work

Sep 7, 2026cs.CG

A Sub-4 Approximation for Fair k-Means

Fairness in clustering has attracted sustained research interest, motivated by the need to ensure equitable representation of protected groups in machine learning applications. We study fair kk-means clustering in Euclidean space, where the proportion of each protected group in every cluster must lie within specified lower and upper bounds. These constraints make it challenging to determine both cluster centers and point assignments. We propose an approximation algorithm that combines a linear programming relaxation with geometric transformations of the input to construct candidate center sets. Given a ρρ-approximate algorithm for weighted kk-means and any ε>0ε>0, our algorithm returns a fractional solution whose cost is at most 1+(31/Γ)ρ+O(ε)1+(3-1/Γ)ρ+O(ε) times the optimal integral fair cost, where Γ6.357Γ\approx6.357 is an upper bound on the integrality gap of the standard Euclidean kk-means LP. With a PTAS as the subroutine, the approximation ratio becomes 3.8427+O(ε)3.8427+O(ε), improving the previous factor of 5+O(ε)5+O(ε) to below 44. The solution satisfies all fairness constraints exactly and can be rounded to an integral assignment with a bounded additive violation of fairness and no increase in cost. The same approximation guarantee extends to the kk-sparse Wasserstein barycenter problem.
Kangke Cheng, Guanlin Mo, Shihong Song +1
Apr 23, 2026cs.LG

An effective variant of the Hartigan k-means algorithm

The k-means problem is perhaps the classical clustering problem and often synonymous with Lloyd's algorithm (1957). It has become clear that Hartigan's algorithm (1975) gives better results in almost all cases, Telgarsky-Vattani note a typical improvement of 5%5\% -- 10%10\%. We point out that a very minor variation of Hartigan's method leads to another 2%2\% -- 5%5\% improvement; the improvement tends to become larger when either dimension or kk increase.
François Clément, Stefan Steinerberger
Jul 28, 2026cs.DS

Randomizing the Number of Centers in k-means++

The kk-means++ algorithm is a standard and widely used seeding method for kk-means clustering, but for a fixed number kk of centers its worst-case expected approximation ratio is Θ(logk)Θ(\log k). We consider the same algorithm when an adversary first fixes the dataset and some KK; the number of centers kk is then chosen uniformly from {K,,2K1}\{K,\ldots,2K-1\}. We prove that kk-means++ is an O(1)O(1)-approximation with constant probability in this budget-smoothed setup.
Vaclav Rozhon