American Journal of Operations Research
Vol.05 No.03(2015), Article ID:56242,10 pages
10.4236/ajor.2015.53013
A Gradient Search Algorithm for the Maximal Visible Area Polygon Problem
Helman I. Stern1, Moshe Zofi1,2
1Department of Industrial Engineering and Management, Ben-Gurion University of the Negev, Beersheva, Israel
2Department of Industrial Management, Sapir College, Sderot, Israel
Email: helman@bgu.ac.il, zofi@bgu.ac.il
Copyright © 2015 by authors and Scientific Research Publishing Inc.
This work is licensed under the Creative Commons Attribution International License (CC BY).
http://creativecommons.org/licenses/by/4.0/



Received 28 March 2015; accepted 8 May 2015; published 12 May 2015
ABSTRACT
This paper provides a gradient search algorithm for finding the maximal visible area polygon (VAP) viewed by an interior point in a simple polygon
. The algorithm is based on a natural partition of
into convex sets, such that each element of the partition is associated with a unique analytical form of the area function. We call this partition a back diagonal partition of
. Our maximal VAP algorithm converges in a finite number of steps, and is polynomial with a complexity of
, for a simple polygon
with n vertices, and r reflex vertices. We use the maximal VAP algorithm as a basis for a greedy heuristic for the well known guardhouse problem with a computation complexity of
.
Keywords:
Maximal Visible Polygon, Gradient Search, Continuous Optimization, Guardhouse Problem

1. Introduction
A visual polygon is a polygon in which any pair of points is mutually visible. A visible polygon from a point
in a simple polygon
with
vertices can be found with a computational complexity of
by the algorithm of El Gindy and Avis [1] . For each visible polygon, one may associate a real number representing its area. The area function over all points
is not well behaved, being in general neither convex nor concave, including points that may be not differentiable and even discontinuous. Some properties of polygonal area functions may be found in [2] .
The first problem we intend to solve is finding an interior point
that maximizes the area of the visual polygon. We denote this problem as the maximal visible area polygon (VAP) problem. This problem was studied by Cheong et al. [3] , which suggested sampling a finite number of points inside the polygon found by its triangulation.
The algorithm we suggest for this problem is based on a gradient search which converges with a finite number of steps. In order to determine the size of each step taken in the gradient direction, we use a specialized partition of the polygon
into convex sets referred to as a back diagonal partition (BDP). This decomposition arises naturally through the introduction of “back diagonals” in such a manner that the area functional expression is invariant within the domain of each element of the partition. Gradient information along with jump points is combined in an algorithm which traces a path from some initial point in the polygon to a local maximal point. The developed algorithm has a computational complexity of
for a polygon
with
vertices and 
A related problem of placing the minimum number of stationary guards to visually cover a room represented as a 2D polygon was first presented by Klee in 1973 [4] as the art gallery or guardhouse problem. The objective was to find the smallest set of points in a polygon, such that every point inside the polygon would be visible to at least one point in the set. Two points are visible to each other, if the line of sight connecting them lies inside the polygon. Several heuristics and complexity calculations are provided in [5] and [6] for different extensions of the guardhouse problems in which the observers are restricted to the vertices of the polygon, and the edges of the polygon, or not restricted at all. In this paper, we offer a greedy algorithm, which repeatedly uses the gradient search method for finding the maximal VAP, and for solving the guardhouse problem. This greedy heuristic terminates after a finite number of steps and is polynomial with time complexity of
In Section 2, we define the maximal VAP problem and introduce useful notation. In Section 3, we introduce the concept of a hidden region, its area, and a back diagonal partition. These set the stage for the introduction of the maximal visible area polygon (VAP) gradient search algorithm described in Section 4. In Section 5, we use the gradient maximal VAP algorithm to form a basis for a greedy algorithm to solve an application in the form of the guardhouse problem, and illustrate it with a small example. Section 6 provides conclusions and future work.
2. Problem Definition and Notation
Before embarking on a formal definition of the problem we present a number of definitions and associated notation. A polygon 



















We define 













The Maximal VAP Problem
Define a maximal visible area polygon (VAP) problem as finding a point 


Figure 1. Simple polygons with hidden areas. (a) A simple polygon containing a reflex vertex; (b) A region created by a chain of vertices which are not visible from an observation point.
The expression for the signed area of a polygon




Note, that 




3. Local Maximal Visible Area Polygon (VAP) Gradient Search Algorithm
We propose a gradient search method which starts with a given observation point, and moves it in the direction of the maximal gradient until a local maximum is achieved. At each step of the algorithm, a different visible area is calculated (i.e. the polygon minus the hidden regions) as a function of the current point. The result of a step in the maximal area gradient direction will give the 






3.1. Basic Definitions and Notation
Given a simple polygon 








Proposition 1 Let a chain 







Proposition 2 Let 








Figure 2. A cross shaped polygon. (a) The visible polygon from point 

enclosed by 

Figure 1(b) shows an example of a point 






said to be a window of 









































3.2 Back Diagonal Partition (BDP)
Consider a pair of vertices 
























Figure 5 shows an example of all back diagonals (dotted lines) induced by the reflex vertices. The introduction of all back diagonals induces a back diagonal partition (BDP) of



Proposition 3 A BDP of 


Proposition 4 A back diagonal is an edge in a BDP such that viewpoints in the neighborhood on either side of it have different visible and area polygonal functional expressions. Thus, each region in a BDP has a unique visible and area polygonal functional expression.
The above propositions will be useful in construction an algorithm for the maximal VAP problem.

Figure 3. (a) A reflection point



Figure 4. A back diagonal 



Figure 5. A back diagonal partitioning for a polygon with three reflex vertices.
3.3. Hidden Regions
Note that the gray areas in Figure 3 are hidden regions with respect to the viewpoints



























where







We can now define a visible polygon in terms of the definitions given above. Given a polygon 









3.4. Calculation Formulas Using Hidden Areas
Define a rectangular coordinate system in 








Here, 



Here, 












The collection of left and right hand hidden regions associated with 


This area function will be derived in terms of the rectangular 





Let 





Figure 6. A simple polygon with a left hand hidden region.
The only relevant vertices are the reflex vertex 









The individual coordinates of 




4. Gradient Search Algorithm for Maximal VAP
Following are the steps of a gradient search algorithm for finding a local max to the maximal visible polygon problem. Given the current point


4.1. Determination of the Maximal Gradient Direction
Since 











The total gradient 

where, 


4.2. Max VAP Algorithm (the Gradient Search Algorithm)
Although this algorithm is based on movements between sub regions of a BDP, there is no need to actually construct it. It is only necessary to construct the back diagonals (line equations). This is because the algorithm searches for a critical event when the observer crosses a back diagonal. At his point, based on proposition 4, a recalculation of the area and new gradient are necessary.
The Steps of the Procedure
Given a simple polygon, and a point 


Step 1 Compute the area of 

Step 2 Determine the visible polygon 









Step 3 Find the total gradient 

Step 4 If 

Step 5 Move 
a) 

b) One of the reflection points 


c) If one of the windows 





d) A new reflex vertex becomes active. Add the associated window to
Step 6 If



Step 7 Stop. No local improvement is possible. Let 


Note that the events in Step 5 correspond to the intersection of the gradient direction vector and all back diagonals.
Proposition 5 The sequence 

Proposition 6 The Gradient Search Algorithm converges in a finite number of steps. This is true since the sequence in Proposition 1 is bounded from above by the area of
Proposition 7 The gradient search algorithm has a time complexity
Proof. In Step 2, the initial polygon can be calculated in time









rithm is
4.3. Illustrative Example for the Maximal VAP Problem
The example in Figure 7 provides a demonstration of the algorithm for the case of a simple polygon with three reflex vertices, one of them, 


5. Application-Solving the Guardhouse Problem
The guardhouse problem, proven to be NP-Hard in [4] , is defined as the problem of the finding the minimal number of observation points 



A greedy algorithm is described for solving the guardhouse problem which repeatedly uses the maximal VAP algorithm. The idea is to start with a simple polygon, and remove a maximal VAP. This operation can result in disconnected components, each in itself a simple polygon. The process is repeated for any remaining components. Each removal results in an additional observation point, so that the number of removals equals the number of points needed to view the entire original polygon.
5.1. The Greedy Heuristic
Given a simple polygon

1) Initially set



2) Start with a random point 




3) Let 






4) If 
5) Select a polygon 

The greedy heuristic described above terminates after a finite number of steps. The complexity of the greedy heuristic for solving the guardhouse problem is


5.2 Illustrative Example
Figure 8(a) shows a sample polygon containing 16 vertices. We start with point shown in (b) and improve it until reaching a local maximum. The visible area is then removed from the initial polygon, and two new sub polygons appear in (c). In (d) and (e), this process is repeated with the two parts left, resulting in the final solution (f) in which the entire polygon is covered by 4 observation points.
6. Conclusions and Future Work
This work defined the maximal VAP problem, and offered a gradient algorithm for its solution which had a time
complexity of



solving the guardhouse problem with a time complexity of
Figure 7. Steps of the max VAP algorithm staring with an initial view point
Figure 8. Example solution to the guardhouse problem using the greedy VAP heuristic algorithm.
It will be interesting to compare the results of our suggested procedure to other well-known heuristics for the guardhouse problem offered by other researchers. Such a comparison must include not only the quality of the solution, but also the running times. This is left for future work.
References
- El Gindy, H. and Davis, D. (1981) A Linear Algorithm for Computing the Visible Polygon from a Point. Journal of Algorithms, 2, 186-197. http://dx.doi.org/10.1016/0196-6774(81)90019-5
- Stern, H. (1989) Polygonal Entropy: A Convexity Measure. Pattern Recognition Letters, 10, 229-235. http://dx.doi.org/10.1016/0167-8655(89)90093-7
- Cheong, O., Efrat, A. and Har-Peled, S. (2004) On Finding a Guard That Sees Most and a Shop That Sells Most. Proc. 15th ACM-SIAM Sympos. Discrete Algorithms 1098-1107.
- O’Rourke, J. (1987) Art Gallery Theorems and Algorithms. Oxford University Press, Oxford.
- Amit, Y., Mitchell, J.S.B. and Packer, E. (2010) Locating Guards for Visibility Coverage of Polygons. International Journal of Computational Geometry & Applications, 20, 601-630. http://dx.doi.org/10.1142/S0218195910003451
- Lee, D.T. and Lin, A.K. (1986) Computational Complexity of Art Gallery Problems. IEEE Transactions on Information Theory, 32, 276-282. http://dx.doi.org/10.1109/TIT.1986.1057165






















