Anarchy in the APSP: Algorithm and Hardness for Incorrect Implementation of Floyd-Warshall

Author Jaehyun Koo



PDF
Thumbnail PDF

File

LIPIcs.FUN.2024.19.pdf
  • Filesize: 0.74 MB
  • 11 pages

Document Identifiers

Author Details

Jaehyun Koo
  • MIT EECS and CSAIL, Cambridge, MA, USA

Cite AsGet BibTex

Jaehyun Koo. Anarchy in the APSP: Algorithm and Hardness for Incorrect Implementation of Floyd-Warshall. In 12th International Conference on Fun with Algorithms (FUN 2024). Leibniz International Proceedings in Informatics (LIPIcs), Volume 291, pp. 19:1-19:11, Schloss Dagstuhl – Leibniz-Zentrum für Informatik (2024)
https://doi.org/10.4230/LIPIcs.FUN.2024.19

Abstract

The celebrated Floyd-Warshall algorithm efficiently computes the all-pairs shortest path, and its simplicity made it a staple in computer science classes. Frequently, students discover a variant of this Floyd-Warshall algorithm by mixing up the loop order, ending up with the incorrect APSP matrix. This paper considers a computational problem of computing this incorrect APSP matrix. We will propose efficient algorithms for this problem and prove that this incorrect variant is APSP-complete.

Subject Classification

ACM Subject Classification
  • Theory of computation → Shortest paths
  • Theory of computation → Problems, reductions and completeness
Keywords
  • fine-grained complexity
  • recreational algorithms

Metrics

  • Access Statistics
  • Total Accesses (updated on a weekly basis)
    0
    PDF Downloads

References

  1. K. Bringmann, A. Cassis, and N. Fischer. Negative-weight single-source shortest paths in near-linear time: Now faster! In 2023 IEEE 64th Annual Symposium on Foundations of Computer Science (FOCS), pages 515-538, Los Alamitos, CA, USA, November 2023. IEEE Computer Society. URL: https://doi.org/10.1109/FOCS57990.2023.00038.
  2. Thomas H Cormen, Charles E Leiserson, Ronald L Rivest, and Clifford Stein. Introduction to algorithms. MIT press, 2022. Google Scholar
  3. Edsger W Dijkstra. A note on two problems in connexion with graphs. In Edsger Wybe Dijkstra: His Life, Work, and Legacy, pages 287-290. 2022. Google Scholar
  4. Robert W Floyd. Algorithm 97: shortest path. Communications of the ACM, 5(6):345, 1962. Google Scholar
  5. Michael L. Fredman and Robert Endre Tarjan. Fibonacci heaps and their uses in improved network optimization algorithms. J. ACM, 34(3):596-615, July 1987. URL: https://doi.org/10.1145/28869.28874.
  6. Stanley P. Y. Fung. Is this the simplest (and most surprising) sorting algorithm ever?, 2021. URL: https://arxiv.org/abs/2110.01111.
  7. Ikumi Hide, Soh Kumabe, and Takanori Maehara. Incorrect implementations of the floyd-warshall algorithm give correct solutions after three repeats, 2019. URL: https://arxiv.org/abs/1904.01210.
  8. Eric S Raymond. The new hacker’s dictionary. Mit Press, 1996. Google Scholar
  9. Stephen Warshall. A theorem on boolean matrices. J. ACM, 9(1):11-12, January 1962. URL: https://doi.org/10.1145/321105.321107.
  10. Virginia Vassilevska Williams and R. Ryan Williams. Subcubic equivalences between path, matrix, and triangle problems. J. ACM, 65(5), August 2018. URL: https://doi.org/10.1145/3186893.