# Incorrect implementations of the Floyd--Warshall algorithm give correct   solutions after three repeats

**Authors:** Ikumi Hide, Soh Kumabe, Takanori Maehara

arXiv: 1904.01210 · 2019-04-03

## TL;DR

This paper demonstrates that certain incorrect implementations of the Floyd--Warshall algorithm, which misorder the nested loops, still produce correct shortest path solutions after three repetitions.

## Contribution

It reveals that loop misordering in Floyd--Warshall can be corrected by repeating the algorithm three times, providing insight into implementation robustness.

## Key findings

- Incorrect loop orderings yield correct results after three repetitions
- Repetition fixes errors caused by misordering loops
- Highlights potential for simplified implementations

## Abstract

The Floyd--Warshall algorithm is a well-known algorithm for the all-pairs shortest path problem that is simply implemented by triply nested loops. In this study, we show that the incorrect implementations of the Floyd--Warshall algorithm that misorder the triply nested loops give correct solutions if these are repeated three times.

## Full text

_Full body text omitted from this summary view._ Fetch the complete paper as Markdown: https://tomesphere.com/paper/1904.01210/full.md

## Figures

2 figures with captions in the complete paper: https://tomesphere.com/paper/1904.01210/full.md

## References

2 references — full list in the complete paper: https://tomesphere.com/paper/1904.01210/full.md

---
Source: https://tomesphere.com/paper/1904.01210