Fréchet distance between two point sets

https://doi.org/10.1016/j.comgeo.2021.101842Get rights and content

Abstract

We define and study the Fréchet distance and the discrete Fréchet distance between two point sets in the plane. One problem based on the well-known Fréchet distance is to find a polygonal curve on a point set with small Fréchet distance or small discrete Fréchet distance to another given polygonal curve. Here, we consider two given point sets and ask if permutations of these point sets exist, such that the Fréchet distance or the discrete Fréchet distance of curves defined by the permutations is small.

Introduction

The Fréchet distance and the discrete Fréchet distance are a popular measure between two polygonal curves that takes the order of the points along the curves into account. Intuitively, the similarity of the shapes of the two curves is measured. In this paper, we want to measure the similarity between two point sets by asking if we can find an order of the points, such that the Fréchet distance or the discrete Fréchet distance between the polygonal curves on the point sets in this order is small. That is, we ask if the point sets can be ordered such that the resulting curves have a similar shape.

This is a natural problem within the Fréchet distance research that has not been considered yet, and there are some interesting applications for this. For instance, it can be used to detect similar linear formations between two groups where one group is represented by one point for each entity within the group. Or for two sets of GPS-positions of two entities for which the time component is missing, we want to determine if the positions can be ordered such that the entities were moving along a similar route. Especially for the discrete version, there are many curves on the point sets that realize a certain distance. Thus, we also discuss how to obtain curves with desirable properties such as small total length or a small number of crossings.

A polygonal curve is a curve P:[1,n]R2 where n is a positive integer, such that the restriction of P to the interval [i,i+1] is affine, that is P(i+λ)=(1λ)P(i)+λP(i+1), for each i{1,2,,n1}. We call {P(i)|i[1:n]} the vertex set of P. To measure the dissimilarity between two polygonal curves, we use the Fréchet distance [6] and the discrete Fréchet distance [12]. For two polygonal curves P,Q:[1,n]R2 and Q:[1,m]R2 their Fréchet distance is defined asδF(P,Q)=infα:[0,1][1,n]β:[0,1][1,m]maxt[0,1]||P(α(t))Q(β(t))||, where α (resp. β) ranges over all continuous non-decreasing onto mappings from [0,1] to [1,n] (resp. [1,m]).

The discrete Fréchet distance is typically defined by couplings. Let u(P) be the vertex set of P and v(Q) the vertex set of Q. A coupling L between P and Q is a sequence (ua1,vb1),(ua2,vb2),,(uaj,vbj) of distinct pairs from u(P)×v(Q) such that a1=1, b1=1, aj=n, bj=m, and for all i{1,2,,j} we have ai+1=ai or ai+1=ai+1 and bi+1=bi or bi+1=bi+1. The length of L is defined as maxid(uai,vbi), where d denotes the Euclidean distance between two points. The discrete Fréchet distance between P and Q equals the shortest possible length of a coupling between P and Q.

Typically, the Fréchet distance is illustrated by a man walking his dog. Here, the Fréchet distance equals the shortest length of a leash that allows the man and the dog to walk on their curves from beginning to end. To adapt this illustration for the discrete Fréchet distance, imagine two frogs jumping along the vertices of the polygonal curves, such that their maximum vertex-to-vertex distance during the traversal is minimized.

Now we define the Fréchet distance and the discrete Fréchet distance between point sets. For this, we use the same notation, δdF(S,R) and δF(S,R), as for the (discrete) Fréchet distance between two polygonal curves.

Definition 1

Given a point set SR2 of size |S|=n. A polygonal curve c(S) induced by the point set S is a polygonal curve with vertex set S. That is c(S) visits each point of S exactly once.

Definition 2

Let S,RR2 be two point sets of size |S|=n, |R|=m. We define the Fréchet distance and the discrete Fréchet distance between S and R as the smallest possible (discrete) Fréchet distance between a polygonal curve c(S) induced by S and a polygonal curve c(R) induced by R.

Next we formally state the problem that we study.

Problem 1

Given two point sets we ask if the Fréchet distance or the discrete Fréchet distance between the point sets is at most a given value ε>0 or not. If so, we want to find two induced curves with (discrete) Fréchet distance at most ε.

Alt and Godau [6] gave algorithms for computing the Fréchet distance between polygonal curves. For two polygonal curves P and Q of complexity n and m their algorithm decides in O(nm) time whether the Fréchet distance between P and Q is smaller than a given value ε>0, and computes the exact Fréchet distance in O(nmlog(nm)) time [6]. The discrete Fréchet distance was introduced by Eiter and Mannila, who gave an algorithm to compute it for two polygonal curves in O(nm) time [12]. Recently, Bringmann gave conditional near-quadratic lower bounds [9] for the Fréchet distance and discrete Fréchet distance. At nearly the same time, slightly faster algorithms were given for both the discrete Fréchet distance [4] and the Fréchet distance [10].

Eiter and Mannila defined a related distance measure, the link distance, between two point sets as the mimimum sum of point to point distances of a relation RS1×S2 for point sets S1 and S2. For each point s1 of S1, R must contain a pair (s1,s2) and vice versa [13].

To the best of our knowledge, the problem of finding polygonal curves on two given point sets with small Fréchet distance has not been considered previously. However, the problem where one polygonal curve P is given and the objective is to find a polygonal curve Q on one point set S with small Fréchet distance or with small discrete Fréchet distance to P is well studied [1], [14], [17]. There are several variants of this problem. The all-points variant requires all points of S to be visited by Q, whereas the subset variant allows to build the polygonal curve on a subset of S. Furthermore, one can allow that points of S are visited more than once (non-unique) or not (unique).

For the discrete Fréchet distance, Wylie and Zhu [17] showed that both non-unique variants are solvable in O(nm) time, where n is the complexity of P and m denotes the size of S. However, they showed that both unique variants are NP-complete. For the continuous Fréchet distance, Accisano and Üngör [1] showed NP-completeness for both unique variants and for the all-points, non-unique variant. Maheshwari et al. [14] showed that the continuous subset non-unique variant is solvable in O(nm2) time. Assisano and Üngör introduced two extensions of the problem, namely allowing an affine transformation of P to be close to some curve on the point set S under the Fréchet distance [2] and dealing with imprecise point sets [3]. However, as for most of the techniques, the order of the given curve is inherent, these approaches do not carry to our problem.

We consider the discrete and continuous Fréchet distance between two point sets. For a curve and a point set, the discrete variant is NP-hard [17]. However, we first observe that for two point sets, the discrete Fréchet distance is equivalent to the Hausdorff distance. Then we show how to obtain two curves with minimal discrete Fréchet distance in O((m+n)log(mn)) time and how to obtain a short and simple representative curve for both point sets.

In contrast to the discrete variant, we prove that the continuous variant is NP-hard to approximate for any constant factor. We develop an exponential time algorithm to decide whether δF(S,R)ε for two point sets S and R and a value ε>0 that exploits the given geometry in order to reduce the number of possible permutations of the points significantly.

All our results are formulated – for ease of presentation – in 2 dimensions. However note that all results generalize to point sets in Rd for any d>2.

Section snippets

Curves realizing the discrete Fréchet distance

Here, we consider the discrete Fréchet distance between two point sets and show how to obtain two induced curves that respect this distance.

We first compare the discrete Fréchet distance with the Hausdorff distance between two point sets. Recall, that the Hausdorff distance between two point sets S and R is defined as the smallest value ε such that for every point sS there exists a point rR with distance at most ε to s, and such that for every point rR there exists a point s in S with

Fréchet distance between point sets

Detecting common routes of two entities or finding similar linear formations of two groups of entities based on the discrete Fréchet distance is quite restrictive. For instance, consider the simple movement of two entities moving along a straight line. Although the movement is the same, the discrete Fréchet distance between the point sets can be large, depending on the sampled points along the line. The continuous variant corrects this shortcoming. Except for the start- and endpoints, the

Conclusion

For the discrete Fréchet distance between two point sets, we showed that we can construct a simple representative curve by approximating the shortest Hamiltonian path problem on the points given by a partition of the two point sets. For the continuous variant, we reduced the possibilities of constructing the induced curves by carefully exploiting all given geometry. Hence, we currently do not see how to obtain more efficient exact or approximation algorithms for the continuous problem in the

Declaration of Competing Interest

The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.

Acknowledgement

B. Kilgus was supported by the German Research Foundation under grant number BU 2419/3-1. We thank the anonymous referees for their helpful comments.

References (17)

  • T. Wylie et al.

    Following a curve with the discrete Fréchet distance

    Theor. Comput. Sci.

    (2014)
  • P. Accisano et al.

    Approximate matching of curves to point sets

  • P. Accisano et al.

    Finding a curve in a point set

  • P. Accisano et al.

    Matching curves to imprecise point sets using Fréchet distance

  • P.K. Agarwal et al.

    Computing the discrete Fréchet distance in subquadratic time

  • H. Alt et al.

    Approximate matching of polygonal shapes (extended abstract)

  • H. Alt et al.

    Computing the Fréchet distance between two polygonal curves

    Int. J. Comput. Geom. Appl.

    (1995)
  • S. Arora

    Polynomial time approximation schemes for Euclidean TSP and other geometric problems

There are more references available in the full text version of this article.

This paper is a full version of the work presented at the 32nd Canadian Conference on Computational Geometry (CCCG 2020) [11].

View full text