The Floyd‐Warshall all‐pairs shortest paths algorithm for disconnected and very sparse graphs

Floyd–Warshall算法 最短路径问题 Dijkstra算法 Suurballe算法 算法 最短路径快速算法 计算机科学 顶点(图论) 组合数学 数学 图形
作者
İsmail Hakkı Toroslu
出处
期刊:Software - Practice and Experience [Wiley]
卷期号:53 (6): 1287-1303 被引量:16
标识
DOI:10.1002/spe.3188
摘要

Abstract The Floyd‐Warshall algorithm is the most popular algorithm for determining the shortest paths between all vertex pairs in a graph. It is a very simple and an elegant algorithm. However, for graphs without any negative weighted edges, using Dijkstra's shortest path algorithm for every vertex as a source vertex to produce all‐pairs shortest paths works significantly better than the Floyd‐Warshall algorithm, especially for large graphs. Furthermore, for graphs with negative weighted edges, with no negative cycle, in general Johnson's algorithm also performs better than the Floyd‐Warshall algorithm for large graphs. Johnson's algorithm first transforms the graph into a non‐negative one by using the Bellman‐Ford algorithm, then applies the Dijkstra's algorithm to the transformed graph. Thus, mainly, the Floyd‐Warshall algorithm is quite inefficient, especially for large graphs. In this paper, we show a simple improvement on the Floyd‐Warshall algorithm that will increases its efficiency, especially for very sparse graphs (i.e., the number of its edges is less than the number of its vertices), so it can be used instead of more complicated alternatives. We also show that our approach is also very effective for denser disconnected graphs. Since the new algorithm modifies the original Floyd‐Warshall algorithm, it is mainly aimed for directed graphs without negative cycles. Most programmers prefer to implement the Floyd‐Warshall algorithm over more complicated but more efficient alternatives for solving all‐pairs shortest path problems. In this work, we show that without the addition of any complicated data structures, the performance of the Floyd‐Warshall algorithm can be improved very easily. Our practical approach works even better than its alternatives for large sparse graphs.
最长约 10秒,即可获得该文献文件

科研通智能强力驱动
Strongly Powered by AbleSci AI
科研通是完全免费的文献互助平台,具备全网最快的应助速度,最高的求助完成率。 对每一个文献求助,科研通都将尽心尽力,给求助人一个满意的交代。
实时播报
1秒前
Lincoln完成签到,获得积分10
1秒前
wuwu完成签到,获得积分10
1秒前
漫天飞雪_寒江孤影完成签到 ,获得积分10
2秒前
沐偶完成签到,获得积分10
4秒前
meng完成签到,获得积分10
5秒前
RT发布了新的文献求助10
5秒前
5秒前
笨笨问儿完成签到 ,获得积分10
8秒前
缓慢怜菡完成签到,获得积分0
9秒前
诚心天晴完成签到 ,获得积分10
10秒前
三伏天发布了新的文献求助10
12秒前
好好完成签到,获得积分10
12秒前
彩色完成签到,获得积分10
13秒前
fx完成签到,获得积分10
16秒前
合适的自行车完成签到 ,获得积分10
17秒前
Haonan完成签到,获得积分0
18秒前
Cx330完成签到,获得积分10
18秒前
yoga完成签到,获得积分10
18秒前
温婉的采蓝完成签到 ,获得积分10
19秒前
孤独的渊思完成签到,获得积分20
19秒前
wawaeryu完成签到,获得积分0
19秒前
粗心的逍遥完成签到 ,获得积分10
20秒前
王倩的老公完成签到 ,获得积分10
20秒前
21秒前
斯文若云完成签到 ,获得积分10
22秒前
ZWX完成签到 ,获得积分10
22秒前
青蛙在自由泳完成签到,获得积分10
22秒前
yu完成签到,获得积分10
25秒前
兼听则明完成签到,获得积分10
26秒前
27秒前
qianshui发布了新的文献求助10
28秒前
WTX完成签到,获得积分10
28秒前
29秒前
monica完成签到 ,获得积分10
30秒前
30秒前
甜蜜的手套完成签到,获得积分10
31秒前
31秒前
圆溜溜溜溜圆完成签到,获得积分10
31秒前
年轻的纲完成签到 ,获得积分10
32秒前
高分求助中
Markov Chain Monte Carlo 10000
(应助此贴封号)【重要!!请各用户(尤其是新用户)详细阅读】【科研通的精品贴汇总】 10000
Common Foundations of American and East Asian Modernisation: From Alexander Hamilton to Junichero Koizumi 5000
Pediatric Dermoscopy Trichoscopy & Onychoscopy 1000
悉尼大学博士学位论文,题目:Modelling and testing of one-sided stitched laminated composites. 作者:Kristopher P. Plain 700
Matrix Methods in Data Mining and Pattern Recognition Second Edition 610
International Security Studies and Technology :Approaches, Assessments, and Frontiers 500
热门求助领域 (近24小时)
化学 材料科学 医学 生物 纳米技术 工程类 有机化学 化学工程 生物化学 计算机科学 内科学 物理 复合材料 催化作用 细胞生物学 无机化学 光电子学 物理化学 电极 基因
热门帖子
关注 科研通微信公众号,转发送积分 7572612
求助须知:如何正确求助?哪些是违规求助? 9151884
关于积分的说明 19573353
捐赠科研通 7157042
什么是DOI,文献DOI怎么找? 3264091
关于科研通互助平台的介绍 2429517
邀请新用户注册赠送积分活动 2254370