This paper describes the shortest path problem in weighted graphs and examines the differences in efficiency that occur when using Dijkstra's algorithm with a Fibonacci heap, binary heap, and self-balancing binary tree. Using C++ implementations of these algorithm variants, we find that the fastest method is not always the one that has the lowest asymptotic complexity. Reasons for this are discussed and backed with empirical evidence.
翻译:本文描述了加权图中的最短路径问题,并考察了使用斐波那契堆、二叉堆和自平衡二叉树实现Dijkstra算法时出现的效率差异。通过采用这些算法变体的C++实现,我们发现最快的方法并非总是渐近复杂度最低的方法。本文讨论了其中的原因,并辅以实证证据支持。