In
computational geometry, polygon triangulation is the
partition of a
polygonal area
In geometry, a polygon () is a plane figure made up of line segments connected to form a closed polygonal chain.
The segments of a closed polygonal chain are called its '' edges'' or ''sides''. The points where two edges meet are the polygon ...
(
simple polygon
In geometry, a simple polygon is a polygon that does not Intersection (Euclidean geometry), intersect itself and has no holes. That is, it is a Piecewise linear curve, piecewise-linear Jordan curve consisting of finitely many line segments. The ...
) into a set of
triangles
A triangle is a polygon with three corners and three sides, one of the basic shapes in geometry. The corners, also called ''vertices'', are zero-dimensional points while the sides connecting them, also called ''edges'', are one-dimensiona ...
,
i.e., finding a set of triangles with pairwise non-intersecting interiors whose
union is .
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 geometry, a convex polygon is a polygon that is the boundary of a convex set. This means that the line segment between two points of the polygon is contained in the union of the interior and the boundary of the polygon. In particular, it is ...
in
linear time
In theoretical computer science, the time complexity is the computational complexity that describes the amount of computer time it takes to run an algorithm. Time complexity is commonly estimated by counting the number of elementary operations ...
into a
fan triangulation
In computational geometry, a fan triangulation is a simple way to Polygon triangulation, triangulate a polygon by choosing a Vertex (geometry), vertex and drawing Edge (geometry), edges to all of the other vertices of the polygon. Not every poly ...
, by adding diagonals from one vertex to all other non-nearest neighbor vertices.
The total number of ways to triangulate a convex
''n''-gon by non-intersecting diagonals is the (''n''−2)nd
Catalan number
The Catalan numbers are a sequence of natural numbers that occur in various Enumeration, counting problems, often involving recursion, recursively defined objects. They are named after Eugène Charles Catalan, Eugène Catalan, though they were p ...
, which equals
:
,
a formula found by
Leonhard Euler
Leonhard Euler ( ; ; ; 15 April 170718 September 1783) was a Swiss polymath who was active as a mathematician, physicist, astronomer, logician, geographer, and engineer. He founded the studies of graph theory and topology and made influential ...
.
A
monotone polygon
In geometry, a polygon in the plane is called monotone with respect to a straight line , if every line orthogonal to intersects the boundary of at most twice.
Similarly, a polygonal chain is called monotone with respect to a straight line ...
can be triangulated in linear time with either the algorithm of
A. Fournier and D.Y. Montuno, or the algorithm of
Godfried Toussaint
Godfried Theodore Patrick Toussaint (1944 – July 2019) was a Canadian computer scientist, a professor of computer science, and the head of the Computer Science Program at New York University Abu Dhabi (NYUAD) in Abu Dhabi, United Arab Emirates ...
.
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 (which results in a new polygon that still meets the conditions) 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
Godfried Theodore Patrick Toussaint (1944 – July 2019) was a Canadian computer scientist, a professor of computer science, and the head of the Computer Science Program at New York University Abu Dhabi (NYUAD) in Abu Dhabi, United Arab Emirates ...
.
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
A greedy algorithm is any algorithm that follows the problem-solving heuristic of making the locally optimal choice at each stage. In many problems, a greedy strategy does not produce an optimal solution, but a greedy heuristic can yield locally ...
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
In geometry, a polygon () is a plane figure made up of line segments connected to form a closed polygonal chain.
The segments of a closed polygonal chain are called its '' edges'' or ''sides''. The points where two edges meet are the polygon' ...
.
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
In the mathematics, mathematical discipline of graph theory, the dual graph of a planar graph is a graph that has a vertex (graph theory), vertex for each face (graph theory), face of . The dual graph has an edge (graph theory), edge for each p ...
. Given a triangulation of , one defines the graph as the graph whose vertex set are the triangles of , two vertices (triangles) being adjacent if and only if they share a diagonal. It is easy to observe that is a tree
In botany, a tree is a perennial plant with an elongated stem, or trunk, usually supporting branches and leaves. In some usages, the definition of a tree may be narrower, e.g., including only woody plants with secondary growth, only ...
with maximum degree 3.
Computational complexity
Until 1988, whether a simple polygon
In geometry, a simple polygon is a polygon that does not Intersection (Euclidean geometry), intersect itself and has no holes. That is, it is a Piecewise linear curve, piecewise-linear Jordan curve consisting of finitely many line segments. The ...
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 (in practice, indistinguishable from ]linear time
In theoretical computer science, the time complexity is the computational complexity that describes the amount of computer time it takes to run an algorithm. Time complexity is commonly estimated by counting the number of elementary operations ...
) 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
In theoretical computer science, the time complexity is the computational complexity that describes the amount of computer time it takes to run an algorithm. Time complexity is commonly estimated by counting the number of elementary operations ...
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 (based on this counting algorithm) 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 objects and problems
* Both triangulation problems are a special case of triangulation (geometry)
In geometry, a triangulation is a subdivision of a plane (geometry), planar object into triangles, and by extension the subdivision of a higher-dimension geometric object into simplex, simplices. Triangulations of a three-dimensional volume would ...
and a special case of polygon partition.
* Minimum-weight triangulation is a triangulation in which the goal is to minimize the total edge length.
* A point-set triangulation is a polygon triangulation of the convex hull of a set of points. A Delaunay triangulation
In computational geometry, a Delaunay triangulation or Delone triangulation of a set of points in the plane subdivides their convex hull into triangles whose circumcircles do not contain any of the points; that is, each circumcircle has its gen ...
is another way to create a triangulation based on a set of points.
* The associahedron is a polytope whose vertices correspond to the triangulations of a convex polygon.
* Polygon triangle covering, in which the triangles may overlap.
* Tiling by polygons, where the goal is to cover the entire plane with polygons of pre-specified shapes.
See also
* Nonzero-rule
In two-dimensional computer graphics, the non-zero winding rule is a means of determining whether a given Point (geometry)#Points in Euclidean geometry, point falls within an enclosed curve. Unlike the similar even-odd rule, it relies on knowing t ...
* Catalan number
The Catalan numbers are a sequence of natural numbers that occur in various Enumeration, counting problems, often involving recursion, recursively defined objects. They are named after Eugène Charles Catalan, Eugène Catalan, though they were p ...
* Planar graph
In graph theory, a planar graph is a graph (discrete mathematics), graph that can be graph embedding, embedded in the plane (geometry), plane, i.e., it can be drawn on the plane in such a way that its edges intersect only at their endpoints. ...
* Flip graph
References
External links
Demo as Flash swf
A Sweep Line algorithm.
{{DEFAULTSORT:Polygon Triangulation
Triangulation (geometry)