Polygon triangulation


In computational geometry, polygon triangulation is the decomposition of a polygonal area P into a set of triangles, i.e., finding a set of triangles with pairwise non-intersecting interiors whose union is P.
Triangulations may be viewed as special cases of planar straight-line graphs. When there are no holes or added points, triangulations form maximal outerplanar graphs.

Polygon triangulation without extra vertices

Over time, a number of algorithms have been proposed to triangulate a polygon.

Special cases

It is trivial to triangulate any convex polygon in linear time into a fan triangulation, by adding diagonals from one vertex to all other vertices.
The total number of ways to triangulate a convex n-gon by non-intersecting diagonals is the nd Catalan number, which equals, a solution found by Leonhard Euler.
A monotone polygon can be triangulated in linear time with either the algorithm of A. Fournier and D.Y. Montuno, or the algorithm of Godfried Toussaint.

Ear clipping method

One way to triangulate a simple polygon is based on the two ears theorem, as the fact that any simple polygon with at least 4 vertices without holes has at least two 'ears', which are triangles with two sides being the edges of the polygon and the third one completely inside it. The algorithm then consists of finding such an ear, removing it from the polygon and repeating until there is only one triangle left.
This algorithm is easy to implement, but slower than some other algorithms, and it only works on polygons without holes. An implementation that keeps separate lists of convex and concave vertices will run in time. This method is known as ear clipping and sometimes ear trimming. An efficient algorithm for cutting off ears was discovered by Hossam ElGindy, Hazel Everett, and Godfried Toussaint.

Monotone polygon triangulation

A simple polygon is monotone with respect to a line, if any line orthogonal to intersects the polygon at most twice. A monotone polygon can be split into two monotone chains. A polygon that is monotone with respect to the y-axis is called y-monotone. A monotone polygon with vertices can be triangulated in time. Assuming a given polygon is y-monotone, the greedy algorithm begins by walking on one chain of the polygon from top to bottom while adding diagonals whenever it is possible. It is easy to see that the algorithm can be applied to any monotone polygon.

Triangulating a non-monotone polygon

If a polygon is not monotone, it can be partitioned into monotone subpolygons in time using a sweep-line approach.
The algorithm does not require the polygon to be simple, thus it can be applied to polygons with holes.
Generally, this algorithm can triangulate a planar subdivision with vertices in time using space.

Dual graph of a triangulation

A useful graph that is often associated with a triangulation of a polygon is the dual graph. Given a triangulation of, one defines the graph as the graph whose vertex set are the triangles of, two vertices being adjacent if and only if they share a diagonal. It is easy to observe that is a tree with maximum degree 3.

Computational complexity

Until 1988, whether a simple polygon can be triangulated faster than time was an open problem in computational geometry. Then, discovered an -time algorithm for triangulation, later simplified by. Several improved methods with complexity Big O notation#Orders of common functions| followed.
Bernard Chazelle showed in 1991 that any simple polygon can be triangulated in linear time, though the proposed algorithm is very complex. A simpler randomized algorithm with linear expected time is also known.
Seidel's decomposition algorithm and Chazelle's triangulation method are discussed in detail in.
The time complexity of triangulation of an -vertex polygon with holes has an lower bound, in algebraic computation tree models of computation. It is possible to compute the number of distinct triangulations of a simple polygon in polynomial time using dynamic programming, and to generate uniformly random triangulations in polynomial time. However, counting the triangulations of a polygon with holes is #P-complete, making it unlikely that it can be done in polynomial time.

Related problems