ContentsPreface 2Introduction 51 Delaunay Tessellation and Convex Hull 91.1 Geometric Preliminaries . . . . . . . . . . . . . . . . . . . . . . . . . . 91.2 Delaunay Tessellation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121.2.1 Definition of Delaunay Tessellation . . . . . . . . . . . . . . . . 121.2.2 Properties of Delaunay Tessellation . . . . . . . . . . . . . . . . 141.3 Delaunay Tessellation and Connection to Convex Hull . . . . . . . . . . 192 Graham’s Algorithm 232.1 Pseudocode, Version A . . . . . . . . . . . . . . . . . . . . . . . . . . . 242.1.1 Start and Stop of Loop . . . . . . . . . . . . . . . . . . . . . . . 242.1.2 Sorting Origin . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252.1.3 Collinearities . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262.2 Pseudocode, Version B . . . . . . . . . . . . . . . . . . . . . . . . . . . 272.3 Implementation of Graham’s Algorithm . . . . . . . . . . . . . . . . . . 272.3.1 Data Representation . . . . . . . . . . . . . . . . . . . . . . . . 282.3.2 Sorting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292.3.3 Main . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312.3.4 Code for the Graham Scan . . . . . . . . . . . . . . . . . . . . . 322.3.5 Complexity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322.4 Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333 Algorithms for Computing Delaunay Tessellation 353.1 Sequential Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . 353.2 Parallel Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 383.3 Correctness and Implementation of the Parallel Algorithm . . . . . . . 43
Trang 1VIETNAM NATIONAL UNIVERSITY, HANOI HANOI UNIVERSITY OF SCIENCE FACULTY OF MATHEMATICS MECHANICS INFORMATICS
———–OOO————
DONG VAN VIET
A Parallel Algorithm Based on Convexity
for the Computing of Delaunay
Trang 2Preface
Trang 31.1 Geometric Preliminaries 9
1.2 Delaunay Tessellation 12
1.2.1 Definition of Delaunay Tessellation 12
1.2.2 Properties of Delaunay Tessellation 14
1.3 Delaunay Tessellation and Connection to Convex Hull 19
2 Graham’s Algorithm 23 2.1 Pseudocode, Version A 24
2.1.1 Start and Stop of Loop 24
2.1.2 Sorting Origin 25
2.1.3 Collinearities 26
2.2 Pseudocode, Version B 27
2.3 Implementation of Graham’s Algorithm 27
2.3.1 Data Representation 28
2.3.2 Sorting 29
2.3.3 Main 31
2.3.4 Code for the Graham Scan 32
2.3.5 Complexity 32
2.4 Example 33
3 Algorithms for Computing Delaunay Tessellation 35 3.1 Sequential Algorithm 35
3.2 Parallel Algorithm 38
3.3 Correctness and Implementation of the Parallel Algorithm 43
Trang 43.4 Concluding Remarks and Open Problems 49
Appendix 51 Introduction to MPI Library 51
Getting Started With MPI on the Cluster 51
Compilation 51
Running MPI 52
The Basis of Writing MPI Programs 52
Initialization, Communicators, Handles, and Clean-Up 52
MPI Indispensable Functions 53
A Simple MPI Program - Hello.c 57
Timing Programs 59
Debugging Methods 60
Trang 5Computational geometry is a branch of computer science concerned with the designand analysis of algorithms to solve geometric problems (such as pattern recognition,computer graphics, operations research, computer-aided design, robotics, etc) thatrequire real-time speeds Until recently, these problems were solved using conventionalsequential computer, computers whose design more or less follows the model proposed
by John von Neumann and his team in the late 1940s (see [1]) The model consists of asingle processor capable of executing exactly one instruction of a program during eachtime unit Computers built according to this paradigm have been able to perform attremendous speeds, thanks to inherently fast electronic components However, it seemstoday that this approach has been pushed as far as it will go, and that the simple laws
of physics will stand in the way of further progress For example, the speed of lightimposes a limit that cannot be surpassed by any electronic device
On the other hand, our appetite appears to grow continually for ever more powerfulcomputers capable of processing large amounts of data at great speeds One solution tothis predicament that has recently gained credibility and popularity is parallel process-ing The main purpose of parallel processing is to perform computations faster thancan be done with a single processor by using a number of processors concurrently Thepursuit of this goal has had a tremendous influence on almost all the activities related
to computing The need for faster solutions and for solving larger-size problemsarises in a wide variety of applications
Three main factors have contributed to the current strong trend in favor of parallelprocessing (see [12]) First, the hardware cost has been falling steadily; hence, it isnow possible to build systems with many processors at a reasonable cost Second, thevery large scale integration circuit technology has advanced to the point where it ispossible to design complex systems requiring millions of transistors on a single chip.Third, the fastest cycle time of a von Neumann-type processor seems to be approachingfundamental physical limitations beyond which no improvement is possible; in addi-tion, as higher performance is squeezed out of a sequential processor, the associated
Trang 6cost increases dramatically All these factors have pushed researchers into exploringparallelism and its potential use in important applications.
A parallel computer is simply a collection of processors, typically of the sametype, interconnected in a certain fashion to allow the coordination of their activitiesand the exchange of data (see [12]) The processors are assumed to be located within
a small distance of one another, and are primarily used to solve a given problemjointly Contrast such computers with distributed systems, where a set of possiblymany different types of processors are distributed over a large geographic area, andwhere the primary goals are to use the available distributed resources, and to collectinformation and transmit it over a network connecting the various processors
Parallel computers can be classified according to a variety of architectural featuresand modes of operations In particular, these criteria include the type and the number
of processors, the interconnections among the processors and the corresponding munication schemes, the overall control and synchronization, and the input/outputoperations
com-In order to solve a problem efficiently on a parallel machine, it is usually necessary
to design an algorithm that specifies multiple operations on each step, i.e., a lel algorithm This algorithm can be executed a piece at a time on many differentprocessors, and then put back together at the end to get the correct result As an ex-ample, consider the problem of computing the sum of a sequence A of n numbers Thestandard algorithm computes the sum by making a single pass through the sequence,keeping a running sum of the numbers seen so far It is not difficult, however, to devise
paral-an algorithm for computing the sum that performs mparal-any operations in parallel Forexample, suppose that, in parallel, each element of A with an even index is pairedand summed with the next element of A, which has an odd index, i.e., A[0] is pairedand with A[1], A[2] with A[3], and so on The result is a sequence of dn/2e numbersthat sum to the same value as the same that we wish to compute This pairing andsumming step can be repeated until, after dlog2ne steps, a sequence consisting of asingle value is produced, and this value is equal to the final sum
As in sequential algorithm design, in parallel algorithm design there are many eral techniques that can be used across a variety of problem areas, including paralleldivide-and-conquer, randomization, and parallel pointer manipulation, etc The divide-and-conquer strategy is to split the problem to be solved into subproblems that areeasier to solve than the original problem solves the subproblems, and merges thesolutions to the subproblems to construct a solution to the original problem
gen-Throughout this thesis, our main goal is to present a parallel algorithm based on
Trang 7a divide-and-conquer strategy for computing the n−dimensional Delaunay tessellation
of a set of m distinct points in En (see [12])
In En, a Delaunay tessellation (i.e Delaunay triangulation in the plane) a long withits dual, the Voronoi diagram, is an important problem in many domains, includingpattern recognition, terrain modeling, and mesh generation for the solution of partialdifferential equations In many of these domains the tessellation is a bottleneck in theoverall computation, making it important to develop fast algorithms As a result, thereare many sequential algorithms available for Delaunay tessellation, along with efficientimplementations (see [14, 16]) Among others, Aurenhammer et al.’ method based
on a beautiful connection between Delaunay tessellation and convex hull in one higherdimension (see [7, 9, 11]) Since these sequential algorithms are time and memoryintensive, parallel implementation are important both for improved performance and
to allow the solution of problems that are too large for sequential machines However,although several parallel algorithms for Delaunay triangulation have been presented(see [1]), practical implementations have been slower to appear (see [6, 8, 10, 13]).For the convex hull problem in 2D and 3D, we find the convex hull boundary inthe domain formed by a rectangular (or rectangular parallelepiped) Then the domain
is restricted to a smaller domain, namely, restricted area to a simple detection ratherthan a complete computation (see [2, 3, 5])
In this thesis, we present a parallel algorithm based on divide-and-conquer strategy
At each process of parallel algorithm, the Aurenhammer et al.’s method (the
lift-up to the paraboloid of revolution) is used The convexity in the plane as a crucialfactor of efficience of the new parallel algorithm over corresponding sequential algorithm
is shown In particular, a restricted area obtained from a paraboloid given in [8]
is used to discard non-Delaunay edges (Proposition 3.4) Some advantages of theparallel algorithm are shown Its implementation in plane is executed easily on PCclusters (Section 3.3) Compare with a previous work, the resulting implementationsignificantly achieves better speedups over corresponding sequential code given in [15](Table 1)
This thesis has 3 chapters and one appendix:
Chapter I Delaunay Tessellation and Convex hull We deals with basis geometricpreliminaries, Delaunay tessellation notion and some properties of Delaunay tes-sellation This chapter shows a beautiful connection between Delaunay tessellationand convex hulls in one higher dimension
Chapter II Graham’s Algorithm Chapter II is concerned with Graham’s scan to
Trang 8compute convex hull of a set of points in plane.
Chapter III Algorithms for Computing Delaunay Tessellation In this chapter, wecome into contact with algorithms for computing Delaunay tessellation The pro-gram language uses in this thesis is C
Appendix Introduction to MPI Library This guide is designed to give a brief overview
of some of the basis and important routines of MPI Library
Trang 9by its two extreme points, the plane containing three given points, the polygon defined
by an (ordered) sequence or points, etc
This section has no pretence of providing formal definitions of the geometric conceptsused in this paper; it has just the objectives of refreshing notions that are certainlyknown to the reader and of introducing the adopted notation
By Edwe denote the d−dimensional Euclidean space, i.e., the space of the d−tuples(x1, , xd) of real numbers xi, i = 1, , d with metric (Pdi=1x2i)1/2 We shall nowreview the definition of the principal objects considered by Computational Geometry.Point: A d−tuple (x1, , xd) denotes a point p of Ed; this point may be alsointerpreted as a d−component vector applied to the origin of Ed, whose free terminus
is the point p
Line: Given two distinct points q1 and q2 in Ed, the linear combination
αq1+ (1 − α)q2 (α ∈ R)
is a line in Ed
Line segment: Given two distinct points q1 and q2 in Ed, if in the expression
αq1+ (1 − α)q2 we add the condition 06α61, we obtain the convex combination of
Trang 10q1 and q2, i.e.,
αq1+ (1 − α)q2 (α ∈ R, 06α61)This convex combination describes the straight line segment joining the two points q1
and q2 Normally this segment is denoted as q1q2 (unordered pair)
Convex set: A domain D in Ed in convex if, for any two points q1 and q2 in D,the segment q1q2 is entirely contained in D
In formula form, we the following definition:
Definition 1.1 Given k distinct points p1, p2, , pk in Ed, the set of points
p = α1p1+ α2p2+ · · · + αkpk (αj ∈ R, αj >0, α1+ α2+ · · · + αk = 1)
is the convex set generated by p1, p2, , pk, and p is a convex combination of p1, p2, , pk
Figure 1.1 a) Convex set, b) nonconvex set
It should be clear from Fig.1.1 that any region with a ”dent” is not convex, sincetwo points stradding the dents can be found such that the segment they determinecontains points exterior to the region
Convex hull: The convex hull of a set of points S in Ed is the boundary of thesmallest convex domain in Ed containing S In mathematics literature, the convex hull
of set S by CH(S) (see Fig.1.2)
Figure 1.2 Convex hull of finite set
Trang 11Extreme points: The extreme points of a set S of points in the plane are thevertices of the convex hull at which the interior angle is strictly convex, less than π.Thus we only want to count ”real” vertices as extreme: Points in the interior of asegment of the hull are not considered extreme.
Extreme edges: An edge is extreme if every point of S is on or to one side ofthe line determined by the edge It seems easiest to detect this by treating the edge
as directed, and specifing one of the two possible directions as determining the ”side”.Let the left side of a directed edge be the inside Phrased negatively, a directed edge
is not extreme if there is some point that is not left of it or on it
Polygon: in E2 a polygon is defined by a finit set of segments such that everysegment extreme is shared be exactly two edges and no subset of edges has the sameproperty The segments are the edges and their extremes are the vertices of the polygon(note that the number of vertices and edges are identical) (see Fig.1.3)
Figure 1.3 Polygon
A polygon is simple if there is no pair of nonconsecutive edges sharing a point Asimple polygon partitions the plane into two disjoint regions, the interior (bounded)and the exterior (unbounded) that are separated by the polygon (Jordan curve theo-rem[15] ) (This strikes most as so obvious as not to require a proof, but in fact theprecise proof is quite difficult, we shall take it as given) In common parlance, the termpolygon is frequently used to denote the union of the boundary and of the interior Asimple polygon P is convex if its interior is a convex set
A simple polygon is star-shaped if there exists a point z not external to P such thatfor all points p of P the line segment zp lies entirely within P (Thus, each convexpolygon is also star-shaped.)
Polyhedron: In E3 a polyhedron is defined by a finite set of plane polygons suchthat every edge of a polygon is shared be exactly one other polygon (adjacent polygons)and no subset of polygons has the same property The vertices and the edges of thepolygons are the vertices and the edges of the polyhedron; the polygons are the facets
of the polyhedron (see Fig.1.4)
A polyhedron is simple if there is no pair of nonadjacent facets sharing a point Asimple polyhedron partitions the space into two disjoint domains, the interior (bounded)
Trang 12Figure 1.4 Polyhedron
and the exterior (unbounded) Again, in common parlance the term polyhedron isfrequently used to denote the union of the boundary and of the interior A simplepolyhedron is convex if its interior is a convex set
Faces: The boundary of a polyhedron in R3 consists of polygons, which are calledfaces Generally, the boundary of a polyhedron in Rnconsists of polyhedrons in Rn−1,which are called (n − 1)-faces; the boundary of an (n − 1)-faces consists on polyhedrons
in Rn−2, which are called (m − 2)-faces; and so on Note that 0-faces are vertices, and1-faces are edges, and that (m − 1)-faces are sometimes called facets
1.2 Delaunay Tessellation
1.2.1 Definition of Delaunay Tessellation
Assumption D1 (the non-collinearity assumption) For a given set P = p1, , pn
of points, the points in P are not on the same line
Note that the non-linearity assumption implicitly implies n >3, because two pointsare always on the same line
Definition 1.2 Tessellation: Let S be a closed subset of Rm, Si be a closed subset
of S and ϕ = {S1, , Sn} (when we deal with an infinite n, we assume that onlyfinitely many Si hit a bounded subset of Rm) If elelments in the set ϕ satisfy
[Si\∂Si] ∩ [Sj\∂Sj] =∅, i 6= j, i, j ∈ In (1.1)and
[n
then we call the set ϕ a tessellation of S Specially, we call a tessellation in R2 aplanar tessellation of S
Figure 1.5 shows two planar tessellations
Definition 1.3 Delaunay tessellation: Let P = {p1, p2, , pm} ⊂ En (3 6
m 6 ∞) and pi 6= pj for i 6= j, i, j ∈ Im := {1, 2, , m} that satisfies the
Trang 13non-Figure 1.5 Tessellation: (a) a tessellation that is not a triangulation; (b) a triangulation
collinearity assumption (D1) Let Ti be the n−dimensional convex hull spanning erators pi1, pi2, , piki
gen-Ti = {x|x =Xki
j=1λjpij, where Xki
j=1λj = 1, λj > 0, j ∈ Iki} (1.3)Let D(P ) = {T1, T2, , Tmv} be a tessellation If ki= n + 1 for all i ∈ Imv, the setD(P ) = {T1, T2, , Tmv} consists of n−dimensional simplicies We call the set D(P )the n − dimensional Delaunay tessellation of the convex hull CH(P ) spanning P if nopoint in P is inside the circum-hypersphere of any simplex in D(P ) (see Fig.1.6)
Figure 1.6 Delaunay tessellation
If there exists at least one ki > 2, we partition Ti having ki > 2 into ki − nsimplices by non-intersecting hyperplanes passing through the vertices of Ti Let
Ti1, Ti2, , Tiki−n be the resulting simplices (Tiki−n = Ti1 = Ti for ki = n + 1), andD(P ) = {T11, , T1k1−n, , Tmvkmv−n} We call the set D(P ) the n − dimensionalDelaunay tessellation of the convex hull CH(P ) spanning P , and a simplex in D(P ) is
Trang 14an n−dimensional Delaunay simplex It should be noted that the problem of dealingwith degeneracies of P such as points with coincident xi coordinates, collinear andcoplanar points have not been entirelyly solved in this thesis.
A two-dimensional Delaunay tessellation is called a Delaunay triangulation and anedge of a Delaunay triangulation is called a Delaunay edge (see Fig.1.6) A three-dimensional Delaunay tessellation is called a Delaunay tetrahedrization Fig.1.7 shows
a stereo-graphic view of a Delaunay tetrahedrization
Figure 1.7 Delaunay tetrahedrization
1.2.2 Properties of Delaunay Tessellation
Having defined a Delaunay tessellation in Section 1.2.1, we now wish to observetheir geometric properties We deal mainly with the properties of a planar Delaunaytriangle, but some of them may be readily extended to an n−dimensional Delaunaytessellation
Property D1 The set Tidefined by equation (1.1) is a unique non-empty polygon, andthe set D(P ) = {T1, , Tmv} given by equation (1.3) satisfies
[m v
i=1Ti= CH(P )[Si\∂Si] ∩ [Sj\∂Sj] =∅, i 6= j, i, j ∈ ImvThis is obvious from the definition
Property D2 The external Delaunay edges in D(P ) constitute the boundary of theconvex hull of P Thus the Delaunay triangulation spanning P is a triangulation ofCH(P ) spanning P Since CH(P ) is bounded, all Delaunay triangles and Delaunayedges are finite
Trang 15Property D3 All circumcircles of Delaunay triangles are empty circles Note that thecircumcircle of a Delaunay triangle is sometimes called a Delaunay circle The notion
of Delaunay circle can be extended in R3, and we call the circumsphere of a Delaunaytetrahedron a Delaunay sphere
Property D4 (non-cocircularity assumption): If there are 4 points of P on thesame circle then the Delaunay triangle is not unique (see Fig.1.8) This assumptioncan be extended to assumption in Rn if we replace a circle with a hypershere and 4with n + 2 In this case we may call the assumption the non-cosphericity assumption
Figure 1.8 Two Delaunay triangulations.
Property D5 For the Delaunay triangulation D(P ) spanning a finite set P of distinctpoints, which satisfies the non-cocircularity assumption, let ne be the number of De-launay edges, nt be the number of the triangles in D(P ) and nv be the number of thevertices on the boundary on CH(P ) The following equations hold:
Proof First since the Delaunay graph is a planar graph, Euler’s formula for planargraphs holds, i.e n - ne + (nt+ 1) = 2 Second, since every internal edge is shared bytwo Delaunay triangles and every external edge belongs to only one Delaunay triangle,the number of Delaunay edges is given by
ne = (3nt+ nv)/2Upon substituting this into n - ne + (nt+ 1) = 2, we have the property D5
For the non-degenerate Delaunay tetrahedrization spanning a finite set P of ndistinct points, the Euler-Poincar´e equation, n0 − n1 + n2 − n3 = 1 holds, where
Trang 16n0, n1, n2, n3are the number of vertices, edges, triangular faces, and tetrahedra, tively Since the vertices are points in P , we have n0 = n Sine every tetrahedron isbounded by four triangular faces and every triangular face bounds at most two tetrahe-dra, we have 2n36 n2 Substituting this relation and n0 = n into n0−n1+n2−n3 = 1,
respec-we obtain the following property
Property D6 For the Delaunay tetrahedrization D(P ) spanning a finite set P of ndistinct points satisfying the non-cosphericity assumption, the following relations hold:
For a given finite set P if distinct points we have many possible triangulations
of CH(P ) spanning P In some applications we want to choose a triangulation inwhich triangles are as closely equiangular as possible One of the criteria is to choose
a triangulation in which the minimum angle in each triangle is as large as possible
To state this criterion more explicitly, let us consider an internal edge pi1pi2 in atriangulation T , and let 4pi1pi2pi3 and 4pi1pi2pi4 be triangles sharing the edge pi1pi2(Fig1.9 (a), (b)) The quadrangle pi1pi2pi3pi4 may non-convex (Fig.1.9 (a)), or convex(Fig.1.9(b)) If it is convex and it does not degenerate into a triangle (pi1is on pi3pi4or
pi2is on pi3pi4), we have another possible triangulation, i.e 4pi1pi3pi4 and 4pi2pi3pi4(Fig1.9(c)) We are concerned with which triangulation is locally better (’locally’ in thesense that a triangulation is made in a local area, i.e the quadrangle pi1pi2pi3pi4) Inthe triangulation in panel (b), the minimum angles among the six angles in 4pi1pi2pi3and 4pi1pi2pi4is∠pi2pi1pi3= α∗i In the triangulation in panel (c), the minimum angleamong the six angles in 4pi1pi3pi4 and 4pi2pi3pi4 is ∠pi2pi4pi3 = βi∗ Comparing α∗iand βi∗, we notice that α∗i > βi∗ or α = max{α∗i, βi∗} We may thus conclude that thetriangulation in panel (b) is locally better than that in panel (c) because the minimumangle is maximized in the triangulation in panel (b) This criterion may be writtengenerally as follows
The local max-min angle criterion: For a triangulation T of CH(P ) spanning P , let
pi1pi2 be an internal edge in CH(P ), and 4pi1pi2pi3 and 4pi1pi2pi4 be two trianglessharing the edge pi1pi2 For the convex quadrangle pi1pi2pi3pi4 which does not degen-erate into a triangle, let αij, j ∈ I6, be the six angles in 4pi1pi2pi3 and 4pi1pi2pi4; and
βij, j ∈ I6, be the six angles in 4pi1pi3pi4and 4pi2pi3pi4 If the quadrangle pi1pi2pi3pi4
Trang 17Figure 1.9 The local max-min angle criterion.
in non-convex or it degenerates into a triangle, or if it is a convex quadrangle whichdoes not degenerate into a triangle and the relation
min
j {αij, j ∈ I6}> min
holds, then we say that the edge pi1pi2 satisfies the local max-min angle criterion
In Fig.1.9 the edge pi1pi2 in panels (a) and (b) satisfies the local max-min anglecriterion, but the edge pi3pi4 in panels (c) does not
At first glance the practical operation in equation (1.8) (measuring angles and ing the minimum angles among them) appears a little complicated In practice, we donot carry out such an operation but use the following relation
find-Let α∗i = minj{αij, j ∈ I6}, and suppose, without loss of generality, that α∗i isone of the angles of 4pi1pi2pi3 Let Ci be the circumcircles of 4pi1pi2pi3; H be theopen half plane made by the line containing pi1pi2 that does not contain 4pi1pi2pi3;and B be the region indicated by the shaded region indicated by the shaded region(including the boundary) in Fig.1.10 (a) Obviously, Pi4 is in B The quadrangle
pi1pi2pi3pi4 may be convex or non-convex If pi4 is in B, the quadrangle pi1pi2pi3pi4 isnon-convex or it degenerates into a triangle (4pi4pi2pi3) The quadrangles pi1pi2pi3pi4
is a convex quadrangle which does not degenerate into a triangle if pi4 ∈ H\B Nowsuppose that pi4 is in H\[B∪CH(Ci)] and the minimum angle α∗i is either ∠pi3pi1pi2(Fig.1.10 (a)) or ∠pi3pi2pi1 Let 4pi1pi3pi4 and 4pi2pi3pi4 be triangles constitutinganother triangulation of the quadrangle pi1pi2pi3pi4, and βij, j ∈ I6, be angles of thosetriangles indicated in Fig.1.10 (b) Using the theorem of equiangles on a circle (seethe two αi∗’s in Fig.1.10 (a)) , we notice that α∗i = minj{αij, j ∈ I6} = αi1(or αi3) >
βi5(or βi6) > minj{βij, j ∈ I6} = βi∗ If the minimum angle α∗i is ∠pi1pi3pi2 as inFig.1.10 (c), α∗i = minj{αij, j ∈ I6} = αi2 > βi2 > minj{βij, j ∈ I6} = βi∗ Thereforethe edge pi1pi2 satifies the local max-min angle criterion Almost in the same manner,
we can show that if pi4 ∈ H ∩ Ci, then α∗i = βi∗ holds, and if pi4 ∈ H ∩ [CH(Ci)\Ci],
Trang 18then α∗i < βi∗ holds Therefore we obtain the following relations:
min
j {αij, j ∈ I6} < min
j {βij, j ∈ I6} if pi4 is inside Ci, (1.9)min
j {αij, j ∈ I6} = min
j {βij, j ∈ I6} if pi4 is on Ci, (1.10)min
j {αij, j ∈ I6} > min
j {βij, j ∈ I6} if pi4 is outside Ci (1.11)
Figure 1.10 Conditions for the local max-min angle criterion.
Using relation (1.11), we can prove the following property
Property D7 (the local max-min angle theorem) Let P = {p1, p2, , pm} ⊂ E2 (3 ≤
m ≤ ∞) be a finite set of distinct points satisfying the non-cocircularity assumption,and T be a triangulation of CH(P ) spanning P Every internal edge in T (P ) satisfiesthe local max-min criterion if and only if T (P ) is the Delaunay triangulation spanning
P
Proof From relation (1.11) it is obvious that if T (P ) is D(P ), every internal edgesatisfies the local max-min criterion, because if the circumcircle of 4pi1pi2pi3 is anempty circle, pi4 is outside of the circumcircle We shall prove that if every internaledge in T (P ) satisfies the local max-min angle criterion, T (P ) is D(P ) Since theedge pi1pi2 satisfies the local max-min angle criterion, pi4 is outside Ci What is left
to prove is that all other vertices of the triangles are outside Ci (Fig.1.11) Since the
Trang 19Figure 1.11 Illustration of the proof of Property D7.
edges pi2pi4 and pi1pi4 satisfy the local max-min angle criterion, there are no points
in the horizontally and vertically hatched regions in Fig.1.11 Similarly, since theedges pi1pi3 and pi2pi3 satisfy the local max-min angle criterion, there are no points
in the diagonally hatched regions Obviously there are no points in 4pi1pi2pi3 and4pi1pi2pi4 Therefore there are no points in the circumcircle of 4pi1pi2pi3 Applyingthe same procedure to every triangle, we can prove that every circumcircle is an emptycircle By definition of Delaunay tessellation, we see that the triangulation spanning
1.3 Delaunay Tessellation and Connection to Convex Hull
In 1986, Edelsbrunner and Seidel discovered a beautiful connection between nay tessellation and convex hulls in one higher dimension (see [11]) This connectionwill then give us an easy method for computing the Delaunay tessellation
Delau-Let P = {p1, p2, , pm} ⊂ En We construct a transformation from a point in En
to En+1, which is illustrated in see Fig.1.12 Let pi be a point in En with coordinate(xi1, xi2, , xin) We lift this point up by height x2i1 + x2i2+ · · · +x2in, and denotethe lift-up points by p∗i The set P∗ = {p∗1, p∗2, , p∗m} of points in En+1 representsthe paraboloid of revolution along the xn+1-axis Thus the above transformation is
to lift a point pi in En up to point in En+1 We call this transformation the lift-uptransformation
Trang 20Definition 1.4 Let α has equation a1x1 + a2x2+ · · · + anxn + a0 = 0 (ai ∈ R) be
a hyperplane in En Suppose M(xm0, xm1, , xmn) is a point in En and suppose thatM’(xm0, xm1, , xm(n−1), z) is a point in α then:
The point M is in the hyperplane α if xmn= z
The point M is above the hyperplane α if xmn > z
The point M is below the hyperplane α if xmn < z
Remark: In E3, let −n→
α(a,b,c) be a normal vector of a plane α and c < 0 LetM(x0, y0, z0) be a point in E3 and let M’(x0, y0, m) be the projected point of M into αthen M is in or above the plane α if and only if −n→
−→
nα−−−→
M0M 60Hence,
c(z0− m) 60Hence,
z0 >mTherefore, by definition, we have the remark above
Let P∗ be the lift-up of P = {p1, p2, , pm} (where pi ∈ En) and CH(P∗) be theconvex hull of P∗ The boundary of the convex hull CH(P∗) consists of polyhedrons
in En, which are called n−faces A n−face of CH(P∗) is called a lower n-face if allpoints of P∗ are on or above the hyperplane passing this face The surface formed byall the lower n−face of CH(P∗) is called the lower boundary of CH(P∗) (see [14, 16]).Theorem 1.1 (see [9, 14]) The Delaunay tessellation of a set of points in En isprecisely the projection to En of the lower n-faces of the convex hull of the transformedpoints in En+1 , transformed by mapping upwards to the paraboloid xn+1= x21+ x22+
· · · + x2
n
Proof We will first prove the case Delaunay tessellation in E2 Let P∗ be the lift-up
of P = {p1, , pn} (where pi ∈ E2) and CH(P∗) be the convex hull of P∗ in E3 Afacet of CH(P∗) is a 2-dimension plane
Trang 21Figure 1.12 The Delaunay tessellation of P in E of the lower n-face of CH(P )
Suppose without loss of generality that three points pi, pj, pk are placed on the x − yplane so that the cycle pi, pj, pk, pi has a counterclockwise direction when it is viewedfrom a point far above the x − y plane Let
H(pi, pj, pk; p) =
Then the circle passing through pi, pj, pk is represented by H(pi, pj, pk; p) = 0, andthat this circle is an empty circle if and only if H(pi, pj, pk; pl) > 0 for any point
pl ∈ P \{pi, pj, pk} In this connection, recall that the the three points pi, pj, pk form
a Delaunay triangle if and only in the circle passing through these points in an emptycircle by definition
H(pi, pj, pk; p) gives another implication The value of H(pi, pj, pk; p)/6 can beinterpreted as the signed volume of the tetrahedron with vertices pi, pj, pk, p Since
we choose pi, pj, pk so that the cycle pi, pj, pk, pi has a counterclockwise direction, thevolume of the tetrahedron is positive if and only if p∗l is above the plane containing
p∗i, p∗j, p∗k This means that pi, pj and pk form a Delaunay triangle if and only if p∗i, p∗jand p∗k give a facet of the lower boundary of CH(P∗) Thus we obtain the theorem
In the case En = E3, we do the similar thing Four noncoplanar points pi, pj, pkand pl define an oriented sphere and point p lies inside, on or outside of the sphere
Trang 22depending on whether the sign of
H(pi, pj, pk, pl; p) =
is negative, zero, or positive The determinant H(pi, pj, pk, pl; p) give the volume of
a parallelepiped in E4 Thus Delaunay triangulation in three dimensions can be structed from a convex hull in four dimensions In fact, it may be that the mostcommon use of 4D hull code if for constructing solid meshes of Delaunay tetrahedra
con-In general, the Delaunay tessellation for a set of n−dimensinal points is the projection
of the lower hull of points is d + 1 dimensions
Many algorithms for computing Delaunay triangulations rely on fast operations fordectecting when a point is within a triangle’s cirumcircle and an efficient data structurefor storing triangles and edges
Flip algorithms: If a triangle is non-Delaunay, we csan flip one of its edges Thislead to a straightforward algorithm: construct any triangulation of the points,and then flip edges until no triangle is non-Delaunay Unfortunately, this can takeO(n2) edges flips, and does not extend to three dimensions or higher
Incremental: The most straightforward way of efficiently computing the Delaunaytriangulation is to repeatedly add one vertex at a time, retriangulating the affectedparts of the graph When a vertex v is added, we split in three the triangle thatconstrains v, then we apply the flip algorithm This will take O(n) time: we searchthrough all the triangles to find the one that contains v, then we potentially flipaway every triangle Then the overal runtime is O(n2)
Divide and conquer In this algorithm, one recursively draws a line to split the tices into two sets The Delaunay triangulation is computed for each set, and thenthe two sets are merged along the splitting line Using some clever tricks, the mergeoperation can be done in time O(n), so the total running time is O(n log n)
ver-In this thesis, we present a parallel algorithm based on computing the convex hull
of one higher dimension for computing the Delaunay tessellation Graham algorithm isonly apply for computing convex hull of a set of points in plane and cannot extend tothe 3-dimension case But we show that, we can apply Graham algorithm in computingDelaunay triangulations of a set of points in plane, i.e., we have to find convex hull in3-dimension
Trang 23Chapter 2
Graham’s Algorithm
In computational geometry, numerous algorithms are proposed for computing theconvex hull for a finite set of points and for other geometric objects with variouscomputational complexities (see [15]) Known convex hull algorithms are listed below,time complexity of each algorithm is stated in terms of inputs poins n and the number
of points on the hull h
1 Gift wrapping algorithm: One of the simplest (although not the most time efficient
in the worst case) palar algorithm Discovered independently by Chand and Kapur
in 1970 and R A Javis in 1973 It has O(nh) time complexity, where n is thenumber of points in the set, and h is the number of points in the hull In worstcase the complexity is O(n2)
2 Graham scan: A slightly more sophisticated, but much more efficient algorithm,published by Ronald Graham in 1972 If the points are already sorted by one
of the coordinates or by the angle to a fixed vector, then the algorithm takesO(n) time In worst case the complexity is O(n log n) We’ll go in detail for thisalgorithm
3 Quick hull: Discovered independently in 1977 by W Eddy and in 1978 by A.Bykat Just like the quicksort algorithm, (see [18]) it has the expected complexity
of O(n log n), but may degenerate to O(n2) in the worst case
4 Divide and conquer: Another O(n log n) algorithm, published in 1977 by Preparataand Hong This algorithm is also applicable to the three dimensional case
5 Incremental Algorithm: Published in 1984 by Michael Kallay Time complexity
is O(n log n)
6 Chan’s algorithm: A simpler optimal output-sensitive algorithm discovered byChan in 1996 Time complexity is O(n log n)
Trang 24Perhaps the honor of the first paper published in the field of computational etry should be accorded to Graham’s algorithm for finding the hull of points in twodimensions in O(n log n) time (Graham 1972) In the late 1960s an application atBell Laboratories required the hull of n ≈ 10, 000 points, and they found the O(n2)algorithm in use too slow Graham developed his simple algorithm in response to thisneed.
geom-2.1 Pseudocode, Version A
Before proceeding to a more careful presentation, we summarize the rough algorithm
in pseudocode in Algorithm 1 We use stack data structure to maintain the points ofthe convex hull We assume stack primitives P ush(p, S) and P op(S), which push ponto the top of the stack S, and pop the top off, respectively (see [17]) We use t
to index the stack top and i for angularly sorted points Many issues remain to beexamined (start and termination in particular), but at this coarse level, it should beapparent that the while loop iterates O(n) times: Each stack pop permanently removesone point, so the number of backups cannot exceed n Together with n forward steps,the loop iterates at most 2n times So the algorithm runs in linear time after thesorting step, which takes O(n log n) time
Algorithm 1 Graham scan, version A
1: Find interior point x; label it p0.
2: Sort all other points angularly about x; label p1, , pn−1.
3: Stack S = (p2, p1) = (pt, pt−1); t indexes top.
2.1.1 Start and Stop of Loop
Even a simple loop can be difficult to start and stop properly: The algorithm sofar presented might have trouble at either end We already mentioned the terminationdifficulties that would arise if a, the stack bottom, were not on the hull Startupdifficulties occur when b, the second point pushed on stack, is not on the hull Forsuppose that (a, b, c) is a right turn Then b would be popped from the stack, and thestack reduced to S = (a) But at least two points are needed to determine if a thirdforms a left turn with the stack top
Trang 25Clearly both startup and stopping problems are avoided if both a and b are on thehull How this can be arranged will be shown in the next subsection.
2.1.2 Sorting Origin
A simplification is to sort with respect to a point of the set, and in particular, withrespect to a point on the hull We shall use the lowest point, which is clearly on thehull In case there are several with the same minimum y coordinate, we will use therightmost of the lowest as the sorting origin This is point 0 in Fig.2.1 Now thesorting appears as in Fig.2.1 Note all points in the figure have been relabeled withnumbers; this is how they will be indexed in the implementation We will call thepoints p0, p1, , pn−1, with p0 the sorting origin and pn−1 the most counterclockwisepoint
Figure 2.1 Sorting points
Now we are prepared to solve the startup and termination problems discussed above
If we sort points with respect to their counterclockwise angle from the horizontal rayemanating from our sorting origin p0, then p1 must be on the hull, as it forms anextreme angle with p0 However, it may not be an extreme points, an issue we shalladdress below If we initialize the stack to S = (p0, p1), the stack will always contain
at least two points, avoiding startup difficulties, and will never be consumed when thechain wraps around to p0 again, avoiding termination difficulties
Trang 262.1.3 Collinearities
The final ”boundary condition” we consider is the possibility that three or morepoints are collinear, until now a situation conveniently assumed not to occur Thisissue affects several aspects of the algorihm First we focus on defining precisely what
we seek as output
Hull Collinearities. We insist here on the most useful output: the extreme verticesonly, ordered around the hull Thus if the input consists of the corners of a square,together with points sprinkled around its boundary, the output should consist of justthe four corners of the square Avoiding nonextreme hull points is easily achieved byrequiring a strict left turn (pt−1, pt, pi) to push pi onto the stack, where pt and pt−1are the top two points on the stack Then if pt is collinear with pt−1 and pt, it will bedeleted
Sorting Collinearities. Collinearities raise another issue: How should we break ties inthe angular sorting if both points a and b form the same angle with p0? One’s firstinclination is to assume (or hope) it does not matter, but alas the situation is moredelicate There are at least two points First, use a consistent sorting rule, and thenensure start and stop and hull collinearities are managed appropriately A reasonablerule is that if angle(a) < angle(b), then a < b, if angle(a) = angle(b), then define
a < b if |a − p0| < |b − p0|, where angle(pi) is the counterclockwise angle between p0pi
and the positive x axis (since, p0 is lowest, all these angles are in range ( 0, π ]) Closerpoints are treated as earliest in the sorting sequence With this rule we obtain thesorting indicated by the indices in the example shown in Fig.2.2 Note, however, that
p1 is not extreme in the firgure, which makes starting with S = (p1, p0) problematic.Although this can be circumvented by starting instead with S = (pn−1, p0) (note that
pn−1 = p18 is extreme), we choose here a second option It is based on this simpleobservation: If angle(a) = angle(b) and a < b according to the above sorting rule,then a is not an extreme point of the hull and may therefore be deleted In Fig.2.2,points p1, p5, p9, p12, and p17 may be deleted for this reason
Coincident Points. Often code that works on distinct points crashes for sets that mayinclude multiple case of a sorting collinearity, deleting all but one copy of each point
Trang 27Figure 2.2 Sorting points with collinearities
2.2 Pseudocode, Version B
Before proceeding with implementation details, we summarize the preceding sion with pseudocode in Algorithm 2 that incorporates the changes
discus-Algorithm 2 Graham scan, version B
1: Find rightmost lowest point; label it p 0
2: Sort all other points angularly about p 0
In case of tie, delete the point closer to p 0
(or all but one copu for multiple points).
3: Stack S = (p 2 , p 1 ) = (p t , p t−1 ); t indexes top.
of being finished Thus the loop stopping condition is indeed i < n
2.3 Implementation of Graham’s Algorithm
We now describe an implementation of Algorithm 2 We assume the input points aregiven with integer coordinate, and we insist upon avoiding all floating-point calculations
Trang 28so that a correct output can be guaranteed We start with data structures, then tacklethe sorting step, and finally present the code.
typedef struct tPointStructure tsPoint;
typedef tsPoint *tPoint;
typedef tsPoint tPointArray[PMAX];
static tPointArry P;
The stack is most naturally represented by s singly linked list of cells, each of which
”contains” a point (i.e., contains a pointer to a point record) With these definitions,the stack top can be declared as tStack top, and the element under the top is top →next See the following code:
typedef struct tStackCell tsStack;
typedef tsStack *tStack;
Trang 29pointer to the next cell Push(p,t) allocates new storage, fills it up with p, and makes
it the new stack top Note in PrintStack that t → p → v reaches the coordinates ofthe point: t is type tStack, p is type tPoint, v is type tPointi See code below:
void Findlowest (void)
{
int i;
int m = 0; /* Index of lowest so far */
Trang 30Avoiding Floats. The sorting step seems straightforward, but there are hidden pitfalls
if we want to guarantee an accurate sort First we introduce a bit of notation Let ri=
pi− p0, the vector from p0 to pi Our goal is to give a precise calculation to determinewhen pi < pj, where ” < ” represents the sorting relation
Left. The impatient reader will have realized long ago the solution is already in hand:Left, the function to determine whether a point is left of a line determined by twoother points, is precisely what we need to compare riand rj Recall that Left was itself
a simple test on the value of Area2, which computes the signed area of the triangledetermined by three points We will use this area function rather than Left, as it isthen easier to distinguish ties We will first discuss the overall sorting method beforeshowing how Area2 is employed for comparisons
Qsort. The standard C library includes a sorting routine qsort that is at least asgood as most programmers could develop on their own, and it makes sense to use it.Because it is general, however, it takes a bit of effort to set it up properly The routinerequires information on the shape and location of the data and a comparison function
to compare keys It then uses the provided comparison function to sort the data inplace, from smallest to largest Its four arguments are:
1 A pointer to the base of the data, in our case &P[1], the address of the first point.( Remember that P [0] is fixed as our lexicographic minimum.)
2 The number of elements to be sorted: n − 1
3 The width of a element in bytes: sizeof(tsPoint)
4 The name of the two-argument comparison routine: Compare
Compare. The routine qsort expects the comparison function to ”return an integerless than, equal to, or greater than 0 according as the first argument is to be consideredless than, equal to, or greater than the second.” Moreover, it will be called ”with two
Trang 31arguments which are pointers to the elements being compared” This latter requirementpresents a slight technical problem, because we need three inputs: p0, pi, and pj Oneway around this difficulty is to compute a separate array filled with the ri’s Here wechoose another solution: make P global, so that p0 can be referenced inside the body
of compare without passing it as a parameter
Finally we can specify the heart of compare: If pj is left of the directed line though
p0pi, then pi < pj In other word, pi < pj if Area2(p0, pi, pj) > 0, in which case qsortexpects a return of −1 to indicate ”less than”
When the area is zero , we fall into a sorting collinearity, which requires action
as discussed previously (Section 2.1.3) First we need to decide which point is closer
to p0 We can avoid computing the distance by noting that if pi is closer, then ri =
pj− p0 projects to a shorter length than does rj = pj− p0 The code computers theseprojections x and y and bases further decisions on them If pi is closer, mark it forlater deletion; if pj is closer, mark it instead If x = y = 0, then pi = pj and we markthe one with lower index for later deletion In all cases, one member of {−1, 0, +1} isreturned according to the angular sorting rule detail earlier
Having worked out the sorting details, let us move to the top level and discuss main.The points are read in, the rightmost lowest is swapped with P [0] in Findlowest, and
P [1], , P [n − 1] are sorted by angle with qsort The repeated call to Compare mark
a number of points for deletion by setting the Boolean delete field The next task is
to delete those points, which we accomplish with a simple routine Squash (Code 2.7).This maintains two indices i and j into the points array P , copying P [i] on top of P [j]for all undeleted points i After this the most problematic cases are gone, and we canproceed with the Graham scan, with the call top = Graham() See code below:
... triangle is non-Delaunay, we csan flip one of its edges Thislead to a straightforward algorithm: construct any triangulation of the points,and then flip edges until no triangle is non-Delaunay... dimension for computing the Delaunay tessellation Graham algorithm isonly apply for computing convex hull of a set of points in plane and cannot extend tothe 3-dimension case But we show that, we can... Delaunaytriangulation is to repeatedly add one vertex at a time, retriangulating the affectedparts of the graph When a vertex v is added, we split in three the triangle thatconstrains v, then we apply the