0% found this document useful (0 votes)
3 views

A Simple and fast

This paper introduces a simple incremental randomized algorithm for computing trapezoidal decompositions and triangulating polygons, achieving an expected running time of O(n log* n). The algorithm's performance is straightforward to analyze and does not rely on complex techniques, making it practical for implementation. By computing a trapezoidal decomposition, the algorithm facilitates efficient triangulation of simple polygons, demonstrating its utility in computational geometry applications.

Uploaded by

hustlechenxing
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

A Simple and fast

This paper introduces a simple incremental randomized algorithm for computing trapezoidal decompositions and triangulating polygons, achieving an expected running time of O(n log* n). The algorithm's performance is straightforward to analyze and does not rely on complex techniques, making it practical for implementation. By computing a trapezoidal decomposition, the algorithm facilitates efficient triangulation of simple polygons, demonstrating its utility in computational geometry applications.

Uploaded by

hustlechenxing
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

$1

Computational Geometry: Theory and Applications 1 (1991) 51-64


Elsevier

A simple and fast incremental


randomized algorithm for
computing trapezoidal
decompositions and for
triangulating polygons
Raimund Seidel*: **
, CA 94720, USA
Computer Science Division, University of California Berkeley, Berkeley

Communicated by Kenneth Clarkson


Submitted 28 September 1990
Accepted 8 March 1991

Abstract
trapezoidal
Seidel, R., A simple and fast incremental randomized algorithm for computing
triangulatin g polygons, Computatio nal Geometry: Theory and Appli-
decompositions and for
cations | (1991) 51-64.
the
This paper presents a very simple incremental randomized algorithm for computing
If 5S is given as a
trapezoidal decomposition induced by a set S of 2 line segments in the plane.
7). This leads to
simple polygonal chain the expected running time of the algorithm is O(” log*
More generally, if S is
a simple algorithm of the same complexity for triangulating polygons.
graph with k connected components , then the expected running time of
presented as a plane
structure
the algorithm is O(n log* n + k logn). Asa by-product our algorithm creates a search
size that allows point location queries in the resulting trapezoidat ion in
of expected linear
time. The analysis of the expected performance is elementary and
logarithmic expected
and
straightforward. All expectations are with respect to ‘coinflips’ generated by the algorithm
are not based on assumptions about the geometric distribution of the input.

1. Introduction

Polygon triangulation has been a problem of great appeal to computational


of a
geometers: It can be easily stated as “given the coordinates of the n vertices
P into
simple polygon P in order around P, find n —3 diagonals that partition
visited the Free
* Large Portions of the research reported here were conducted while the author
University Berlin.
grant CCR-8809040 and Presidential Young Investigator Award CCR-
** Supported by NSF
9058440.

0925-7721/91/$03.50 © 1991 — Elsevier Science Publishers B.V.


52 R. Seidel

n—2 triangles;” it is of importance in various application areas; and finally, the


actual computational complexity of the problem remained unresolved for more
than a decade until very recently. _
A brief history: Garey et al. [7] were the first to publish an O(n logn)
algorithm based on sweeping in 1978. Four years later another algorithm with the
same complexity was published by Chazelle [1]. The O(n logn) bound was then
improved to bounds of the form O(n log Cp), where Cp is a ‘shape’ parameter no
bigger than n that depends on the polygon P to be triangulated (for instance the
number of refiex vertices [6, 8], or the ‘sinuosity’ of P [3]). On a different front an
ever-increasing class of polygons were shown to be triangulatable in linear time
[12-13]. After a false start, Tarjan and Van Wyk [11] made’ a major breakthro-
ugh with an O(7 log log 7) algorithm in 1986. This time bound was matched by a
different but simpler algorithm by Kirkpatrick et al. [10] three years later. In the
mean time Clarkson et al. had published a randomized algorithm with
O(n log* n) expected running time [5]. Finally in 1990 Chazelle discovered a
linear time deterministic algorithm [2], which settles the question about the
intrinsic computational complexity of triangulating once and for all.
This paper presents another randomized algorithm with O(n log* n) expected
running time. Its virtues lie in its simplicity. It uses no divide-and-conquer or
recursion, and no ‘Jordan-sorting’ [5, 9]. Its expected performance admits a very
straightforward and self-contained analysis. Finally, it is practical and relatively
simple to implement, a property that very few, if any, of the algorithms
mentioned can claim.
Like most of its predecessors our algorithm does not triangulate a polygon P
directly, but rather it computes what is known as the ‘horizontal visibility map’ or
‘trapezoidal decomposition’ of P. By an observation of Fournier and Montuno [6]
it is easy to derive from such a decomposition of P in linear time a triangulation
of P.
Section 2 of this paper gives some basic definitions and facts about trapezoidal
decompositions and how they relate to triangulations. Section 3 describes the new
algorithm.

2. Trapezoidations

Our setting is the Euclidean plane with the usual Cartesian x-y coordinate
system. We will feel free to use intuitive notions such as ‘vertical’ (meaning
parallel to the y-axis), ‘horizontal,’ ‘left of,’ etc.
We call two straight line segments in the plane noncrossing iff their intersection
is either empty or a common endpoint. Consider a set S of n nonhorizontal,
noncrossing closed line segments. Starting at each endpoint of each segment in S
draw two horizontal rays, one towards the left and one towards the right, each
extending until it hits a segment of S. For a segment endpoint p we call the union
Trapezoidal decompositions and triangulating polygons 53

Fig. 1. A trapezoidation of 5 segments.

of these two possibly truncated rays emanating from p the horizontal extension
through p. The segments of S together with the horizontal extensions through the
endpoints form a plane graph, which we call the trapezoidation of S, or F(S) for
short (see Fig. 1). As each face of 7(S) has two horizontal sides (one of which
might have length 0) we are justified in calling the faces of F(S) trapezoids.
What is the complexity of 7(S)? If S consists of n segments, then there are at
most 2n segment endpoints. Through each endpoint there is a horizontal
extension whose endpoints in turn can contribute at most two vertices to F(S).
Thus 7(S) has at most 6n vertices, and since it is a planar graph it follows
_immediately that it has O{7) edges and faces. In particular, the number of faces
(trapezoids) is at most 3n +1, which can be easily established using a sweep
argument.
For our purposes it would be advantageous if each trapezoid of J (S) had at
most two ‘neighboring’ trapezoids above it and at most two neighboring
trapezoids below it. By this we mean that if a trapezoid has a nondegenerate
upper (lower) side, then this side should have non-empty intersection with the
lower (upper) sides of at most two other trapezoids. This condition holds
automatically if no two distinct endpoints of segments in S have the same
y-coordinate. From now on we will assume that S satisfies this ‘nondegeneracy’
assumption. As noted already in [5], no generality is lost with this assumption,
since it can always be achieved by rotating the coordinate system by a sufficiently
small amount. Better yet, this perturbative rotation can simply be simulated using
a lexicographic technique: if two distinct points have the same y-coordinate, then
the one with smaller x-coordinate is considered the ‘lower’ one (see Fig. 2).
We end this section by giving the connection between computing trapezoida-
tions and triangulating simple polygons. This connection was originally estab-
lished in [6] and [3]. We include it for the sake of completeness.
Let S = {so, 51, -- + ,S,-1} be a set of m segments that form a simple and closed
polygonal curve; i.e. s; and s;,, share a common endpoint, and 5,1s;,=9 iff
|i —j| > 1 (all index arithmetic here is modulo 1). This polygonal curve bounds a
34 R. Seidel

Fig. 2(a). A ‘degenerate’ trapezoidation.

simple polygon P with n vertices. Triangulating P amounts to finding a set of


n —3 noncrossing diagonals of P that partition P into n — 2 triangles.

Lemma 1. Let S = {50, 5), .. - Sn_1} be the set of edges around a simple polygon
P. If F(S) is available, then a triangulation of P can be computed in O(n) time.

Proof. (Sketch) Assume that no two vertices of P have the same y-coordinate.
As mentioned above, this assumption entails no loss of generality. We compute a
triangulation of P from a trapezoidation 7(S) in three stages:
First remove from consideration all trapezoids of Z(S) that do not lie in the
interior of P.
Second, for each of the remaining trapezoids check whether it has two vertices
of P on its boundary that do not lie on the same side. If such a pair of vertices

Fig. 2(b). Degeneracies removed by rotation of coordinate system (or lexicographic method).
Trapezoidal decompositions and triangulating polygons 55

Fig. 3. (a) Trapezoids inside the polygon; (b) Introducing diagonals; (c) Decomposition of polygon
into pieces that are easy to triangulate.

exists draw a diagonal between them.


The diagonals introduced in the second phase partition P into a number of
subpolygons, each of which has a very special form: its boundary consists of two
y-monotone chains, one of which is a single edge. A polygon of such a form can
easily be triangulated in linear time by repeatedly ‘cutting off convex corners of
the y-monotone chain (see Fig. 3). For more details see [6,3]. 0

3. The Algorithm

For the purposes of this section we assume a representation of the trapezoida-


tion 7(S) that allows for each trapezoid t € Z(S) to determine in constant time
the segments of S that bound T to its left and to its right (if any), the (up to two)
adjacent trapezoids of Z(S) above t, and the (up to two) adjacent trapezoids
56 R. Seidel

below t. Here we assume nondegeneracy in the sense outlined in the previous


section, namely that no two non-identical segment endpoints have the same
y-coordinate. Again this condition can easily be simulated using lexicographic
techniques. Our representation allows efficient navigation through (S$), i.e.
tracing a curve C through F(S) at cost proportional to the complexity of C plus
the number of trapezoid traversals, provided C crosses no segment of S. Note
that the size of such a representation is linear in the number of segments of S. Let
A(S) be a point location query structure for J(S), i.e. 2(S) is a directed acyclic
graph with one source and with exactly one sink for each trapezoid of F(S). Each
nonsink node has outdegree 2 and is labeled either X, in which case it has a
segment of S associated with it as a key, or the node is labeled Y, in which case
its associated key is a real number, namely the y-coordinate of an endpoint of
some segment in S (or in other words, the horizontal extension through the
endpoint). A query with query point q is supposed to proceed as follows: It starts
at the source of Q(S) and proceeds along a directed path to some sink whose
corresponding trapezoid of F(S) is to contain g. At each nonsink node along the
way the decision which of the two outedges to follow is dictated by the outcome
of the comparison of q with the key (At an X-node: Is q left or right of the key

T({s1,52})

Q({s1, s2})

[_]...¥-node
C7)... x-nede
O .. sink
Fig. 4. A trapezoidation and an associated query structure.
Trapezoidal decompositions and triangulating polygons 57

Does
segment? At a Y-node: Is q’s y-coordinate less or greater than the key? or:
q lie below or above the horizontal extension?). We assume that the trapezoid s of
of 7(S)
J(S) and the sinks of 2(S) are properly correlated, i.e. for a trapezoid
(see
one can tell in constant time its corresponding sink of 2(S), and vice versa
Fig. 4).
b
Let s be a nonhorizontal segment with upper endpoint a and lower endpoint
consider the problem of
that crosses no segment of S, and let S’ be SU {s}. We
computing 7(S') and 2(S‘), given 7(S) and 2(S).
If the upper endpoint a is not an endpoint of some segment in S already, we
with
first use 2(S) to locate the trapezoid of t, of 7(S) that contains a. We split t,
a to obtain a new trapezoidal decomposition 7’. The
a horizontal line through
sink of 2(S) that corresponds to t, becomes a Y-node whose key is the
are sinks
y-coordinate of a and whose two successors are two new nodes, which
and correspond to the two new trapezoids of 7’. Thus we obtained besides 7’
also a new query structure 2’.
If a was an endpoint of some segment of S already, then let F' be F and let 2’
be 2.
Next we proceed likewise with the lower endpoint b to obtain from 7’ and 2'a
trapezoidation 7" and a corresponding query structure Q".
Now we ‘thread’ segment s through J”, i.e. we determine all trapezoids of 7”
that are intersected by s, cut them in two, and on each side of s we merge
contiguous sequences of trapezoids that agree in their bounding segments. Thus
we have obtained 7(S').
We obtain 2(S’) as follows: For each ‘new’ trapezoid of F(S') along s we
to a
create a new corresponding sink-node. Each sink of 2” that corresponds
trapezoid of J” that is cut by s becomes an X-node whose key is s and whose two
successors are the appropriate new sinks.
The time necessary to obtain J(S’) and 2(S’) from 7 (S) and 2(S) consists of
the query time for locating the two endpoints of s and the ‘threading time’ for s.
Note that the latter is proportional to the number of horizontal lines of F(S) that
are cut by s, or equivalently, it is proportional to the number of horizontal lines
of 7(S‘) that abut upon s.
What is the total time necessary for constructing J(S) and 2(S) by successive
insertion of the segments of S, starting with empty structures? Clearly this
depends very much on the order of insertion. Note that F(S) is independent of
this order, but 2(S) and the query time it admits very much depend on this order.
It is not hard to concoct bad examples: Consider, for instance, a set S of n vertical
segments that all intersect the x-axis. If these segments are inserted by increasing
x-coordinate, then the resulting query structure will have very long source-sink
paths and locating a query point on the x-axis to the right of all segments will take
O(n) time. .
In the following we argue that if the segments of S are inserted in random
order, with each ordering occuring equally likely, then 2(S) will behave nicely in
38 R. Seidel

expectation, and the overall expected construction time will be reasonable. For
this purpose we will need to show something about the expected point location
query time and the expected ‘threading’ time.

Lemma 2. Let s;,...,5, be a random ordering of the segments of S, and let


S;= {51,...,8;} for 0<i<n. For 1<i<n the expected number of horizontal
lines of F(S;-,) that are intersected by the relative interior of s, is at most 4.

Proof. For a segment s eS; let deg(s, 7(S;)) denote the number of horizontal
extensions of 7(S;) that abut upon 5,, i.e. they end in the relative interior of s.
As the number of horizontal extensions of 7(S,_,) that are intersected by s; is
the same as the number of horizontal extensions of J(S,) that abut upon s,;, we
are interested in the expected value Exp(deg(s; 7(S,))).
As there are at most 2i horizontal extensions in J(S,), each abutting upon at
most two segments, we have ¥,.s deg(s, 7(S;)) <4i. Because of the random
ordering, 5; is any one of the i segments in S, with equal probability. Thus
Exp(deg(s,, 7(S)))=4 O

Let H, =1+1/2+1/3+-+++1/n, and recall that H, = O(log n), in particular


for n > 1 we have log. n<H, <1+ log. n.

Lemma 3. Let s,,...,5, be a random ordering of the segments of S, and let


S;={51,-.-,8;} for O<i<n. For 1<i<n let F(S,) and 2(S,) be the trapezoid-
ation and query structure for S; obtained from F(S,.,) and 2(S,_,) by inserting
segment s,. If q is any query point, then, taken over all orderings of S, the expected
number of key comparisons necessary to locate q in F(S,) using 2(S,,) is at most
5H,, i.e. O(log 7).

Proof. Let 1; be the trapezoid in 7(S,) that contains g. Assuming 1,_; is known,
what is E;, the expected number of comparisons necessary to identify 1,? In other
words, assuming we know the trapezoid of 7(S,_,) that contains g, what is the
expected number of comparisons necessary to determine the trapezoid of J(S;)
that contains q?
Clearly no comparisons are necessary if t;_, and t; are the same. If they are
different, then at least one of the sides of 1; has to be part of the new segments s,
or part of the horizontal extension through one of the endpoints of s;.
If the right side of 1, is part of s;, then exactly one comparison is necessary to
identify t;, namely an X-comparison between g and s,. Because of the random
ordering every one of the i segments of S, has the same chane 1/i of being s;. Thus
the probability that s; happens to be the segment bounding 7; to its right is at most
1/i (t; might be unbounded to the right). Thus the expected number of
comparisons between q and the right side of 1; is at most 1/i. By symmetry the
same holds for the left side of 1;.
Trapezoidal decompositions and triangulating polygons 59

Similarly, if the upper side of 1, is part of a horizontal extension through an


endpoint of s;, then one comparison is necessary to identify 1, namely a
Y-comparison between q and that extension. Again, because of the random
ordering this happens with probability 1/i at most, and thus the expected number
of comparisons between g and the upper side of 1; is at most 1/i. The same holds
for the lower side of 1;.
Thus the expected number of comparisons between q and the sides of 1; is at
most 4/i. (Note that here we are exploiting the fact that the expectation of a sum
of random variables is simply the sum of the individual expectations, even if the
random variables are dependent.) However, Mike Hohmeyer at U.C. Berkeley
has pointed out that one additional kind of comparison can occur: Assume the
upper side of 1; is part of the horizontal extension of an endpoint of s, (which
happens with probability at most 1/i), in particular assume the upper side of 1; is
the horizontal extension of the lower endpoint of s,;. In addition assume that no
horizontal extension abuts upon the relative interior of s; and that no other
segment of S; shares an endpoint with s;. This means that the segment s, is
contained in the interior of the trapezoid t,_,. By the way we obtain the query
structure 2(S;) from 2(S,_,) it is clear that in order to locate gq in 1; at first also a
comparison between g and the horizontal extension of the upper endpoint of s;
has to be made. Thus if this particular configuration occurs, one additional
comparison has to be performed with probability at most 1/7.
It follows that E;, the expected number of comparisons necessary to ascertain
that q lies in t; knowing that it lies in 1,_, is at most 5/i.
To prove the lemma it now suffices to observe that the expected overall query
time is clearly Dj<ic,E;. O

Lemmas 2 and 3 together with the preceding discussion immediately imply the
following theorem.

Theorem 1. Let S be a set of n noncrossing, nonhorizontal line segments in the


plane. Let the trapezoidation F(S) and the query structure Q2(S) be built
incrementally by inserting the segments of S in random order.
(1) The expected time necessary to build F(S) and 2(S) in O(n log n).
(2) The expected size of 2(S) is O(n).
(3) For any query point q the expected time for locating q in T(S) via Q(S) is
O(log rn).
(All expectations are with respect to the random ordering of S, where each
permutation of S is assumed to occur equally likely.)

In the following we show that if S is the set of segments of a simple polygonal


chain, then Y(S) and 2(S) can be built even faster.
The expensive part of inserting a segment seems to be the location queries for
its endpoints. How could one do without them? If S derives from a polygonal
60 R. Seidel

chain C, then an obvious fix seems to be to insert the segments in order along C.
This way one endpoint of s; coincides with an endpoint of the just inserted
segment s;_, whose location is known. The location of the other endpoint could
be determined while ‘threading’ s; through the current trapezoidation. Unfortun-
ately this strategy forgoes the use of randomization, and it is not true any more
that the expected cost of ‘threading’ s; through the current trapezoidation is
constant. Indeed it is not hard to concoct examples where this ‘threading’ cost is
O(i) for n/2<i<n, which leads to an O(n’) algorithm.
We will pursue the following strategy: We will still insert the segments in
random order. But every once in a while we will stop and locate all endpoints
(which are vertices of C) in the current trapezoidation by tracing out C. To
document the efficiency of this approach we will need two lemmas: one tells how
much this intermediate location information helps with the searches later on; the
other one tells how expensive it is to trace C through the current trapezoidation.

Lemma 4. Let s,,...,5, be a random ordering of the segments of S, and let


Si= {5i,.-- Si} forO<isn. For 1<i<n let F(S;) and 2(S,) be the trapezoida-
tion and query structure for S; obtained from F(S,.;) and Q(S;_,) by inserting
segment s; Let 1<j<k<n. If q is a query point whose location in TJ (S;) is
known (along with the corresponding sink node of 2(S,)), then q can be located
via 2(S,) in F(S,) in expected time at most 5(H,—H,), which is O(log(k/j)).
(The expectation is with respect to all possible orderings of S.)

Proof. Proceed as in the proof of Lemma 3. However, the expected query time
in this case is Djcjc, E;. O

Lemma 5. Let S be a set of n noncrossing, nonhorizontal segments in the plane


and let R be a random subset of S of size r. Let Z be the number of intersections
between horizontal trapezoid sides of F(R) and segments in S\R. The expected
value of Z is at most 4(n —r), where the expectation is over all subsets R of S of
size r.

Proof. For T cS and seéT let deg(s, J(T)) denote the number of horizontal
extensions of endpoints of segments in T that abut upon the relative interior of s.
As every horizontal extension abuts upon at most two segments we have
User deg(s, T(T)) <4 |T|.
For Rc S and s ¢R observe that the number of horizontal trapezoid sides of
F(R) that are intersected by s is exactly deg(s, F(R U {s})). We are interested in

+S ST deg(s, H(RU {s})).


N\ RES seS\R
IR|=r
r
Trapezoidal decompositions and triangulating polygons 61

Expressing this double sum slightly differently, this is the same as

+NA\ SS
R'cS
deg(s, 718)
SER’
r IR'jere1

— > surears yen =4(n—r). O

(ices (")
IK

Before presenting the final algorithm and its analysis a bit of notation: Let
logn denote the ith iterated logarithm, i.e. log n =n and for i>0 we have
logn = log(log— n). For n>0 let log* n denote the largest integer / so that
log” n=1, and for n>O and 0<h<log*n let N(h) be shorthand for
[n/log™ n].
The input to the algorithm below is a simple polygonal chain C of n segments in
consecutive order along C.

(1) Generate s,, 52,...,5,, a random ordering of the segments of C


(2) Generate J;, the trapezoidation for the set {s,} along with the cor-
responding search structure 2,.
(3) For h = 1 to log* n do
(3.1) For N(h -— 1)<i<MN(h) do
(3.1.1) Obtain trapezoidation 7; and search structure 9, from J;_, and
9,_, by inserting segment 5,.
(3.2) Trace C through Jy, to determine for each endpoint of all
non-inserted segments the containing trapezoid of Taya).
(4) For N(log* n)<i<n do
(4.1) Obtain trapezoidation J; and search structure 2; from F,_, and 9;.;
by inserting segment 5;.

What is the expected running time of this algorithm? We assume that Step 1
can be executed in linear time (see Section 4 for a discussion of this assumption).
Step 2 takes constant time.
For Step 3 let us consider some h, with 1<h <log* n. By Lemma 5 Step 3.2
can be performed on O(n) expected time. What about Step 3.1? The expected
cost of Step 3.1.1, inserting segment s;, is the sum of the expected time necessary
to locate s,’s endpoints in Y;_, and the expected time for ‘threading’ s; through
J,_,. By Lemma 2 the latter is constant. Since the location of s,’s endpoints in
Tniwr-1) is known already, by Lemma 4 the expected location time is only
O(log(i/N(h — 1))). Since i<n and N(h - 1) = [n/log“~? n], this is O(log” n).
For fixed A Step 3.1.1 is executed at most N(h)= [n/log™ n] times. Thus for
fixed A the total cost of Step 3 is O(n), and hence the entire expected cost of step
3 over all A is O(n log* n).
62 R. Seidel

The analysis for step 4 is similar to the one of Step 3.1. Note that
N(log* n)=n/e, and therefore the expected point location cost is constant. It
follows that Step 4 takes O(7) expected time. Thus we have proved the following
theorem.

Theorem 2. Let S be a set of n noncrossing segments in the plane that are


presented as a simple polygonal chain C. The above algorithm computes the
trapezoidation J(S) along with a point location structure 9(S) for this trapezoida-
tion in expected time O(n log* n). The point location structure uses expected O(n)
space and admits an expected O(log n) query time.

This theorem admits easy generalizations. Note that the algorithm exploits only
one property of the chain C, namely its connectedness. If 5 was presented as a
connected plane graph G with the order of the incident edges around each vertex
given explicitly, then the result would continue to hold. Only the tracing of Step 3.2
of the algorithm would have to be performed in order of some graph traversal of
G. Allowing the graph G to have several connected components leads to a
unification of Theorems 1 and 2.

Theorem 3. Let S be a set of n noncrossing segments in the plane that are


presented as a plane graph with k connected components. Let F(S) be the
trapezoidation of S.
Trapezoidation F(S) along with a query structure Q(S) can be built in time
O(n log* n + k log 7).
The expected size of 2(S) is O(n).
For any query point q the expected time for locating q in J(S) via QS) is
O(log 7).

Proof. Apply the algorithm outlined above, but modify Step 3.2 so as to trace
the segments of each connected component of the graph through the current
trapezoidation in the order of some graph traversal, say, depth-first-search. In
order to start the tracing of one connected component, one of its vertices has to
be located in the current trapezoidation. Because of Lemma 3 the cumulative
expected cost for this over the entire algorithm is O(log) per component. O

4, Remarks

An algorithm somewhat similar to the one described in this paper has also been
discovered by Clarkson, Cole, and Tarjan [4]. However, their approach is based
on divide-and-conquer and the main thrust of their approach is towards a fast
parallel trapezoidation algorithm.
Trapezoidal decompositions and triangulating polygons 63

Our algorithm can be viewed as a holistic version of the divide-and-conquer


algorithm in [4] or its predecessor in [5]. The log* n stops in our segment insertion
routine at which the curve is traced through the current trapezoidation cor-
respond to the log* n levels of recursion in the divide-and-conquer algorithms.
However, by always dealing with the global trapezoidation our algorithm avoids
the myopia brought about by the very high divisiveness of the divide-and-conquer
algorithms.
The algorithm presented in this paper seems to require that every one of the n!
might
permutations of n segments can be generated with equal likelihood. This
seem unsatisfactory from the theoretical point of view, since this requires
@(n log n) random bits. As a matter of fact this makes the main result of this
paper questionable at best, if a model of computation is used that requires unit
cost for single random bits. For our result to be interesting we need to be able to
obtain random integers distributed over a polynomially sized range at unit Cost.
However, such a model of computation is not at all unreasonable: From the
practical point of view today’s pseudo-random number generators do provide
such ‘random’ integers at unit cost. From the theoretical point of view it seems
unfair to work with a uniform cost model for the arithmetic but with a bit model
for the randomness. Note that if a bit model is assumed throughout, then the
number of random bits required is proportional to the input size (measured in
bits, of course).
The question of estimating the probability that the running time of our
algorithm significantly exceeds its expectation is currently being investigated.

Acknowledgements

1 would like to thank Mike Hohmeyer for pointing out an error in the original
version of the proof of Lemma 3. I would also like to thank Emo Welzl for
inviting me to the Freie Universitat Berlin. I doubt this research would have
happened without the stimulating visit there.

References

IEEE Symp. on
{1} B. Chazelle, A theorem on polygon cutting with applications, Proc. 23rd Annual
Found. of Comput. Sci. (1982) 339-349.
[2] B. Chazelle, Triangulating a simple polygon in linear time, Princton Univ. Computer Science
Rep. CS-TR-264-90, to appear in Proc. 31st Annual IEEE Symp. on Found. of Comput.
Tech.
Sci. (1990).
and J. Incerpi, Triangulation and shape-complexity, ACM Trans. on Graphics 3
{3] B. Chazelle
(1984) 135-152.
[4] K. Clarkson, R. Cole and R.E. Tarjan, Randomized parallel algorithms for trapezoidal
diagrams, to appear in Proc. 7th ACM Symposium on Computational Geometry (1991).
64 R. Seidel

[5] K. Clarkson, R.E. Tarjan and C.J. Van Wyk, A fast Las Vegas algorithm for triangulating a
simple polygon, Discrete Comput. Geom. 4 (5) (1989) 423—432.
[6] A. Fournier and D.Y. Montuno, Triangulating simple polygons and equivalent problems, ACM
Trans. on Graphics 3 (1984) 153-174.
[7] M.R. Garey, D.S. Johnson, F.P. Preparata and R.E. Tarjan, Triangulating a simple polygon,
Inform. Process. Lett. 7 (1978) 175--180.
[8} S. Hertel and K. Mehthorn, Fast triangulation of a simple polygon, Proc. Conf. Found. Comput.
Theory, Lecture Notes in Comput. Sci. 158 (Springer, Berlin, 1983) 207-218.
{9] K. Hoffman, K. Mehlhorn, P. Rosenstiehl and R.E. Tarjan, Sorting Jordan sequences in linear
time using level-linked search trees, Inform. and Control 68 (1986) 170-184.
[10] D.G. Kirkpatrick, M.M. Klawe and R.E. Tarjan, O(n log logn) polygon triangulation with
simple data structures, Proc. 6th Annual ACM Symp. Comput. Geom. (1990) 34-43.
[11] R.E. Tarjan and C.J. Van Wyk An O(n log log 7)-time algorithm for triangulating a simple
polygon, SIAM J. Comput. 17 (1988) 143-178.
[12) G. Toussaint and D. Avis, On a convex huil algorithm for polygons and its applications to
triangulation problems, Pattern Recognition 15 (1) (1982) 23-29.
{13] G. Toussaint, An output-complexity-sensitive polygon triangulation algorithm, Report SICS-
86.3, McGill University, Montreal, 1988.

You might also like