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.
翻译:本文描述了加权图中的最短路径问题,并比较了使用Fibonacci堆、二叉堆和自平衡二叉树实现Dijkstra算法效率的差异。通过使用C++实现这些算法的变体,我们发现最快的方法不总是具有最低的渐近复杂度。本文讨论了原因并提供了实证证据。