The Discrete Fréchet Distance with Shortcuts via Approximate Distance Counting and Selection Techniques

Rinat Ben Avraham, Omrit Filtser, Haim Kaplan, Matthew J. Katz, Micha SharirarXiv 2013 · arXiv · OpenReview

Abstract

The \emph{Fr'echet distance} is a well studied similarity measures between curves. The \emph{discrete Fr'echet distance} is an analogous similarity measure, defined for a sequence $A$ of $m$ points and a sequence $B$ of $n$ points, where the points are usually sampled from input curves. In this paper we consider a variant, called the \emph{discrete Fr'echet distance with shortcuts}, which captures the similarity between (sampled) curves in the presence of outliers. For the \emph{two-sided} case, where shortcuts are allowed in both curves, we give an $O((m^{2/3}n^{2/3}+m+n)\log^3 (m+n))$-time algorithm for computing this distance. When shortcuts are allowed only in one noise-containing curve, we give an even faster randomized algorithm that runs in $O((m+n)^{6/5+\varepsilon})$ expected time, for any $\varepsilon>0$. Our techniques are novel and may find further applications. One of the main new technical results is: Given two sets of points $A$ and $B$ and an interval $I$, we develop an algorithm that decides whether the number of pairs $(x,y)\in A\times B$ whose distance ${\rm dist}(x,y)$ is in $I$, is less than some given threshold $L$. The running time of this algorithm decreases as $L$ increases. In case there are more than $L$ pairs of points whose distance is in $I$, we can get a small sample of pairs that contains a pair at approximate median distance (i.e., we can approximately "bisect" $I$). We combine this procedure with additional ideas to search, with a small overhead, for the optimal one-sided Fr'echet distance with shortcuts, using a very fast decision procedure. We also show how to apply this technique for approximating distance selection (with respect to rank), and for computing the semi-continuous Fr'echet distance with one-sided shortcuts.

Introduction

The Fréchet distance is often described as the "dog-on-a-leash" metric: it measures the minimum leash length needed for a person and a dog to traverse two separate curves from start to finish without backtracking. While powerful, the standard Fréchet distance is notoriously sensitive to outliers. A single noisy GPS coordinate can blow up the distance between two otherwise identical trajectories.

To handle noise, researchers introduced "shortcuts," allowing one or both "frogs" (the discrete version of the person and dog) to skip points. However, computing this has historically been difficult. The decision problem (is the distance $\le \delta$?) is often fast, but the optimization problem (what is the minimum $\delta$?) usually relies on "parametric search," which makes the algorithm significantly slower. This paper aims to close that gap and provide efficient, sub-quadratic solutions for one-sided, two-sided, and semi-continuous versions of the problem.

Methods

The authors move away from standard optimization techniques and instead develop a framework based on Approximate Distance Counting and Selection.

Fast Decision Procedures

For the one-sided case, the authors prove that a greedy "lowest upward-skipping path" in the distance matrix is sufficient to decide if a distance $\delta$ is feasible in $O(m+n)$ time. This path represents the sequence of points visited while allowing shortcuts in one curve.

Visualization of reachability paths in the distance matrix for (a) two-sided shortcuts, (b) one-sided shortcuts, and (c) semi-continuous shortcuts.

Interval Narrowing and Efficient Simulation

Instead of testing every possible pairwise distance, the algorithm uses a randomized approach involving hierarchical cuttings (a geometric data structure) to find a narrow interval $(\alpha, \beta]$ that contains the optimal distance and only a small number of other "critical" distances.

Detail of the greedy 'lowest upward-skipping path' for the one-sided shortcut variant.

They then simulate the decision procedure within this narrow interval. By using a "bifurcation tree" to track different possible execution paths of the decision algorithm, they can resolve multiple unknown distances simultaneously using binary search. For the two-sided case, where both curves can skip points, they use an implicit compact representation of point pairs (disjoint unions of complete bipartite cliques) to maintain reachability efficiently.

Key Results

The paper delivers several breakthrough complexity bounds:

  • One-sided Discrete Shortcuts: $O((m + n)^{6/5+\epsilon})$ expected time. This is a major improvement over the $O(mn)$ (quadratic) time typically expected for Fréchet problems.
  • Two-sided Discrete Shortcuts: $O((m^{2/3}n^{2/3} + m + n) \log^3(m + n))$ time.
  • Semi-continuous Shortcuts: $O((m+n)^{2/3}m^{2/3}n^{1/3} \log(m+n))$ time.
  • Approximate Distance Selection: The technique can find a distance of a specific rank (e.g., the $k$-th smallest distance) much faster than previous exact methods if a small amount of error in the rank is acceptable.

Conclusion

The most significant contribution is the realization that the full machinery of parametric search is unnecessary if the decision procedure is sufficiently fast. By narrowing the search space to a small set of candidate distances using geometric cuttings and random sampling, the optimum can be found much more quickly.

While the fastest one-sided algorithm is randomized, it provides a robust framework for curve similarity in the presence of noise. Future work may involve extending these techniques to the fully continuous Fréchet distance with shortcuts, which remains a challenging open problem, potentially using these methods as a stepping stone toward better approximation algorithms.

Summary updated

Abstract

The \emph{Fr\'echet distance} is a well studied similarity measures between curves. The \emph{discrete Fr\'echet distance} is an analogous similarity measure, defined for a sequence $A$ of $m$ points and a sequence $B$ of $n$ points, where the points are usually sampled from input curves. In this paper we consider a variant, called the \emph{discrete Fr\'echet distance with shortcuts}, which captures the similarity between (sampled) curves in the presence of outliers. For the \emph{two-sided} case, where shortcuts are allowed in both curves, we give an $O((m^{2/3}n^{2/3}+m+n)\log^3 (m+n))$-time algorithm for computing this distance. When shortcuts are allowed only in one noise-containing curve, we give an even faster randomized algorithm that runs in $O((m+n)^{6/5+\varepsilon})$ expected time, for any $\varepsilon>0$. Our techniques are novel and may find further applications. One of the main new technical results is: Given two sets of points $A$ and $B$ and an interval $I$, we develop an algorithm that decides whether the number of pairs $(x,y)\in A\times B$ whose distance ${\rm dist}(x,y)$ is in $I$, is less than some given threshold $L$. The running time of this algorithm decreases as $L$ increases. In case there are more than $L$ pairs of points whose distance is in $I$, we can get a small sample of pairs that contains a pair at approximate median distance (i.e., we can approximately "bisect" $I$). We combine this procedure with additional ideas to search, with a small overhead, for the optimal one-sided Fr\'echet distance with shortcuts, using a very fast decision procedure. We also show how to apply this technique for approximating distance selection (with respect to rank), and for computing the semi-continuous Fr\'echet distance with one-sided shortcuts.
BibTeX
@misc{avraham2013discrete,
  author = {Rinat Ben Avraham and Omrit Filtser and Haim Kaplan and Matthew J. Katz and Micha Sharir},
  title = {{The Discrete Fréchet Distance with Shortcuts via Approximate Distance Counting and Selection Techniques}},
  year = {2013},
  eprint = {1310.5245},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1310.5245},
}
Figure