The Fréchet Distance Unleashed: Approximating a Dog with a Frog
We show that a variant of the continuous Frechet distance between polygonal curves can be computed using essentially the same algorithm used to solve the discrete version. The new variant is not necessarily monotone, but this shortcoming can be easily handled via refinement. Combined with a Dijkstra/Prim type algorithm, this leads to a realization of the Frechet distance (i.e., a morphing) that is locally optimal (aka locally correct), that is both easy to compute, and in practice, takes near linear time on many inputs. The new morphing has the property that the leash is always as short as possible. These matchings/morphings are more natural and are better than the ones computed by standard algorithms -- in particular, they handle noise more graciously. This approach should make the Frechet distance more useful for real-world applications. We implemented the new algorithm and various strategies to obtain reasonably fast practical performance. We performed extensive experiments on our new algorithm, and released publicly available (and easily installable and usable) Julia and Python packages. Our algorithms can be used to compute the almost-exact Frechet distance between polygonal curves. Implementations and numerous examples are available here: https://frechet.xyz. We emphasize, however, that the existing state-of-the-art algorithm/implementation in C++ is faster, by several orders of magnitude, than our current algorithm/implementation.