Shadoks Approach to Parallel Reconfiguration of Triangulations
Abstract
We describe the methods used by Team Shadoks to win the CG:SHOP 2026 Challenge on parallel reconfiguration of planar triangulations. Our approach combines exact methods based on SAT with several greedy heuristics, and also makes use of SAT and MaxSAT for solution improvement.
Keywords and phrases:
Exact algorithm, SAT, MaxSAT, heuristic, computational geometryCategory:
CG ChallengeCopyright and License:
2012 ACM Subject Classification:
Theory of computation Computational geometrySupplementary Material:
Software (Source Code): https://github.com/gfonsecabr/shadoks-CGSHOP2026archived at
swh:1:dir:14b1868ef49dcd479ff783d738ee448d33be9221
Acknowledgements:
We would like to thank the Challenge organizers and other competitors for their time, feedback, and making this whole event possible. We would like to thank Hélène Toussaint, Raphaël Amato, Boris Lonjon, and William Guyot-Lénat from LIMOS, as well as the Qarma and TALEP teams and Manuel Bertrand from LIS, who continue to make the computational resources of the LIMOS and LIS clusters available to our research. We would also like to thank Aldo Gonzalez-Lorenzo for the very useful discussion on SAT models.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
The CG:SHOP Challenge is an annual competition in geometric optimization. In 2026, the challenge focuses on a reconfiguration problem between planar triangulations. Our team, called Shadoks, won first place with the best solution (among the 28 participating teams) to instances out of instances and provably optimal solutions to instances.
In this paper, we outline the exact methods that we employed. The heuristic solvers are only presented in the full version due to space limitations. We start with some definitions that allow us to describe the problem. Throughout, we consider triangulations of a common point set .
Given a triangulation , a unit flip is the operation that removes an edge and adds an edge . The unit flip of the edge considers the empty convex quadrilateral and replaces its diagonal it by the other diagonal (Figure 2).
Similarly, a parallel flip removes a set of edges and adds a set of edges , in a way that is a triangulation, with the condition that no two edges of are in the same triangle in . A path of length is a sequence of triangulations such that for all , the triangulation is obtained from by performing a parallel flip.
An instance is a set of points and a set of triangulations of , called input triangulations. A solution is a set of paths such that starts at for all and all paths end in a common triangulation called center. The goal is to find a solution that minimizes the objective value defined as the sum of the lengths of its paths.
During the competition, the organizers provided a total of instances, with ranging from to points and ranging from to triangulations. The instances are divided into three classes: random instances, woc instances, and rirs instances. The former two instances have up to points and to input triangulations (hence, we call them small instances), while the latter have to points and to input triangulations. The centers of some of our best solutions are presented in Figure 1. Additional details about the challenge can be found in the organizers’ survey paper [2].
Our best solvers heavily rely on the SAT solver CaDiCal [5] and the MaxSAT solver EvalMaxSAT [3]. Nevertheless, we also developed heuristics that do not rely on any external solver, which are important to find initial solutions to large instances, which are then improved by roughly using SAT and MaxSAT solvers., which are presented in the full version.
2 Exact Algorithms
2.1 Path SAT Formulation
Next, we describe a SAT formulation for the following decision problem. The input is a set of points, an integer and two triangulations . The output is whether there exists a path of length .
We define two types of variables. For and for , we define an edge variable . The variable represents that the edge is in the triangulation . There are edge variables. It would be possible to define a SAT formulation using only such variables. However, a SAT formulation that performed much better in our experiments uses a second type of variable.
We say that a convex quadrilateral is empty if it contains no point of except for its vertices. For -1 and for an empty convex quadrilateral , we introduce flip variables , which is true if and only if is in triangulation and is in triangulation , as shown in Figure 2. Notice that if the points are uniformly distributed, then the number of empty convex quadrilaterals is [8], which means that for uniformly distributed points, the number of flip variables is also . However, the number of flip variables is if the points are in convex position (which is not the case for the challenge instances). Next, we describe the different types of clauses.
Start and target.
For every edge variable , we have the clause if and if . For every edge variable , we have the clause if and if .
Flips need edges.
For every flip variable , we have the binary CNF clauses translating the implication
Flips keep edges.
Similarly, or every flip variable , we have the binary CNF clauses translating the implication
Flips flip edges.
For every flip variable , we have the binary clauses translating
Edge changes require flips.
The last type of clause is the only one that has more than variables in CNF form. It states that if the edge variable changes from triangulation to , then there must be a flip. The below considers all values of the subscript that define existing flip variables. We have two such clauses for each edge variable:
Eliminating variables and clauses.
The number of variables and clauses grows very fast, even though the number of clauses is linear in the number of variables. Next, we show how to eliminate many variables from the model. All eliminated variables are defined as false and the clauses that become tautologies are eliminated. If a CNF clause becomes empty, then the problem is unsatisfiable.
The following theorem is easy to prove and implies that parallel flips are sometimes necessary to reconfigure two triangulations of points, even when the points are in convex position. We say that two segments cross if they intersect at a point that is not an endpoint of either segment.
Theorem 1.
Consider two triangulations of such that a parallel flip transforms into and a segment with endpoints in . Let respectively denote the number of edges of crossed by . We then have .
Consequently, we only define the variable when crosses strictly less than edges of and strictly less than target edges. We only define flip variables when a certain set of edge variables is defined: is only defined when , are all defined at and , are all defined at .
2.2 Solution SAT Formulation
Next, we describe a SAT formulation for the following decision problem. Recall that an instance is a set of points and a list of input triangulations . The input of the decision problem is an instance and integers . The output is whether there exists a solution such that path has length for all .
We model the paths independently as before, starting path at the input triangulation . The final triangulation of each path is unknown, but the same edge variables are used for the final triangulation of every path, since a valid solution requires that all paths end in the same triangulation. It is easy to see that the SAT formulation is satisfiable if and only if there exists a solution with the given lengths.
2.3 Lower Bound
In order to obtain an exact solution to an instance , we start by computing a lower bound to its objective value. We say that the distance between two triangulations is the length of the shortest path from to . We create a complete directed graph with edge lengths as follows. The vertices are the triangulations and the length of each edge is the distance between the corresponding triangulations. A cycle packing of is a collection of vertex-disjoint directed cycles, i.e. a subset of edges such that each vertex has at most one outgoing and at most one incoming edge in the subset. The graph is directed to allow for cycles with only edges. The length of a cycle is the sum of the lengths of its edges, and the length of a cycle packing is the sum of the lengths of its cycles. The maximum length cycle packing can be solved in polynomial time using a reduction to maximum weight bipartite matching [6]. The following theorem is easy to show.
Theorem 2.
Given an instance , the objective value of a solution is at least the length of any cycle packing of divided by .
2.4 The Exact Solver
First, we use the exact path formulation from Section 2.1 to calculate the distance between all pairs of input triangulations using a SAT solver (in our case, CaDiCal [5]). It is easy to formulate the problem of finding a maximum length cycle packing as a weighted MaxSAT problem, which provides a lower bound to the objective value (see Section 2.3). We solve this problem using a weighted MaxSAT solver (in our case EvalMaxSAT [3]). We then use backtracking to list all integer solutions to that satisfy . We use the SAT formulation from Section 2.2 to test the existence of a solution with the given lengths , again using the CaDiCal SAT solver. If a solution is found, then it is optimal. Otherwise, we increment and repeat. Notice that is always a lower bound to the objective value. Hence, if a solution obtained by a heuristic attains this lower bound, then it is optimal.
2.5 Happy Edges Conjecture
The happy edges conjecture [1] is a general conjecture that is false for some reconfiguration problems and true for others.
Conjecture 3.
For any pair of configurations , there exists a shortest path between where the edges that are common to both and appear in all intermediate configurations.
The conjecture is false for triangulations under unit flips and arbitrary points [10] but true when the points are in convex position [11]. Our experiments lead us to believe that the conjecture is true for parallel flips, as we could not find a counterexample.
When computing a path of length from to using SAT, for every edge that appears in both and , we add clauses that force the variable to be true for all . More importantly, we then eliminate every edge variables corresponding to edges that cross . The same idea can be applied to the SAT formulation that finds a solution, but then only the edges that appear in all input triangulations are forced to be true for all , and again the edges that cross them are eliminated.
Furthermore, when computing a path, for every edge , we eliminate flip variables that remove , i.e. for all . Similarly, for every edge , we eliminate flip variables that insert , that is for all .
3 Results
In this section, we present the computational results that we obtained with our implementation of the aforementioned algorithm. In Section 3.1, we present the results on computing short paths between two given triangulations. In Section 3.2, we present our exact solver, with and without the happy edges conjecture.
The solvers were coded in C++ and compiled with GCC and run a single thread. During the competition, they were executed on several Linux computers, either using GNU Parallel [12] for local executions or Slurm [13] for cluster executions. It was very useful to have access to machines with 128GB or more RAM to solve large SAT formulations with CaDiCal [5], which has been able to solve SAT instances with more than million variables and million clauses. The time measurements on this paper use an AMD Ryzen 9 9900X CPU and ASUS TUF B650M motherboard with 128GB of RAM running Fedora Core 43.
3.1 Path Calculation
| Heuristic | SAT happy | SAT exact | ||||
|---|---|---|---|---|---|---|
| length | total time | length | time | length | time | |
| 500 | 12 | 70.9 | 12 | 1512 | 12 | 10191 |
| 1000 | 12 | 77.6 | 11 | 6806 | 11 | 78264 |
| 1500 | 12 | 100 | 11 | 19302 | 11 | 201353 |
| 2000 | 13 | 208 | 13 | 16937 | 13 | 485177 |
| 3000 | 14 | 695 | 14 | 140729 | ||
| 4000 | 15 | 1340 | 15 | 101402 | ||
| 5000 | 16 | 656 | 16 | 1037840 | ||
| 6000 | 16 | 1891 | 16 | 271081 | ||
| 7000 | 17 | 777 | 16 | 471389 | ||
Computing short paths between two given triangulations is a key component to obtain good solutions. Typically, these paths are computed with an input triangulation as one extreme, and a triangulation that makes a reasonably good center as the other extreme. Table 1 shows the best length of the path obtained with our heuristics (described in the full version of the paper) with the associated running times compared to our SAT formulation with and without the happy edges conjecture. The paths are computed from the Delaunay triangulation that makes a reasonably good (but not very good) center to the first input triangulation of several instances. The SAT paths are obtained by first running a heuristic in both directions, and then iteratively decreasing the path length with our SAT solution.
3.2 Exact Solutions
We end the paper with the performance of our exact solver. Figure 4 plots the number of exact solutions found as a function of runtime, with and without the happy edges conjecture. Since the solution values are identical in both cases, the happy edge conjecture holds.
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, 2022. doi:10.48550/arXiv.2206.03879.
- [2] 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.
- [3] Florent Avellaneda. A short description of the solver EvalMaxSAT. MaxSAT Evaluation, 8:364, 2020.
- [4] Lorenzo Battini and Marko Milenković. ETH flippers approach to parallel reconfiguration of triangulations: SAT formulation and heuristics. In Proceedings of the Symposium on Computational Geometry (SoCG), 2026. doi:10.4230/LIPIcs.SoCG.2026.105.
- [5] Armin Biere, Tobias Faller, Katalin Fazekas, Mathias Fleury, Nils Froleyks, and Florian Pollitt. CaDiCaL 2.0. In Computer Aided Verification - 36th International Conference, CAV, volume 14681 of LNCS, pages 133–152, 2024. doi:10.1007/978-3-031-65627-9_7.
- [6] P Biró, D Manlove, and R Rizzi. Maximum weight cycle packing in optimal kidney exchange programs, university of glasgow, department of computing science. Technical report, Technical Report TR–2009–298, 2009.
- [7] Jacobus Conradi, Benedikt Kolbe, Philip Mayer, Jonas Sauer, and Jack Spalding-Jamieson. Engineering greedy heuristics and simulated annealing methods for the median triangulation under the parallel flip distance. In Proceedings of the Symposium on Computational Geometry (SoCG), 2026. doi:10.4230/LIPIcs.SoCG.2026.106.
- [8] Ruy Fabila-Monroy, Clemens Huemer, and Dieter Mitsche. The number of empty four-gons in random point sets. Electronic Notes in Discrete Mathematics, 46:161–168, 2014. doi:10.1016/j.endm.2014.08.022.
- [9] Jaegun Lee, Seokyun Kang, Hyeonseok Lee, Hyeyun Yang, and Taehoon Ahn. CG#Hunters approach to central triangulation under parallel flip operations. In Proceedings of the Symposium on Computational Geometry (SoCG), 2026. doi:10.4230/LIPIcs.SoCG.2026.108.
- [10] 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.
- [11] Daniel D. Sleator and William P. Tarjan, Robert E.and Thurston. Rotation distance, triangulations, and hyperbolic geometry. In Proceedings of the eighteenth annual ACM symposium on Theory of computing, pages 122–135, 1986.
- [12] O. Tange. GNU parallel – The command-line power tool. ;login: The USENIX Magazine, 36(1):42–47, February 2011. URL: http://www.gnu.org/s/parallel.
- [13] Andy B Yoo, Morris A Jette, and Mark Grondona. Slurm: Simple linux utility for resource management. In Workshop on job scheduling strategies for parallel processing, pages 44–60, 2003. doi:10.1007/10968987_3.
