计算机科学 ›› 2014, Vol. 41 ›› Issue (6): 180-184.doi: 10.11896/j.issn.1002-137X.2014.06.035

• 人工智能 • 上一篇    下一篇

SPFA算法的分析及改进

夏正冬,卜天明,张居阳   

  1. 华东师范大学上海市可信重点实验室 上海200062;华东师范大学上海市可信重点实验室 上海200062;华东师范大学上海市可信重点实验室 上海200062
  • 出版日期:2018-11-14 发布日期:2018-11-14
  • 基金资助:
    本文受国家自然基金青年基金(61003068)和华东师范大学科研创新基金资助

Analysis and Improvement of SPFA Algorithm

XIA Zheng-dong,BU Tian-ming and ZHANG Ju-yang   

  • Online:2018-11-14 Published:2018-11-14

摘要: SPFA(Shortest Path Faster Algorithm)算法是一种对任意有向图求单源最短路径的算法。该算法实现简单,实际运行效果较好,在国内有着比较大的影响力。但遗憾的是,该算法一直缺少正确的理论分析。对该算法进行了分析,指出该算法在不存在源点可达负圈的有向图中,最坏情况运行时间为Θ(|V||E|);在存在源点可达负圈的有向图中,算法将无限运行下去。对此,给出了改进的SPFA算法,对于任意的有向图,该算法能够在O(|V||E|)内运行完毕。最后,从实际运行角度将SPFA算法与其它思想上同源的最短路径算法进行了一系列比较。

关键词: 组合算法,单源最短路径,SPFA算法,Bellman-Ford算法 中图法分类号TP312文献标识码A

Abstract: SPFA (Shortest Path Faster Algorithm) algorithm is a kind of single-source shortest path algorithm for digraphs.Because its easy implementation and good performance,SPFA has a large influence in the Domestic.But unfortunately,it lacks of correct theoretical analysis.This paper analysed this algorithm both in theoretical and experimental.The paper pointed out that the worst-case running time of SPFA algorithm is Θ(|V||E|) in the case of digraphs with no negative-weight cycle reachable from the source.In the case of digraphs with negative-weight cycle reachable from the source,the algorithm will run indefinitely.This paper then revisesd the algorithm so that it is O(|V||E|) for any digraphs.Finally,this paper compared SPFA in experiment with other shortest path algorithms which are based on the same idea.

Key words: Combinational algorithm,Single-source shortest paths,SPFA algorithm,Bellman-Ford algorithm

[1] 段凡丁.关于最短路径的SPFA快速算法[J].西南交通大学学报,1994,29(2):207-212
[2] Cherkassky B V,Goldberg A V,Radzik T.Shortest paths algorithms:Theory and experimental evalutation [J].Mathematical Programming,1996,73(2):129-174
[3] 姜碧野.SPFA的优化与应用[C]∥国家集训队2009年论文集.2009
[4] Cormen T H,Leiserson C E,Rivest R L,et al.Introduction to Algorithms(Third Edition) [M].MIT Press,Cambridge,MA,2009:651-655
[5] Chen Z L,Powell W B.A note on bertsekas’ small-label-firststrategy [J].Networks,1997,29:111-116

No related articles found!
Viewed
Full text


Abstract

Cited

  Shared   
  Discussed   
No Suggested Reading articles found!