ETH Flippers Approach to Parallel Reconfiguration of Triangulations: SAT Formulation and Heuristics
Abstract
We describe the algorithms used by the ETH Flippers team in the CG:SHOP 2026 Challenge. Each instance consists of a set of triangulations on a common point set, and the objective is to find a central triangulation that minimizes the total parallel flip distance to the input set. Our strategy combines an exact solver for small and medium-sized instances with a suite of heuristics for larger instances. For the exact approach, we formulate the problem as a SAT instance with XOR clauses to model edge transitions across multiple rounds, further optimized by lower bounds derived from exact pairwise distances. For larger instances, we use a greedy local search and edge-coloring techniques to identify maximal sets of independent flips. Our approach ranked second overall and first in the junior category, computing provably optimal solutions for 186 out of 250 instances.
Keywords and phrases:
exact solution, heuristic, SAT solver, XOR clauses, computational geometryCategory:
CG ChallengeCopyright and License:
2012 ACM Subject Classification:
Theory of computation Computational geometrySupplementary Material:
Software: https://github.com/Lbattini/ETH-flippers-CGSHOP2026 [2]archived at
swh:1:dir:ec12f1b858c98832fd57fc7a2d407989c1fc00cf
Acknowledgements:
We would like to thank the Challenge organizers and other competitors for their time, feedback, and for making this whole event possible. This work was conducted as part of the Practical Work course at ETH Zürich under the supervision of Michael Hoffmann, whose guidance was invaluable. We sincerely thank Bernd Gärtner for providing travel support to attend the conference. We also acknowledge the ETH High Performance Computing group for providing the computational resources of the Euler cluster.Editors:
Hee-Kap Ahn, Michael Hoffmann, and Amir NayyeriSeries and Publisher:
Leibniz International Proceedings in Informatics, Schloss Dagstuhl – Leibniz-Zentrum für Informatik
1 Introduction
Triangulations of point sets, in this context, maximal straight-line crossing-free graphs with endpoints in the point set, have many applications, for instance, in computer graphics and in reconstruction problems in geodesy.
A common problem is transforming a triangulation into another on the same point set using edge flips, replacing an internal edge whose incident triangles form a convex quadrilateral with its other diagonal. Hurtado, Noy, and Urrutia [4] introduced parallel edge flips, which consist of flipping at the same time a set of edges such that none of the pairs of edges in the set shares a triangle.
The “CG:SHOP Challenge” (Computational Geometry: Solving Hard Optimization Problems) is a computational challenge competition about a hard geometric optimization problem. This year’s challenge problem was proposed by Aichholzer, Dorfer, and Kramer. The goal is to find a central triangulation and, for each of the given triangulations on the same pointset , a sequence of parallel flips transforming into , such that the sum of the lengths of these sequences is minimized. The solution methods are evaluated on a benchmark of 250 instances. We refer to [1] for further challenge details.
We present an exact solution method based on formulating the problem as a SAT problem with XOR clauses, which is used to solve the small and medium instances, as well as various heuristics that we used for the larger instances.
Our team, ETH flippers, ranked second overall and first in the junior category. We computed a provably optimal solution for 186 instances. Three further instances were solved, but a technical bug during our local validation caused us to stop at sub-optimal values. The largest instances we optimally solved featured twenty -point triangulations, while the highest total parallel flip distance among our optimally solved instances is . Notably, for this latter instance (random_instance_440_160_20), our solution was uniquely the best among all participating teams (see Figure 1).
2 2-SAT formulation
Given a set of triangulations, , we formulate a 2-SAT instance to search for a triangulation such that the distance from each to is at most one.
For every convex quadrilateral formed by a pair of facial triangles that share an edge in any , we fix an arbitrary reference diagonal. Let the variable denote whether uses its reference diagonal and let the constant denote its state in . To prevent invalid simultaneous flips, we add the clause for all pairs of intersecting quadrilaterals in each . This determines the existence of a central triangulation in time.
3 SAT formulation with XOR clauses
XOR clauses.
The most natural approach to modelling parallel flips is a round-by-round progression. We need to keep the state of each edge across intermediate parallel flips.
We model the state transition of an edge over parallel flips using XOR operations. Let denote the presence of in the initial and final triangulations, respectively. Let be the set of all potential convex empty quadrilaterals that share as a diagonal. We let indicate whether a flip is performed on during step .
Because the final state of edge after parallel flips is simply its initial state XORed with all intermediate flips across its potential quadrilaterals , we add the constraint
We decided to use the CryptoMiniSat5 [8] solver, since it supports inputs with XOR clauses.
Formulation
We extend the previous formulation to search for a center whose distance to each is upper bounded by a given target .
Geometric Preconditions for Flips.
Let be the set of all convex empty quadrilaterals defined on the pointset, which we identified via spatial hashing [9]. Let the variable denote the presence of edge at step . For a flip to be geometrically valid at step , the four boundary edges of its corresponding quadrilateral must exist in the prior step. We enforce this constraint with implication .
Target Equivalence with Center C.
We introduce global boolean variables representing the edges of the center . We enforce consistency at the final step via the equivalence . This link forces the final state of every flip sequence to be identical to the global center, effectively merging the independent SAT sub-problems to a shared solution.
Edge Transition Constraints.
We must ensure that the triangulation changes only through valid flip operations. An edge changes its status (present or absent) between parallel flips and if and only if a flip is performed on a quadrilateral where serves as the diagonal.
Let be the set of all convex empty quadrilaterals for which is a diagonal. The relationship between the edge’s state at consecutive parallel flips and the flip variables is enforced via an XOR constraint: .
For edges on the convex hull, the set is empty, effectively enforcing that these edges remain constant throughout the transformation.
Constraints on Simultaneous Flips.
We must enforce strict independence between simultaneous operations. Specifically, for any subset of four vertices , there can be at most one active flip operation at time involving three of these vertices. This prevents structural conflicts where multiple flips compete for the same triangle.
We iterate through all quadruplets of vertices and identify the set of potential flip variables of size associated with them. We then enforce an At-Most-One (AMO) constraint on this set . There are multiple ways to model this constraint using a linear number of clauses [7]. The ladder encoding that we implemented uses variables and clauses, compared to variables and clauses. Due to the possible number of convex empty quadrilaterals, clauses generation becomes a computational bottleneck.
Initial State and Boundary Conditions.
We initialize the SAT model for each input triangulation by fixing to true if the edge exists in it and false otherwise. Furthermore, since parallel flips only affect internal diagonals of convex quadrilaterals, the convex hull edges remain invariant. We hard-code to true for all across all steps , effectively pruning the search space by preventing flips of boundary edges.
Pruning clauses.
To significantly prune the search space, we precompute the minimum flip distance required to introduce each edge into triangulation using an iterative breadth-first reachability search. We then omit all SAT variables and clauses associated with an edge for any time step prior to this theoretical minimum.
4 Exact solving
Lower bound.
To establish a lower bound, we first compute exact pairwise parallel flip distances using our SAT formulation. Any valid central triangulation at distances to inputs must satisfy the triangle inequality for all pairs . To test if a target total distance is feasible, we find all integer assignments summing to that satisfy these pairwise constraints via recursive backtracking. For instances with triangulations, we use some further pruning techniques. We compute the minimum parallel flip distance for the last triangulations, for , where we used for most instances since it was experimentally found to be sufficiently fast to compute. Then we use those suffix distances by pruning a branch whenever . Moreover, after the first and distances have been assigned recursively, we prune the branch if the prefix is not satisfiable.
Choosing the distribution of distances.
The upper bound search is existential. Consequently, prioritizing candidates that are more likely to be satisfiable can significantly accelerate the search.
Let represent a potential assignment vector. We define the scoring function as the sum of absolute differences between all pairs of elements: . The candidate distributions are processed in ascending order of .
Empirical analysis reveals that this heuristic is remarkably effective for randomly generated instances. In the majority of cases, the satisfiable distribution corresponds to the candidate with the minimal score. Even in cases where the global minimum is not the solution, the valid assignment is consistently found among the top-ranked candidates.
Conjecture 1.
For a randomly generated triangulation instance under the standard uniform distribution model, ordering of candidate distance vectors by increasing minimizes the expected number of queries required to find a satisfiable assignment.
5 Heuristics
Transforming a triangulation into another.
To transform a triangulation into another , we flip edges such that the number of intersecting edges decreases. We now describe how, at each step, we choose a subset of independent edges to flip among the ones that reduce the number of intersections.
Firstly, we choose edges that, if flipped, introduce an edge that is present in . To do so, we start by creating a graph containing those edges, where the nodes correspond to faces incident to them. Then we compute an edge coloring of this graph using the Misra and Gries algorithm [5] from the Boost Graph Library [6]. Finally, we flip the edges corresponding to the color class of maximum cardinality, and all the isolated edges. Since the boundary edges cannot be flipped, and the bounded faces are triangles, the maximum degree is at most . Since the Misra and Gries algorithm uses at most colors, at least one fourth of the edges in the graph are flipped.
Secondly, we greedily pick the edges that are independent from all the edges that have already been picked, in order of non-increasing reduction of the number of intersections.
This transforms a triangulation into the other in a finite number of steps, since it can be seen as an adaptation to parallel flips of the algorithm described by Hanke, Ottmann, and Schuierer [3]. Given the flip sequence that we obtain with the described heuristic, let be the corresponding sequence of triangulations, where is the triangulation we obtain after the parallel flip . The reversed flip sequence transforms into and it can be obtained by reversing the order of the parallel flips, and replacing each individual flip with .
We can obtain other heuristic flip sequences , with , by concatenating the heuristic flip sequence that turns into with the reversed flip sequence that turns into .
Since these sequences are heuristic, their length might differ, and so we try multiple values of and choose the shortest flip sequence.
We empirically observed that trying all intermediate values typically reduces each triangulation’s distance by 1. Therefore, to maintain computational efficiency on large instances, we only do this when the total distance is within . Here, is the smallest objective value among all the centers that were computed before.
Choosing centers.
Apart from input triangulations, we also generate candidate centers by greedily flipping edges in input triangulations to minimize total intersections with the entire point set until a local optimum is reached.
We then record all the intermediate triangulations at the end of each parallel flip, which is used to transform an input triangulation into one of those centers. To avoid trying all centers, we sort them in increasing order of total number of intersections with all the input triangulations and only compute the heuristic parallel flip distance for a fraction of them.
6 Combined Strategies
Fixed center.
A promising combined strategy involves using the heuristic to select a candidate center triangulation, denoted as , and using the exact SAT solver to compute the minimal parallel flip distances from all input triangulations to , one by one.
Although this approach remains heuristic, it was effective on the rirs instances, but it also indirectly helped significantly with large non-rirs instances. Finding a slightly better solution allows the exact solver to handle cases that were previously out of reach.
Solving a subproblem.
A natural extension to computing pairwise distances is to compute exact distances for larger subsets. This yielded negligible improvements to the lower bound, likely due to the triangle inequality holding strong even for pairwise constraints.
Similar reasoning proved highly effective for the woc (especially tsplib) instances, observing that the distances to the optimal center were not uniformly distributed. By identifying and excluding outlier triangulations, we could exactly solve for the center of the remaining subset. This produced a robust heuristic center for the fixed center heuristic.
References
- [1] Oswin Aichholzer, Joseph Dorfer, Sándor P. Fekete, Phillip Keldenich, Peter Kramer, and Stefan Schirra. Central Triangulation under Parallel Flip Operations: The CG:SHOP Challenge 2026, 2026. arXiv:2603.18812.
- [2] Lorenzo Battini and Marko Milenković. ETH flippers CGSHOP2026. Software, swhId: swh:1:dir:ec12f1b858c98832fd57fc7a2d407989c1fc00cf (visited on 2026-05-15). URL: https://github.com/Lbattini/ETH-flippers-CGSHOP2026, doi:10.4230/artifacts.26084.
- [3] Sabine Hanke, Thomas Ottmann, and Sven Schuierer. The edge-flipping distance of triangulations. Journal of Universal Computer Science, 2, April 1996. doi:10.3217/jucs-002-08-0570.
- [4] Ferran Hurtado, Marc Noy, and Jorge Urrutia. Parallel edge flipping. In CCCG, 1998.
- [5] J. Misra and David Gries. A constructive proof of Vizing’s theorem. Information Processing Letters, 41(3):131–133, 1992. doi:10.1016/0020-0190(92)90041-S.
- [6] Maciej Piechotka. Edge coloring BGL implementation. URL: https://www.boost.org/doc/libs/latest/libs/graph/doc/edge_coloring.html.
- [7] Carsten Sinz. Towards an optimal CNF encoding of boolean cardinality constraints. In Principles and Practice of Constraint Programming – CP 2005, volume 3709 of Lecture Notes in Computer Science, pages 827–831. Springer, 2005. doi:10.1007/11564751_73.
- [8] Mate Soos, Karsten Nohl, and Claude Castelluccia. Extending SAT solvers to Cryptographic problems. In Theory and Applications of Satisfiability Testing – SAT 2009, volume 5584 of Lecture Notes in Computer Science, pages 244–257. Springer, 2009. doi:10.1007/978-3-642-02777-2_24.
- [9] Matthias Teschner, Bruno Heidelberger, Matthias Müller, Danat Pomeranets, and Markus Gross. Optimized spatial hashing for collision detection of deformable objects. Proceedings of Vision, Modeling, and Visualization, 3:47–54, 2003.
