We show that the eccentricities, diameter, radius, and Wiener index of an undirected n-vertex graph with nonnegative edge lengths can be computed in time O(n · k+ log n k · 2 k k 2 log n), where k is the treewidth of the graph. For every > 0, this bound is n 1+ exp O(k), which matches a hardness result of Abboud, Vassilevska Williams, and Wang (SODA 2015) and closes an open problem in the multivariate analysis of polynomial-time computation. To this end, we show that the analysis of an algorithm of Cabello and Knauer (Comp. Geom., 2009) in the regime of non-constant treewidth can be improved by revisiting the analysis of orthogonal range searching, improving bounds of the form log d n to d+ log n d , as originally observed by Monier (J. Alg. 1980).We also investigate the parameterization by vertex cover number.
ACM Subject ClassificationTheory of computation → Shortest paths, Parameterized complexity and exact algorithms, Computational geometry. Mathematics of computing → Paths and connectivity problems.In fact, this holds under the potentially weaker Orthogonal Vectors conjecture, see [18] for an introduction to these arguments. Thus, under this assumption, the dependency on tw(G) in Theorem 1 cannot be significantly improved, even if the dependency on n is relaxed from just above linear to just below quadratic. Our analysis encompasses the Wiener index, an important structural graph parameter left unexplored by [1].Perhaps surprisingly, the main insight needed to establish Theorem 1 has nothing to do with graph distances or treewidth. Instead, we make-or re-discover-the following observation about the running time of d-dimensional range trees: Lemma 2 ([15]). A d-dimensional range tree over n points supporting orthogonal range queries for the aggregate value over a commutative monoid has query time O(2 d · B(n, d)) and can be built in time O (nd · B(n, d)This is a more careful statement than the standard textbook analysis, which gives the query time as O(log d n) and the construction time as O(n log d n). For many values of d, the asymptotic complexities of these bounds agree-in particular, this is true for constant d and for very large d, which are the main regimes of interest to computational geometers. But crucially, B(n, d) is always n exp O(d) for any > 0, while log d n is not.After Lemma 2 is realised, Theorem 1 follows via divide-and-conquer in decomposable graphs, closely following the idea of Cabello and Knauer [6] and augmented with known arguments [1,5]. We choose to give a careful presentation of the entire construction, as some of the analysis is quite fragile.Using known reductions, this implies that the following multivariate lower bound on orthogonal range searching is tight:
K. Bringmann and T. Husfeldt and M. Magnusson
23:3Theorem 3 (Implicit in [1]). A data structure for the orthogonal range query problem for the monoid (Z, max) with construction time n · q (n, d) and query time q (n, d), where q (n, d) = n 1− exp o (d) for some > 0, refutes the Strong Exponential Time hypothesis.We a...