Abstract
On sparse graphs, Roditty and Williams [2013] proved that no \(\varvec{O(n^{2-\varepsilon })}\)-time algorithm achieves an approximation factor smaller than \(\varvec{\frac{3}{2}}\) for the diameter problem unless SETH fails. In this article, we solve an open question formulated in the literature: can we use the structural properties of median graphs to break this global quadratic barrier? We propose the first combinatorial algorithm computing exactly all eccentricities of a median graph in truly subquadratic time. Median graphs constitute the family of graphs which is the most studied in metric graph theory because their structure represents many other discrete and geometric concepts, such as CAT(0) cube complexes. Our result generalizes a recent one, stating that there is a linear-time algorithm for all eccentricities in median graphs with bounded dimension \(\varvec{d}\), i.e. the dimension of the largest induced hypercube. This prerequisite on \(\varvec{d}\) is not necessary anymore to determine all eccentricities in subquadratic time. The execution time of our algorithm is \(\varvec{O(n^{1.6456}\log ^{O(1)} n)}\). We provide also some satellite outcomes related to this general result. In particular, restricted to simplex graphs, this algorithm enumerates all eccentricities with a quasilinear running time. Moreover, an algorithm is proposed to compute exactly all reach centralities in time \(\varvec{O(2^{3d}n\log ^{O(1)}n)}\).
Similar content being viewed by others
Notes
This tree T is independent to the one built in Section 3.2
References
Avann, S.P.: Metric ternary distributive semi-lattices. Proc. Amer. Math. Soc. 12, 407–414 (1961)
Birkhoff, G., Kiss, S.A.: A ternary operation in distributive lattices. Bull. Amer. Math. Soc. 53, 745–752 (1947)
Bandelt, H., Chepoi, V.: Metric graph theory and geometry: a survey. Contemp. Math. 453, 49–86 (2008)
Chepoi, V.: Graphs of some CAT(0) complexes. Adv. Appl. Math. 24(2), 125–179 (2000)
Barthélemy, J., Constantin, J.: Median graphs, parallelism and posets. Discret. Math. 111(1–3), 49–63 (1993)
Sassone, V., Nielsen, M., Winskel, G.: A classification of models for concurrency. In: Proc. of CONCUR. Lecture Notes in Computer Science, vol. 715, pp. 82–96 (1993)
Bandelt, H., Quintana-Murci, L., Salas, A., Macaulay, V.: The fingerprint of phantom mutations in mitochondrial dna data. Am. J. Hum. Genet. 71, 1150–1160 (2002)
Bandelt, H.J., Forster, P., Sykes, B.C., Richards, M.B.: Mitochondrial portraits of human populations using median networks. Genetics 141(2), 743–753 (1995)
Abboud, A., Williams, V.V., Wang, J.R.: Approximation and fixed parameter subquadratic algorithms for radius and diameter in sparse graphs. In: Proc. of SODA, pp. 377–391 (2016)
Cabello, S.: Subquadratic algorithms for the diameter and the sum of pairwise distances in planar graphs. In: Proc. of SODA, pp. 2143–2152 (2017)
Ducoffe, G., Habib, M., Viennot, L.: Diameter, eccentricities and distance oracle computations on H -minor free graphs and graphs of bounded (distance) Vapnik-Chervonenkis dimension. SIAM J. Comput. 51(5), 1506–1534 (2022). https://doi.org/10.1137/20m136551x
Chechik, S., Larkin, D.H., Roditty, L., Schoenebeck, G., Tarjan, R.E., Williams, V.V.: Better approximation algorithms for the graph diameter. In: Proc. of SODA, pp. 1041–1052 (2014)
Roditty, L., Williams, V.V.: Fast approximation algorithms for the diameter and radius of sparse graphs. In: Proc. of STOC, pp. 515–524 (2013)
Mulder, M.: The structure of median graphs. Discret. Math. 24(2), 197–204 (1978)
Mulder, M.: The interval function of a graph. Mathematical Centre Tracts, Mathematisch Centrum, Amsterdam (1980)
Bandelt, H.: Retracts of hypercubes. J. Graph Theory 8(4), 501–510 (1984)
Mulder, H.M., Schrijver, A.: Median graphs and Helly hypergraphs. Discret. Math. 25(1), 41–50 (1979)
Klavzar, S., Mulder, H.M., Skrekovski, R.: An Euler-type formula for median graphs. Discret. Math. 187(1–3), 255–258 (1998)
Bénéteau, L., Chalopin, J., Chepoi, V., Vaxès, Y.: Medians in median graphs and their cube complexes in linear time. In: Proc. of ICALP, vol. 168, pp. 10–11017 (2020)
Hagauer, J., Imrich, W., Klavzar, S.: Recognizing median graphs in subquadratic time. Theor. Comput. Sci. 215(1–2), 123–136 (1999)
Imrich, W., Klavzar, S., Mulder, H.M.: Median graphs and triangle-free graphs. SIAM J. Discret. Math. 12(1), 111–118 (1999)
Alon, N., Yuster, R., Zwick, U.: Finding and counting given length cycles. Algorithmica 17(3), 209–223 (1997)
Chepoi, V., Dragan, F.F., Vaxès, Y.: Center and diameter problems in plane triangulations and quadrangulations. In: Proc. of SODA, pp. 346– 355 (2002)
Ducoffe, G.: Isometric embeddings in trees and their use in distance problems. In: Proc. of MFCS. LIPIcs, vol. 202, pp. 43–14316 (2021)
Chepoi, V., Labourel, A., Ratel, S.: Distance labeling schemes for cube-free median graphs. In: Proc. of MFCS, vol. 138, pp. 15–11514 (2019)
Bergé, P., Habib, M.: Diameter, radius and all eccentricities in linear time for constant-dimension median graphs. In: Proc. of LAGOS (2021)
Barthélemy, J., Leclerc, B., Monjardet, B.: On the use of ordered sets in problems of comparison and consensus of classifications. J. Classif. 3, 187–224 (1986)
Gutman, R.J.: Reach-based routing: A new approach to shortest path algorithms optimized for road networks. In: Proc. of ALENEX/ANALC, pp. 100–111 (2004)
Bandelt, H., Chepoi, V., Eppstein, D.: Combinatorics and geometry of finite and infinite squaregraphs. SIAM J. Discret. Math. 24(4), 1399–1440 (2010)
Hammack, R., Imrich, W., Klavžar, S.: Handbook of Product Graphs. CRC Press, Boca Raton, FL (2011)
Kovse, M.: Complexity of phylogenetic networks: counting cubes in median graphs and related problems. Analysis of complex networks: From Biology to Linguistics, 323–350 (2009)
McMorris, F.R., Mulder, H.M., Roberts, F.S.: The median procedure on median graphs. Discret. Appl. Math. 84(1–3), 165–181 (1998)
Bandelt, H., Chepoi, V., Dress, A.W.M., Koolen, J.H.: Combinatorics of lopsided sets. Eur. J. Comb. 27(5), 669–689 (2006)
Bandelt, H., van de Vel, M.: Embedding topological median algebras in products of dendrons. Proc. London Math. Soc. 58, 439–453 (1989)
Klavzar, S., Mulder, H.M.: Partial cubes and crossing graphs. SIAM J. Discret. Math. 15(2), 235–251 (2002)
Habib, M., Paul, C., Viennot, L.: Partition refinement techniques: An interesting algorithmic tool kit. Int. J. Found. Comput. Sci. 10(2), 147–170 (1999)
Paige, R., Tarjan, R.E.: Three partition refinement algorithms. SIAM J. Comput. 16(6), 973–989 (1987)
Winkler, P.M.: Isometric embedding in products of complete graphs. Discret. Appl. Math. 7(2), 221–225 (1984)
Abboud, A., Grandoni, F., Williams, V.V.: Subcubic equivalences between graph centrality problems, APSP and diameter. In: Proc. of SODA, pp. 1681–1697 (2015)
Bresar, B.: Characterizing almost-median graphs. Eur. J. Comb. 28(3), 916–920 (2007)
Klavzar, S., Shpectorov, S.V.: Characterizing almost-median graphs II. Discret. Math. 312(2), 462–464 (2012)
Acknowledgements
This work was supported by a grant of the Romanian Ministry of Research, Innovation and Digitalization, CCCDI - UEFISCDI, project number PN-III-P2-2.1-PED-2021-2142, within PNCDI III.
Author information
Authors and Affiliations
Contributions
All authors contributed to both the scientific content and the writing.
Corresponding author
Ethics declarations
Competing interests
The authors declare no competing interests.
Additional information
Publisher's Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Rights and permissions
Springer Nature or its licensor (e.g. a society or other partner) holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.
About this article
Cite this article
Bergé, P., Ducoffe, G. & Habib, M. Subquadratic-time Algorithm for the Diameter and all Eccentricities on Median Graphs. Theory Comput Syst 68, 144–193 (2024). https://doi.org/10.1007/s00224-023-10153-9
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s00224-023-10153-9