Fréchet distance

Imagine a person traversing a finite curved path while walking their dog on a leash, with the dog traversing a separate finite curved path.

Each can vary their speed to keep slack in the leash, but neither can move backwards.

The Fréchet distance between the two curves is the length of the shortest leash sufficient for both to traverse their separate paths from start to finish.

Note that the definition is symmetric with respect to the two curves—the Fréchet distance would be the same if the dog were walking its owner.

corresponds to choosing the walk along the given paths where the maximum leash length is minimized.

be non-decreasing means that neither the dog nor its owner can backtrack.

The Fréchet metric takes into account the flow of the two curves because the pairs of points whose distance contributes to the Fréchet distance sweep continuously along their respective curves.

The Fréchet distance and its variants find application in several problems, from morphing[1] and handwriting recognition[2] to protein structure alignment.

[3] Alt and Godau[4] were the first to describe a polynomial-time algorithm to compute the Fréchet distance between two polygonal curves in Euclidean space, based on the principle of parametric search.

An important tool for calculating the Fréchet distance of two curves is the free-space diagram, which was introduced by Alt and Godau.

[4] The free-space diagram between two curves for a given distance threshold ε is a two-dimensional region in the parameter space that consists of all point pairs on the two curves at distance at most ε:

The weak Fréchet distance is a variant of the classical Fréchet distance without the requirement that the endpoints move monotonically along their respective curves — the dog and its owner are allowed to backtrack to keep the leash between them short.

Alt and Godau[4] describe a simpler algorithm to compute the weak Fréchet distance between polygonal curves, based on computing minimax paths in an associated grid graph.

The discrete Fréchet distance, also called the coupling distance, is an approximation of the Fréchet metric for polygonal curves, defined by Eiter and Mannila.

[6] The discrete Fréchet distance considers only positions of the leash where its endpoints are located at vertices of the two polygonal curves and never in the interior of an edge.

This approximation unconditionally yields larger values than the corresponding (continuous) Fréchet distance.

However, the approximation error is bounded by the largest distance between two adjacent vertices of the polygonal curves.

Contrary to common algorithms of the (continuous) Fréchet distance, this algorithm is agnostic of the distance measures induced by the metric space.

Its formulation as a dynamic programming problem can be implemented efficiently with a quadratic runtime and a linear memory overhead using only few lines of code.

[7] When the two curves are embedded in a metric space other than Euclidean space, such as a polyhedral terrain or some Euclidean space with obstacles, the distance between two points on the curves is most naturally defined as the length of the shortest path between them.

The leash is required to be a geodesic joining its endpoints.

The resulting metric between curves is called the geodesic Fréchet distance.

[1][8][9] Cook and Wenk[8] describe a polynomial-time algorithm to compute the geodesic Fréchet distance between two polygonal curves in a simple polygon.

If we further require that the leash must move continuously in the ambient metric space, then we obtain the notion of the homotopic Fréchet distance[10] between two curves.

The motion of the leash describes a homotopy between the two curves.

Chambers et al.[10] describe a polynomial-time algorithm to compute the homotopic Fréchet distance between polygonal curves in the Euclidean plane with obstacles.

The Fréchet distance between two concentric circles of radius

The longest leash is required when the owner stands still and the dog travels to the opposite side of the circle (

), and the shortest leash when both owner and dog walk at a constant angular velocity around the circle (

Fréchet distance has been used to study visual hierarchy, a graphic design principle.

example of a free-space diagram
Free-space diagram of the red and the blue curve. In contrast to the definition in the text, which uses the parameter interval [0,1] for both curves, the curves are parameterized by arc length in this example.