by lambo4bkfast · 3y ago · 0 comments
"Two textbook algorithms for SSSP are Bellman-Ford and Dijkstra’s algorithm. Dijkstra’s algorithm is near-linear time (O(m + n log n) time)"
This is incorrect; Dijkstra's Algorithm using a binary priority queue has: O((m + n)log n) time
https://en.m.wikipedia.org/wiki/Dijkstra%27s_algorithm#CITER...
This is because there are much fewer heap.decrease_key operations on average than Dijkstra's worst case analysis suggests. The expected number of heap.decrease_key operations is not large enough to offset the loss in average runtime for the heap.delete_min operation.