English

On the Discrete Fr\'echet Distance in a Graph

Computational Geometry 2024-11-20 v2

Abstract

The Fr\'{e}chet distance is a well-studied similarity measure between curves that is widely used throughout computer science. Motivated by applications where curves stem from paths and walks on an underlying graph (such as a road network), we define and study the Fr\'{e}chet distance for paths and walks on graphs. When provided with a distance oracle of GG with O(1)O(1) query time, the classical quadratic-time dynamic program can compute the Fr\'{e}chet distance between two walks PP and QQ in a graph GG in O(PQ)O(|P| \cdot |Q|) time. We show that there are situations where the graph structure helps with computing Fr\'{e}chet distance: when the graph GG is planar, we apply existing (approximate) distance oracles to compute a (1+ε)(1+\varepsilon)-approximation of the Fr\'{e}chet distance between any shortest path PP and any walk QQ in O(GlogG/ε+P+Qε)O(|G| \log |G| / \sqrt{\varepsilon} + |P| + \frac{|Q|}{\varepsilon } ) time. We generalise this result to near-shortest paths, i.e. κ\kappa-straight paths, as we show how to compute a (1+ε)(1+\varepsilon)-approximation between a κ\kappa-straight path PP and any walk QQ in O(GlogG/ε+P+κQε)O(|G| \log |G| / \sqrt{\varepsilon} + |P| + \frac{\kappa|Q|}{\varepsilon } ) time. Our algorithmic results hold for both the strong and the weak discrete Fr\'{e}chet distance over the shortest path metric in GG. Finally, we show that additional assumptions on the input, such as our assumption on path straightness, are indeed necessary to obtain truly subquadratic running time. We provide a conditional lower bound showing that the Fr\'{e}chet distance, or even its 1.011.01-approximation, between arbitrary \emph{paths} in a weighted planar graph cannot be computed in O((PQ)1δ)O((|P|\cdot|Q|)^{1-\delta}) time for any δ>0\delta > 0 unless the Orthogonal Vector Hypothesis fails. For walks, this lower bound holds even when GG is planar, unit-weight and has O(1)O(1) vertices.

Keywords

Cite

@article{arxiv.2201.02121,
  title  = {On the Discrete Fr\'echet Distance in a Graph},
  author = {Anne Driemel and Ivor van der Hoog and Eva Rotenberg},
  journal= {arXiv preprint arXiv:2201.02121},
  year   = {2024}
}
R2 v1 2026-06-24T08:42:03.518Z