Improving The Floyd-Warshall All Pairs Shortest Paths Algorithm

09/04/2021
by   Ismail H. Toroslu, et al.
0

The Floyd-Warshall algorithm is the most popular algorithm for determining the shortest paths between all pairs in a graph. It is very a simple and an elegant algorithm. However, if the graph does not contain any negative weighted edge, using Dijkstra's shortest path algorithm for every vertex as a source vertex to produce all pairs shortest paths of the graph works much better than the Floyd-Warshall algorithm for sparse graphs. Also, for the graphs with negative weighted edges, with no negative cycle, Johnson's algorithm still performs significantly better than the Floyd-Warshall algorithm for sparse graphs. Johnson's algorithm transforms the graph into a non-negative one by using the Bellman-Ford algorithm, then, applies the Dijkstra's algorithm. Thus, in general the Floyd-Warshall algorithm becomes very inefficient especially for sparse graphs. In this paper, we show a simple improvement on the Floyd-Warshall algorithm that will increases its performance especially for the sparse graphs, so it can be used instead of more complicated alternatives.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
10/18/2018

New and Simplified Distributed Algorithms for Weighted All Pairs Shortest Paths

We consider the problem of computing all pairs shortest paths (APSP) and...
research
01/18/2014

Computing All-Pairs Shortest Paths by Leveraging Low Treewidth

We present two new and efficient algorithms for computing all-pairs shor...
research
04/18/2023

A New Deterministic Algorithm for Fully Dynamic All-Pairs Shortest Paths

We study the fully dynamic All-Pairs Shortest Paths (APSP) problem in un...
research
12/24/2020

A Generalized A* Algorithm for Finding Globally Optimal Paths in Weighted Colored Graphs

Both geometric and semantic information of the search space is imperativ...
research
07/11/2023

Distance-Preserving Graph Compression Techniques

We study the problem of distance-preserving graph compression for weight...
research
12/13/2021

Factorization and pseudofactorization of weighted graphs

For unweighted graphs, finding isometric embeddings is closely related t...
research
10/23/2017

Probabilistic Pursuits on Graphs

We consider discrete dynamical systems of "ant-like" agents engaged in a...

Please sign up or login with your details

Forgot password? Click here to reset