
On the Longest Flip Sequence to Untangle Segments in the
Plane∗
Guilherme D. da Fonseca†Yan Gerard‡Bastien Rivier‡
March 21, 2023
Abstract
A set of segments in the plane may form a Euclidean TSP tour or a matching, among
others. Optimal TSP tours as well as minimum weight perfect matchings have no crossing
segments, but several heuristics and approximation algorithms may produce solutions with
crossings. To improve such solutions, we can successively apply a flip operation that replaces
a pair of crossing segments by non-crossing ones. This paper considers the maximum number
D
(
n
)of flips performed on
n
segments. First, we present reductions relating
D
(
n
)for
different sets of segments (TSP tours, monochromatic matchings, red-blue matchings, and
multigraphs). Second, we show that if all except
t
points are in convex position, then
D
(
n
) =
O
(
tn2
), providing a smooth transition between the convex
O
(
n2
)bound and the
general
O
(
n3
)bound. Last, we show that if instead of counting the total number of flips, we
only count the number of distinct flips, then the cubic upper bound improves to O(n8/3).
1 Introduction
In the Euclidean Travelling Salesman Problem (TSP), we are given a set
P
of
n
points in the
plane and the goal is to produce a closed tour connecting all points of minimum total Euclidean
length. The TSP problem, both in the Euclidean and in the more general graph versions, is
one of the most studied NP-hard optimization problems, with several approximation algorithms,
as well as powerful heuristics (see for example [
2
,
13
,
17
]). Multiple PTAS are known for the
Euclidean version [
3
,
24
,
28
], in contrast to the general graph version that unlikely admits a
PTAS [
11
]. It is well known that the optimal solution for the Euclidean TSP is a simple polygon,
i.e., has no crossing segments, and in some situation a crossing-free solution is necessary [
10
].
However, most approximation algorithms (including Christofides and the PTAS), as well as a
variety of simple heuristics (nearest neighbor, greedy, and insertion, among others) may produce
solutions with pairs of crossing segments. In practice, these algorithms may be supplemented
with a local search phase, in which crossings are removed by iteratively modifying the solution.
Given a Euclidean TSP tour, a flip is an operation that removes a pair of crossing segments
and adds a new pair of segments preserving a tour (Fig. 1(a)). If we want to find a tour without
crossing segments starting from an arbitrary tour, it suffices to find a crossing, perform a flip,
and repeat until there are no crossings. It is easy to see that the process will eventually finish, as
the length of the tour can only decrease when we perform a flip. Since a flip may create several
new crossings, it is not obvious how to bound the number of flips performed until a crossing-free
solution is obtained. Let
DTSP
(
n
)denote the maximum number of flips successively performed on
a TSP tour with
n
segments. An upper bound of
DTSP
(
n
) =
O
(
n3
)is proved in [
30
], while the
∗
A version of this paper appears in Walcom’23. This work is supported by the French ANR PRC grant ADDS
(ANR-19-CE48-0005).
†Aix-Marseille Université and LIS, France. guilherme.fonseca@lis-lab.fr
‡Université Clermont Auvergne and LIMOS, France. {yan.gerard, bastien.rivier}@uca.fr
1
arXiv:2210.12036v3 [cs.CG] 17 Mar 2023