# Almost optimal algorithms for diameter-optimally augmenting trees

We consider the problem of augmenting an n-vertex tree with one shortcut in order to minimize the diameter of the resulting graph. The tree is embedded in an unknown space and we have access to an oracle that, when queried on a pair of vertices u and v, reports the weight of the shortcut (u,v) in constant time. Previously, the problem was solved in O(n^2 ^3 n) time (see DBLP:conf/isaac/0001A16a) and in O(n n) time for paths embedded in a metric space (see DBLP:conf/wads/wang). Furthermore, a (1+ϵ)-approximation algorithm running in O(n+1/ϵ^3) has been designed for paths embedded in R^d, for constant values of d, in DBLP:conf/icalp/GrosseGKSS15. The contribution of this paper is twofold: we solve the problem for trees (not only paths) and we also improve upon all known results. More precisely, we design an optimal O(n^2) time algorithm. Furthermore, for trees embedded in a metric space, we design (i) an exact O(n n) time algorithm and (ii) a (1+ϵ)-approximation algorithm that runs in O(n+1/ϵ1/ϵ) time.

READ FULL TEXT