Abstract
We present a linear-time $O(n)$ algorithm for determining the diameter of a unicycle graph, reaching the theoretical lower bound for this problem. Building on this result, we address the Diameter-Optimally Augmenting Tree (DOAT) problem—identifying the optimal single shortcut to add to a tree to minimize its diameter. Our approach solves the DOAT problem in $O(n^2 \log n)$ time while maintaining a linear $O(n)$ space complexity, offering a practical balance between computational speed and memory efficiency compared to previous quadratic-space solutions.
Introduction
The diameter of a graph, defined as the maximum shortest path distance between any pair of vertices, is a critical metric in network analysis and design. While computing the diameter of a tree is straightforward in $O(n)$ time, the introduction of even a single cycle increases the complexity. This paper focuses on two related problems: efficiently finding the diameter of unicycle graphs (trees with one additional edge) and the Diameter-Optimally Augmenting Tree (DOAT) problem, which seeks to minimize a tree's diameter by adding a single shortcut.
Methodology
Linear-Time Diameter for Unicycle Graphs
Previous algorithms for unicycle graph diameters typically required $O(n \log n)$ time. The authors propose a combinatorial pruning strategy that achieves $O(n)$ time. The core of this method is the domination relation. By analyzing vertices on the unique cycle $C$, the algorithm identifies "dominated" vertices—those that cannot possibly be endpoints of the diameter because another vertex provides a longer path in all relevant directions.
The pruning process utilizes a stack-based approach to perform "full-cycle" and "half-cycle" scans. As shown in the figure, for a vertex $v_i$, the cycle is partitioned into clockwise ($C_{cw}$) and counter-clockwise ($C_{ccw}$) regions relative to an antipodal point $p$. This geometric partitioning allows the algorithm to discard unimportant vertices efficiently, leaving a reduced set of candidates for the diameter calculation.
Solving the DOAT Problem
The DOAT problem is tackled by reducing the search space for the optimal shortcut. The authors demonstrate that the problem of adding a shortcut to a general tree can be simplified to adding a shortcut to the tree's diametral path.
Key to this efficiency is the discovery of unimodality. The authors prove that for a specific set of undominated shortcuts, the resulting graph diameter follows a unimodal pattern—it decreases to a minimum and then increases. This property allows the use of binary search to find the optimal shortcut. At each step of the binary search, the new linear-time unicycle diameter algorithm is used as a subroutine, leading to an overall complexity of $O(n^2 \log n)$ time and $O(n)$ space.
Results and Comparison
The proposed algorithms offer significant improvements over existing literature:
- Unicycle Diameter: Achieved $O(n)$ time, which is asymptotically optimal.
- DOAT Problem: Achieved $O(n^2 \log n)$ time and $O(n)$ space.
- This improves upon the $O(n^2 \log^3 n)$ time of Oh and Ahn (2016) while maintaining the same linear space.
- While Bilò (2018) achieved $O(n^2)$ time, their approach requires $O(n^2)$ space, making the authors' $O(n)$ space solution more suitable for large-scale networks where memory is a constraint.
Conclusion and Future Work
This work establishes new benchmarks for diameter-related problems in simple cyclic graphs and tree augmentation. By leveraging domination relations and unimodality, the authors move away from complex geometric structures toward more efficient combinatorial methods.
Future research could address the "oracle assumption," where the length of any potential shortcut is assumed to be available in $O(1)$ time. Additionally, extending these techniques to the $k$-shortcut augmentation problem—which is currently NP-hard—remains a significant challenge. Empirical studies comparing these algorithms' constant factors against space-intensive alternatives would also provide valuable practical insights.
Summary updated