To appear in Algorithmica Finding a Closest Visible Vertex Pair Between Two Polygons Nancy M. Amatoy Coordinated Science Laboratory and Department of Computer Science University of Illinois at Urbana-Champaign 1308 W. Main St. Urbana, IL 61801 email: [email protected] Abstract Given nonintersecting simple polygons and , two vertices 2 and 2 are said to be visible if does not properly intersect or . We present a parallel algorithm for nding a closest pair among all visible pairs ( ), 2 and 2 . The algorithm runs in time (log ) using ( ) processors on a CREW PRAM, where = j j + j j. This algorithm can be implemented serially in ( ) time, which gives a new optimal sequential solution for this problem. P pq p; q O n Q P p P q Q Q p P O n q Q n P Q n 1 Introduction Computing the minimum distance between two nonintersecting simple polygons P and Q is a well studied problem in computational geometry. There are two common variants of this problem: (i) nding a closest pair of boundary points between P and Q, and (ii) nding a closest pair of mutually visible vertices between P and Q, where vertices p 2 P and q 2 Q are visible if pq does not properly intersect P or Q. The former variant is known as the separation problem [DK90], and we will refer to the latter variant as the closest visible vertex or the CVV problem (see Fig. 1). The Euclidean distance between a pair of points realizing the closest visible vertex distance between P and Q is denoted by cvv (P; Q). For convenience, in this paper we will refer to the CVV problem as nding cvv (P; Q), e.g., a solution of cvv (P; Q) will give a pair (p; q ) realizing cvv (P; Q), p 2 P and q 2 Q. Although the separation and the CVV problems appear to be closely related, it seems no benet for either problem has been gained by this similarity in the past; in fact, the algorithms proposed for these two problems have diered greatly from one another. Computing the closest visible vertex distance between two polygons P and Q has received much attention. Let jP j + jQj = n. The CVV problem has been addressed sequentially in various cases. When both P and Q are convex, cvv (P; Q) can be computed sequentially in time (n) [MT85, Tou84, CSW85]. If exactly one of P or Q is convex, then cvv (P; Q) can also be computed sequentially in time (n) [CSW85, Wan83]. Several sequential CVV algorithms have been proposed This paper appeared in preliminary form as [Ama92] y This work was supported in part by an AT&T Bell Laboratories Graduate Fellowship, the Joint Services Electron- ics Program (U.S. Army, U.S. Navy, U.S. Air Force) under contract N00014-90-J-1270, and NSF Grant CCR-89-22008. 1 P Q qc p c qs p s Figure 1: The separation of P and Q is realized by the pair (ps ; qs), and the closest visible vertex distance is realized by the pair (pc ; qc ). when neither P nor Q is convex: Wang and Chan [WC86] have given an algorithm for computing cvv(P; Q) in time O(n log n), Aggarwal et al. [AMSS89] proposed an optimal (n) algorithm for this problem, and recently Hershberger and Suri [HS93] have given a general technique which can be used to solve several problems dealing with shortest paths in simple polygons, including the CVV problem, in O(n) time. In parallel, the CVV problem has been addressed for the case in which neither polygon is convex by Hsu et al. [HCL92]. Their O(log n) time and O(n) processor algorithm is patterned after the sequential algorithm of Aggarwal et al.. The model of parallel computation used by Hsu et al. is the CREW PRAM, which is a shared memory machine that supports concurrent reads from (but not writes to) a common shared memory location in unit time; for details of the various PRAM models consult [KR90]. In this paper we study the problem of determining cvv (P; Q) in the most general case, i.e., when P and Q are any two nonintersecting simple polygons. We describe a parallel algorithm for computing cvv (P; Q) that runs in time O(log n) using O(n) processors on a CREW PRAM. Although it is not work-optimal, our algorithm is time-optimal, as shown by Atallah and Goodrich [AG88]. Actually, they show that any parallel algorithm for the separation problem requires (log n) time on an exclusive write PRAM (i.e., an EREW or a CREW PRAM) with a polynomial number of processors; however, their argument can easily be applied to the CVV problem as well. Our CVV algorithm consists of two phases: (i) rst the problem of computing cvv (P; Q) is decomposed into a collection of linearly separable subproblems, and then (ii) the subproblems are solved independently, and the subproblem realizing cvv (P; Q) is identied. The sequential algorithms of Wang and Chan [WC86], and Aggarwal et al. [AMSS89], and the parallel algorithm of Hsu et al. [HCL92] all have this same general strategy. We give a new decomposition technique that is much simpler than the corresponding methods used in the above mentioned CVV algorithms [WC86, AMSS89, HCL92]. Our solution of the linearly separable subproblems is a modication of the sequential technique of Aggarwal et al., which includes some new ideas and some concepts rst introduced in the sequential algorithm of Wang and Chan. However, we must modify the technique of Aggarwal et al. for solving the subproblems since, as is discussed in Section 3.2, the technique, as presented in [AMSS89], does not always correctly determine cvv (P 0; Q0); since this portion of the parallel algorithm of Hsu et al. is a direct parallelization of the method of Aggarwal et al., their algorithm suers this shortcoming as well. A sequential version of our parallel algorithm can be implemented in (n) time, which gives a new optimal sequential algorithm for the general version of the CVV problem. An advantage of this 2 algorithm over the optimal sequential algorithm of Aggarwal et al. is that the decomposition phase is much simpler. In particular, the decomposition proceeds in our algorithm by performing some simple modications to a shortest path in a simple polygon, whereas the algorithm of Aggarwal et al. uses the complicated window tree data structure [Sur87]. Due to its generality, the sequential CVV algorithm resulting from the new technique of Hershberger and Suri [HS93] is somewhat more complicated than our sequential algorithm; briey, whereas we need only a single shortest path in a certain simple polygon, their technique builds (during preprocessing) a powerful data structure that implicitly contains every shortest path between two sets of vertices in the simple polygon. Another feature of our CVV algorithm is that we have shown that the same general strategy can be used to solve the separation problem as well, i.e., there is no underlying geometric reason that past algorithms for the CVV and separation problems have diered so greatly from one another. In particular, we show in [Ama93] that the CVV algorithm presented here can be modied to nd the separation of two simple polygons; the parallel separation algorithm uses O(log n) time and O(n) processors on a CREW PRAM, and its sequential version runs (n) time. This improves over the best previous sequential time bound of O(n log n) which was based on generalized Voronoi diagrams [Kir79, For87, Yap87]. The parallel complexity of the separation problem had not been previously studied except in the special case in which both polygons are convex [AG88, DK87]; however, a solution of the general case can be found in O(log2 n) time using O(n) processors on a CREW PRAM since generalized Voronoi diagrams can be computed within these resource bounds [GO Y93]. 2 Nonintersecting Simple Polygons In this section we decompose the problem of computing cvv (P; Q) into a collection of restricted subproblems. The decomposition is based on a sequence of line segments separating P and Q, and the subproblems are of the following form: compute cvv (P 0; Q0), where P 0 and Q0 are linearly separable subchains of P and Q, respectively. Although similar decomposition takes place in the parallel algorithm of Hsu et al. [HCL92], and in the sequential algorithms of Wang and Chan [WC86] and Aggarwal et al. [AMSS89], the methods used in these algorithms to nd an appropriate set of separating line segments and to construct the subproblems are quite involved. The parallel algorithm of Hsu et al. introduces data structures called merging trees which are combined with other complicated calculations; they rst present a complex O(log2 n) time and O(n) processor divide-and-conquer decomposition method, and then they use a technique built upon merging tree data structures (requiring such operations as splitting a single merging tree into a sequence of merging trees) to reduce the time complexity to O(log n). The sequential decomposition technique of Aggarwal et al. is built upon the window tree data structure [Sur87], (parallelization of this technique would require the nontrivial parallelization of the window tree data structure). The decomposition step of the sequential algorithm of Wang and Chan requires O(n log n) time (this technique uses an inherently sequential greedy scanning process). In contrast, the decomposition technique proposed here is very simple: the sequence of separating line segments is constructed by modifying a shortest path in a simple polygon that lies between P and Q, and once this set of separating line segments is found the denition of the subproblems is almost immediate. There are two general situations that we distinguish: the containing case, when CH (P [ Q) is identical to CH (Q) or CH (P ), and the non-containing case (see Fig. 2). Note that in the non3 p qt t l t Q q P Q l l Q 2 q b 1 l 2 l l l 1 l p P P l 0 er el 4 3 l l 4 3 5 l 0 p b l b (a) (b) Figure 2: The (a) non-containing, and (b) containing cases. containing case we can reduce the problem of computing cvv (P; Q) to that of computing cvv (P 0; Q0), where P 0 and Q0 are the facing portions of P and Q between the two common supporting lines to CH (P ) and CH (Q). Another feature of our decomposition technique is that it allows the containing and the non-containing cases to be treated identically after the sequence of separating line segments is found, whereas the CVV algorithms of Wang and Chan, Aggarwal et al., and Hsu et al. all treat the containing and non-containing cases dierently. The decomposition technique is outlined in Algorithm 2.1. Algorithm 2.1 DECOMPOSE(P; Q) Step 1. Find a sequence of line segments separating P and Q. (a) Construct a simple polygon R that lies between P and Q. In the non-containing case (see Fig. 2(a)), nd the two common supporting lines lt and lb to CH (P ) and CH (Q); R is formed from P 0 and Q0 and the segments qb pb and qtpt of lb and lt, respectively, between P and Q. In the containing case we assume without loss of generality that CH (P [ Q) = CH (Q) (see Fig. 2(b)). In this case, R is formed from the portion of the plane that lies between P and Q by adding a segment between two visible vertices p 2 P and q 2 Q; this segment is viewed as two edges of R. (If CH (P [ Q) = CH (Q) but P is not contained within Q, then we also include an edge of CH (Q) in R.) (b) Find a shortest path in R. In the non-containing (containing) case, nd the shortest path in R between pb and pt (the two instances of p). (See coarse dotted line in Fig. 2.) (c) Extend the segments of the shortest path to the boundary of R. Let SP (P; Q) = (l0sp, l1sp , : : :, lksp,1) denote the resulting sequence of segments. 4 Q + q i+1 P l i+1 Q i p+ = t i i + q i + q i-1 Pi b i + p i-1 l i l i-1 Figure 3: The subchains Pi and Qi associated with li. (d) Remove redundant segments from the shortest path. Identify the subset S (P; Q) = (l0; l1; : : :; lm,1) of SP (P; Q) that satises: (i) l0 = l0sp , and (ii) li is the maximal (indexed) segment in SP (P; Q) that intersects li,1 , for i increasing, 0 < i < m k. In the containing case, all arithmetic is modulo m and we require lm,1 \ l0 6= ;. (See ne dotted line segments in Fig. 2.) We now give some useful denitions. A vertical orientation is associated with each segment li 2 S (P; Q) so that the bottom (top) endpoint bi (ti ) of li is the endpoint closest to li,1 (li+1 ). It is a simple matter to verify that each li 2 S (P; Q) intersects both P and Q, either at an endpoint or at some interior point of li ; let p+i and qi+ denote the highest points of intersection of li with P + = qb , p+ = pt, and Q, respectively. For convenience, in the non-containing case let p+,1 = pb , q,1 m + and qm = qt . The subchain of P beginning at pi and ending at pj , in a clockwise scan of P , is denoted by Ppi ;pj (pi and pj may be any points on the boundary of P ); the subchain Qqi;qj is dened analogously with counterclockwise replacing clockwise. Step 2. Construct the subproblems. For each segment li 2 S (P; Q) we dene a subproblem cvv(Pi; Qi), where Pi and Qi are subchains of P and Q, respectively, separated by li. The subchains Pi, 80 i < m, are dened as follows; subchains Qi are dened analogously. (See Fig. 3.) (a) The initial assignment of subchains to li. 8 < P + + if ti 2 P or i = m , 1 Pi = : Ppi+,1;pi+ otherwise pi,1 ;pi+1 (b) Prune the initial subchains, if necessary. If ti 2 P , and li+1 is not perpendicularly visible from p+i = ti (i.e., the perpendicular segment from p+i to li+1 intersects P ), then we prune Pi as follows. Assume li+1 is horizontal, and let px be the rightmost vertex of Pp+i ;p+i+1 . Delete all vertices of Pi above bi+1 that lie to the left of px. We rst examine the complexity of DECOMPOSE, and then we prove its correctness. 5 2.1 Complexity of DECOMPOSE Let n = jP j+jQj. Computing the set of separating line segments S (P; Q) in Step 1 of DECOMPOSE can be accomplished in O(log n) time using O(n) processors on a CREW PRAM. The classication of containing or non-containing requires that we compute the convex hulls of P , Q, and P [ Q, and then test whether CH (P [ Q) is identical to CH (P ) or CH (Q); the former can be accomplished in O(log n) time using O(n= log n) processors on an EREW PRAM [Che90, DK90], and the latter can be done in constant time using O(n) processors. In the non-containing case the simple polygon R is completed by segments belonging to the two common supporting lines of CH (P ) and CH (Q) (see Fig. 2(a)); these supporting lines can be found by the O(log n) sequential technique of Dobkin and Kirkpatrick [DK90] when merging CH (P ) and CH (Q) to form CH (P [ Q). The construction of R in the containing case is nearly as simple. Assume CH (P [ Q) = CH (Q), let p 2 P be the vertex of P with largest y -coordinate, and let E be the subset of the edges of Q [ CH (Q) that are intersected by the horizontal line through p. Find the closest edges to p in E , from both the left and the right; denote these edges by el and er , respectively (see Fig. 2(b)). Let q be the vertex of the subchain of Q (closest to p) between el and er with smallest y -coordinate; clearly p and q are visible and thus the segment pq can be used to form R. All of the above computations can be carried out by standard parallel techniques in O(log n) time using O(n= log n) processors on an EREW PRAM [KR90]. If CH (P [ Q) = CH (Q), but P is not contained in Q, then the edge of CH (Q) needed to separate R from the unbounded region can be found by a list ranking process within these same resource bounds. The shortest path in Step 1(b) can be computed in O(log n) time using O(n= log n) processors by the technique of Goodrich et al. [GSG90]; this technique requires that R be triangulated which can be done in O(log n) time using O(n) processors [Goo89]. The extension of the endpoints of the shortest path in Step 1(c) can be done by ray shooting queries (i.e., given a simple polygon R and a query ray r, what is the rst edge of R that is hit by r); the technique of Goodrich et al. [GSG90] answers such queries in O(log n) time with a single processor. The removal of the redundant segments from SP (P; Q) in Step 1(d) can be performed by a list ranking process in O(log n) time using O(n= log n) processors. The construction of the subproblems in Step 2 is straightforward once S (P; Q) is found. Each subproblem can be dened in O(1) time, and, if necessary, the pruning of the subchains can be accomplished in O(log n) time with O(n) processors using ray shooting queries [GSG90]. Thus, Step 2 requires O(log n) time and O(n) processors. A CREW PRAM is needed for Steps 1 and 2 since the ray query data structure may be involved in O(n) simultaneous queries, i.e., concurrent accesses. We will show in Section 2.2 that cvv (P; Q) = min0i<m fcvv (Pi; Qi )g. It is immediate to verify from the denition of Pi and Qi that no point of P or Q appears inPmore than four subproblems. Therefore, the size of all subproblems in aggregate is at most 4n, i.e., i<m i=0 jPi j+jQi j = O(n). Thus, assuming that, as will be established in Section 3, cvv (Pi; Qi) can be solved in O(log jPi j + log jQi j) time using O(jPi j + jQij) processors on a CREW PRAM, 80 i < m, we have the following theorem. Theorem 2.1 If P and Q are nonintersecting simple polygons, then cvv(P; Q) can be computed in O(log n) time using O(n) processors on a CREW PRAM, where n = jP j + jQj. 6 Proof: The subproblems cvv(Pi; Qi), 80 i < m, are constructed within the desired time and processor bounds by DECOMPOSE. Next, each subproblem is solved independently in O(log n) time using a total of O(n) processors, and the subproblem achieving the minimum solution is selected in O(log n) time using O(n= log n) processors. We note that DECOMPOSE can be implemented in O(n) sequential time. The only portions of the above description that require more than O(n) work are the shortest path computation and the ray shooting queries. The shortest path can be found in O(n) time using the technique of Guibas and Hershberger [GH89]; this requires that the polygon rst be triangulated which Chazelle has shown can be done in linear time [Cha91]. It is a simple matter to verify that the extension of the endpoints in Step 1(c) and the pruning of the subchains in Step 2(b) can be accomplished by linear scans of the simple polygon R, i.e., in O(n) time. We will see in Section 3 that the subproblem cvv (Pi; Qi) can be solved sequentially in O(jPi j + jQij) time, 80 i < m, which gives a new optimal sequential algorithm for the CVV problem. Corollary 2.1 If P and Q are nonintersecting simple polygons, then cvv(P; Q) can be computed sequentially in (n) time, where n = jP j + jQj. 2.2 Correctness of Algorithm DECOMPOSE We now turn our attention to establishing the correctness of DECOMPOSE. In the following lemmas we show that cvv (P; Q) = min0i<m fcvv (Pi; Qi)g. In this section, x(v ) and y (v ) denote the x-coordinate and the y -coordinate, respectively, of the point v , and d(u; v ) denotes the Euclidean distance between points u and v . For convenience, we use v w (v w) to indicate that vertex v is below (above) vertex w, where the terms above and below are in reference to the bottom-to-top orientation associated with each li 2 S (P; Q). In addition, for the purpose of our discussion in this section, the endpoints of the segments on the boundaries of P and Q will be treated as vertices; this will not introduce any spurious solutions since we can simply disregard the endpoints that are not true vertices when solving the subproblems. We begin by establishing that every pair of visible vertices p 2 P and q 2 Q is assigned to some subproblem in Step 2(a) of DECOMPOSE. Lemma 2.1 Let P and Q be nonintersecting simple polygons with S (P; Q) as dened above. If p 2 P and q 2 Q are visible, pq \ li 6= ;, and pq \ li,1 = ;, then p 2 Pi and q 2 Qi , where the subchains Pi and Qi are the original subchains dened in Step 2(a) of DECOMPOSE. Proof: Consider a pair of visible vertices p 2 P and q 2 Q satisfying the conditions of the lemma, i.e., pq \ li 6= ;, and pq \ li,1 = ;. Since pq does not intersect li,1 , it must be that p p+i,1 and q qi+,1. Without loss of generality assume ti 2 P (see Fig. 3), so that p p+i = ti , i.e., p 2 Pi . It is easy to verify that no vertex q 0 qi++1 , q 0 2 Q, is visible from li ; this follows from the fact that S (P; Q) is constructed from extensions of segments forming a shortest path in R, and that li+1 is the highest segment in this path that intersects li . Since by hypothesis p and q are visible, the above fact implies q qi++1 , i.e., q 2 Qi . We must now show (i) cvv (Pi; Qi) cvv (P; Q), 80 i < m, i.e., no spurious solutions to the original problem are introduced by the subproblems, and (ii) no pair that could realize cvv (P; Q) is removed from consideration by the pruning described in Step 2(b) of DECOMPOSE. 7 p+ t i= i pi+= t i P p* li+1 Q bi+1 q* li+1 p li p* P Pi Pi bi+1 p x q* li Q (b) (a) Figure 4: (a) If p and q , realizing cvv (Pi; Qi ), are not visible, then cvv (P; Q) < cvv (Pi; Qi) = d(p; q ). (b) No vertex pruned from Pi can be a closest visible vertex to Q. Lemma 2.2 Let P and Q be nonintersecting simple polygons with S (P; Q), Pi and Qi as described above. Then any pair (p ; q ) realizing cvv (Pi; Qi) is either (i) visible in P and Q, or (ii) if p and q are not visible, then cvv (P; Q) < d(p; q). Moreover, no pair of vertices that could potentially realize cvv (P; Q) will be neglected due to the pruning described in Step 2(b) of DECOMPOSE. Proof: Without loss of generality assume that li+1 is horizontal and that ti 2 P ; this implies that bi+1 2 P . Initially, we shall assume that no pruning of Pi was required in Step 2(b) of DECOMPOSE, i.e., that ti = p+i is perpendicularly visible from li+1 . Let (p; q ) be a pair of vertices realizing cvv (Pi; Qi), p 2 Pi and q 2 Qi . If p and q are visible in P and Q then we are done, so assume p and q are not visible in P and Q. Note that the only obstructions in P and Q between Pi and Qi can be due to P + = Pp+i ;p+i+1 ; this follows from the fact that Qi lies on the opposite side of both li and li+1 from Pi . Since p and q are not visible, there must be at least one vertex of P + that lies below p q ; let p0 be the rightmost such vertex (see Fig. 4(a)). Since p+i is perpendicularly visible from li+1 , we have x(q ) < x(p0) < x(p), and since p0 lies below the line through p and q , we have y (q ) < y (p0) < y (p ); thus, d(p0; q ) < d(p; q ) = cvv (Pi; Qi). If p0 and q are visible then we are done, i.e., cvv (P; Q) d(p0; q ) < cvv (Pi; Qi ). If p0 and q are not visible, then a simple argument shows that cvv (P; Q) < d(p0; q ) < cvv (Pi; Qi). We now remove the assumption that p+i is perpendicularly visible from li+1 . Recall that Step 2(b) will remove those vertices of Pi that lie to the left of the rightmost vertex of P + ; let px denote the rightmost vertex of P + and let Pi0 (Pi00) denote the portion (not) pruned from Pi (see Fig. 4(b)). Note that the highest indexed vertex of Pi00 is perpendicularly visible from li+1 so that the previous argument shows that cvv (P; Q) cvv (Pi00; Qi). Thus, we need only show that cvv(P; Q) < cvv (Pi0; Qi), i.e., that no pair of vertices that could potentially realize cvv (P; Q) will be neglected due to the pruning of Pi . To obtain a contradiction, assume cvv (P; Q) is realized by pair (pq ), p 2 Pi0 and q 2 Qi . Since the only vertices of Q that are visible from p lie below and to the right of px, it must be that x(p ) < x(px) < x(q ) and y (p) < y (px) < y (q ), i.e., d(px; q) < d(p; q). However, if px and q are visible then we have cvv (P; Q) d(px; q ), and if px and q are not visible, then again a simple argument shows that cvv (P; Q) < d(px ; q ) < cvv (Pi0; Qi ). 8 pl p+ p p* r(p)+ P (p) W(p) q r(p)- p- l Figure 5: The visible wedge W (p) for a vertex p 2 P . 3 Linearly Separable Polygonal Chains We now consider two disjoint polygonal chains P and Q that can be separated by a line l; we allow vertices and edges of P and Q to lie on l. We present an algorithm for this special case that determines cvv (P; Q) in O(log n) time using O(n) processors on a CREW PRAM. As mentioned before, the CVV algorithms of Wang and Chan [WC86], Aggarwal et al. [AMSS89], and Hsu et al. [HCL92] also dene and solve subproblems of this type when solving a general instance of the CVV problem. The algorithm given here incorporates ideas rst used in the sequential CVV algorithms of Wang and Chan and Aggarwal et al., and in particular our general approach is very much patterned after the algorithm of Aggarwal et al.; since Hsu et al. solve problems of this special type by parallelizing the sequential algorithm of Aggarwal et al., our algorithm also bears a great similarity to theirs. However, there are some notable instances in which our algorithm departs from all of the above mentioned algorithms; in particular, there are some problem instances for which the algorithm of Aggarwal et al. (and thus also that of Hsu et al.) will fail to compute cvv (P; Q) correctly. For the sake of readability, we defer our discussion of the similarities and dierences between our algorithms until the end of this section. Without loss of generality the line l is assumed to be vertical, Q lies to the left of l, jP j = np , jQj = nq , n = np + nq , and the vertices of P and Q are assumed to be indexed bottom-to-top. We begin with some useful denitions (see Fig. 5). For every vertex p 2 P , the visible wedge of p, denoted by W (p), is the interior of the maximal wedge with apex p whose interior contains no vertex of P and all points of l visible from p. The upper and lower rays dening W (p) are denoted by r(p)+ and r(p), , respectively, and p+ and p, denote r(p)+ \ l and r(p), \ l, respectively. (If r(p)+ \ l = ; then p+ = +1, and if r(p), \ l = ; then p, = ,1.) The visible angle of p, is the angle, in W (p), between the rays r(p), and r(p)+ and is denoted by (p). Finally, let lp be the line perpendicular to l that passes through p, and denote l \ lp by pl . Analogous denitions hold for vertices of Q. Throughout this section, d(u; v ) denotes the Euclidean distance between points u ,! vu and vw , and 4(u; v; w) denotes and v , 6 (u; v; w) denotes the clockwise angle between the rays ,! the triangle formed by the points u, v and w. We now state some lemmas that are useful in reducing the number of candidate pairs that must be considered when computing cvv (P; Q). 9 W(p ) Q l P j u+ i R(p ) p j i p i p u-i W(p ) k k qj W(p ) i Figure 6: The feasible region R(pi ) for a vertex pi 2 P . Although pi and qj are visible, they can't realize cvv (P; Q). Lemma 3.1 Let P and Q be polygonal chains that are separated by a line l. If (p; q) realizes cvv(P; Q), then pl 2 W (q) and ql 2 W (p). Proof: Assume the lemma is false, and let (p; q) be a pair realizing cvv(P; Q) such that pl 62 W (p). Clearly, q 2 W (p) and assume, without loss of generality, that y (pl ) > y (p+ ) (see Fig. 5). By denition of W (p), there must be some vertex p 2 P that lies on pp+ . Note that 6 (p; p+; q ) 90 since y (q ) < y (p+ ) < y (p) and x(q ) x(p+ ) < x(p); thus, (a) triangles 4(p; p+; q ) and 4(p; p+; q ) are similar, and (b) d(p; q ) > d(p; p+). Conditions (a) and (b), respectively, establish that (i) d(p; q) < d(p; q ), and (ii) d(p; t) < d(p; q), t 6= q and t 2 4(p; p+; q). Therefore, p and q are visible since W (p) contains no vertices or edges of P and 4(p; p+; q ) W (p) can contain no vertices (and thus no edges) of Q; the latter statement is established by noting that by hypothesis q is a closest visible vertex of Q to p and that by (ii) above, any point in 4(p; p+; q ) is closer to p than q . Thus, p and q are a pair of visible vertices with d(p; q ) < d(p; q ), contradicting the hypothesis that (p; q ) realizes cvv (P; Q). Lemma 3.2 ([WC86]) Let P and Q be polygonal chains that are separated by a line l such that P and Q are monotone with respect to l. If (p; q ) realizes cvv (P; Q), then (p) 90 and (q ) 90. We now assume that P and Q have been pruned according to Lemmas 3 and 4 (i.e., the subchains are monotone with respect to l and the visible angle of every remaining vertex is at least 90), and that the size of these pruned subchains is jP j = np and jQj = nq , respectively. The following fact concerning the remaining subchains is readily veried. Fact 3.1 Let P and Q be polygonal chains that are separated by a line l such that P and Q are monotone with respect to l. If vertices p 2 P and q 2 Q are not visible, then d(p; q ) > cvv (P; Q). We next dene a feasible region for each vertex p 2 P , denoted by R(p); regions R(q ), 8q 2 Q, are dened analogously. We associate with each vertex pi 2 P , two points of Q, u+i and u,i (see Fig. 6). The point u+i is the highest point of Q that satises: (i) u+i 2 W (pi ), and (ii) 10 y (pi ) y (u+i ) y(u+i+1). Similarly, the point u,i is the lowest point of Q that satises: (i) u,i 2 W (pi), and (ii) y(pi) y (u,i ) y (u,i,1 ). (The y -coordinate of u+nq +1 (u,0 ) is assumed to be +1 (,1).) The region R(pi) is bounded above by the segment pi u+i and the horizontal ray originating at u+i , and is bounded below by the segment pi u,i and the horizontal ray originating at u,i . Note that R(p) is properly contained in W (p), 8p 2 P , and that the set of the lower (upper) boundaries of the feasible regions R(p), 8p 2 P , is monotone with respect to the separating line l. The following lemma shows that although vertices p 2 P and q 2 Q may be visible, if p 62 R(q ) or q 62 R(p), then d(p; q ) > cvv (P; Q). Lemma 3.3 Let P and Q be polygonal chains that are separated by a line l and monotone with respect to it, (p) 90 , and (q ) 90, 8p 2 P; q 2 Q. If (p; q ) realizes cvv (P; Q), then p 2 R(q ) and q 2 R(p). Proof: Assume the lemma is false, and that (pi; qj ) realizes cvv(P; Q) but qj 62 R(pi) and/or pi 62 R(qj ). Clearly, if pi and qj are not visible they cannot realize cvv (P; Q); therefore we assume pi and qj are visible. Without loss of generality assume that qj lies below R(pi) (see Fig. 6), the other cases are similar. Because pi and qj are visible, by denition of R(pi ), there must exist some vertex pk , k < i, such that qj lies below W (pk ). Since pk and qj are not visible, by Fact 3.1 we have d(pk ; qj ) > cvv (P; Q). Moreover, since (pk ) 90, and both pi and qj lie outside W (pk ), we have d(pi; qj ) > d(pk ; qj ). Thus, d(pi; qj ) > d(pk ; qj ) > cvv (P; Q). In order to prot from Lemma 5, we now consider the np nq matrix M whose entries are dened as follows. Let B 0 be some constant that is greater than the maximal distance between P and Q, and let B = B 0 + nq . We use q < R(p) or q > R(p) to indicate that q lies below R(p) or above R(p), respectively. 8> < B , j if qj < R(pi) or pi > R(qj ) M [i; j ] = > d(pi; qj ) if pi 2 R(qj ) and qj 2 R(pi) :1 otherwise By Lemma 5, the above matrix M contains the distances between all pairs of vertices that are candidates for closest visible vertices. Note that if qj 62 R(pi ) or pi 62 R(qj ), then M [i; j ] B , j B 0 > cvv (P; Q). Further note that, since R(p) W (p) and R(q ) W (q ), all candidate pairs (p; q ) are visible. Thus, a minimum entry in M will yield cvv (P; Q). We now give the following denitions. An m n matrix consisting of real entries is called monotone if the minimum entry in its ith row lies below or to the right of the minimum entry in the (i , 1)st row, 81 < i m. (If a row has several minima then we take the leftmost one.) Furthermore, a matrix is called totally monotone if each of its 2 2 submatrices (minors) is monotone. Atallah and Kosaraju [AK91] show that if every entry of a totally monotone matrix can be computed in constant time, then a minimum entry in every row can be found in O(log m +log n) time using O(m + n) processors on a CREW PRAM. Note that, given R(p) and R(q ), 8p 2 P; q 2 Q, each entry in M can easily be found in constant time. Motivated by the above discussion, we now show that the matrix M dened above is totally monotone. Lemma 3.4 Let P and Q be polygonal chains that are separated by a line l and monotone with respect to it, (p) 90 and (q ) 90, 8p 2 P and q 2 Q. The matrix M described above is totally monotone. 11 Proof: We rst establish: (i) If M [i; j ] = B , j , then M [i0; j ] = B , j , and (ii) If M [i; j ] = d(pi; qj ), then M [i0; j ] = 6 1, 81 i < i0 np. To establish claim (i) we argue as follows. Since M [i; j ] = B,j , either pi lies above R(qj ) or qj lies below R(pi ). If pi lies above R(qj ), then pi0 must also lie above R(qk ), and M [i0; j ] = B , j . If qj lies below R(pi ), then qj must also lie below R(pi0 ), and M [i0; j ] = B , j . We now consider claim (ii). Since M [i; j ] = d(pi; qj ), it must be that pi 2 R(qj ) and qj 2 R(pi ), and if M [i0; j ] = 1, then it must be that pi0 lies below R(qj ) or qj lies above R(pi0 ). However, pi0 cannot lie below R(qj ) since pi 2 R(qj ) and pi0 is above pi , and qj cannot lie above R(pi0 ) since qj 2 R(pi) and R(pi) is below R(pi0 ). c of M formed by the To see that M is totally monotone, consider the 2 2 submatrix M c intersection of rows i and j , i < j , and columns k and l, k < l; note that M is not monotone if and only if (a) M [i; l] < M [i; k] and (b) M [j; k] M [j; l]. It is easy to verify that (M [i; k]; M [i; l]) 2 f(B,k; B,l); (B,k; d(pi; ql)); (d(pi; qk ); d(pi; ql)); (B,k; 1); (d(pi; qk ); 1); (1; 1)g (an analogous set can be constructed for the possible values of (M [j; k]; M [j; l]), by replacing i with j ). Since condition (a) cannot be satised if M [i; l] = 1, the rst three values in the above set are the only c might not be monotone. If M [i; k] = B , k and M [i; l] = B , l, then, possibilities in which M c is monotone. If M [i; k] = B , k and by (i) above, M [j; k] = B , k and M [j; l] = B , l, and M M [i; l] = d(pi ; ql), then, by (i) and (ii) above, M [j; k] = B , k and M [j; l] 2 fB , l; d(pj ; ql)g; since, c is monotone. M [j; k] = B , k > B , l > d(pj ; ql), M The nal possibility is that M [i; k] = d(pi; qk ) and M [i; l] = d(pi; ql). In this case, by (ii) above, M [j; k] 6= 1 and M [j; l] 6= 1, i.e., (M [j; k]; M [j; l]) 2 f(B , k; B , l); (B , k; d(pj ; ql)); c is monotone, i.e., M [j; k] > M [j; l] since B , k > (d(pj ; qk ); d(pj ; ql ))g. If M [j; k] = B , k, then M B , l > d(pj ; ql ). The remaining case is when M [j; k] = d(pj ; qk ) and M [j; l] = d(pj ; ql), i.e., pi and pj are both visible from qk and ql . Thus, the vertices pi , pj , qk , and ql form a convex quadrilateral; recall that in a convex quadrilateral, the sum of the lengths of the diagonals is larger than the sum of the lengths of the opposite sides, i.e., M [i; l]+ M [j; k] > M [i; k]+ M [j; l]. Thus, it is not possible c is monotone. that M [i; l] < M [i; k] and M [j; k] M [j; l], i.e., M Lemmas 3 through 6 constitute the basis of the following algorithm for computing cvv (P; Q) when P and Q are linearly separable polygons. Algorithm 3.1 LinSep-CVV(P; Q) Step 1. Remove vertices that are not perpendicularly visible from l, and vertices that have visible angles less than 90 degrees. Step 2. Find the feasible regions R(p) and R(q) for all vertices p 2 P and q 2 Q remaining under consideration. Step 3. Find the minimum entry in the matrix M , which identies a pair realizing cvv(P; Q). 3.1 Complexity of LinSep-CVV We rst consider the pruning operations of Step 1. Note that a vertex p 2 P is perpendicularly visible from l if and only if the horizontal ray emanating from p in the direction of l does not intersect any edge of P . Further note that the wedge W (p) is identied by the rst edges on 12 the shortest paths from p to p1 and pnp , respectively. We recall that Goodrich et al. [GSG90] give techniques, requiring preprocessing of O(log n) time and O(n) processors, for a triangulated simple polygon that can answer ray shooting queries and can identify the rst edge of a shortest path in O(log n) time using a single processor. Since P and Q are separated by l, an appropriate simple polygon can be found and triangulated in O(log n) time using O(n) processors [Goo89]. Thus, Step 1 requires O(log n) time and O(n) processors on a CREW PRAM. (Alternatively, these pruning operations can be performed by modied versions of parallel planar convex hull algorithms; appropriate choices are the optimal O(log n) time CREW PRAM algorithm independently due to Atallah and Goodrich [AG86] and Aggarwal et al. [ACG+ 88], and the optimal O(log n) time EREW PRAM algorithm of Miller and Stout [MS88].) Ray shooting queries also prove useful in Step 2 when constructing the regions R(p) and R(q ), 8p 2 P; q 2 Q. Without loss of generality, we describe a divide-and-conquer strategy to nd the point u+i for each pi 2 P ; the points u,i can be found analogously. Initially, each vertex pi sets its u+i point to be rst point of Q intersected by r(pi)+ ; this point is found by a ray shooting query. Next, the polygonal chain P is partitioned into two subchains P1 = Pp1 ;pbnp =2c and P2 = Ppbnp =2c+1 ;pnp . Recursively compute the u+i point for each vertex of P1 (P2 ) when only considering the subchain P1 (P2 ). Also, nd the u+i point with smallest y -coordinate within each subchain; for Pi , denote this additional point by u(Pi ), i = 1; 2. Consider pi 2 P2 ; the u+i point computed for pi within P2 is the nal u+i point for pi in P . Next, consider pi 2 P1 ; the nal u+i point in P for pi is the point with minimum y -coordinate among u(P2) and the u+i point computed for pi within P1 . Note that, given u(P1 ) and u(P2 ), the above calculation can be done in O(1) time using one processor per vertex, and in addition, the point u(P ), for chain P = P1 [ P2 , can be computed in constant time with a single processor. Thus, the recurrence has depth O(log np ) and computes the points u+i , 81 i np, in time O(log np) using O(np) processors. Once the u+i and u,i points are known, the regions R(pi), 81 i n, can be computed in constant time using one CREW PRAM processor for each pi 2 P . In Step 3, we use the algorithm of Atallah and Kosaraju [AK91] to nd a minimum entry in each row of the totally monotone matrix in time O(log n) using O(n) processors on a CREW PRAM; a minimum entry in M , and thus cvv (P; Q), can then be found within these same resource bounds by nding the minimum of the row minima. The above discussion establishes the following theorem. Theorem 3.1 If P and Q are linearly separable polygonal chains, then cvv(P; Q) can be found in time O(log n) using O(n) processors on a CREW PRAM, where n = jP j + jQj. Although the parallel algorithm described above performs O(n log n) work, there exists a more ecient serial algorithm. It is easy to see that the pruning required in Step 1, and the computation of the feasible regions R() in Step 2 can accomplished sequentially by performing O(1) linear scans of P and Q; this linear scanning technique was used by the sequential CVV algorithms of [WC86] and [AMSS89], and is similar to the process of nding the convex hull of a simple polygon [BE84] or of triangulating a polygon monotonic with respect to a line [GJPT78]. A minimum entry in the totally monotone matrix M can then be found in O(n) time using the algorithm of of Aggarwal et al. [AKM+ 86]. Corollary 3.1 If P and Q are linearly separable polygonal chains, then cvv(P; Q) can be found in (n) sequential time, where n = jP j + jQj. 13 l Q P p q Figure 7: The maximal subchain monotone with respect to the separating line l encountered on a clockwise (counterclockwise) scan of P (Q) may not contain the vertex p (q ) that realizes cvv (P; Q). The dotted line segments identify the portions deleted from P and Q. 3.2 Relation to Other CVV Algorithms We now discuss the similarities and dierences between LinSep-CVV, our algorithm for nding cvv(P; Q) when P and Q are linearly separable, to other algorithms (both parallel and sequential) for this special case of the CVV problem. Wang and Chan [WC86] were the rst to propose the general method of decomposing a general instance of the CVV problem into a collection of linearly separable subproblems. In their solution of the linearly separable subproblems, they introduced the notion of pruning the polygonal chains by noticing that a vertex with visible angle less than 90 cannot be part of a closest visible pair. They solve the subproblems by a divide-and-conquer process requiring O(n log n) time. The algorithm of Aggarwal et al. [AMSS89] builds upon the general paradigm proposed by Wang and Chan: they solve the general problem by solving subproblems involving linearly separable subchains. They begin by pruning the chains so that they are monotone with respect to the separating line l. The motivation of the pruning step is to construct regions analogous to our feasible regions R() (dened by bottom and top anchors in Aggarwal et al.) which can be used to form a totally monotone matrix whose minimum entry will identify cvv (P; Q). However, the process by which they form the monotone chains may potentially eliminate vertices which can realize cvv (P; Q). In particular, the (original) polygonal chain P (Q) is pruned as follows: the pruned chain P 0 (Q0) is a maximum subset of the vertices of P that are encountered on a clockwise (counterclockwise) scan of P (Q) so that each vertex is visible from some point on l (not necessarily perpendicularly) and the vertices of P 0 (Q0 ) are monotone with respect to l. Note that vertices that are not perpendicularly visible from l may be retained in P 0 (Q0) and that vertices that block the perpendicular visibility of some other vertices of P (Q) from l may be discarded. It is a simple matter to verify that visible vertices realizing cvv (P; Q) can be eliminated by this pruning process (see Fig. 7). We remark that this problem is easily xed by adding the requirement that each vertex on the resulting subchain must be perpendicularly visible from l. Another potential problem with the pruning process of Aggarwal et al. is that they do not explicitly eliminate vertices with visible angles less than 90. This fact becomes problematical 14 when they dene their totally monotone matrix. Specically, entries in their matrix are dened in a similar manner to the way we have done it here, and they claim that a minimum entry in this matrix will yield cvv (P; Q). However, recall that in our case the fact that all remaining vertices have visible angles at least 90 was instrumental in establishing that our matrix M contained the distances between all candidates for closest visible pair (Lemma 5). It is not clear that this claim can be established if vertices with visible angles less than 90 are retained in the candidate pool. The parallel algorithm for the linearly separable subproblems of Hsu et al. [HCL92] is a direct parallelization of the technique of Aggarwal et al. An exception is that they prune vertices from the subchains that have visible angles less than 90. Thus, their algorithm also suers from the rst problem (but not the second) noted above for the algorithm of Aggarwal et al.. In summary, our algorithm introduces the requirement of perpendicular visibility, and incorporates techniques from both the sequential algorithms of Wang and Chan [WC86] and Aggarwal et al. [AMSS89]. Wang and Chan proposed the requirement that all candidate vertices must have visible angles of at least 90. Aggarwal et al. provided the notable innovation of applying the searching techniques for totally monotone matrices to the CVV problem; our feasible regions R() are modeled after similar constructs used in their algorithm to dene entries in their matrix. 4 Conclusion We have given a parallel algorithm for computing a closest visible vertex pair between two nonintersecting simple polygons in O(log n) time using O(n) processors on a CREW PRAM. This algorithm consists of two distinct phases: the rst phase decomposes the original problem into a collection of restricted subproblems which are solved independently in the second phase. This same general strategy was used in the sequential algorithms of Wang and Chan [WC86] and Aggarwal et al. [AMSS89], and in the parallel algorithm of Hsu et al. [HCL92]. We provide a new decomposition technique that is much simpler than those used in these other CVV algorithms [WC86, AMSS89, HCL92]. In addition, a serial version of our algorithm can be implemented in (n) time and thus provides a new optimal sequential algorithm that is simpler than that of Aggarwal et al.. Recently, Hershberger and Suri [HS93] have proposed an algorithm for computing row-wise minima or maxima of an implicit, totally-monotone matrix whose entries represent shortest-path distances between pairs of vertices in a simple polygon; this technique requires a linear amount of preprocessing to build a shortest path tree and is quite general in that it can be used to solve several geometric problems dealing with simple polygons and shortest path distances. After the initial preprocessing to form the shortest path tree, their algorithm can be used to solve the CVV problem in (n) time. However, since our CVV algorithm was designed specically for the CVV problem, our algorithm is simpler than the two phase CVV algorithm implied by the technique of Hershberger and Suri, i.e., the process of building the shortest path tree and performing the matrix search, considered as a whole, is more involved than our CVV algorithm. Although it is time-optimal (as established by Atallah and Goodrich [AG88]), our parallel algorithm is not work-optimal, i.e., the processor-time product is O(n log n). In order to obtain an optimal parallel algorithm for this problem, it seems that either the parallel complexity of triangulating a simple polygon and of nding the minimum value in a totally monotone matrix 15 need to be reduced, or, more likely, an entirely dierent approach is required. We note that parallelizing the sequential technique of Hershberger and Suri is not a good strategy for obtaining an optimal parallel algorithm since it also requires monotone matrix searching. 5 Acknowledgement The author would like to thank Franco Preparata and the anonymous referees whose comments greatly improved the presentation of this paper. References [ACG+88] A. Aggarwal, B. Chazelle, L. Guibas, C. O 'Dunlaing, and C. Yap. Parallel computational geometry. Algorithmica, 3:293{327, 1988. [AG86] M. J. Atallah and M. T. Goodrich. Ecient parallel solutions to some geometric problems. J. Parallel Distrib. Comput., 3:492{507, 1986. [AG88] M. J. Atallah and M. T. Goodrich. Parallel algorithms for some functions of two convex polygons. Algorithmica, 3:535{548, 1988. [AK91] M. J. Atallah and S. R. Kosaraju. An ecient parallel algorithm for the row minima of a totally monotone matrix. In Proc. 2nd ACM-SIAM Sympos. Discrete Algorithms, pages 394{403, 1991. [AKM+ 86] A. Aggarwal, M. M. Klawe, S. Moran, P. Shor, and R. Wilber. Geometric applications of a matrix searching algorithm. In Proc. 2nd Annu. ACM Sympos. Comput. Geom., pages 285{292, 1986. [Ama92] N. M. Amato. Computing the minimum visible vertex distance between two nonintersecting simple polygons. In Proc. 1992 Conf. Inform. Sci. Systems, volume II, pages 800{805, Princeton, NJ, 1992. [Ama93] N. M. Amato. An optimal algorithm for nding the separation of simple polygons. In Proc. 3rd Workshop Algorithms Data Struct., volume 709 of Lecture Notes in Computer Science, pages 48{59. Springer-Verlag, 1993. (To appear in International Journal of Computational Geometry & Applications as: Determining the Separation of Simple Polygons.) [AMSS89] A. Aggarwal, S. Moran, P. W. Shor, and S. Suri. Computing the minimum visible vertex distance between two polygons. In Proc. 1st Workshop Algorithms Data Struct., volume 382 of Lecture Notes in Computer Science, pages 115{134. Springer-Verlag, 1989. [BE84] B. K. Bhattacharya and H. ElGindy. A new linear convex hull algorithm for simple polygons. IEEE Trans. Inform. Theory, IT-30:85{88, 1984. [Cha91] B. Chazelle. Triangulating a simple polygon in linear time. Discrete Comput. Geom., 6:485{524, 1991. 16 [Che90] D. Z. Chen. Ecient geometric algorithms in the EREW-PRAM. In Proc. 28th Allerton Conf. Commun. Control Comput., pages 818{827, 1990. [CSW85] F. Chin, J. Sampson, and C. A. Wang. A unifying approach for a class of problems in the computational geometry of polygons. Visual Comput., 1:124{132, 1985. [DK87] N. Dadoun and D. Kirkpatrick. Optimal parallel algorithms for convex polygon separation. Report 89-21, Dept. Comput. Sci., Univ. British Columbia, Vancouver, British Columbia, Canada, 1987. [DK90] D. P. Dobkin and D. G. Kirkpatrick. Determining the separation of preprocessed polyhedra { a unied approach. In Proc. 17th Internat. Colloq. Automata Lang. Program., volume 443 of Lecture Notes in Computer Science, pages 400{413. Springer-Verlag, 1990. [For87] S. J. Fortune. A sweepline algorithm for Voronoi diagrams. Algorithmica, 2:153{174, 1987. [GH89] L. J. Guibas and J. Hershberger. Optimal shortest path queries in a simple polygon. J. Comput. Syst. Sci., 39:126{152, 1989. [GJPT78] M. R. Garey, D. S. Johnson, F. P. Preparata, and R. E. Tarjan. Triangulating a simple polygon. Inform. Process. Lett., 7:175{179, 1978. [Goo89] M. T. Goodrich. Triangulating a polygon in parallel. J. Algorithms, 10:327{351, 1989. [GO Y93] M. T. Goodrich, C. O 'Dunlaing, and C. Yap. Constructing the Voronoi diagram of a set of line segments in par all el. Algorithmica, 9:128{141, 1993. [GSG90] M. T. Goodrich, S. B. Shauck, and S. Guha. Parallel methods for visibility and shortest path problems in simple polygons. In Proc. 6th Annu. ACM Sympos. Comput. Geom., pages 73{82, 1990. [HCL92] F. R. Hsu, R. C. Chang, and R. C. T. Lee. Parallel algorithms for computing the closest visible vertex pair between two polygons. Internat. J. Comput. Geom. Appl., 2(2):135{162, 1992. [HS93] J. Hershberger and S. Suri. Matrix searching with the shortest path metric. In Proc. 25th Annu. ACM Sympos. Theory Comput. (STOC 93), pages 485{494, 1993. [Kir79] D. G. Kirkpatrick. Ecient computation of continuous skeletons. In Proc. 20th Annu. IEEE Sympos. Found. Comput. Sci., pages 18{27, 1979. [KR90] R. M. Karp and V. Ramachandran. Parallel algorithms for shared memory machines. In J. van Leeuwen, editor, Handbook of Theoretical Computer Science, pages 869{941. Elsevier/The MIT Press, Amsterdam, 1990. [MS88] R. Miller and Q. F. Stout. Ecient parallel convex hull algorithms. IEEE Trans. Comput., C-37(12):1605{1618, 1988. 17 [MT85] [Sur87] [Tou84] [Wan83] [WC86] [Yap87] M. McKenna and G. T. Toussaint. Finding the minimum vertex distance between two disjoint convex polygons in linear time. Comput. Math. Appl., 11:1227{1242, 1985. S. Suri. Minimum link paths in polygons and related problems. Ph.D. thesis, Dept. Comput. Sci., Johns Hopkins Univ., Baltimore, MD, 1987. G. T. Toussaint. An optimal algorithm for computing the minimum vertex distance between two crossing convex polygons. Computing, 32:357{364, 1984. C. Wang. Intersection and minimum distance problems for planar polygons. M.Sc. thesis, Dept. Comput. Sci., Univ. Alberta, Edmonton, Alberta, Canada, 1983. C. A. Wang and E. P. F. Chan. Finding the minimum visible vertex distance between two nonintersecting simple polygons. In Proc. 2nd Annu. ACM Sympos. Comput. Geom., pages 34{42, 1986. C. K. Yap. An O(n log n) algorithm for the Voronoi diagram of a set of simple curve segments. Discrete Comput. Geom., 2:365{393, 1987. 18
© Copyright 2026 Paperzz