University of Bonn, Bonn, [email protected]://orcid.org/0000-0002-8259-1187Partially funded by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) - 313421352 (FOR 2535 Anticipating Human Behavior). Affiliated with Lamarr Institute for Machine Learning and Artificial Intelligence. Hausdorff Center for Mathematics, University of Bonn, [email protected]://orcid.org/0000-0002-1943-2589Affiliated with Lamarr Institute for Machine Learning and Artificial Intelligence. Hausdorff Center for Mathematics, University of Bonn, Bonn, [email protected] funded by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) – 459420781. \CopyrightJacobus Conradi, Anne Driemel, Benedikt Kolbe \ccsdesc[500] Theory of computation Design and analysis of algorithms
Revisiting the Fréchet distance between piecewise smooth curves
Abstract
Since its introduction to computational geometry by Alt and Godau in 1992, the Fréchet distance has been a mainstay of algorithmic research on curve similarity computations. The focus of the research has been on comparing polygonal curves, with the notable exception of an algorithm for the decision problem for planar piecewise smooth curves due to Rote (2007). We present an algorithm for the decision problem for piecewise smooth curves that is both conceptually simpler and naturally extends to the first algorithm for the problem for piecewise smooth curves in .
We assume that the algorithm is given two continuous curves, each consisting of a sequence of , resp. , smooth pieces, where each piece belongs to a sufficiently well-behaved class of curves, such as the set of algebraic curves of bounded degree. We introduce a decomposition of the free space diagram into a controlled number of pieces that can be used to solve the decision problem similarly to the polygonal case, in time, leading to a computation of the Fréchet distance that runs in time.
Furthermore, we study approximation algorithms for piecewise smooth curves that are also -packed for some fixed value . We adapt the existing framework for -approximations and show that an approximate decision can be computed in time for any .
keywords:
Fréchet distance, piecewise smooth curves, decision algorithm1 Introduction and motivation
The Fréchet distance is a well-studied distance measure between curves, with a long history in both applications and algorithmic research. The wealth of work surrounding the analysis of algorithms for computing the Fréchet distance is centered primarily on polygonal curves. However, more complicated curves and especially splines have become commonplace in industrial applications for, e.g., computer graphics, robotics and to represent motion tracking or planning data. In such applications, the number of dimensions corresponds to the number of tracked parameters, leading to a high-dimensional ambient space. On the other hand, polygonal curves in applications often represent (unnecessarily complex) discretizations approximating an underlying smooth curve that can be described more efficiently as a smooth curve using only a small number of parameters. For an algorithmic example, smooth curves may help in more naturally describing the average of a set of polygonal curves. A crucial prerequisite to using smooth curves similarly to polygonal curves in such contexts is the ability to effectively answer elementary algorithmic questions for such curves. A natural and fundamental task in computational geometry is therefore to devise algorithms for the computation of the Fréchet distance between smooth curves such as splines. Despite this, as far as we know, there is no known approach to realizing such a computation for curves in . To tackle the case of smooth curves in the plane (), Rote [13] introduced an approach based on analyzing the turning angle and planar curvature of the planar curves. However, this approach does not easily generalize to higher dimensions. We revisit this problem and present a novel, simpler approach, with the additional benefit that it works for higher dimensions, with the same time complexity. Our methods are conceptually simple, but rely on a number of key technical ingredients.
Problem definition
Throughout the paper, and will be used to denote two piecewise smooth curves in with fixed, that is, continuous maps that are comprised of and smooth pieces, each of class . Let be the set of continuous and bijective maps that are increasing. The Fréchet distance between and is defined as . Our methods naturally allow any fixed norm with for the norm (the cases , while possible, would add a level of technicality to our treatment that distracts from its relative simplicity). To compute , we mostly focus on the decision problem of deciding whether the Fréchet distance between two piecewise smooth curves is at most a given .
Results
Our first main contribution is that we establish an algorithm to solve the decision problem for the Fréchet distance between piecewise smooth curves. Assuming that the curves are algebraically bounded curves, i.e., piecewise smooth algebraic curves where the degree of the curves is bounded by a constant, we obtain a bound of for the time complexity of the decision problem, which matches the polygonal case. The running time is independent of the ambient dimension but the algebraic complexity of the operations involved in the algorithm depends on the dimension and the nature of the curves. Our algorithm for the decision problem results in an algorithm for the computation of the Fréchet distance for algebraically bounded curves in time using parametric search, similarly to the polygonal case.
It is known [4] that the decision problem cannot be solved in strongly subquadratic time, so research has focused on investigating algorithms for restricted classes of curves. Our second contribution is that we show that we can adapt the framework from [7] for an efficient -approximation algorithm for the Fréchet distance between two -packed, polyognal curves to the setting of -packed piecewise smooth curves in . To this end, we introduce a simplification procedure for piecewise smooth curves and distill the necessary ingredients to obtain a linear time decision algorithm for algebraically bounded -packed curves.
Comparison to previous work
To arrive at an algorithm for the decision problem for smooth planar curves for the -norm for a given in general position, Rote uses a partitioning of the smooth curves to obtain pieces for which the associated free space diagram (Section 2) is well-behaved. His approach relies on analyzing the curves and , introducing cuts to control the turning angle and at points with a certain value for the planar curvature. In contrast to this, our approach is to analyze the free space diagram directly, by studying the boundary of the free space in . The free space is defined as the set of parameter value pairs at which the curves are at most a distance of apart. Working directly with the free space not only leads to a conceptually simpler algorithm, but also avoids relatively complicated integral equations related to the curvature and the turning angle. We propose a refined decomposition of each cell of into a controlled number (depending on the degree of the curves) of subcells (Section 2), for which the existence of a monotone path connecting two intervals on the boundary of a subcell can be read off. Here, the role of convexity of the free space in a cell for polygonal curves is replaced by monotonicity of the boundary curves of within each subcell of the refined decomposition. We emphasize here that our construction of the refined decomposition exclusively accesses the same values that are also required in Rote’s work to process each subcell of .
Unlike the polygonal case, the free space within a cell of can be very complicated, as illustrated by a contour plot of the distance function in parameter space for two degree 3 splines in in Figure 1 for different values of .

Figure 2 shows another example of the kind of behavior of the free space one can expect within a cell.
We note that both Rote’s decision algorithm as well as ours assume values of for which the boundary of has no singularities. A key technical result we show (Section 3) is that singularities of the boundary of are confined to a small number of critical values of and are not necessary for the computation of . Together with the approximation schemes for smooth curves we introduce later on, our results show that the setting of smooth curves provides a natural extended framework for algorithmic approaches to the Fréchet distance.
Computational model
We make the same assumptions as Rote in his work on planar smooth curves, subsuming the real RAM model. In essence, we assume that we can compare two real solutions of an algebraic equation. Specifically, we require being able to compute the intersection of a curve with a sphere of a given radius centered at a point of another curve and find the parameter values in that correspond to the intersections. While we limit the use of such algebraic operations where possible, our approach to the decision problem via construction of a specific partitioning of the free space diagram, the subsequent computation of , as well as the simplification ultimately make use of this assumption. Studying the algebraic numbers involved in the computations for different classes of curves goes beyond the scope of this paper.
2 A combinatorial description of the free space diagram
For two piecewise smooth curves consisting of and pieces, respectively, and , the free space is defined as
The complement of in is commonly referred to as the forbidden region.
There is a natural partition of the joint parameter space of both curves into rectangular cells such that and are smooth when restricting to the interior of each rectangle. We refer to the resulting decomposition of together with the partitioning into the free space and forbidden region as the free space diagram . The primary motivation behind the introduction of the free space diagram is the elementary observation that iff there is a path from to through the free space in that is monotone in both coordinates.
2.1 Overview of the algorithm
Similarly to the classical polygonal case, to solve the decision problem, we investigate the existence of a monotone (in both coordinates) path from to in the free space . To this end, we refine the free space diagram using the boundary of the free space. Our decision algorithm has the following high-level description.
-
1.
Mark the minima and maxima of the boundary of the free space in in the (horizontal) and (vertical) direction.
-
2.
Cut each cell of into subcells, horizontally (vertically) through each marked point if it has a vertical (horizontal) tangent. Mark each point of intersection of a cut with .
-
3.
For each resulting subcell, pair the marked points on the boundary according to how they are connected by through monotone arcs, so that adjacent points are paired.
-
4.
Solve the decision problem for using only the marked points and pairings by computing reachable intervals on the boundaries of cells, in particular
-
(a)
process all cells in lexicographical order of their indices (row by row, from the left);
-
(b)
for each cell, process all subcells within the cell in lexicographical order.
-
(a)
In our analysis, we make certain assumptions on the given with respect to the input curves, which can be ensured by applying a random small perturbation. We follow up our presentation of the decision algorithm with a justification for why this assumption does not lead to loss of generality in the context of using the decision algorithm in practice and to compute the Fréchet distance (Section 3).
2.2 Refining the free space diagram
We consider the boundary of as a set of curves, as opposed to the boundary of a region. We define the three sets and of points on :
-
1.
The set of extrema of the free space in the direction (with horizontal tangent).
-
2.
The set of extrema of the free space in the direction (with vertical tangent).
-
3.
The set of singularities of in the interior of the cells of , consisting of points where is not , which includes points of self-intersection and cusps.
The geometry of is related to the geometry of equidistant curves and can be quite complicated in general. In Section 3, we show that for almost all , there are no singular points of in the interior of each cell in associated to the smooth pieces of the curves, so that , after possibly applying a small perturbation to . We note that for the norms and in the definition of the Fréchet distance, may contain cusp singularities for all values of in an open interval.
Using the points in , (and ), we define a partition of each cell of the free space diagram that lends itself to combinatorial investigations into the decision problem. For simplicity of exposition, we assume that each of , and is a collection of isolated points. In particular, does not have a vertical or horizontal segment, which means that there is no arc of one curve that lies at a constant distance from a point on the other. If there are such circular arcs in any of the three sets, then in the following we represent each such arc by a single point lying on it, distinct from others in the sets.
For a point (), we fix the cell in containing , and trace the vertical (horizontal) line incident to inside this cell. For every point , similarly trace a horizontal line incident to . The result is a refinement of each cell of into a collection of subcells . Figure 2 shows an illustration of the refinement inside a cell of .
Lemma 2.1.
The boundary of the free space in the interior of each subcell in is a union of smooth arcs that are monotone in both coordinates of and are disjoint except possibly at the boundary of a subcell.
Proof 2.2 (Proof of Lemma 2.1).
Consider a curve representing a connected component of inside the interior of a subcell . Observe that cannot intersect another arc of in the interior of and that is at least , as the singular points of are confined to the boundaries of the subcells in .
If is not monotone in either coordinate, consider the case that starts on the bottom edge of and is not vertical and thus locally given as a function of . If is not monotone in the -coordinate, then there are such that . By continuity, there is a point with , whence . By construction, then lies on the vertical boundary of . Other cases for can be treated similarly.
We record each intersection of with the boundary of each subcell , which together form the set of all intersections of subcell walls with .
The construction of consists of finding the intersections of a horizontal or vertical line in with , which amounts to computing the intersections of a given smooth piece of , with a sphere of radius centered at a point of (and vice versa, switching the roles of and ). The associated values for in correspond to the parameter values for the computed points on each curve.
In the following, we impose the general position assumption that is such that and postpone a justification for this assumption to Section 3. The boundary can be naturally interpreted as a graph with vertex set . Each edge of is a monotone arc contained in a subcell, by Lemma 2.1. In the remainder of this section we focus on elucidating two crucial observations regarding . The first is that the combinatorial structure of , i.e., which points of are connected by monotone edges in , can be deduced from the set along with what we call slope information at certain points, which is readily computable additional information which we introduce more carefully below. The second observation is that the answer to the decision problem does not depend on the monotone arcs joining points on subcell walls. In other words, the combinatorial structure of is sufficient to answer the decision problem, which justifies referring to as a combinatorial model for . We elaborate on the necessary adjustments to the existing framework for the decision algorithm for polygonal curves in more detail in Subsection 2.3.
To begin with, we partition the two sets and into the sets and , and and , respectively, according to whether the forbidden region lies locally to the right of or above the point (), or to the left of or below the point (). For the bottom and left edge of each subcell , we refer to the information of whether the boundary at each point in is increasing or decreasing as a function of the horizontal -coordinate as the slope information of these points. In other words, the slope information at a point can be thought of an extra bit associated to that encodes whether curves to the left or to the right at . In Figure 2, the slope information is illustrated by an arrow pointing to the left or right (top or bottom) next to the point on the bottom (left) edge of .

The following somewhat surprising statement is the main result of this section and shows that the slope information on the bottommost and leftmost edges of the original cells of leads to a construction recipe for the combinatorial structure of .
Lemma 2.3.
Assume is such that . There is an algorithm that reproduces the combinatorial structure of , using the sets , and along with the slope information on the bottommost and leftmost edges of , in time .
Proof 2.4.
By Lemma 2.1, each subcell contains only arcs that are monotone in both coordinates. We show that the slope information at the points in that lie on the lower and left edge of is sufficient to know how they are connected through arcs in inside . Transferring the slope information along arcs, we can thus find the structure of in all subcells incrementally, starting from the bottom left, where after every step there is a (new) subcell in where the slope information is known on the bottom and left edges.
Assume first for simplicity that there are no points on the corners of . We remove all points in (corresponding to points in or ) that only touch , so that does not enter . Each point then has an incident arc that enters the interior of , so every point in has to be paired with another such point. To find how they are matched, the algorithm proceeds incrementally, deducing at least one set of matching points at every step.
We consider a number of cases, depending on the behavior of at the as-of-yet unmatched points closest to the corners. Denote by and the bottom, right, top, and left edge of . We further write and for the two unmatched points in on that are farthest apart, i.e., for the left-most and right-most unmatched points, respectively. We similarly define the points and on the edges and , as illustrated in Figures 3 and 4. The combinations of the slope information at the points , and on the left and bottom edges yields a total of cases to consider, where we first assume that these 4 points are distinct. We will show how every case leads to a unique insertion of an arc of matching at least two vertices of , at which point we restart the process to insert another arc until every point is matched.
Case type 1
Consider the case where the arcs of at and move toward each other as in Figure 3(left). Then there is no arc in that connects any point on to and thus necessarily connects to . Since the same argument holds if the arcs of at and curve toward each other as in Figure 3(right), this resolves a total of different possibilities.


Case type 2
Let be decreasing at and at . Since each arc is monotone, cannot be joined to any point lying above , so these two points have to be matched. This takes care of further cases.


Consider next the case where is decreasing at . The case of decreasing at having already been treated above, assume otherwise, so that does not connect to a point on . Moreover, none of the points on can connect to points on or , so they have to be joined to points on . Therefore, if is the number of unmatched points on , connects to the -th point on (and the leftmost points on get joined to points on ). The case where decreases at is analogous, concluding a total of 15 cases.
Last case
The only remaining case not yet treated is the case where is increasing at each of the four points in question, as depicted in Figure 4(right). There are two possibilities. If is not joined by an arc to , then it must be joined to the -th point on (counted from the top), where is the number of unmatched points in on .
The two cases can be distinguished by a simple rule. Let and denote the number of unmatched points on and , respectively. If is connected to the -th point on , then all of the unmatched points in have to be connected to and no point on can be joined to . Since no point on connects to because of the slope, we find that
(1) |
Since every point has to be joined, (1) alone also implies that no point on can be joined to , distinguishing the two cases.
After having matched all points in , we can transfer the slope information from points on the bottom and left edges to the points on and . Note for this that the behavior does not change for points that are in neither of , or , for which the slope at the corresponding points is clear. Lastly, the remaining points on and without slope information that have been matched to each other are marked as decreasing.
To conclude the proof, we next deal with degenerate cases and corner points.
The degenerate cases
Consider now the cases where there are no four pairwise distinct points , and . Notice first that the above analysis already treats the case where there are only three distinct such unmatched points. Also, none of the above cases require the slope information for all four points, so the case study also applies in this situation.
The next case is that of only two distinct extremal points on , which again can be treated very similarly. Likewise, the case of a single point on can be settled in the same way. Last, consider the undiscussed situation where all points on and have been matched. In this case, the unmatched points on have to be matched with those of .
Corner points
To conclude the proof that the points in can be uniquely joined in , we still need to discuss the case where there are points in on the corners of . For corner points on or , the slope information tells us whether or not to include these points in for the matching process. To check if a point in the upper right hand corner needs to be considered in the absence of slope information for that corner point, we first observe that none of the points on or can connect to . If connects to some other point in , then no point on can connect to . Hence, we see that
(2) |
where denotes the number of points on that connect to a point on . The quantities are defined as above, with the convention that the top left and bottom left corner only counts for , the bottom right corner for , and for . Note that the points in any pair of matched points in are incident to a decreasing arc of . Therefore, none of them can connect to . Furthermore, no such pair of points can be separated by an arc from . Thus, (2) can only be valid for a specific value of .
In case is not part of , let denote the number of points on that are connected to a point on . Then , and we see that the right hand side decreases with each pair of matched points from and . All in all, we see that to check if belongs to , one calculates the left and right hand side of (2). Their difference determines if belongs to .
Remark 2.5.
Figure 5 illustrates the necessity of some knowledge of the slope information on edges of a subcell for the accurate reconstruction of inside a cell.

Deriving the slope information
In the following, we explain how to derive the slope information for points in a subcell by evaluating the distance between the two curve segments at specific test points along their parametrization. The process is illustrated in Figure 6. We explain the approach using the example of an extremal point , which belongs to either or , depending on the distance evaluated at three test points. The three points are any points lying, sufficiently close, below, above, and to the left (or right) of . Two of the three points either both belong to the free space or both to the forbidden region, and one will not, determining whether or , as illustrated in Figure 6. A similar analysis can be used to determine the slope information associated to other points (as long as ).
Since lies on the (vertical) boundary of a cell, at least two of the points have natural candidates: We can choose any point on the boundary of the cells that is closer to than any other intersection point with lying on the same (vertical) line. To guarantee that the chosen point in the horizontal direction is sufficiently close to for the analysis to work, we use the same machinery as before in the construction of the cell decomposition. Denoting , let be the first number smaller than where (parametrized by the horizontal axis) intersects the ball of radius centered at . Then the point of evaluation is chosen from the open interval .


2.3 Monotone paths in the free space diagram and the decision problem
In this section, we use the machinery developed above to derive an algorithm that answers the decision problem.
Definition 2.6.
The reachable free space of two curves and is the subset of all points of the free space that are reachable from the origin by a path monotone in both coordinates. The complexity of the reachable free space is the number of original cells with non-empty intersection with .
As before, we can assume (by Proposition 3.12 below) that is such that there are no singularities on the boundary curves of the free space. We will later show (Proposition 3.14) that for algebraically bounded curves the decomposition of and point set in Lemma 2.3 (corresponding to the vertices of the graph ) consists of elements (depending on the allowed degrees of the curves). To obtain bounds on the running time of the algorithm, in the following we assume that the investigated curves are algebraically bounded. A reachable interval is a maximal interval of points on a boundary edge of a subcell, such that every point in is reachable from the origin by a path contained in the free space, that is monotone in both coordinates. In particular, horizontal (vertical) reachable intervals always end on the right (top) either at a vertex of , or at a cell wall, so there are at most reachable intervals. Consider, for example, a reachable interval on the bottom edge of a cell and its left-most point . Points reachable from clearly include all points reachable from any point to the right of within the same interval of free space on the edge. By Lemma 2.1, there is at most one reachable interval on each of the top and right edges of a subcell that is reachable by a monotone path starting from a reachable interval on the left (or bottom) edge of , as illustrated in Figure 7. The set of reachable intervals on the top and right edges of can be readily computed in constant time from the coordinates of the vertices of along with its combinatorial information.

We obtain a graph representation of the reachable intervals as follows. Every reachable interval corresponds to a vertex and two vertices are joined by an edge if both intervals belong to the same subcell and every point of one of the reachable intervals can be joined by a monotone path to some point on the other interval. To construct the resulting graph , consider the original cell decomposition of . We start by checking if and then iterate through the original cells from the bottom left in every row and subsequently move up row by row, computing the reachable intervals on the top and right boundary edges of each cell at every step. To compute these reachable intervals, we compute the reachable intervals on the constant number of subcells in each cell in the same fashion, processing a total of cells. Observe that all reachable intervals have and coordinates that are each already present in the coordinates of the marked points, i.e., vertices of . (We can also compute the combinatorial structure of within a subcell while processing it, as described in the proof of Lemma 2.3.) All in all, we obtain the following result.
Proposition 2.7.
Given two algebraically bounded piecewise smooth curves , in comprised of and pieces, respectively, and a value of such that has no singularities, one can decide if . The running time is bounded by .
Remark 2.8.
In contrast to the situation for polygonal curves, our solution to the decision problem does not automatically yield a parametrization of and that realizes the given distance of . One way of obtaining such parametrizations would be through parametrizations of the arcs of .
We note that a necessary ingredient for the above decision algorithm is being able to compare the coordinates of the points in the set of points used in the construction of the partitioning of . No further algebraic operations are required to solve the decision problem. Observe that the answer to the decision problem depends only on the combinatorial structure of and the ordering of the - and -coordinates of the marked points that give rise to the partition. Away from critical values of , the answer therefore does not change when applying a sufficiently small perturbation of the marked points. Furthermore, in the following section, we deduce that the number of marked points for algebraically bounded curves is bounded, and also show that the number of values of for which the answer to the decision problem is subject to change is bounded for such curves. In particular, we observe that the decision algorithm does not crucially depend on evaluating the required algebraic operations exactly, but can also be carried out approximately.
3 The structure of the boundary of the free space
In this section, we complement the introduced computational approach with results concerning the structure of singular points on that guarantee that our algorithms work correctly. The material in this section provides the technical foundation for the approach outlined above. Observe that even for straight edges, in case of the or norm, can feature non-smooth points that persist when varying , as the free space is the intersection of a parallelogram with (refer to [1]). Although our framework can be adjusted to include these cases, for simplicity, we exclude the values and from our treatment. We discuss the different scenarios for all remaining norms, starting with general smooth curves and subsequently focusing on algebraically bounded curves; see [10] for background on algebraic curves and degree. The central property of an algebraic curve we use is that it cannot intersect a hyperplane in general position more than a constant number (depending on the allowed degree) of times.

Defining the function by , we have that . There are two possible types of singular points of — cusps and points of self-intersection — characterized as those points that do not have a well-defined tangent defined by the Jacobi matrix (gradient) . The singular points correspond to critical points of the function . The image of a critical point is known as a critical value. The entries for are given by
(3) |
The singular points of can thus be described as
(4) | ||||
Geometrically, critical points of for can be described as pairs of points on satisfying the additional criteria
(5) |
Observe that both equations in (4) (or (5)) are continuous for . The implicit function theorem guarantees that, away from critical points, can be described as a collection of planar curves, as illustrated in Figure 8.
The intuitive idea behind the investigations of this section is that since the two equations in (4) are independent of , the solution set (the singular points) should ideally be a collection of isolated points, so that there are only isolated critical values of to which they belong.
Since both and are , the function is for , and for (see also (6) below). For the sake of completeness, we derive the coefficients , with , of the Hessian of , from the Jacobian in (3) of . Up to multiplication by a constant , we compute by differentiating the equations (4), which yields
(6) | ||||
where is the Kronecker delta, which has the value one for and zero otherwise.
Example 3.1.
In case of the Euclidean norm, where , the singularities satisfy the orthogonality condition
(7) |
The singularities thus correspond to pairs of points, one on each of the curves, at which the two tangent vectors are contained in the hyperplane orthogonal to the vector between the pair of points.
Consider the two curves and for and , for some . Notice that both and are curves. Since has infinitely many zeros in , its derivative also has infinitely many zeros in , so there are infinitely many critical points of in for , giving rise to infinitely many critical values. Observe also that the related function for and is infinitely differentiable in and has the same property.
Remark 3.2.
One might find it desirable to find assumptions which imply that the function is a Morse function. A Morse function is a function where the Hessian is non-singular at critical points, see [9]. The Morse lemma would then imply that the critical points described by the equations (4) are isolated, so that the same is also true for the critical values. However, it is noteworthy that there are cases where a small rotation and translation of one of the curves is not be enough to ensure that the critical points are isolated, as can be seen by an adjustment of Example 3.1.
We have the following result regarding the regular, i.e., non-critical values of . To simplify the exposition, we assume that and are smooth, so that consists of a single cell. In particular, we can ignore singularities of due to the nonsmoothness of the curves where the smooth pieces join.
Proposition 3.3.
The set of regular values of is open in for and dense if . For , there is a dense and open set in in which the only possible singular points of are the points where for some . If the points where for all form a null set, then is also dense for .
Proof 3.4.
Let be a sequence of critical values with limit . For every , there is a singular point satisfying (4). Since is compact, we can assume that converges by passing over to a subsequence. The set of critical values is then closed by continuity of (4) and in both and for .
For , is , so by the classical Morse-Sard theorem [14] the set of those that are the image of singular points in has Lebesgue measure zero in . As the complement of a zero-set for the Lebesgue measure, the set of regular values is dense.
We argue similarly for . The regularity of is insufficient to obtain strong bounds on the size of the set of singular values, even with recent generalizations of the Morse-Sard theorem [8]. We thus restrict attention to points where for all , where the Jacobian (3) of is locally Lipschitz, which implies that the set of singular values has measure zero, at least when restricted to these points [3, Theorem 1]. The critical points of the equation are given by . If these form a set of measure zero in for each , then the image of their union under the map is a null set with respect to the Lebesgue measure.
Remark 3.5.
If the curves and are both Morse functions for all , which is almost always the case, then also defines a Morse function on the product space [2, Exercise 4], which implies, by the Morse lemma, that the critical points are isolated [12, Theorem 3.1.1]. Therefore, the last assumption in Proposition 3.3 ensuring that is dense for is satisfied for almost all curves.
Proposition 3.3 does not rule out accumulation points of singular values for general smooth curves, even when , as illustrated in Example 3.1.
Lemma 3.6.
Let , be a simple component of , such that has two components, each with non-empty interior. Let be a region in enclosed by . If admits a neighborhood that has empty intersection with all other components of , then is everywhere differentiable, i.e., does not have any cusps.
Proof 3.7.
We sketch the proof, which can be seen as a consequence of the classification of the shape of the free space inside a cell of the free space diagram associated to two line segments [1, Lemma 3], as the intersection of a smooth ellipse with a rectangle. The statement there is only for the -norm, but can be naturally extended by noting that for , the boundary of the set of all points with norm from a given point is , as follows from the regular value theorem since any is a regular value of the -norm.
The question of whether a point on corresponding to the two points and on the two curves with distance is a cusp is inherently a local one. By differentiability of the two curves, they are approximated locally by their tangents and within a sufficiently small neighborhoods of and , we can picture the curves as a result of a differentiable deformation of their tangents at these points. Such a deformation leads to a similar local deformation of the boundary of the free space. Indeed, the boundary of the free space for the linear tangents is for noncritical values of the distance parameter , which remains that way after a small local differentiable deformation of the linear tangents. We therefore have regularity of at .
As a consequence of Lemma 3.6, the critical values of for coincide with the appearance of a new component, or the merging of components in the free space diagram.
We will show that if the piecewise smooth curves and consist of algebraically bounded curves, Proposition 3.3 can be strengthened. To this end, we need some preparation.
Lemma 3.8.
Let be an algebraically bounded curve. Then is tangent to only finitely many -spheres centered at the origin, given by for some , with bound depending only on the degree bound of the curve.
Proof 3.9.
First note that the statement of the lemma is well-known to be true if we replace -spheres by hyperplanes orthogonal to a coordinate axis. Indeed, an algebraic curve of a given degree only has finitely many extrema in a given coordinate direction (if it is not contained in such a plane), as the extrema correspond to algebraic sets themselves, obtained through partial derivatives of each of the defining equations of . To derive the statement for -spheres, we make use of a variant of stereographic projection that considers all -spheres of positive radius at the same time. For a sphere , centered at the origin, with radius , we define the function (see Figure 9)
with inverse

Outside of the points where , we obtain a rational map defined on all of , mapping all -spheres centered at the origin to hyperplanes, with rational inverse. Therefore, if was tangent to infinitely many spheres, the algebraic curve that is its image under would be tangent to infinitely many hyperplanes. However, as pointed out above, the number of times this can happen is a finite number depending on the degree of the algebraic curve in question, concluding the proof.
Lemma 3.10.
Algebraically bounded curves can intersect an -sphere only a finite number of times, with bound depending only on the degree bound.
Proof 3.11.
Assume otherwise, so that there is a sphere that intersects a curve some large number of times. Since is compact, there are arbitrarily many intersection points within a small neighborhood in . Consider the pencil of -spheres centered at a point in the middle of . One readily sees that the number of times is tangent to some sphere in this pencil can be made arbitrarily large, which would contradict Lemma 3.8.
The underlying idea of the proof of Lemma 3.10 can be also used to show the following.
Proposition 3.12.
Let and be algebraically bounded curves. Then there are only finitely many (with bound depending only on the degree bound) critical values of for .
It is instructive to first consider the important case that , and both and have (componentwise) parametrizations as polynomials or more generally rational functions. Observe that in this case the set of critical points of is an algebraic set, and thus the finite union of irreducible algebraic sets, which correspond to connected components in both the Zariski and the usual topology [10] (for this, instead of just real numbers, we also allow complex numbers as input for ). The image on each connected set of critical points under the function is constant, so the image of all critical points leads to only finitely many critical values of . Note that the number of irreducible algebraic sets is bounded in terms of the degree bound of the curves.
Proof 3.13 (Proof of Proposition 3.12).
We now treat the general case, for which we argue geometrically. By Lemma 3.6, for , a critical value of the function corresponds to either the appearance of a new component of , or to two (or more) components becoming tangent, at some critical point . In , by (5), these events correspond to becoming tangent at to an -ball centered at a point ; conversely, the same ball centered at is tangent to at .
Assume that there are infinitely many distinct critical values where these events take place. Then, by compactness of , there is a convergent subsequence of critical points in corresponding to pairs of points on the two curves where these events happen for distinct values of . We can assume that the terms of the sequence are pairwise distinct. We consider the sequences as given by and in the first and second coordinates, respectively, and assume, without loss of generality, that the are pairwise distinct. The tangent vectors of at lie in the hyperplanes tangent to balls centered at the convergent sequence of points . For sufficiently large , the tangent vectors of at are roughly the same. As a consequence, the pencil of -spheres based at a point sufficiently close to contains an unbounded number of tangencies to the curve as alternates between moving away from and towards . This is illustrated in Figure 10, showing the tangent vectors of ‘bundle’ together around the eventual limit vector. We can further assume that the spheres do not contain an entire part of by applying a small perturbation to the sphere if necessary. However, this would again contradict Lemma 3.8, so we can discard the assumption of infinitely many critical values of .

To see that the number of critical values is in fact bounded by a constant depending on the bound on the degrees of the algebraic curves, we assume otherwise and argue very similarly to above. Indeed, given a sequence of curves with unbounded number of critical values leads to an arbitrary number of critical points within an arbitrary small neighborhood in . By rescaling, we can assume that the arclength of the curves in the sequence is bounded and thus, just as above, we have that an arbitrary number of critical points correspond to points and tangents on each of the curves that are arbitrarily close to each other.
Similarly to the proof of Proposition 3.12 which bounds the number of critical values of , we also obtain a similar bound on the number of marked points for a regular value of .
Proposition 3.14.
The number of points (components) in each of the sets , (and ) is at most a constant in each cell, for a total of , whenever are algebraically bounded, consisting of , resp. smooth pieces, and is a regular value. The resulting decomposition of the free space diagram consists of cells.
Proposition 3.14 implies that the bound on the degree of a set of algebraically bounded curves determines a bound on the number of points used in the decomposition of , for any regular value of , thereby providing the justification for the complexity bounds on the running-time of our decision algorithm. The proof is very similar to that of Proposition 3.12.
Proof 3.15 (Proof of Proposition 3.14).
Assume that there is a sequence of values for a given for which the number of points in, say, becomes greater than any given constant, then we can arrive at a contradiction, similarly to the proof of Proposition 3.12. The idea is that in this case, there has to be an arbitrary number of points in, say, , that are arbitrarily close to each other in . By rescaling the curves (and ) to normalize the length of the longer curve, we can assume that these points correspond to arbitrarily close points along and in . This again allows the construction of a pencil of -spheres with an arbitrary number of tangencies to , contradicting Lemma 3.8.
By Lemma 3.10, we see that each of the finitely many extrema leads to only finitely many marked points. Again by rescaling, one can eliminate the possibility that the maximum number of points in depends on .
4 The minimization problem of computing the Fréchet distance
The aim of this section is to use the solution of the decision problem to solve the optimization problem of finding the minimal for which the decision problem for two curves has a positive answer, which corresponds to the Fréchet distance between the curves. Assuming that all , resp. smooth pieces of , resp. are algebraically bounded curves, we show that the number of operations required for the computation is of the same complexity as the polygonal case. The results outlined in this section mostly essentially mirror those for smooth planar curves under the -distance in [13].
The central idea is to invoke Megiddo’s parametric search technique [11], together with the optimization introduced by Cole [6]. Parametric search is the standard approach to computing the Fréchet distance and its variants [1, 15, 13, 5]. In the following, we explain the adjustments necessary to apply it to the situation of algebraically bounded curves.
The combinatorial structure of the partition of the free space diagram introduced in Section 2 changes only at certain critical values of . In addition to these values being critical values of the function introduced in Section 3, there are further possibilities. By Lemma 3.6, the only values of where the decision problem can change are related to the emergence or merging of components of free space, a component becoming tangent to the boundary of walls of original cells, a marked point appearing or disappearing, or the ordering of the - and -coordinates of the marked points changing. The results of the previous section imply that the set of where none of these events occur is open. Moreover, we observe that a new marked point that is not naturally related to a previously marked point can appear (or disappear) only a finite number of times, bounded by a constant depending on the degree of the algebraically bounded curves. Similarly to the proof of Proposition 3.14, this is again a consequence of the fact that if there did exist a sequence of values of with an ever increasing number of such events, then there is a sequence of points on the curves that ultimately contradict the property that algebraically bounded curves cannot be tangent to sphere centered at a fixed point more than a fixed number of times. A similar argument also shows that the ordering of the marked points cannot change more often than a constant depending on the degree bound of the curves, as the ordering is subject to change only when extremal points meet on the same vertical or horizontal line in .
There are critical values of between which no marked points appear or disappear, and no components merge, appear, or start touching the boundary of cells. We apply a binary search among these critical values so that the only changes to the answer of the decision problem are due to a change of the order of the extremal points in the - and -direction. Every step of the binary search involves running the decision algorithm, resulting in a running time of for this step. Note that since we cannot run our decision algorithm directly on these critical values, we have to move to a value for that lies between them. As a result, the binary search only narrows down the interval of to two possible, adjacent intervals, instead of one. Inbetween these critical values, we use Cole’s variant of parametric search with a parallel sorting algorithm for both the - and -coordinates of the marked points of , to obtain an overall running time of . The value of the Fréchet distance is the lowest point of the lowest interval in which the decision problem has a positive answer. The result is summarized in Theorem 4.1.
Theorem 4.1.
Let and be two algebraically bounded curves in consisting of and pieces, respectively. Then the Fréchet distance between and can be computed in space and in operations (of bounded algebraic complexity).
5 Simplification of piecewise smooth curves
In this section, we introduce an algorithm to simplify a piecewise smooth curve consisting of smooth pieces and runs in time. We adapt the approach of [7] to our setting of piecewise smooth curves with appropriate changes.
Computing the simplification of a piecewise smooth curve with respect to .
Starting with the first smooth piece of , consider its arc length . If , then we move on to the next piece and start over from there. Let be the first piece with . Then is contained in the ball of radius centered at . Following the curve , let be the first piece of that leaves . We take the first point on lying on the boundary and join to with a straight line of length , replacing the part of between and ; and with the part of it after . We then restart the procedure at . If after any piece with , does not intersect the boundary of , then we remove the part of after .
The simplification algorithm results in a piecewise smooth curve with each piece of having an arc length of at least . Note that the algebraic operation of intersecting with a ball is the same operation required in the computation of the Fréchet distance between two curves.
Lemma 5.1.
The simplification of a piecewise smooth curve defined by Algorithm 5 above satisfies . In particular, .

Here, denotes the Minkowski sum of and . The situation is illustrated in Figure 11.
Proof 5.2.
Let be the first new segment of and the portion of that gets replaced by in and has the same endpoints and as . Now, is contained in , so and the statement about the Minkowski sum follows, which in turn implies the statement about the Fréchet distance. Indeed, we can traverse and until , then traverse while the parametrization of stays on . Then, is traversed until is reached for both parametrizations, while maintaining a distance of at most .
5.1 Preserving -packedness
We make precise the idea that since each piece of a simplified curve is -close to , the length contained in any ball cannot increase too much through the simplification.
Lemma 5.3.
Let , with a piecewise smooth curve. Then for any and , .
The situation is illustrated in Figure 12.

Proof 5.4.
Let be a segment of and . Consider the subcurve of that gets replaced by in and has the same endpoints as . By Lemma 5.1, . Moreover, , so . Since is a straight line, it is the shortest path connecting its two endpoints. Therefore, we can erect two planes orthogonal to at the endpoints such that any path connecting these two planes must have length at least . In particular, since contains such a path, . The statement of the lemma follows by summing over the intersections of all pieces of with .
Lemma 5.5.
Let be a -packed planar smooth curve and . Then the simplified curve is a -packed curve.
Proof 5.6.
For the sake of contradiction, assume that . We consider first the case that . Then Lemma 5.3 implies that . However, since is -packed, we also have , a contradiction.
Let . Let denote the number of curve pieces of in and consider , where denotes the number of original pieces of in that are also present in and denotes the number of new curve pieces that intersect . Since is -packed, the curved pieces in present in both and cannot have a total length greater than . Therefore, if , then the new pieces have to add up in length to at least . Since the new pieces are straight lines they can contribute at most in length to the intersection , so .
Observe that , since a new segment of intersecting also intersects and each curve piece in has length at least . Therefore, by Lemma 5.3, , which contradicts the -packedness of .
We note that the results and proofs in this section are valid for all simplifications of -packed curves, as long as the simplified curve
-
1.
is contained in a tubular neighborhood of the original curve,
-
2.
consists of pieces with arc length bounded from below by .
6 The relative free space complexity of simplified smooth curves
The central idea of the approximation algorithm for the decision problem for piecewise smooth curves is to replace the two curves in question with their simplifications. To study the complexity of the reachable free space, we examine the following central quantity.
Definition 6.1.
The -relative free space complexity of two curves and is
Proposition 6.2.
Let and be two piecewise smooth curves that are -packed and such that the arc length of each of the pieces is at least . Then the number of cells in containing non-empty free space is in .
Proof 6.3.
Assign a counter to all pieces of the two curves, starting with the value . Each cell in has two associated smooth pieces and of and , respectively. The free space in the cell associated to and is non-empty if and only if there are two points and such that . For every cell in with non-empty free space, we add one to the counter of the shorter of the two pieces. Figure 13 shows the pieces that contribute to the counter for in red. We bound the maximal possible value of the counter of each piece as follows.

For a piece of , consider the ball of radius centered at its midpoint . By construction, the distance of every point of to the boundary of is at least . Therefore, every piece of that adds one to the counter of has an arc length of at least in . Since is -packed and , the number of times we add one to the counter of is bounded from above by
Thus, there are at most cells containing free space, concluding the proof of the proposition.
Theorem 6.4.
Let and be two -packed piecewise smooth curves and . Then .
Proof 6.5.
We can now apply the solution to the decision problem from Proposition 2.7 to the decision problem for the simplified curves. Using this decision procedure in place of that for polygonal curves, the otherwise same algorithms (Lemmas 3.5 and 3.6) in [7] can be used in our context to obtain an approximate solution to the decision problem for piecewise smooth -packed curves that runs in time. We note that -packedness is used only in its role in guaranteeing that by Theorem 6.4.
Corollary 6.6.
Let and be two piecewise smooth algebraically bounded -packed curves, and . There is an algorithm that correctly outputs, in time, one of the following:
-
(i)
a -approximation to ,
-
(ii)
,
-
(iii)
.
References
- [1] Helmut Alt and Michael Godau. Computing the Fréchet distance between two polygonal curves. International Journal of Computational Geometry and Applications, 05(01n02):75–91, mar 1995. doi:10.1142/S0218195995000064.
- [2] Michèle Audin and Mihai Damian. Morse Theory and Floer Homology. Universitext. Springer London, London, 2014. URL: http://link.springer.com/10.1007/978-1-4471-5496-9, doi:10.1007/978-1-4471-5496-9.
- [3] Sean Michael Bates. Toward a Precise Smoothness Hypothesis in Sard’s Theorem. Proceedings of the American Mathematical Society, 117(1):279, 1993. doi:10.2307/2159728.
- [4] Karl Bringmann. Why walking the dog takes time: Frechet distance has no strongly subquadratic algorithms unless SETH fails. In Proceedings - Annual IEEE Symposium on Foundations of Computer Science, FOCS, pages 661–670, 2014. arXiv:1404.1448, doi:10.1109/FOCS.2014.76.
- [5] Erin W. Chambers, Éric Colin de Verdière, Jeff Erickson, Sylvain Lazard, Francis Lazarus, and Shripad Thite. Homotopic fréchet distance between curves or, walking your dog in the woods in polynomial time. Comput. Geom., 43(3):295–311, 2010. URL: https://doi.org/10.1016/j.comgeo.2009.02.008, doi:10.1016/J.COMGEO.2009.02.008.
- [6] Richard Cole. Slowing down sorting networks to obtain faster sorting algorithms. Journal of the ACM, 34(1):200–208, jan 1987. doi:10.1145/7531.7537.
- [7] Anne Driemel, Sariel Har-Peled, and Carola Wenk. Approximating the Fréchet distance for realistic curves in near linear time. Discrete and Computational Geometry, 48(1):94–127, 2012. arXiv:1003.0460, doi:10.1007/s00454-012-9402-z.
- [8] Adele Ferone, Mikhail V. Korobkov, and Alba Roviello. On some universal Morse–Sard type theorems. Journal des Mathematiques Pures et Appliquees, 139:1–34, 2020. doi:10.1016/j.matpur.2020.05.002.
- [9] Victor Guillemin and Alan Pollack. Differential Topology, volume 4. American Mathematical Society, Providence, Rhode Island, aug 2010. URL: http://www.ams.org/chel/370, doi:10.1090/chel/370.
- [10] Robin Hartshorne. Algebraic Geometry, volume 52 of Graduate Texts in Mathematics. Springer New York, New York, NY, 1977. doi:10.1007/978-1-4757-3849-0.
- [11] Nimrod Megiddo. Applying Parallel Computation Algorithms in the Design of Serial Algorithms. Journal of the ACM, 30(4):852–865, oct 1983. doi:10.1145/2157.322410.
- [12] Louis Nirenberg. Topics in Nonlinear Functional Analysis, volume 6 of Courant Lecture Notes. American Mathematical Society, Providence, Rhode Island, apr 2001. doi:10.1090/cln/006.
- [13] Günter Rote. Computing the Fréchet distance between piecewise smooth curves. Computational Geometry: Theory and Applications, 37(3 SPEC. ISS.):162–174, aug 2007. doi:10.1016/J.COMGEO.2005.01.004.
- [14] Arthur Sard. The measure of the critical values of differentiable maps. Bulletin of the American Mathematical Society, 48(12):883–890, 1942. doi:10.1090/S0002-9904-1942-07811-6.
- [15] René van Oostrum and Remco C. Veltkamp. Parametric search made practical. Comput. Geom., 28(2-3):75–88, 2004. URL: https://doi.org/10.1016/j.comgeo.2004.03.006, doi:10.1016/J.COMGEO.2004.03.006.