0
$\begingroup$

I am trying to enumerate and display all possible divisions of an n-polygon into (n-2) triangles (as in the following mathworld picture)

Euler polygon division

I know how to count how many divisions (Catalan numbers, 1, 2, 5, 14, 42, ... ), but I am struggling to find a way to generate all the C(n-2) triangulations. Can anyone point to existing software implementation, or at least to an algorithm that generates these triangles?

asked May 28, 2021 at 11:09
$\endgroup$

2 Answers 2

1
$\begingroup$

See: Hurtado and Noy, Graph of triangulations of a convex polygon and tree of triangulations , Computational Geometry 13 (1999) pp179–188.

Section 3 of that paper gives a relatively straightforward method for constructing all triangulations of $n+1$-gons given all triangulations of $n$-gons.

answered May 28, 2021 at 12:00
$\endgroup$
1
$\begingroup$

You can use the formula to count the number of division to generate them.

Suppose you want to generate a division of a $n$-polygon whose vertices are 1,ドル 2, ..., n$. We know that there are $C_{n-2}$ such divisions (where $C_k$ is the $k$-th Catalan's number). What we need to do is:

  • chose 2ドル\leqslant k\leqslant n-1$ the other vertex of the triangle with edge $\{1, n\}$;
  • chose a division of the polygon with vertices 1,ドル 2, ..., k$;
  • chose a division of the polygon with vertices $k, k+1, ..., n$.

Suppose you want to generate the $i$-th division of the $n$-polygon, 1ドル\leqslant i\leqslant C_{n-2}$. Since we know that $C_{n-2} = \sum\limits_{j=2}^{n-1}C_{j-2}C_{n-1-j}$, we have a way to chose the value of $k$: chose the minimum $k$ such that $i\leqslant \sum\limits_{j=2}^kC_{j-2}C_{n-1-j}$.

We then need to chose the number $i_1$ of the division of the polygon 1,ドル 2, ..., k$ and the number $i_2$ of the division of the polygon $k, k+1, ..., n$. Picking $i_1 = i\mod C_{k-2}$ and $i_2 = \left\lfloor \frac{i}{C_{k-2}}\right\rfloor$ will do the trick.

This gives the idea of a recursive algorithm to generate divisions. Note that the base case here is the polygon with $n=2$ (a simple edge).

answered May 28, 2021 at 12:33
$\endgroup$

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.