Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Standard view
Full view
of .
0 of .
Results for:
P. 1
Divide and Conquer For Convex Hull

# Divide and Conquer For Convex Hull

Ratings: (0)|Views: 200 |Likes:
Journal of Computing, eISSN 2151-9617, http://www.journalofcomputing.org/, Call For Computer Science Papers
Journal of Computing, eISSN 2151-9617, http://www.journalofcomputing.org/, Call For Computer Science Papers

Categories:Types, Research

### Availability:

See more
See less

07/17/2014

pdf

text

original

Divide and Conquer For Convex Hull
Ngonidzashe Zanamwe

Abstract
— The divide and concqur approach has many applications in computer science. With this approach a large problem isbroken down into small and manageable subproblems and each is solved then the solutions are combined to give the grandsolution to the problem. The problem of finding the convex hull of a polygon can be viewed as one problem that can be solvedusing the divide and conqurer approach. This paper therefore presents a discussion on the divide and conquer for the ConvexHull. The paper looks at generic divide and conquer approach before using the approach in finding the convex hull of a polygon. The paper presents a step by step procedure for finding the convex hull using the divide and conqurer approach. Also, thepaper discusses running times of the Convex Hull divide-and-conquer algorithm, advantages and disadvantages of the divideand conquers approach for convex hull. The paper concludes by giving other algorithms for solving the convex hull problemapart from the divide and conquer.
Index Terms
—divide and conqurer, convex hull, polygon, divide and conqurer for convex hull.
——————————

——————————
1 I
NTRODUCTION
HIS paper presents a discussion on the divide andconquer for Convex Hull (hereinafter referred to asCH). The paper begins by looking at the divide andconquer in general before focusing on its applications incomputational geometry, notably to the CH problem.This paper looks at two distinct ways of computing theconvex hull using the divide and conquer approach. Also,the paper discusses running times of Convex Hull divide-and-conquer algorithm, advantages and disadvantages ofthe divide and conquers approach for convex hull. Thepaper concludes by giving other algorithms for solvingthe convex hull problem apart from the divide and con-quer approach.
1.1 Divide and Conquer algorithms
Naher and Schmitt [1] note that divide and conquer algo-rithms solve problems by dividing them into instances,solving each instance recursively and merging the corre-sponding results to a complete solution. Further, [1] as-serts that all instances have exactly the same structure asthe original problem and can be solved independentlyfrom each other, and so can easily be distributed over anumber of parallel processes or threads. The divide andconquer approach is presented in Fig. 1 below.
Figure 1: The divide and conquer approach
The above diagram shows that if one is faced with a prob-lem of size
n
, one begins by dividing it into two sub-problems of size
n/2
each and then finds a solution toeach sub-problem then merges the solutions to sub-problems. Similar assertions were made by [5], hepresents the following divide and conquer algorithm:if trivial (small), solve it “brute force”else{
divide
into a number of sub-problems;
solve
each sub-problem recursively;
combine
solutions to sub-problems;}
1.2 Polygon
A polygon is defined as a closed shape with more thantwo sides or line segments. A simple polygon has no twoconsecutive edges that are intersecting.
————————————————

Ngonidzashe Zanamwe is with the University of Zimbabwe, Zimbabwe
T
JOURNAL OF COMPUTING, VOLUME 5, ISSUE 3, MARCH 2013, ISSN (Online) 2151-9617https://sites.google.com/site/journalofcomputingWWW.JOURNALOFCOMPUTING.ORG1

1.3 Convexity
A convex is a polygon in which any line joining twopoints within the polygon lies within the polygon. Alex-ander Kolesnikov [7] gives similar definitions of convexi-ty, the first is that, a subset set S of the plane is calledconvex if and only if for any pair of points P, Q
S theline segment PQ is completely contained in S. The secondgoes as, a set S is convex if it is exactly equal to the inter-section of all the half planes containing it. The figuresbelow show convex and non-convex shapes.
Figure 2: The convex and non-convex shapes
1.3. Convex Hull
Mohammed Nadeem Ahmed and Raghavendra Kyatha[2] establish that the Convex Hull of a set Q of points isthe smallest convex polygon P, for which each point in Qis either on the boundary of P or in its interior. In linewith the above, [4] asserts that the convex hull of a set
S
of points, denoted
hull
(
S
) is the smallest polygon
P
forwhich each point of
S
is either on the boundary or in theinterior of
P
. Similarly, [7] establishes that the convex hullCH(P) of a finite point set P is the smallest convex poly-gon that contains P. Figure 3 below shows a convex hullP.
Figure 3: Convex Hull P
1.4 Intuition:
If each point is represented by a nail sticking out from aboard and you take a rubber band and lower it over thenails, so as to completely encompass the set of nails, andthen let the rubber band naturally contract, the rubberband will give you the edges of the convex hull of the setof points, and those nails that correspond to a change inslope of the rubber band represent the extreme points ofthe convex hull [4].
1.5 Convex Hull Problem
From the above definition it can thus be said that a con-vex hull problem is one where given a set of points orcoordinates one is asked to come up with the smallestpolygon in which all points are either inside or on theedge of the polygon.
1.6 Finding the convex hull using divide andconquer
Souvaine [3]establishes that in order to find the convexhull using a divide-and-conquer approach, one has tofollow these steps:sort points (
p
1
, p
2
, . . . , p
n
) by their x-coordinaterecursively find the convex hull of
p
1
through
p
n/
2
recursively find the convex hull of
p
n/2
+1
through
p
n

merge the two convex hullsA more detailed algorithm for finding a Convex Hull ispresented in [6]. The algorithm is as follows:Hull(S) :If |S| <= 3, then compute the convex hull by brute forcein O(1) time and return.Otherwise, partition the point set S into two sets A and B,where A consists of half the points with the lowest x co-ordinates and B consists of half of the points with thehighest x coordinates.Recursively compute HA = Hull(A) and HB = Hull(B).Merge the two hulls into a common convex hull, H, bycomputing the upper and lower tangents for HA and HBand discarding all the points lying between these twotangents.
2. A
PPROACHES TO FINDING THE CONVEX HULL

There are two approaches to computing the convex hulland the approaches are here named approach A and ap-proach B. The next section explores these approaches ingreater detail beginning with approach A.
2.1 Approach A
This approach involves a number of steps which include,sorting the points, dividing the set of points into two sets,recursive computation of convex hulls for each subset ofpoints and merging the convex hulls. Below is a detailedexplanation of each of the above steps.
2.1.1 Sorting the points or coordinates
This involves sorting the points in increasing order oftheir
x
-coordinates with ties resolved by increasing orderof y coordinates. For example if one is given the followingset of points S: (2,12), (4,17), (10,19), (12,15), (15,19), (7,20),(18,20), (16,10), (18,2), (14,7), (20,11), (8,9), (4,6) and (9,1). Ifthese points are sorted according to be explanation givenabove, we end up with the following arrangement,P1(2,12), P2(4,6), P3(4,17), P4(7,20), P4(8,9), P6(9,1),P7(10,19), P8(12,15), P9(14,7), P10(15,19), P11(16,10),P12(18,2) , P13(18,20), and P14(20,11). The points areshown in the figure 4 below:
JOURNAL OF COMPUTING, VOLUME 5, ISSUE 3, MARCH 2013, ISSN (Online) 2151-9617https://sites.google.com/site/journalofcomputingWWW.JOURNALOFCOMPUTING.ORG2

Figure 4: The Points
2.1.2 Dividing points
This step involves partitioning the point set S into twosets A and B, where A consists of half the points with thelowest
x
coordinates and B consists of half of the pointswith the highest
x
coordinates. For instance, in our exam-ple set A will consist points P1 through P7 whereas set Bwill consist points P8 to P14. This partition is illustratedin figure 5 below.
Figure 5: The Partition
Each subset in the above figure has 7 elements. We nowsubdivide each subset into two subsets one with four el-ements and the other with three elements. The algorithmabove stipulates that once the number of points in eachpartition is 3 or less you construct the convex hull, other-wise continue dividing. The final partitions are in figure 6below.
Figure 6: Final Partitions
2.1.3 Computation of convex hulls
This involves constructing convex hulls by joining allpoints in each subset in the diagram above. For instance, join P2, P3 and P4 to form triangle P2P3P4, then join P5,P6 and P7 to form triangle P5P6P7, join P8P9, join P10P11and lastly join P12, P13 and P14 to form triangleP12P13P14. This goes on until the points in the last parti-tion are joined as shown in the shown in the diagram be-low. The computed convex hulls are shown in figure 7below.
Figure 7: Computed Convex Hull
The convex hulls in the figure above must be combinedby removing the partitions in the reverse order in whichthey were placed; this implies that, remove lines
L4
and
L5
first. If we remove L
4
, we then join P1 to hull P2P3P4.If we remove L
5
, we then join the two lines as illustratedin Figure 8 below.
Figure 8: Two Lines Joined
The next stage is to remove lines L
2
and L
3
, if we removeL
2
, then we join P4 to P7 and P2 to P6. If we remove L
2
,then we join P10 to P13 and P9 to P12. After that, we re-move all non-convex edges such as P5P6, P2P3, P10P11and so on. This leaves one with two convex hulls HA andHB as shown in figure 9 below.
JOURNAL OF COMPUTING, VOLUME 5, ISSUE 3, MARCH 2013, ISSN (Online) 2151-9617https://sites.google.com/site/journalofcomputingWWW.JOURNALOFCOMPUTING.ORG3