Johnson's algorithm: Difference between revisions

Content deleted Content added
Algorithm description: split section
Line 13:
#Finally, {{math|''q''}} is removed, and [[Dijkstra's algorithm]] is used to find the shortest paths from each node {{math|''s''}} to every other vertex in the reweighted graph.
 
==Correctness==
In the reweighted graph, all paths between a pair {{math|''s''}} and {{math|''t''}} of nodes have the same quantity {{math|''h(s)'' − ''h(t)''}} added to them. The previous statement can be proven as follows: Let p be an s-t path. It's weight W in the reweighted graph is given by the following expression: