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.
翻译:我们证明,多边形曲线之间连续弗雷歇距离的一种变体,可以使用与求解离散版本基本相同的算法来计算。这种新变体不一定是单调的,但这一缺点可以通过细化轻松处理。结合Dijkstra/Prim类型算法,这导致了一种局部最优(又称局部正确)的弗雷歇距离实现(即形态变换),该实现不仅易于计算,而且在实践中对许多输入耗时接近线性。新形态变换具有牵线始终尽可能短的特性。这些匹配/形态变换比标准算法计算的结果更自然、更优——特别是它们能更优雅地处理噪声。该方法应能使弗雷歇距离在现实世界应用中更具实用性。我们实现了新算法及多种策略,以获得合理的快速实际性能。我们对新算法进行了广泛实验,并发布了公开可用(且易于安装和使用)的Julia和Python软件包。我们的算法可用于计算多边形曲线之间的几乎精确弗雷歇距离。实现和大量示例可在此处获取:https://frechet.xyz。然而,我们强调,现有C++中的最先进算法/实现比我们当前的算法/实现快几个数量级。