{"title":"近似二次期望时间Floyd-Warshall算法的改进","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":null,"pages":null},"PeriodicalIF":0.0000,"publicationDate":"2021-04-13","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"3","resultStr":"{\"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\":null,\"pages\":null},\"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}","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
摘要
本文对众所周知的计算全对最短路径的FloydWarshall算法进行了两个相对简单的改进。与Floyd-Warshall算法相比,这两种修改的根本区别在于,松弛是以一种聪明的方式完成的。我们证明了这两种算法的期望情况时间复杂度都是O(n log n),对于有n个顶点的完全有向图,这些顶点的弧权值是从均匀分布[0,1]中随机独立选择的。理论上,这类图最著名的算法都是基于Dijkstra算法,并获得更好的期望情况界。然而,通过进行经验评估,我们证明了我们的算法在实践中至少与最知名的算法具有竞争力,而且表现优于大多数算法。所提出的算法的实际效率的原因是没有使用优先级队列。*这项工作的初步版本已发表在最短路径求解器:从软件到湿软件,涌现,复杂性和计算(2018)第32卷。作者要感谢审稿人的优秀意见,这大大提高了论文的质量。†这项工作部分由斯洛文尼亚研究机构赞助(研究计划P2-0359和研究项目J1-2481, J2-2504和N2-0171)。‡通讯作者。这项工作得到了斯洛文尼亚研究机构的部分支持(研究项目P1-0285和研究项目N1-0062、J1-9110、J1-9187、J1-1694、N1-0159、J1-2451)。本作品在https://creativecommons.org/licenses/by/4.0/下获得许可,并由2 Ars Math授权。一栏。
Modifications of the Floyd-Warshall algorithm with nearly quadratic expected-time
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.