Solving all-pairs shortest path by single-source computations: Theory and practice

被引:5
作者
Brodnik, Andrej [1 ,2 ]
Grgurovic, Marko [1 ]
机构
[1] Univ Primorska, Dept Informat Sci & Technol, Glagoljaska 8, Koper 6000, Slovenia
[2] Univ Ljubljana, Fac Comp & Informat Sci, Trzaska Cesta 25, Ljubljana 1000, Slovenia
关键词
All pairs shortest path; Single source shortest path; ALGORITHMS; GRAPHS; HEAPS; TIME;
D O I
10.1016/j.dam.2017.03.008
中图分类号
O29 [应用数学];
学科分类号
070104 ;
摘要
Given an arbitrary directed graph G = (V, E) with non-negative edge lengths, we present an algorithm that computes all pairs shortest paths in time O (m*n + m Ign + nT(psi) (m*, n)), where m* is the number of different edges contained in shortest paths and T-psi (m*, n) is the running time of an algorithm psi solving the single-source shortest path problem (SSSP). This is a substantial improvement over a trivial n times application of psi that runs in O (nT(psi) (m, n)). In our algorithm we use psi as a black box and hence any improvement on psi results also in improvement of our algorithm. A combination of our method, Johnson's reweighting technique and topological sorting results in an O (m*n m Ig n) all-pairs shortest path algorithm for directed acyclic graphs with arbitrary edge lengths. We also point out a connection between the complexity of a certain sorting problem defined on shortest paths and SSSP. Finally, we show how to improve the performance of the proposed algorithm in practice. We then empirically measure the running times of various all pairs shortest path algorithms on randomly generated graph instances and obtain very promising results. (C) 2017 Elsevier B.V. All rights reserved.
引用
收藏
页码:119 / 130
页数:12
相关论文
共 16 条
[1]   THE EXPECTED LENGTH OF A SHORTEST-PATH [J].
DAVIS, R ;
PRIEDITIS, A .
INFORMATION PROCESSING LETTERS, 1993, 46 (03) :135-141
[2]   Experimental Analysis of Dynamic All Pairs Shortest Path Algorithms [J].
Demetrescu, Camil ;
Italiano, Giuseppe F. .
ACM TRANSACTIONS ON ALGORITHMS, 2006, 2 (04)
[3]  
Dijkstra EW., 1959, NUMER MATH, V1, P269, DOI 10.1007/BF01386390
[4]   ALGORITHM-97 - SHORTEST PATH [J].
FLOYD, RW .
COMMUNICATIONS OF THE ACM, 1962, 5 (06) :345-345
[5]   FIBONACCI HEAPS AND THEIR USES IN IMPROVED NETWORK OPTIMIZATION ALGORITHMS [J].
FREDMAN, ML ;
TARJAN, RE .
JOURNAL OF THE ACM, 1987, 34 (03) :596-615
[6]   FASTER SCALING ALGORITHMS FOR NETWORK PROBLEMS [J].
GABOW, HN ;
TARJAN, RE .
SIAM JOURNAL ON COMPUTING, 1989, 18 (05) :1013-1036
[7]  
GOLDBERG AV, 1993, PROCEEDINGS OF THE FOURTH ANNUAL ACM-SIAM SYMPOSIUM ON DISCRETE ALGORITHMS, P222
[8]  
Hagerup T, 2000, LECT NOTES COMPUT SC, V1853, P61
[9]   EFFICIENT ALGORITHMS FOR SHORTEST PATHS IN SPARSE NETWORKS [J].
JOHNSON, DB .
JOURNAL OF THE ACM, 1977, 24 (01) :1-13
[10]   FINDING THE HIDDEN PATH - TIME-BOUNDS FOR ALL-PAIRS SHORTEST PATHS [J].
KARGER, DR ;
KOLLER, D ;
PHILLIPS, SJ .
SIAM JOURNAL ON COMPUTING, 1993, 22 (06) :1199-1217