arXiv:2610.29781cs.DSOct 2026

Manuscript Offprint

arXiv:2610.29781

An experimental evaluation of static k-center clustering algorithms on graphs

Sebastian Forster, Martin Grösbacher

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

Sebastian Forster†

Martin Grösbacher †^{\dagger}

Abstract. The k-center problem is one of the most fundamental clustering problems and has applications in a wide range of areas, including facility location, network design, data mining, and machine learning. Given a set of objects together with a distance measure, the goal is to select k centers such that the maximum distance from any object to its closest center is minimized. The k-center problem has been studied extensively from a theoretical perspective, both in metric spaces and on graphs. While there have been experimental studies for k-center clustering in metric spaces, a comprehensive experimental comparison of graph-based k-center algorithms on large-scale graphs is still lacking. In this paper, we bridge this gap by evaluating a set of algorithms ranging from classical approaches such as Gonzalez's greedy algorithm [TCS 1985], an algorithm based on the framework established by Hochbaum and Shmoys [Math. Oper. Res. 1985], to more recent methods, including algorithms by Thorup [SICOMP 2001] and Abboud et al. [SOSA 2023]. Our study considers both running time, solution quality and the effects of parallelism on a variety of synthetic and real-world datasets. Our goal is to provide a comprehensive comparison of state-of-the-art k-center algorithms on graphs and identify the strengths and weaknesses of different approaches in practice.

*This project has received funding from the European Research Council (ERC) under the European Union’s Horizon 2020 research and innovation programme (grant agreement No 947702). All code is publicly available at: https://doi.org/10.5281/zenodo.23433263

†^{\dagger}University of Salzburg, Austria (forster@cs.sbg.ac.at)

‡^{\ddagger}University of Salzburg, Austria (martin.groesbacher@plus.ac.at)

1 Introduction Analyzing the structure of large-scale networks is a fundamental problem in many fields. One important task is to partition the underlying data into meaningful subgroups. This process is naturally captured by clustering problems. These problems have been extensively studied in data mining and machine learning [31, 3, 32]. The goal of clustering problems is to group input data together in structures called clusters such that similar data ends up in the same cluster. Among the many clustering objectives, k-clustering methods represent each cluster by one of k centers and each data point is assigned to the cluster of its closest center. The k-center problem is concerned with selecting its centers such that the maximum distance of every data point to its closest center is minimized. Formally, this is an optimization problem of the following form: Given a metric space M=(P,dist)M = (P, \text{dist}) and an integer k≥1k \geq 1, the objective is to compute a set of centers C⊆PC \subseteq P with ∣C∣=k|C| = k minimizing fM(C)=max⁡p∈Pdist(p,C)f_M(C) = \max_{p \in P} \text{dist}(p, C), where dist(p,C)=min⁡q∈Cdist(p,q)\text{dist}(p, C) = \min_{q \in C} \text{dist}(p, q).

This problem is NP-hard [30] and thus TCS research generally focuses on finding efficient approximation algorithms [24, 29, 41, 19]. The k-center problem is commonly defined on arbitrary metric spaces. In this general setting, often called ‘metric k-center’ or ‘vertex k-center’, it is usually assumed that the distances are given to the algorithm explicitly as part of the input or that distances can be queried upon request. However, in transportation, communication, social and web network analysis, data is often inherently represented as a graph, where distances correspond to shortest-path lengths rather than explicitly given pairwise distances. Consequently, the graph k-center problem has been studied alongside its metric counterpart from theoretical and algorithmic perspectives [49, 1, 21]. Although graph metrics satisfy the triangle inequality and therefore constitute a special case of metric spaces, they introduce a fundamental algorithmic difference. As a result, the practical performance of graph k-center algorithms depends not only on the quality of the approximation algorithm itself, but also on how efficiently shortest-path computations are performed. Despite recurring progress of theoretical research on graph k-center there is comparatively little empirical work evaluating these algorithms on modern large-scale graph datasets. This paper aims to fill this gap by providing a comprehensive experimental study of state-of-the-art graph k-center algorithms on graphs.

1.1 Related Work Note that for the sake of clearer exposition, we report running times under the assumption that the weights are integers in the range 1 to ncn^{c} for some constant c. For super-polynomial weights, general techniques for reducing the weight range at the expense of a mild increase in approximation guarantee exist (see [1] for a brief discussion). We furthermore employ O~(⋅)\tilde{O}(\cdot)-notation suppresses factors polylogarithmic in n (the number of nodes).

Classic approximation algorithms for k-center have originally considered the “metric” version of the problem. Both the farthest-point heuristic (discovered independently by Gonzalez [24] and Dyer and Frieze [19]) and the covering heuristic (discovered independently by Hochbaum and Shmoys [29] and Plesnik [41]) compute a solution that exceeds the optimal value by a factor of at most 2 in polynomial time. This approximation factor is tight unless P=NPP = NP [30]. 1^{1} In cases where constant-time query access to the distances of the metric space is supported, these two classic algorithms have a running time of O(kn)O(kn) and O~(kn)\tilde{O}(kn), respectively. 2^{2} Note that any algorithm formulated for the metric setting can readily be applied to graphs after performing an (expensive, Ω(n2)\Omega(n^{2})-time) all-pairs shortest path computation in a preprocessing step. 3^{3} The two classic algorithms can however be directly implemented more efficiently in O~(km+n)\tilde{O}(km + n) time by employing Dijkstra’s algorithm (or any other comparably fast single-source shortest path (SSSP) algorithm) for a graph with n nodes and m edges. It can further be shown that at least Ω(kn)\Omega(kn) distance queries are necessary in the metric setting [7], but this lower bound does not apply to the graph setting.

Indeed, Thorup [49] designed a 2-approximation algorithm with near-linear running time, i.e., time O~(m+n)\tilde{O}(m + n). Thorup in particular exploits the following near-linear time primitive that cannot be implemented as efficiently in other metric spaces: Given a set of source nodes S⊆VS \subseteq V, compute the distance of every node to its closest node in S by a straightforward modification of Dijkstra's algorithm. Another interesting aspect about Thorup's algorithm is that it eliminates the inherent "chain of sequentiality" present in the classic algorithms that arises from the iterative choice of the k centers.

Recently, the graph setting has received further attention. First, Abboud, Cohen-Addad, Lee, and Manurangsi [1] showed that the two classic algorithmic approaches mentioned above can be implemented in near-linear time in the graph setting due to an elegant randomization trick; for the Hochbaum-Shmoys algorithm

1^{1}Note that such hardness results directly carry over to the graph setting because every metric space with n points can be viewed as a complete graph with n2n^{2} edges.

2^{2}Otherwise, a quadratic-time preprocessing step is required for reading the whole input.

3^{3}As pointed out by Thorup [49], distance approximation algorithms can be used to gain efficiency in such a preprocessing step at the cost of overall accuracy.

this approach worsens the approximation guarantee by a (1+ϵ)(1+\epsilon)-factor for a tuneable parameter ϵ\epsilon with (inverse) linear influence on the running time. Second, Forster, Nazari, Rao, and Skarlatos [21] observed that the two classic algorithmic approaches can be implemented efficiently by employing a partially dynamic single-source shortest paths data structure. In particular, the partially dynamic algorithm of Górkiewicz and Karczmarz [25] implies a nearly-linear time implementation at the cost of worsening the approximation guarantee by a (1+ϵ)(1+\epsilon)-factor for a tuneable parameter ϵ\epsilon with (inverse) linear influence on the running time. Note that these recent works again exhibit the aforementioned “chain of sequentiality” in choosing the centers.

Apart from the study of Kralev et al. [33], which compares an exact and an approximation algorithm on randomly generated graphs with at most 150 nodes, we are not aware of any experimental studies targeting the k-center problem in the graph setting. Existing studies [39, 23] for the related metric k-center problem (in which the all-pairs distances are given explicitly as part of the input) focus approximation guarantee and have been conducted for moderate input sizes.

1.2 Research Questions As explained above, the k-center problem on graphs has become a separate object of study with several potential use cases. Yet, to the best of our knowledge, a systematic study of running time performance is lacking. In this paper, we address this research gap by engineering scalable implementations of existing algorithms and introducing an implementation-oriented simplification of Thorup's algorithm. In doing so, we in particular consider parallelization issues to support large input graphs on modern hardware. All algorithms in this paper were therefore implemented both with sequential and parallel support via parallel SSSP routines.

The main goal of our work is to answer the following questions:

  1. Which algorithms achieve the best running time on different graph classes?

  2. How do the solution qualities of the algorithms compare?

  3. How well do the algorithms scale with parallelism?

To answer these questions, we perform an extensive experimental evaluation on synthetic random graphs as well as real-world instances. To keep this study feasible, we (a) limit the scope of our investigations to polynomial-time algorithms with a (close to) optimal multiplicative approximation factor of 2 and (b) rely on established implementations of single-source shortest path algorithms. Algorithms included in this paper are well known approaches such as the algorithm of Gonzalez [24], a recent improvement over the classic algorithm of Hochbaum & Shmoys [29] by Abboud et al. [1], an algorithm by Thorup [49] as well as an α\alpha-approximate version of Gonzalez's algorithm by Abboud et al. [1]. All algorithms were implemented in C++ using the graph-based benchmark suite (GBBS) by Dhulipala et al. [14].

1.3 Outline The rest of this paper is organized as follows: In section 2 we provide preliminaries and discuss our parallel model. Sections 4 and 5 explain the algorithms and their implementations. Sections 6 and 7 treat our experimental setup and results and section 8 contains the conclusion.

2 Preliminaries

2.1 Basic Concepts Let G=(V,E,w)G = (V, E, w) be an undirected (weighted) graph with vertex set VV, edge set EE, and weight function w:E→N>0w : E \to \mathbb{N}_{>0} assigning a positive integer weight to each edge. Throughout this paper, let n=∣V∣n = |V| denote the number of vertices, m=∣E∣m = |E| the number of edges and let NN denote the highest weight in the graph which we assume to be polynomial in nn. This assumption is justified by the observation that N<<nN << n in massive real-world data sets with a large number of nodes. Furthermore, we define the density of GG as ρ=mn\rho = \frac{m}{n}. We write deg⁡(v)\deg(v) to refer to the degree of the vertex vv, i.e. the number of its incident edges and deg⁡max⁡\deg_{\max} to refer to the highest degree of any v∈Vv \in V of GG. Let d(u,v)d(u, v) denote the weight of the shortest path between uu and vv in GG, sometimes also referred to as the distance from uu to vv. Since the graphs considered in this paper are undirected, d(u,v)d(u, v) is symmetric. The kk-center problem on graphs is defined as:

DEFINITION 2.1 (k-Center Problem on Graphs). Given an undirected (weighted) graph G=(V,E,w)G = (V, E, w) and an integer kk, find a set of centers C⊆VC \subseteq V with ∣C∣≤k|C| \leq k minimizing

max⁡v∈Vd(v,C),whered(v,C)=min⁡c∈Cd(v,c).\max_{v\in V}d(v,C),\quad where\quad d(v,C)=\min_{c\in C}d(v,c).

The solution to the k-center problem returned is often referred to as the radius of the clusters produced. For a vertex u∈Vu \in V, let dud_u denote its current distance to the nearest center. During the execution of an algorithm, dud_u refers to the value maintained by the algorithm and is updated whenever a closer center is found. We say that an event occurs with high probability (w.h.p.), if it occurs with probability at least 1−1nc1 - \frac{1}{n^c} for any c≥1c \geq 1.

2.2 Parallel Model and Primitives In this paper, we analyze the running time of parallel algorithms in the work-depth model [8, 46], which is commonly used to analyze fork-join style parallel algorithms. Work is the total number of operations performed (equivalently, the sequential running time). Depth (span) is the length of the longest chain of sequential dependencies. By Brent's theorem [9], the running time of a parallel algorithm in the work-depth model on P processors satisfies TP=O(WP+D)T_P = O(\frac{W}{P} + D) where W denotes the total work, P denotes the number of available processors, D denotes the depth and TPT_P denotes the running time of the algorithm using P processors. This model is a shared-memory extension of the sequential RAM model and has been commonly used to develop and analyze parallel algorithms. A work-efficient parallel algorithm is one where the work asymptotically matches the best-known sequential time complexity for the problem.

References (28)