Skip to main content
Log in

Subquadratic-time Algorithm for the Diameter and all Eccentricities on Median Graphs

  • Published:
Theory of Computing Systems Aims and scope Submit manuscript

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)}\).

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Algorithm 1
Fig. 8
Fig. 9
Fig. 10
Fig. 11
Fig. 12
Fig. 13
Fig. 14
Algorithm 2
Fig. 15

Similar content being viewed by others

Notes

  1. This tree T is independent to the one built in Section 3.2

References

  1. Avann, S.P.: Metric ternary distributive semi-lattices. Proc. Amer. Math. Soc. 12, 407–414 (1961)

    Article  MathSciNet  Google Scholar 

  2. Birkhoff, G., Kiss, S.A.: A ternary operation in distributive lattices. Bull. Amer. Math. Soc. 53, 745–752 (1947)

    Article  MathSciNet  Google Scholar 

  3. Bandelt, H., Chepoi, V.: Metric graph theory and geometry: a survey. Contemp. Math. 453, 49–86 (2008)

    Article  MathSciNet  Google Scholar 

  4. Chepoi, V.: Graphs of some CAT(0) complexes. Adv. Appl. Math. 24(2), 125–179 (2000)

    Article  MathSciNet  Google Scholar 

  5. Barthélemy, J., Constantin, J.: Median graphs, parallelism and posets. Discret. Math. 111(1–3), 49–63 (1993)

    Article  MathSciNet  Google Scholar 

  6. 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)

  7. 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)

    Article  Google Scholar 

  8. 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)

    Article  Google Scholar 

  9. 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)

  10. Cabello, S.: Subquadratic algorithms for the diameter and the sum of pairwise distances in planar graphs. In: Proc. of SODA, pp. 2143–2152 (2017)

  11. 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

    Article  MathSciNet  Google Scholar 

  12. 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)

  13. Roditty, L., Williams, V.V.: Fast approximation algorithms for the diameter and radius of sparse graphs. In: Proc. of STOC, pp. 515–524 (2013)

  14. Mulder, M.: The structure of median graphs. Discret. Math. 24(2), 197–204 (1978)

    Article  MathSciNet  Google Scholar 

  15. Mulder, M.: The interval function of a graph. Mathematical Centre Tracts, Mathematisch Centrum, Amsterdam (1980)

    Google Scholar 

  16. Bandelt, H.: Retracts of hypercubes. J. Graph Theory 8(4), 501–510 (1984)

    Article  MathSciNet  Google Scholar 

  17. Mulder, H.M., Schrijver, A.: Median graphs and Helly hypergraphs. Discret. Math. 25(1), 41–50 (1979)

    Article  MathSciNet  Google Scholar 

  18. Klavzar, S., Mulder, H.M., Skrekovski, R.: An Euler-type formula for median graphs. Discret. Math. 187(1–3), 255–258 (1998)

    Article  MathSciNet  Google Scholar 

  19. 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)

  20. Hagauer, J., Imrich, W., Klavzar, S.: Recognizing median graphs in subquadratic time. Theor. Comput. Sci. 215(1–2), 123–136 (1999)

    Article  MathSciNet  Google Scholar 

  21. Imrich, W., Klavzar, S., Mulder, H.M.: Median graphs and triangle-free graphs. SIAM J. Discret. Math. 12(1), 111–118 (1999)

    Article  MathSciNet  Google Scholar 

  22. Alon, N., Yuster, R., Zwick, U.: Finding and counting given length cycles. Algorithmica 17(3), 209–223 (1997)

    Article  MathSciNet  Google Scholar 

  23. 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)

  24. Ducoffe, G.: Isometric embeddings in trees and their use in distance problems. In: Proc. of MFCS. LIPIcs, vol. 202, pp. 43–14316 (2021)

  25. Chepoi, V., Labourel, A., Ratel, S.: Distance labeling schemes for cube-free median graphs. In: Proc. of MFCS, vol. 138, pp. 15–11514 (2019)

  26. Bergé, P., Habib, M.: Diameter, radius and all eccentricities in linear time for constant-dimension median graphs. In: Proc. of LAGOS (2021)

  27. 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)

    Article  MathSciNet  Google Scholar 

  28. 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)

  29. Bandelt, H., Chepoi, V., Eppstein, D.: Combinatorics and geometry of finite and infinite squaregraphs. SIAM J. Discret. Math. 24(4), 1399–1440 (2010)

    Article  MathSciNet  Google Scholar 

  30. Hammack, R., Imrich, W., Klavžar, S.: Handbook of Product Graphs. CRC Press, Boca Raton, FL (2011)

    Book  Google Scholar 

  31. 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)

  32. McMorris, F.R., Mulder, H.M., Roberts, F.S.: The median procedure on median graphs. Discret. Appl. Math. 84(1–3), 165–181 (1998)

    Article  MathSciNet  Google Scholar 

  33. Bandelt, H., Chepoi, V., Dress, A.W.M., Koolen, J.H.: Combinatorics of lopsided sets. Eur. J. Comb. 27(5), 669–689 (2006)

    Article  MathSciNet  Google Scholar 

  34. Bandelt, H., van de Vel, M.: Embedding topological median algebras in products of dendrons. Proc. London Math. Soc. 58, 439–453 (1989)

    Article  MathSciNet  Google Scholar 

  35. Klavzar, S., Mulder, H.M.: Partial cubes and crossing graphs. SIAM J. Discret. Math. 15(2), 235–251 (2002)

    Article  MathSciNet  Google Scholar 

  36. Habib, M., Paul, C., Viennot, L.: Partition refinement techniques: An interesting algorithmic tool kit. Int. J. Found. Comput. Sci. 10(2), 147–170 (1999)

    Article  MathSciNet  Google Scholar 

  37. Paige, R., Tarjan, R.E.: Three partition refinement algorithms. SIAM J. Comput. 16(6), 973–989 (1987)

    Article  MathSciNet  Google Scholar 

  38. Winkler, P.M.: Isometric embedding in products of complete graphs. Discret. Appl. Math. 7(2), 221–225 (1984)

    Article  MathSciNet  Google Scholar 

  39. Abboud, A., Grandoni, F., Williams, V.V.: Subcubic equivalences between graph centrality problems, APSP and diameter. In: Proc. of SODA, pp. 1681–1697 (2015)

  40. Bresar, B.: Characterizing almost-median graphs. Eur. J. Comb. 28(3), 916–920 (2007)

    Article  MathSciNet  Google Scholar 

  41. Klavzar, S., Shpectorov, S.V.: Characterizing almost-median graphs II. Discret. Math. 312(2), 462–464 (2012)

    Article  MathSciNet  Google Scholar 

Download references

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

Authors

Contributions

All authors contributed to both the scientific content and the writing.

Corresponding author

Correspondence to Pierre Bergé.

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.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

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

Download citation

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s00224-023-10153-9

Keywords

Navigation