Johnson's algorithm - Wikipedia
en.wikipedia.org › wiki › Johnson&Johnson's algorithm is a way to find the shortest paths between all pairs of vertices in an edge-weighted directed graph. It allows some of the edge weights to be negative numbers, but no negative-weight cycles may exist. It works by using the Bellman–Ford algorithm to compute a transformation of the input graph that removes all negative weights, allowing Dijkstra's algorithm to be used on the transformed graph. It is named after Donald B. Johnson, who first published the technique in 1977 ...
Johnson's Algorithm | Brilliant Math & Science Wiki
brilliant.org › wiki › johnsons-algorithmJun 02, 2016 · It is interesting to note that Johnson's algorithm can support negative weight graphs because one of its subroutines, Dijkstra's algorithm, cannot. Johnson's algorithm has three main steps. A new vertex is added to the graph, and it is connected by edges of zero weight to all other vertices in the graph. All edges go through a reweighting process that eliminates negative weight edges. The added vertex from step 1 is removed and Dijkstra's algorithm is run on every node in the graph.