Abstract
We consider the problem of computing the diameter of a unicycle graph (i.e., a graph with a unique cycle). We present an O(n) time algorithm for the problem, where n is the number of vertices of the graph. This improves the previous best \(O(n\log n)\) time solution [Oh and Ahn, ISAAC 2016]. Using this algorithm as a subroutine, we solve the problem of adding a shortcut to a tree so that the diameter of the new graph (which is a unicycle graph) is minimized; our algorithm takes \(O(n^2\log n)\) time and O(n) space. The previous best algorithms solve the problem in \(O(n^2\log ^3 n)\) time and O(n) space [Oh and Ahn, ISAAC 2016], or in \(O(n^2)\) time and \(O(n^2)\) space [Bilò, ISAAC 2018].
This research was supported in part by NSF under Grant CCF-2005323.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Similar content being viewed by others
References
Bilò, D.: Almost optimal algorithms for diameter-optimally augmenting trees. In: Proceedings of the 29th International Symposium on Algorithms and Computation (ISAAC), pp. 40:1–40:13 (2018)
Carufel, J.-L.D., Grimm, C., Maheshwari, A., Smid, M.: Minimizing the continuous diameter when augmenting paths and cycles with shortcuts. In: Proceedings of the 15th Scandinavian Workshop on Algorithm Theory, pp. 27:1–27:14 (2016)
Carufel, J.-L.D., Grimm, C., Schirra, S., Smid, M.: Minimizing the continuous diameter when augmenting a tree with a shortcut. In: Proceedings of the 15th Algorithms and Data Structures Symposium (WADS), pp. 301–312 (2017)
Farley, A., Proskurowski, A.: Computation of the center and diameter of outerplanar graphs. Discrete Appl. Math. 2, 185–191 (1980)
Federickson, G.: Fast algorithms for shortest paths in planar graphs, with applications. SIAM J. Comput. 16, 1004–1022 (1987)
Große, U., Gudmundsson, J., Knauer, C., Smid, M., Stehn, F.: Fast algorithms for diameter-optimally augmenting paths. In: Proceedings of the 42nd International Colloquium on Automata, Languages and Programming, pp. 678–688 (2015)
GroĂźe, U., Gudmundsson, J., Knauer, C., Smid, M., Stehn, F.: Fast algorithms for diameter-optimally augmenting paths and trees. ar**v:1607.05547 (2016)
Johnson, C., Wang, H.: A linear-time algorithm for radius-optimally augmenting paths in a metric space. In: Proceedings of the 16th Algorithms and Data Structures Symposium (WADS), pp. 466–480 (2019)
Megiddo, N.: Linear-time algorithms for linear programming in \(R^3\) and related problems. SIAM J. Comput. 12(4), 759–776 (1983)
Oh, E., Ahn, H.-K.: A near-optimal algorithm for finding an optimal shortcut of a tree. In: Proceedings of the 27th International Symposium on Algorithms and Computation (ISAAC), pp. 59:1–59:12 (2016)
Olariu, S.: A simple linear-time algorithm for computing the center of an interval graph. Int. J. Comput. Math. 34, 121–128 (1990)
Wang, H.: An improved algorithm for diameter-optimally augmenting paths in a metric space. Comput. Geom.: Theory Appl. 75, 11–21 (2018)
Wang, H., Zhao, Y.: Algorithms for diameters of unicycle graphs and diameter-optimally augmenting trees. ar**v:2011.09591 (2020)
Wang, H., Zhao, Y.: A linear-time algorithm for discrete radius optimally augmenting paths in a metric space. In: Proceedings of the 32nd Canadian Conference on Computational Geometry (CCCG), pp. 174–180 (2020)
Williams, R.: Faster all-pairs shortest paths via circuit complexity. SIAM J. Comput. 47, 1965–1985 (2018)
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2021 Springer Nature Switzerland AG
About this paper
Cite this paper
Wang, H., Zhao, Y. (2021). Algorithms for Diameters of Unicycle Graphs and Diameter-Optimally Augmenting Trees. In: Uehara, R., Hong, SH., Nandy, S.C. (eds) WALCOM: Algorithms and Computation. WALCOM 2021. Lecture Notes in Computer Science(), vol 12635. Springer, Cham. https://doi.org/10.1007/978-3-030-68211-8_3
Download citation
DOI: https://doi.org/10.1007/978-3-030-68211-8_3
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-030-68210-1
Online ISBN: 978-3-030-68211-8
eBook Packages: Computer ScienceComputer Science (R0)