Computing the diameter, and more generally, all eccentricities of an undirected graph is an important problem in algorithmic graph theory and the challenge is to identify graph classes for which their computation can be achieved in subquadratic time. Using a new recursive scheme based on the structural properties of median graphs, we provide a quasilinear-time algorithm to determine all eccentricities for this well-known family of graphs. The gist of our technique is to identify the balanced and unbalanced parts of the Θ-class decomposition of median graphs, which are then processed using different recursive schemes. The exact running time of our algorithm is in O(nlog<sup>4</sup> n). This outcome not only answers a question asked by Bénéteau et al. (2020) but also greatly improves the recent combinatorial algorithm of Bergé et al. (2022) for the same problem, running in time O(n<sup>1.6408</sup> log<sup>O(1)</sup> n). As our second main contribution, we further propose a distance oracle for median graphs with both polylogarithmic size and query time. More specifically, we present a combinatorial algorithm which computes for any median graph G, in quasilinear time O(nlog<sup>4</sup>(n)), vertex-labels of size O(log<sup>3</sup>(n)) such that any distance of G can be retrieved in time O(log<sup>4</sup>(n)) thanks to these labels.
Cuvinte cheie
—
An
2025
Tip publicație
Lucrare conferință
Eveniment
36th Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2025