English

Walking Your Frog Fast in 4 LoC

Computational Geometry 2024-04-09 v1

Abstract

Given two polygonal curves, there are many ways to define a notion of similarity between them. One popular measure is the Fr\'echet distance which has many desirable properties but is notoriously expensive to calculate, especially for non-trivial metrics. In 1994, Eiter and Mannila introduced the discrete Fr\'echet distance which is much easier to implement and approximates the continuous Fr\'echet distance with a quadratic runtime overhead. However, this algorithm relies on recursions and is not well suited for modern hardware. To that end, we introduce the Fast Fr\'echet Distance algorithm, a recursion-free algorithm that calculates the discrete Fr\'echet distance with a linear memory overhead and that can utilize modern hardware more effectively. We showcase an implementation with only four lines of code and present benchmarks of our algorithm running fast on modern CPUs and GPGPUs.

Keywords

Cite

@article{arxiv.2404.05708,
  title  = {Walking Your Frog Fast in 4 LoC},
  author = {Nis Meinert},
  journal= {arXiv preprint arXiv:2404.05708},
  year   = {2024}
}

Comments

22 pages, 8 figures, a lot of fun

R2 v1 2026-06-28T15:47:50.554Z