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 $G$ with $O(1)$ query time, the classical quadratic-time dynamic program can compute the Fr\'{e}chet distance between two walks $P$ and $Q$ in a graph $G$ in $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 $G$ is planar, we apply existing (approximate) distance oracles to compute a $(1+\varepsilon)$-approximation of the Fr\'{e}chet distance between any shortest path $P$ and any walk $Q$ in $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+\varepsilon)$-approximation between a $\kappa$-straight path $P$ and any walk $Q$ in $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 $G$. 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.01$-approximation, between arbitrary \emph{paths} in a weighted planar graph cannot be computed in $O((|P|\cdot|Q|)^{1-\delta})$ time for any $\delta > 0$ unless the Orthogonal Vector Hypothesis fails. For walks, this lower bound holds even when $G$ is planar, unit-weight and has $O(1)$ vertices.
翻译:Fr\'{e}chet 距离是整个计算机科学中广泛使用的曲线之间的一种非常相似的度量 {crt-time-treater}。在应用中,曲线来自路径,在基本图形(如道路网络)上行走,我们定义和研究路径和图中行走的距离。当提供G$的距离或奥元,我们用现有的(近)距离来计算$(1美元查询时间),典型的二次时间动态程序可以计算两条行程之间的距离 r\{{{e}我们走的距离,以美元平方美元计算。我们用美元计算最短的路程之间的距离,以美元计算,以美元计算更近的(G}\cdoro_echrach) 距离。我们使用现有的(近) 距离来计算(light) 美元(lation- prqlation) 。我们用最短的路程的($美元) 和任何美元走的(美元 美元 显示时间(x) 美元) 显示我们一般的(x(x) 美元) 美元 和美元 美元 美元 显示。