Algorithm
Algorithm
c 2006 Society for Industrial and Applied Mathematics
Vol. 35, No. 3, pp. 627–646
DOI. 10.1137/S009753970444572X
∗ Received by the editors August 16, 2004; accepted for publication (in revised form) June 20, 2005;
published electronically January 6, 2006. A preliminary version of this paper appeared in Proceedings
of the 35th Annual ACM Symposium on Theory of Computing, San Diego, 2003, pp. 531–540. This
work was supported in part by NSF grants CCR-998817 and ARO grant DAAH04-96-1-0181 and by
the NEC Research Institute.
http://www.siam.org/journals/sicomp/35-3/44572.html
† Department of Computer Science, Princeton Univeristy, Princeton, NJ, 08544 (chazelle@cs.
princeton.edu, [email protected]).
‡ Department of Computer Science, University of Toronto, Toronto, ON, M5S3G4 Canada (avner@
cs.toronto.edu).
627
628 BERNARD CHAZELLE, DING LIU, AND AVNER MAGEN
1 Throughout this paper, unless specified otherwise, the running times are understood in the
expected sense.
SUBLINEAR GEOMETRIC ALGORITHMS 629
Rq
Rp
p
1 Cp
p
p
2
gramming, we can test Rp and Rq for intersection without computing them explicitly.
This can be done probabilistically (or even deterministically) in linear time. There
are many ways of doing that (see [5] for references). It is easy to modify the algorithm
(of, say, [31]) so that in O(r) time it reports a point in the intersection of Rp and Rq
if there is one (in which case we are done) and a bitangent separating line L otherwise
(Figure 1). Let p be the vertex of Rp in L, and let p1 , p2 be its two adjacent vertices
in P . We define a polygon Cp as follows. If neither p1 nor p2 is on the Rq side of L,
then Cp is the empty polygon. Otherwise, by convexity exactly one of them is (say,
p1 ). We walk along the boundary of P starting at p1 , away from p, until we cross L
again. This portion of the boundary, clipped by the line L, forms the convex polygon
Cp . A similar construction for Q leads to Cq .
It is immediate that P ∩ Q = ∅ if and only if P intersects Cq or Q intersects
Cp . We check the first condition and, if it fails, check the second one. We restrict
our explanation to the case of P ∩ Cq . First, we check whether Rp and Cq intersect,
again using a linear time algorithm for a linear program (LP), and return with an
intersection point if they do. Otherwise, we find a line L that separates Rp and
Cq and, using the same procedure as described above, we compute the part of P ,
denoted Cp , on the Cq side of L . Finally, we test Cp and Cq for intersection in time
linear on their sizes, using an LP or any other straightforward linear-time algorithm
for intersection detection of convex polygons. Correctness is immediate. The running
time is O(r + |Cp | + |Cp | + |Cq | + |Cq |). We can prove that E |Cp | = O(n/r). (The
three-dimensional case discussed below will subsume this result, so there is no need for
a proof now.) Similarly, E |Cp | = E |Cq | = E |Cq | = √
O(n/r). The overall complexity
of √the algorithm is O(r + n/r), and choosing r = n
gives the desired bound of
O( n ).
To show optimality, consider the following distributions on pairs of polygons. One
polygon is fixed, convex, and nondegenerate with one vertex in the origin and all other
vertices below the x-axis. The other polygon (also convex and nondegenerate) has
n−1 vertices above the x-axis, and one vertex, p, in the origin or in (0, δ), where δ is a
positive number small enough so that p is the lowest vertex of the polygon. Moreover,
the edges of this polygon are randomly ordered in the edge table. Clearly, these two
polygons intersect if and only if p is in the origin. Since nothing in the structure of the
input except the geometry of p reveals whether it is indeed the origin, any algorithm
that detects intersection must have access to p. Now recall that the only operations
allowed are the random sampling of edges and edge-traversing via links, which means
SUBLINEAR GEOMETRIC ALGORITHMS 631
√
that, as in Lemma 1.1, an expected time of Ω( n) is needed to access p. Optimality
of subsequent results follows these lines very closely and shall not be proved again.
We have the following.
√Theorem 1.2. To check whether two convex n-gons intersect can be done in
O( n ) time, which is optimal.
To put Theorem 1.2 in perspective, recall that the intersection of two convex
polygons can be determined in logarithmic time if the vertices are stored in an array
in cyclic order [6]. The key point of our result is that, in fact, a linked list is sufficient
for sublinearity. Similarly, if polyhedra are preprocessed à la Dobkin and Kirkpatrick,
then fast intersection detection is possible [15]. What we show below is that sublinear-
ity is achievable even with no preprocessing at all. Again, we use a two-stage process:
In the first stage we break up the problem into r subproblems of size roughly n/r and
then identify which ones actually need to be solved; in the second stage we solve these
subproblems in standard (i.e., nonsublinear) fashion. Their number is constant, and
hence the square root complexity. What prevents us from solving these subproblems
recursively is the model’s restriction to global random sampling. In other words, one
can sample efficiently for the main problem but not for the subproblems.
2. Convex polyhedral intersections. Given two n-vertex convex polyhedra
P and Q in R3 , the problem is to determine whether or not they intersect: If they
do, then we should report a point in the intersection; otherwise, we should report
a plane that separates them. We assume that a convex polyhedron is given in any
classical edge-based fashion (e.g., DCEL, winged-edge) but with no extra preprocess-
ing. The main structure is a table of edges that allows us to pick an edge at random
in constant time. There are also two tables for vertices and faces. Moreover, these
tables are interconnected via pointers to make various local operations possible. For
example, each edge points to its two vertices and two adjacent faces. It also points
to its predecessor and successor edges in its two adjacent faces. Such a structure is
a standard representation for convex polyhedra in computational geometry. It allows
us to traverse a portion of a convex polyhedron in a local fashion and in time linear
in the number of edges visited. √
Choose a random sample of r = n
edges from P and Q, and let Rp and Rq
denote the convex hulls of these random edges in P and Q, respectively. We do not
compute Rp and Rq explicitly but merely use their vertices to get an LP as described
in the last section for the case of polygons. We use this LP to detect the intersection
of Rp and Rq in O(r) time by invoking a linear-time algorithm for low-dimensional
linear programming. We stop with a point of intersection if there is one. Otherwise,
we find a separating plane L that is tangent to both Rp and Rq . It is important to
choose the plane L in a canonical fashion. To do that, we set up the LP so as to
maximize, say, the coefficient α in the equation2 αx + βy + γz = 1 of L.
Next, choose a plane π normal to L and consider projecting P and Q onto it. (Of
course, we do not actually do it.) Let p be a vertex of Rp in L (there could be two
of them, but not more, if we assume general position between P and Q), and let p∗
be its projection onto π. We also project the neighbors of p in P onto π and get
p∗1 ,p∗2 , . . ., p∗k . In other words, they are the set of vertices adjacent to p∗ in the
projection of P onto π. We test to see if any of them is on the Rq side of L and
identify one such point, p1 , if the answer is yes (more on that below). If none of them
2 With perturbation techniques, we can always assume general position, and hence avoid having
a solution passing through the origin. We will also assume that the relative position of P and Q is
general.
632 BERNARD CHAZELLE, DING LIU, AND AVNER MAGEN
p
1
f
p
Fig. 2. The edges of P incident to p; the thick lines form the random sample.
many times as its number of incident edges; (ii) Rp and Rq are formed by picking each
point of M independently with probability r/n and assigning points of P to Rp and
points of Q to Rq . With respect to the modified distribution, |Cp |+|Cq | is proportional
to the number of constraints in M that violate the LP P(Rp , Rq ) used to define L
(with each point of Rp and Rq defining a linear constraint). For technical reasons, we
need to perturb M slightly to make it in general position. Specifically, we move each
point of M away from its corresponding vertex in P or Q by an infinitesimal random
amount, along the corresponding edge of P or Q. After this random perturbation,
the size of the violation set of P(Rp , Rq ) can only increase. To see this, note that
constraints in M that violate P(Rp , Rq ) before the perturbation continue to do so
because the perturbation is infinitesimal; and constraints in M that lie on L before
the perturbation may violate the LP after the perturbation.
To bound the expected size of the violation set, we apply a result proved by
Gärtner and Welzl [19] (and also by Clarkson [9]). Following the notation of the
“Sampling Lemma” in [19], we let the ground set S be the (perturbed) set M . After
sampling a set of points R from M randomly, we set up an LP αx + βy + γz = 1 that
separates Rp and Rq . Note that in this LP, α, β, and γ are variables and (x, y, z) is
a point in R. This LP is set up so as to maximize the variable α, whose optimum
value is a function of R. We set the function φ in [19] to be α. Under this setting, the
extreme elements of Rp and Rq are their vertices on the optimum separating plane
(as implied by the above LP). Since M is in general position, any Rp and Rq have
three extreme elements. The Sampling Lemma in [19] then implies that the expected
size of the violation set is at most 3(n − r)/(r + 1) = O(n/r).
Let D be the original distribution (the one used by the actual algorithm) with r
replaced by 13r. Of course, this scaling has no asymptotic effect on the upper bound
for E (|Cp | + |Cq |). We define an intermediate distribution D1 by going through each
edge (u, v) of P ∪Q twice, selecting it with probability r/n, and then throwing into the
sample both u and v, provided that the edge (u, v) has not yet been selected. (Note
that this implies that u and v are kept out with probability (1 − r/n)2 .) There are at
most 6n edges in P and Q, so the probability that a sample from D1 is of size less than
13r is overwhelmingly high. Since all equal-size subsets of edges are equally likely to be
chosen, ED (|Cp |+|Cq |) is nonincreasing with the sample size, and so ED (|Cp |+|Cq |) =
O(ED1 (|Cp |+|Cq |)). Let D2 denote the modified distribution used in the calculations.
Observe that D2 is derived from D1 by picking only u if (u, v) is chosen the first time
it is considered for selection and then only v if it is picked the second time around.
By monotonicity, we then have ED1 (|Cp | + |Cq |) = O(ED2 (|Cp | + |Cq |)). This proves
that the O(n/r) bound holds in the original distribution used by the algorithm.
Recall that the running time√is O(r + n/r√+ E (|Cp | + |Cq |)), which is O(r + n/r)
by the above analysis. For r = n
it is O( n).
When the two convex polyhedra intersect, the algorithm reports a point in the
intersection. On the other hand, when they are disjoint, we can report a plane that
separates them. Here is a brief description on how to do that. Note that we cannot
simply return a separating plane for Cp and Cq (or Cp and Cq ) because it is not
necessarily separating for P and √Q. Instead, we resort to geometric duality to compute
the desired plane in expected O( n) time. In a standard geometric duality transform,
a vertex in the primal space is mapped to a plane in the dual space and vice versa.
Moreover, the upper (resp., lower) hull of a convex polyhedron is transformed to a
lower (resp., upper) envelope [13]. When P and Q are disjoint, at least one of the
following must be true: (1) there exists a plane above the upper hull of P and below
634 BERNARD CHAZELLE, DING LIU, AND AVNER MAGEN
the lower hull of Q; (2) there exists a plane below the lower hull of P and above the
upper hull of Q. Since they are symmetric, it suffices to consider the first one. By
duality, such a plane dualizes to a point in the common intersection of an upper and
a lower envelope, which is itself a convex polyhedron. Although this polyhedron is
not available explicitly, we have access to its geometric features (vertices, edges, etc.)
in constant time via the corresponding features
√ in the primal space. Hence we can
apply the above algorithm to find, in O( n) time, an intersection point which is the
dual of a separating plane for P and Q.
It is important to note that an alternative to the above approach can be found in a
general scheme to solve the constant-dimensional LP in linear time due to Clarkson [9].
Clarkson √ suggested a randomized√ algorithm that finds a set of constraints of expected
size O( n) (or, in general, O(d n), where d is the dimension) that contains a “basis,”
that is, a minimal set of constraints that determines the problem. Our approach is
somewhat similar to that schema. Of course, there √ are details to be filled as to how
exactly this set may be computed in time O( n). (Clarkson’s √ algorithm as it is
would be a linear time algorithm.) In particular, an O( n)-time method of finding
the violating subpolyhedron (like the one we proposed) must still be used in order to
implement the alternative approach of Clarkson efficiently enough.
3. Ray shooting applications. Given a convex polyhedron P with n vertices
and a directed line in R3 , the ray shooting problem asks for the point on (the
boundary of) P hit by if it exists. We apply essentially the same techniques√ as in
convex polyhedral intersection√to ray shooting and solve it in expected O( n) time.
Choose a random sample of n
edges from P , and let Rp denote the convex√hull
of these edges. We first use an LP to detect intersection of Rp and in time O( n).
There are two cases. If Rp and do not intersect, we get a plane L that separates them
and passes through a vertex q of Rp . Starting from q we construct the intersection
Cp of P with the halfspace bounded by L that contains . We already explained
how to do that in the previous section. Finally, we solve ray shooting for Cp and .
Now suppose
√ that Rp and intersect. We first find the point p on Rp hit by in
time
√ O( n). We cannot afford to compute an explicit representation of Rp in time
Ω( n log n). To find p we again use an LP. We can assume that is the positive x-axis
by rotating the coordinate system. Of course, we do not rotate the whole polytope P .
Instead, we maintain such a rotation transform implicitly. In other words, whenever
we need a geometric feature (vertex, edge, etc.) of P after the rotation, we compute
it from its corresponding feature on the original input in constant time. Finding p
is equivalent to finding a plane L such that (1) all vertices of Rp are on one side
of L (the side that contains (+∞, 0, 0)); (2) the intersection point of L with the x-
axis has its x-coordinate as large as possible. In fact, p is that intersection point.
It is straightforward
√ to formulate this problem as a three-dimensional LP and solve
it in time O( n). In particular, to ensure (2) above we minimize the coefficient α
in the equation αx + βy + γz = 1 for L. Once we have L and p, we construct Cp
as before and solve the problem for Cp and . Essentially the √ same analysis as the
proof of Theorem 2.1 shows that the expected size of Cp is O( n). We thus have the
following.
Theorem 3.1. Given a convex polyhedron with n vertices
√ and a directed line, we
can compute their intersection explicitly in optimal O( n ) time.
This sublinear time algorithm for ray shooting towards a convex polyhedron gives
us useful ammunition for all sorts of location problems.
Given the Delaunay triangulation T of a set S of n points in the plane and a
SUBLINEAR GEOMETRIC ALGORITHMS 635
query point q, consider the problem of locating q, i.e., retrieving the triangle of T
that contains it. The Delaunay triangulation can be given in any classical edge-based
data structure (e.g., DCEL), as long as it supports O(1) time access to a triangle from
a neighboring triangle. We use the close relationship between Delaunay triangulations
and convex hulls given by the mapping h : (x, y)
→ (x, y, x2 + y 2 ). As is well known,
the Delaunay triangulation of S is facially isomorphic to the lower hull of h(S) (i.e.,
the part of the convex hull that sees z = −∞). In this way, point location in T is
equivalent to ray shooting towards the convex hull, where the ray originates from the
query point q and shoots in the positive z-direction. Obviously, any facial feature of
the convex hull can be retrieved in constant time from its corresponding feature in
the Delaunay triangulation. (The one exception is the set of faces outside the lower
hull: we can simplify matters by adding a dummy vertex to the hull at z = ∞.)
The same argument can be used for point location in Voronoi diagrams. Recall
that each point (px , py ) is now lifted to the plane Z = 2px X + 2py Y − (p2x + p2y ), which
is tangent to the paraboloid Z = X 2 + Y 2 . The Voronoi diagram of S is isomorphic to
the lower envelope of the arrangement formed by the n tangent planes. Note that any
vertex (resp., edge) of the envelope can be derived in constant time from the three
(resp., two) faces incident to the corresponding vertex (resp., edge).
Theorem 3.2. Point location in the Delaunay√triangulation or Voronoi diagram
of n points in the plane can be done in optimal O( n ) time.
Observe that algorithms for computing a Delaunay triangulation or a Voronoi
diagram often supply an efficient point location data structure as a by-product, and
thus sublinear time point location in Delaunay triangulations or Voronoi diagrams
may be of lesser interest. However, our algorithm is still useful when the triangula-
tion/diagram is huge and we cannot afford to store it together with the point location
structure. Our algorithm for point location in Delaunay triangulations also has its
limitations: It works only because of the known correspondence between a Delaunay
triangulation and a special convex polyhedron. It cannot perform point location in ar-
bitrary planar triangulations. In the next section, we use a different method to achieve
sublinear time point location in arbitrary triangulations or convex subdivisions with
O(1) maximum face size.
We consider the following problem, which will arise in our subsequent discussion
of volume approximation and shortest path algorithms. Given a convex polyhedron P
with n vertices and a point q, let nP (q) denote the (unique) point of P that is closest
to q. Of course, we can assume that q does not lie inside P , which we can test by using
the
√ previous algorithm. To compute nP (q) we extract a sample polyhedron Rp of size
n (as we did before) and find nRp (q). Since we just have a collection of vertices
of Rp instead
√ of its full facial representation, it is not obvious how to find nRp (q)
in time O( n). For this purpose, we express this problem as an LP-type problem
and solve it using the method in [5] (see Chapter 8). A reformulation of the problem
would be to seek the plane L that separates q from the vertices of Rp and maximizes
the distance from q to it. To apply the method in [5], we view each vertex of Rp
as a constraint. We also check that all the assumptions (i.e., monotonicity, locality,
violation test, and range space oracle) needed√to solve this problem efficiently hold.
See [5] for details. Thus we get L in time O( n): it is tangent to Rp at nRp (q) and
normal to the segment qnRp (q). Next, we compute the intersection Cp of P with the
halfspace bounded by L √ that contains q. Again, a similar analysis shows that the
expected size of Cp is O( n). Obviously, nP (q) = nCp (q), so we can finish the work
by exhaustive search in Cp .
636 BERNARD CHAZELLE, DING LIU, AND AVNER MAGEN
Theorem 3.3. Given a convex polyhedron √ P with n vertices and a point q, the
nearest neighbor of q in P can be found in O( n ) time.
We can compute a related function by similar means. Given a directed line ,
consider an orthogonal system of coordinates with as one of its axes (in the positive
direction), and define ξP () to be any point of P with maximum -coordinate. If we
choose a point q at infinity on , then ξP () can be chosen as nP (q), and so we can
apply Theorem 3.3.
Another function we can compute in this fashion maps a plane L and a direction
in L to the furthest point of P in L along : in other words,
√ ξP (L, ) = ξP∩L (). Again,
the nonobvious part is computing ξRp (L, ) in time O( n) for a sample polytope Rp .
As in the case of ray shooting, we can assume without loss of generality that L is the
xy-plane and is the positive x-direction. Finding ξRp (L, ) is the same as finding a
plane L such that (1) all vertices of Rp are on one side of L (the side that contains
(−∞, 0, 0)); (2) L is parallel to the y-axis; (3) the intersection point of L with
the√x-axis has its x-coordinate as small as possible. We solve this problem in time
O( n) by formulating it as a three-dimensional LP. Other parts of the algorithm
(e.g., constructing Cp ) and its analysis are similar to other problems discussed in this
section. We summarize our results.
Theorem 3.4. Given a convex polyhedron P with n vertices, √ a directed line ,
and a plane π, the points ξP () and ξP (π, ) can be found in O( n ) time.
4. Point location in convex subdivisions. Given a convex planar subdivision
S with n edges and a query point q, the point location problem √ asks for the face of S
that contains q. In the previous section, we provided an O( n)-time point location
algorithm where S is a Delaunay triangulation or a Voronoi diagram. Devroye, Mücke,
and Zhu [14] also showed that a simple “walk-through” technique locates a query point
in the Delaunay triangulation of n random points in the plane in expected (roughly)
O(n1/3 ) time. Here we show that a slight variation of the walk-through technique
actually locates a query point in any planar√triangulation (not necessarily Delaunay or
formed by random points) in expected O( n) time, which is optimal. Our algorithm
generalizes to planar subdivisions with O(1) maximum face size. We also give a simple
argument showing an Ω(n) lower bound for point location in subdivisions with large
faces.
Theorem 4.1. Point location in an n-edge √ convex planar subdivision with O(1)
maximum face size can be done in optimal O( n ) time.
Proof. First, we consider the case of a triangulation. For an edge e in the tri-
angulation and a query point q, we use qe to denote the nearest neighbor of q on e.
√ to define the Euclidean distance between q and e as |qqe |. We start by
It is natural
sampling n edges of the triangulation at random. Let e be the edge in the random
sample that has the smallest Euclidean distance to q. We walk from qe toward3 q by
traversing all triangles crossed by qqe one by one. Given any edge-based representa-
tion of the triangulation (such as DCEL), it takes constant time to traverse from one
triangle to the next. We stop at the triangle that contains q and output it as the
answer.
The running time (besides the sampling stage) is proportional to the number
of triangles crossed by qqe . Thus it suffices to show that the expected number of
3 It is important to walk towards q from its nearest neighbor on the nearest edge. In contrast,
previous algorithms [27] either walk from an endpoint (or the midpoint) of the nearest edge or
sample by vertices and walk from the nearest sample vertex. These algorithms do not have sublinear
expected running time for arbitrary triangulations.
SUBLINEAR GEOMETRIC ALGORITHMS 637
√
triangulation edges crossed by qqe is O( n). For this, we rank each edge according
to its Euclidean distance to q. Since the rank of every edge crossed by qqe is smaller
than that of e, the number of edges crossed by qqe is at most the rank√of e. The
claimed time bound then √ follows from the fact that the smallest rank of n random
edges has expectation O( n). It is straightforward to generalize this algorithm to
planar subdivisions with O(1) maximum face size.
What if the subdivision has large faces: Is sublinear time point location still
possible? The answer is no.
Theorem 4.2. There exists an n-edge planar subdivision such that any random-
ized algorithm for point location in this subdivision has expected running time Ω(n).
Proof. Consider the following problem first: We are given a doubly linked list of
numbers. We know exactly one of them is nonzero and want to find out that special
number. We can use an argument similar to the proof of Lemma 1.1 to show that any
randomized algorithm has to spend Ω(n) expected time on this problem. Returning
to point location, consider a rectangle with corners (−1, 0), (−1, n + 1), (1, 0), and
(1, n + 1). By breaking its two vertical sides into n + 1 unit length segments, we get a
face with 2n + 4 edges. Finally, we pick an integer i from 1 to n and add a horizontal
edge from (−1, i) to (1, i). This gives us a two-face subdivision. Given the query
point (0, (n + 1)/2), a deterministic algorithm must find the horizontal edge in the
middle to locate the query correctly, and the only way to do that is through a visit
to one of its four adjacent edges. This is similar in spirit to the list-checking problem
considered above. In other words, in both problems we try to find one of O(1) special
elements in a list4 of size Θ(n). We thus get the same lower bound of Ω(n).
5. Volume approximation. We seek to approximate the volume of a convex
polytope P . We proceed in two stages. First, we compute a large enough enclosed
ellipsoid, which we use to rescale P affinely. This is intended to make P round enough
so that good Hausdorff distance approximation yields good volume approximation.
Second, we use a standard construction of Dudley [16] to find, via the methods of
the previous section, an enclosing polytope of O(1/ε) vertices whose boundary is at
Hausdorff distance at most ε from P . √
Stage 1. We begin by computing, in O( n ) time, a polytope P ⊆ P , such that
vol (P ) ≥ c0 vol (P ) for some constant c0 > 0. Compute the six points ξP () for
= ±x, ±y, ±z. These points come in pairs, so let w1 , w2 be the pair forming the
largest distance. Given a point w on the line L passing through w1 and w2 , let Pw
denote the intersection of P with the plane through w that is orthogonal to L. Let
w0 be the midpoint of w1 w2 (Figure 3). We first show that if S is a set of points in
Pw0 such that
for some constant c1 > 0, then vol (conv (S ∪ {w1 , w2 })) ≥ c2 vol (P ) for some other
constant c2 > 0. Therefore, we can take P = conv (S ∪ {w1 , w2 }) to achieve our
goal. Indeed, assume we have such a set S. As √ a straightforward consequence of
Pythagorean theorem, we find that diam (P ) ≤ 3 d(w1 , w2 ); therefore,√the orthogo-
nal projection of P on L is a segment v1 v2 ⊇ w1 w2 of length at most 3 d(w1 , w2 ).
This implies that, for any w in L, area (Pw ) ≤ 12 area (Pw0 ). To see why, observe that
if, say, w ∈ v1 w0 , then, by convexity, Pw is enclosed in the cone with apex w2 and base
4 In the point location problem there are two lists of vertical edges instead of one. This requires
w1 Pw y 1
z1 0
y0
w0
z2 L
y2
w2
√
Pw0 . Therefore, Pw lies in a copy of Pw0 scaled by at most d(w, w2 )/d(w0 , w2 ) ≤ 2 3,
which proves our claimed upper bound on area v (Pw ). Of course, the same argument
can be repeated if w ∈ w0 v2 . Since vol (P ) = v12 area (Pw ) dw, we can conclude that
the four quantities
q2
p
p m–1
q1 2
q m–1
p pm
1
√ √
each cell is √
of length ε by ε (with an exception made for the last latitude and
longitude if ε does not divide π). All lengths in this discussion are Euclidean, except
in this case where the length of a circular arc refers to its corresponding angle. We
choose a parameter λ = ε3/4 and subdivide √ each side of a cell into subarcs of length
λ (Figure 4). In this way√each cell has O( ε/λ) vertices, and the whole construction
defines a set V of O(1/λ ε ) vertices. For each point v ∈ V , we compute nP (v), its
nearest neighbor in ∂P , and define
(2) Q= { Hn+P (v) | v ∈ V }.
to remove from the point set V all vertices whose nearest neighbors in ∂P fall outside of the clipping
box in section 6.1. We also need to clip Q by that box. We omit these minor details.
642 BERNARD CHAZELLE, DING LIU, AND AVNER MAGEN
To help build intuition for the remainder of our discussion, it is useful to sketch
the proof of the lemma. Mapping the grid G to P via the nearest neighbor function nP
creates a grid nP (G) on ∂P (with curved, possibly degenerate edges). It is convenient
to think of P as a smooth manifold by infinitesimally rounding the vertices and edges.
It does not much matter how we do that, as long as the end result endows each point
p ∈ ∂P with an (outward) unit normal vector ηp that is a continuous function of p.
Note that in this way, for any u ∈ S, the vectors unP (u) and ηnP (u) are collinear,
and the function nP is a bijection. The fundamental property of the nearest neighbor
function is that it is nonexpansive. We need only a weak version of that fact, which
follows directly from Lemmas 4.3 and 4.4 in [16].
Lemma 6.5 (Dudley [16]). Given two points p, q ∈ ∂P , |pq| and (ηp , ηq ) are
both in O( |n−1 −1
P (p)nP (q)| ).
This implies that, for any two points p, √q ∈ ∂P in the same cell of the mapped grid
nP (G), both |pq| and (ηp , ηq ) are in O( ε ). We shortcut the shortest path on ∂P
from s to t to form a supported path σ that passes through each cell at most once. In
this manner, we identify O(1/ε) points p1 , . . . , pm on ∂P , where pi (resp., pi+1 ) is the
entry (resp., exit) point of the path through the ith cell in the sequence. The points
pi lie on the edges of nP (G). There are two exceptions, p1 = s and pm = t, which
might lie in the interior of the cell. Next, we connect each pair (pi , pi+1 ) by taking
the shortest path on Hpi ∪ Hpi+1 . The path intersects Hpi ∩ Hpi+1 at a point denoted
qi . (Note that qi might be infinitesimally close to pi .) This forms a supported path
σ with O(1/ε) vertices s = p1 , q1 , p2 , q2 , . . . , qm−1 , pm = t. The only real difference
from the proof in [2] is that we skip the final “trimming” step and keep the points pi
unchanged. We mention two useful, immediate √ consequences of Lemma 6.5.
• The folding angle at qi is O( ε ).
• For each 1 ≤ i ≤ m, the point pi belongs to ∂P and, for i = 1, m, there exists
a point wi = nP (vi ), where vi ∈ V , such that both |pi wi | and (ηpi , ηwi ) are
in O(λ).
From σ we build a curve σ of length (1 + O(ε))|σ| that joins s and t outside the
interior of Q. The classical result below shows that the shortest path on ∂ Q from s
to t cannot be longer than σ , which proves Theorem 6.3.
Theorem 6.6 (Pogorelov [29]). Given a convex body C, let γ be a curve joining
two points s, t ∈ ∂C outside the interior of C. Then the length of γ is at least that of
the shortest path joining s and t on ∂C.
We now explain how to construct σ . For 0 < i < m, let (pi , ηpi ) and (qi , ηpi )
be the rays emanating from pi and qi , respectively, in the direction normal to Hpi
away from P . Together with the segments pi qi and qi pi+1 , the four rays (pi , ηpi ),
(qi , ηpi ), (qi , ηpi+1 ), and (pi+1 , ηpi+1 ) define a polyhedral surface Σi , which consists of
two unbounded rectangles, Σ1i and Σ3i , joined together at qi by an unbounded triangle,
Σ2i (Figure 6). Note that the surface is in general nonplanar, but Σ2i is always normal
to the line Hpi ∩Hpi+1 . Out of Σi we carve a polyhedral strip Si as follows. Fix a large
enough constant c > 0, and let Ki denote the plane Hpi + cλ2 ηpi . In other words, Ki
is a parallel copy of Hpi translated by cλ2 away from P . As usual, the superscripted
Ki+ denotes the halfspace enclosing P . Recall that wi is the nearest neighbor of vi
defined earlier. We need to consider
Si = Σi ∩ (Ki+ ∩ Ki+1 +
) ∪ (Hw+i ∩ Hw+i+1 ) .
Again, we have two exceptions for i = 1, m − 1, where we use Hp+1 instead of Hw+1 and
SUBLINEAR GEOMETRIC ALGORITHMS 643
2
1 Σi
Σi Σi
3
q i/ q i/ /
p/
i+1
p/ qi
i
2
p Cλ
pi
i+1
x
y
O
p
Hp
the portion of ∂Si between pi and pi+1 and define σ as 0<i<m σi . To provide a
connection to s and t, we also add to σ the segments p1 p1 and pm pm . To show that
σ is a connected curve outside the interior of Q of length (1 + O(ε))|σ| requires a
simple technical lemma.
Lemma 6.7 (Figure 7). Given an orthogonal system of reference (O, xyz), assume
that P is tangent to the xy-plane at O and lies below it. Given a point p on ∂P , if
|n−1 −1
P (O)nP (p)| < δ, for some small enough δ > 0, then the intersection of Hp with
the xz-plane has for an equation Z = aX + b, where |a| = O(δ) and 0 ≤ b = O(δ 2 ).
Proof. By Lemma 6.5, the normal to Hp forms a small angle θ = O(δ) with
the z-axis, so the plane Hp , being nonparallel to the z-axis, can be expressed as
Z = aX + cY + b. The cross product between the normal (a, c, −1) and the z-
axis
√ vector is the vector (c, √ −a, 0). By the cross product formula, its length, which is
a2 + c2 , is also equal to a2 + c2 + 1 sin θ. It follows that a2 +c2 = O(a2 +c2 +1)δ 2 ;
therefore,
O(δ 2 )
(3) a2 + c2 = = O(δ 2 ),
1 − O(δ 2 )
and hence |a| = O(δ). By convexity of P , the plane Hp intersects the nonnegative part
of the z-axis, and pz , the z-coordinate of p, is nonpositive. By (3) and |Op| = O(δ),
it follows that
0 ≤ b = pz − apx − cpy ≤ a2 + c2 p2x + p2y = O(δ 2 ).
We examine each σi separately, omitting the cases i = 1, m − 1, which are trivial
644 BERNARD CHAZELLE, DING LIU, AND AVNER MAGEN
modifications of the general case 1 < i < m − 1. The curve σi lies outside the interior
of Hw+i ∩ Hw+i+1 , and hence of Q. It is naturally broken up into three parts, σ j ⊂ Σj
i i
(j = 1, 2, 3), each one of them being a polygonal curve whose edges lie in any one of
four planes: Ki , Ki+1 , Hwi , and Hwi+1 . Applying Lemma 6.7 with (pi , − → −−→
p−
i qi , pi pi ) in
the role of (O, x, z) and wi in the role of p, we find that Hwi intersects the segment
pi pi for c large enough (note that this c is the one in the definition of Ki ); similarly,
Hwi+1 intersects pi+1 pi+1 . This shows that pi is the intersection of the ray (pi , ηpi )
with the plane Ki ; therefore, pi is the same point in the definition of σi and σi−1
, thus
proving that the curve σ is, indeed, connected. (The danger was having pi defined
by Hwi+1 .) We now bound the length of σi .
• By√Lemma 6.7 the slopes of the edges√of σi1 are chosen among 0 for Ki ;
O( ε ) for Ki+1 ; O(λ) for √ Hwi ; and O( ε ) for Hwi+1 . It follows that |σi1 | ≤
|pi qi |/ cos θ, where θ = O( ε ); therefore, |σi1 | = (1 + O(ε))|pi qi |. The same
argument shows that |σi3 | = (1 + O(ε))|qi pi+1 |.
• Let qi , qi be the endpoints of the curve σi2 (Figure 6), and let a, a , b, b be
the distances along the ray (qi , ηpi ) from qi to Ki , Ki+1 , Hwi , and Hwi+1 ,
respectively. By definition of Si ,
|qi qi | = max min{a, a }, min{b, b } .
Within Σ2i , the curve σi2 is a polygonal line consisting of at most a constant
number of edges. It is not difficult to see that for any vertex v of σi2 (including √
qi and qi ), the angle between qi v and edges of σi2 incident to v is π/2±O( ε ).
This follows from a simple geometric observation: given any plane H whose
normal makes with qi v an angle at most α, the angle formed by qi v and any
line on H lies in the range [π/2 − α, π/2 + α]. Since any of the edges of σi2
lies on one of four planes, Ki , K √i+1 , Hwi , and Hwi+1 , and the normal of each
of them makes an √ angle of O( ε) with qi v, the claim follows. Because the
folding angle of O( ε ) can be assumed to be less than, say, π/2, this implies
that the curve σi2 lies entirely√at a distance O(|qi qi |+|qi qi |) from qi . It follows
that |σi2 | = O(|qi qi | + |qi qi |) ε.
Putting everything together we find that
√ √
|σi | = (1 + O(ε) + O(λ ε ))(|pi qi | + |qi pi+1 |) + O(λ2 ε ).
In view of the fact that |p1 p1 | = |pm pm | = cλ2 , summing up over all |σi |’s (there are
O(1/ε) of them),
√ √
|σ | = (1 + O(ε) + O(λ ε ))|σ| + O(λ2 / ε )
= (1 + O(ε))|σ| + O(ε)
= (1 + O(ε))|σ|,
which completes the proof of Theorem√ 6.3. Note that the setting of λ is made to
ensure that the additive term O(λ2 / ε ) is O(ε).
SUBLINEAR GEOMETRIC ALGORITHMS 645
REFERENCES