KAIST Department of Computer Science

0 downloads 0 Views 290KB Size Report
Jun 23, 1998 - for the convex polygon G as follows: nd two congruent closed disks whose .... endpoint of I. Clearly, all problems considered in this paper satisfy the ...... in which side of Q? the s-vertex pi lies, and then identify the pair by .... Let lg (resp., lh) be a line that is perpendicular to the line segment gh and passes.
Two-Center Problems for a Convex Polygon Chan-Su Shin

1

Jung-Hyun Kim Sung Kwon Kim Kyung-Yong Chwa 1

2

1

CS/TR-127 June, 23, 1998

KAIST Department of Computer Science

Two-Center Problems for a Convex Polygon Chan-Su Shin1, Jung-Hyun Kim1, Sung Kwon Kim2, and Kyung-Yong Chwa1 1 Dept. of Comp. Sci., KAIST, Taejon, 305-701, KOREA

fcssin,

g

jhkim, kychwa @jupiter.kaist.ac.kr

2 Dept. of Comp. Sci. Eng., Chung-Ang U., Seoul, 156-756, KOREA [email protected]

1 Introduction Let S be a set of n points in the plane. The standard 2-center problem for S is to cover S by the union of two congruent closed disks whose radius is as small as possible. The standard 2-center problem has been studied extensively studied. The best algorithm, due to Sharir [15] and slightly improved by Eppstein [9], runs in randomized expected O(n log2 n) time. As a variant of the standard 2-center problem, we can consider the discrete 2-center problem for S that nds two congruent closed disks whose union covers S , and whose centers are two points of S . Recently, this problem was solved in O(n4=3 log5 n) time [1]. In this paper, we consider some variants of the 2-center problems for the point set. Let G be a convex polygon of n vertices in the plane. We consider the standard 2-center problem for the convex polygon G as follows: nd two congruent closed disks whose union covers G (its boundary and interior) and whose radius is minimized. Like the discrete 2-center problem for the point set, we also consider its discrete version with centers at some vertices of G. Compared with the 2-center problems for the point set, the di erences are that (1) points covered by two disks are the vertices of G in convex positions (not in arbitrary positions) and (2) the union of two disks should cover the edges of G as well as the vertices of G. By the points in convex positions, we mean that the points form the vertices of a convex polygon. The former means the problem is easier than the standard point-set 2-center problem, but the latter tells us that it might be more dicult. Let G be a convex polygon of n vertices in the plane. We assume in this paper that the vertices of G are in general circular position, meaning that no four or more vertices are cocircular. The model of computation used throughout the paper is the extended real RAM (for details refer to [14]). Our results are summarized as follows.

{ We rst consider the discrete 2-center problem for the convex polygon G. We show that

the problem can be solved in O(n log3 n) time. This result can be used to solve the discrete 2-center problem for a set of n points in convex position in O(n log3 n) time. The discrete 2-center problem for a set of the points in arbitrary positions is solved in O(n4=3 log5 n) time [1], thus our result says that the convex position is a crucial constraint for improving the time bound for points in arbitrary positions. { We next consider the standard 2-center problem for the convex polygon G, and present an O(n2 log3 n)-time algorithm. The best known deterministic 2-center algorithm for the point set runs in O(n log4 n= log log n) time; this bound can be obtained by combining the

results presented by Eppstein [9] and by Chan [7]. Thus there is a room for improvement here, however we have been not able to reduce our bound further. All algorithms presented in this paper are based on the parametric search technique proposed by Megiddo [13]. Many of center problems for the point set have been solved by the technique [15, 9, 1]. In Section 2, we brie y review the parametric search technique. We explain how to solve the discrete and standard 2-center problems for the convex polygon in Section 3 and Section 4, respectively.

2 Parametric Search Technique Parametric search is an optimization technique which can be applied in situations where we seek a minimum parameter r satisfying the monotone condition that is met by all r  r but not by any r < r . The strategy of the parametric search is to design ecient sequential and parallel algorithms for the corresponding decision problem: decide whether a given parameter r is smaller than or larger than or equal to the minimum parameter r . Assume that we have both an ecient sequential algorithm As that, given an input data and a xed radius r, decides if r < r or r  r , and a parallel algorithm Ap, running on Valiant's model of computation [16]. We will denote the running time of As by Ts , the running time of Ap by Tp , and the number of processors it uses by Wp. Assume moreover that the

ow of execution of Ap depends only on comparisons, each of which is resolved by testing the sign of some low-degree polynomial in r. The parametric search technique executes Ap \generically", without specifying the value of r, with the intention of simulating its execution at the unknown value r . At each step of Ap , where there are at most Wp independent comparisons to resolve, the roots of the associated polynomials are computed. If we know between which two of them r lies, we can resolve the comparisons, because the sign of the polynomials is constant between consecutive roots, and continue to the next parallel step. Thus we search r in the list of O(Wp) roots, using binary search and utilizing As to decide if a given root ri is below or above r , i.e., ri < r or ri  r . This search requires O(Wp + Ts log Wp ) time per parallel step, for a total of O(Wp Tp + Ts Tp log Wp ) time. Throughout this execution of the generic Ap , we obtain a sequence of progressively smaller intervals, each known to contain r . When the entire algorithm terminates, it will have produced a left-closed interval I so that r is either its left endpoint or an interior point. However, the latter case is impossible, because the output of the generic algorithm is the same for all r in the interior of I , but the output must change at r , by de nition. Hence, r is the left endpoint of I . Clearly, all problems considered in this paper satisfy the monotone condition that G is covered by two disks of all radius r  r , but not by two disks of any radius r < r .

3 Discrete Two-Center Problem for a Convex Polygon Let G be a convex polygon of n vertices in the plane. The problem is to nd two congruent closed disks with centers at some vertices of G whose union covers G and whose radius is

minimized. To apply the parametric search technique to this problem, we have to solve the following decision problem: Given a xed radius r > 0, decide whether G is covered by (the union of) two congruent disks of radius r. As it will be proved below, for this decision problem, Ts = O(n log n), Tp = O(log n), and Wp = O(n log n). Thus the overall algorithm runs in O(n log3 n) time. For convenience, we assume that the vertices of G cannot be covered by any single disk of radius r with its center at any vertex of G; this can be checked in O(n) time by computing the farthest vertex for each vertex of G [3]. To help describe the decision algorithm, some de nitions and notation are needed. Consider two points p and q on the boundary of G, not necessarily vertices of G. The vertex interval hp; qi of G is de ned to be the set of vertices of G that we meet when we move in the clockwise direction on the boundary of G from p to q. Note that hp; qi 6= hq; pi and hp; qi[hq; pi is equal to the set of vertices of G. For a vertex v of G, we shall denote the disk of radius r centered at v by D(v). Let a(v) (resp., b(v)) be the rst intersection point of @ D(v)1 with @G as we follow @G starting from v in the clockwise (resp., counterclockwise) direction. Let us de ne A(v) to be the subchain of @G that is de ned when we move in the clockwise direction on @G from b(v) to a(v). Then A(v) contains v.

Lemma 1. The convex polygon G is covered by two disks of radius r if and only if there exists a pair of vertices, u and w, of G such that @G  A(u) [ A(w). Proof. If such a pair of vertices, u and w, exists, then G is clearly covered by two disks of radius r; one disk covering A(u) and the other disk covering A(w). Suppose now that G is covered by two disks D1 and D2 . Without loss of generality, we assume that D1 is to the left of D2 . It suces to prove that if the center of D1 is located at some vertex v, then the complementary boundary @G ? A(v) should be covered by D2 . For a contradiction, assume that there is a point z 2 @G ? A(v) that is not covered by D2 . Consider two vertex intervals ha(v); zi and hz; b(v)i. Since G cannot be covered by a single disk of radius r and G is convex, there must be at least one vertex in each vertex interval that is not contained in D1 . Let v0 and v00 be such vertices of ha(v); z i and hz; b(v)i, respectively. Of course, v0 6= v00 . It is easily checked that v and z must be covered only by D1 , and v0 and v00 must be covered only by D2 . This directly implies that @ D1 and @ D2 intersect at least four times, which is a contradiction.

2

We are now ready to give an algorithm for the decision problem. First, compute A(v) for each vertex v of G. Next, nd a pair of vertices, u and w, such that the union of A(u) and A(w) covers @G. Such a pair can be found by solving the minimum circle cover problem [12]. The problem is de ned as follows: Given n circular-arcs on a circle of radius r, nd a minimum number of circular-arcs whose union covers the circle. We can easily transform A(v)'s into the input (i.e., circular-arcs) of the minimum cover problem in linear time. Provided that the circular-arcs are sorted according to their starting points in the clockwise direction, the minimum circle cover problem is solved by a sequential algorithm [12] which runs in O(n) time and by parallel algorithms [6, 11] which run in O(log n) time with O(n) processors. Thus, 1 To denote the boundary of a closed, bounded region R, we will use the notation @R.

if the minimum number is equal to 2, then G is covered by two disks of radius r. Otherwise (i.e., > 2), G cannot be covered by any two disks of radius r. The most time-consuming step in our algorithm is a step of computing A(v)'s. In what follows, we show that the step can be done in O(n log n) sequential-time, and in O(log n) parallel-time with O(n) processors. Let p and q be the vertices of G whose distance is the diameter of G. Assume that p and q lie on x-axis, and p is to the left of q. The vertices divide @G into two chains; a lower chain GL = (u1 ; u2 ;    ; un1 ) and an upper chain GU = (w1 ; w2 ;    ; wn2 ), where u1 = w1 = p and un1 = wn2 = q. Then the chains are all x-monotone. In the remainder of this section, we explain the method of computing A(ui )'s only for the vertices ui of GL . To compute A(ui ) for a vertex ui of GL, we compute a(ui ) and b(ui ), separately. Since the de nition of b(ui ) is symmetrical to that of a(ui ), we will explain only the method of computing a(ui ) for each ui 2 GL. We partition the set of vertices of GL into two subsets, S1 = fui j a(ui ) 2 GLg and S2 = fui j a(ui ) 2 GU g. To determine to which subset each ui belongs, it suces to test whether or not D(ui ) contains p, because p and q are a farthest vertex pair of G. Consider two vertices ui and uj of S1 such that i < j . Since p and q are the farthest pair of G and GL is x-monotone, a(uj ) appears after a(ui ) when we move from p to q. Thus, we can compute each a(ui ) for each ui 2 S1 , in a total of O(n) time, as we traverse the edges of GL, from left to right, one by one. Let us now consider how to compute a(ui ) for each ui 2 S2 . Suppose that wk is a vertex of GU immediately to the right of a(ui ). The vertex wk is the rst vertex that is not contained by D(ui ) when we follow GU from p to q. In other words, D(ui ) covers the vertex interval hui ; wk?1i but not hui ; wk i. We will compute the vertex wk instead of a(ui ); a(ui ) is the intersection point between the edge (wk?1 ; wk ) and @ D(ui ). For a vertex interval L, we denote intersection of disks of radius r centered on the vertices of L, that is, I (L) = Tbyv2IL(LD)(vthe ). The intersection I (L) is a closed, bounded region in the plane, whose boundary consists of at most jLj arcs each of which is a circular-arc bounding D(v) for v 2 L. Since D(ui) covers hui ; wk?1i and does not cover hui; wk i, it holds that ui 2 I (hui ; wk?1 i) and ui 2= I (hui ; wk i). However, since hui ; w1 i is always contained in D(ui) for any vertex ui 2 S2, it is also true that ui 2 I (hw1 ; wk?1 )i and ui 2= I (hw1 ; wk i). To nd wk , we maintain a complete binary tree T . It stores the vertices w1 ;    ; wn2 in its leaves from left to right. A node  of T represents I (), where I () denotes the intersection of the disks centered on the vertices that are stored at leaves of the subtree rooted at . If a node  is the leaf storing the vertex wj , then I () is D(wj ) itself. If  is an internal node with left child !l and right child !r , then I () = I (!l ) \ I (!r ). The boundary @I () is divided into an upper chain @I + () and a lower chain @I ? () by the leftmost and rightmost points on @I (). Actually, each node  maintains @I () in two doubly linked lists; one for @I + () and the other for @I ? (). We show in Appendix A that T can be computed in O(n log n) sequential-time and in O(log n) parallel-time with O(n) processors. If we can nd the vertex wk with the help of T in O(log n) time, then we can nd all wk 's (i.e., all a(ui )'s) for each ui 2 S2 within the bound we want.

From the de nition of wk , it holds that ui 2 I (hw1 ; wk?1 i) but ui 2= I (hw1 ; wk i). To search it, traverse T in the top-down fashion. At the root of  of T , check whether ui is contained in I (). The inclusion test is easily done in O(log n) time through binary searches in @I + () and in @I ? (). If  2 I (), then all the vertices of GU (including q) are contained in D(ui ). If q is contained in D(ui ), then the vertices of GL are also contained in D(ui ). That is, G is covered by the disk D(ui ). But this situation cannot occur because of the assumption that G cannot be covered by a single disk. Thus we automatically know that ui 2= I (). Next, do the same test for the left child !l of . If ui 2 I (!l ), then this implies that wk is not stored at some leaf in the subtree rooted at !l , so we go to the right child !r of ; otherwise, go to the left child !l . Continue this process until one reaches at some leaf in T . Then the vertex stored at the leaf is exactly wk . Since the inclusion test at some node takes O(log n) time, we need O(log2 n) time totally. However, it does not match the bound that we want. To reduce the bound to O(log n) , we employ the fractional cascading technique [8]. Consider the following problem: Given a binary tree of n nodes such that every node  contains a sorted list X (), construct a data structure that, given a walk of length h from the root to a leaf and an arbitrary element x, enables a single processor to locate x quickly in each X () for each  on the walk. The fractional cascading technique provides an ecient solution to this problem as follows:

Lemma 2. [8, 4] One can construct such a data structure, in O(m) time or in O(log m) time using O(m= log P m) processors, that enables to locate x in each X () in O(log m + h) time, where m = n +  jX ()j.

The tree T has two sorted lists @I + () and @I ? () at each node . The sum of size of @I + ()'s for nodes  at each level is O(n), so the total size m is O(n log n). Applying Lemma 2 to the sorted lists @I + ()'s in T , we can construct a data structure in O(n log n) sequentialtime and O(log n) parallel-time with O(n) processors. Construct another data structure for @I ? ()'s in T . Then we can perform all inclusion tests to nd wk in O(log m + h) = O(log n) time by Lemma 2. As a result, we can compute a(ui )'s for all vertices ui 2 S2 in O(n log n) sequential-time and O(log n) parallel-time with O(n) processors.

Theorem 1. Given a convex polygon G of n vertices in the plane, we can solve the discrete 2-center problem for G in O(n log3 n) time. Theorem 2. Given a set S of n points in convex positions in the plane, we can solve the discrete 2-center problem for S in O(n log3 n) time.

4 Standard 2-Center Problem for a Convex Polygon In this section, we present an O(n2 log3 n)-time algorithm for nding optimal two disks that covers a convex polygon G. To apply the parametric search technique, we solve the decision problem: Given a xed radius r > 0, decide whether G is covered by two disks of radius r. The decision problem is solved below as follows; Ts = O(n2 log n), Tp = O(log n), and Wp = O(n2 ). Thus, the overall algorithm runs in O(n2 log3 n) time.

Let D1 and D2 be two closed disks of radius r. We want to decide whether G  D1 [ D2 by locating D1 and D2 properly. By G  D1 [ D2 , we mean the union of D1 and D2 contains the edges of G as well as the vertices of G. Let ci denote the center of Di , and let Ci denote the circle bounding Di , for i = 1; 2. We may assume that two centers, c1 and c2 , are as close as possible. Then we can say that, for i = 1; 2, the circle Ci passes through at least one vertex of G that lies on the portion of Ci that appears on the boundary of the convex hull of D1 [D2 (see Figure 1 (a)). Such a vertex pair (p; q) through which C1 and C2 can pass in order to be G  D1 [ D2 is called a candidate vertex pair of G. We furthermore assume that G is not covered by a single disk of radius r; this is easily checked in O(n) time by computing the farthest Voronoi diagram of G [2]. From the above two assumptions, we can easily prove that p 2= D2 and q 2= D1 if C1 passes through p and C2 does through q for a candidate vertex pair (p; q). Using the same approach to Lemma 3 in [10], we can bound the number of candidate vertex pairs of G by O(n). Lemma 3. [10] Under the assumption that the vertices of G are in general circular positions, the number of candidate vertex pairs of G is O(n), and the pairs can be found in O(n) time. Suppose now that C1 and C2 pass through vertices p and q, respectively, where (p; q) is a candidate vertex pair. We assume that p and q lie on x-axis, and p is to the left of q. The candidate pair (p; q) divides @G, the boundary of G, into two chains; a lower chain GL = (u1 ;    ; un1 ) and an upper chain GU = (w1 ;    ; wn2 ), where u1 = w1 = p and un1 = wn2 = q. We shall denote by P and Q the circles of radius r centered at vertices p and q, respectively. Then the center c1 (resp., c2 ) should be located on P (resp., Q). More precisely, c1 is located on PR and c2 is located on QL . Here, PR (resp., QL ) denotes the semi-circle of the circle P (resp., Q) that lies on the right (resp., left) of the vertical line passing through p (resp., q). For each vertex v of G, draw a disk D(v) and compute intersections of @ D(v) with PR . Since two distinct circles intersect at most twice, the semi-circle PR has at most 2n ? 2 intersections. Sort them along PR in their y-coordinates. Then the intersections partition PR into O(n) circular-arcs Aj 's. wl

wl?1 q

p

Aj

p

uk?1 PR

(a)

q uk (b)

Fig. 1. (a) C (resp., C ) passes through at least one vertex p (resp., q). (b) De nitions of uk 1

2

and wl when c1 is located in Aj .

Suppose again that the center c1 of D1 is on the j -th arc Aj . See Figure 1 (b). Following the edges of GL from p to q, one meets an edge (uk?1 ; uk ) that C1 rstly intersects. Then

uk is the rst vertex that is not covered by D1 when we follow the vertices of GL from p to q. Similarly, we de ne the rstly intersected edge (wl?1 ; wl ) of GU with C1 . Wherever c1 is located on Aj , the set of the vertices covered by D1 is the same, thus vertices uk and wl are uniquely determined with respect to Aj . Then the following lemma holds.

Lemma 4. If the center c is located on Aj and G  D [D , then the vertex interval hwl ; uk i is covered by D . Proof. For a contradiction, assume that there is a vertex z 2 hwl ; uk i not covered by D . Without loss of generality, assume that z is a vertex of GU between uk and q. Clearly, z = 6 uk and z = 6 q. Since G  D [ D , p and z must be covered only by D , and uk and q must be covered only by D . This directly implies that C and C intersect at least three times, which 1

1

2

2

2

1

2

2

is a contradiction. 2

1

1

2

Let A0j be an arc on QL where the center cT 2 of D2 must be located to cover hwl ; uk i. By 0 0 the above lemma, the arc Aj is de ned as Aj = v2hwl ;uk i (D(v) \ QL ). If A0j = ;, then D1 [D2 cannot cover G wherever c1 is located on Aj . If A0j 6= ; and the center c2 is located on A0j , then D1 [ D2 covers all the vertices of G; however, we cannot say that every edge of G is covered by D1 [D2 because edges (uk?1 ; uk ) and (wl?1 ; wl ) may not be covered. Thus we have to check whether D1 [ D2 covers those two edges. We will iterate this process over each arc Aj . If there are no arc pairs (Aj ; A0j ) admitting G  D1 [ D2 , then G cannot be covered by any two disks of radius r. The decision algorithm is summarized below. Algorithm Standard 2-Center Decision (G; r)

(1) compute candidate vertex pairs of G by Lemma 3. (2) FOR each candidate vertex pair (p; q) DO ( note that this FOR loop is only a parametric search part. ) (2.1) compute arcs Aj 's on PR and sort them. (2.2) construct complete binary trees TL (resp., TU ) with vertices of GL (resp., GU ) in its leaves as we did in previous section. (2.3) FOR each arc Aj DO ( suppose that c1 is located in Aj . ) (2.3.1) nd two vertices uk , and wl by searching TL and TU . (2.3.2) compute an arc A0j on QL , corresponding to Aj . ( assume that A0j 6= ; and c2 is located in A0j . ) (2.3.3) IF (uk?1 ; uk ) and (wl?1 ; wl ) are covered by D1 [ D2 THEN return \YES". ( G is covered by D1 [ D2 . )

End-FOR End-FOR return \NO". ( G is not covered by any two disks of radius r ) End-algorithm

We can perform Step (2.1) and Step (2.2) in O(n log n) time and in O(log n) time with O(n) processors; we use Lemma 13 in Appendix A for Step (2.2). For a xed arc Aj , if we

can do Steps (2.3.1)  (2.3.3) in O(log n) time with a single processor, then we can perform Step (2.3) in O(n log n) sequential-time and in O(log n) parallel time with O(n) processors. Using the search procedure presented in the previous section, we can do Step (2.3.1) in

O(log n) time by searching TL and TU . Let us now compute the arc A0j for a xed arc Aj T in Step (2.3.2). Note that A0j = v2hwl ;uk i (D(v) \ QL ). To do it, we construct two segment trees KL and KU . LeavesTof KU store vertices of GU in x-increasing order and each node  of KU stores a circular arc v2S() (D(v) \ QL) on QL, where S () denotes the vertices stored at leaves of the subtree rooted at . The tree KU can be easily constructed in the bottomup fashion in O(n log n) sequential-time and O(log n) parallel-time with O(n) processors. Similarly, construct another segmentT tree KL for GL. Using the standard range searching T technique [14], we can compute arcs v2hwl ;qi (D(v) \ QL ) from KU and v2hq;uk i (D(v) \ QL ) from KL in O(log n) time. Since hwl ; uk i = hwl ; qi [ hq; uk i, the intersection of the computed arcs is the interval A0j . Consequently, we can compute intervals A0j for all intervals Aj within the desired bound. What remains is to check whether edges (uk?1 ; uk ) and (wl?1 ; wl ) are covered by D1 [ D2 when c1 is in Aj and c2 is in A0j (6= ;), for each pair (Aj ; A0j ). In Lemma 5, we will show that such a test for one arc pair can be done in O(1) time under the extended real RAM model. Thus Steps (2.3.1)  (2.3.3) are performed in O(log n) time with a single processors, and Step (2.3) can be done in in O(n log n) sequential-time and in O(log n) parallel-time with O(n) processors. Since there are O(n) candidate vertex pairs, the decision algorithm can be solved in O(n2 log n) sequential-time and in O(log n) parallel-time with O(n2 ) processors. Hence, we have the following result.

Lemma 5. Let d = (uk? ; uk ) and e = (wl? ; wl ). We can test whether d; e 2 D [ D in 1

1

1

O(1) time under the extended real RAM.

2

Proof. We shall use x(w) to denote x-coordinate of a vertex (or point) w. To proceed further, we need the following lemma; we omit its proof in this version.

Lemma 6. If uk? 2 D ? D and uk 2 D ? D , then x(uk? )  x(uk ). Similarly, if wl? 2 D ? D and wl 2 D ? D , then x(wl? )  x(wl ). Draw two circles @ D(uk? ) and @ D(wl? ), and compute their intersections with A0j . Then 1

1

1

2

1

2

2

1

2

1

1

1

1

1

A0j are divided into at most ve sub-intervals. When c2 is located in a sub-interval L, we have three cases depending whether or not D2 covers uk?1 or wl?1 . In the rst case that D2 covers both of them, D1 [ D2 covers two edges d and e obviously. The second case is that D2 covers only one of them. Suppose that uk?1 2 D2 and wl?1 2= D2 . Then the edge d is contained in D1 [ D2 , but the edge e may not be. To check if e 2 D1 [ D2 for c1 2 Aj and c2 2 L, it is sucient to check if maxc1 2Aj x(e \ C1 ) > minc2 2L x(e \ C2 ) by Lemma 6. This can be done in O(1) time. The dicult case is the third one that D2 covers neither uk?1 nor wl?1 . Let ai = Ci \ d and bi = Ci \ e for i = 1; 2; see Figure 2 (a). Lemma 6 implies that d; e 2 D1 [ D2 if and only if x(a1 ) ? x(a2 )  0 and x(b1 ) ? x(b2 )  0 for some c1 2 Aj and c2 2 L. We express the

wl

wl?1 p

Aj

uk?1

b2 b1

L

q

p

 1 Aj

L 2

q

uk

a1 a2

(a)

(b)

Fig. 2. (a) De nitions of ai and bi. (b) Representations of centers c and c as functions of angle parameter 1 and 2 .

1

2

centers c1 and c2 as functions of angle parameters, 1 and 2 , as shown in Figure 2 (b). Then x(ai ) (resp., x(bi )) becomes functions Fi (i ) (resp., Gi (i)) with parameters i for i = 1; 2. Let  = f(1 ; 2 ) j F1 (1 ) ? F2 (2 )  0 and G1 (1 ) ? G2 (2 )  0g. The following statement holds: d; e 2 D1 [ D2 ()  6= ;. To check whether  6= ;, we have to test the existence of intersections of two functions: F1 (1 ) ? F2 (2 ) = 0 and G1 (1 ) ? G2 (2 ) = 0. Through analyzing several cases, we prove that those functions intersect at most twice; the detailed proof is omitted in this version. Hence we can compute the intersections in O(1) time by Newton's approximation method in the extended real RAM model. 2

Theorem 3. Given a convex polygon G of n vertices in the plane, we can solve the standard

2-center problem for G in O(n2 log3 n) time.

5 Concluding Remarks In this paper, we investigate 2-center problems for a convex polygon. An immediate open question is to improve the time bound of our algorithms. In particular, we believe that the O(n2 log3 n) bound for the standard 2-center problem could be lowered suciently. It would be interesting to consider the standard 2-center problem for a set of the points in convex positions. The standard point-set 2-center problem can be solved in O(n log4 n= log log n) worst-case time [9, 7]. In spite of numerous e orts we have been unable to beat the complexity of O(n log4 n= log log n). It would be also interesting to consider the k-center problems for the convex polygon for general k > 2.

References 1. P. K. Agarwal, M. Sharir, and E. Welzl. The discrete 2-center problem. In Proc. 13th Annu. ACM Sympos. Comput. Geom., 1997. 147{155. 2. A. Aggarwal, L. J. Guibas, J. Saxe, and P. W. Shor. A linear-time algorithm for computing the Voronoi diagram of a convex polygon. Discrete Comput. Geom., 4(6):591{604, 1989. 3. A. Aggarwal, M. M. Klawe, S. Moran, P. Shor, and R. Wilber. Geometric applications of a matrix-searching algorithm. Algorithmica, 2:195{208, 1987. 4. M. J. Atallah, R. Cole, and M. T. Goodrich. Cascading divide-and-conquer: A technique for designing parallel algorithms. SIAM J. Comput., 18:499{532, 1989. 5. M. J. Atallah and M. T. Goodrich. Parallel algorithms for some functions of two convex polygons. Algorithmica, 3:535{548, 1988. 6. L. Boxer and R. Miller. A parallel circle-cover minimization algorithm. Inform. Process. Lett., 32(2):57{60, 1989. 7. T. M. Chan. Deterministic algorithms for 2-d convex programming and 3-d online linear programming. In Proc. 8th ACM-SIAM Sympos. Discrete Algorithms, pages 464{472, 1997. 8. B. Chazelle and L. J. Guibas. Fractional cascading: I. A data structuring technique. Algorithmica, 1:133{ 162, 1986. 9. D. Eppstein. Faster construction of planar two-centers. In Proc. 8th ACM-SIAM Sympos. Discrete Algorithms, 1997. 10. V. Estivill-Castro and J. Urrutia. Two- oodlight illumination of convex polygons. In Proc. 4th Workshop Algorithms Data Struct., pages 62{73, 1995. 11. S. K. Kim. Parallel algorithms for geometric intersection graphs. Ph.D. thesis, CS Dept., U. of Washington, 1990. 12. C. C. Lee and D. T. Lee. On a circle-cover minimization problem. Inform. Process. Lett., 18:109{115, 1984. 13. N. Megiddo. Applying parallel computation algorithms in the design of serial algorithms. J. ACM, 30:852{ 865, 1983. 14. F. P. Preparata and M. I. Shamos. Computational Geometry: An Introduction. Springer-Verlag, New York, NY, 1985. 15. M. Sharir. A near-linear algorithm for the planar 2-center problem. In Proc. 12th Annu. ACM Sympos. Comput. Geom., pages 106{112, 1996. 16. L. Valiant. Parallelism in comparison problems. SIAM J. Comput., 4(3):348{355, 1975.

A Constructing the tree T We here consider a problem of building the tree T that stores a vertex interval of G in its leaves. Notice that the vertices of the vertex interval may not form a sorted sequence according to their x-coordinates. Suppose that the vertices v0 ;    ; vm?1 of the vertex interval are stored in the leaves of T from the left to the right. The vertices appear consecutively along @G in the clockwise direction from v0 to vm?1 . Each node  of T maintains @I () as two doubly linked lists; one for @I + ()+ and the other for @I ? (). Note that the vertices stored in the leaves of the subtree rooted at  also form some vertex interval of G. The goal is to build T in O(m log m) sequential-time and in O(log m) parallel-time with O(m) processors. Before proceeding further, we need to state some useful geometric properties on the intersection I (L) for a vertex interval L. Suppose that each arc of @I (L) is labeled with an integer j if the arc belongs to the disk D(vj ). In the remainder, we will frequently refer to an arc as its label, instead of giving the arc's name directly. From the fact that the vertices of L are in convex positions, we can easily prove Lemma 7.

Lemma 7. Let L be a vertex interval of G. When we follow the arcs of @I (L) in the clockwise,

their labels form a circular sequence with no duplications, and the circular sequence is a subsequence of the clockwise-sequence of the vertices in L.

Lemma 8. Let L and L be vertex intervals of G such that they are disjoint each other and 1

2

every vertex of L2 appears after all vertices of L1 in the clockwise direction on @G. Then the number of intersections between @I (L1 ) and @I (L2 ) is zero, one (if the intersection is tangential), or two (proper intersections). Proof. Because @I (L1 ) and @I (L2 ) are both planar, closed curves, the number of proper intersections plus twice the number of tangential intersections is even. This implies that if the lemma were false, then the number of intersections have to be four or more. Thus one of two situations arises: (1) there is a tangential intersection and at least one more intersections, or (2) there are at least four proper intersections. In this proof, we consider only the second case; the rst case can be proved similarly. Suppose that we are moving along @I (L1 ) in the clockwise direction from a vertex of @I (L1 ) that lies outside I (L2 ). To have four or more intersections, @I (L1 ) enters inside I (L2 ) through the rst intersection p, and then leaves I (L2 ), and again enters I (L2 ) through the third intersection q. Assume that p = i \ k and q = j \ l, where i; j are the arcs of @I (L1 ) and k; l are the arcs of @I (L2 ). Consider the intersection I (fvi ; vj ; vk ; vl g). From the de nitions of p and q, the labels of the arcs in the intersection form the circular sequence of (i; l; j; k). However, the arc l cannot appear between the arcs i and j , by Lemma 7. 2

The tree T is constructed in a bottom-up fashion; compute @I () for each node  at each level from the bottom level to the top level. If a node  is the leaf storing the vertex vi , then @I () is @ D(vi ) itself. If  is an internal node with left child !l and right child !r , then @I () = @ (I (!l ) \ I (!r )). To compute @I (), we should compute all the intersections between @I (!l ) and @I (!r ). By Lemma 8, the number of intersections between the chains is at most two.

Sequential algorithm of constructing T : Since the number of the intersections is at most two, we can easily compute @I () from @I (!l ) and @I (!r ) in O(j@I (!l )j + j@I (!r )j) time by traversing the arcs of @I (!l ) and @I (!r ), simultaneously. Thus T is constructed in O(m log m) sequential-time.

Parallel algorithm of constructing T : To compute the intersections between @I (!l ) and @I (!r ), we compute all the intersections between two chains of them; @I + (!l ) and @I + (!r ), @I + (!l ) and @I ? (!r ), @I ? (!l ) and @I + (!r ), and @I ? (!l ) and @I ? (!r ). If they can be computed in O(1) time with O(j@I (!l )j + j@I (!r )j) processors, then the whole tree T can be constructed in O(log m) time with O(m) processors. In what follows, we will explain how to compute the intersections between two chains. Let P be a chain (@I + (!l ) or @I ? (!l )) of @I (!l ) with m1 vertices and let Q be a chain (@I + (!r ) or @I ? (!r )) of @I (!r ) with m2 vertices. Assume that the vertices of P and Q are ordered from the left to the right, and assume, for convenience, that m1 and m2 are

square numbers. Select every pm1 -th vertex of P (including the leftmost and rightmost vertices of P ), i.e., 0-th (the leftmost) vertex, (pm1 )-th vertex, (2pm1 )-th vertex,   , and nally (pm1 pm1 )-th (the rightmost) vertex. Then, at most pm1 + 1 vertices are selected; particularly, we shall call such sampled vertices s-vertices. We shall denote the (ipm1 )-th vertex by pi for 0  i  pm1 ; note that p0 and ppm1 are the leftmost and rightmost vertices of P , respectively. Let Pi be a subchain consisting of the arcs of P between pi and pi+1 for 0  i < pm1 . Similarly, we de ne each subchain Qj as a collection of the arcs of Q between qj and qj+1,pwhere qj is the (j pmp2)-th vertex ofpQ for 0  j  pm2 . Note that jPij  pm1 and jQj j  m2 for any 0  i < m1 , 0  j < m2 . The following lemmas will be used as basic routines.

Lemma 9. For some xed i, we can compute the intersections (if exist) between Pi and Q in O(1) time with O(m1 + m2 ) processors. The same for P and Qj for some xed j .

Proof. If there exist (at most two) intersections between Pi and Q, then we have to report them; otherwise, output \no intersections". We assume in this proof that P is a lower chain and Q is an upper chain; the similar approach can be applied for other cases. For the completeness of the proof, we augment Q with two horizontal rays; one from the leftmost end vertex to x = ?1 and the other from the rightmost end vertex to x = 1. We divide Q into subchains Q?1 ; Q0 ;    ; Qpm2 ?1 ; Qpm2 , where Q?1 (resp., Qpm2 ) is composed of only a horizontal ray emanating from q0 (resp., qpm2 ). Let us denote the x-range of Qj by Rj . By the x-range of Qj , we mean the interval on x-axis between the x-coordinates of end vertices of Qj . For each vertex w of Pi , we determine in whichpx-range the x-coordinatep of w lies. This is easily determined by pairwise comparisons of O( m1 ) arcs of Pi and O( m2 ) Rj 's. Thus it takes O(1) time if we use O(pm1 m2 ) processors. Consider an arc of Pi whose left and right end vertices fall into Rj1 and Rj2 , respectively. We now test if the arc intersects with each of Qj1 ;    ; Qj2 . Since each subchain Qj contributes to such tests at most twice, we can do the tests for all vertices of Pi in O(1) time with O(m2 ) processors. If no intersections are produced, then we know that Pi and Q do not intersect each other. Hence, the intersections (if exist) between Pi and Q can be computed in O(1) time with O(pm1 m2 + m2 ) = O(m1 + m2) processors. 2

Lemma 10. Suppose that P and Q intersects in at most one point and the intersection, if

exists, is not tangential. Then, we can determine whether they intersect, in O(1) time with O(m1 + m2 ) processors. Moreover, if the intersection exists, then we can report it in the same bound.

Proof. In this proof, we consider only when both of P and Q are upper chains. Let P ? (resp., Q? ) be a closed, unbounded region consisting of all points that lie on or below P (resp., Q). If P and Q intersect at one point and it is not tangential, then one of the following situations must arise: (1) one of end vertices of P is inside Q? and the other is outside Q? , or (2) one of end vertices of Q is inside P ? and the other is outside P ? . Without loss of generality, we assume that p0 is outside Q? and ppm1 is inside Q? . This implies that if P and Q intersect, then there is exactly one pair of s -vertices pi and pi+1 such that pi is outside Q? and pi+1 is inside Q? for some 0  ipm1 . Thus we nd the pair as follows: For each s -vertex pi , determine

in which side of Q? the s -vertex pi lies, and then identify the pair by comparing the side of pi with the sides of its neighboring s -vertices pi?1 and pi+1 . By the similar way as in the proof of Lemma 9, we can do it in O(1) time with O(m1 + m2 ) processors. If the pair does not exist, then we conclude that they do not intersect. Otherwise (if (pi ; pi+1 ) is that pair), then the intersection between P and Q lies on Pi . Accordingly, we suces to compute the intersection between Pi and Q by Lemma 9. It takes O(1) time with O(m1 + m2 ) processors. 2 We will rst explain how to detect the intersections between P and Q when P is an upper chain @I + (!l ) and Q is a lower chain @I ? (!r ). Let P ? (resp., Q? ) be a closed, unbounded region consisting of all points that lie in or below P (resp., in or above Q); see Figure 3 (a). Since at least one of four end vertices of P and Q must lie outside P ? or Q? , we can assume, without loss of generality, that p0 is outside Q? . We consider two cases: (1) ppm1 is inside Q? , and (2) ppm1 is outside Q? . In case (1), P and Q intersect in at most one point. If the upward vertical ray emanating from q0 does not meet P , then they must intersect in exactly one point, and moreover the intersection cannot be tangential. Hence, we can nd the intersection, by Lemma 10, in O(1) time with O(m1 + m2 ) processors. If the vertical ray meets P , then it is easy to see that P and Q do not intersect each other. The remaining case is that ppm1 is outside Q? . The possible con gurations that could occur are shown in Figure 3; the number of the intersections is zero, one (the intersection is tangential), or two (proper intersections). The idea to handle this case is to nd a point f on @ (P ? \ Q? ). Let l denote a vertical line through f . If f is not tangential, then one of two intersections between P and Q lies to the left of l and the other does to the right of l. We have now two subproblems, each of which can be solved by Lemma 10. If f is tangential, then f itself is the unique intersection. If f does not exist, then we conclude that P and Q have no intersections. q0

Q?

qpm2

Q p0

P? (a)

P ppm1 (c)

(b)

(d)

Fig. 3. Four possible con gurations when p and ppm1 both are outside Q? . 0

Let us now explain how to nd a point f . Let P 0 be a polygonal chain that consists of line segments joining the s -vertices pi and pi+1 . First, compute the intersections between P 0 and Q. To do it, we use the result [5] that computes the intersection of a line (or a line segment) with a convex polygon in O(1) time with the number of processors proportional to the square root of the size of the convex polygon. With a slight modi cation, we can apply the result to our case, so we can compute the intersections in O(1) time with O(pm1 m2 ) processors. If the intersection points between P 0 and Q are found, then one of them becomes f . Otherwise, we

need some lemma to proceed further. Let g 2 P 0 and h 2 Q be a closest pair of points that gives the minimum distance between P 0 and Q. Modifying the algorithm [5] that computes the minimum distance between two disjoint convex polygons, the closest point pair g and h can be obtained in O(1) time with O(m1 + m2 ) processors. Let gl and gr be the vertices of P 0 immediately to the left and immediately to the right of g. We denote by P (gl ; gr ) the subchain of the arcs of P between gl and gr . Clearly, the number of arcs of P (gl ; gr ) is at most 2pm1 ; if g is an s -vertex pi , then gl = pi?1 and gl = pi+1 , so P (gl ; gr ) = Pi?1 [ Pi ; otherwise (i.e., if g lies on a line segment pipi+1 ), P (gl ; gr ) = P (pi ; pi+1 ) = Pi . Borrowing the idea from [5], we can prove the following lemma.

Lemma 11. If f exists, then it must lie on P (gl ; gr ). Proof. Let lg (resp., lh ) be a line that is perpendicular to the line segment gh and passes through g (resp., h). It is clear that the lines lg and lh are tangential to P 0 and Q, respectively. We may assume that lg and lh are parallel to x-axis. Then P 0 is strictly below lg except at g, and Q is strictly above lh except at h. Suppose to the contrary that the point f lies to the right of gr (not on P (gl ; gr )). The point gr should lie on or below lg , and the point f must be on or above lh because f is on @ (P ? \ Q? ). This implies that P (g; f ), the subchain from g to f , cannot be convex, which completes the lemma. 2

Finding the point f on P (gl ; gr ) is equivalent to computing the intersections between P (gl ; gr ) and Q. This is done by Lemma 9. As a consequence, we can nd the intersections between the upper and lower chains in O(1) time with O(m1 + m2 ) processors We next explain the method of nding the intersections of P and Q when both P and Q are lower chains. Let P ? (resp., Q? ) be a closed region consisting of all points that lie in or above P (resp., Q). Without loss of generality, we assume that p0 is outside Q? . As did in the previous case, we consider two cases: (1) ppm1 is inside Q? , and (2) ppm1 is outside Q? . In case (1), P and Q intersect in at most one point, and the intersection P \ Q can be found within the desired bound (refer to the case (1) when P and Q are the upper and lower chains). In the following, we consider the case (2), that is, p0 and ppm1 both are outside Q? . Let t be a point on Q with minimum y-coordinate. The point t divides Q into the left subchain QL and the right subchain QR . Similarly, by the point s on P with minimum y-coordinate, P is divided into two subchains PL and PR . Note that each arc of PR and QR (resp., PL and QL ) belongs to the fourth (resp., the third) quadrant2 -arc of some circle of radius r. If t is outside P ? , then P and Q must intersect in exactly two points (if we regard one tangential intersection as two points); one is QL \ PL and the other is QR \ PR . Hence, by Lemma 10, we can compute the intersections within the desired bound. We now assume that t is inside P ? . Then one of the following situations occurs only: one is that jPL \ QL j = 2 but jPR \ QR j = 0, and the other is that jPL \ QL j = 0 but jPR \ QR j = 2. Suppose here that PR and QR intersect at points z1 and z2 , where z1 is to the left of z2 . We shall nd a point f on @ (PR \ Q? ). Check if there 2 A point

p in the plane partitions the plane into four quadrants. We refer to the quadrant f(x; y) j x  x(p); y  y(p)g as the rst quadrant. Here, x(p) and y(p) denote the x- and y-coordinates of p. The other

quadrants are referred to in the counterclockwise direction as second, third, and fourth quadrants. Four quadrant-arcs of a circle is similarly de ned.

exists an s -vertex pi in PR that is contained in Q? ; if exists, then f is set to the vertex pi . If no s -vertices pi 's lie on @ (PR \ Q? ), then @ (PR \ Q? ) is completely contained in a subchain Pj for some j < pm1 . This implies that if f exists, then it must lie on the subchain. To determine the subchain within constant time, we need the following lemma. QRPR vj+2 vj+1

z2 z1 QR t s PR

j

0

vj vi

i

vj

(a)

vi

0

(b)

Fig. 4. An illustration of Lemma 12. Lemma 12. Let d(p) be the vertical distance from a point p on PR to its vertically projected

point on Q. For any point p on PR (s; z1 ), the vertical distance d(p) is strictly increasing as p moves (from z1 ) toward s. Also, for any point p on PR (z2 ; ppm1 ), the vertical distance d(p) is strictly increasing as p moves (from z2 ) toward ppm1 . Proof. In this proof, we will prove the rst part of the lemma; the second part can be proved similarly. We begin with the fact that each arc of PR and QR belongs to the fourth quadrantarc of some r-radius circle. As shown in Figure 4 (a), suppose that z1 is the intersection point between the arcs i 2 PR and j 2 QR . Recall that the arcs i and j are circular-arcs of the circle centered at the vertices vi and vj . Then, from the geometric property of the circles with same radius, we can know that vi should be placed in the third quadrant of vj (see Figure 4 (b)). Consider the next arc j + 1 of arc j when we traverse from z1 to s. Then the vertex vj +1 should be placed in the rst quadrant of vj . For following arcs j + 2; j + 3;   , the same fact holds, thus the positions of the corresponding centers are determined as in Figure 4 (b). Since the vertices, vj ; vj +1 ;   , appear along @G in the clockwise direction, there are edges from vj to vj +1 , from vj +1 to vj +2 , and so on (cf. Lemma 7). For a contradiction, we assume that at a point on some arc j 0 (> j ) of QR , its vertical distance onto PR is not increasing rstly. Then there must exist an arc i0 (> i) of PR such that the y-decreasing rate of i0 is less than that of j 0 . This implies that the vertex vi0 should be placed in the rst or fourth quadrants of vj 0 . Note that vi0 appears after vi along @G in the clockwise direction. When we follow the vertices vj 0 , vi , and vi0 in that order, we cannot make a convex path through them, because vi and vi0 are placed in the di erent sides with respect to the vertical line passing through vj 0 . This contradiction completes the lemma. 2

Note that the vertical distance d(pi ) for each s -vertex pi in PR can be computed in O(1) time with O(m1 + m2 ) processors. Consider the s -vertices pl ; pl+1 ;    ; ppm1 in PR , where pl is the leftmost s -vertex among the s -vertices in PR between s and z1 ; if there are no s vertices between them, then pl is set to be s. The above lemma implies that the sequence of d(pl );    ; d(ppm1 ) has at most two local minima. (In fact, if two local minima exist, then they occur at consecutive two s -vertices.) It is easy to show that the minima can be found in O(1) time with O(pm1 ) processors. If the local minima occur at pk and pk+1 , then the point f is contained in a subchain between pk and pk+1 , i.e., Pk . If the local minima occur only at pk , then f is contained either in Pk or in Pk?1 ; in this case, we can identify on which subchain of them f lies by computing both of Pk \ Q and Pk?1 \ Q. As a result, we have the following result.

Lemma 13. The tree T for a vertex interval of G can be constructed in O(m log m) sequential-

time and in O(log m) parallel-time with O(m) processors. Here, m denotes the size of the vertex interval.