English

Faster Randomized and Deterministic k-Clustering on Graphs

Data Structures and Algorithms 2026-07-08 v1

Abstract

In this paper, we study the (k,z)(k,z)-clustering and kk-center problems on graphs, where (k,z)(k,z)-clustering generalizes the kk-median (z=1z=1) and kk-means (z=2z=2) problems. We obtain the following main results. Our first contribution is the first deterministic algorithm for kk-center on graphs that achieves a (2+ε)(2+\varepsilon)-approximation in O~(m)\tilde{O}(m) time. This affirmatively resolves an open problem raised by Abboud, Cohen-Addad, Lee, and Manurangsi [SOSA 2023]. Our techniques also extend to the kk-center with outliers problem, where up to tt points may be discarded. Our second contribution is a randomized algorithm for (k,z)(k,z)-clustering on graphs that achieves an O(1)O(1)-approximation in O~(m)\tilde{O}(m) time, which in particular covers kk-median (z=1z=1) and kk-means (z=2z=2). Prior to this work, an O~(m)\tilde{O}(m)-time randomized algorithm was known for kk-median by Thorup [SIAM J. Comput. 2005], and a recent work of Jiang, Jin, Lou, and Lu [2026] achieves m1+o(1)m^{1+o(1)} time for general zz via local search. Finally, we design a deterministic algorithm for (k,z)(k,z)-clustering on graphs that achieves an O(poly(c))O(\mathrm{poly}(c))-approximation in O~(m1+1/c)\tilde{O}(m^{1+1/c}) time, for a positive parameter cc. To obtain this result, we use techniques from the Thorup-Zwick distance oracle [JACM 2005]; this technical connection may be of independent interest, considering the wide application of distance oracles in various computational settings. Most of our algorithms are incremental, in the sense that for any given parameter kk, they return a sequence of centers such that every prefix of length k\ell \leq k yields a constant-factor approximate solution to the \ell-clustering problem.

Cite

@article{arxiv.2607.07615,
  title  = {Faster Randomized and Deterministic k-Clustering on Graphs},
  author = {Sebastian Forster and Yasamin Nazari and Rajath Rao K. N. and Antonis Skarlatos},
  journal= {arXiv preprint arXiv:2607.07615},
  year   = {2026}
}

Comments

32 pages