Constrained Flips in Plane Spanning Trees
Abstract
A flip in a plane spanning tree is the operation of removing one edge from and adding another edge such that the resulting structure is again a plane spanning tree. For trees on a set of points in convex position we study two classic types of constrained flips: (1) Compatible flips are flips in which the removed and inserted edge do not cross each other. We relevantly improve the previous upper bound of on the diameter of the compatible flip graph to , by this matching the upper bound for unrestricted flips by Bjerkevik, Kleist, Ueckerdt, and Vogtenhuber [SODA 2025] up to an additive constant of . We further show that no shortest compatible flip sequence removes an edge that is already in its target position. Using this so-called happy edge property, we derive a fixed-parameter tractable algorithm to compute the shortest compatible flip sequence between two given trees. (2) Rotations are flips in which the removed and inserted edge share a common vertex. Besides showing that the happy edge property does not hold for rotations, we improve the previous upper bound of for the diameter of the rotation graph to .
Keywords and phrases:
Non-crossing spanning trees, Flip Graphs, Diameter, Complexity, Happy edgesFunding:
Joseph Dorfer: Austrian Science Foundation (FWF) 10.55776/DOC183.Copyright and License:
2012 ACM Subject Classification:
Mathematics of computing Discrete mathematics ; Mathematics of computing Combinatorics ; Mathematics of computing Combinatoric problemsEditors:
Vida Dujmović and Fabrizio MontecchianiSeries and Publisher:
Leibniz International Proceedings in Informatics, Schloss Dagstuhl – Leibniz-Zentrum für Informatik
1 Introduction
Let be a finite point set in the plane in general position, that is, no three points lie on a common line. We call a convex point set if no point in lies in the interior of the convex hull of . A plane straight-line graph of is a graph with vertex set and whose edges are straight line segments between pairs of points of S such that no two edges intersect, except at a common endpoint. All graphs considered in this paper are straight-line graphs. For brevity we will omit the term straight-line. A plane spanning tree is a plane connected graph with edges. In a convex point set, edges appear in two forms. Convex hull edges are edges that lie on the boundary of the convex hull of the point set. Edges that are not convex hull edges are diagonals.
Flip Graphs of Plane Spanning Trees.
A flip between two plane spanning trees of is the operation that removes an edge from a tree and adds another edge such that the resulting structure is again a plane spanning tree. We also denote this operation as an unrestricted flip. A constrained version of flips are so-called compatible flips, for which the removed edge and the added edge are not allowed to cross. Rotations are a restricted subclass of compatible flips for which we additionally require the removed edge and the added edge to share a common vertex. The most restricted and local operation is a so called slide. A slide is an operation in which the added edge and the removed edge are again required to share a common vertex, additionally, the triangle must not contain any other vertex and the edge has to be contained in the current tree. This can visually be interpreted as sliding the edge along the edge into the edge . The (compatible) flip graph of plane spanning trees of has as its vertex set all such trees. Two vertices , of this flip graph are connected with an edge if and only if can be transformed into by a single (compatible) flip. See Figure 1 for an example of flips in plane spanning trees.
Given an initial tree and a target tree , a (compatible) flip sequence from to is a path from to in the (compatible) flip graph. The (compatible) flip distance between and is the length of a shortest path between and in the flip graph. Any (compatible) flip sequence of this length is called a shortest (compatible) flip sequence. Similarly, we define the rotation graph, rotation sequences and the rotation distance. See Figure 2 for an illustration of the concepts.
For graph reconfiguration problems three natural questions arise: (1) Is the flip graph connected? (2) What is the diameter of the flip graph? (3) What is the complexity of computing shortest flip sequences between two specific configurations?
Connectedness and Diameter.
For any -point set , the flip graph of plane spanning trees on is known to be connected and has radius exactly . The same holds for the compatible flip graph and the rotation graph; see [5, 6]. Hence, the diameter always lies between and . Since a lower bound for the diameter of for convex -point sets was shown in [12], the flip graph of plane spanning trees on convex point sets has received considerable attention. However, despite a prevailing conjecture that the diameter is at most [10, 14], even improving the upper bound to took surprisingly long. In the last few years, the upper bound for its diameter was improved to in [1] and soon after to in [10]. The upper bound from [10] is constructive and, though not stated explicitly, only uses compatible flips. Hence it also provides an upper bound for the diameter of the according compatible flip graph. In [8], the diameter was bounded from above by with , which marked the first linear improvement over the initial bound from [5]. Very recently, a lower bound of and an upper bound of on the diameter were achieved in [6], where the upper bound in general requires non-compatible flips. It is also known that any plane spanning tree can be transformed into any other using many slides [4]. For a survey on further flip operations in trees with multiple flips in parallel as well as flips with labeled edges, we refer to [18].
Happy Edges and Complexity.
For any graph reconfiguration problem, happy edges are edges that lie in both the initial and the target graph. A flip graph fulfills the happy edge property if there exists a shortest flip sequence between any two graphs that never flips happy edges. The happy edge property often is a good indication for the complexity of a graph reconfiguration problem. For example, for triangulations of simple polygons [3] and general point sets [16, 19], finding shortest flip sequences is computationally hard. The hardness proofs use counterexamples to the happy edge property as a key ingredient. Conversely, the happy edge property is known to hold for triangulations of convex polygons [20]. Though the complexity of finding shortest flip sequences is still open, the happy edge property yields multiple fixed-parameter tractable algorithms [7, 11, 15, 17]. Moreover, the happy edge property holds for plane perfect matchings of convex point sets and shortest flip sequences can be found in polynomial time [13]. For plane spanning trees in convex position the happy edge property was conjectured to hold [1, 14] for different types of flips. Up to now, it has only been disproved for slides [1].
Contribution and Outline.
We will start by improving upper bounds on the flip graph for restricted flip types in convex point sets. In Section 2 we improve the upper bound on the diameter of the compatible flip graph from in [10] to . Section 3 is dedicated to improving the upper bound on the rotation graph from in [5] to .
Afterwards we deal with the happy edge property. In Section 4 we provide a more refined framework for happy edge properties and in Section 5 we prove the happy edge property for compatible flips in convex point sets and provide a counterexample to the happy edge property for rotations.
Finally, in Section 6 we use variants of the happy edge property to show fixed-parameter tractability of the flip distance for both unrestricted and compatible flips.
Due to space restrictions, full technical details and proofs for statements marked with are given in the arXiv Version of our paper [2].
2 Bounding the Diameter of the Compatible Flip Graph
This section is devoted to improving the upper bound on the diameter of the compatible flip graph. All the currently known improvements to the upper bound of the length of shortest flip sequences for unrestricted flips are based on two different ways to handle edges: They either invest two flips to flip an edge from to a convex hull edge and later flip that convex hull edge to an edge of , or perform a single perfect flip, that is, a flip from an edge of to an edge of . Upper bounding the length of a flip sequence is then achieved by lower bounding the number of perfect flips. Note that any such flip sequence induces a pairing of the edges of with edges of .
To obtain our improved bound for the diameter of the compatible flip graph, we build on strategies for bounding the diameter of the flip graph with unrestricted flips from [6]. We give an overview of their proof and highlight the parts where we provide adjustments to make the flip sequence compatible.
The pairing of edges in [6] is obtained as follows: The authors consider the linear representation of a tree on a convex point set as illustrated in Figure 3. The linear representation is obtained by cutting the convex point set between two consecutive vertices on the convex hull and unfolding the tree such that its vertices are on a straight line.
The linear representation induces a linear order of the vertices of . With this linear order, the length of an edge , where , is defined as . Further, the edge covers all vertices as well as any edge with .
A gap is an edge between two consecutive vertices in the linear order (which might or might not be present in the tree ). Next, the authors define a bijection (Lemma 3.1 in [6]) between gaps and edges of , where each gap is in bijection with the shortest edge of that covers that gap. The edges are then partitioned into categories based on how many vertices they share with their corresponding gap ; see Figure 4 for an illustration. Concretely, an edge is a …
-
short edge if
-
near edge if
-
wide edge if
The authors show that the number of short edges in any tree is always larger than the number of wide edges. In a next step, they construct an edge-edge-bijection between the edges in and by concatenating the edge-gap-bijection for with the gap-edge-bijection of . An edge and its image from the edge-edge-bijection form a pair. If an edge is in both and , and is in bijection to itself, then is not flipped at all. Note that any edge can be flipped to its assigned gap by a single (compatible) flip. The authors use this and the relation between the numbers of short and wide edges in each tree to show that all pairs of edges containing at least one short or wide edge can be flipped using an average of flips per pair. This is done by flipping every edge in such a pair to its corresponding gap and later from its gap to its target edge, which takes two flips minus the number of short edges in the pair.
The remaining pairs then only consist of near edges. These pairs can further be partitioned into three sets as illustrated in Figure 5.
-
above pairs, where and share a vertex and is longer than .
-
below pairs, where and share a vertex and is shorter than .
-
crossing pairs, where and cross, or equivalently, and share a different vertex with their gap.
The sets of above, below and crossing pairs are then denoted by , , and , respectively. The authors provide a flip sequence that flips all pairs in (resp. , ) directly [6, Lemma 3.2]. Since a direct flip of an above or below pair is compatible, this implies the following lemma.
Lemma 1.
Assume that in the linear representation, the trees and consist only of short edges and pairs of edges in (resp. ). Then there is a compatible flip sequence from to of length (resp. ).
In contrast, no direct flip between two edges of a pair in is compatible, since any such pair is crossing. In the arXiv version of our paper [2] we develop an approach to flip these edges such that the resulting flip sequence is compatible while using only one additional flip.
Lemma 2 ().
Assume that in the linear representation, the trees and consist only of short edges and pairs of edges in . Then there is a compatible flip sequence from to of length .
To obtain their upper bound on the flip distance between two trees , , the authors cut the original instances , along happy diagonals, handle each of the resulting subinstances separately, and then add up the flips needed in each of the subinstances. Let denote the number of happy convex hull edges, the number of happy diagonals, and the cardinality of . Using that , their resulting bound [6, Theorem 4.1] is . With similar calculations, we show the following theorem for compatible flips in the arXiv version of our paper [2].
Theorem 3 ().
Let and be two plane spanning trees in convex point sets with vertices. Then, there exists a compatible flip sequence from to of length at most , where and where and denote the number of happy convex hull edges and happy non-convex-hull edges, respectively.
We remark that our bound with respect to the parameters , , and can be relevantly higher than the one in [6, Theorem 4.1] if the two trees share many happy diagonals. This behaviour was not unexpected due to the following result: In [9, Theorem 1.6], the authors provide examples of pairs of plane spanning trees with (unrestricted) flip distance and compatible flip distance . The according tree pairs have happy diagonals. However, any pair of trees that could reach the upper bounds in [6, Theorem 4.1] and Theorem 3 must have . So while for certain instances the flip distance and the compatible flip distance may differ strongly, extremal examples that determine the diameter are not affected.
3 Bounding the Diameter of the Rotation Graph
Next, we show that for the even more constrained rotation as flip operation, the diameter of the resulting flip graph is linear with leading coefficient less than two.
For this purpose we again construct a pairing of edges such that a perfect flip can be performed for many of them. The challenge that arises, compared to unrestricted or compatible flips, is that rotations require the removed and the added edge to share a vertex. This rules out the gap based pairing from the last section, since in crossing pairs, edges do not share vertices and the same holds for most pairs that contain a wide edge.
Lemma 4.
For a plane spanning tree on a point set and a vertex there exists a bijection between vertices in and edges in such that is incident to for every vertex .
Proof.
We root the tree at and orient every edge away from such that forms the unique source of the oriented graph; see Figure 6 for an illustration. Now map each vertex in to its incoming edge.
Corollary 5.
Let and be two plane spanning trees on a point set and let be a vertex in . Then there exists a pairing of edges from with edges in such that:
-
Two edges that are paired together share a vertex.
-
Different pairs of edges share a different vertex.
-
No pair of edges has as its shared vertex.
Proof.
The pairing induced by the bijection in Lemma 4 has all the desired properties.
For any two given plane spanning trees and , we apply the bijection from Corollary 5 with to obtain a pairing of the edges of the two trees with all the mentioned properties. For an edge that is in bijection with a vertex we say that is attached to . Note that each vertex with has an attached edge from each of and , while has no attached vertices.
From this point on we consider the two trees presented in their linear representation, see Figure 3, such that is the rightmost vertex. The pairs of edges , where is the vertex where edges and are attached to, can now be subdivided into multiple classes. We say that a pair of edges is …
-
right-attached above if
-
left-attached above if
-
right-attached below if
-
left-attached below
-
diving if
-
jumping if
We denote the respective sets of pairs in that order by , , , and . Additionally, we set and . See Figure 7 for an illustration of the six types of edge pairs, as well as the two groups and . We remark that happy edges that are left-attached fulfill both, the definition for left-attached above and the one left-attached below. This does not pose any problem, since in the parts of the proof where this is relevant, we will only consider the whole set . By symmetry, the same can be said about right-attached happy edges. Another noteworthy observation is that we do not handle convex hull edges any differently than diagonals. There might even be happy convex hull edges that belong to different pairs. This will lead to cases in which we rotate happy (convex-hull) edges. We allow this on purpose, since we will see in Section 5 that the happy edge property does not hold for rotations.
The new upper bound on the diameter of the rotation graph is described by the following Theorem.
Theorem 6.
There exists a rotation sequence from to of length at most
We will use Lemma 7 below to get the edges from three of the sets , , , and “out of the way”. Then we will show that all edges from the remaining set can be perfectly flipped.
We pair the edges and vertices of via the bijection . Further, for an arbitrary , we assign a gap to every vertex except by the following function (indices taken modulo ).
In other words, we choose one particular gap that is not assigned to any vertex and the other gaps are assigned such that they contain their assigned vertex.
In the following lemma, is an arbitrary index, is a subset of the convex hull edges in that behave “nicely” with respect to , and are all edges of that are incident to . and are according subsets that are required to be present in the resulting tree .
Lemma 7.
For any , let and . Further, let be a partition of , that is, and . Then there exists a rotation sequence from to of length at most that does not flip edges in and has the following properties:
-
For all , the tree contains the convex hull edges . That is, the convex hull edges attached to directed away from with respect to the order of vertices along the path on the convex hull from to 111We remark that this direction in general differs from the orientation induced by the tree that is used in the proof of Lemma 4..
-
The tree contains the edges for all . That is, all vertices that are attached to are connected directly to via edges that form a fan at .
Proof.
We set and . Now consider the forest of edges that are visible from in . These are all edges for which no straight-line segment from to the edge is intersected by any other edge. Further, let be a vertex of degree one in . Then the only edge incident to in is . In particular, if then does not contain any edge and is visible from , and if then the straight-line segment between and is uncrossed.
We can execute a flip that exchanges the edge with the edge (if ) or if to get a valid tree. We replace (resp. ) and (resp. ) and repeat the process. We repeat until . This takes at most rotations, since the cardinality of increases by one in every iteration.
A gap in a tree is called empty if the edge is not part of . Note that in the target tree from Lemma 7, the gap is empty. Moreover, by setting , a flip sequence as in Lemma 7 can be used to rotate all edges to the convex hull such that all convex hull edges that point away from do not have to be rotated.
3.1 The Sets and
Proposition 8.
There exists a flip sequence from to that uses rotations.
Without loss of generality, let . For the sets , we will (1) rotate all edges except the ones in to the convex hull such that every edge in has an empty gap to the left of its attachment point, (2) rotate all edges in pairs in to their target position, and (3) obtain the final tree. Steps (1) and (3) are described in Lemma 9, Step (2) happens in Lemma 10. An illustration of the strategy can be seen in Figure 9.
Lemma 9 ().
There exists a rotation sequence of length at most that rotates all edges except the ones in to the convex hull such that each edge is rotated into the gap in the convex hull that is left of its assigned vertex. In particular, for an edge with that belongs to a pair in , the gap in the convex hull is empty. A symmetric argument holds for pairs in .
Lemma 9 is an iterative application of Lemma 7. We apply the lemma with to every subtree that results from cutting the tree along edges in (resp. ). Let and be the trees obtained from applying Lemma 9 to and .
Lemma 10 ().
There exists a rotation sequence from to of length at most (resp. ).
3.2 The Sets and
Proposition 11.
There exists a flip sequence from to that uses rotations.
As the first rotation of the rotation sequence we rotate into the edge . From now on, we say that a gap is visible from above if the gap is empty and shares a face in the tree (more specifically a face of the drawing of combined with the convex hull) with . The concept is illustrated in Figure 10. Note that there is always a unique gap that is visible from above and that it has an edge that is attached to its left vertex and (maybe) an edge that is attached to its right vertex. may not exist if is the rightmost gap. Further, we show that and share a face with .
Lemma 12.
and share a face with .
Proof.
Assume and share a face with additional vertices. Then it also has to share a face with further edges in order for to be a tree. Those edges are exactly the edges that are attached to the vertices and, thus, include and .
Lemma 13 ().
There exists a flip sequence of length at most that transforms into a tree that only contains the following three groups of edges:
-
(A)
some convex hull edges attached to their right vertex,
-
(B)
all target edges of jump pairs, and
-
(C)
some edges that are attached to their left vertex and have as a second vertex a vertex of a jump pair or the vertex .
A tree as obtained from Lemma 13 is depicted in Figure 11. The edges that are of special interest for the further application of Lemma 14 are highlighted with colors.
Lemma 14 ().
We can transform into as in Lemma 13 in at most rotations.
4 Relations of Happy Edge Properties
In this section, we introduce a more refined distinction of happy edge properties.
Definition 15.
A graph reconfiguration problem, in which flips exchange edges, fulfills the
-
(weak) happy edge property, if, from any initial graph to any target graph , there exists a shortest flip sequence that does not flip happy edges.
-
strong happy edge property, if, from any initial graph to any target graph , any shortest flip sequence does not flip happy edges.
-
perfect flip property if, whenever we can perform a flip in such that the resulting graph has one edge more in common with than has in common with , then there exists a shortest flip sequence from to that has as its first intermediate graph (that is, the flip sequence starts with and is called a perfect flip).
Further, we provide a framework, that allows us to compare the different properties.
Proposition 16 ().
Let be a graph reconfiguration problem where flips exchange one edge at a time.
-
(i)
If any flip sequence in that flips at least one happy edge can be shortened by at least two flips, then fulfills the perfect flip property.
-
(ii)
If for any flip in from to , and can never be in the same configuration, then the reverse direction in (i) holds.
We remark that all the introduced properties may or may not hold for certain graph reconfiguration problems. While the condition in Proposition 16(ii) is not fulfilled for trees, it does hold for example for triangulations.
5 Happy Edges in Plane Spanning Trees on Convex Sets
In [1], the authors formulated the Weak Happy Edge Conjecture for trees on convex point sets:
Conjecture 17 (Conjecture 17 in [1]).
For any two plane spanning trees and on a convex point set, there is a shortest flip sequence from to that does not flip happy edges.
Based on an example from [1] for a different context, we first observe that the perfect flip property holds neither for unrestricted flips nor for compatible flips on trees.
In contrast, we will show in this section that the strong happy edge property does hold for compatible flips on trees. Our first proof ingredient is the following lemma, which is an extension of [1, Proposition 18] for compatible flips.
Lemma 18 ().
Consider any point set and any two plane spanning trees and on and any shortest compatible flip sequence from to . If some edge is removed and later added back, then some flip during that subsequence must add an edge that crosses .
In [1], a parking edge is defined as an edge that appears in a flip sequence and that is not contained in . A second ingredient of our proof is Lemma 20, which verifies the compatible flip analogue of the following conjecture from [1].
Conjecture 19 (Parking Edge Conjecture, Conjecture 21 in [1]).
For any convex point set and any two plane spanning trees and on , there is a shortest flip sequence from to that only uses parking edges from the boundary of the convex hull of .
We remark that in [1, Claim 22] it is shown that for unrestricted flips Conjecture 19 implies Conjecture 17.
Lemma 20 ().
For any convex point set and any two plane spanning trees and on , there is a shortest compatible flip sequence from to that only uses parking edges from the boundary of the convex hull of .
Figure 13 shows the intuition behind the proof: One by one, we replace a parking edge that is not on the boundary of the convex hull with a parking edge on the convex hull boundary. To make this replacement possible, we change the order of the flips that happen while is part of the tree. The edge splits the convex point set into two sides, say and . Flips in either of the two sides can be executed independently from flips in the other side. Assume is added when flipping from the tree to and removed in the flip from to . Exactly one of the sides, say side , of entirely contains a path that connects the two endpoints of . The flips in the other side, say side , can be executed before gets added. Afterwards, we close a cycle in side by adding the convex hull parking edge and execute all the flips in side . We conclude the new subsequence of flips by removing and obtain the tree .
We now show the strong happy edge property for compatible flips on trees.
Theorem 21.
For any convex point set and any two plane spanning trees and on , any compatible flip sequence from to that removes (and adds) a happy edge is at least one step longer than the shortest compatible flip sequence from to .
Proof.
Let , ,…, be a compatible flip sequence that removes a happy edge in a flip from to . By Lemma 20, there exists a shortest compatible flip sequence from ,,…, that only uses parking edges from the convex hull boundary. Since crosses neither an edge of nor one on the convex hull boundary, crosses no edge in the flip sequence ,…,,,…,. Hence, by Lemma 18, we can construct a shorter flip sequence that preserves .
By Proposition 16(i) and the example in Figure 12, Theorem 21 is best possible in the sense that there are flip sequences that flip a happy edge and cannot be shortened by two flips.
When we restrict the flip even further by only allowing edge rotations instead of all compatible exchanges, the happy edge property no longer holds. Also for the more restricted edge slides, the happy edge property does not hold, see [4] for the general case, and [1] for convex point sets.
Figure 14 shows a counterexample to the happy edge property for convex point sets with rotations. Assume the happy edge property would hold. Then the happy edge that passes through the middle of our convex polygon would split the tree into two proper subtrees. In each such subtree, the unhappy edge has a fixed position where it has to go. Since the initial position and the target position of the unhappy edge do not share any vertex, we need at least two rotations to get each unhappy edge from one position to the other. This gives us a minimum length of four for any flip sequence that preserves happy edges.
The flip sequence in Figure 14 only uses three rotations. Therefore, the happy edge property does not hold for the reconfiguration of plane spanning trees with rotations.
6 Fixed-Parameter Tractable Algorithms
Next, we show that the flip distance and the compatible flip distance are fixed-parameter tractable in (resp. ). The core ingredient for all proofs is the happy edge property for convex hull edges, which is shown to hold for unrestricted flips in Proposition 18 in [1]. We obtain further improvements on the runtime built on the happy edge property for all edges and the parking edge property.
The upcoming lemma will describe a crucial step in the first two algorithms. Even if we never flip happy convex hull edges, the number of happy edges that are on the convex hull can still be arbitrarily large when compared to the number of unhappy edges. Therefore, we have to reduce that number in order to obtain a reasonable instance size that is bounded by a function in . We do this as follows: We mark all vertices that are incident to an unhappy edge that is in the initial configuration or the target configuration. All non-marked vertices are now only incident to convex hull edges. If we have a path between two marked vertices that only travels along convex hull edges incident to only non-marked vertices (except the first and/or last edge that start or end in a marked vertex), then we contract that path into one single edge (if both endpoints are marked) or a single vertex (if only one endpoint is marked). All the non-marked vertices get removed in the process. We call the new reduced instances and . The following Lemma states that in this contraction step no information about the length of the flip sequence is lost.
Lemma 22 ().
The (compatible) flip distance between and has the same length as the flip distance between and .
Now, we are ready to obtain our first FPT-algorithm. We remark that the notation hides terms that are polynomial in .
Theorem 23.
The flip distance for unrestricted flips is fixed-parameter tractable in with runtime , where . The constant can be improved to if the happy edge property holds for unrestricted flips.
Proof.
For the unrestricted flip we define good happy edges. All happy edges on the convex hull are good happy edges. Further, a happy edge that does not lie on the convex hull splits the point set into two parts. If one of the two parts contains only happy edges, then is a good happy edge as well.
Claim 24 ().
No good happy edge is flipped in any shortest flip sequence.
Now consider the tree that is obtained from from exhaustively contracting happy leaves and paths of happy edges along the convex hull as in Lemma 22. We consider the dual tree of , whose vertices are the faces of except the outer face and which contains edge between two vertices if and only if their corresponding faces share an edge of .
Claim 25 ().
Let be a path in the dual tree that connects two faces containing distinct unhappy edges such that all the edges on traversed faces are happy edges. Then any shortest flip sequence either flips all those happy edges or none of them.
Let there be a total of unhappy edges. Then there are a total of paths ,…, that fit the form of Claim 25. Let ,…, denote their number of happy edges in some order. Any flip sequence of length gets to spend a total of at most flips on all these happy edges combined. We enumerate all subsets of and if their number of happy edges sums up to less than , then we consider an instance that contains all the faces that contain unhappy edges and the faces along the paths in the subset. Then the total remaining tree contains at most unhappy edges from and unhappy edges from . That gives a total of at most unhappy edges and a total of at most vertices. Additionally, we have a total of less than edges from faces with only happy edges. This gives another vertices. So we have at most vertices in our reduced forest. Brute forcing the optimal solution gives us a total of possible edges to remove and a total of at most positions to add edges for every flip. This gives us a total runtime of based on the number of flip sequences that we have to check.
Figure 16 gives an intuitive idea, where the improvement comes from. We cut the point set along all happy diagonals such that the new instances have all their happy edges on the convex hull.
Next, we prove the existence of a faster FPT-algorithm for compatible flips that is based on the parking edge property.
Theorem 27.
The compatible flip distance is fixed-parameter tractable in with runtime , for any fixed .
Proof.
We divide the point set into components by cutting along happy edges and then find the shortest flip sequence for every remaining component individually, see Figure 16. Observe that all the happy edges in these components are convex hull edges. If all edges in a component are happy, do not flip any edge in it. By Lemma 20 there exists a shortest flip sequence that only uses edges from , or the convex hull.
Now let be fixed and . Let ,…, be all components with unhappy edges. Determine the respective flip distances from to via brute force and discard all the instances. For checking whether the remaining instances have a combined flip distance of one has to check different flip sequences. There are choices to remove an edge and every component with diagonals has holes in the convex hull where we can add edges.
7 Conclusion
In this work, we have considered the compatible flip graph and the rotation graph, by improving the upper bound on the respective diameter from to and to , respectively. The constructive upper bounds align with our findings about the happy edge property. On the one hand, we showed that any shortest compatible flip sequence preserves happy edges and that there is a shortest compatible flip sequence that only uses parking edges from the convex hull. The same holds for the compatible flip sequences that we used to obtain our upper bound. On the other hand, shortest rotation sequences may rotate happy edges. This may also happen in our upper bound construction. We further showed an immediate application of happy edge properties in trees, namely, that they can be used to derive fixed-parameter tractable algorithms. Open questions that are related to our work are:
-
1.
Can we close the gap between upper and lower bounds for the flip distance, for each of the flip types? Do the diameters for different flip types differ or do they coincide?
-
2.
Does the happy edge property still hold for flipping plane spanning trees if we drop one of the restrictions that either the point set is convex or the flips are all compatible?
-
3.
What is the time complexity of finding shortest flip sequences for plane spanning trees? Again, this is interesting for each of the flip types.
References
- [1] Oswin Aichholzer, Brad Ballinger, Therese Biedl, Mirela Damian, Erik D. Demaine, Matias Korman, Anna Lubiw, Jayson Lynch, Josef Tkadlec, and Yushi Uno. Reconfiguration of non-crossing spanning trees. Journal of Computational Geometry, 15:224–253, 2024. doi:10.20382/jocg.v15i1a9.
- [2] Oswin Aichholzer, Joseph Dorfer, and Birgit Vogtenhuber. Constrained flips in plane spanning trees, 2025. arXiv:2508.15520.
- [3] Oswin Aichholzer, Wolfgang Mulzer, and Alexander Pilz. Flip distance between triangulations of a simple polygon is NP-complete. Discrete & Computational Geometry, 54(2):368–389, June 2015. doi:10.1007/s00454-015-9709-7.
- [4] Oswin Aichholzer and Klaus Reinhardt. A quadratic distance bound on sliding between crossing-free spanning trees. Computational Geometry, 37(3):155–161, 2007. Special Issue on the 20th European Workshop on Computational Geometry. doi:10.1016/j.comgeo.2004.12.010.
- [5] David Avis and Komei Fukuda. Reverse search for enumeration. Discrete Applied Mathematics, 65(1):21–46, 1996. First International Colloquium on Graphs and Optimization. doi:10.1016/0166-218X(95)00026-N.
- [6] Håvard Bakke Bjerkevik, Linda Kleist, Torsten Ueckerdt, and Birgit Vogtenhuber. Flipping non-crossing spanning trees. Proceedings of the 2025 Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 2313–2325, 2025. doi:10.1137/1.9781611978322.77.
- [7] Miguel Bosch-Calvo and Steven Kelk. An improved kernel for the flip distance problem on simple convex polygons. Inf. Process. Lett., 182(C), 2023. doi:10.1016/j.ipl.2023.106381.
- [8] Nicolas Bousquet, Lucas de Meyer, Théo Pierron, and Alexandra Wesolek. Reconfiguration of Plane Trees in Convex Geometric Graphs. In Wolfgang Mulzer and Jeff M. Phillips, editors, 40th International Symposium on Computational Geometry (SoCG 2024), volume 293 of Leibniz International Proceedings in Informatics (LIPIcs), pages 22:1–22:17, Dagstuhl, Germany, 2024. Schloss Dagstuhl – Leibniz-Zentrum für Informatik. doi:10.4230/LIPIcs.SoCG.2024.22.
- [9] Nicolas Bousquet, Lucas de Meyer, Théo Pierron, and Alexandra Wesolek. Reconfiguration of plane trees in convex geometric graphs. CoRR, 2023. doi:10.48550/arXiv.2310.18518.
- [10] Nicolas Bousquet, Valentin Gledel, Jonathan Narboni, and Théo Pierron. A note on the flip distance between non-crossing spanning trees. Computing in Geometry and Topology, 2023. doi:10.57717/cgt.v2i1.36.
- [11] Sean Cleary and Katherine St. John. Rotation distance is fixed-parameter tractable. Inf. Process. Lett., 109(16):918–922, 2009. doi:10.1016/J.IPL.2009.04.023.
- [12] Carmen Hernando, Ferran Hurtado, Alberto Márquez, Mercè Mora, and Marc Noy. Geometric tree graphs of points in convex position. Discrete Applied Mathematics, 93(1):51–66, 1999. doi:10.1016/S0166-218X(99)00006-2.
- [13] M. Carmen Hernando, Ferran Hurtado, and Marc Noy. Graphs of non-crossing perfect matchings. Graphs and Combinatorics, 18:517–532, January 2002. doi:10.1007/s003730200038.
- [14] Ferran Hurtado. CCCG 2003; Paul Erdös Memorial Lecture: Flip, 2003.
- [15] Haohong Li and Ge Xia. An O () time FPT algorithm for convex flip distance. Discrete & Computational Geometry, pages 1–17, 2023.
- [16] Anna Lubiw and Vinayak Pathak. Flip distance between two triangulations of a point set is NP-complete. Computational Geometry, 49:17–23, 2015. doi:10.1016/j.comgeo.2014.11.001.
- [17] Joan Lucas. An improved kernel size for rotation distance in binary trees. Information Processing Letters, 110:481–484, June 2010. doi:10.1016/j.ipl.2010.04.022.
- [18] Torrie L. Nichols, Alexander Pilz, Csaba D. Tóth, and Ahad N. Zehmakan. Transition operations over plane trees. Discrete Mathematics, 343(8):111929, 2020. doi:10.1016/j.disc.2020.111929.
- [19] Alexander Pilz. Flip distance between triangulations of a planar point set is APX-hard. Computational Geometry, 47(5):589–604, 2014. doi:10.1016/j.comgeo.2014.01.001.
- [20] Daniel D. Sleator, Robert E. Tarjan, and William P. Thurston. Rotation distance, triangulations, and hyperbolic geometry. Journal of the American Mathematical Society, 1(3):647–681, July 1988. doi:10.1090/S0894-0347-1988-0928904-4.
