On Constructing Approximate Convex Hull

—The algorithms of convex hull have been extensively studied in literature, principally because of their wide range of applications in different areas. This article presents an efﬁcient algorithm to construct approximate convex hull from a set of n points in the plane in O ( n + k ) time, where k is the approximation error control parameter. The proposed algorithm is suitable for applications preferred to reduce the computation time in exchange of accuracy level such as animation and interaction in computer graphics where rapid and real-time graphics rendering is indispensable.


I. INTRODUCTION
T HE construction of planar convex hull is one of the most fundamental problems in computational geometry. The applications of convex hull spread over large number of fields including pattern recognition, regression, collision detection, area estimation, spectrometry, topology, etc. For instance, computer animation, the most crucial section of computer gaming, requires fast approximation for real-time response. Consequently, it is evidential from literature that numerous studies focus on fast approximation of different geometric structures in computer graphics [1], [2]. Moreover, the construction of exact and approximate convex hull is used as a preprocessing or intermediate step to solve many problems in computer graphics [3], [4].
Convex hull for a given finite set P ⊂ R d of n points where R d denotes the d-dimensional Euclidean space, is defined as the smallest convex set that contains all the n points. A set S ⊂ R d is convex if for two arbitrary points a, b ∈ S, the line segment ab is entirely contained in the set S. Alternatively, the convex hull can be defined as the intersection of all half-spaces (or half-planes in R 2 ) containing P . The main focus of this article is limited on the convex hull in Euclidean plane R 2 .
II. PREVIOUS WORK Because of the importance of convex hull, it is natural to study for improvement of running time and storage requirements of the convex hull algorithms in different Euclidean spaces. Graham [5] published one of the fundamental algorithms of convex hull, widely known as Graham's scan as early as 1972. This is one of the earliest convex hull algorithms with O(n log n) worst-case running time. Graham's algorithm is asymptotically optimal since Ω(n log n) is the lower bound of planar convex hull problem. It can be shown [6] that Ω(n log n) is a lower bound of a similar but weaker problem of determining the points belonging to the convex hull, not necessarily producing them in cyclic order.
However, all of these lower bound arguments assume that the number of hull vertices h is at least a fraction of n. Another algorithm due to Jarvis [7] surpasses the Graham's scan algorithm if the number of hull vertices h is substantially smaller than n. This algorithm with O(nh) running time is known as Jarvis's march. There is a strong relation between sorting algorithm and convex hull algorithm in the plane. Several divide-and-conquer algorithms including MergeHull and QuickHull algorithms of convex hull modeled after the sorting algorithms [8] and the first algorithm Graham's [5] scan uses explicit sorting of points.
In 1986, Kirkpatrick and Seidel [9] proposed an algorithm that computes the convex hull of a set of n points in the plane in O(n log h) time. Their algorithm is both output sensitive and worst case optimal. Later, a simplification of this algorithm [9] was obtained by Chan [10]. In the following year Melkman [11] presented a simple and elegant algorithm to construct the convex hull for simple polyline. This is one of the on-line algorithms which construct the convex hull in linear time.
Approximation algorithms for convex hull are useful for applications including area estimation of complex shapes that require rapid solutions, even at the expense of accuracy of constructed convex hull. Based on approximation output, these algorithms of convex hull could be divided into three groupsnear, inner, and outer approximation algorithms. Near, inner, and outer approximation algorithms compute near, inner, and outer approximation of the exact convex hull for some point set respectively.
In 1982, Bentley et al. [12] published an approximation algorithm for convex hull construction with O(n + k) running time. Another algorithm due to Soisalon-Soininen [13] which uses a modified approximation scheme of [12] and has the same running time and error bound. Both of the algorithms are the inner approximation of convex hull algorithm. The proposed algorithm in this article is a near approximation algorithm of O(n + k) running time.

III. APPROXIMATION ALGORITHM
Let P ⊂ R 2 be the finite set of n ≥ 3 points in general position and the (accurate) convex hull of P be CH(P ). Kavan, Kolingerova, and Zara [14] proposed an algorithm with O(n + k 2 ) running time which partitions the plane R 2 into k sectors centered in the origin. Their algorithm requires the origin to be inside the convex hull. (It is possible to choose a point p ∈ P and translate all the other points of P accordingly using additional steps in their algorithm). Conversely, we partition the plane R 2 into k vertical sector pair with equal central angle α in the origin and for our algorithm the origin O could be located outside of the convex hull. The sets represent the vertically opposite sectors that form the vertical sector pairs where, i = 0, 1, . . . , k − 1 and the central angle α = π/k. Then, the sets s ⊕ i and s i denote the points belonging to the set P in sectors S ⊕ i and S i respectively. Formally, A pair of unit vectors u ⊕ i and u i obtain in ith vertical sector pair as The maximum projection magnitudes in the directions of u ⊕ i and u i are The definition of max function is extend to return −∞ for The vectors that produce the maximum magnitude in the directions of u ⊕ i and u i for some points in the ith vertical sector pair are The magnitude of the vectors v ⊕ i and v i could be ±∞ for the ith vertical sector pair containing less than two points. The sets V ⊕ and V containing all the finite vectors in the ranges [0, π) and [π, 2π), are Let, V = V ⊕ ∪ V and V contains at least three terminal points of the vectors in general position to construct the convex hull. The convex hull approximation of k vertical sector pairs according to the proposed algorithm in this article is The input of the algorithm P ⊂ R 2 is a set of n ≥ 3 points in general position. For simplicity, we assume that the origin O / ∈ P and k ≥ 2. (This assumption can be achieved by taking a point arbitrarily close to the origin instead of the origin itself, within the upper bound of error calculated in Section V). We also assume that at least two vertical sector pairs together contains minimum three points (where none of these two are empty). The assumption can be reduced to one of the requirements of minimum three points input (i.e., |P | ≥ 3) of convex hull. To illustrate that, let us consider p and q to be two points in P such that ∠pOq ≤ π − α where O is the origin. Such two points do exist if no three points are collinear in P (i.e., the points of P are in general position). If Ot is the bisector of ∠pOq, then adding the angle of Ot from positive x -axis as an offset to every vertical sector pair ensures that all the input points cannot be in the same vertical sector pair. Thus, the assumption is satisfied. Alternatively, if less than three absolute values in M are finite, then for each M i ∈ M , assign M i cos α to M i−1 and M i+1 where these are infinite.  (The next paragraph contains details about M .) Therefore, the number of points in V must be at least three.
A circular array U is used to contain the k pairs of unit vectors of all the k vertical sector pairs and another circular array M is used to hold the number of k pairs of maximum projection magnitude in all the k vertical sector pairs. Both circular arrays have the same size of 2k and use zero based indexing scheme. The function atan2 is a variation of function arctan with point as a parameter. The function returns the angle in radians between the point and the positive x -axis of the plane in the range of [0, 2π). The function anglex searches sequentially for the index of maximum angular distance between two consecutive positive finite vectors (computed using projection magnitude with index referring angle). If the index is i such that maximum angle occurs in between i and j, the anglex function returns j. The final convex hull is constructed using Melkman's [11] algorithm from set of V points which are the terminal points of finite vectors computed in steps 14 and 15. If the first three points of V are collinear, displacing one of these points within the error bound solves the problem.
Since the vertices of the convex hull produced by the proposed algorithm are not necessarily in the input point set P , the algorithm cannot be applied straight away to solve some other problems. Let us consider another circular array Q of 2k size which used to contain the points generating the inner products of M . Adding the point Q j instead of M j U j to the sequence V in steps 14 and 15 ensures that the vertices of the convex hull will be the points from P . These modifications of the algorithm allow us to solve some problems including approximate farthest-pair problem but increase the upper bound of error (described in Section V) to r sin(π/k).

V. ERROR ANALYSIS
There are different schemes for measuring the error of an approximation of the convex hull. We measured the error as distance from point set of accurate convex hull CH(P ). The distance of an arbitrary point x from a set S is defined as Formally the approximation error E can be defined as It is sufficient to determine the upper bound of error E of the approximate convex hull CH k (P ). Let, Q be be a point lying outside of the convex hull CH k (P ) and O be the origin. Suppose that, AB is an edge of the approximate convex hull (as shown in Figure 4). Therefore, the distance of the point Q from the CH k (P ) is It follows that the minimum distance d directly depends on k which is denoted as function d(k). Thus, the upper bound of approximation error E is r sin(π/2k). If k approaches to infinity, the CH k (P ) converges to CH(P ).  The upper error bounds r sin(π/k) and max(r tan(π/k), 2r sin(π/k)) are calculated in this article and in [14] (i.e., KKZ Algorithm) respectively where r is unit in the graph.
VI. CORRECTNESS Theorem 1: The approximation algorithm produces the convex hull from a set of points in R 2 correctly within the prescribed error bound.
Proof: Since, Melkman's algorithm can construct the convex hull correctly for points on a simple polygonal chain, it suffices to prove that the sequence of points V denotes a simple polygonal chain. (Melkman [11] published the on-line algorithm of convex hull with formal proof of correctness in 1987). Suppose that, the plane R 2 is partitioned into Fig. 6.
The proof of correctness of the algorithm that consider both the simple and non-simple variation of polygonal chain i refer to the same point of V (e.g., h i+2 contains only one point in the Figure 6). Let ∠h i h j denotes the angle from h i to h j where h i and h j are half-lines from the origin. Since the angle between two consecutive half-lines ∠h i h i+1 ≥ π/k and O / ∈ V (because t > 0 for our assumptions O / ∈ P and k ≥ 2 in the algorithm), no two line segments The equation of ∠Ov ⊕ i v i+1 (derived using the law of sines and basic properties of triangle) also illustrates this fact mathematically for Ov ⊕ i v i+1 (as shown in the Figure 6) The solution with minimum magnitude of the above equation If the maximum angle between two consecutive half-lines is ∠h i h i+1 for some i, then anglex function returns the index i + 1 that ensures the construction a simple polygonal chain

VII. CONCLUSION
Geometric algorithms are frequently formulated under the non-degeneracy assumption or general position assumption [15] and the proposed algorithm in this article is also not an exception. To make the implementation of the algorithm robust an integrated treatment for the special cases can be applied. There are other general techniques called perturbation schemes [16], [17] to transform the input into general position and allow the algorithm to solve the problem on perturbed input. Both symbolic perturbation and numerical (approximation) perturbation (where perturbation error is consistent with the error bound of the algorithm) can be used on the points of P to eliminate degenerate cases.

APPENDIX
The article describes a near approximation algorithm for convex hull however it is possible to extend the concept for inner as well as outer approximation algorithms for convex hull. An illustration of inner approximate convex hull algorithm is shown in Figure 7.
V ← V ∪ sort(T ) 18. return MELKMAN-CONVEX-HULL(V ) Fig. 7. The proposed algorithm to compute an inner approximate convex hull in O(n + k) time from inputs P and k where P ⊂ R 2 is a set of n points in the plane and k is the number of vertical sector pair partitioning the plane.