4 ms·
Johnson's algorithm appears to run Bellman–Ford as a sub-routine. At that point you are already spending |V||E| time, so you are not getting anywhere close to
by thomasahle 3y ago
Johnson's algorithm appears to run Bellman–Ford as a sub-routine.
At that point you are already spending |V||E| time, so you are not getting anywhere close to the performance of Dijkstra and the new algorithm.
But I guess you are saying that this preprocessing is OK if you need to run many single-source-shortest-path queries on the graph.