In computational geometry, a polygonalization of a finite set of points in the Euclidean plane is a simple polygon with the given points as its vertices. A polygonalization may also be called a polygonization, simple polygonalization, Hamiltonian polygon, non-crossing Hamiltonian cycle, or crossing-free straight-edge spanning cycle.
Every point set that does not lie on a single line has at least one polygonalization, which can be found in polynomial time. For points in convex position, there is only one, but for some other point sets there can be exponentially many. Finding an optimal polygonalization under several natural optimization criteria is a hard problem, including as a special case the travelling salesman problem. The complexity of counting all polygonalizations remains unknown.
A polygonalization is a simple polygon having a given set of points in the Euclidean plane as its set of vertices. A polygon may be described by a cyclic order on its vertices, which are connected in consecutive pairs by line segments, the edges of the polygon. A polygon, defined in this way, is "simple" if the only intersection points of these line segments are at shared endpoints.
Some authors only consider polygonalizations for points that are in general position, meaning that no three are on a line. With this assumption, the angle between two consecutive segments of the polygon cannot be 180°. However, when point sets with collinearities are considered, it is generally allowed for their polygonalizations to have 180° angles at some points. When this happens, these points are still considered to be vertices, rather than being interior to edges.
observed that every finite point set with no three in a line forms the vertices of a simple polygon. However, requiring no three to be in a line is unnecessarily strong. Instead, all that is required for the existence of a polygonalization (allowing 180° angles) is that the points do not all lie on one line. If they do not, then they have a polygonalization that can be constructed in polynomial time. One way of constructing a polygonalization is to choose any point
q
P
q
q
O(nlogn)
As well as star-shaped polygonalizations, every non-collinear set of points has a polygonalization that is a monotone polygon. This means that, with respect to some straight line (which may be taken as the
x
x
It is NP-complete to determine whether a set of points has a polygonalization using only axis-parallel edges. However, polygonalizations with the additional constraint that they make a right turn at every vertex, if they exist, are uniquely determined. Each axis-parallel line through a point must pass through an even number of points, and this polygonalization must connect alternating pairs of points on this line. The polygonalization may be found in time
O(nlogn)
Problems of finding an optimal polygonalization (for various criteria of optimality) are often computationally infeasible. For instance, the solution to the travelling salesman problem, for the given points, does not have any crossings. Therefore, it is always a polygonalization, the polygonalization with the minimum perimeter. It is NP-hard to find. Similarly, finding the simple polygonalization with minimum or maximum area is known to be NP-hard, and has been the subject of some computational efforts. The maximum area is always more than half of the area of the convex hull, giving an approximation ratio of 2. The exact complexity of the simple polygonalization with maximum perimeter, and the existence of a constant approximation ratio for this problem, remain unknown. The polygonalization that minimizes the length of its longest edge is also NP-hard to find, and hard to approximate to an approximation ratio better than
\sqrt3
A non-optimal solution to the travelling salesman problem may have crossings, but it is possible to eliminate all crossings by local optimization steps that reduce the total length. Using steps that also eliminate crossings at each step, this can be done in polynomial time, but without this restriction there exist local optimization sequences that instead use an exponential number of steps.
The shortest bitonic tour (the minimum-perimeter monotone polygon through the given points) is always a polygonalization, and can be found in polynomial time.
The problem of counting all polygonalizations of a given point set belongs to
, the class of counting problems associated with decision problems in NP. However, it is unknown whether it is
or, if not, what its computational complexity might be. A set of points has exactly one polygonalization if and only if it is in convex position. There exist sets of
n
4.64n
n
54.6n
Methods applying the planar separator theorem to labeled triangulations of the points can be used to count all polygonalizations of a set of
n
nO(\sqrt
It is unknown whether it is possible for the system of all polygonalizations to form a connected state space under local moves that change a bounded number of the edges of the polygonalizations. If this were possible, it could be used as part of an algorithm for generating all polygonalizations, by applying a graph traversal to the state space. For this problem, it is insufficient to consider flips that remove two edges of a polygonalization and replace them by two other edges, or VE-flips that remove three edges, two of which share a vertex, and replace them by three other edges. There exist polygonalizations for which no flip or VE-flip is possible, even though the same point set has other polygonalizations.
The polygonal wraps, weakly simple polygons that use each given point one or more times as a vertex, include all polygonalizations and are connected by local moves. Another more general class of polygons, the surrounding polygons, are simple polygons that have some of the given points as vertices and enclose all of the points. They are again locally connected, and can be listed in polynomial time per polygon. The algorithm constructs a tree of polygons, with the convex hull as its root and with the parent of each other surrounding polygon obtained by removing one vertex (proven to be possible by applying the two ears theorem to the exterior of the polygon). It then applies a reverse-search algorithm to this tree to list the polygons. As a consequence of this method, all polygonalizations can be listed in exponential time (
2O(n)
n
Classical connect the dots puzzles involve connecting points in sequence to form some unexpected shape, often without crossings. The travelling salesman problem and its variants have many applications. Polygonalization also has applications in the reconstruction of contour lines from scattered data points, and in boundary tracing in image analysis.