{"title":"Modifications of the Floyd-Warshall algorithm with nearly quadratic expected-time","authors":"A. Brodnik, Marko Grgurovic, Rok Požar","doi":"10.26493/1855-3974.2467.497","DOIUrl":null,"url":null,"abstract":"The paper describes two relatively simple modifications of the well-known FloydWarshall 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 log 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. ∗A preliminary version of this work has been published in Shortest Path Solvers: From Software to Wetware, volume 32 of Emergence, Complexity and Computation (2018). The authors would like to thank the reviewer for excellent comments that substantially improved the quality of the paper. †This work is sponsored in part by the Slovenian Research Agency (research program P2-0359 and research projects J1-2481, J2-2504, and N2-0171). ‡Corresponding author. This work is supported in part by the Slovenian Research Agency (research program P1-0285 and research projects N1-0062, J1-9110, J1-9187, J1-1694, N1-0159, J1-2451). cb This work is licensed under https://creativecommons.org/licenses/by/4.0/ Ac ce pt ed m an us cr ip t 2 Ars Math. Contemp.","PeriodicalId":8402,"journal":{"name":"Ars Math. Contemp.","volume":"26 1","pages":"1"},"PeriodicalIF":0.0000,"publicationDate":"2021-04-13","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"3","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Ars Math. Contemp.","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.26493/1855-3974.2467.497","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 3
Abstract
The paper describes two relatively simple modifications of the well-known FloydWarshall 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 log 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. ∗A preliminary version of this work has been published in Shortest Path Solvers: From Software to Wetware, volume 32 of Emergence, Complexity and Computation (2018). The authors would like to thank the reviewer for excellent comments that substantially improved the quality of the paper. †This work is sponsored in part by the Slovenian Research Agency (research program P2-0359 and research projects J1-2481, J2-2504, and N2-0171). ‡Corresponding author. This work is supported in part by the Slovenian Research Agency (research program P1-0285 and research projects N1-0062, J1-9110, J1-9187, J1-1694, N1-0159, J1-2451). cb This work is licensed under https://creativecommons.org/licenses/by/4.0/ Ac ce pt ed m an us cr ip t 2 Ars Math. Contemp.