English

Local Search for Clustering in Almost-linear Time

Data Structures and Algorithms 2025-04-07 v1

Abstract

We propose the first \emph{local search} algorithm for Euclidean clustering that attains an O(1)O(1)-approximation in almost-linear time. Specifically, for Euclidean kk-Means, our algorithm achieves an O(c)O(c)-approximation in O~(n1+1/c)\tilde{O}(n^{1 + 1 / c}) time, for any constant c1c \ge 1, maintaining the same running time as the previous (non-local-search-based) approach [la Tour and Saulpic, arXiv'2407.11217] while improving the approximation factor from O(c6)O(c^{6}) to O(c)O(c). The algorithm generalizes to any metric space with sparse spanners, delivering efficient constant approximation in p\ell_p metrics, doubling metrics, Jaccard metrics, etc. This generality derives from our main technical contribution: a local search algorithm on general graphs that obtains an O(1)O(1)-approximation in almost-linear time. We establish this through a new 11-swap local search framework featuring a novel swap selection rule. At a high level, this rule ``scores'' every possible swap, based on both its modification to the clustering and its improvement to the clustering objective, and then selects those high-scoring swaps. To implement this, we design a new data structure for maintaining approximate nearest neighbors with amortized guarantees tailored to our framework.

Keywords

Cite

@article{arxiv.2504.03513,
  title  = {Local Search for Clustering in Almost-linear Time},
  author = {Shaofeng H. -C. Jiang and Yaonan Jin and Jianing Lou and Pinyan Lu},
  journal= {arXiv preprint arXiv:2504.03513},
  year   = {2025}
}
R2 v1 2026-06-28T22:46:57.534Z