Performance

FrechetDist against the other implementations, on real curves, one thread unless said otherwise; the linked sections give the setup, the full tables and how to rerun them.

ProblemAgainstResultDetails
Deciding (is the distance at most r?)BKN's C++ decider1.2 to 2.5 times as fast on 8 of 13 sets of curves, about as fast on 4, slower on Berlin (by 4 to 30%), whose tiny curves are decided in tens of nanoseconds; its C++ port is faster on all 13, by 1.1 to 2.7 times (three machines)The decider against the C++ code of Bringmann, Künnemann and Nusser
The distance, by bisectionBKN's distance; CGALabout as fast as BKN's (faster on three sets, slower on the tiny curves of UniD); significantly faster than CGALThe distance: against BKN and CGAL
The exact distancethe frog code11 to 12 times fasterThe frog benchmark
The exact distance, high dimensionsFred81 and 158 times faster on 16 threads, on curves in ℝ^963 and ℝ^19200; Fred returns distances up to 1.3% too low for 5 of the 55 pairsHigh-dimensional curves: comparison with Fred

The speedup over BKN per set and machine

The speedup of the decision procedure over BKN's decider (their time over ours), per set and machine; the grey band is within 10%. Left: the decider ported to C++ and built into one program with BKN's; right: the Julia package. Berlin and UniD are left out (their 800 queries take under 0.2 ms in all).

The older frechet_c_compute (a relative tolerance, with a matching that realizes the distance) can be catastrophically slow: on example 35 of the gallery, two zig-zags of 15 and 16 vertices, it takes about 16 minutes and 10 GB of memory, against under a millisecond for frechet_c_compute_exact. Use frechet_c_compute_bisect or frechet_c_compute_exact instead.

The other implementations

  • BKN (C++): the decider and the distance of K. Bringmann, M. Künnemann and A. Nusser, Walking the Dog Fast in Practice: Algorithm Engineering of the Fréchet Distance (SoCG 2019).
  • The frog code (C++): the exact distance of J. Conradi, I. van der Hoog and E. Rotenberg, On computing the (exact) Fréchet distance with a frog (SoCG 2026, arXiv 2512.07728).
  • CGAL dD Fréchet Distance (C++): the decision procedure and the distance with certified bounds.
  • Fred (Python, with a C++ core; source): the distance and clustering of curves, in any dimension.

Reproducing the benchmarks tells how to rerun every comparison.