Dijkstra's Algorithm: O(m + n \log n)
A* Algorithm: h(u) \leq \delta(u, v) + h(v), h(v) \leq \delta(v, t) (optional), h(t) = 0
Bellman-Ford: O(mn\log n) work, O(n \log n) span with table, O(mn) work and O(n \log n) span with sequence
BFS: O(d\log n) span and O(m+n) work
DFS: tree-based O((m+n)\log n), array sequence and adjacency sequences O(m+n)
SCC (G = (V, E)) = let
F = decreasingFinish G
G^T = transpose G
SCCOne ((X, comps), v) = let
(X', comp) = DFSReach G^T (X, v)
in
(X', comp::comps) (* here: you can check for empty comp if you want *)
end
in
iterate SCCOne ({}, []) F
end
The overall number of comparison is
Table of Content