On Fréchet Traveling Salesmen Problems
Abstract
The Fréchet distance is a well-studied distance measure between two curves. In this work, we demonstrate that the merit of Fréchet distance extends beyond evaluating similarity, and introduce a new setting in which it proves useful. Consider a situation where two agents are required to visit a given set of sites, while staying close to each other throughout their traversal. In this paper, we study problems where the goal is to construct two curves whose vertices are from a given set of points, under the constraint that the Fréchet distance between the curves is kept as small as possible. This problem can be viewed as a variant of the Traveling Salesman Problem (TSP), and thus may be of interest in routing, network planning and more. We present a near-linear algorithm for this problem under the discrete Fréchet distance, and explore several variants of the problem, including minimizing the lengths of the curves and balancing the number of sites assigned to each agent. Lastly, we prove that the problem is NP-hard under the continuous Fréchet Distance.
Keywords and phrases:
Fréchet distance, traveling salesman problemCopyright and License:
2012 ACM Subject Classification:
Theory of computation Computational geometryAcknowledgements:
We would like to thank an anonymous reviewer for helpful comments and references, and in particular for suggesting the expected linear time algorithm in Section 3.Funding:
This research was supported by the ISRAEL SCIENCE FOUNDATION (grant No. 2135/24).Editor:
Pierre FraigniaudSeries and Publisher:
Leibniz International Proceedings in Informatics, Schloss Dagstuhl – Leibniz-Zentrum für Informatik
1 Introduction
The traveling salesman problem (TSP) asks for the shortest route that visits a given set of points. It is a classic NP-hard problem, and have various approximation algorithms (including a PTAS in the Euclidean plane [4, 23]). In some generalizations of TSP, e.g. the Vehicle Routing Problem or Multiple-TSP (see, e.g. [5, 7, 12, 24]), the goal is to plan short routes for a group of agents to visit all the points together. In these variants there is no restriction on the relations between the routes.
Consider a situation where two agents are asked to visit a given set of sites, they can split but they still need to remain close to each other throughout their motion. This can be required for example in order to keep then in some range of communication, or so that one agent can quickly get to other in case of trouble. Therefore, in this paper, we introduce and study a new set of problems where the goal is to plan routes for two (or more) agents, that together visit a given set of sites, while keeping the agents close to each other throughout the traversal. More precisely, our goal is to construct two curves from a given set of points, such that the (continuous or discrete) Fréchet distance between the curves is as small as possible. We also consider variations of this Fréchet-TSP type problem where the goal is to balance the load on the agents, in different ways.
The Fréchet distance [18], introduced by Maurice Fréchet, is a popular measure of similarity between curves. It is often described by an analogy of a person and a dog connected by a leash, both walking forward along two separate curves, while the leash keeps them at a bounded distance. The Fréchet distance is then the shortest length of a leash that allows them to traverse their respective curves. The Fréchet distance takes into account both the position and ordering of points, distinguishing it from other metrics like the Hausdorff distance. This property makes the Fréchet distance useful across a wide range of applications.
The discrete Fréchet distance focuses solely on the points of the curves rather than the edges between them. This variant can be described analogously by replacing the man and dog by two frogs that are “hopping” along the vertices of the curves while attempting to maintain a small distance between them. This discrete approach allows simpler and (slightly) faster algorithms for computing the distance.
Alt and Godau [3] showed that the Fréchet distance between a curve of length and a curve of length , can be calculated in time. Eiter and Mannila [16] showed that the discrete Fréchet distance can be computed in time. Only 20 years later, it has been shown that under the Strong Exponential Time Hypothesis (SETH), the Fréchet distance cannot be computed in strongly subquadratic time [9]. Very recently, Cheng, Huang, and Zhang [13], presented a strong subquadratic time algorithm that computes a -approximation for both the discrete and continuous distance.
A plethora of applications and variants of the Fréchet distance have been studied since then (see, e.g. [10, 14, 15, 21]). The variant most relevant to our work is the Fréchet distance between two point sets, recently studied by Buchin and Kilgus [11]. In this variant, the input objects are two sets of points rather than two curves, and the goal is to construct two curves (one for each set of points), to minimize the Fréchet distance between them. The main difference from our version is that we also need to find a partition of the point set into two sets. Buchin and Kilgus showed that under the discrete Fréchet distance, the problem is equivalent to computing the Hausdorff distance between the two sets, and thus can be solved in time (where are the sizes of the two sets). The continuous version, on the other hand, was shown to be NP-complete. They also provide an exponential time algorithm running in where denotes the number of points that can be matched only to edges (“floating” points in their terminology) and is the maximum number of edges that can cover such a point.
Another closely related variant is the Curve-Point-Set Matching Problem (CPSM), where given a polygonal curve , a set of points , and a maximum distance , the objective is to find another polygonal curve , whose set of vertices is either a subset of or contains all the points of (also, either with or without repetitions, referred to as the non-unique/unique variant, respectively), such that the continuous or discrete Fréchet distance between the new curve and the original curve is smaller than . Maheshwari, Arora, and Smid [22] addressed the continuous non-unique subset version of the problem, and presented an algorithm that runs in time. Wylie [26] studied CPSM under the discrete Fréchet distance, and proved that the unique version (where each point in can appear only once in ) is NP-complete for both the subset and all-point versions. This is in contrast to the non-unique cases which were shown to be polynomial-time solvable (in time, where is the size of and the size of ). Accisano and Ungor [1] also showed NP-completeness under the continuous distance for the all-points variant, both in unique and non-unique settings.
Overview.
To the best of our knowledge, the Fréchet-TSP problem described above has not been studied before. This gives rise to a rich family of TSP-style questions centered around the Fréchet distance, and we systematically outline several natural variants that capture different aspects of this setting. In Section 3, we present an algorithm for the discrete Fréchet-TSP problem that runs in time for a set of points in a constant dimension. We utilize a combination of the properties of Nearest-Neighbor-Graph and Minimum-Spanning Tree (MST) over a Unit-Disk Graph (UDG). By utilizing the properties of UDG, we ensure an upper bound on the distance between the partitions we output. By utilizing the properties of the MST, we obtain a linear time partitioning. The initialization of these constructs are obtained in time. In Section 4, we consider a variant of the problem aiming to minimize the total length of the curves, and present a constant-factor approximation algorithm that also runs in time. In Section 5, we focus on balancing the number of vertices among the partitioned components, and present different strategies to achieve almost optimal balance. Here, we utilize the properties of the UDG again. Specifically, the upper bound on the number of kissing number of the graph. This in turn limits the number of cases in the possible partition we wish to balance. We handle these case-by-case showing that we can get the balance as close as at most 1 from optimal. Finally, in Section 6, we show that the continuous variant of Fréchet-TSP is NP-hard. Out proof is an adaptation of the method used by Buchin and Kilgus [11].
2 Notations and problem definition
A polygonal curve in is a continuous function , such that for any integer the restriction of to the interval is a straight line segment. The points are the vertices of , and the segments are the edges of .
Let and be two polygonal curves of with number of vertices and , respectively.
The (continuous) Fréchet distance.
A reparameterization of a curve is a continuous, non-decreasing, surjective function such that and . The Fréchet distance between and is defined as where is a reparameterization of and is a reparameterization of .
The discrete Fréchet distance.
111For the simplicity of presentation, we follow the definition given in [6], which is equivalent to the original definition given in [16].A paired-walk along and is a sequence of pairs , such that and partition and , respectively, into (disjoint) non-empty subsequences of their vertices, and for any it holds that either or . The cost of a paired walk along and is
For any pair , we say that is matched to in .
The discrete Fréchet distance between and is , where is the set of all possible paired-walks along and .
Partitioning a point set into curves.
Let be a Fréchet-based distance measure for two curves in (i.e., either the continuous or discrete Fréchet distance). Given a set of points in , we say that two curves partition if there is a partition of into two sets and such that the set of vertices of is exactly and the set of vertices of is exactly , and each point in is used exactly once (either in or in ). The basic version of the problem that we wish to consider is the following.
Problem 1 (Fréchet-TSP).
Given a set of points in , find two curves that partition and such that is minimized.
Note that if we do not require each point in to be visited by exactly one of the agents, then the problem becomes trivial: we can pick any order on the points in and set , so the distance between the paths is . In the full version of the paper, we discuss a variant in which we allow a point to be used more than once by the same agent, and show that this variant is equivalent to Problem 1 under the discrete Fréchet distance.
Denote by the distance between the curves in an optimal solution for the Fréchet-TSP problem. Clearly, there may be many different optimal solutions, all having distance . However, some solutions may be considered better than others, for example, if each curve covers roughly the same number of points from (balanced partition – see Figure 1), or if the min-max length (or sum of lengths) of the curves is very small in comparison to other solutions (see Figure 2). We therefore define below different variants of the problem in which the goal is to find a “good” solution among those that achieve the optimal distance .
Problem 2 (balanced-Fréchet-TSP).
Given a set of points in , find two curves that partition , such that , and is minimized.
For a curve , denote by the sum of the lengths of the edges of .
Problem 3 (min-max-Fréchet-TSP).
Given a set of points in , find two curves that partition , such that , and is minimized.
Problem 4 (min-sum-Fréchet-TSP).
Given a set of points in , find two curves that partition , such that , and is minimized.
Minimizing the length of the path is NP-hard, similar to the traveling salesman problem (TSP), which is NP-hard: for a reduction, simply double each point in an instance of TSP, leading to the following theorem:
Corollary 1.
min-max-Fréchet-TSP and min-sum-Fréchet-TSP are NP-hard.
We can thus aim to find an approximation algorithm for minimizing the length.
3 Discrete Fréchet-TSP
In this section, we focus on the discrete Fréchet distance (i.e. ). We begin by presenting an algorithm for the decision version of the problem: Given a set of points in , and a threshold , decide whether there exist two curves and that partition and have .
Let be the graph whose vertices are the points in , and there is an edge if and only if . By definition, is a unit-disk graph with radius . Let be two curves that partition s.t. the edges in are edges from . Any paired walk along and with can be reduced to a set of disjoint stars in simply by removing edges from . Therefore, if there is such a walk , then there is such a set of disjoint starts and vice versa. Thus, we can search for such a set.
Lemma 2.
There exist two curves that partition and have if and only if does not contain a vertex of degree .
Proof.
If contains a vertex of degree , then there is no with . Therefore, cannot be matched to any other point in in a paired-walk of cost at most . For the other direction, let be a connected component of . We now show that if contains more than one vertex, then we can construct two curves on the set of vertices of as required. This finishes the proof, as we can concatenate the curves that were constructed for all the connected components, and get two curves with vertices from such that each point in is used exactly once. Let be some spanning tree of . We color the vertices of red and blue, as follows: first, color all the leaves in red, and then, color the parents of all those leaves in blue. This coloring defines a set of stars, each has a blue center node and at least one red node. By removing these stars from , we are left with a smaller tree, . If is a single vertex, then color it red and add it to one of the stars of its child nodes. Otherwise, contains at least one edge. We then repeat the process on and obtain another set of stars, remove them from and get a smaller tree . We continue this process until all the vertices are colored. This process results in a partition of the nodes of into stars , each star contains exactly one blue node , and a non empty sequence of red nodes . Let and . Since for each we have for every , the sequence of stars corresponds to a paired-walk with cost at most , and therefore we get .
Note that Lemma 2 provides an algorithm for computing a partition of into two curves such that . Given a spanning forest of , the running time for constructing is , since each tree can be colored using a a simple BFS traversal. We conclude this in the following corollary.
Corollary 3.
Given a spanning forest of such that no vertex in has degree , a partition of with can be constructed in time.
We wish to find the partition of that minimizes . Denote by the distance between the curves in an optimal partition, i.e., there exists a partition of with , and for any partition of it holds that . In Claim 4 below, we show that is the furthest nearest neighbor distance, i.e., the length of the longest edge in the Nearest Neighbor Graph of .
Denote by the Nearest Neighbor Graph (NNG) of , i.e., the graph whose vertices are the points of , and there is an edge is the graph if and only if is a nearest neighbor of in . Note that a point can have more than a single nearest neighbor. In this case, we break ties by taking the point with the largest index to be the unique nearest neighbor. It is well-known that when applying such a tie-breaking rule, the NNG is a forest, and a subgraph of the Euclidean minimum spanning tree.
Claim 4.
Let be the longest edge in . Then .
Proof.
Notice that is a spanning forest of that does not contain any vertex of degree (every point in has a unique nearest neighbor). Therefore, by Corollary 3 we get that there exists a partition of with .
Assume by contradiction that there is a partition of with , and consider a paired-walk along and with cost . Then for any pair of points that are matched in , we have . Let be the longest edge in , so , and are not matched in . Therefore, there exists such that are matched in and are matched in . We get that , so is not a nearest neighbor of , and , so is not a nearest neighbor of , a contradiction to being an edge of .
By Claim 4, all the edges of have length smaller or equal to the optimal distance , and therefore it is a spanning forest of . Thus, given as an input, the algorithm from Corollary 3 runs in time. For , computing can be dome in time [17]. For general dimension , computing can be done in time [25], so the overall running time for our problem is for any fixed dimension .
We, therefore, obtain the following theorem.
Theorem 5.
Given a set of points in , for any fixed dimension , one can find two curves that partition such that is minimized in time.
In the two remarks below, we suggest other ways to use Claim 4 and Corollary 3 for computing an optimal partition of .
Remark 6 (Using the Net and Prune framework).
Har-Peled and Raichel [19] show that the furthest nearest neighbor distance (which, by Claim 4, equals ) can be computed in expected linear time for points in any dimension . Then, to apply Corollary 3, we need to compute a spanning forest of such that no vertex in has degree . For this we can use the Net and Prune framework of [19] as follows. Put in a grid with cell diameter . Points that belong to the same grid cell form a clique in , and can be connected, for example, by some star graph. The lonely points, i.e., points that are alone in their cell, can be connected to a point in a neighbor cell (such a point must exist by the way we chose ). Since the number of neighbor cells is , this results in an time algorithm for computing the spanning forest, and expected time for computing the partition.
Remark 7 (Using the MST).
For points in dimension , we can use the the Minimum Spanning Tree of () instead of as follows. We compute , and then iterate the edges from the longest to shortest. If removing an edge from does not create a vertex of degree , remove it, and otherwise stop. Since , and because in there is no vertex of degree , the resulting graph contains and the length of its edges is at most . We can then execute the algorithm from Corollary 3 on this residue graph. Since can be computed in time [2], this is also the total running time of the algorithm. Notice that for , where , we prefer to run the algorithm that finds the residue graph over computing . This is because the running time for finding the residue graph is while computing is in .
4 Minimizing the lengths
In this section, we focus on problems 3 and 4. Let be a set of points in the plane. Our goal is to find a partition with . In problem 3, the partition also minimizes . In problem 4 it also minimizes .
Let be a path on of minimum length. Denote by the sum of edge lengths of a graph embedded in the plane.
4.1 Min-max discrete Fréchet-TSP
In this section, we prove the following theorem.
Theorem 8.
Given a set of points in the plane, two curves that partition such that and can be found in time.
By Theorem 5, computing the value can be done in time. Let be a minimum spanning tree of , and observe that . We thus focus on computing two curves that partition such that and . For simplicity, we say that two points (or vertices) are close if , and otherwise we say that are far.
Observation 9.
Every vertex in has at least one neighbor in that is close to it.
Proof.
Assume by contradiction that all the neighbors of a vertex in are far from . By Lemma 2, has a neighbor in , and therefore is close to . This contradicts the fact that the MST contains a nearest neighbor for each vertex (by Kruskal’s algorithm).
We now show how to construct two curves and that partition by traversing in a DFS order, starting from a leaf vertex of as a root, and coloring the vertices red and blue. The blue vertices will be in , and the red vertices in . The order of the points along the curves would be the same order in which they where colored during the algorithm.
Consider a vertex in the rooted tree . Let be the set of children of that are close to , and similarly, will be the set of children of that are far from . In addition, let . In other words, is the set of lonely children of – those that are either leaves in , or that do not have close children – and therefore must be in ’s star. Notice that by Observation 9, all the nodes in are close to .
Let be the current vertex visited by the DFS algorithm. The invariant of our recursive DFS algorithm is that if is empty, then there must be at least one vertex in . The algorithm has two main steps: in the first step we color vertices in red and blue, and the second step contains the recursive calls.
Coloring.
In this step, we color the entire star that belongs to using Algorithm 1. Note that can be either a center or a leaf in that star. Also, Algorithm 1 colors exactly one vertex in blue and the rest in red. We progress in recursion on the vertices of the tree. In each recursive call, we activate the coloring algorithm on newly colored vertices in the following order:
-
1.
First, activate the algorithm on children of vertices that are colored red, in reversed order (last colored first called).
-
2.
then, activate the algorithm on children of the blue vertex.
First, notice that when the algorithm is called with a vertex in a recursive step, then and its entire subtree were not colored yet. Moreover, we show that the following invariant holds in each step of the algorithm.
Claim 10.
In each step of the algorithm, if is empty, then there must be at least one vertex in .
Proof.
Assume by contradiction that in some step of the algorithm both and are empty. Then, by Observation 9, must have a parent in such that , and was already colored by the algorithm. Moreover, is in , because . Therefore, it is not possible that was colored blue, because then would have been already colored red and would not be called recursively. In addition, is not a lonely child of its parent, because . Therefore, if was colored red, then it must be in step 2(a) of the algorithm, which means that is empty, but this is not possible because .
Let (resp. ) be the set of vertices that were colored blue (resp. red), in the order in which they were colored during the DFS scan.
Claim 11.
The running time for computing and is .
Proof.
Calculating the Euclidean MST for the set takes time. A standard DFS traversal over the MST also requires time. The additional overhead in the algorithm comes from recursively scanning the children of each vertex . Since in the EMST, this adds at most additional operations. Thus, the total running time remains .
Claim 12.
.
Proof.
We show that in each step of the algorithm, we color a star in with edges of length at most . The center is colored blue, and the leaves red. Let be the current vertex. There are two cases:
-
If is not empty, then is colored blue and the nodes in are colored red. Since (by Observation 9), this red-blue star has edges of length at most .
-
If , then the algorithm picks a vertex and color it blue. This vertex becomes the center of a star with its children which are colored red. Since , we again obtain a red-blue star with edges of length at most .
Since the vertices of and are ordered by the time they were colored, we get that the sequence of starts corresponds to a paired-walk of cost at most between and , as required.
Next, we bound the lengths of the curves and in relation to . Notice that the order in which we color the blue vertices (the vertices of ) follows a classic DFS preordering, and therefore we clearly have . However, the order in which we color the red vertices slightly differs from a classic DFS preordering. However, since all the children of that are colored in this step are close to , the additional traversal overhead is small. The following claim together with Claim 12 implies Theorem 8.
Claim 13.
.
Proof.
Let be the path on all the points in , which is obtained by traversing the edges of in the order in which the algorithm colors the vertices, regardless of their color. Clearly . We show that .
Recall that the degree of any vertex in is at most . Since we choose the root of to be a leaf, then for every vertex in the rooted tree, may contain at most vertices. Consider a step of the algorithm were the current vertex is . If was colored blue, denote for . Then, the subpath of that was added in this step is . This is because, in , we are moving from to through , since is not an edge in . If was colored red, the algorithm picked a vertex . Denote for . The subpath of that was added in this step is .
We show how to charge the edges of for each such star-subpath and for each of the edges that are connecting between star-subpaths. First, notice that in each star-subpath , each edge of the star is traversed at most twice. Let be the set of edges that are charged for the star-subpaths themselves. Because the edges of the stars are disjoint, each edge in is charged at most twice.
Let be the set of edges that are traversed in when connecting between any two star-subpaths. Each edge of is charged at most twice because we traverse the stars following the classic DFS order. Therefore, in both sets each edge is charged at most twice. Notice that are distinct.
The edges in have length at most , so edges of length larger than can only appear in . In addition, edges that are incident to leaves in appear only in , because they do not connect between star-subpaths. We conclude that leaf-edges are charged only twice, and edges of length larger than are also charged only twice.
Consider an edge such that is empty and . Notice that the edge is charged only once in (it appears once in ) and once in (to connect with the centers of stars in ’s subtree), so in total it is charged at most twice.
The only case left to handle is edges in a star such that ( can be either the current vertex or its child ). In this case, . If is not a leaf, then there exists an edge such that . Since the algorithm recursively runs on , the edges is in . In other words, for every there exists an edge such that , which is charged only twice. Therefore, if is charged four times (twice in and twice in ), we charge it three times, and transfer the forth charge to , so that both edges are charged only three times in total. Note that no other edge can transfer its charge to , because has to come after in the order of the traversal.
This gives a bound of . To further improve the bound, notice that the last edge is charged only once in . Moreover, it is also charged only once in , because the children in its subtree are the first to be called recursively in this step, so only appears on the subpath that goes back to . In the worst case, when , we charge the first three edges a total of times (by transferring one charge to the corresponding edge in ), and is charged only twice. By choosing the farthest child to be colored last, i.e., , each of the first three edges can transfer a charge of to , resulting in a total charge of at most per edge of , as claimed. Theorem 8 follows from Claim 11, Claim 12, and Claim 13.
4.2 Min-sum discrete Fréchet-TSP
In this section we consider the case where the goal is to minimize the sum of the lengths. The following theorem is a corollary of Theorem 8.
Theorem 14.
Given a set of points in the plane, two curves that partition such that and can be found in time.
Proof.
Let and be the curves obtained by the algorithm in the previous section. Then by Theorem 8 . For , note that it follows a DFS traversal of the restricted to the centers. Since each edge is used at most twice and no vertex is repeated as in , this gives . Combining the two bounds yields . This result can be improved by using a approximation for TSP (for ) on one of the curves. We make use of the algorithm of Kisfaludi-Bak, Nederlof and Węgrzycki [20] which computes in time. We get the following result.
Theorem 15.
Given a set of points in , two curves that partition such that can be found in time for constant .
Proof.
Given the set of stars that were obtained in the proof of Lemma 2, each star has a blue vertex that is connected in to a set of red vertices. We run an algorithm that computes a approximation for the TSP. On the blue vertices, and obtain a curve with the length .
We then construct the curve on the red vertices following the order of the blue vertices in , i.e., for each vertex that corresponds to the star , we connect the red vertices of , and then connect these red paths according to the TSP order on the blue vertices. We can bound the length of by the length of a curve traversing with detours for traversing the red vertices. The sum of lengths of these detours is bounded by traversing each edge of a star twice, which is bounded by . We therefore get that and thus .
4.3 Comparing to the optimal solution
In previous sections, we compared the solution obtained from our algorithm to . We now show that it gives a constant approximation comparing to the optimal solution.
Observation 16.
Let be two curves that partition , such that for some . Then .
Proof.
By concatenating and , we obtain a path of at most that traverses all the points of , which is a feasible solution for TSP on . Denote by two curves that partition with such that is minimized.
Lemma 17.
Let be two curves that partition , such that . Denote by (reps. ) the maximum length of an edge in (resp. ). If , then .
Proof.
Assume by contradiction that . That means that all edges of both and are of strictly smaller length than . Denote and . If , then the discrete Fréchet distance between and is at most . Similarly, if , then the Fréchet distance between and is at most . Therefore, the discrete Fréchet distance between and is at most , in contraction to the optimality of .
Note that if one of is a single vertex, the above lemma may not be correct. Let such that for some . Let for all . Then is the optimal Fréchet distance. And yet, the lemma does not hold for and .
An immediate corollary of Observation 16 and Lemma 17 is that , and . Therefore, by Theorem 8 we have the follwiing corrolary.
Corollary 18.
Given a set of points in the plane, we can find in time two curves , that partition such that and , or .
5 Balancing the number of vertices
In this section, we address Problem 2 (balanced-Fréchet-TSP) under the discrete Fréchet distance. Clearly, it is possible that there is no pair of curves that partition and have both (the optimal distance) and (see, e.g. Figure 5).
We show that for points in the plane our solution to discrete-Fréchet-TSP can be adjusted such that . In other words, we prove the following theorem.
Theorem 19.
Given a set of points in the plane, there always exists two curves that partition , such that , and (and in case that is odd, ). Moreover, such curves can be found in time.
Proof.
Consider the set of stars that were obtained in the proof of Lemma 2, and that can be computed in time by Theorem 5). Each star has a blue vertex which is connected in the spanning tree to a set of red vertices . For Theorem 5 we are using the nearest neighbor graph , applying the unique nearest neighbor rule, and therefore the maximum degree in is at most . Therefore, for every , we have .
Notice that flipping the colors of the vertices in a star does not change the correctness of the algorithm, and we still obtain two curves that partition and have distance at most . Therefore, we can perform the following procedure. Let and be the curves obtained from the algorithm of Theorem 5, then by construction . Set , and iterate over the stars : if , flip the colors in the current star, and update . The algorithm terminates when , or after is flipped.
Since initially each star has exactly one vertex in (its center ) and at most vertices in (), a flip adds vertices to , and removes vertices from , which in total reduces by . Therefore, after a flip we have . Assume by contradiction that the algorithm terminates with . Then all the stars were flipped, but this is a contradiction because in the first step we had , and thus after flipping all the stars we have .
We conclude that when the algorithm terminates, we have . If , we flip all the stars, and get , as required. Finally, note if is odd, then must be odd, and therefore in this case we have .
Remark 20.
In fact, the maximum degree of the NNG for points in dimensions is equal the kissing number of spheres in dimensions, and therefore Theorem 19 can be generalized to higher dimensions accordingly.
5.1 Relaxing the distance requirement
The example in Figure 5 shows a set for which there is no balanced partition with distance . However, notice that if we relax the requirement on the distance between the curves and allow it to be up to , then we can split each star into smaller stars by connecting pairs of leaves, so that the maximum degree of a star becomes two, which allows for a balanced partition. Below we show that by allowing an even smaller relaxation (the discrete Fréchet distance will be at most ), we can always obtain optimally balanced curves.
Theorem 21.
Given a set of points in the plane, there always exists two curves that partition , such that and . Moreover, such curves can be found in time.
Proof.
Consider the set of stars that were obtained in the proof of Lemma 2. If the degree of each star is at most two (i.e. for every ), then by applying arguments similar to the proof of Theorem 19, we get that as required.
Otherwise, let be a star such that . Let , then there is at least one pair of nodes such that the smaller angle at at most . Thus, by the law of cosines, the distance between them is
Since the length of any edge in is at most , we have
We now split into two stars: remove from and create a new star, , with and .
We continue this process until all our stars have degree at most two. Notice that any star that we add consists of a single pair of points with distance at most . Therefore, when applying the arguments from the proof of Theorem 19 as before, we obtain , and .
The example in Figure 6 shows that the bounds in Theorem 19 and Theorem 21 are tight, as we conclude in the observation below.
Observation 22.
There exists a set of points in the plane such that: (i) for any two curves that partition and have it holds that , and (ii) for any two curves that partition and have it holds that .
5.2 Tighter balancing
In the proof of Theorem 19 we flip the colors of some stars in order to obtain a difference of four between and . However, for some instances there might still be a different way to arrange the stars (i.e., a different paired-walk) that allows for a more balanced partition. Therefore, to further improve the difference, we now show how to split some of the starts (as we do in the proof of Theorem 21) in order to reduce the difference between and , while still having .
Given a star subgraph of , define its balance as , where is the degree of the center node of . We call a star with balance a -star (e.g., a 0-star, a 1-star, etc.). For a set of star subgraphs of , denote .
Let be a set of disjoint stars in that together cover . We call such a set a star cover of . Consider a valid coloring of the stars in in two colors, then as in the proof of Lemma 2 this coloring yields two curves that partition and a paired-walk along them with cost at most . Intuitively, is the amount that a star contributes to either and . Therefore, the following problem is equivalent to Problem 2 (balanced-Fréchet-TSP).
Problem 5.
Given a set of points in the plane and a value , find a star cover of , that can be partitioned into two sets of stars and , that minimizes the difference
We thus focus on solving the problem defined above. For a given star cover , an optimally balanced partition of is a partition of into two sets of stars and that minimizes . In the full version of the paper, we show that when is even, any star cover of with consists of only -stars and -stars. We then present an algorithm that runs in time, and either returns a star cover of with , or reports (correctly) that the optimal star cover has .
Theorem 23.
Given a set of points in the plane, where is even, there exists an algorithm that runs in time, which returns a star cover of s.t. either:
-
1.
and it is the minimum possible value of any star cover of (i.e. must be optimal).
-
2.
.
6 Continuous Fréchet-TSP is hard
As mentioned in the introduction, Buchin and Kilgus [11] show that the continuous Fréchet distance between 2 point sets is NP-hard. Similarly, we show that the Fréchet-TSP problem under the continuous Fréchet distance is also NP-hard. The reduction is quite similar to the reduction described in [11], and for completeness, we include a sketch of the proof. We reduce from a restricted version of 3-SAT, called -SAT, in which each clause contains exactly three literals, and each literal (that is, a variable or its negation) appears exactly twice in the entire formula. As in [11], we assume that in the -SAT instance no two clauses share more than one literal (this is possible by the construction in [8]).
Given a -SAT formula, we construct a set of points in the plane such that the formula is satisfiable if and only if there exist two curves that partition and have . Our construction is as follows. Each clause in the formula is represented by a single point, where three line segments intersect, with one segment for each literal in the clause. This is possible because no two clauses share more than one literal. Since each literal appears at most twice in the formula, the line segment corresponding to a literal passes through the two points representing the clauses containing that literal. The variable gadgets are then created in a way for each clause point, one curve must visit it, and the other curves must pass close to it. This is possible because no two clauses share more than one literal. Since each literal appears in at most two clauses, the line segment corresponding to a literal passes through the two points representing the clauses containing that literal. This ensures that each clause is “covered” by the appropriate combination of curves according to the truth assignment encoded by the variable gadgets.
To make this construction concrete, we now describe the variable gadgets in detail. For every input variable in the formula, we build a gadget similar to the one described in [11]. Each gadget has two points that represent the positive literal, and two points that represent the negative literal, see Figure 7 below.
The key difference for the 1-set case, compared to the original two–point-set case in [11], is that the vertices are not yet assigned to the curves. In order to force the partition to be as in [11], we place the points at the corners of the variable gadgets at distance , for small enough . If the formula is stisfiable, then the optimal Fréchet distance will be ,because each pair of corner points can be matched while still passing through all the clause points, as illustrated in Figure 7.
More precisely, the gadgets consists of four pairs of points , , and , each pair of points is placed so the distance between them is very small . This ensures that both curves are forced to pass through all four corners, and, in order to preserve the uniqueness of each point along the curves, they cannot complete a full loop around the gadget and return to their starting corner. As a result, the traversal of the gadget is restricted, so that each curve may follow only one of the two diagonals. This restriction allows the gadget to enforce that exactly one of the line segments corresponding to or is visited by one of the curves (and the other one passes close enough to it), corresponding to the chosen assignment of the 3SAT variable.
For the clauses in the -Linear-SAT formula, we intersect the 3 different gadgets in one of the representing the variables in the clause, this is constructed in the same way as [11], as once the variable gadget are built the difference of the points being preassigned a curve or not does not affect the construction anymore, Figure 8.
Theorem 24.
There is no polynomial-time solution for uniquely partitioning into curves with minimal Fréchet distance, unless .
Remark 25.
Partitioning into curves with minimal weak Fréchet distance, also cannot be done in polynomial time unless . This follows directly from the proof over the Fréchet distance that also applies for the week case. Notice that the proof does not apply for the non-unique case, where we allow the same point to repeat on the same curve, but not in both because then we can just take identical curves over all set .
References
- [1] Paul Accisano and Alper Üngör. Hardness results on curve/point set matching with fréchet distance. CoRR, abs/1211.2030, 2012. arXiv:1211.2030.
- [2] Pankaj K Agarwal, Herbert Edelsbrunner, Otfried Schwarzkopf, and Emo Welzl. Euclidean minimum spanning trees and bichromatic closest pairs. In Proceedings of the sixth annual symposium on Computational geometry, pages 203–210, 1990. doi:10.1145/98524.98567.
- [3] Helmut Alt and Michael Godau. Computing the fréchet distance between two polygonal curves. International Journal of Computational Geometry & Applications, 5(01n02):75–91, 1995. doi:10.1142/S0218195995000064.
- [4] Sanjeev Arora. Polynomial time approximation schemes for euclidean traveling salesman and other geometric problems. Journal of the ACM (JACM), 45(5):753–782, 1998. doi:10.1145/290179.290180.
- [5] Tolga Bektas. The multiple traveling salesman problem: an overview of formulations and solution procedures. Omega, 34(3):209–219, 2006. doi:10.1016/j.omega.2004.10.004.
- [6] Sergey Bereg, Minghui Jiang, Wencheng Wang, Boting Yang, and Binhai Zhu. Simplifying 3d polygonal chains under the discrete fréchet distance. In LATIN 2008: Theoretical Informatics, pages 630–641, Berlin, Heidelberg, 2008. Springer Berlin Heidelberg. doi:10.1007/978-3-540-78773-0_54.
- [7] Mark de Berg, Kevin Buchin, Bart MP Jansen, and Gerhard Woeginger. Fine-grained complexity analysis of two classic tsp variants. ACM Transactions on Algorithms (TALG), 17(1):1–29, 2020. doi:10.1145/3414845.
- [8] Piotr Berman, Marek Karpinski, and Alex D. Scott. Approximation hardness of short symmetric instances of MAX-3SAT. Electron. Colloquium Comput. Complex., TR03-049, 2003. URL: https://eccc.weizmann.ac.il/eccc-reports/2003/TR03-049/index.html.
- [9] Karl Bringmann. Why walking the dog takes time: Frechet distance has no strongly subquadratic algorithms unless seth fails. In 2014 IEEE 55th Annual Symposium on Foundations of Computer Science, pages 661–670. IEEE, 2014. doi:10.1109/FOCS.2014.76.
- [10] Kevin Buchin, Maike Buchin, Wouter Meulemans, and Bettina Speckmann. Locally correct fréchet matchings. Comput. Geom., 76:1–18, 2019. doi:10.1016/J.COMGEO.2018.09.002.
- [11] Maike Buchin and Bernhard Kilgus. Fréchet distance between two point sets. Comput. Geom., 102:101842, 2022. doi:10.1016/J.COMGEO.2021.101842.
- [12] Omar Cheikhrouhou and Ines Khoufi. A comprehensive survey on the multiple traveling salesman problem: Applications, approaches and taxonomy. Computer Science Review, 40:100369, 2021. doi:10.1016/j.cosrev.2021.100369.
- [13] Siu-Wing Cheng, Haoqiang Huang, and Shuo Zhang. Constant approximation of fréchet distance in strongly subquadratic time. In Michal Koucký and Nikhil Bansal, editors, Proceedings of the 57th Annual ACM Symposium on Theory of Computing, STOC 2025, Prague, Czechia, June 23-27, 2025, pages 2329–2340. ACM, 2025. doi:10.1145/3717823.3718157.
- [14] Anne Driemel and Sariel Har-Peled. Jaywalking your dog: Computing the fréchet distance with shortcuts. SIAM J. Comput., 42(5):1830–1866, 2013. doi:10.1137/120865112.
- [15] Alon Efrat, Quanfu Fan, and Suresh Venkatasubramanian. Curve matching, time warping, and light fields: New algorithms for computing similarity between curves. J. Math. Imaging Vis., 27(3):203–216, 2007. doi:10.1007/S10851-006-0647-0.
- [16] Thomas Eiter, Heikki Mannila, et al. Computing discrete fréchet distance. Technical Report CD-TR 94/64, Christian Doppler Laboratory for Expert Systems, Technische Universität Wien, 1994.
- [17] David Eppstein, Michael S Paterson, and F Frances Yao. On nearest-neighbor graphs. Discrete & Computational Geometry, 17(3):263–282, 1997. doi:10.1007/PL00009293.
- [18] Maurice Fréchet. Sur quelques points du calcul fonctionnel. Rendiconti del Circolo Matematico di Palermo, 1906.
- [19] Sariel Har-Peled and Benjamin Raichel. Net and prune: A linear time algorithm for euclidean distance problems. Journal of the ACM (JACM), 62(6):1–35, 2015. doi:10.1145/2831230.
- [20] Sándor Kisfaludi-Bak, Jesper Nederlof, and Karol Węgrzycki. A gap-ETH-tight approximation scheme for Euclidean TSP. Journal of the ACM, 72(6):1–48, 2025.
- [21] Anil Maheshwari, Jörg-Rüdiger Sack, Kaveh Shahbaz, and Hamid Zarrabi-Zadeh. Fréchet distance with speed limits. Comput. Geom., 44(2):110–120, 2011. doi:10.1016/J.COMGEO.2010.09.008.
- [22] Anil Maheshwari, Jörg-Rüdiger Sack, Kaveh Shahbaz, and Hamid Zarrabi-Zadeh. Staying close to a curve. In CCCG, 2011.
- [23] Joseph S. B. Mitchell. Guillotine subdivisions approximate polygonal subdivisions: A simple polynomial-time approximation scheme for geometric tsp, k-mst, and related problems. SIAM Journal on Computing, 28(4):1298–1309, 1999. doi:10.1137/S0097539796309764.
- [24] David Mount and Mary Monroe. A ptas for the min-max euclidean multiple tsp, December 2021. doi:10.48550/arXiv.2112.04325.
- [25] Pravin M Vaidya. An o (n log n) algorithm for the all-nearest-neighbors problem. Discrete & Computational Geometry, 4:101–115, 1989. doi:10.1007/BF02187718.
- [26] Tim Wylie. Discretely following a curve. In International Conference on Combinatorial Optimization and Applications, pages 13–24. Springer, 2013. doi:10.1007/978-3-319-03780-6_2.
