The Floyd-Warshall Algorithm Re-implemented Using 3D-Tensors and Hardware Acceleration
Taher Anjary

TL;DR
This paper presents a GPU-accelerated implementation of the Floyd-Warshall algorithm and R-Kleene for solving the all-pairs shortest path problem, demonstrating significant speedups over traditional CPU-based methods.
Contribution
It introduces a novel GPU-based implementation of Floyd-Warshall using PyTorch, along with a recursive R-Kleene algorithm and a flexible graph generator for performance evaluation.
Findings
GPU implementations outperform NetworkX in runtime
R-Kleene shows competitive performance on large graphs
Open-source code facilitates further research and benchmarking
Abstract
The Floyd-Warshall(FW) algorithm, is an ancient but a largely important algorithm used to solve the all-pairs simple-paths(APSP) problem. While the algorithm is available for use in open-source graph optimization libraries such as NetworkX, they do not take advantage of modern parallel processing hardware such as Graphics Processing Units(GPUs), which would reduce compute time to a fraction of its iterative or recursive implementations. In this work, a re-implementation of the Floyd-Warshall algorithm using open-source GPU libraries such as PyTorch is presented. A further implementation of the R-Kleene is also described, a slightly newer algorithm used for solving the APSP problem in a divide-and-conquer, recursive but highly parallelized architecture. In addition, a random graph generator that generates a wide range of graphs of different scales is also contributed, where the densities…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsParallel Computing and Optimization Techniques · Computational Physics and Python Applications · Tensor decomposition and applications
