Modifications of the Floyd-Warshall algorithm with nearly quadratic expected-time - Brodnik, Andrej (Ars mathematica contemporanea, 2022)
The paper describes two relatively simple modifications of the well-known Floyd-Warshall algorithm for computing all-pairs shortest paths. A fundamental difference of both modifications in comparison to the Floyd-Warshall algorithm is that the relaxation is done in a smart way. We show that the expected-case time complexity of both algorithms is ?$O(n^2\log^2 n)$? for the class of complete directed graphs on ?$n$? vertices with arc weights selected independently at random from the uniform distribution on ?$0,1$?. Theoretically best known algorithms for this class of graphs are all based on Dijkstra's algorithm and obtain a better expected-case bound. However, by conducting an empirical evaluation we prove that our algorithms are at least competitive in practice with best know algorithms and, moreover, outperform most of them. The reason for the practical efficiency of the presented algorithms is the absence of use of priority queue.
Keywords: all-pairs shortest paths; Floyd-Warshall algorithm; Floyd-Warshallov algoritem; najkrajše poti med vsemi pari vozlišč; probabilistic analysis; verjetnostna analiza