Abstract
The all pairs shortest path (APSP) problem is to compute shortest paths between all pairs of vertices of a directed graph with non-negative edge costs. We present an algorithm that computes shortest distances between all pairs of vertices, since shortest paths can be computed easily as by-products as in most other algorithms. It is well-known that the time complexity of (n, n)-distance matrix multiplication (DMM) is asymptotically equal to that of the APSP problem for a graph with n vertices. See Aho, ttopcroft and Ullman [1] for example. Based on this fact, Fredma~ [5] invented an algorithm for DMM of O(n3(log log n/log n) 1/3) time, which is o(n3), meaning that the APSP problem can be solved with the same time complexity. In the average case, Moffat and Takaoka [6] solved this problem with O(n 9 log n) expected time. Our algorithm in this paper solves DMM in O(n3(loglog n/log n) ~/2) time, meaning that the APSP problem can be solved with the same time complexity. This is an asymptotic improvement of Fredman's algorithm by the factor of (logn/loglogn) 1Is. Another merit of our algorithm is that it is simple and easy to implement, whereas Fredman's algorithm is complicated and difficult to implement. Also a possible parallel implementation is mentioned. The base of logarithm is assumed to be two in this paper and fractions are rounded up if necessary.
Talk to us
Join us for a 30 min session where you can share your feedback and ask us any queries you have