Next Article in Journal
Some Inequalities for g-Frames in Hilbert C*-Modules
Next Article in Special Issue
B-Spline Solutions of General Euler-Lagrange Equations
Previous Article in Journal
Some Identities Involving Hermite Kampé de Fériet Polynomials Arising from Differential Equations and Location of Their Zeros
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

NLP Formulation for Polygon Optimization Problems

Department of Mathematics and Computer Science, Amirkabir University of Technology, Tehran 15875-4413, Iran
*
Author to whom correspondence should be addressed.
Mathematics 2019, 7(1), 24; https://doi.org/10.3390/math7010024
Submission received: 11 November 2018 / Revised: 12 December 2018 / Accepted: 19 December 2018 / Published: 27 December 2018
(This article belongs to the Special Issue Discrete and Computational Geometry)

Abstract

:
In this paper, we generalize the problems of finding simple polygons with minimum area, maximum perimeter, and maximum number of vertices, so that they contain a given set of points and their angles are bounded by α + π where α ( 0 α π ) is a parameter. We also consider the maximum angle of each possible simple polygon crossing a given set of points, and derive an upper bound for the minimum of these angles. The correspondence between the problems of finding simple polygons with minimum area and maximum number of vertices is investigated from a theoretical perspective. We formulate these three generalized problems as nonlinear programming models, and then present a genetic algorithm to solve them. Finally, the computed solutions are evaluated on several datasets and the results are compared with those from the optimal approach.

1. Introduction

Polygons are one of the fundamental objects in the field of computational geometry. Simple polygonization is a way to construct all possible simple polygons on a set of points in the plane. Global optimization problems, such as optimal area and perimeter polygonization [1,2], are of major interest to researchers and arise in various application areas, such as image processing [3,4], pattern recognition [3,5,6], geographic information systems (GIS) [7], sensor networks [8,9], and so on.
Minimum- and maximum-perimeter polygonization problems are known as the traveling salesman problem (TSP) and the maximum traveling salesman problem (Max-TSP), respectively, which are NP-complete problems [1,10]. Fekete considered a set of points on the grid and showed that the problems of minimum area polygonization (MAP) and maximum area polygonization (MAXP) on that set of points are NP-complete [2]. Recently, it has been shown that computing an α -concave hull (as a generalization of MAP) is still NP-hard [11].
To the best of our knowledge, little attention has been paid to the constraint on the internal angles of polygons in previous studies [12,13,14]. In this paper, we explore the optimum polygonization such that the internal angles of the polygons are bounded. Here, we define α -MAP, α -MPP, and α -MNP as the problems of computing simple polygons containing a set of points in the plane with minimum area, maximum perimeter, and maximum number of vertex points, respectively, such that all internal angles of the polygons are less than or equal to π + α . We consider α -MAP, α -MPP and α -MNP as generalizations of computing the convex hull, and formulate them as nonlinear programming models.
For a set S of points in the plane and for k 2 , an algorithm for finding k convex polygons that covers S is presented in [15], such that the total area of the convex polygons is minimized. Also, for k = 2 , another algorithm is presented, to minimize the total perimeter of the convex polygons.
There are many NP-complete problems such as TSP [16], packing problems [17], convex shape decomposition [18], and the path planning problem [19] that can be formulated as integer programming problems. In [20], a nonlinear programming model is presented for the problem of cutting circles from rectangles with minimum area. In [21], the rectangular cartogram problem is formulated as a bilinear program. Raimund Seidel constructs convex hulls of n points in R d for d > 3 , using a linear programming algorithm [22].
There have been many studies on approximation and randomized algorithms for MAP [11,23,24], MAXP [23], TSP [25,26], and Max-TSP [27,28]. Here, we apply a genetic algorithm (GA) to solve α -MAP, α -MPP, and α -MNP, and then compare the results with those from the optimal approach. A genetic algorithm is used to solve many problems such as TSP [29,30,31], packing of polygons [32], path planning [33,34], and pattern recognition [35].
χ -shape [36], α -shape [37], concave hull [7], simple-shape [38], RGG [39], and crust [40] are all bounding hulls of a set of points, same as the convex hull. α -shape and concave hull are generalizations of the convex hull to cover a set of points, and can be used in the fields of space decomposition [41], sensor networks [42], bioinformatics [43], feature detection [44], GIS [45], dataset classification [46], shape reconstruction [47,48], and so on. We implement the concave hull algorithm [49], and then use the computed results to compare against those obtained from the GA.
The rest of the paper is as follows: In Section 2, we present some notation and definitions which are required throughout the paper. In Section 3, we first formulate the required functions and then introduce nonlinear programming models for α -MAP, α -MPP, and α -MNP. In Section 4, our theoretical results are discussed. For a set S of points, an upper bound for θ is obtained, such that θ is the minimum of maximum angles of each simple polygon containing S. Also, the similarity of the two problems α -MAP and α -MNP is investigated on the grid points. Section 5 is devoted to a full evaluation of our experimental results obtained by implementing the GA and the brute-force algorithm. Section 6 concludes the paper, highlighting its main contribution.

2. Preliminaries

Let S = { s 1 , s 2 , , s n } be a set of points in the plane, and C H be the convex hull of S. The vertices and edges of C H are denoted by V C H = { c 1 , c 2 , , c m } and E C H = { e 1 , e 2 , , e m } , respectively. Furthermore, let I P = { a 1 , a 2 , , a r } be the inner points of C H , such that r = n m . A polygon P containing S is specified by a closed chain of vertices P = ( p 1 , p 2 , , p l , p 1 ) . Table 1 shows more notation that is used in the rest of the paper. The simple polygon P contains S iff V P S and i { 1 , 2 , , n } , s i P . Moreover, P crosses a point x iff x V P .
MAP is the problem of computing the simple polygon M ( S ) , such that P ( S ) , A r e a ( M ) A r e a ( P ) ; MPP is the problem of computing the simple polygon E ( S ) , such that P ( S ) , P e r i m e t e r ( E ) P e r i m e t e r ( P ) ; and MNP is the problem of computing the simple polygon C ( S ) , such that P ( S ) , B o u n d a r y ( C ) B o u n d a r y ( P ) . The following definitions introduce the problems of computing α -MAP, α -MPP, and α -MNP.
Definition 1.
For 0 α π , a simple polygon P ( S ) is an α-polygon if all internal angles of P are less than or equal to π + α [11].
Definition 2.
α-MAP, α-MPP and α-MNP are the problems of computing the α-polygon containing S with minimum area, maximum perimeter and maximum number of vertices, respectively.
In the case of α = π , the α -polygon, α -MAP, α -MPP, and α -MNP will be converted into the simple polygon, MAP, MPP, and MNP, respectively. Also, in the case of α = 0 , the α -polygon will be converted into the convex polygon, and all of the α -MAP, α -MPP, and α -MNP will be converted into CHP. We formulate these as binary nonlinear programming models:
Definition 3.
Let { c 1 , c 2 , , c m } be the vertices of C H , e j = c j c j + 1 ¯ be the jth edge of C H and P be a simple polygon containing S. The points { b 1 , j , b 2 , j , , b t , j } S are assigned to the edge e j if ( c j , b 1 , j , b 2 , j , , b t , j , c j + 1 ) is a chain in P.
Figure 1 shows that the polygon P assigns the points { b 1 , 1 , b 2 , 1 , b 3 , 1 } to the edge e 1 , the point { b 1 , 2 } to the edge e 2 , and so on. The inner points of P are unassigned. We assume that c j is assigned to e j .

3. Modeling

In this section we present nonlinear programming models for α -MAP, α -MPP, and α -MNP. We first introduce the indices, input data, and variables that are used in our models, and then formulate the required functions.

3.1. Indices

The following indices are utilized to formulate the problems α -MAP, α -MPP, and α -MNP as binary nonlinear programming models:
  • i { 1 , 2 , , n } is an index counting the points of S. The point s n + 1 is identified by s 1 , and the point s n + 2 is identified by s 2 .
  • j { 1 , 2 , , m } is an index counting the edges in E C H and the vertices in V C H . The edge e m + 1 is identified by e 1 , and the vertex c m + 1 is identified by c 1 .
  • k { 0 , 1 , , r } specifies the order of assigned points for an edge of convex hull. b k , j is the kth point which is assigned to e j . Assume that c i is assigned to e i at the position 0.

3.2. Input Data

The input data is as follows:
  • n is the number of points in S.
  • ( x i , y i ) R 2 is the coordinate of the point s i .
  • α [ 0 , π ] is the constraint for angles.

3.3. Assumptions

  • x ( j ) is the x-coordinate of c j .
  • y ( j ) is the y-coordinate of c j .

3.4. Variables

In this model, we have n × m × r variables, denoted by z, which is defined as follows: Z i , j , k is a binary variable such that Z i , j , k = 1 iff the point s i is assigned to e j at the position of k. In Figure 1, Assume that b 3 , 1 is the tenth point of S. Since b 3 , 1 is assigned to e 1 at the position of 3, we have Z 10 , 1 , 3 = 1 .

3.5. Functions

The functions used in this model are listed below.
  • A r e a ( P ) is the area of the polygon P.
  • P e r i m e t e r ( P ) is the perimeter of the polygon P.
  • B o u n d a r y ( P ) is the number of vertices of the polygon P.
  • X ( a ) is the x-coordinate of the point a in the plane.
  • Y ( a ) is the y-coordinate of the point a in the plane.
  • X ( j , k ) is the x-coordinate of the kth points that is assigned to e j .
    X ( j , k ) = Σ i = 1 n Z i , j , k · x i
  • Y ( j , k ) is the y-coordinate of the kth points that is assigned to e j .
    Y ( j , k ) = Σ i = 1 n Z i , j , k · y i
  • A d j u s t ( i 1 , i 2 ) : if e E P such that s i 1 and s i 2 are endpoints of e, then A d j u s t ( i 1 , i 2 ) = 1 , otherwise, A d j u s t ( i 1 , i 2 ) = 0 .
  • C o n f l i c t ( i 1 , i 2 , i 3 , i 4 ) : if two edges s i 1 s i 2 ¯ and s i 3 s i 4 ¯ cross each other, then C o n f l i c t ( i 1 , i 2 , i 3 , i 4 ) = 1 , otherwise, C o n f l i c t ( i 1 , i 2 , i 3 , i 4 ) = 0 .
  • A n g l e ( i 1 , i 2 , i 3 ) is the clockwise angle between s i 1 s i 2 ¯ and s i 2 s i 3 ¯ .
Figure 2 is an example of a polygon P containing the set S = { s 1 , s 2 , , s 19 } . In this example, the points { s 5 , s 6 , s 10 } are assigned to e 1 . Hence, we have Z 5 , 1 , 1 = Z 6 , 1 , 2 = Z 10 , 1 , 3 = 1 . Also, since s 1 is assigned to e 1 at the position 0, Z 1 , 1 , 0 = 1 . In the same way, for the other edges of C H , we have: Z 11 , 2 , 0 = Z 15 , 2 , 1 = 1 , Z 19 , 3 , 0 = 1 , Z 18 , 4 , 0 = Z 17 , 4 , 1 = Z 16 , 4 , 2 = Z 13 , 4 , 3 = 1 , Z 12 , 5 , 0 = Z 7 , 5 , 1 = 1 , Z 2 , 6 , 0 = Z 3 , 6 , 1 = Z 4 , 6 , 2 = 1 . In Figure 2, to compute X ( j , k ) for j = 4 and k = 2 we have:
X ( 4 , 2 ) = Σ i = 1 19 Z i , 4 , 2 · x i = 0 + + 0 + x 16 + 0 + 0 + 0 = x 16 .

3.6. Models

Here, we present the nonlinear programming formulations for α -MAP, α -MPP, and α -MNP. We first formulate the functions A d j u s t , C o n f l i c t and A n g l e as follows: The A d j u s t function is used to determine if two points are adjacent to each other in the polygon, the C o n f l i c t function is used to check if the polygon is simple and the A n g l e function is used to compute the angle between two edges to verify the angular constraint.
Adjust function
The Adjust function is computed as follows:
A d j u s t ( i 1 , i 2 ) = 1 k { 0 , , r 1 } , j { 1 , , m } Z i 1 , j , k = Z i 2 , j , k + 1 = 1 1 k { 0 , , r 1 } , j { 1 , , m } Z i 2 , j , k = Z i 1 , j , k + 1 = 1 1 k { 1 , , r } , j { 1 , , m } Z i 1 , j , k = Z i 2 , j + 1 , 0 = 1 , i { 1 , , n } Z i , j , k + 1 = 0 1 k { 1 , , r } , j { 1 , , m } Z i 2 , j , k = Z i 1 , j + 1 , 0 = 1 , i { 1 , , n } Z i , j , k + 1 = 0 0 otherwise
As seen in Figure 2, s 6 is adjusted to s 10 . Since Z 6 , 1 , 2 = Z 10 , 1 , 3 = 1 , we have A d j u s t ( 6 , 10 ) = 1 . Also, since Z 10 , 1 , 3 = Z 11 , 2 , 0 = 1 and i { 1 , , n } Z i , 1 , 4 = 0 , we have A d j u s t ( 10 , 11 ) = 1 .
Conflict function
To compute the conflict function, consider the following expression:
E i 1 , i 2 = ( X ( s i 2 ) X ( s i 1 ) , Y ( s i 2 ) Y ( s i 1 ) ) R i 1 , i 2 = ( Y ( E i 1 , i 2 ) , X ( E i 1 , i 2 ) ) h ( i 1 , i 2 , i 3 , i 4 ) = ( E i 3 , i 1 . R i 1 , i 2 ) / ( E i 3 , i 4 . R i 1 , i 2 ) = ( X ( E i 3 , i 1 ) · X ( R i 1 , i 2 ) + Y ( E i 3 , i 1 ) · Y ( R i 1 , i 2 ) ) ( X ( E i 3 , i 4 ) · X ( R i 1 , i 2 ) + Y ( E i 3 , i 4 ) · Y ( R i 1 , i 2 ) ) .
So, the function C o n f l i c t ( i 1 , i 2 , i 3 , i 4 ) is computed as follows:
C o n f l i c t ( i 1 , i 2 , i 3 , i 4 ) = 0 h ( i 1 , i 2 , i 3 , i 4 ) 1 a n d 1 A d j u s t ( i 1 , i 2 ) = A d j u s t ( i 3 , i 4 ) = 1 a n d A d j u s t ( i 1 , i 3 ) = A d j u s t ( i 2 , i 4 ) = 0 0 otherwise
Based on the mentioned notation, P is simple if i 1 , i 2 , i 3 , i 4 { 1 , 2 , , n } , such that i 1 i 2 i 3 i 4 , A d j u s t ( i 1 , i 2 ) = A d j u s t ( i 3 , i 4 ) = 1 , and A d j u s t ( i 1 , i 3 ) = A d j u s t ( i 2 , i 4 ) = 0 , we have C o n f l i c t ( i 1 , i 2 , i 3 , i 4 ) = 0 .
Angle function
The polygon P is an α -polygon iff i 1 , i 2 , i 3 { 1 , 2 , , n } such that i 1 i 2 i 3 , A d j u s t ( i 1 , i 2 ) = A d j u s t ( i 2 , i 3 ) = 1 and A d j u s t ( i 1 , i 3 ) = 0 , we have A n g l e ( i 1 , i 2 , i 3 ) π + α . The angle between two line segments A and B can be computed as follows:
θ = arccos A . B ( | A | · | B | ) .
Based on the mentioned notation, let
A i 1 , i 2 = ( X ( s i 2 ) X ( s i 1 ) , Y ( s i 2 ) Y ( s i 1 ) ) , B i 2 , i 3 = ( X ( s i 3 ) X ( s i 2 ) , Y ( s i 3 ) Y ( s i 2 ) ) .
If A d j u s t ( i 1 , i 2 ) = A d j u s t ( i 2 , i 3 ) = 1 and A d j u s t ( i 1 , i 3 ) = 0 , A n g l e ( i 1 , i 2 , i 3 ) is computed as follows, otherwise A n g l e ( i 1 , i 2 , i 3 ) = 0 .
A n g l e ( i 1 , i 2 , i 3 ) = arccos X ( A i 1 , i 2 ) · X ( B i 2 , i 3 ) + Y ( A i 1 , i 2 ) · Y ( B i 2 , i 3 ) X ( A i 1 , i 2 ) 2 + Y ( A i 1 , i 2 ) 2 · X ( B i 2 , i 3 ) 2 + Y ( B i 2 , i 3 ) 2 .

3.6.1. Modeling α -MAP

α -MAP is the problem of computing the α -polygon with the minimum area on a set of points. Since ( S ) is the set of all simple polygons containing S, α -MAP can be formulated as follows:
min P ( S ) A r e a ( P ) such that All internal angles of P are less than or equal to π + α
As seen in Figure 1, each polygon P ( S ) assigns the points of S to the edges of C H . Therefore, each simple polygon containing S is equivalent to an assignments of the points of S to the edges of C H , and each assignment is determined by an evaluation of Z i , j , k for all i , j , k . In the following, the area function is formulated as an objective function of the model.
Theorem 1.
Let P ( S ) be a simple polygon and Z be the corresponding assignment for P. The area of P is computed as follows:
A r e a ( P ) = Σ j = 1 m Σ k = 1 r [ [ Σ i = 1 n Z i , j , k · x i + ( Σ i = 1 n Z i , j , k 1 ) · ( 1 Σ i = 1 n Z i , j , k ) ) · x ( j + 1 ) + Σ i = 1 n Z i , j , k 1 · x i ] × [ Σ i = 1 n Z i , j , k · y i + ( Σ i = 1 n Z i , j , k 1 ) · ( 1 Σ i = 1 n Z i , j , k ) ) · y ( j + 1 ) Σ i = 1 n Z i , j , k 1 · y i ] ] .
Proof. 
Based on the Shoelace formula (also known as the surveyor’s formula [50]), the area of a polygon P = ( p 1 , p 2 , , p l , p 1 ) is:
A r e a ( P ) = Σ i = 1 l ( X ( p i + 1 ) + X ( p i ) ) · ( Y ( p i + 1 ) Y ( p i ) ) .
As an example, assume that P is the polygon of Figure 2. So, p 1 = s 1 , p 2 = s 5 , p 3 = s 6 , p 4 = s 10 , and p 5 = s 11 . Let T i = ( X ( p i + 1 ) + X ( p i ) ) · ( Y ( p i + 1 ) Y ( p i ) ) , thus we have:
T 1 = ( X ( p 2 ) + X ( p 1 ) ) · ( Y ( p 2 ) Y ( p 1 ) ) = ( X ( s 5 ) + X ( s 1 ) ) · ( Y ( s 5 ) Y ( s 1 ) ) .
Since the points s 5 and s 1 are assigned to e 1 at positions 1 and 0, respectively, we have:
T 1 = ( X ( 1 , 1 ) + X ( 1 , 0 ) ) · ( Y ( 1 , 1 ) Y ( 1 , 0 ) ) .
In the same way,
T 2 = ( X ( p 3 ) + X ( p 2 ) ) · ( Y ( p 3 ) Y ( p 2 ) ) = ( X ( 1 , 2 ) + X ( 1 , 1 ) ) · ( Y ( 1 , 2 ) Y ( 1 , 1 ) ) , T 3 = ( X ( p 4 ) + X ( p 3 ) ) · ( Y ( p 4 ) Y ( p 3 ) ) = ( X ( 1 , 3 ) + X ( 1 , 2 ) ) · ( Y ( 1 , 3 ) Y ( 1 , 2 ) ) , T 4 = ( X ( p 5 ) + X ( p 4 ) ) · ( Y ( p 5 ) Y ( p 4 ) ) = ( X ( 2 , 0 ) + X ( 1 , 3 ) ) · ( Y ( 2 , 0 ) Y ( 1 , 3 ) ) .
Based on the above equations, we employ the below formula for T 1 , T 2 , and T 3 so that:
T k = ( X ( 1 , k ) + X ( 1 , k 1 ) ) · ( Y ( 1 , k ) Y ( 1 , k 1 ) ) .
Equation (15) cannot be used for T 4 :
( X ( 1 , 4 ) + X ( 1 , 3 ) ) · ( Y ( 1 , 4 ) Y ( 1 , 3 ) ) ( X ( 2 , 0 ) + X ( 1 , 3 ) ) · ( Y ( 2 , 0 ) Y ( 1 , 3 ) ) .
In other words, Equation (15) can be used while the points are assigned to the same edge. In Equation (14), for T 4 , the point p 5 = s 11 is assigned to e 2 while the point p 4 is assigned to e 1 . Based on Equation (1), since i { 1 , 2 , , n } , Z i , 1 , 4 = 0 X ( 1 , 4 ) = Σ i = 1 n Z i , 1 , 4 = 0 ( 1 Σ i = 1 n Z i , 1 , 4 ) · x ( 2 ) = x ( 2 ) ( 1 Σ i = 1 n Z i , 1 , 4 ) · x ( 2 ) = X ( p 5 ) . Hence, ( 1 Σ i = 1 n Z i , 1 , 4 ) · x ( 2 ) can be used to compute X ( p 5 ) .
T k = ( X ( 1 , k ) + ( 1 Σ i = 1 n Z i , 1 , k ) · x ( 2 ) + X ( 1 , k 1 ) ) × ( Y ( 1 , k ) + ( 1 Σ i = 1 n Z i , 1 , k ) · y ( 2 ) Y ( 1 , k 1 ) ) .
Based on Equation (16):
T 4 = ( X ( 1 , 4 ) + ( 1 Σ i = 1 n Z i , 1 , 4 ) · x ( 2 ) + X ( 1 , 3 ) ) × ( Y ( 1 , 4 ) + ( 1 Σ i = 1 n Z i , 1 , 4 ) · y ( 2 ) Y ( 1 , 3 ) ) , T 4 = ( 0 + ( 1 0 ) x ( 2 ) + X ( 1 , 3 ) ) · ( 0 + ( 1 0 ) y ( 2 ) Y ( 1 , 3 ) ) , T 4 = ( X ( 2 , 0 ) + X ( 1 , 3 ) ) · ( Y ( 2 , 0 ) Y ( 1 , 3 ) ) .
Since, based on Equation (1), X(1,k) is equal to 0 for all k 4 , we have:
T 5 = ( 0 + ( 1 0 ) x ( 2 ) + X ( 1 , 4 ) ) · ( 0 + ( 1 0 ) y ( 2 ) Y ( 1 , 4 ) ) , T 5 = ( 0 + X ( 2 , 0 ) + 0 ) · ( 0 + Y ( 2 , 0 ) 0 ) .
Hence, in order to avoid extra summation, we employ the following equation:
T k = [ X ( 1 , k ) + ( Σ i = 1 n Z i , 1 , k 1 ) · ( 1 Σ i = 1 n Z i , 1 , k ) · x ( 2 ) + X ( 1 , k 1 ) ] × [ Y ( 1 , k ) + ( Σ i = 1 n Z i , 1 , k 1 ) · ( 1 Σ i = 1 n Z i , 1 , k ) · y ( 2 ) Y ( 1 , k 1 ) ] .
From Equation (19), for all k 5 we have:
T k = ( 0 + ( 0 ) · ( 1 0 ) · x ( 2 ) + 0 ) × ( 0 + ( 0 ) · ( 1 0 ) · y ( 2 ) 0 ) = 0 .
Considering the points that are assigned to e j , Equation (19) can be extended as follows:
T j , k = [ X ( j , k ) + ( Σ i = 1 n Z i , j , k 1 ) · ( 1 Σ i = 1 n Z i , j , k ) · x ( j + 1 ) + X ( j , k 1 ) ] × [ Y ( j , k ) + ( Σ i = 1 n Z i , j , k 1 ) · ( 1 Σ i = 1 n Z i , j , k ) · y ( j + 1 ) Y ( j , k 1 ) ] .
Based on Equation (11), the area of the polygon P is computed as follows:
A r e a ( P ) = Σ j = 1 m Σ k = 1 r T j , k = Σ j = 1 m Σ k = 1 r [ [ X ( j , k ) + ( Σ i = 1 n Z i , j , k 1 ) · ( 1 Σ i = 1 n Z i , j , k ) · x ( j + 1 ) + X ( j , k 1 ) ] × [ Y ( j , k ) + ( Σ i = 1 n Z i , j , k 1 ) · ( 1 Σ i = 1 n Z i , j , k ) · y ( j + 1 ) Y ( j , k 1 ) ] ] .
From Equations (1), (2) and (22), we have:
A r e a ( P ) = Σ j = 1 m Σ k = 1 r [ [ Σ i = 1 n Z i , j , k · x i + ( Σ i = 1 n Z i , j , k 1 ) · ( 1 Σ i = 1 n Z i , j , k ) · x ( j + 1 ) + Σ i = 1 n Z i , j , k 1 · x i ] × [ Σ i = 1 n Z i , j , k · y i + ( Σ i = 1 n Z i , j , k 1 ) · ( 1 Σ i = 1 n Z i , j , k ) · y ( j + 1 ) Σ i = 1 n Z i , j , k 1 · y i ] ] .
 □
Based on Theorem 1, Equation (9) is formulated as follows:
min Σ j = 1 m Σ k = 1 r [ [ Σ i = 1 n Z i , j , k · x i + ( Σ i = 1 n Z i , j , k 1 ) · ( 1 Σ i = 1 n Z i , j , k ) · x ( j + 1 ) + Σ i = 1 n Z i , j , k 1 · x i ] × [ Σ i = 1 n Z i , j , k · y i + ( Σ i = 1 n Z i , j , k 1 ) · ( 1 Σ i = 1 n Z i , j , k ) · y ( j + 1 ) Σ i = 1 n Z i , j , k 1 · y i ] ] such that Z i , j , k { 0 , 1 } i { 1 , , n } , j { 1 , , m } , k { 1 , , r } , ( a ) Σ j = 1 m Σ k = 1 r Z i , j , k 1 i { 1 , 2 , , n } , ( b ) c o n f l i c t ( i 1 , i 2 , i 3 , i 4 ) = 0 i 1 , i 2 , i 3 , i 4 { 1 , 2 , , n } i 1 i 2 i 3 i 4 , ( c ) a n g l e ( i 1 , i 2 , i 3 ) π + α i 1 , i 2 , i 3 { 1 , 2 , , n } i 1 i 2 i 3 . ( d )
In Equation (24), constraint (a) considers all assignments of the points while constraint (b) prevents assigning a point to more than one edge. The point s i is unassigned if Σ j = 1 m Σ k = 1 r Z i , j , k = 0 , and assigned to one edge if Σ j = 1 m Σ k = 1 r Z i , j , k = 1 . Also, constraint (b) prevents assigning a point to more than one position on an edge. In addition, constraint (c) guarantees that the constructed polygon is simple, while constraint (d) ensures that it is an α -polygon.
When α = 0 , the solution of Equation (24) is an assignment that constructs the convex hull of the points, and when α = π the solution of Equation (24) is an assignment that constructs M as the solution of MAP on the points. There is an algorithm to compute C H in O ( n log n ) time [51], while MAP is NP-complete.
Figure 3 illustrates the solution of α -MAP on a set of points for different values of α .

3.6.2. Modeling α -MPP

α -MPP is the problem of computing the α -polygon with the maximum perimeter on a set of points. Since ( S ) is the set of all simple polygons containing S, α -MPP is computed as follows:
max P ( S ) P e r i m e t e r ( P ) such that All internal angles of P are less than or equal to π + α
Let P = ( p 1 , p 2 , , p l , p 1 ) be a polygon containing S. The perimeter of P is the total length of its edges:
P e r i m e t e r ( P ) = Σ i = 1 l ( X ( p i + 1 ) X ( p i ) ) 2 + ( Y ( p i + 1 ) Y ( p i ) ) 2 .
By using Z as the corresponding assignment for P, similar to Theorem 1, the perimeter of P is computed as follows:
P e r i m e t e r ( P ) = Σ j = 1 m Σ k = 1 r ( X ( j , k ) + ( Σ i = 1 n Z i , j , k 1 ) · ( 1 Σ i = 1 n Z i , j , k ) · x ( j + 1 ) X ( j , k 1 ) ) 2 + ( Y ( j , k ) + ( Σ i = 1 n Z i , j , k 1 ) · ( 1 Σ i = 1 n Z i , j , k ) · y ( j + 1 ) Y ( j , k 1 ) ) 2
Based on Equations (25) and (27), we have the following formula for α -MPP:
max Σ j = 1 m Σ k = 1 r ( X ( j , k ) + ( Σ i = 1 n Z i , j , k 1 ) · ( 1 Σ i = 1 n Z i , j , k ) · x ( j + 1 ) X ( j , k 1 ) ) 2 + ( Y ( j , k ) + ( Σ i = 1 n Z i , j , k 1 ) · ( 1 Σ i = 1 n Z i , j , k ) · y ( j + 1 ) Y ( j , k 1 ) ) 2 such that Z i , j , k { 0 , 1 } i { 1 , , n } , j { 1 , , m } , k { 1 , , r } , ( a ) Σ j = 1 m Σ k = 1 r Z i , j , k 1 i { 1 , 2 , , n } , ( b ) c o n f l i c t ( i 1 , i 2 , i 3 , i 4 ) = 0 i 1 , i 2 , i 3 , i 4 { 1 , 2 , , n } i 1 i 2 i 3 i 4 , ( c ) a n g l e ( i 1 , i 2 , i 3 ) π + α i 1 , i 2 , i 3 { 1 , 2 , , n } i 1 i 2 i 3 . ( d )
When α = 0 , the solution of Equation (28) is an assignment that constructs the convex hull of the points, and when α = π it is an assignment that constructs E as the solution of MPP, which is known as Max-TSP, on the points. There is an algorithm to compute C H in O ( n log n ) time, while Max-TSP is a well-known NP-complete problem.
Figure 4 illustrates the solution of α -MPP on a set of points for different values of α .

3.6.3. Modeling α -MNP

α -MNP on a set of points is the problem of computing the α -polygon with the maximum number of vertices. Since ( S ) is the set of all simple polygons containing S, α -MNP is computed as follows:
max P ( S ) B o u n d a r y ( P ) such that All internal angles of P are less than or equal to π + α
As stated before, Z i , j , k is equal to 1 iff the point s i is assigned to the edge e j at the position k. Hence, the following equation specifies the number of vertex points for the constructed polygon P:
B o u n d a r y ( P ) = Σ i = 1 n Σ j = 1 m Σ k = 0 r Z i , j , k .
Similar to α -MAP and α -MPP, α -MNP is formulated as follows:
max Σ i = 1 n Σ j = 1 m Σ k = 0 r Z i , j , k such that Z i , j , k { 0 , 1 } i { 1 , , n } , j { 1 , , m } , k { 1 , , r } , ( a ) Σ j = 1 m Σ k = 1 r Z i , j , k 1 i { 1 , 2 , , n } , ( b ) c o n f l i c t ( i 1 , i 2 , i 3 , i 4 ) = 0 i 1 , i 2 , i 3 , i 4 { 1 , 2 , , n } i 1 i 2 i 3 i 4 , ( c ) a n g l e ( i 1 , i 2 , i 3 ) π + α i 1 , i 2 , i 3 { 1 , 2 , , n } i 1 i 2 i 3 . ( d )
When α = 0 , the solution of Equation (31) is an assignment that constructs the convex hull of the points, and when α = π the solution of Equation (31) is an assignment that constructs C as the solution of MNP on the points. C is a simple polygon that crosses all points. There are optimal algorithms to compute C H and C in O ( n log n ) time.
Figure 5 illustrates the solution of α -MNP on a set of points, for different values of α .

4. Theoretical Results

In this section, we present our theoretical results. As stated before, α -MNP will be converted into CHP and SPP when α = 0 and α = π , respectively, which are solvable in polynomial time. When α = π , the constructed polygon crosses all points. For each set S of points, the smallest value of α such that α -MNP crosses S is computed in the next subsection.

4.1. Upper Bound for α in α -MNP

For each polygon P ( S ) , assume that γ P is the maximum angle of the polygon P. Let θ be the minimum value of γ P over all P ( S ) that crosses S. For all α θ π , there always exists an α -polygon that crosses S. In other words, the polygon P such that γ P = θ , satisfies α -MNP for all α θ π . Here, we present an upper bound for θ , on any set of points.
In Theorem 2, it is shown that 2 π 2 π 2 r 1 m can be interpreted as an upper bound for θ , and in Theorem 3 this bound is improved. In the following, we design an algorithm to construct a simple polygon containing S which satisfies these bounds. Let us first define the concept of a “sweep arc”, and then prove some lemmas.
Definition 4.
Let e = A B ¯ be an edge of polygon P. A sweep arc on the edge e is a minor arc A B where A B = 0 and expands to the major arc A B where A B = π . The direction of expansion is to the inside of the polygon. Figure 6 depicts the sweep arc on the edge e.
Let e j be an edge of the polygon P. We denote the major segment with length of β that corresponds to e j by M j β .
Lemma 1.
Let x be a point inside the convex polygon P, E = { e 1 , e 2 , , e m } be the edges of P and β = 2 π 4 π m . Then j { 1 , 2 , , m } , such that x M j β .
Proof. 
Let β j be the angle subtended by e j at the point x and β M be the maximum angle. Let e be the edge that corresponds to β M . Since Σ j = 1 m β j = 2 π , we have β M 2 π m and the corresponding arc of β M is more than 4 π m . Hence, the measure of the sweep arc on the edge e at x is less than 2 π 4 π m , (see Figure 7). □
Lemma 2.
Let P be a convex polygon, { e 1 , e 2 , , e m } be the edges of P and β m a x = 2 π 4 π m . The entirety of P is covered by all major segments with length of β m a x that correspond to the edges of P, i.e., P j = 1 m M j β m a x (see Figure 8).
Proof. 
To prove the lemma by reductio ad absurdum, suppose that there exists a point x inside the polygon P and outside of all the major segments. Since the measures of all major segments are equal to 2 π 4 π m , there is no edge e such that the sweep arc on e touches x at the measure β 2 π 4 π m , i.e., j { 1 , 2 , , m } , x M j β m a x . This contradicts Lemma 1. □
Remark 1.
Suppose that the convex hull of S has n 1 edges; that is, one point is inside the convex hull. Based on Lemma 2, 2 π 2 π n 1 is an upper bound for θ over all simple polygons containing S. It is noteworthy that this bound is tight. The tightness is achieved when the inner point is at the center of a regular n-gons, as illustrated in Figure 9.
In the following, we generalize the upper bound for any set S of points, and then present an algorithm to generate a polygon containing S that satisfies the generalized upper bound. However, let us first consider a sweep arc on an edge to measure β m a x that includes a set of n points.
Lemma 3.
Let e = c 1 c 2 ¯ be a line segment and S be a set of n points inside the major segment corresponding to e, such that the measure of major arc is β m a x = 2 π 4 π m for an integer number m (see Figure 10a). There exists a chain ( s 1 , s 2 , , s n ) on S such that all internal angles of s i ^ in the polygon ( c 1 , s 1 , s 2 , , s n , c 2 , c 1 ) are greater than or equal to 2 π 2 n 1 · m (see Figure 10b).
Proof. 
Here, we employ the sweep arc algorithm to construct the polygon.
Algorithm 1 (Sweep Arc Algorithm)
Let us sweep the arc from measure 0 to β m a x on e = c 1 c 2 ¯ . By so doing, the polygon is constructed, while the arc hits the points. In the following, we show how to construct the polygon step by step.
On the first hit:
Let x 1 be the first point that the sweeping arc meets. We construct the polygon by connecting x 1 to c 1 and c 2 . Since the maximum measure of the arc is β m a x , the internal angle of x 1 ^ in the triangle ( c 1 x 1 c 2 ) is greater than or equal to 2 π m (see Figure 11).
On the second hit:
Let x 1 be the first point that the sweeping arc meets and x 2 be the second one. Also, let e 1 = c 1 x 1 ¯ and e 2 = c 2 x 1 ¯ be two constructed edges in the previous step. The edges e 1 and e 2 divide the sweeping arc into 3 parts; the arc B 1 where e 1 is visible but e 2 is not visible from all the points on it; the arc B 2 where e 2 is visible but e 1 is not visible from all the points on it; and finally the arc B 3 where e 1 and e 2 are visible from all points on it (see Figure 12).
Case 1.
If x 2 is placed on B 1 : The angle c 1 x 2 x 1 ^ is greater than c 1 x 2 c 2 ^ , and the angle c 1 x 2 c 2 ^ is greater than or equal to 2 π m . Hence, the angle c 1 x 2 x 1 ^ is greater than 2 π m . Since the internal angles x 2 ^ and x 1 ^ are greater than 2 π 2 m , we consider the polygon ( c 1 x 2 x 1 c 2 c 1 ) as the constructed polygon.
Case 2.
If x 2 is placed on B 2 : Based on the same reason mentioned above, the angle c 2 x 2 x 1 ^ is greater than 2 π m . Since the internal angles x 2 ^ and x 1 ^ are greater than 2 π m , we consider the polygon ( c 1 x 1 x 2 c 2 c 1 ) as the constructed polygon.
Case 3.
If x 2 is placed on B 3 : In contrast to the previous cases, the angles c 1 x 2 x 1 ^ and c 2 x 2 x 1 ^ are less than c 1 x 2 c 2 ^ , but the maximum of c 1 x 2 x 1 ^ and c 2 x 2 x 1 ^ is greater than c 1 x 2 c 2 ^ 2 . Since c 1 x 2 c 2 ^ is greater than 2 π m , the maximum of c 1 x 2 x 1 ^ and c 2 x 2 x 1 ^ is greater than 2 π 2 m . Hence, if c 1 x 2 x 1 ^ > c 2 x 2 x 1 ^ , the constructed polygon is ( c 1 x 2 x 1 c 2 c 1 ) ; otherwise, it is ( c 1 x 1 x 2 c 2 c 1 ) .
In other words, the angular bisector of c 1 x 1 c 2 ^ divides the sweeping arc into 2 parts, A 1 and A 2 (see Figure 13). Any point x 2 on A 1 constructs the angle c 1 x 2 x 1 ^ greater than 2 π 2 m , and on A 2 constructs the angle x 1 x 2 c 2 ^ greater than 2 π 2 m . Hence, in the case where point x 2 is placed on A 1 , we consider the polygon ( c 1 x 2 x 1 c 2 c 1 ) as the constructed polygon and, if placed on A 2 , we consider the polygon ( c 1 x 1 x 2 c 2 c 1 ) as the constructed polygon.
On the third hit:
Without loss of generality, assume that ( c 1 x 2 x 1 c 2 c 1 ) is the polygon obtained at the end of the previous step. The angular bisector of c 1 x 2 x 1 ^ divides A 1 into 2 parts A 11 and A 12 . Hence, the sweeping arc is divided into 3 parts A 2 , A 11 and A 12 (see Figure 14).
Based on the previous step, any point x 3 on A 2 leads to the construction of the angle x 1 x 3 c 2 ^ which is greater than 2 π 2 m . Similarly, any point x 3 on A 11 and A 12 leads to the construction of the angles c 1 x 3 x 2 ^ and x 2 x 3 x 1 ^ , respectively, which are greater than c 1 x 3 x 1 ^ 2 . Since any angle c 1 x 3 x 1 ^ on A 1 is greater than 2 π 2 m , either the angle c 1 x 3 x 2 ^ or x 2 x 3 x 1 ^ is greater than 2 π 4 m .
Let x 3 be the third point that the sweeping arc meets. If x 3 is placed on A 2 , or on A 11 or on A 12 , we consider ( c 1 x 2 x 1 x 3 c 2 c 1 ) or ( c 1 x 3 x 2 x 1 c 2 c 1 ) or ( c 1 x 2 x 3 x 1 c 2 c 1 ) as the constructed polygon, respectively (see Figure 15).
Generalization:
Assume that ( c 1 x 1 x 2 x n 1 c 2 c 1 ) is the obtained polygon at the end of the previous step. Let x n be the next point touched by the sweeping arc which is divided into n parts A 1 , A 2 , , A n . Considering the worst case, x n is placed on A i or on A i + 1 such that the angular bisector of x i ^ divides the corresponding part into A i and A i + 1 . Any point x n on A i , or on A i + 1 , leads to the construction of the angle x n ^ which is greater than x i ^ 2 . Based on the previous step and considering the worst case, the angle x i ^ is greater than 2 π 2 n 2 m . Hence, the angle x n ^ is greater than 2 π 2 n 1 m . If x n is placed on A 1 , or on A 2 , ... or on A n , we consider the polygon ( c 1 x n x 1 x n 1 c 2 c 1 ) , or ( c 1 x 1 x n x 2 x n 1 c 2 c 1 ) , ... or ( c 1 x 1 x n 1 x n c 2 c 1 ) as the constructed polygon, respectively. □
We refer to the polygon constructed by Algorithm 1 as a polygon corresponding to the line segment e. In the following, based on the Lemma 3, we present an algorithm to generate a polygon containing a given set of points, such that all internal angles are less than 2 π 2 π 2 r 1 m .
Theorem 2.
There exists a polygon P ( S ) that crosses S, in which all internal angles of P are less than 2 π 2 π 2 r 1 m .
Proof. 
Here, by presenting Algorithm 2, we construct the polygon.
Algorithm 2
  • Compute C H as the convex hull of S, and let I P be the set of inner points of C H .
  • For each edge e j of C H :
    (a)
    Compute the polygon P j corresponding to the edge e j using Algorithm 1 to meet the points of I P .
    (b)
    Remove the vertices of P j from I P .
  • For all j { 1 , 2 , , m } , the edges of P j minus all edges of C H (except those that have no corresponding polygon), construct the desired polygon.
Based on Lemma 2, the entire C H is covered by all major segments that correspond to the edges of C H with length of β m a x = 2 π 4 π m . Since the number of points inside the major segments is less than r and also, based on Lemma 3, all internal angles of the corresponding polygons are greater than or equal to 2 π 2 r 1 m . Hence, all internal angles of the polygon computed by Algorithm 2 are less than 2 π 2 π 2 r 1 m . □
In step 2(a) of Algorithm 2, for each edge of C H , the measure of sweeping arc expands from 0 to β m a x , and the sweeping arc contains the inner points as much as possible. In Algorithm 3 (presented below), the sweeping arcs that correspond to all edges of C H expand concurrently to contain all inner points. In this way, the upper bound is improved to 2 π 2 π 2 d 1 m , such that d is the depth of angular onion peeling on S which is defined as follows:
Let us increase the measure of all sweeping arcs concurrently from 0 to the first hit (or β m a x , if a sweeping arc does not hit any point). All inner points that are hit by sweeping arcs form layer 1 of the points. The next layers are formed by deleting the points of the computed layer from inner points and keep increasing the measure of all sweeping arcs to the next hit. The process continues until all inner points are hit. The process of peeling away the layers, described above, is defined as "angular onion peeling" and the number of layers is called "depth of angular onion peeling" on these points.
Theorem 3.
There exists a polygon P ( S ) such that crosses S, and all internal angles of P are less than 2 π 2 π 2 d 1 m where d denotes the depth of angular onion peeling on S.
Proof. 
Here, by presenting Algorithm 3, we construct such a polygon.
Algorithm 3
  • Compute C H as the convex hull of S, and let I P be the set of inner points.
  • While I P is not empty:
    (a)
    Increase the measure of all sweeping arcs to the next hit or β m a x .
    (b)
    Based on Algorithm 1, reconstruct the polygons corresponding to each edge of C H .
    (c)
    Remove the visited points from I P .
All edges of corresponding polygons computed in step 2, minus all of the edges of C H (except those that have no corresponding polygon), construct the desired polygon.
Since, the number of points inside the major segments are less than d, all internal angles of corresponding polygons are greater than or equal to 2 π 2 d 1 m . Hence, all internal angles of the polygon computed by Algorithm 3 are less than 2 π 2 π 2 d 1 m . □

4.2. α -MAP vice versa α -MNP

Let S be a set of points on the grid G and P ( S ) be a simple polygon. Based on Pick’s theorem [52], the area of P is equal to b 2 + i 1 where b is the number of grid points on the boundary of P and i is the number of grid points which are inside the polygon P.
The polygon P crosses both b 1 points of S, which we call vertex points, and b 2 non-vertex points on G, which we call grid points. Hence, A r e a ( P ) = b 1 + b 2 2 + i 1 .
Assume that two polygons A and B with the same number of inner grid points cross no grid points (i.e., b 2 = 0 ). Hence, based on Pick’s theorem, the area of polygon A is more than that of B iff the number of vertex points in A is more than that in B. In this case, α -MAP is equivalent to α -MNP.
In the following, we show that for each polygon P ( S ) on the grid and all ϵ > 0 , there exists a polygon P with the same vertices points such that | A r e a ( P ) A r e a ( P ) | < ϵ , and P does not cross any grid point.
Let e = a b ¯ be an edge of P on the grid G. If a = ( x a , y a ) and b = ( x b , y b ) , W e = | x b x a | is the width of e and H e = | y b y a | is the height of e. (see Figure 16)
Lemma 4.
Let e be an edge of P on the grid G. If W e and H e are coprime integers, then e does not cross any grid point.
Proof. 
Assume e crosses n > 0 grid points. As shown in Figure 17, W e is divided into n + 1 parts, similar to H e . Hence, n + 1 is common divisor of W e and H e . □
Lemma 5.
Let a and b be two non-coprime integers. There exist infinitely many positive integers x > 1 , such that a x and b x 1 are coprime integers.
Proof. 
Each common denominator of a and b satisfies x. □
Definition 5.
The polygon P ( S ) is a grid-avoiding polygon if P does not cross any grid points.
The following theorem shows that if P crosses some grid points, for all ϵ > 0 there exists a grid-avoiding polygon P such that | A r e a ( P ) A r e a ( P ) | < ϵ .
Theorem 4.
Let e = a b ¯ be an edge of P ( S ) that crosses a grid point. For all ϵ > 0 , there exists a point b such that e = a b ¯ does not cross any grid point, the number of inner grid points does not change, and | A r e a ( a b b ) | < ϵ .
Proof. 
We convert the grid G to the grid G by dividing each cell of G into x 2 subcells and placing b on the one grid point left or right of b, as shown in Figure 18. If the right (left) grid point is inside the polygon P, place b on the right (left) side of b. Let n = x H e , m = x W e and m = x W e = m 1 . Based on Lemma 5, there exist infinitely many integers x such that n and m are coprime integers. Based on Lemma 4, since n and m are coprime integers, the edge e does not cross any grid point of G . As seen in Figure 18, the number of grid points inside the polygon does not change.
Let u be the length of each side of grid cells in G and u be the length of each side of grid cells in G . Based on Figure 18, A r e a ( a b b ) = 1 2 u H e . Since u = u x and there exist infinitely many integers x such that x W e and x H e are coprime integers, for each ϵ > 0 there exists an integer x such that | A r e a ( a b b ) | < ϵ . □
The following algorithm converts the grid G into the grid G , and the polygon P into the grid-avoiding polygon P on G .
Algorithm 4
Let P = ( a 1 , a 2 , a 3 , , a n , a 1 ) be the polygon on the grid G.
  • Set i = 1
  • If i = n go to 5, otherwise set e = a i a i + 1 ¯
  • If e does not cross any grid point
    (a)
    i = i + 1
    (b)
    Go to step 2.
  • Else
    (a)
    Set x = L C D ( W e , H e )
    (b)
    Convert G into the grid G using x (dividing each cell of G into x 2 subcells).
    (c)
    For j = 1 to i 1
    • If d = a j a j + 1 ¯ crosses any grid point
      • Move the vertex a j + 1 to the left side or right side grid point (in G ).
    (d)
    If e crosses any grid point
    • Move the vertex a i + 1 to the left side or right side grid point (in G ).
    (e)
    set i = i + 1 and go to step 2.
  • Exit.
Let W i be the width of e i = a i a i + 1 ¯ and H i be the length of e i . Let us further assume that W 1 and W 2 are coprime to H 1 and H 2 , respectively. Steps 3(a) and 3(b) avoid changing the position of these vertices. Assume e 3 = a 3 a 4 ¯ crosses a grid point. The grid G is converted into the grid G in step 4(b). In the new grid G , since W 1 = x W 1 and H 1 = x H 1 , the width and length of e 1 are not coprime integers the same as the width and length of e 2 . Therefore, the position of the previous vertices should be changed. Step 4(c) of Algorithm 4 updates the position of the previous vertices. Note that changing e 1 may have an effect on the edge e 2 . Hence, we check the loop in step 4(c), to see if the edge crosses any grid point. If so, then updating the last previous edge may have an effect on the edge e 3 . Hence, in step 4(d), we change the position of a 4 if e 3 crosses any grid point. Finally, the position of all vertices are updated such that the new edges do not cross any grid point.
Corollary 1.
Let P 1 and P 2 be two simple polygons containing S with the same number of inner grid points. B o u n d a r y ( P 1 ) > B o u n d a r y ( P 2 ) iff A r e a ( P 1 ) < A r e a ( P 2 ) . In other words, under these conditions we have the same solution for α-MAP and α-MNP.
Corollary 2.
Let P 1 and P 2 be two simple polygons containing S. If B o u n d a r y ( P 1 ) B o u n d a r y ( P 2 ) , then A r e a ( P 2 ) < A r e a ( P 1 ) .

5. Numerical Experiments and Results

Considering Equations (24), (28) and (31), the time complexity of the brute-force algorithm is O ( 2 n · m · r ) such that n is the number of points, m is the number of vertices of C H , and r is the number of inner points. In this section, we present a genetic algorithm as a fast and accurate method to solve these models. The genetic algorithm is a powerful stochastic search technique, which is applicable to a variety of nonconvex optimization problems [53].
In order to evaluate the results, we implemented both the G A and the brute-force algorithm for α -MAP, α -MPP, and α -MNP. We ran both algorithms on the same datasets of points. Each dataset contained 100 sets of points with the same cardinality. We obtained the results for datasets of 5, 7, 10, and 12 points which are tabulated in Table 2.
A polygon-match occurs if the result of the GA on a set of points is the same as that of the brute-force algorithm. The quantity column in Table 2 shows the percentage of polygon-matches in each dataset, and the quality column displays the average difference between the two areas; that is, A r e a ( P ) A r e a ( P ) where P and P are the constructed polygons using the genetic and the brute force algorithms, respectively.
The pseudocode for the GA is presented as follows:
Algorithm 5 (Genetic Algorithm)
Inputs:
S : the points set α : constraint on angles e : elitism rate m u : mutation rate i t t c o u n t : iteration count
  • Initialize the population: Generate random α -polygons with m , m + 1 , , n vertices containing S. Also, set i t t = 1 .
  • Coding: Compute the vector C for each randomly generated polygon as a code such that C [ i × j × k ] = 1 iff Z i , j , k =1. The length of C is n × m × r .
  • Packing: Construct a chromosome c h r for each code using C such that c h r [ k ] = j iff the kth inner point is assigned to the jth edge of C H , i.e., t { 1 , 2 , , r } : C [ k × j × t ] = 1 . The length of chr is r.
  • Elitist selection: Select e percent of the best chromosomes, and move them to the next generation.
  • Crossover: The single-point crossover is used. Select a random position i n d ( 1 i n d r ) and two random chromosomes as the parents.
  • Mutation: Each child that is constructed in step 5 is mutated with a probability of m u . Select a random position i n d ( 1 i n d r ) and randomly change the value of c h r [ i n d ] . The mutation leads an inner point to be assigned to another edge.
  • Unpacking: Convert each chromosome of the new generation into an individual code. Each c h r in the new generation is unpacking to a code C. In this step, the order of assigned points for each edge is specified.
  • Re-evaluate: Based on the objective function (Area, Perimeter, and Boundary), re-evaluate the new polygons and keep the best chromosome as the solution. Replace the old generation with the new one and set i t t = i t t + 1 . If i t t < i t t c o u n t go to step 3, otherwise finish.
Because of the exponential time complexity of the brute-force algorithm, the exact result could not be obtained on large datasets in a reasonable computational time. Thus, we ran the GA on datasets of 15, 20, 25, and 30 points and displayed the resulting polygons in Figure 19 which are the solutions for α -MAP for α = π .
As stated in Section 1, the concave hull is a generalization of the convex hull, that identifies the area occupied by a set of points. Moreira and Santos presented an algorithm to compute the concave hull [49], and in [54] an algorithm was presented to compute the concave hull in d dimensions. We implemented the said algorithm in [49], and compared the quality of the obtained result with that of the GA. Figure 20 illustrates this comparison with the x-axis exhibiting the cardinality of datasets and the y-axis exhibiting the approximation average quality of the results.
Figure 21, Figure 22 and Figure 23 illustrate the results of GA on a set of points which are the solutions for α -MAP, α -MPP, and α -MNP for different values of α , respectively. For α = 0 , the constructed polygons are the convex hull of points. As the value of α increases, the concave angles start to appear in the polygons. For large values of α (e.g., for α = 180 ), the boundary of the polygons would pass through all of the points; the results are simple polygons with approximately minimum area, maximum perimeter, and maximum number of vertices, respectively.

6. Conclusions

In this paper, we considered the problem of finding optimal simple polygons containing a set of points in the plane. We generalized the problems of finding the minimum area, maximum perimeter, and maximum number of vertices containing a set of points by adding constraint to the angles of polygons. We formulated the generalized problems as nonlinear programming models.
Given that all simple polygons contain a set of points, we derived an upper bound for the minimum of the maximum angles of each polygon. As a further theoretical achievement, we demonstrated that the problem of computing a polygon with minimum area is almost equivalent to that of computing a polygon with a maximum number of vertices.
We presented a genetic algorithm to solve these models, and conducted experiments on several datasets. Finally, in comparison to the brute-force method and other previous studies, better results were obtained.

Author Contributions

The authors contributed equally to this work. The authors read and approved the final manuscript.

Funding

This research received no external funding.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Papadimitriou, C.H. The Euclidean travelling salesman problem is NP-complete. Theor. Comput. Sci. 1977, 4, 237–244. [Google Scholar] [CrossRef]
  2. Fekete, S.P.; Pulleyblank, W.R. Area optimization of simple polygons. In Proceedings of the Ninth Annual Symposium on Computational Geometry, San Diego, CA, USA, 18–21 May 1993; ACM; pp. 173–182. [Google Scholar]
  3. Pakhira, M.K. Digital Image Processing and Pattern Recognition; PHI Learning Pvt. Limited: New Delhi, India, 2011. [Google Scholar]
  4. Marchand-Maillet, S.; Sharaiha, Y.M. Binary Digital Image Processing: A Discrete Approach; Academic Press: San Diego, CA, USA, 2000. [Google Scholar]
  5. Pavlidis, T. Structural Pattern Recognition; Springer: Berlin, Germany, 2013; Volume 1. [Google Scholar]
  6. Abdi, M.N.; Khemakhem, M.; Ben-Abdallah, H. An effective combination of MPP contour-based features for off-line text-independent arabic writer identification. In Signal Processing, Image Processing and Pattern Recognition; Springer: Berlin, Germany, 2009; pp. 209–220. [Google Scholar]
  7. Galton, A.; Duckham, M. What is the region occupied by a set of points? In Proceedings of the International Conference on Geographic Information Science, Münster, Germany, 20–23 September 2006; 81–98. [Google Scholar]
  8. Li, X.; Frey, H.; Santoro, N.; Stojmenovic, I. Strictly localized sensor self-deployment for optimal focused coverage. IEEE Trans. Mob. Comput. 2011, 10, 1520–1533. [Google Scholar] [CrossRef]
  9. Nguyen, P.L.; Nguyen, K.V. Hole Approximation-Dissemination Scheme for Bounded-Stretch Routing in Sensor Networks. In Proceedings of the 2014 IEEE International Conference on Distributed Computing in Sensor Systems (DCOSS), Marina Del Rey, CA, USA, 26–28 May 2014; pp. 249–256. [Google Scholar]
  10. Lawler, E.L.; Lenstra, J.K.; Kan, A.R.; Shmoys, D.B. The Traveling Salesman Problem: A Guided Tour of Combinatorial Optimization; Wiley: New York, NY, USA, 1985; Volume 3. [Google Scholar]
  11. Asaeedi, S.; Didehvar, F.; Mohades, A. α-Concave hull, a generalization of convex hull. Theor. Comput. Sci. 2017, 702, 48–59. [Google Scholar] [CrossRef]
  12. Fekete, S.P.; Woeginger, G.J. Angle-restricted tours in the plane. Comput. Geom. 1997, 8, 195–218. [Google Scholar] [CrossRef]
  13. Culberson, J.; Rawlins, G. Turtlegons: Generating simple polygons for sequences of angles. In Proceedings of the First Annual Symposium on Computational Geometry, Baltimore, MD, USA, 5–7 June 1985; ACM; pp. 305–310. [Google Scholar]
  14. Evans, W.S.; Fleszar, K.; Kindermann, P.; Saeedi, N.; Shin, C.S.; Wolff, A. Minimum Rectilinear Polygons for Given Angle Sequences. In Discrete and Computational Geometry and Graphs; Springer: Cham, Switzerland, 2015; pp. 105–119. [Google Scholar]
  15. Cho, H.G.; Evans, W.; Saeedi, N.; Shin, C.S. Covering points with convex sets of minimum size. In Proceedings of the International Workshop on Algorithms and Computation, Kathmandu, Nepal, 29–31 March 2016; Springer: Cham, Switzerland, 2016; pp. 166–178. [Google Scholar]
  16. Miller, C.E.; Tucker, A.W.; Zemlin, R.A. Integer programming formulation of traveling salesman problems. J. ACM (JACM) 1960, 7, 326–329. [Google Scholar] [CrossRef]
  17. Fasano, G. A global optimization point of view to handle non-standard object packing problems. J. Glob. Optim. 2013, 55, 279–299. [Google Scholar] [CrossRef]
  18. Liu, H.; Liu, W.; Latecki, L.J. Convex shape decomposition. In Proceedings of the 2010 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), San Francisco, CA, USA, 13–18 June 2010; pp. 97–104. [Google Scholar]
  19. Masehian, E.; Habibi, G. Robot path planning in 3D space using binary integer programming. Int. J. Mech. Ind. Aerospace Eng. 2007, 1, 26–31. [Google Scholar]
  20. Kallrath, J. Cutting circles and polygons from area-minimizing rectangles. J. Glob. Optim. 2009, 43, 299–328. [Google Scholar] [CrossRef]
  21. Speckmann, B.; Kreveld, M.; Florisson, S. A linear programming approach to rectangular cartograms. Prog. Spat. Data Handl. 2006, 529–546. [Google Scholar] [CrossRef]
  22. Seidel, R. Small-dimensional linear programming and convex hulls made easy. Discret. Comput. Geom. 1991, 6, 423–434. [Google Scholar] [CrossRef]
  23. Peethambaran, J.; Parakkat, A.D.; Muthuganapathy, R. An Empirical Study on Randomized Optimal Area Polygonization of Planar Point Sets. J. Exp. Algorithmics (JEA) 2016, 21, 1–10. [Google Scholar] [CrossRef]
  24. Taranilla, M.T.; Gagliardi, E.O.; Hernández Peñalver, G. Approaching Minimum Area Polygonization. In XVII Congreso Argentino de Ciencias de la Computación; Universidad Nacional de La Plata: La Plata, Argentina, 2011; pp. 161–170. [Google Scholar]
  25. Moylett, D.J.; Linden, N.; Montanaro, A. Quantum speedup of the traveling-salesman problem for bounded-degree graphs. Phys. Rev. A 2017, 95, 032323. [Google Scholar] [CrossRef]
  26. Bartal, Y.; Gottlieb, L.A.; Krauthgamer, R. The traveling salesman problem: Low-dimensionality implies a polynomial time approximation scheme. SIAM J. Comput. 2016, 45, 1563–1581. [Google Scholar] [CrossRef]
  27. Hassin, R.; Rubinstein, S. Better approximations for max TSP. Inf. Process. Lett. 2000, 75, 181–186. [Google Scholar] [CrossRef] [Green Version]
  28. Dudycz, S.; Marcinkowski, J.; Paluch, K.; Rybicki, B. A 4/5-Approximation Algorithm for the Maximum Traveling Salesman Problem. In Proceedings of the International Conference on Integer Programming and Combinatorial Optimization, Waterloo, ON, Canada, 26–28 June 2017; Springer: Cham, Switzerland, 2017; pp. 173–185. [Google Scholar]
  29. Matei, O.; Pop, P. An efficient genetic algorithm for solving the generalized traveling salesman problem. In Proceedings of the 2010 IEEE International Conference on Intelligent Computer Communication and Processing (ICCP), Cluj-Napoca, Romania, 26–28 August 2010; pp. 87–92. [Google Scholar]
  30. Lin, B.L.; Sun, X.; Salous, S. Solving travelling salesman problem with an improved hybrid genetic algorithm. J. Comput. Commun. 2016, 4, 98–106. [Google Scholar] [CrossRef]
  31. Hussain, A.; Muhammad, Y.S.; Nauman Sajid, M.; Hussain, I.; Mohamd Shoukry, A.; Gani, S. Genetic Algorithm for Traveling Salesman Problem with Modified Cycle Crossover Operator. Comput. Intell. Neurosci. 2017, 2017, 7430125:1–7430125:7. [Google Scholar] [CrossRef] [PubMed]
  32. Jakobs, S. On genetic algorithms for the packing of polygons. Eur. J. Oper. Res. 1996, 88, 165–181. [Google Scholar] [CrossRef]
  33. Parvez, W.; Dhar, S. Path planning of robot in static environment using genetic algorithm (GA) technique. Int. J. Adv. Eng. Technol. 2013, 6, 1205. [Google Scholar]
  34. Vadakkepat, P.; Tan, K.C.; Ming-Liang, W. Evolutionary artificial potential fields and their application in real time robot path planning. In Proceedings of the 2000 Congress on Evolutionary Computation, La Jolla, CA, USA, 16–19 July 2000; Volume 1, pp. 256–263. [Google Scholar]
  35. Dalai, J.; Hasan, S.Z.; Sarkar, B.; Mukherjee, D. Adaptive operator switching and solution space probability structure based genetic algorithm for information retrieval through pattern recognition. In Proceedings of the 2014 International Conference on Circuit, Power and Computing Technologies (ICCPCT), Nagercoil, India, 20–21 March 2014; pp. 1624–1629. [Google Scholar]
  36. Duckham, M.; Kulik, L.; Worboys, M.; Galton, A. Efficient generation of simple polygons for characterizing the shape of a set of points in the plane. Pattern Recognit. 2008, 41, 3224–3236. [Google Scholar] [CrossRef]
  37. Edelsbrunner, H.; Kirkpatrick, D.; Seidel, R. On the shape of a set of points in the plane. IEEE Trans. Inf. Theory 1983, 29, 551–559. [Google Scholar] [CrossRef]
  38. Gheibi, A.; Davoodi, M.; Javad, A.; Panahi, F.; Aghdam, M.M.; Asgaripour, M.; Mohades, A. Polygonal shape reconstruction in the plane. IET Comput. Vision 2011, 5, 97–106. [Google Scholar] [CrossRef]
  39. Peethambaran, J.; Muthuganapathy, R. A non-parametric approach to shape reconstruction from planar point sets through Delaunay filtering. Comput.-Aided Des. 2015, 62, 164–175. [Google Scholar] [CrossRef]
  40. Amenta, N.; Bern, M.; Eppstein, D. The crust and the β-skeleton: Combinatorial curve reconstruction. Graph. Models Image Process. 1998, 60, 125–135. [Google Scholar] [CrossRef]
  41. Ganapathy, H.; Ramu, P.; Muthuganapathy, R. Alpha shape based design space decomposition for island failure regions in reliability based design. Struct. Multidiscip. Optim. 2015, 52, 121–136. [Google Scholar] [CrossRef]
  42. Fayed, M.; Mouftah, H.T. Localised alpha-shape computations for boundary recognition in sensor networks. Ad Hoc Netw. 2009, 7, 1259–1269. [Google Scholar] [CrossRef]
  43. Ryu, J.; Kim, D.S. Protein structure optimization by side-chain positioning via beta-complex. J. Glob. Optim. 2013, 57, 217–250. [Google Scholar] [CrossRef]
  44. Varytimidis, C.; Rapantzikos, K.; Avrithis, Y.; Kollias, S. α-shapes for local feature detection. Pattern Recognit. 2016, 50, 56–73. [Google Scholar] [CrossRef]
  45. Siriba, D.N.; Matara, S.M.; Musyoka, S.M. Improvement of Volume Estimation of Stockpile of Earthworks Using a Concave Hull-Footprint. Int. Sci. J. Micro Macro Mezzo Geoinf. 2015, 5, 11–25. [Google Scholar]
  46. Chau, A.L.; Li, X.; Yu, W. Large data sets classification using convex–concave hull and support vector machine. Soft Comput. 2013, 17, 793–804. [Google Scholar] [CrossRef]
  47. Vishwanath, A.; Ramanathan, M. Concave hull of a set of freeform closed surfaces in R 3. Comput.-Aided Des. Appl. 2012, 9, 857–868. [Google Scholar] [CrossRef]
  48. Jones, J. Multi-agent Slime Mould Computing: Mechanisms, Applications and Advances. In Advances in Physarum Machines; Springer: Cham, Switzerland, 2016; pp. 423–463. [Google Scholar]
  49. Moreira, A.J.C.; Santos, M.Y. Concave hull: A k-nearest neighbours approach for the computation of the region occupied by a set of points. In Proceedings of the Second International Conference on Computer Graphics Theory and Applications (GRAPP 2007), Barcelona, Spain, 8–11 March 2007; pp. 61–68. [Google Scholar]
  50. Braden, B. The surveyor’s area formula. Coll. Math. J. 1986, 17, 326–337. [Google Scholar] [CrossRef]
  51. Graham, R.L. An efficient algorith for determining the convex hull of a finite planar set. Inf. Process. Lett. 1972, 1, 132–133. [Google Scholar] [CrossRef]
  52. Pick, G. Geometrisches zur zahlenlehre. Sitzenber. Lotos (Prague) 1899, 19, 311–319. [Google Scholar]
  53. Qing-feng, Z. The Application of Genetic Algorithm in Optimization Problems. J. Shanxi Norm. Univ. (Nat. Sci. Ed.) 2014, 1, 008. [Google Scholar]
  54. Park, J.S.; Oh, S.J. A new concave hull algorithm and concaveness measure for n-dimensional datasets. J. Inf. Sci. Eng. 2013, 29, 379–392. [Google Scholar]
Figure 1. Polygon P assigns internal points to convex hull edges.
Figure 1. Polygon P assigns internal points to convex hull edges.
Mathematics 07 00024 g001
Figure 2. The polygon P = ( s 1 , s 5 , s 6 , , s 4 , s 1 ) containing S = { s 1 , , s 19 } assigns internal points to convex hull edges.
Figure 2. The polygon P = ( s 1 , s 5 , s 6 , , s 4 , s 1 ) containing S = { s 1 , , s 19 } assigns internal points to convex hull edges.
Mathematics 07 00024 g002
Figure 3. Solution of α -MAP for different values of α .
Figure 3. Solution of α -MAP for different values of α .
Mathematics 07 00024 g003
Figure 4. Solution of α -MPP for different values of α .
Figure 4. Solution of α -MPP for different values of α .
Mathematics 07 00024 g004
Figure 5. Solution of α -MNP for different values of α .
Figure 5. Solution of α -MNP for different values of α .
Mathematics 07 00024 g005
Figure 6. A sweep arc on the edge e.
Figure 6. A sweep arc on the edge e.
Mathematics 07 00024 g006
Figure 7. Measure of the sweep arc on the edge e is less than 2 π 4 π 6 .
Figure 7. Measure of the sweep arc on the edge e is less than 2 π 4 π 6 .
Mathematics 07 00024 g007
Figure 8. Measure of all major segments are β m a x = 2 π 4 π 6 .
Figure 8. Measure of all major segments are β m a x = 2 π 4 π 6 .
Mathematics 07 00024 g008
Figure 9. Maximum angle of each polygon containing these points is equal to 2 π 2 π 6 .
Figure 9. Maximum angle of each polygon containing these points is equal to 2 π 2 π 6 .
Mathematics 07 00024 g009
Figure 10. (a) Set of six points inside the major segment; (b) All internal angles of the polygon ( c 1 , s 1 , s 2 , s 3 , s 4 , s 5 , s 6 , c 2 , c 1 ) are greater than or equal to 2 π 32 m .
Figure 10. (a) Set of six points inside the major segment; (b) All internal angles of the polygon ( c 1 , s 1 , s 2 , s 3 , s 4 , s 5 , s 6 , c 2 , c 1 ) are greater than or equal to 2 π 32 m .
Mathematics 07 00024 g010
Figure 11. Angle of x 1 ^ is greater than or equal to 2 π m .
Figure 11. Angle of x 1 ^ is greater than or equal to 2 π m .
Mathematics 07 00024 g011
Figure 12. The sweeping arc is divided into 3 parts B 1 , B 2 and B 3 .
Figure 12. The sweeping arc is divided into 3 parts B 1 , B 2 and B 3 .
Mathematics 07 00024 g012
Figure 13. The sweep arc is divided into 2 parts A 1 and A 2 .
Figure 13. The sweep arc is divided into 2 parts A 1 and A 2 .
Mathematics 07 00024 g013
Figure 14. The sweep arc is divided into 3 parts A 2 , A 11 and A 12 .
Figure 14. The sweep arc is divided into 3 parts A 2 , A 11 and A 12 .
Mathematics 07 00024 g014
Figure 15. The angles of all constructed simple polygons are greater than or equal to 2 π 4 m .
Figure 15. The angles of all constructed simple polygons are greater than or equal to 2 π 4 m .
Mathematics 07 00024 g015
Figure 16. W e and H e are the width and height of e, respectively.
Figure 16. W e and H e are the width and height of e, respectively.
Mathematics 07 00024 g016
Figure 17. Common divisor of W e and H e is 3.
Figure 17. Common divisor of W e and H e is 3.
Mathematics 07 00024 g017
Figure 18. The grid G is shown in bold lines, and G in regular mode.
Figure 18. The grid G is shown in bold lines, and G in regular mode.
Mathematics 07 00024 g018
Figure 19. Solutions for α -MAP for α = π and n = 15, 20, 25 and 30.
Figure 19. Solutions for α -MAP for α = π and n = 15, 20, 25 and 30.
Mathematics 07 00024 g019
Figure 20. Genetic algorithm (GA) versus concave hull algorithm (CH), in terms of both area and perimeter metrics.
Figure 20. Genetic algorithm (GA) versus concave hull algorithm (CH), in terms of both area and perimeter metrics.
Mathematics 07 00024 g020
Figure 21. Application of GA to approximate α -MAP, for different values of α .
Figure 21. Application of GA to approximate α -MAP, for different values of α .
Mathematics 07 00024 g021
Figure 22. Application of GA to approximate α -MPP, for different values of α .
Figure 22. Application of GA to approximate α -MPP, for different values of α .
Mathematics 07 00024 g022
Figure 23. Application of GA to approximate α -MNP, for different values of α .
Figure 23. Application of GA to approximate α -MNP, for different values of α .
Mathematics 07 00024 g023
Table 1. Notations of symbols.
Table 1. Notations of symbols.
NotationDescription
SA set of points in the plane
ncardinality of S
s i ith point of S ( 1 i n )
C H convex hull of S
mnumber of vertices of C H
I P inner points of C H
Pa simple polygon containing S
V P vertices of P
E P edges of P
rcardinality of I P
c j jth vertex of C H ( 1 j m )
e j jth edge of C H ( 1 j m )
Pa simple Polygon containing S
s i s j ¯ an edge of P with s i and s j as its end points ( 1 i , j n , i j )
( S ) set of all simple polygons containing S
A r e a ( P ) area of polygon P
P e r i m e t e r ( P ) perimeter of polygon P
B o u n d a r y ( P ) number of vertices of P
α an angle between 0 and π
MAPproblem of computing a simple polygon containing S with minimum area
MPPproblem of computing a simple polygon containing S with maximum perimeter
MNPproblem of computing a simple polygon containing S with maximum number of vertices
CHPproblem of computing convex hull of S
SPPproblem of computing a simple polygon crossing S
A B the measure of arc A B
Table 2. Numerical results.
Table 2. Numerical results.
Number of
Points
Number of
Generations
AreaPerimeterBoundary
QualityQuantityQualityQuantityQualityQuantity
n = 55099.153449698.350359598.695
10099.871799999.4602399100100
150100100100100100100
200100100100100100100
n = 75097.050388397.16538897.402682
10098.670089298.775869698.1428593
15098.9139493100100100100
20098.9065695100100100100
n = 105094.216555589.567226780.9090924
10095.141976794.31243808950
15097.798238396.674989397.587
20097.8845584100100100100
n = 125087.959035287.868935980.5384620
10090.847846393.452627084.6666744
15096.674987795.953288493.9166773
20097.764088296.159589898.591

Share and Cite

MDPI and ACS Style

Asaeedi, S.; Didehvar, F.; Mohades, A. NLP Formulation for Polygon Optimization Problems. Mathematics 2019, 7, 24. https://doi.org/10.3390/math7010024

AMA Style

Asaeedi S, Didehvar F, Mohades A. NLP Formulation for Polygon Optimization Problems. Mathematics. 2019; 7(1):24. https://doi.org/10.3390/math7010024

Chicago/Turabian Style

Asaeedi, Saeed, Farzad Didehvar, and Ali Mohades. 2019. "NLP Formulation for Polygon Optimization Problems" Mathematics 7, no. 1: 24. https://doi.org/10.3390/math7010024

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop