Exact computation of shortest paths in weighted graphs has been traditionally studied in one of two settings. First, one can assume that the edge weights are real numbers and all the performed operations on reals (typically comparisons and additions) take constant time. Classical Dijkstra's and Bellman-Ford algorithms have been described in this setting. More efficient exact shortest paths algorithms have been obtained for integer-weighted graphs. Integrality assumption not only enables faster algorithms but also allows implementing the aforementioned algorithms in a much more realistic word RAM model where only arithmetic operations on $O(\log{n})$-bit integers are performed in constant time. On the word RAM one can as efficiently exactly encode even \emph{rational-weighted} instances with $O(\log{n})$-bit numerators and denominators. However, the known exact real-weighted shortest paths algorithms, run on such a rational input, can easily encounter intermediate values of $\Theta(n)$ bits if represented exactly. This leads to a factor-$\Omega(n)$ slowdown on the word RAM. At the same time, the scaling algorithms suited for integer weights do not produce exact solutions for rational inputs without dramatically increasing their accuracy. In this paper, we design randomized exact single-source shortest paths algorithms for rational-weighted graphs on the word RAM. Most importantly, in the non-negative case, we obtain a near-linear time algorithm matching Dijkstra's algorithm running time up to polylogarithmic factors. In presence of negative weights, we give an $\tilde{O}(n^{2.5})$-time algorithm breaking through the best known strongly polynomial bound attained by Bellman-Ford for sufficiently dense graphs.
翻译:摘要:加权图中最短路径的精确计算传统上在两种设定下进行研究。第一种假设边权重为实数,且所有对实数的操作(通常是比较与加法)均可在常数时间内完成。经典的Dijkstra算法与Bellman-Ford算法正是在此设定下被描述的。针对整数权重图,研究人员已获得更高效的精确最短路径算法。整数性假设不仅允许更快的算法,还使得上述算法能在更为实际的Word RAM模型上实现——在该模型中,只有对$O(\log{n})$位整数的算术运算可在常数时间内完成。在Word RAM上,甚至可以通过$O(\log{n})$位的分子与分母对\emph{有理权重}实例进行同样高效的精确编码。然而,现有精确实数权重最短路径算法在处理此类有理输入时,若进行精确表示,中间值极易达到$\Theta(n)$位,从而导致Word RAM上的$\Omega(n)$倍减速。与此同时,适用于整数权重的缩放算法在有理输入下若不显著提高精度则无法产生精确解。本文在Word RAM上为有理权重图设计了随机化精确单源最短路径算法。最重要的是,在非负权重情形下,我们获得了近乎线性时间的算法,其运行时间在多项对数因子内匹配Dijkstra算法。在存在负权重时,我们给出一个$\tilde{O}(n^{2.5})$时间算法,突破了Bellman-Ford算法对足够稠密图所保持的最佳强多项式界。