All pairs shortest paths: Difference between revisions

From Algowiki
Jump to navigation Jump to search
Line 14: Line 14:
# [[Floyd-Warshall]]
# [[Floyd-Warshall]]
# [[Bellman-Ford]]
# [[Bellman-Ford]]
# [[Shortest paths by repeated squaring]] (varian of Bellman-Ford)
# [[Shortest paths by repeated squaring]] (variant of Bellman-Ford)

Revision as of 04:39, 22 October 2014

Input

  1. A directed graph [math]\displaystyle{ G = (V,A) }[/math]
  2. An arc length [math]\displaystyle{ l(a) \in \mathbb{R} }[/math] for each arc [math]\displaystyle{ a \in A }[/math]

Ouptut

For each pair [math]\displaystyle{ (v,w) \in A }[/math] with [math]\displaystyle{ v,w \in V }[/math], the length [math]\displaystyle{ \Delta(v,w) }[/math] of a shortest [math]\displaystyle{ (v,w) }[/math]-path in [math]\displaystyle{ G }[/math] with respect to [math]\displaystyle{ l }[/math].

Complexity

Polynomial

Known algorithms

  1. Floyd-Warshall
  2. Bellman-Ford
  3. Shortest paths by repeated squaring (variant of Bellman-Ford)