Bidirectional Algorithms for Polygon Triangulations and (m + 2)-Angulations via Fuss–Catalan Numbers
Abstract
1. Introduction
- Unified Fuss–Catalan Decomposition: We formalize a hierarchical decomposition of Catalan and Fuss–Catalan structures, establishing a common foundation for triangulations, quadrangulations, pentangulations, and general angulations.
- Bidirectional Linear-Time Algorithms: We design mutually inverse stack-based and tree-based algorithms that convert m-Dyck words to angulations and back in strict linear time and space.
- Correctness and Optimality Proofs: We prove soundness, completeness, bijection, and optimal O(n) bounds for all algorithms, supported by structural lemmas on stack nesting and dual-tree uniqueness.
- Experimental Validation: Through extensive experiments, we show that the proposed methods outperform classical rotation-based algorithms, especially for higher-arity angulations, in both speed and memory footprint.
- Generalizable Framework: The methods provide a compact, reversible, and scalable representation that supports enumeration, compressed storage, and future extensions to non-convex or higher-dimensional polygonal decompositions.
2. Related Works
3. Theoretical Foundations
- The diagonals are pairwise non-crossing.
- The diagonals partition the polygon into exactly n interior faces, each with exactly m + 2 edges.
- Exactly diagonals are inserted.
- The boundary edge (1, 2) is designated as the root edge.
- Total balance:
- Prefix constraint: for every prefix
- Every internal node has exactly m+1 ordered children;
- Leaves have no children;
- The root node is distinguished and has no parent.
- angulations of an -gon,
- planted ary trees with n internal nodes,
- Dyck words of semilength n.
- Root and orientation:The polygon is rooted at boundary edge .Vertices are labeled clockwise.
- Traversal Conventions:The dual of an angulation is a planted ary tree.Preorder traversal outputs U when entering an internal node and D when finishing it.
- Stack discipline:The stack contains the left endpoints of all currently open faces.Each U-step opens a new face.Each D-step closes exactly one face.
4. Unified Algorithms and Fuss–Catalan Generalization
4.1. Ballot-to-Angulation Algorithm (Generalized Algorithm 1)
| Algorithm 1. From ballot notation to (m + 2)-angulation |
|
- Prefix Condition: The Dyck property ensures that at any point, the stack contains at least m elements before a is processed.
- The LIFO stack discipline guarantees that all diagonals are properly nested and therefore non-crossing.
- Termination: After processing all symbols, exactly diagonals have been inserted, yielding a valid angulation.
4.2. Angulation-to-Ballot Algorithm (Generalized Algorithm 2)
| Algorithm 2. From angulation to Dyck ballot notation |
|
- The dual graph of the angulation is a tree because the diagonals are non-crossing.
- The clockwise order of children gives a unique embedding, ensuring the output word is uniquely determined.
- The resulting word satisfies the m-Dyck prefix condition by construction.
4.3. Tree-Based Enumeration of (m + 2)-Angulations (Generalized Algorithm 3)
| Algorithm 3. Generation of all angulations via backtracking on ary tree |
|
4.4. Correctness of the Unified Framework
4.5. Complexity Analysis
- A U-step pushes one record onto the stack, requiring constant time.
- A D-step pops exactly one record, again in constant time, and adds a single diagonal.
- Entering a face outputs one U,
- Finishing a face outputs one D.
- Local branching: For a partially constructed tree, the algorithm selects all admissible placements of m non-crossing diagonals that extend the current partial angulation. The number of such choices depends only on the tree node being expanded and does not depend on N = mn + 2. Thus each branching operation requires constant time.
- Recursive extension: Each recursive call appends one internal node to the underlying tree, and there are exactly n internal nodes. Therefore, along any recursion path, at most n = O(N) calls are made, but each call performs only constant work aside from recursion management.
- Amortized cost: Because every internal node of every tree is created exactly once, the total number of recursive calls is proportional to the number of generated angulations. The overhead between two successive outputs is therefore O(1), establishing the amortized bound.
- Space usage: The recursion stack and the partial tree representation together store at most n = O(N) nodes. No additional data structures grow beyond linear size because each partial configuration corresponds to a prefix of the tree.
- Output cost: Converting a fully constructed tree to its corresponding (m + 2)-angulation requires writing out mn − 1 = Θ(N) diagonals. This output cost is inherent and cannot be reduced.
4.6. Comparison with Rotation-Based Methods
- Each new output typically requires repeated geometric validity checks;
- Adjacency information and local neighborhood structure must be stored and updated;
- The amortized cost per generated angulation becomes superlinear once the method is extended from triangulations to general angulations.
4.7. Experimental Evaluation
- To measure the actual runtime of Algorithms 1 and 2 for a range of values of m and n;
- To verify that memory usage grows linearly with the size of the polygon;
- To empirically confirm that the bidirectional ballot–tree–angulation framework scales uniformly across different arities.
- CPU: Intel Core i7-11800H (8 cores, 2.30 GHz, 4.60 GHz turbo)
- RAM: 32 GB DDR4
- Operating System: Ubuntu 22.04 LTS (64-bit)
- Implementation Language: Python 3.11 with optimized recursion disabled;
- Critical loops implemented with CPython built-ins to avoid overhead.
- Random Generation: Dyck words and angulations generated using standard uniform algorithms to ensure unbiased test cases.
- Algorithms 1 and 2 (Ballot ↔ Angulation Conversions): Both curves exhibit an almost perfect linear growth in n, confirming the proven O(N) time complexity. Their slopes are shallow, indicating small constant factors. Among these, Algorithm 1 is the fastest due to its strictly iterative structure and limited overhead (simple push/pop operations). Algorithm 2 is only slightly slower because constructing and traversing the dual tree incurs minor additional overhead, but it still remains strictly linear.
- Algorithm 3 (Tree-Based Enumeration): The runtime also grows linearly with n, as expected for its amortized O(1) per-output cost (excluding output writing). Its slope is steeper than Algorithms 1 and 2, reflecting the cost of recursive branching and backtracking within the (m + 1)-ary tree structure. Nevertheless, it remains fully linear and far below the Hurtado–Noy growth rate.
- Hurtado–Noy rotation method: This curve departs from linearity and displays clear superlinear behavior. Even at moderate values of n, the runtime grows noticeably faster than any of the proposed linear-time algorithms. This aligns with theoretical expectations: rotation-based generation requires repeated structural validations and adjacency updates, resulting in average-case Θ(N2) behavior for general (m + 2)−angulations.
5. Future Directions
- Polyhedral dissections in 3D;
- Higher-dimensional Catalan objects;
- m-ary hypertrees and generalized polytopal subdivisions.
- Parallel traversal of trees;
- GPU-based generation of large families of angulations;
- SIMD operations for vectorized ballot-sequence handling.
- Compressed encodings of trees and Dyck paths;
- Succinct representations of angulations;
- Streaming algorithms that generate objects without storing them.
- Mesh generation and geometric modeling;
- Polygon partitioning for computational geometry;
- Dynamic triangulation updates;
- Computer graphics and animation.
6. Conclusions
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
Appendix A
Appendix A.1. Detailed Pseudocode of Algorithm 1
- A U-step adds a new pending face;
- A D-step closes the most recently opened face;
- Certex indices advance cyclically around the polygon boundary.

Appendix A.2. Detailed Pseudocode of Algorithm 2

Appendix A.3. Detailed Pseudocode of Algorithm 3

Appendix B
- Example (m = 2, n = 3): quadrangulations of an 8-gon.
- Example (m = 3, n = 2): pentangulations of an 8-gon.Example forHere . The objects correspond to decompositions of a convex 8-gon into quadrilaterals.m-Dyck path: e.g.,Tree representation: a ternary rooted tree with three internal nodes.An example quadrangulation of an 8-gon corresponding to the case and example pentangulation of an 8-gon corresponding to the case are shown in Figure A1a,b.

References
- Saračević, M.; Selimi, A. Convex polygon triangulation based on planted trivalent binary tree and ballot problem. Turk. J. Electr. Eng. Comput. Sci. 2019, 27, 346–361. [Google Scholar] [CrossRef]
- Pilaud, V.; Santos, F.; Ziegler, G.M. Celebrating Loday’s associahedron. Arch. Math. 2023, 121, 559–601. [Google Scholar] [CrossRef]
- Firoozi, F.; Jedwab, J.; Rattan, A. Combinatorial enumeration of lattice paths by flaws with respect to a linear boundary of rational slope. arXiv 2024, arXiv:2406.09590. [Google Scholar] [CrossRef]
- The Catalan Connection. Springer eBooks; Springer Nature: Cham, Switzerland, 2007; p. 289. [Google Scholar] [CrossRef]
- Kaibel, V.; Ziegler, G.M. Counting lattice triangulations. In Cambridge University Press eBooks; Cambridge University Press: Cambridge, UK, 2003; p. 277. [Google Scholar] [CrossRef]
- Dumitrescu, A.; Gärtner, B.; Pedroni, S.; Welzl, E. Enumerating triangulation paths. Comput. Geom. 2001, 20, 3–12. [Google Scholar] [CrossRef]
- Aleardi, L.C.; Devillers, O. Explicit Array-Based Compact Data Structures for Triangulations. In Lecture Notes in Computer Science; Springer Science+Business Media: Berlin/Heidelberg, Germany, 2011; p. 312. [Google Scholar] [CrossRef]
- Lee, E.; Masuda, M.; Park, S. Toric Richardson varieties of Catalan type and Wedderburn–Etherington numbers. Eur. J. Comb. 2022, 108, 103617. [Google Scholar] [CrossRef]
- Acharya, R.C.; Mütze, T.; Verciani, F. Flips in colorful triangulations. arXiv 2024, arXiv:2406.03783. [Google Scholar] [CrossRef]
- Jönsson, J. Generalized triangulations and diagonal-free subsets of stack polyominoes. J. Comb. Theory Ser. A 2005, 112, 117–142. [Google Scholar] [CrossRef]
- Stanley, R.P. Catalan Numbers, 1st ed.; Cambridge University Press: Cambridge, UK, 2015. [Google Scholar]
- Armstrong, D.; Rhoades, B.; Williams, N. Rational Catalan Combinatorics: The Associahedron. In Discrete Mathematics & Theoretical Computer Science, Proceedings of the 25th International Conference on Formal Power Series and Algebraic Combinatorics (FPSAC 2013), Paris, France, 24–28 June 2013; Discrete Mathematics and Theoretical Computer Science (DMTCS): Nancy, France, 2013. [Google Scholar] [CrossRef]
- Hurtado, F.; Noy, M. Counting triangulations of almost-convex polygons. Comput. Geom. 1999, 13, 219–229. [Google Scholar]
- Epstein, P.; Sack, J.-R. Generating triangulations at random. In Proceedings of the Fourth Canadian Conference on Computational Geometry, St. John’s, NL, Canada, 10–14 August 1992; pp. 305–310. [Google Scholar]
- Barcucci, E.; Del Lungo, A.; Pergola, E. Random generation of trees and other combinatorial objects. Theor. Comput. Sci. 1999, 218, 219–232. [Google Scholar] [CrossRef]
- Stanley, R.P. Enumerative Combinatorics, 1st ed.; Cambridge University Press: Cambridge, UK, 2011; Volume 2. [Google Scholar]
- Lyapin, A.P.; Chandragiri, S. The Cauchy Problem for Multidimensional Difference Equations in Lattice Cones. J. Sib. Fed. Univ. Math. Phys. 2020, 13, 187–196. [Google Scholar] [CrossRef]
- Fusy, É. New bijective links on planar maps via orientations. Eur. J. Comb. 2010, 31, 145–160. [Google Scholar] [CrossRef][Green Version]
- Chapoton, F. Enumerative properties of generalized associahedra. Sémin. Lothar. Comb. 2006, 55, B55b. [Google Scholar]
- Bernardi, O.; Fusy, É. Unified bijections for maps with prescribed degrees and girth. J. Comb. Theory Ser. A 2012, 119, 1351–1387. [Google Scholar] [CrossRef]
- Pallo, J.M. Enumeration of polygon dissections. Theor. Comput. Sci. 2000, 233, 147–182. [Google Scholar]
- Aichholzer, O.; Mulzer, W.; Pilz, A. Flip Distance Between Triangulations of a Simple Polygon is NP-Complete. Discret. Comput. Geom. 2015, 54, 368–389. [Google Scholar] [CrossRef]
- Kirkpatrick, D.; Klawe, M.; Tarjan, R.E. Polygon triangulation in O(logn) time with simple data structures. Discret. Comput. Geom. 1992, 7, 329. [Google Scholar] [CrossRef]
- Krtolica, P.; Stanimirović, P.S.; Stojanović, I. An Alternative Decomposition of Catalan Number. Facta Univ. Ser. Math. Inform. 2018, 33, 63–77. [Google Scholar] [CrossRef]
- Poulalhon, D.; Schaeffer, G. Optimal Coding and Sampling of Triangulations. Algorithmica 2006, 46, 505–527. [Google Scholar] [CrossRef]
- Svihla, S.S.; Lladser, M.E. Sparsification of Phylogenetic Covariance Matrices of k-Regular Trees. arXiv 2024, arXiv:2405.17847. [Google Scholar] [CrossRef]
- Merlini, D.; Sprugnoli, R.; Verri, M.C. Some statistics on Dyck paths. J. Stat. Plan. Inference 2002, 101, 211–227. [Google Scholar] [CrossRef]
- Prodinger, H. On k-Dyck Paths with a Negative Boundary. J. Comb. Math. Comb. Comput. 2024, 119, 3–12. [Google Scholar] [CrossRef]
- Sabri, A.; Vajnovszki, V. On the exhaustive generation of generalized ballot sequences in lexicographic and Gray code order. Pure Math. Appl. 2019, 28, 109–119. [Google Scholar] [CrossRef]
- Merino, A.; Mütze, T. Combinatorial Generation via Permutation Languages. III. Rectangulations. Discret. Comput. Geom. 2022, 70, 51–122. [Google Scholar] [CrossRef]


| Algorithms | Input Size | Time Complexity | Space Complexity | Explanation |
|---|---|---|---|---|
| Ballot-to-Angulation (Algorithm 1) | m-Dyck word of length (m + 1)n; polygon with N = mn + 2 vertices | Processes each symbol once; each D-step closes exactly one face; stack ≤ mn; output diagonals . | ||
| Angulation-to-Ballot (Algorithm 2) | (m + 2)-angulation with (N = mn + 2) vertices | Preorder traversal of the dual (m + 1)-ary tree visits each internal node once. | ||
| Tree-Based Generation (Algorithm 3) | amortized per output | Each extension of the tree requires constant work; writing each angulation costs . | ||
| Hurtado–Noy Method | (m + 2)-angulations | per output | Rotation/flip operations require repeated validity checks and structural updates; known to be superlinear for m > 1. |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2025 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Selim, A.; Saracevic, M.; Stosic, L.; Aydin, O.; Zajmović, M. Bidirectional Algorithms for Polygon Triangulations and (m + 2)-Angulations via Fuss–Catalan Numbers. Mathematics 2025, 13, 3837. https://doi.org/10.3390/math13233837
Selim A, Saracevic M, Stosic L, Aydin O, Zajmović M. Bidirectional Algorithms for Polygon Triangulations and (m + 2)-Angulations via Fuss–Catalan Numbers. Mathematics. 2025; 13(23):3837. https://doi.org/10.3390/math13233837
Chicago/Turabian StyleSelim, Aybeyan, Muzafer Saracevic, Lazar Stosic, Omer Aydin, and Mahir Zajmović. 2025. "Bidirectional Algorithms for Polygon Triangulations and (m + 2)-Angulations via Fuss–Catalan Numbers" Mathematics 13, no. 23: 3837. https://doi.org/10.3390/math13233837
APA StyleSelim, A., Saracevic, M., Stosic, L., Aydin, O., & Zajmović, M. (2025). Bidirectional Algorithms for Polygon Triangulations and (m + 2)-Angulations via Fuss–Catalan Numbers. Mathematics, 13(23), 3837. https://doi.org/10.3390/math13233837

