Professional Documents
Culture Documents
Frechet 3557915.3560970
Frechet 3557915.3560970
Figure 1: In the �rst plot on the left, two curves that are similar in their spatial and temporal progression are shown. In the
second plot, the curves are similar in space but not in time. In the third plot, the temporal course is similar, but not the spatial
course. In the fourth, both the spatial and temporal curves di�er signi�cantly. We introduce a new distance measure, based on
the framework of the Fréchet distance, which considers both, spatial and temporal information, and allows to combine them
as desired for the application.
[5, 8]. Another issue is that in contrast to the Fréchet distance, without backtracking. Any such traversal can be modelled by a so
DTW and most others are not metric. The survey also discusses called reparameterisation.
applications where the spatial and the temporal components should
De�nition 2.2 (Reparameterisation). Given % 2 P3 of length
not equally contribute to the (dis)similarity of two trajectories and
< as well as = 2 N 2 , a continuous non-decreasing surjective
hence more �exibility in the weighting would be desirable.
function U : [0, =] ! [0, <] with U (0) = 0 and U (=) = < is called a
reparametrisation of %.
1.2 Contribution
The following theoretical and experimental results on multi-di- The set of all such functions U is denoted by =,< .
mensional trajectory similarity computation are presented in this De�nition 2.3 (Fréchet Distance). Let %, & 2 P3 be two polygonal
paper: We introduce the (discrete) Generalized Fréchet distance, curves of length = and <, then the Fréchet distance is de�ned as
as a generalization of the classical (discrete) Fréchet distance, this
allows to customize the contribution of each data dimension to the 3 (%, &) = inf max 3 (% (C)), & (U (C))).
U2 =,< C 2 [0,=]
distance value. If the contribution of each dimension is modelled
by a di�erentiable convex function, we prove that the concept of Alt and Godau [1] introduced several algorithms to e�ciently
free space diagrams introduced in [1] can be adapted such that the compute the Fréchet distance of two polygonal curves % and &.
Generalized Fréchet distance can be computed within the same as- Their algorithms rely on answering the respective decision problem
ymptotic running time bound as the classical Fréchet distance. For as a subroutine: Given two curves and Y, does there exist reparameter-
the discrete Generalized Fréchet distance, we show that the dynamic isations such that 3 (%, &) Y? The algorithms then systematically
programming approach for the conventional discrete Fréchet dis- search for the smallest value Y for which the answer to the decision
tance can be integrated with the individual function choices for each problem is true.
dimension. The applicability of the Generalized Fréchet distance Free Space Diagram. To answer the decision problem, the concept
is demonstrated in an experimental study on real-world spatio- of a free space diagram was introduced in [1]. In case the given
temporal trajectories and generated curves with three-dimensional curves %, & 2 P = are both of length two, i.e. both consist of a single
data points. We describe implementation details and engineering line segment, all pairs of points whose distance is at most Y de�ne
techniques that enable sensible running times, and study the impact the free space
of the choice of the mapping function on the distance value.
Y = {(B, C) 2 [0, 1] 2 3 (% (B), & (C)) Y}.
2 PRELIMINARIES Alt and Godau showed that Y is always a convex set. The concept
In this section, we review basic de�nitions and algorithms for the can be extended to polygonal curves of arbitrary length by applying
classical (discrete) Fréchet distance, which the Generalized Fréchet the free space de�nition to each pair of line segments from % and
distance will be built upon. &. Accordingly, the free space diagram
Given two points 0, 1 2 R3 , their Euclidean distance is denoted Y (%, &) = {(B, C) 2 [0, =] ⇥ [0, <] 3 (% (B), & (C)) Y}
by 3 (0, 1). We use 01 to describe the line segment from 0 to 1, and is composed of the =< cells ⇠8,9 where Y (%, &)\⇠8,9 corresponds to
01 for the line passing through 0, 1. A polygonal curve is described the free space of the 8th line segment of % and the 9th line segment
by a sequence of = points and the corresponding = 1 line segments of &. Given the free space diagram Y (%, &), the decision problem
connecting successive points. More formally, let S3 be the set of all can be answered based on the observation that 3 (%, &) Y i�
sequences of 3-dimensional points ( = hB 0, . . . , B= i where ( (8) = B8 there exists a continuous curve in Y (%, &) from (0, 0) to (=, <),
for all 8 2 [=] with [=] = {0, 1, 2, ..., =} for any = 2 N. Then the which is monotone in both coordinates.
following de�nition of a (continuous) polygonal curve applies. For (8, 9) 2 [=] ⇥ [<] let !8,9 (or ⌫8,9 ) be the left (or bottom)
line segment bounding cell ⇠8,9 (see Figure 2 for an illustration).
De�nition 2.1 (Polygonal Curve). Given a sequence ( 2 S3 with =
points, a polygonal curve is a continuous mapping % : [0, =] ! R3 , Further de�ne !8,9 = !8,9 \ Y and ⌫8,9 = ⌫8,9 \ Y . Two things
where % (8) = B8 for 8 2 [=] and % (8 + _) = _(B8+1 B8 ) + B8 for follow from the convexity of Y \ ⇠8,9 . First, !8,9 and ⌫8,9 are line
_ 2 [0, 1]. The length of % is then denoted by =. segments, and secondly, it is su�cient to calculate all !8,9 and ⌫8,9
We refer to the set of all polygonal curves in 3 dimensions as to decide whether there exists a a path in the corresponding free
P3 . Unless stated otherwise, we will always assume for ease of space diagram. Let now 'Y be the set of points that are reachable
exposition that 3 2 O (1) in the following. This complies with the from (0, 0), that is, the points on monotone curve from (0, 0) in
Y . Further let !8,9 = !8,9 \ 'Y and ⌫8,9 = ⌫8,9 \ 'Y . Because of
' '
fact that in most applications we deal with low-dimensional data,
e.g., spatio-temporal trajectories are typically three-dimensional the convexity of Y \ ⇠8,9 , !8,9
' and ⌫ ' are line segments as well
8,9
with two spatial and one temporal dimension, or four-dimensional and 3 (%, &) Y i� (=, <) 2 !=+1,<
' . Note that !8,9 and ⌫8,9 can be
with three spatial and one temporal dimension (in case elevation computed in constant time using basic geometric operations.
matters). Based on these considerations, the question whether 3 (%, &)
Y can be answered in time O (=<) by �rst computing all intervals of
2.1 Continuos Fréchet Distance the free space on the boundary of all cells in the free space diagram
The continuous Fréchet distance measures the maximum distance and then systematically testing for each cell whether its right upper
between two polygonal curves while traversing them in parallel corner is reachable from (0, 0).
SIGSPATIAL ’22, November 1–4, 2022, Sea�le, WA, USA Theodor Gutschlag and Sabine Storandt
De�nition 2.5 (Discrete Fréchet Distance). Given two sequences P����. Let %, &, ' 2 P3 . By de�nition of g and the minimality
', ( 2 S3 . The discrete Fréchet distance is de�ned as 33 (', () = of U 2 =,< , we get 3 GF (%, &) = 0 , % = &. Since g is a norm it
minV max (A,B) 2V 3 (A, B). follows, that 3 GF (%, &) = 3 GF (&, %). It remains to be shown, that
3 GF (%, &) 3 GF (%, ') + 3 GF (', &). Now let Y > 0 and W, ` 2 ,
The discrete structure enables the computation of 33 (', () in
such that 3 GF (%, ') = XW (%, ') and 3 GF (', &) = X ` (', &). Then
O (=<) by applying the concept of dynamic programming [19].
XW (%, ') < 3 GF (%, ') + Y/3
3 GENERALIZED FRÉCHET DISTANCE
and
The idea of the (discrete) Generalized Fréchet distance is to create
a bottleneck distance measure, where every dimension of the input X ` (', &) < 3 GF (', &) + Y/3.
data can be modelled individually and can be arbitrarily combined Further, there exists a CY 2 [0, 1], such that (i):
with the other dimensions as desired for the application. The char-
acteristics of the Fréchet distance are to be retained: sensitivity to g (% (CY ) & (W (` (CY )))) > max g (% (C) (& (W (` (C)))) Y/3
C 2 [0,1]
backtracking, being a metric and allowing for e�cient computation.
We will prove these properties for the continuous and the discrete Let W (CY ) = DY and ` (DY ) = E Y , then:
version, and also examine the relation between the continuous and g (% (CY ) '(DY )) < 3 GF (%, ') + Y/3
the discrete variant.
g ('(DY ) & (E Y )) < 3 GF (', &) + Y/3
Let us start with the following basic de�nition, which is needed
for both variants: By adding the above equations we get:
De�nition 3.1 (Weight Function). Let be the set of all di�er-
3 2Y
g (% (CY ) '(DY )) + g ('(DY ) & (E Y )) < 3 GF (%, ') + 3 GF (', &) +
entiable and convex functions g : R3 ! R+0 for which g (G) = 0 , 3
G = 0 applies for all G 2 R3 . Since g is norm and therefore ful�ls the triangle inequality, we
obtain:
3.1 Continous Generalized Fréchet Distance 2Y
First, we introduce the continuous Generalized Fréchet distance g (% (CY ) & (E Y )) < 3 GF (%, ') + 3 GF (', &) + .
3
and prove that it de�nes a norm on P3 for a g 2 3 if g is a metric
Reorganizing and (i) results:
on R3 , which is important for many applications. We further show
that it can be computed within the same asymptotic running time max g (% (C) (& (EC )) Y < 3 GF (%, ') + 3 GF (', &).
C 2 [0,1]
bounds as the classical Fréchet distance.
Since Y is arbitrary and W and ` are minimal 3 GF (%, &) 3 GF (%, ') +
De�nition 3.2 (Generalized Fréchet Distance). Let g 2 3 be arbi-
3 GF (', &) follows. ⇤
trary but �xed. Then the weighted distance of %, & 2 P3 of length
=, < for a given reparametrisation U 2 =,< is de�ned as: Next, we want to design an algorithm to compute the Generalized
XU (%, &) := max g (% (C) & (U (C))) Fréchet distance for any feasible choice of g. In the following, we
C 2 [0,=]
argue that the concept of the free space diagram can be generalized
Accordingly, the Generalized Fréchet distance of % and & is to work also for the Generalized Fréchet distance. To get the same
3 GF (?, @) := inf XU (%, &). asymptotic running times for the Generalized Fréchet distance
U
as for computing the classical Fréchet distance, we need to show
For example, if we set that all critical values as well as !8,9
⌫ and ! ⌫ can be determined in
q 8,9
constant time.
g= G 12 + G 22 + G 32
Now let g 2 3 be arbitrary but �xed and Y 2 R>0 . The de�nition
for 3 = 3, we would have the classical Fréchet distance using the of the free space can be generalized as follows.
Euclidean norm in three dimensions. But we can also set e.g.
q De�nition 3.4 (Free Space). We call
g = G 12 + G 22 + G 32 g
Y = {(B, C) 2 [0, =] ⇥ [0, <] g (% (B) & (C)) Y}
to re�ect that for the two �rst (spatial) data dimensions, the Eu-
clidean distance is sensible, but the third data dimension (e.g. time) the free space of %, & 2 P3 under Y and g.
should be treated di�erently. Hence the �exibility in de�ning a A necessary condition for answering the decision problem based
suitable measure for a given application is signi�cantly increased. on the free space diagram is that for curves of length two the free
Given this generalized de�nition of the Fréchet distance, we next space is convex.
investigate its properties and how it can be computed e�ciently.
We start by proving that the Generalized Fréchet distance still L���� 3.5 (C��������). Let %, & 2 P3 be of length two, then Y
constitutes a metric when the weight function is di�erentiable and is convex.
convex.
P����. Let _ 2 [0, 1] and (B, C), (G, ~) 2 Y . We will show that
L���� 3.3 (M����� S����). If g 2 3 is a norm on R3 , then
(P3 , 3 GF ) is a metric space. _(B, C) + (1 _)(G, ~) = (_B + (1 _)G, _C + (1 _)~) 2 Yg ,
SIGSPATIAL ’22, November 1–4, 2022, Sea�le, WA, USA Theodor Gutschlag and Sabine Storandt
hence, g (% (_B + (1 _)G) & (_C + (1 _)~)) Y. W.l.o.g. assume critical values of ���� �. Hence also computing a critical value of
g (% (B) & (C)) g (% (G) & (~)). By the de�nition of a polygonal ���� � is in O (1).
curve and the convexity of g, we get: Since all types of critical values can be computed in O (1), the
optimization problem can be solved in O ((= 2< + =< 2 ) log(=<)) by
g (_(% (B) & (C)) + (1 _)(% (G) & (~)))
a binary search over the respective value set.
_g (% (B) & (C)) + (1 _)g (% (G) & (~)))
T������ 3.7. Let %, & 2 P3 be two polygonal curves of length
g (% (B) & (C)) Y
=, < and g 2 3 . Then 3 GF (%, &) can be computed in O ((= 2< +
⇤ =< 2 ) log(=<)).
To show that !8,9 and ⌫8,9 are computable in O (1), we reduce the To also make the parametric search algorithm from Alt and
problem to one variable and then obtain the value by solving a one Godau applicable to the computation of 3 GF , the end points 08,9 , 18,9
dimensional equation. Let ', ( 2 S3 be of length =, < and let %, & and 28,9 , 38,9 of the line segments !8,9 and ⌫8,9 , respectively, must be
be the corresponding polygonal curves. Then !8,9 is the interval of de�nable as a functions in Y. Rearranging
the line segment ( ( 9)( ( 9 + 1), 9 2 [< 1] which has a distance of g ('(8) C (( ( 9 + 1) ( ( 9)) + ( ( 9))) = Y
at most Y from the point '(8), 8 2 [=]. Due to Lemma 3.5, the set of
for C 2 R results in the respective functions in Y for 08,9 and 18,9 .
these points is a line segment, which means we only need to �nd
Similarly, we can de�ne the functions for 28,9 and 38,9 .
the endpoints of this line segment to de�ne !8,9 . In 3-dimensional
Euclidean space a line DE can be written as C (E D) + D with C 2 R. T������ 3.8 (C��������� O����������� P������). Let %, & 2
Solving g ('(8) C · (( ( 9 + 1) ( ( 9)) + ( ( 9)) = Y allows �nding P3 be two polygonal curves of length =, < and g 2 3 . If 08,9 , 18,9 , 28,9 , 38,9
the endpoints ; 1, ; 2 . Since g is convex, at most two solutions exist. can be described as functions of constant degree for all 8 2 [=], 9 2
Now !8,9 = ; 1; 2 \ ( ( 9)( ( 9 + 1). The computation of ⌫8,9 works in [<], then 3 GF (%, &) can be computed in O (=< log(=<)).
analogues fashion. Hence !8,9 and ⌫8,9 can be computed in O (1).
3.2 Discrete Generalized Fréchet Distance
T������ 3.6. Let %, & 2 P = . Then 3 GF (%, &) Y can be decided Similar to the extended de�nition of the continuous Fréchet dis-
in O (=<) for arbitrary but �xed g 2 3 . tance, we now de�ne the discrete generalized version.
Now, in order to compute the Generalized Fréchet distance, we De�nition 3.9 (Discrete Generalized Fréchet Distance). Let g 2 3
need to calculate the critical values of ���� �, ���� � and ���� � be arbitrary but �xed. Further let ', ( 2 S3 be point sequences and
in time O (1) each. This is trivial for values of ���� �, as we only V a traversal of ' and (. The discrete weighted distance between '
need to check the distance between the starting and the end points and ( of traversal V is de�ned as :
of the two curves. For the calculation of the critical values of ����
X V (', () := max g (B8 C 9 ).
� and ���� � we apply the same approach as for the calculation of (B8 ,C 9 ) 2V
!8,9 , ⌫8,9 . That is, we reduce the problem to one variable and then The discrete Generalized Fréchet distance of ' and ( is de�ned as
obtain the value by solving a one dimensional equation. Again, let 3 dGF (', () := inf V X V (', ().
', ( 2 S3 of length =, < and let %, & be the corresponding polygonal
curves. Critical values of ���� � correspond to the distance from Based on the same argumentation as used in the proof of Lemma
'(8), 8 2 [=] to 1 9 2 ( ( 9)( ( 9 + 1), 9 2 [< 1], such that 3.3, we obtain the following result for the discrete Generalized
Fréchet distance.
min g ('(;) G) = g ('(8) 19)
G 2( ( 9)( ( 9+1) L���� 3.10 (M����� S����). (S3 , 3 dGF ) if g 2 3 is a norm.
(or from ( ( 9), 9 2 [<] to '(8)'(8 + 1) , 8 2 [= 1]). Since g is convex The de�nition of a traversal is una�ected by the distance measure
and ( ( 9)( ( 9 + 1) is a bounded set, there exists one minimum. By used. But it is important to note, that we can still divide the prob-
de�nition all g are di�erentiable, hence solving lem into independent sub-problems in the same way as it is done
g 0 ('(8) C (( ( 9 + 1) ( ( 9)) + ( ( 9)) = 0 for the classical discrete Fréchet distance. Therefore we can solve
the discrete Generalized Fréchet distance using the same dynamic
returns a C such that C (( ( 9 + 1) ( ( 9)) + ( ( 9) = 1 9 . Accordingly, programming approach as for the conventional discrete Fréchet
computing critical values of ���� � is in O (1). distance, only using the new distance de�nition internally. Thus
Critical values of ���� �, are the common weighted distance of we obtain the following theorem.
two points '(8 1 ), '(8 2 ), 8 1, 8 2 2 [=] to a line segment ( ( 9)( ( 9 + 1)
with 9 2 [< 1] (or ( ( 91 ), ( ( 92 ), 91, 92 2 [<] to a line segment T������ 3.11. Let ', ( 2 S3 be of length =, < and g 2 3 . Then
'(8)'(8 + 1) with 8 2 [= 1]). Let 3 dGF (', () can be computed in O (=<).
of the curve between the points into account, while the discrete of this algorithm for the Generalized Fréchet distance is rather slow
variant ’jumps’ from point to point. Hence the question is how and might exhibit some numerical instabilities. In the following,
much information is lost in the discretized variant. we describe some ideas to take care of these problems.
Next we want to assess the gap between the discrete and the Solving the equations to compute !8,9 , ⌫8,9 as well as the critical
continuous Generalized Fréchet distance. For given ', ( 2 S3 with values T��� � and T��� � results in long and unwieldy formulas. In
%, & being their polygonal curves, we have 3 GF (%, &) 3 dGF (', () order to avoid handling these, we use a numerical equation solver1 .
as we can de�ne a reparametrisation U, such that, for each (A8 , B 9 ) 2 To decrease the practical running time, we seek to reduce the
V there exists a C 2 [0, =] such that % (C) = A8 and & (U (C)) = B 9 . To number of critical values for which we need to answer the respec-
get a more �ne-grained distinction, we de�ne tive decision problem, in particular those of ���� �. Like in the
⇡ (() := max g (B8 1 B8 ) parametric search algorithm, we construct a critical interval [Y 1, Y 2 ],
8=2,...,= based on the critical values of ���� � and ���� �. Note that there are
for ( = hB 1, . . . , B= i 2 S3 . possibly a lot of duplicates in values of ���� �, which we remove
beforehand. Next, we test if Y 2 r solves the decision problem for
L���� 3.12. Given ', ( 2 S3 , their polygon curves %, & and r > 0 being negligibly small. If the decision problem is false, then
g 2 3 , then we assume the Y 2 is the optimum, otherwise there exists a value of
3 dGF (', () 3 GF (%, &) + max{⇡ ('), ⇡ (()}/2. ���� � in [Y 1, Y 2 ], for which the decision problem is positive. Since
we already computed the critical interval we can directly discard
if g is a norm over R3 . all values of ���� � which are not in the critical interval.
P����. Let V be a traversal such that X V (', () is minimal. Further,
let U be a reparametrisation such XU (%, &) is minimal. Now assume 4.2 Scalability and Sensitivity Study
we are at traversal step V2 = ('(8), ( ( 9)). We have to distinguish Next, we evaluate the practical running times of the Generalized
between three cases for V2+1 : Fréchet distance and the in�uence of g. The code was compiled
First, let V2+1 = ('(8 + 1), ( ( 9)), let C8+1 with Python 3.8.10 and run on an AMD Ryzen Threadrippe 3970X
⇣ be the smallest C such⌘
that % (C) = '(8 + 1) then & (U (C8+1 )) 2 ,
( ( 9 1)+( ( 9) ( ( 9)+( (8+1) 32-Core processor with 3.7GHz and 256 GB RAM.
2 2
as otherwise V or U would not be optimal. Due to the triangle
inequality, we get: Algorithm 1 Create next data point depending on current direction
and previous value.
g ('(8 + 1) ( ( 9)) g (% (C8+1 ) & (U (C8+1 ))) + max{⇡ ('), ⇡ (()}/2.
Require: 38A42C8>= 2 {0, 1} and previous point ?A4E
The same applies for the case V2+1 = ('(8), ( ( 9 + 1)). 1: function N���V����(38A42C8>=, ?A4E)
In case V2+1 = ('(8 + 1), ( ( 9 + 1)), we again choose C8+1 to be the 2: while TRUE do
smallest ) such
⇣ that % (C) = '(8 + 1). Since
⌘ V and U are optimal so 3: - ⇠ N (?A4E, 25)
( ( 9)+( ( 9+1) ( ( 9+1)+( (8+2)
& (U (C8+1 )) 2 2 , 2 , otherwise V2+1 < ('(8 + 4: if - > 0 then
1), ( ( 9 + 1)). We hence have 5: if direction then
6: if - ?A4E then
g ('(8+1) ( ( 9 +1)) g (% (C8+1 ) & (U (C8+1 )))+max{⇡ ('), ⇡ (()}/2,
7: return X
. Thus the assertion follows. ⇤ 8: with probability 15 return X
9: else
Hence 3 GF (?, @) 3 dGF (', () 3 GF (%, &)+max{⇡ ('), ⇡ (()}/2
10: if - < ?A4E then
if the chosen g is a norm over R3 .
11: return X
12: with probability 15 return X
4 SHOWCASE: SPATIO-TEMPORAL
TRAJECTORY SIMILARITY
In this section we apply the Generalized Fréchet distance to deter- In the �rst set of experiments, we use generated curve data to
mine the similarity of three-dimensional trajectories. In previous have control over the data characteristics. The goal is to gener-
work, typically the Fréchet distance was only used on the spatial ate trajectories that mimic real object movements, such as a car
dimensions of the trajectories. Here, we also incorporate the tem- routes, and are therefore not too random. We hence use th follow-
poral dimension and show that tuning the in�uence of the third ing approach: Trajectories are built iteratively and space and time
dimension heavily impacts the outcome. separately. In order to build the spatial part of the curve, take a
random starting point ? 1 2 [0, 1] 2 . Algorithm 1 now creates point
4.1 Implementation ?8+1 based on ?8 , where x and y coordinates are created separately.
Therefore in each iteration there is a current direction (up and
Although the parametric search algorithm proposed by Alt and Go-
down/ left and right) which is changed with each run with a proba-
dau has a better asymptotic runtime than the simpler binary search 1 . At start the direction for both coordinates are picked
bility of 10
algorithm, it was already noted in the original paper that the former
randomly. After the �nal iteration the whole curve is normalized
is based on data structures that are hard to implement and that
to [0, 1] 2 . The temporal sequence is easier to create, since one can
come with large computational overhead. Hence, in practice, the
simpler algorithm is preferable. However, a naive implementation 1 We use fsolve provided by the Python ����� package in our implementation.
SIGSPATIAL ’22, November 1–4, 2022, Sea�le, WA, USA Theodor Gutschlag and Sabine Storandt
Figure 4: Visualisation of the migration routes of 18 geese. To study which geese migrated together not only the spatial course
but also the temporal similarity of the trajectories needs to be considered.
Figure 5: Trajectory similarity of 18 geese migration routes, shown here as heat maps. The redder the square, the more similar
the routes in the respective row and colum. On the left (i), the classic Fréchet distance is used, where time does not e�ect
the evaluation. The middle (ii) and right (iii) graphics use the Generalized Fréchet distance. In addition to the geographical
information, the temporal course is included. In the middle and in the right graphic, the geographical data is weighted by the
Euclidean Distance and the temporal plane is weighted by G in the middle and G 4 in the right graphic.
q
The goal is to discover which individuals have similar migration (i) g1 : R2 ! R, g1 (G 1, G 2 ) = G 12 + G 22
behaviour and which, if any, have �own together. q
The data set consists of GPS data of di�erent individuals tracked (ii) g2 : R3 ! R, g2 (G 1, G 2, G 3 ) = G 12 + G 22 + G 3
q
over the same period of time. In preparation of the experiment, (iii) g3 : R3 ! R, g3 (G 1, G 2, G 3 ) = G 12 + G 22 + G 34 .
we did some elementary preprocessing. We removed all trajecto-
ries with less than �ve data points, as those only captured local
Note that (i) is the classical Fréchet distance, while (ii) and (iii) are
movement but not migration. For the remaining 18 trajectories, we
chosen to show the impact of a large di�erences in the gradient of
normalised the coordinates to [0, 1] 2 and the corresponding time
the selected weight functions.
stamps to [0, 1]. Since the data points of the individual trajecto-
The results are shown in Figure 5, represented as colormaps.
ries are close to each other, we subsampled the curves such that
The di�erent patterns emerging in the colormaps indicate that the
the trajectories have an approximate length of 20 on average. The
similarity di�ers greatly between the four scenarios. One obvious
trajectories are shown in Figure 4.
observation is, that in (ii) and (iii), the similarity is more di�er-
In our experiment, we calculate the similarity of each pair of
entiated than (i). In (i) there appears to be a subset of ten geese
trajectories for three di�erent weight functions:
with similar spatial course. However (ii) suggests that there are
di�erences in the temporal course of the routes. In particular, (ii)
SIGSPATIAL ’22, November 1–4, 2022, Sea�le, WA, USA Theodor Gutschlag and Sabine Storandt
shows that geese 1 and 11 are the only two that migrated together Science 34, 12 (2020), 2401–2433. https://doi.org/10.1080/13658816.2019.1684498
with respect to both the spatial and the temporal dimensions. In arXiv:https://doi.org/10.1080/13658816.2019.1684498
[11] Erin Wolf Chambers, Eric Colin De Verdiere, Je� Erickson, Sylvain Lazard, Francis
(iii), similar to (i), one can see that there is a subset that has strong Lazarus, and Shripad Thite. 2010. Homotopic Fréchet distance between curves
similarities in both temporal and spatial course. What is striking, or, walking your dog in the woods in polynomial time. Computational Geometry
43, 3 (2010), 295–311.
however, is that in (i) there are two trajectories with weak similari- [12] Erin W Chambers, David Letscher, Tao Ju, and Lu Liu. 2011. Isotopic Fréchet
ties to the others (1, 8) and in (iii) there are four (3,5,7,8). Thus goose Distance.. In CCCG. Citeseer.
1 seems to have a di�erent spatial course but a similar temporal one. [13] Daniel Chen, Anne Driemel, Leonidas J Guibas, Andy Nguyen, and Carola Wenk.
2011. Approximate map matching with respect to the Fréchet distance. In 2011
Geese 3, 5, 7 and 8 on the other hand still have a similar spatial but Proceedings of the Thirteenth Workshop on Algorithm Engineering and Experiments
very di�erent temporal course. It can be clearly seen that curves 3, (ALENEX). SIAM, 75–83.
5, 7, 8 and 12 show strong di�erences in the temporal course and [14] Lei Chen, M Tamer Özsu, and Vincent Oria. 2005. Robust and fast similarity
search for moving object trajectories. In Proceedings of the 2005 ACM SIGMOD
that these birds therefore did not �y together. Trajectory 10 is also international conference on Management of data. 491–502.
interesting, as it shows a high degree of similarity to all the others [15] Ahlame Chouakria-Douzal and Panduranga Naidu Nagabhushan. 2006. Improved
fréchet distance for time series. In Data Science and Classi�cation. Springer, 13–20.
and is therefore close to the average in terms of time course. [16] Richard Cole. 1987. Slowing down sorting networks to obtain faster sorting
Our results imply that the use of di�erent functions leads to algorithms. Journal of the ACM (JACM) 34, 1 (1987), 200–208.
drastically di�erent relative similarities. Thus, choosing a suitable [17] Atlas F Cook and Carola Wenk. 2008. Geodesic Fréchet distance with polygonal
obstacles. Citeseer.
function helps to make the distance measure more interpretable [18] Hui Ding, Goce Trajcevski, and Peter Scheuermann. 2008. E�cient similarity join
and to gain a deeper understanding of the underlying data. of large sets of moving object trajectories. In 2008 15th International Symposium
on Temporal Representation and Reasoning. IEEE, 79–87.
[19] Thomas Eiter and Heikki Mannila. 1994. Computing discrete Fréchet distance.
5 CONCLUSION Technical Report. Citeseer.
[20] Xuri Gong, Zhou Huang, Yaoli Wang, Lun Wu, and Yu Liu. 2020. High-
We introduced the Generalized Fréchet distance, discussed theo- performance spatiotemporal trajectory matching across heterogeneous data
retical properties and possible applications, and provided a proof- sources. Future Generation Computer Systems 105 (2020), 148–161.
of-concept implementation. The �exibility of the measure can be [21] Joachim Gudmundsson and Nacho Valladares. 2014. A GPU approach to subtra-
jectory clustering using the Fréchet distance. IEEE Transactions on Parallel and
utilized to come up with the most suitable incarnation for a given Distributed Systems 26, 4 (2014), 924–937.
application scenario. The practical running times can certainly [22] Piotr Indyk. 2002. Approximate nearest neighbor algorithms for Fréchet dis-
be further improved by incorporating more engineering concepts tance via product metrics. In Proceedings of the eighteenth annual symposium on
Computational geometry. 102–106.
or testing other numerical equation solvers. From a theoretical [23] Fan Jiang, Yan Zhou, Mengdou Qin, and Xu Wang. 2021. A Trajectory Com-
perspective, it would be interesting to investigate whether approxi- pression Method Based on Fréchet Distance. In IOP Conference Series: Earth and
Environmental Science, Vol. 693. IOP Publishing, 012091.
mation algorithms for the classical Fréchet distance transfer to the [24] Minghui Jiang, Ying Xu, and Binhai Zhu. 2008. Protein structure–structure align-
generalized version. ment with discrete Fréchet distance. Journal of bioinformatics and computational
biology 6, 01 (2008), 51–64.
[25] Marc van Kreveld, Maarten Lö�er, and Lionov Wiratma. 2018. On Optimal
6 ACKNOWLEDGEMENT Polyline Simpli�cation using the Hausdor� and Fréchet Distance. In 34th Inter-
national Symposium on Computational Geometry, Vol. 99. Leibniz International
Funded by the Deutsche Forschungsgemeinschaft (DFG, German Proceedings in Informatics (LIPIcs), 56–1.
Research Foundation) - Project-ID 251654672 - TRR 161. [26] Yin Lou, Chengyang Zhang, Yu Zheng, Xing Xie, Wei Wang, and Yan Huang.
2009. Map-matching for low-sampling-rate GPS trajectories. In Proceedings of
the 17th ACM SIGSPATIAL international conference on advances in geographic
REFERENCES information systems. 352–361.
[1] Helmut Alt and Michael Godau. 1995. Computing the Fréchet distance between [27] Nimrod Megiddo. 1983. Applying parallel computation algorithms in the design
two polygonal curves. International Journal of Computational Geometry & Appli- of serial algorithms. Journal of the ACM (JACM) 30, 4 (1983), 852–865.
cations 5, 01n02 (1995), 75–91. [28] A Salarpour and H Khotanlou. 2018. An empirical comparison of distance mea-
[2] Donald J Berndt and James Cli�ord. 1994. Using dynamic time warping to �nd sures for multivariate time series clustering. International Journal of Engineering
patterns in time series.. In KDD workshop, Vol. 10. Seattle, WA, USA:, 359–370. 31, 2 (2018), 250–262.
[3] Vlad Boldea, Gregory C Sharp, Steve B Jiang, and David Sarrut. 2008. 4D-CT [29] Yaguang Tao, Alan Both, Rodrigo I Silveira, Kevin Buchin, Stef Sijben, Ross S
lung motion estimation with deformable registration: quanti�cation of motion Purves, Patrick Laube, Dongliang Peng, Kevin Toohey, and Matt Duckham. 2021.
nonlinearity and hysteresis. Medical physics 35, 3 (2008), 1008–1018. A comparative analysis of trajectory similarity measures. GIScience & Remote
[4] Sotiris Brakatsoulas, Dieter Pfoser, Randall Salas, and Carola Wenk. 2005. On map- Sensing (2021), 1–27.
matching vehicle tracking data. In Proceedings of the 31st international conference [30] Gineke A Ten Holt, Marcel JT Reinders, and Emile A Hendriks. 2007. Multi-
on Very large data bases. 853–864. dimensional dynamic time warping for gesture recognition. In Thirteenth annual
[5] Milutin Brankovic, Kevin Buchin, Koen Klaren, André Nusser, Aleksandr Popov, conference of the Advanced School for Computing and Imaging, Vol. 300. 1.
and Sampson Wong. 2020. (k, l)-Medians Clustering of Trajectories Using Contin- [31] Michail Vlachos, George Kollios, and Dimitrios Gunopulos. 2002. Discovering
uous Dynamic Time Warping. In Proceedings of the 28th International Conference similar multidimensional trajectories. In Proceedings 18th international conference
on Advances in Geographic Information Systems. 99–110. on data engineering. IEEE, 673–684.
[6] Kevin Buchin, Maike Buchin, and André Schulz. 2010. Fréchet distance of surfaces: [32] Haozhou Wang, Han Su, Kai Zheng, Shazia Sadiq, and Xiaofang Zhou. 2013.
Some simple hard cases. In European Symposium on Algorithms. Springer, 63–74. An e�ectiveness study on trajectory similarity measures. In Proceedings of the
[7] Kevin Buchin, Maike Buchin, Rolf Van Leusden, Wouter Meulemans, and Wolf- Twenty-Fourth Australasian Database Conference-Volume 137. 13–22.
gang Mulzer. 2016. Computing the Fréchet distance with a retractable leash. [33] Xiaoyue Wang, Abdullah Mueen, Hui Ding, Goce Trajcevski, Peter Scheuermann,
Discrete & Computational Geometry 56, 2 (2016), 315–336. and Eamonn Keogh. 2013. Experimental comparison of representation methods
[8] Kevin Buchin, Maike Buchin, and Yusu Wang. 2009. Exact algorithms for partial and distance measures for time series data. Data Mining and Knowledge Discovery
curve matching via the Fréchet distance. In Proceedings of the twentieth annual 26, 2 (2013), 275–309.
ACM-SIAM symposium on Discrete algorithms. SIAM, 645–654. [34] Hong Wei, Yin Wang, George Forman, and Yanmin Zhu. 2013. Map matching by
[9] Kevin Buchin, Anne Driemel, Natasja van de L’Isle, and André Nusser. 2019. Fréchet distance and global weight optimization. Technical Paper, Departement of
klcluster: Center-based clustering of trajectories. In Proceedings of the 27th ACM Computer Science and Engineering (2013), 19.
SIGSPATIAL International Conference on Advances in Geographic Information [35] Tim Wylie, Jun Luo, and Binhai Zhu. 2011. A practical solution for aligning and
Systems. 496–499. simplifying pairs of protein backbones under the discrete Fréchet distance. In
[10] Maike Buchin, Bernhard Kilgus, and Andrea Kölzsch. 2020. Group diagrams International Conference on Computational Science and Its Applications. Springer,
for representing trajectories. International Journal of Geographical Information 74–83.