The Geodesic 2 -center Problem in a Simple Polygon
TThe geodesic -center problem in a simple polygon ∗ Eunjin Oh † Jean-Lou De Carufel ‡ Hee-Kap Ahn † § Abstract
The geodesic k -center problem in a simple polygon with n vertices consists in the follow-ing. Find a set S of k points in the polygon that minimizes the maximum geodesic distancefrom any point of the polygon to its closest point in S . In this paper, we focus on the casewhere k = 2 and present an exact algorithm that returns a geodesic -center in O ( n log n ) time. The geodesic k -center problem in a simple polygon P with n vertices consists in the following.Find a set S of k points in P that minimizes max p ∈ P min s ∈ S d ( s, p ) , where d ( x, y ) is the length of the shortest path between x and y lying in P (also called geodesicdistance ). The set S is called a k -center of P . Geometrically, this is equivalent to find k smallest-radius geodesic disks with the same radius whose union contains P .The -dimensional Euclidean k -center problem is similar to the geodesic k -center problem ina simple polygon P . The only difference is that in the Euclidean k -center problem, the distancebetween two points x and y is their Euclidean distance, denoted by (cid:107) x − y (cid:107) . That is, given aset P of n points in the plane, find a set S of k points in R that minimizes max p ∈P min s ∈ S (cid:107) p − s (cid:107) . Computing a k -center of points is a typical problem in clustering. Clustering is the taskof partitioning a given set into subsets subject to various objective functions, which have ap-plications in pattern-analysis, decision-making and machine-learning situations including datamining, document retrieval, and pattern classification [13]. The Euclidean k -center problemhas been studied extensively. The -center of P coincides with the center of the minimum en-closing circle of P , which can be computed in linear time [16]. Chan showed that the -centerproblem can be solved in O ( n log n log log n ) deterministic time [6]. The k -center problemcan be solved in O ( n O ( √ k ) ) time [12]. It is NP-hard to approximate the Euclidean k -centerproblem within an approximation factor smaller than 1.822 [10]. Kim and Shin presented an O ( n log n log log n ) -time algorithm for computing two congruent disks whose union contains aconvex n -gon [14]. ∗ This work was supported by the NRF grant 2011-0030044 (SRC-GAIA) funded by the government of Korea. † Pohang University of Science and Technology, Korea. Email: {jin9082, heekap}@postech.ac.kr ‡ University of Ottawa, Canada. Email: [email protected] § Corresponding author. a r X i v : . [ c s . C G ] O c t he -center problem has also been studied under the geodesic metric inside a simple polygon.Asano and Toussaint presented the first algorithm for computing the geodesic -center of asimple polygon with n vertices in O ( n log n ) time [4]. In 1989, the running time was improvedto O ( n log n ) time by Pollack et al. [19]. Their technique can be described as follows. Theyfirst triangulate the polygon and find the triangle T that contains the center in O ( n log n ) time. Then they subdivide T further and find a region containing the center such that thecombinatorial structures of the geodesic paths from each vertex of P to all points in that regionare the same. Finally, the problem is reduced to find the lowest point of the upper envelope of afamily of distance functions in the region, which can be done in linear time using a technique byMegiddo [17]. Recently, the running time for computing the geodesic -center was improved tolinear by Ahn et al. [1, 2], which is optimal. In their paper, instead of triangulating the polygon,they construct a set of O ( n ) chords. Then they recursively subdivide the polygon into O (1) cellsby a constant number of chords and find the cell containing the center. Finally, they obtain atriangle containing the center. In this triangle, they find the lowest point of the upper envelopeof a family of functions, which is the geodesic 1-center of the polygon, using an algorithm similarto the one of Megiddo [17].Surprisingly, there has been no result for the geodesic k -center problem for k > , except theone by Vigan [20]. They gave an exact algorithm for computing a geodesic -center in a simplepolygon with n vertices, which runs in O ( n log n ) time. The algorithm follows the frameworkof Kim and Shin [14]. However, the algorithm does not seem to work as it is because of thefollowing reasons. They claim that the decision version of the geodesic -center problem in asimple polygon can be solved using a technique similar to the one by Kim and Shin [14] withoutproviding any detailed argument. They apply parametric search using their decision algorithm,but they do not describe how their parallel algorithm works. The parallel algorithm by Kim andShin does not seem to extend for this problem. In this paper, we present an O ( n log n ) -time algorithm that solves the geodesic -center prob-lem in a simple polygon with n vertices. The main steps of our algorithm can be described asfollows. We first observe that a simple polygon P can always be partitioned into two regions bya geodesic path π ( x, y ) such that • x and y are two points on the boundary of P , and • the set consisting of the geodesic 1-centers of the two regions of P defined by π ( x, y ) is ageodesic 2-center of P .Then we consider O ( n ) candidate pairs of edges of P , one of which, namely ( e, e (cid:48) ) , satisfies x ∈ e and y ∈ e (cid:48) . We explain how to find these candidate pairs of edges in O ( n log n ) time. Finally,we present an algorithm that computes a -center restricted to such a pair of edges in O ( n log n ) time using parametric search [15] with a decision algorithm and a parallel algorithm. A polygon P is said to be simple if it is bounded by a closed path, and every vertices are distinctand edges intersect only at common endpoints. The polygon P is weakly simple if, for any ε > ,there is a simple polygon Q such that the Fréchet distance between P and Q is at most ε [7].The algorithms we use in this paper are designed for simple polygons, but they also work forweakly simple polygons. 2he vertices of a simple polygon P with n vertices are labeled v , . . . , v n in clockwise orderalong the boundary of P . We set v n + k = v k for all k ≥ . An edge whose endpoints are v i and v i +1 is denoted by e i . For ease of presentation, we make the following general positionassumption : no vertex of P is equidistant from two distinct vertices of P , which was also assumedin [3]. This assumption can be removed by applying perturbation to the degenerate vertices [9].For any two points x and y lying inside a (weakly) simple polygon P , the geodesic path between x and y , denoted by π ( x, y ) , is the shortest path inside P between x and y . The lengthof π ( x, y ) is called the geodesic distance between x and y , denoted by d ( x, y ) . The geodesic pathbetween any two points in P is unique. The geodesic distance and the geodesic path between x and y can be computed in O (log n ) and O (log n + k ) time, respectively, after an O ( n ) -timepreprocessing, where k is the number of vertices on the geodesic path [11]. The vertices of π ( x, y ) excluding x and y are reflex vertices of P and they are called the anchors of π ( x, y ) . If π ( x, y ) is a line segment, it has no anchor. In this paper, “distance” refers to geodesic distance unlessspecified otherwise.Given a set X of points in P (for instance a polygon or a disk), we use ∂X to denote theboundary of X . A set X ⊆ P is geodesically convex if π ( x, y ) ⊂ X for any two points x and y in X . For any two points u and w on ∂P , let C [ u, w ] be the part of ∂P in clockwise orderfrom u to w . For u = w , let C [ u, w ] be the vertex u . The subpolygon of P bounded by C [ u, w ] and π ( u, w ) is denoted by P [ u, w ] . Note that P [ u, w ] may not be simple, but it is always weaklysimple. Indeed, consider the set of Euclidean disks centered at points on π ( u, w ) with radius ε > . There exists a simple polygonal curve connecting u and w that lies in the union of thesedisks and that does not intersect C [ u, w ] except at u and w . The region bounded by that simplecurve and C [ u, w ] is a simple polygon whose Fréchet distance from P is at most ε .The radius of P , denoted by r ( P ) , is defined as max p ∈ P d ( c, p ) , where c is the geodesic -center of P . Given two points α, β ∈ ∂P , we set r ( α, β ) = r ( P [ α, β ]) . Notice that r ( α, x ) ismonotonically increasing as x moves clockwise from α along ∂P . Similarly, r ( x, α ) is monoton-ically decreasing as x moves clockwise from α along ∂P .The geodesic disk centered at a point p ∈ P with radius r , denoted by D r ( p ) , is the set ofpoints whose geodesic distances from p are at most r . The boundary of a geodesic disk inside P consists of disjoint polygonal chains of ∂P and O ( n ) circular arcs [5]. Given a center p ∈ P anda radius r ∈ R , D r ( p ) can be computed in O ( n ) time as follows. We first compute the shortestpath map of p in linear time [11]. Each cell in the shortest path map of p is a triangle and everypoint q in the same cell has the same combinatorial structure of π ( p, q ) . Thus, a cell in theshortest path map of p intersects at most two circular arcs of D r ( p ) . Moreover, a circular arcintersecting a cell C is a part of the boundary of the Euclidean disk centered at v with radius r − d ( p, v ) , where v is the (common) anchor of π ( p, q ) closest to q for a point q ∈ C , if it exists,or p itself, otherwise. With this fact, we can compute ∂D r ( p ) by traversing the cells from a cellto its neighboring cell and computing the circular arcs of ∂D r ( p ) in time linear in the numberof cells and circular arcs, which is O ( n ) .We call a set of two points c , c ∈ P a -set . For instance, a geodesic -center of P is a -set. We slightly abuse notation and write ( c , c ) (instead of the usual notation { c , c } for aset) to designate the -set defined by c and c . The radius of a -set ( c , c ) in P , denoted by r P ( c , c ) , is defined as r P ( c , c ) = max p ∈ P min { d ( c , p ) , d ( c , p ) } . A geodesic -center of P is a -set with minimum radius. Note that given any -set ( c , c ) and r ≥ r P ( c , c ) , it holds that P ⊆ D r ( c ) ∪ D r ( c ) .For any two points x, y ∈ P , the bisector of x and y is defined as the set of points in P equidistant from x and y . The bisector of two points may contain a two-dimensional region if3 x x x p q c c βz π ( α, β ) ≤ r (a) (b) α b ( c , c ) Figure 1: (a) The bisector of p and q contains two 2-dimensional regions (two dashed triangles). Wehave two line segments x x and x x after removing two 2-dimensional regions. Here, b ( p, q ) = x x .(b) For any point z in C [ α, β ] , we have d ( z, c ) ≤ r for any radius r for the geodesic disks containing P centered at c and c , where α and β are the endpoints of b ( c , c ) . there is a vertex of P equidistant from x and y . If we remove all two-dimensional regions fromthe bisector, we are left with curves each of which is contained in P with two endpoints on ∂P .Among such curves, we call the one crossing π ( x, y ) the bisecting curve of x and y , denoted by b ( x, y ) . See Figure 1(a). -center Although there may exist more than one geodesic -center of P , the radius of any geodesic -center is the same. Let ( c ∗ , c ∗ ) be a geodesic -center and r ∗ = r P ( c ∗ , c ∗ ) . For any two points α and β on ∂P , let r max ( α, β ) = max { r ( α, β ) , r ( β, α ) } . We say that two geodesic disks cover P if the union of the two geodesic disks coincides with P . Lemma 1 [19, Lemma 1]
Let a, b and c be points in P . As x varies along π ( b, c ) , d ( a, x ) is aconvex function of d ( b, x ) , and d ( a, x ) ≤ max { d ( a, b ) , d ( a, c ) } . Lemma 2 If P is covered by two geodesic disks centered at points in P with radius r , then thereare two points x, y ∈ ∂P with r max ( x, y ) ≤ r .Proof. Let c and c be the centers of the two geodesic disks with radius r covering P . Let α and β be the two endpoints of the bisecting curve b ( c , c ) . We will argue that r max ( α, β ) ≤ r .Without loss of generality, assume that c lies in the subpolygon of P bounded by b ( c , c ) and C [ α, β ] . Let z be any point on C [ α, β ] . See Figure 1(b). Since P coincides with D r ( c ) ∪ D r ( c ) ,we have min { d ( z, c ) , d ( z, c ) } ≤ r . Also, since z and c lie in the same side of b ( c , c ) , we have d ( z, c ) ≤ d ( z, c ) . Therefore, d ( z, c ) = min { d ( z, c ) , d ( z, c ) } ≤ r .Moreover, for any point p ∈ π ( α, β ) , it holds that d ( c , p ) ≤ max { d ( c , α ) , d ( c , β ) } byLemma 1. Then, since α and β are the endpoints of b ( c , c ) , we find max { d ( c , α ) , d ( c , β ) } ≤ r ,from which d ( c , p ) ≤ r . Therefore, the boundary of P [ α, β ] is contained in D r ( c ) and so is P [ α, β ] by the geodesic convexity of P [ α, β ] .Similarly, we can show that P [ β, α ] is contained in D r ( c ) . Consequently, r max ( α, β ) ≤ r . For any -set ( c , c ) in P and any radius r , we call a pair ( α, β ) of points on ∂P a point-partition of P with respect to ( c , c , r ) if d ( c , x ) ≤ r and d ( c , y ) ≤ r for all points x ∈ P [ α, β ] and y ∈ P [ β, α ] . Note that a point-partition with respect to ( c , c , r ) does not exist if r For a vertex v , we define f ccw ( v ) , f cw ( v ) and f ( v ) . is a point-partition ( α, β ) with respect to ( c , c , r ) for α ∈ e and β ∈ e (cid:48) . A point-partitionand an edge-partition with respect to ( c ∗ , c ∗ , r ∗ ) are said to be optimal . By Lemma 2, therealways exist an optimal point-partition and an optimal edge-partition in a simple polygon. Notethat a point-partition and an edge-partition with respect to ( c , c , r ) are not necessarily uniqueif min { d ( c , α ) , d ( c , β ) } < r , where α and β are the two endpoints of b ( c , c ) . If an optimalpoint-partition ( α, β ) of P is given, we can compute a -center in linear time using the algorithmin [1, 2].Our general strategy is to first compute a set of pairs of edges, which we call candidate edgepairs , containing at least one optimal edge-partition. For each candidate edge pair ( e i , e j ) ,we compute a -center ( c , c ) restricted to ( e i , e j ) . That is, a -set ( c , c ) such that c and c are the -centers of P [ α, β ] and P [ β, α ] , respectively, where ( α, β ) is the pair realiz-ing inf ( x,y ) ∈ e i × e j r max ( x, y ) . In this section, we define candidate edge pairs and describe how to find the set of all candidateedge pairs in O ( n log n ) time. Let f ( · ) be the function which maps each vertex v of P to the setof vertices v (cid:48) of P that minimize r max ( v, v (cid:48) ) . It is possible that there are more than one vertex v (cid:48) that minimizes r max ( v, v (cid:48) ) . Moreover, such vertices appear on the boundary of P consecutively.This is because the function r ( v, x ) is non-decreasing and r ( x, v ) is non-increasing as x movesclockwise from v along ∂P .We use f cw ( v ) to denote the set of all vertices on ∂P that come after v and before any vertexin f ( v ) in clockwise order. Similarly, we use f ccw ( v ) to denote the set of all vertices on ∂P thatcome after v and before any vertex in f ( v ) in counterclockwise order. Refer to Figure 2. Thethree sets f ccw ( v ) , f ( v ) and f cw ( v ) are pairwise disjoint by the fact that v / ∈ f ( v ) and by themonotonicity of r ( v, x ) and r ( x, v ) .Given two points α, β ∈ ∂P , recall that we set r ( α, β ) = r ( P [ α, β ]) . Lemma 3 Given a vertex v of P , it holds that r ( v, w ) < r ( w, v ) for any vertex w ∈ f cw ( v ) and r ( v, w ) > r ( w, v ) for any vertex w ∈ f ccw ( v ) .Proof. Let us focus on the first inequality. Assume to the contrary that r ( v, w ) ≥ r ( w, v ) forsome vertex w ∈ f cw ( v ) . Let v (cid:48) be a vertex in f ( v ) . Since r ( v, v (cid:48) ) ≥ r ( v, w ) and r ( w, v ) ≥ r ( v (cid:48) , v ) ,we have r ( v, v (cid:48) ) ≥ r ( v (cid:48) , v ) . Thus r max ( v, v (cid:48) ) = r ( v, v (cid:48) ) ≥ r ( v, w ) = r max ( v, w ) , which contradictsthe fact that f ( v ) ∩ f cw ( v ) = φ .We can prove the second inequality in a similar way. Lemma 4 Let v be a vertex of P . For a vertex w ∈ f cw ( v ) , it holds that f ( w ) ∩ C [ v cw , w ] (cid:54) = φ ,where v cw is the last vertex of f cw ( v ) from v in clockwise order. i v i +1 v i v i +1 v cw ( i + 1) (a) (b) v ccw ( i ) v ccw ( i ) v cw ( i + 1) Figure 3: According to the relative positions for v cw ( i + 1) and v ccw ( i ) , the candidate edges of e i aredefined. (a) Four candidate edges of type (1) and one candidate edge of type (2). (b) Four candidateedges of type (1). Proof. Let w (cid:48) be the last vertex of f ( w ) from w in clockwise order. We show that w (cid:48) ∈ C [ v cw , w ] ,which implies the lemma.Assume to the contrary that w (cid:48) ∈ C [ w, v cw ] \ { w, v cw } . By Lemma 3 and the monotonicityof the functions r ( · , w (cid:48) ) and r ( w (cid:48) , · ) , we have r ( w, w (cid:48) ) ≤ r ( v, w (cid:48) ) < r ( w (cid:48) , v ) ≤ r ( w (cid:48) , w ) . Simi-larly, we get r ( w, v cw ) ≤ r ( v, v cw ) < r ( v cw , v ) ≤ r ( v cw , w ) . Thus, r max ( w, v cw ) = r ( v cw , w ) ≤ r ( w (cid:48) , w ) = r max ( w, w (cid:48) ) by the monotonicity of r ( · , w ) . This contradicts the fact that w (cid:48) is thelast vertex of f ( w ) from w in clockwise order.Given an edge e i = v i v i +1 , an edge e j = v j v j +1 is called a candidate edge of e i if it belongsone of the following two types. For a vertex v k , let v cw ( k ) be the last vertex of f cw ( v k ) from v k in clockwise order and v ccw ( k ) be the first vertex of f ccw ( v k ) from v k in counterclockwise order.Refer to Figure 3.1. v j (or v j +1 ) is v ccw ( i ) or v cw ( i + 1) .2. e j has both endpoints in the interior of C [ v ccw ( i ) , v cw ( i + 1)] and v ccw ( i ) comes before v cw ( i + 1) from v i in clockwise order along ∂P . The edge marked with thick line segmentin Figure 3(a) satisfies this condition.A pair ( e i , e j ) of edges is called a candidate edge pair if e j is a candidate edge of e i . Lemma 5 There is an optimal edge-partition in the set of all candidate edge pairs.Proof. By Lemma 2, there exists an optimal point-partition. Among all optimal point-partitions,let ( α, β ) be one such that ( α, β (cid:48) ) is not an optimal point-partition for any β (cid:48) ∈ C [ α, β ] \ { β } .Let ( e i , e j ) be an optimal edge-partition with α ∈ e i and β ∈ e j . If β is a vertex, let e j be anedge such that β = v j +1 (so that in all cases, the counterclockwise neighbor of β is v j ). Ourgoal is to show that if there is no candidate edge pair of type (1), then ( e i , e j ) is a candidateedge pair of type (2). Thus, we need to locate e j with respect to v ccw ( i ) and v cw ( i + 1) .Assume that ( e i , e j ) is not a candidate edge pair of type (1). We claim the followings.1. v ccw ( i ) ∈ C [ v i +1 , v j +1 ] v cw ( i + 1) ∈ C [ v j , v i ] Suppose these two claims are true. Then, v cw ( i + 1) appears after v ccw ( i ) as we move clockwisefrom v i along ∂P since we assume that ( e i , e j ) is not a candidate edge pair of type (1). Moreover,6 i e j e k v i v i +1 v j v j +1 v k v k +1 v ccw ( j ) v cw ( j ) v cw ( i ) v ccw ( i ) Figure 4: Two candidate edge pairs ( e i , e k ) and ( e j , e k ) of type (2). e i comes before e j from e k . e j has both endpoints in the interior of C [ v ccw ( i ) , v cw ( i + 1)] . Therefore, ( e i , e j ) is a candidateedge pair of type (2).It remains to prove the two claims. We start with the first one. The strategy is to show thatif the first claim is not true, there is another optimal edge-partition belonging to type (1). Let x (cid:48) i ∈ ∂P be the last clockwise point from v i which minimizes r max ( v i , x (cid:48) i ) . By the definitions of x (cid:48) i and ( α, β ) , we have r max ( v i , x (cid:48) i ) = r ( v i , x (cid:48) i ) = r ( x (cid:48) i , v i ) ,r max ( α, β ) = r ( α, β ) = r ( β, α ) . Since ( α, β ) is an optimal point-partition, we have r ( x (cid:48) i , v i ) = r max ( v i , x (cid:48) i ) ≥ r max ( α, β ) = r ( β, α ) . (1)If our first claim is not true, then v ccw ( i ) comes after v j +1 in clockwise order from v i . This impliesthat x (cid:48) i comes after v j +1 in clockwise order from v i . We show that r max ( v i , x (cid:48) i ) = r max ( α, β ) . Ifnot, we would have r ( x (cid:48) i , v i ) > r ( β, α ) , from which, by the monotonicity of the functions r ( β, · ) and r ( · , v i ) , r ( x (cid:48) i , v i ) > r ( β, α ) ≥ r ( β, v i ) ≥ r ( x (cid:48) i , v i ) , which is a contradiction. Therefore, r ( x (cid:48) i , v i ) = r ( β, α ) , which means that ( v i , x (cid:48) i ) is an optimalpoint-partition since we now have r max ( v i , x (cid:48) i ) = r ( x (cid:48) i , v i ) = r ( β, α ) = r max ( α, β ) .Let us redefine α as v i and β as x (cid:48) i . We also redefine ( e i , e j ) as an optimal edge-partitionsuch that v i = α and β ∈ e j (if β is a vertex, we choose e j such that β = v j +1 ). In this way, v ccw ( i ) remains the same. Thus v ccw ( i ) is the counterclockwise neighbor of x (cid:48) i . Therefore, ( e i , e j ) is a candidate pair of type (1).We now prove the second claim. The second claim can be proved in a similar way. Assumeto the contrary that v cw ( i + 1) ∈ C [ v i , v j ] \ { v i , v j } . Then v cw ( i + 1) comes before v j from v i +1 inclockwise order. Let x (cid:48) i +1 be the first clockwise point from v i +1 that minimizes r max ( v i +1 , x (cid:48) i +1 ) .Thus, x (cid:48) i +1 comes before β from v i +1 in clockwise order. Then the following holds: r max ( v i +1 , x (cid:48) i +1 ) = r ( v i +1 , x (cid:48) i +1 ) ≤ r ( v i +1 , β ) ≤ r ( α, β ) = r max ( α, β ) . This implies that ( v i +1 , x (cid:48) i +1 ) is also an optimal point-partition. We redefine α as v i +1 and β as x (cid:48) i +1 . We also redefine e i and e j accordingly. This pair ( e i , e j ) is a candidate edge pair of type(1).Therefore, we have an optimal edge-partition in the set of all candidate edge pairs. Lemma 6 There are O ( n ) candidate edge pairs. roof. Since v ccw ( i ) and v cw ( i ) are uniquely defined for any vertex v i of P , the total number ofcandidate edge pairs of type (1) is at most n .Now we consider the candidate edge pairs which have not been counted yet. Assume thatfor an edge e k there are two distinct candidate edge pairs, say ( e i , e k ) and ( e j , e k ) , of type(2). Without loss of generality, we assume that e i comes before than e j in clockwise orderfrom e k . Since they are candidate edge pairs of type (2), e k is contained in the intersection of C [ v ccw ( i ) , v cw ( i + 1)] and C [ v ccw ( j ) , v cw ( j + 1)] .We now argue that v j lies on C [ v i +1 , v cw ( i +1)] . Suppose that v j ∈ C [ v cw ( i +1) , v i +1 ] \{ v cw ( i +1) , v i +1 } for the sake of a contradiction. Then, since e k is contained in C [ v ccw ( i ) , v cw ( i + 1)] ,the vertex v j lies in the interior of C [ v k +1 , v i +1 ] . This contradicts the fact that e i comes beforethan e j in clockwise order from e k . Therefore, v j lies on C [ v i +1 , v cw ( i + 1)] , which means that v j ∈ f cw ( v i +1 ) . Refer to Figure 4.Consequently, by Lemma 4, v ccw ( j ) lies in C [ v cw ( i + 1) , v j ] . Since e k is contained in C [ v ccw ( i ) , v cw ( i + 1)] , v cw ( i + 1) lies in C [ v k +1 , v i ] . This implies that e k is not contained in C [ v ccw ( j ) , v cw ( j + 1)] , which is a contradiction.Therefore, for an edge e , there exists at most one edge e (cid:48) such that ( e (cid:48) , e ) is a candidate edgepair of type (2). Thus the number of candidate edge pairs of type (2) is O ( n ) .Now we present a procedure for finding the set of all candidate edge pairs. For each index i , we compute v cw ( i ) and v ccw ( i ) in O ( n log n ) time. To find v cw ( i ) , we apply binary search onthe vertices of P using Lemma 3 and a linear-time algorithm [1, 2] that computes the center ofa simple polygon. We can find v ccw ( i ) in a similar way. This takes O ( n log n ) time in total.Then, we compute the set of all candidate edge pairs based on the information we justcomputed. For each edge e i , we consider the edges lying between v ccw ( i ) and v cw ( i + 1) if v ccw ( i ) comes before v cw ( i +1) from v i in clockwise order. Otherwise, we consider the four edges incidentto v ccw ( i ) and v cw ( i + 1) . In total, this takes time linear to the number of candidate edge pairs,which is O ( n ) by Lemma 6. Lemma 7 The set of all candidate edge pairs can be computed in O ( n log n ) time. We say that a point-partition ( α, β ) is restricted to ( e i , e j ) if α ∈ e i and β ∈ e j . We say thata triplet ( c , c , r ) consisting of a -set ( c , c ) and a radius r is restricted to ( e i , e j ) if somepoint-partitions with respect to ( c , c , r ) are restricted to ( e i , e j ) . We consider r max ( α, β ) as afunction whose variables are α ∈ e i and β ∈ e j . Since the function is continuous and the domainis bounded, there exist two points, α ∗ ∈ e i and β ∗ ∈ e j , that minimize the function. We call ( c ∗ , c ∗ ) a -center restricted to ( e i , e j ) if c ∗ and c ∗ are the -centers of P [ α ∗ , β ∗ ] and P [ β ∗ , α ∗ ] ,respectively. By Lemma 5, there is a -center restricted to a candidate edge pair which is a -center (without any restriction).In this section, we present a decision algorithm for a candidate edge pair ( e i , e j ) . Let r ∗ ij bethe radius of a -center restricted to ( e i , e j ) . Let r be an input of the algorithm. The decisionalgorithm in this section returns “yes” if r ≥ r ∗ ij . Additionally, it returns a -center restricted to ( e i , e j ) with radius r . It returns “no”, otherwise.Throughout this section, we assume that r ( v i +1 , v j ) ≤ r < r ( v i , v j +1 ) and r ( v j +1 , v i ) ≤ r The total number of circular arcs in ∂I and ∂I is O ( n ) .Proof. We prove the lemma only for ∂I . The case for ∂I can be proven analogously. Thesize of the (refined) farthest-point geodesic Voronoi diagram of n sites in a simple polygon with n vertices is O ( n ) [3]. In other words, there are O ( n ) refined cells and edges of the Voronoidiagram.Let s be a circular arc of ∂I . The center c s of the geodesic disk containing s on its boundarylies in C [ v i +1 , v j ] . Note that c s is unique by the general position assumption. Every geodesicdisk whose center is a vertex in C [ v i +1 , v j ] \ { c s } with radius r contains s in its interior. Thismeans that, for any point x ∈ s , the farthest vertex from x in C [ v i +1 , v j ] is c s . Moreover, thecombinatorial structures of the geodesic paths from the center c s to points on the circular arc s are the same. Thus each circular arc s is contained in a refined cell of FV whose site is c s .Moreover, each endpoint of the circular arc lies in the boundary of the refined cell containing it(including the boundary of P .) Each edge of the diagram is intersected by at most one circulararc of ∂I . Therefore, the number of circular arcs in ∂I is O ( n ) by the fact that the size of therefined farthest-point geodesic Voronoi diagram is O ( n ) . Lemma 9 Let D = { D , . . . , D k } be a set of geodesic disks with the same radius and let I bethe intersection of all geodesic disks in D . Let S = (cid:104) s , . . . , s k (cid:48) (cid:105) be the cyclic sequence of thecircular arcs of ∂I along its boundary in clockwise order. For any integer i ∈ [1 , k ] , the circulararcs in ∂I ∩ ∂D i are consecutive in S . i s k s j s ‘ D i D j D ‘ x x y y b ( c i , c ‘ ) b ( c i , c j ) Figure 5: The center of D i (cid:48) must lie to either the right of b ( c i (cid:48) , c j (cid:48) ) or the left of b ( c i (cid:48) , c (cid:96) (cid:48) ) . Proof. Assume to the contrary that there are four circular arcs s i , s j , s k , s (cid:96) in S with i For a point x ∈ ∂I t , it holds that d ( φ t ( x ) , x ) = r and d ( ψ t ( x ) , x ) = r if d ( v i , x ) ≥ r and d ( v j +1 , x ) ≥ r for t = 1 , . We say that a geodesic path between two points is elementary if the number of line segmentsin the geodesic path is at most two. If π ( x, p ) is elementary for all points x on the samefiner arc of ∂I and all points p on the same subedge, there are at most three possible distinctcombinatorial structures as shown in Figure 6(b). However, the combinatorial structures of π ( x, p ) are the same for any point x on the same finer circular arc and any point p on the samesubedge if π ( x, p ) is not elementary for all x and p . Refer to Figure 6(c). In this section, we will subdivide ∂I and ∂I into O (1) subchains (refer to Subsection 4.3.2).Then for every pair of subchains, one from ∂I and one from ∂I , we will explain how to decidewhether there is a -center ( c , c ) restricted to a candidate edge pair lying on the two subchainsin Section 4.4. To this end, in the following subsection, we define four functions φ t ( x ) and ψ t ( x ) for t = 1 , . We represent each point p ∈ e i as a real number in [0 , : A point x ∈ e i (and y ∈ e j ) isrepresented as (cid:107) v i − p (cid:107) / (cid:107) v i − v i +1 (cid:107) in [0 , , where (cid:107) x − y (cid:107) is the Euclidean distance betweentwo points x and y . Similarly, we represent each point q ∈ e j as (cid:107) v j − q (cid:107) / (cid:107) v j − v j +1 (cid:107) . We usea real number in [0 , and its corresponding point interchangeably. Recall that S and S arethe unions of the circular arcs of ∂I and ∂I , respectively.Let us define the four functions φ t ( x ) and ψ t ( x ) for t = 1 , as follows. Refer to Figure 7. • The function φ : S → [0 , maps x ∈ S to the infimum of the numbers which representthe points in D r ( x ) ∩ e i . • The function φ : S → [0 , maps x ∈ S to the supremum of the numbers which representthe points in D r ( x ) ∩ e i . • The function ψ : S → [0 , maps x ∈ S to the supremum of the numbers which representthe points in D r ( x ) ∩ e j . • The function ψ : S → [0 , maps x ∈ S to the infimum of the numbers which representthe points in D r ( x ) ∩ e j .In the following, let t be or . Our goal is to split S t into subchains such that φ t and ψ t are monotone when their domain is restricted to each subchain. However, S t is not necessarily a12onnected subset of ∂I t . Thus, to simplify the description of the split, we define four continuousfunctions φ (cid:48) t , ψ (cid:48) t : ∂I t → [0 , by interpolating φ t and ψ t on ∂I t : φ (cid:48) t ( x ) = (cid:40) φ t ( x ) if x ∈ S td c ( x ,x ) d c ( x ,x ) φ t ( x ) + d c ( x ,x ) d c ( x ,x ) φ t ( x ) otherwise,where x and x are the first and the last points of S t along ∂I t from x in clockwise order,respectively, and d c ( x (cid:48) , y (cid:48) ) denotes the length of a chain C [ x (cid:48) , y (cid:48) ] . The function ψ (cid:48) t is definedsimilarly. Lemma 11 The functions φ (cid:48) t and ψ (cid:48) t for t = 1 , are well-defined.Proof. Here we prove the lemma only for φ (cid:48) . For the other functions, the lemma can be provedanalogously.If φ ( x ) is well-defined, so is φ (cid:48) ( x ) . Thus, we show that φ ( x ) is well-defined. The set S is the domain of φ and e i is the range of φ . Since D r ( v i +1 ) contains all points in S , D r ( x ) contains v i +1 for all x ∈ S . For each point x ∈ S , there are two cases: D r ( x ) intersects e i orcontains v i . For the first case, φ ( x ) represents the point closest to v i among the points p ∈ e i with d ( x, p ) = r . For the second case, φ ( x ) is , which represents v i +1 . Thus, φ ( x ) is uniquelydefined for a point x ∈ S , which means that it is well-defined.We choose any two points w ∈ ∂I and w ∈ ∂I which are endpoints of some circular arcsof ∂I and ∂I , respectively, such that d ( w t , v i ) < r and d ( w t , v j +1 ) < r . Such points alwaysexist by the assumption that r ( v i , v j +1 ) < r . We use them as reference points for ∂I and ∂I .We write p ≺ q for any two points p ∈ ∂I t and q ∈ ∂I t , if p comes before than q when wetraverse ∂I t in clockwise order from the reference point w t for t = 1 , . We consider ∂I and ∂I as chains of circular and linear arcs starting from w and w , respectively.In the following, we consider the local extrema of the four functions. For the function φ (cid:48) t ,let N max be the set of points x (cid:48) ∈ I t \ { w t } such that φ (cid:48) t ( x ) has a local maximum at x = x (cid:48) .Similarly, let N min be the set of points x (cid:48) ∈ I t \ { w t } such that φ (cid:48) t ( x ) has a local minimum at x = x (cid:48) . Then the following lemma holds. Lemma 12 Both N max and N min are connected.Proof. We first consider the case that φ (cid:48) ( x ) (cid:54) = 1 for some x ∈ N max . The boundary of D r ( φ (cid:48) ( x )) intersects ∂I at x . Moreover, there exists a connected region N ( x ) ⊂ ∂I containing x suchthat D r ( φ (cid:48) ( x )) ∩ N ( x ) = { x } . Together with Lemma 9, this implies that D r ( φ (cid:48) ( x )) does notcontain any point other than x . Thus, x is the only point contained in N max .For the remaining case that φ (cid:48) ( x ) = 1 for any point x in N max , Lemma 9 implies that D r ( φ (cid:48) ( x )) ∩ ∂I is connected. By definition, N max = D r ( φ (cid:48) ( x )) ∩ ∂I , which is connected.Similarly, we can prove that N min is connected.Let x max and x min be any two points in N max and N min , respectively. To make the descriptioneasier, we assume that x max ≺ x min .The following corollary states Lemma 11 from a different point of view. Corollary 13 The function φ is monotonically increasing in the domain { x ∈ S : x ≺ x max } and in the domain { x ∈ S : x min ≺ x } and monotonically decreasing in the domain { x ∈ S : x max ≺ x ≺ x min } . .3.2 Subdividing the chains with respect to local extrema We first compute one local maximum and one local minimum for each function. Here we describea way to find a local maximum of φ (cid:48) lying on S . For a point x lying on S , it holds that φ (cid:48) ( x ) = φ ( x ) by definition. Consider the sequence of the endpoints of the finer circular arcsstarting from the reference point w . There are O ( n ) endpoints. First we choose the median w of the endpoints. Let w (cid:48) be the endpoint adjacent to w on S such that w (cid:48) ≺ w . Then wecompute φ ( w ) and φ ( w (cid:48) ) . This takes O (log n ) time by the following lemma. Lemma 14 For a given point x ∈ S , φ ( x ) can be computed in O (log n ) time once the shortestpath trees rooted at v i and v i +1 are constructed.Proof. The function d ( z, x ) for z ∈ e i is convex for a fixed point x by Lemma 1. Moreover, d ( v i , x ) ≤ r and d ( v i +1 , x ) ≥ r since φ is well-defined. As we saw before, L i subdivides theedge e i into O ( n ) subedges. For any point p on the same subedge, the combinatorial structureof the geodesic path π ( p, x ) is the same.To compute φ ( x ) , we apply binary search on L i . First, we choose the median p med of L i .If d ( p med , x ) > r , then φ ( x ) lies between v i and p med , and we search the points in L i lyingbetween them. Otherwise, φ ( x ) lies between v med and v i +1 . In either way, we can ignore halfof the current search space. After O (log n ) iterations, we can narrow the search space into thesubedge containing φ ( x ) . Once we find the subedge which contains φ ( x ) , we can find the pointin constant time.Since computing the geodesic distance between two points takes O (log n ) time and the num-ber of iterations is O (log n ) , the time complexity for computing φ ( x ) is O (log n ) for a pointin S .If φ ( w ) = 1 , w is a local maximum of φ (cid:48) lying on S . If φ ( w ) < φ ( w (cid:48) ) < φ ( w ) , thena local maximum comes after w (cid:48) . Thus, we only consider the endpoints which come after w (cid:48) .Otherwise, a local maximum comes before w by Corollary 13. After O (log n ) iterations, we canfind the finer circular arc s max in S which contains a local maximum point.The remaining step is to find a local maximum point on the finer circular arc s max . Now,we search the edge e i to find the interval of L i containing a local maximum of φ (cid:48) . Let p be themedian of L i . If D r ( p ) contains or intersects s max , we search further the points of L i which comeafter p . Otherwise, we search the points of L i which come before p . By the construction of L i ,the number of different combinatorial structures of π ( x, p ) for a point x in the same circular arcand a point p in the same subedge is at most three (see Figure 6). Thus, in constant time, wecan check whether D r ( p ) contains or intersects s max .After O (log n ) iterations, we find the subedge that contains a local maximum of φ (cid:48) . Thenwe find a local maximum in the finer circular arc in constant time. Similarly, we compute alocal maximum and a local minimum for the other functions.Therefore, we have the following lemma. Lemma 15 A local maximum and a local minimum for φ (cid:48) t (or ψ (cid:48) t ) can be computed in O (log n ) time. These local extrema subdivide ∂I into at most five subchains c ,k for k ∈ { , , . . . , } asfollows. Let x , x , x and x be the local maxima and the local minima of φ (cid:48) and ψ (cid:48) with x ≺ x ≺ x ≺ x . The subchain c ,k is the set of points x ∈ ∂I with x k − ≺ x ≺ x k for k ∈ { , , . . . , } , where we set x = x = w . After subdividing ∂I , φ and ψ are monotonewhen the domain is restricted to c ,k ∩ S for k ∈ { , , . . . , } . Similarly, the local extrema of φ (cid:48) and ψ (cid:48) subdivide the chain ∂I into five subchains c ,(cid:96) ( (cid:96) ∈ { , , . . . , } ). The functions φ and ψ restricted to c ,(cid:96) ∩ S for (cid:96) ∈ { , , . . . , } are monotone.14 .4 Computing a -center restricted to a pair of subchains We consider a pair ( c ,k , c ,(cid:96) ) of subchains for k ∈ { , , . . . , } and (cid:96) ∈ { , , . . . , } . Let s ,k = S ∩ c ,k and s ,(cid:96) = S ∩ c ,(cid:96) . We find a -center with radius r that is restricted to ( e i , e j ) ,if it exists, where one center is on s ,k and the other is on s ,(cid:96) . Assume that φ and ψ aredecreasing when their domains are restricted to s ,k . That is, for any two points x and x (cid:48) in S ,k with x ≺ x (cid:48) , it holds that φ ( x (cid:48) ) ≤ φ ( x ) and ψ ( x (cid:48) ) ≤ ψ ( x ) . Similarly, assume that φ and ψ are decreasing when their domains are restricted to s ,(cid:96) . The other cases where some functionsare increasing and the others are decreasing can be handled in a similar way.We define two new functions µ : s ,k → s ,(cid:96) and µ : s ,k → s ,(cid:96) . For a point x ∈ s ,k , µ ( x ) denotes the last clockwise point in s ,(cid:96) which is contained in D r ( φ ( x )) . Similarly, for a point x ∈ s ,k , µ ( x ) denotes the first clockwise point in s ,(cid:96) which is contained in D r ( ψ ( x )) . If everypoint in s ,(cid:96) is contained in D r ( φ ( x )) , then µ ( x ) is the last clockwise point of s ,(cid:96) . Notice that µ ( x ) and µ ( x ) are increasing on s ,k . If there is a point x ∈ s ,k such that µ ( x ) ≺ µ ( x ) , thetriplet ( x, µ ( x ) , r ) is restricted to ( e i , e j ) . Moreover, for a 2-center ( c , c ) restricted to ( e i , e j ) with c ∈ s ,k and c ∈ s ,(cid:96) , it holds that µ ( c ) ≺ c ≺ µ ( c ) . Thus, we are going to find apoint x ∈ s ,k such that µ ( x ) ≺ µ ( x ) .To check whether there exists such a point, we traverse c ,k twice. In the first traversal, wepick O ( n ) points, which are called event points . While picking such points, we compute µ ( x ) and µ ( x ) for every event point x in linear time. Then we traverse the two subchains again andfind a -center using the information we just computed. Definition of the event points on c ,k . We explain how we define the event points on c ,k .The set of event points of c ,k is the subset of c ,k consisting of points belonging to one of thethree types defined below. • (T1) The endpoints of all finer arcs. Recall that the subchain c ,k ⊆ ∂I consists of circulararcs and line segments, and it is subdivided into finer arcs by the four shortest path mapsin Section 4.2. • (T2) The points x ∈ s ,k such that d ( x, p ) = r for some p ∈ L i • (T3) The points x ∈ s ,k such that d ( x, p ) = r for some p ∈ L j Let E , E and E be the sets of event points of types T1, T2 and T3, respectively. Let E = E ∪ E ∪ E . We say η ∈ E is caused by p if d ( η, p ) = r for p ∈ L i ∪ L j .Recall that L i is the set of intersection points of the extensions of the edges in the twoshortest path trees rooted at v i and rooted at v i +1 with e i , which has already been constructedin a previous step. Let L i = { v i = p , . . . , p m = v i +1 } , where the points are labeled in clockwiseorder from v i . Computation of the event points on c ,k . Since we already maintain the arcs of c ,k inclockwise order, we already have E . In the following, we show how to compute all T2 points.In a similar way, we compute all T3 points.Initially, E is set to be empty. Assume that we have reached an event point η ∈ E ∪ E andhave already computed all T2 points on the subchain lying before η . Let η (cid:48) be the T1 point nextto η . We find all T2 points on the subchain lying between η and η (cid:48) by walking the subchain from η to η (cid:48) once. If η lies in c ,k \ s ,k , it is contained on ∂P . In this case, let h ( η ) be the last T2point in s ,k in clockwise order with h ( η ) ≺ η . Otherwise, let h ( η ) = η . While computing all T2points, we also compute φ ( h ( η )) and maintain π ( η, φ ( h ( η ))) for every event point η ∈ E ∪ E .15e have two cases; the subchain connecting η and η (cid:48) is contained in ∂P or contained in acircular arc of c ,k . This is because η (cid:48) is a T1 point, an endpoint of a finer arc. To handle thesecases, we need the following two lemmas. Lemma 16 Let x and x be any two points in the same finer arc of c ,k . Once we have π ( x , p ) for some point p ∈ e i and the finer arc of c ,k containing x and x , we can compute π ( x , p ) inconstant time.Proof. Since we subdivide I into finer arcs using the shortest path trees rooted at v i and at v i +1 , π ( x , v i ) and π ( x , v i ) have the same combinatorial structure. Similarly, π ( x , v i +1 ) and π ( x , v i +1 ) have the same combinatorial structure.If π ( x , p ) is not elementary, π ( x , p ) and π ( x , p ) have the same combinatorial structure.So, we can compute π ( x , p ) in constant time.If π ( x , p ) is elementary, π ( x , p ) and π ( x , p ) may have distinct combinatorial structures.But in this case, π ( x , p ) is also elementary. Moreover, it consists of a line segment, or two linesegments whose common endpoint is the anchor of π ( v i , x ) or π ( v i +1 , x ) closest to x . Notethat the anchor of π ( v i , x ) closest to x is the same for every point x in the same cell in SPM i . Wecan compute this information while subdividing ∂I into finer arcs. Thus, we may assume thatwe already have the anchors of π ( v i , x ) and of π ( v i +1 , x ) closest to x . Thus, we can compute π ( x , p ) in constant time.Therefore, in any case, we can compute π ( x , p ) in constant time. Lemma 17 Let p and p (cid:48) be any two points lying in the same subedge of e i . Once we have π ( p, x ) for some point x ∈ c ,k and the finer arc of c ,k containing x , we can compute π ( p (cid:48) , x ) in constanttime.Proof. By the construction of L i , π ( p, v ) and π ( p (cid:48) , v ) have the same combinatorial structurefor any vertex v of P . Thus, if π ( p, x ) is not elementary, π ( p, x ) and π ( p (cid:48) , x ) have the samecombinatorial structure.If π ( p, x ) is elementary, π ( p (cid:48) , x ) is also elementary, but their combinatorial structures maybe different. In this case, π ( p (cid:48) , x ) consists of a line segment, or two line segments whose commonendpoint is the anchor of π ( v i , x ) or π ( v i +1 , x ) closest to x . We already have the cells of SPM i and SPM i +1 containing x because we have the finer arc of c ,k containing x , which is the assumptionof the lemma. Thus, we can compute π ( p (cid:48) , x ) in constant time.Therefore, in any case, we can compute π ( p (cid:48) , x ) in constant time.Now, we show how to handle the cases. Here, we assume that we already have π ( η, φ ( h ( η ))) . Case 1. The subchain is contained in ∂P . If the subchain of c ,k connecting η and η (cid:48) iscontained in ∂P , there is no T2 point lying between η and η (cid:48) . Thus η (cid:48) is the event point nextto η and we simply compute φ ( h ( η (cid:48) )) and π ( η (cid:48) , φ ( h ( η (cid:48) ))) .If η (cid:48) / ∈ s ,k , we have h ( η (cid:48) ) = h ( η ) . We compute π ( η (cid:48) , φ ( h ( η ))) , which takes constant timeby Lemma 16.If η (cid:48) ∈ s ,k , we have h ( η (cid:48) ) = η (cid:48) . To compute π ( η (cid:48) , φ ( η (cid:48) )) , we first compute π ( η (cid:48) , p i (cid:48) ) and d ( η (cid:48) , p i (cid:48) ) , where p i (cid:48) p i (cid:48) +1 is the subedge of e i which contains φ ( h ( η )) . They can be computed inconstant time by Lemma 16 and Lemma 17. Since φ is decreasing, φ ( η (cid:48) ) lies on C [ v i , φ ( h ( η ))] .If d ( η (cid:48) , p i (cid:48) ) > r , then φ ( h ( η )) does not lie on C [ p i (cid:48) , φ ( h ( η ))] , and we skip p i (cid:48) . We check eachsubedge of e i from p i (cid:48) in counterclockwise order until we find the subedge containing φ ( η (cid:48) ) .Then we compute the geodesic path π ( η (cid:48) , φ ( η (cid:48) )) for φ ( η (cid:48) ) on the subedge. This takes timelinear to the number of subedges we traverse on e i by Lemma 16 and Lemma 17.16 ase 2. The subchain is contained in a circular arc of c ,k . In this case, we first compute π ( η (cid:48) , p i (cid:48) ) and d ( η (cid:48) , p i (cid:48) ) , where p i (cid:48) p i (cid:48) +1 is the subedge of e i which contains φ ( h ( η )) = φ ( η ) . Thistakes constant time by Lemma 16 and Lemma 17.If d ( η (cid:48) , p i (cid:48) ) is at least r , then φ ( η (cid:48) ) lies between φ ( η ) and p i (cid:48) . In this case, there is no T2point lying between η and η (cid:48) . If d ( η (cid:48) , p i (cid:48) ) is less than r , then there is an event point caused by p i (cid:48) lying between η and η (cid:48) . It can be computed in constant time. Moreover, it is the first T2point from η . Then, we have to compute π ( η (cid:48)(cid:48) , φ ( η ( η (cid:48)(cid:48) ))) for the first T2 point η (cid:48)(cid:48) from η . Wecan do this in constant time as we did for Case 1. Definition and computation of the event points on c ,(cid:96) . The event points on c ,(cid:96) aredefined similarly. Each event point is a point on c ,(cid:96) belonging to one of the three types definedbelow. • (T1) The endpoints of all finer arcs of c ,(cid:96) . • (T2) The points x ∈ s ,(cid:96) such that d ( x, p ) = r for some p ∈ L (cid:48) i , where L (cid:48) i is the set of allpoints in L i and all points p ∈ e i with d ( η, φ ( η )) = r for some η ∈ E . • (T3) The points x ∈ s ,(cid:96) such that d ( x, p ) = r for some p ∈ L (cid:48) j , where L (cid:48) j is the set of allpoints in L j and all points p ∈ e j with d ( η, ψ ( η )) = r for some η ∈ E .We already have L (cid:48) i and L (cid:48) j , and the elements are sorted along the edges e i and e j , respectively.The event points on c ,(cid:96) can be computed in a way similar to the event points on c ,k inlinear time. Thus, we have the following lemma. Lemma 18 The event points on c ,k and c ,(cid:96) can be computed in O ( n ) time. Traversal for finding a restricted 2-center. Using the event points on c ,k and c ,(cid:96) , we cancompute µ ( x ) and µ ( x ) for all x ∈ E in linear time. Then, we can find a -center restricted to ( e i , e j ) with radius r by traversing c ,k as follows. For every two consecutive event points η, η (cid:48) on c ,k , we check whether there exists a point x with η ≺ x ≺ η (cid:48) such that µ ( x ) ≺ µ ( x ) usingthe following lemma. Lemma 19 Let η and η (cid:48) in E be two consecutive event points along s ,k . We can determinewhether there is a point η ≺ x ≺ η (cid:48) such that µ ( x ) ≺ µ ( x ) in time linear to the number ofevent points lying between µ ( η ) and µ ( η (cid:48) ) if µ ( η ) ≺ µ ( η ) ≺ µ ( η (cid:48) ) ≺ µ ( η (cid:48) ) . Otherwise, wecan determine whether there is such a point in constant time.Proof. By the construction, φ ( x ) lies in the same subedge induced by L i for all η ≺ x ≺ η (cid:48) ,and so does φ ( x ) by L j . Moreover, µ ( x ) lies between µ ( η ) and µ ( η (cid:48) ) , and µ ( x ) lies between µ ( η ) and µ ( η (cid:48) ) .Consider the case where µ ( η ) ≺ µ ( η ) ≺ µ ( η (cid:48) ) ≺ µ ( η (cid:48) ) . For a point x with η ≺ x ≺ η (cid:48) ,it holds that µ ( x ) ≺ µ ( x ) if and only if there is a point y with µ ( η ) ≺ y ≺ µ ( η (cid:48) ) and max { d ( φ ( x ) , y ) , d ( φ ( x ) , y ) } ≤ r . Note that for two consecutive event points ν and ν (cid:48) on s ,(cid:96) , d ( φ ( x ) , y ) and d ( φ ( x ) , y ) are algebraic functions of constant degree for ν ≺ y ≺ ν (cid:48) and η ≺ x ≺ η (cid:48) . Moreover, we can find the algebraic functions while computing the event points.Thus, in constant time, we can determine whether there exists such a pair ( x, y ) such that y liesbetween given two consecutive event points in s ,(cid:96) .We do this for every two consecutive event points lying between µ ( η ) and µ ( η (cid:48) ) , whichtakes time linear to the number of event points lying between them.For the remaining case, we can answer “yes” or “no” in constant time. To see this, considerthree possible subcases; µ ( η ) ≺ µ ( η ) , µ ( η (cid:48) ) ≺ µ ( η (cid:48) ) or µ ( η (cid:48) ) ≺ µ ( η ) .17f µ ( η ) ≺ µ ( η ) or µ ( η (cid:48) ) ≺ µ ( η (cid:48) ) , the answer is clearly “yes.” If µ ( η (cid:48) ) ≺ µ ( η ) , the answeris “no” because it holds that µ ( η ) ≺ µ ( x ) ≺ µ ( η (cid:48) ) ≺ µ ( η ) ≺ µ ( x ) ≺ µ ( η (cid:48) ) for every point x lying between η and η (cid:48) .If r ≥ r ∗ ij , there exists a -set ( c , c ) with radius r such that c ∈ S and c ∈ S byLemma 10. We have µ ( c ) ≺ c ≺ µ ( c ) . Thus, the algorithm always find a 2-center withradius r .We analyze the running time for traversing the chain c ,k . There are two types of a pair ( η, η (cid:48) ) of consecutive event points; µ ( η ) ≺ µ ( η ) ≺ µ ( η (cid:48) ) ≺ µ ( η (cid:48) ) or not. The running timefor handling two consecutive event points belonging to the first case is linear to the number ofevent points lying between µ ( η ) and µ ( η (cid:48) ) . For the second case, the running time is constant.Here, for the pairs ( η, η (cid:48) ) belonging to the first case, their corresponding subchains { y : µ ( η ) ≺ y ≺ µ ( η (cid:48) ) } are pairwise disjoint. This implies that the total running time is linear tothe number event points on c ,k and on c ,(cid:96) , which is O ( n ) . Lemma 20 Given two sets of all event points on c ,k and of all event points on c ,(cid:96) , a 2-centerwith radius r restricted to ( e i , e j ) can be computed in O ( n ) time. Now we analyze the running time of the algorithm. In the first step described in Section 5.1,we compute the intersection of the geodesic disks. Once we have the farthest-point geodesicVoronoi diagram, this step takes linear time.In the second step described in Section 4.2, we subdivide the edges and the boundaries ofthe intersections. For subdividing the edges, we compute the four shortest path trees in lineartime [11], and compute the intersections of the edges e i and e j with the extensions of the edgesin the trees. Then we sort them along the edges, which takes O ( n log n ) time. For subdividingthe boundaries of the intersections I and I , we traverse the shortest path map along ∂I (or ∂I ) once, which takes O ( n ) time by Lemma 8.In the third step described in Section 4.3, we find one local minimum and one local maximumof each function. Then we subdivide ∂I and ∂I into O (1) subchains. This takes O (log n ) time by Lemma 15.In the last step described in Section 4.4, we consider O (1) subchain pairs. For a givensubchain pair ( c ,k , c ,(cid:96) ) , we compute all event points on the subchains and traverse the twosubchains once. This takes linear time as we have shown.Therefore, we have the following lemma. Lemma 21 For a candidate edge pair ( e i , e j ) and a radius r , we can decide whether r ≥ r ∗ ij in O ( n ) time, once we have L i and L j and the farthest-point geodesic Voronoi diagrams of thevertices of C [ v j +1 , v i ] and of the vertices of C [ v i +1 , v j ] are computed. In the same time, if r ≥ r ∗ ij ,we can compute a -center with radius r restricted to ( e i , e j ) . Here, we do not consider the time for computing L i and L j and the farthest-point geodesicVoronoi diagrams because they do not depend on input radius r . In the overall algorithm, thisdecision algorithm will be executed repeatedly with different input radius r . In this case, we donot need to recompute L i and L j and the farthest-point geodesic Voronoi diagrams. The geodesic -center of a simple polygon is determined by at most three convex vertices of P that are farthest from the center. For a given geodesic -center ( c ∗ , c ∗ ) with radius r ∗ = r ( c ∗ , c ∗ ) ,18 I ( r L ) ∂I ( r U ) ∂I ( r ∗ ) g k ( r ∗ ij )(a) (b)edges of SPM i g k +1 ( r ∗ ij ) g k +2 ( r ∗ ij ) Figure 8: (a) For all r L ≤ r ≤ r U , the combinatorial structures of ∂I ( r ) are the same. (b) The points g k ( r ∗ ij ) and g k +2 ( r ∗ ij ) are intersections of ∂I ( r ∗ ij ) and edges of SPM i . The point g k +1 ( r ∗ ij ) is an endpointof a finer arc of ∂I ( r ∗ ij ) . a similar argument applies.Lemma 2 and its proof imply that there are three possible configurations for a -center asfollows. Let α ∗ and β ∗ be the two endpoints of b ( c ∗ , c ∗ ) .1. d ( c ∗ t , α ∗ ) < r ∗ and d ( c ∗ t , β ∗ ) < r ∗ for t = 1 , .2. Either d ( c ∗ , α ∗ ) = d ( c ∗ , α ∗ ) = r ∗ or d ( c ∗ , β ∗ ) = d ( c ∗ , β ∗ ) = r ∗ .3. d ( c ∗ , α ∗ ) = d ( c ∗ , α ∗ ) = d ( c ∗ , β ∗ ) = d ( c ∗ , β ∗ ) = r ∗ .For Configuration 1, a -center ( c ∗ , c ∗ ) restricted to ( e i , e j ) can be computed in O ( n ) timebecause c ∗ is the 1-center of P [ v i +1 , v j ] and c ∗ is the 1-center of P [ v j +1 , v i ] . Thus we only focuson Configurations 2 and 3.In this section, we present an algorithm for computing a 2-center restricted to a given candi-date edge pair ( e i , e j ) . We apply the parametric searching technique [15] to extend the decisionalgorithm in Section 4 into an optimization algorithm. We use the decision algorithm for twodifferent purposes. We simulate the decision algorithm with the optimal solution r ∗ ij (withoutexplicitly computing r ∗ ij .) While simulating the decision algorithm with r ∗ ij , we use the decisionalgorithm as a subprocedure with an explicit input r .In the following, we show how to simulate the decision algorithm with the optimal solution r ∗ ij , and finally compute the optimal solution. We compute the farthest-point geodesic Voronoi diagrams, denoted by FV and FV , of thevertices in C [ v i +1 , v j ] and C [ v j +1 , v i ] in O ( n log log n ) time, respectively, as we did in the decisionalgorithm (refer to Section 4.1). Let I ( r ) = ∩ jk = i +1 D r ( v k ) and I ( r ) = ∩ ik = j +1 D r ( v k ) . Insteadof computing ∂I ( r ∗ ij ) and ∂I ( r ∗ ij ) explicitly, we compute the combinatorial structures of ∂I ( r ∗ ij ) and ∂I ( r ∗ ij ) . Here, the combinatorial structures of ∂I ( r ∗ ij ) and ∂I ( r ∗ ij ) are the cyclic sequencesof edges of the farthest-point geodesic Voronoi diagram intersecting ∂I ( r ∗ ij ) and ∂I ( r ∗ ij ) inclockwise order, respectively.For each vertex v f in FV and FV , we compute d ( v f , t ) for all sites t of the cells incidentto v f . Let R be the set of these distances. Then we have |R| = O ( n ) . We sort those distancesin increasing order and apply binary search on R to find the largest value r U ∈ R and thesmallest values r L ∈ R satisfying r ∗ ij ∈ [ r L , r U ] using the decision algorithm. We have already19onstructed FV and FV . And we compute L i and L j , which are independent of r . Then thedecision algorithm takes linear time. Thus, this procedure takes O ( n log n ) time.Then, for any radius r ∈ [ r L , r U ] , the combinatorial structure of ∂I ( r ) is the same. SeeFigure 8(a). Thus, by computing ∂I ( r L ) , we can obtain the combinatorial structure of ∂I ( r ∗ ij ) .Note that each endpoint of the arcs of ∂I ( r ) can be represented as algebraic functions of r withconstant degree for r ∈ [ r L , r U ] . In the following, we let t be or . We subdivide ∂I t ( r ∗ ij ) by overlaying SPM i , SPM i +1 , SPM j ,and SPM j +1 with ∂I t ( r ∗ ij ) . Instead of computing it explicitly, we compute the combinatorialstructure of the subdivision of ∂I t ( r ∗ ij ) .First we compute the shortest path map SPM i . The annulus I t ( r U ) \ int( I t ( r L )) does notcontain any vertex of the shortest path map. Thus the edges of SPM i intersecting the curve ∂I t ( r ) can be ordered along the curve ∂I t ( r U ) in clockwise fashion for any r ∈ [ r L , r U ] . Moreover,the order of these edges is the same for any r ∈ [ r L , r U ] . Thus, this order can be computed inlinear time by traversing ∂I t ( r U ) and SPM i as we did in Section 4.3.2. We do this also for SPM i +1 , SPM j , and SPM j +1 .Consider an edge e of SPM i intersecting ∂I t ( r ) for r ∈ [ r L , r U ] . Then the intersection canbe represented as an algebraic function of r . We compute such an algebraic function for eachedge of SPM i , SPM i +1 , SPM j , and SPM j +1 and merge them with the set of the endpoints ofthe arcs in ∂I t ( r ) for r ∈ [ r L , r U ] computed in Section 5.1. Let A denote the merged set. Thereare O ( n ) elements in A each of which is an algebraic function of the variable r . They can besorted in clockwise order along ∂I t ( r ∗ ij ) in O ( n log n ) time by Lemma 22. See Figure 8. Let A = { g ( r ) , . . . , g m ( r ) } . The elements are the endpoints of finer arcs of ∂I t ( r ) . Let { g (cid:48) ( r ) , . . . , g (cid:48) m (cid:48) ( r ) } be the sorted list of the endpoints of finer arcs of ∂I ( r ) for r ∈ [ r L , r U ] . Lemma 22 The sorted list A can be computed in O ( n log n ) time.Proof. As described above, we can compute all elements of A in linear time. In the following,we show that they can be sorted in O ( n log n ) time. Sorting O ( n ) elements can be done in O ( T c log n ) time using O ( n ) processors [8], where T c is the time for comparing two elements. Tocompare two elements, that is, to determine the order for the two elements along ∂I t ( r ∗ ij ) withrespect to the reference point for ∂I t ( r ∗ ij ) , we do the followings. Let h ( r ∗ ij ) and h ( r ∗ ij ) be twoelements of A . Here, h ( r ) and h ( r ) are algebraic functions of variable r ∈ R , and we wantto determine the order for them when r = r ∗ ij . We first find the roots of h ( r ) = h ( r ) . Let c be the number of roots, which is a constant. We apply the decision algorithm c times with theroots. Then we can compare h ( r ∗ ij ) and h ( r ∗ ij ) in O ( n ) time, which is the time for applying thedecision algorithm c times. In other words, T c = O ( n ) for our case. Note that we have alreadyconstructed the farthest-point geodesic Voronoi diagrams.We apply parametric search [15] with this parallel sorting algorithm. In each iteration ofthe sorting, we need to do O ( n ) comparisons, which are done in different processors in the par-allel sorting algorithm. That means each of them is independent of the others. Thus, in eachiteration, we find O ( n ) roots for all functions. Then we sort them and apply binary search on O ( n ) roots using the decision algorithm. Each iteration takes O ( n log n ) time, thus the totaltime complexity is O ( n log n ) time.This section can be summarized as follows. Lemma 23 The set of endpoints of the finer arcs of ∂I ( r ) and ∂I ( r ) can be computed in O ( n log n ) time for r ∈ [ r L , r U ] . .3 Computing the coverage function values Recall that the function φ ( p ) maps a point p ∈ P to the infimum of the numbers which representthe points in D r ( p ) ∩ e i . We find the subedge that contains φ ( g k ( r ∗ ij )) for each index k ∈ [1 , m ] in O ( n log n ) time. In the decision algorithm, this can be done in O ( n ) time. However, eachcomparison in the decision algorithm depends on the results of the comparisons in the previoussteps, thus this algorithm cannot be parallelized. Therefore, we devise an alternative algorithmwhich can be parallelized by allowing more comparison steps. Lemma 24 For an index k ∈ [1 , m ] , the subedge of e i containing φ ( g k ( r ∗ ij )) can be computedin O ( n log n ) time.Proof. For a fixed r , we can compute φ ( g k ( r )) in O (log n ) time by Lemma 14. However, sincewe do not know the exact value r ∗ ij , we cannot apply the algorithm of Lemma 14. Instead, weagain apply parametric search.The first step of the algorithm for finding φ ( x ) in Lemma 14 is to compute d ( p med , x ) , where p med is the median of L i . Since g k ( r ) is contained in the same cell of SPM i and in the same cellof SPM i +1 for all r ∈ [ r L , r U ] , the combinatorial structures of π ( p med , g k ( r )) are the same for all r ∈ [ r L , r U ] . To determine whether p med comes before or after φ ( g k ( r ∗ ij )) from v i in L i , we checkthe sign of the value r ∗ ij − d ( p med , g k ( r ∗ ij )) . If it is positive, then p med comes before φ ( g k ( r ∗ ij )) .If it is negative, then p med comes after φ ( g k ( r ∗ ij )) . Otherwise, p med equals φ ( g k ( r ∗ ij )) . Wecompute the roots of r − d ( p med , g k ( r )) = 0 and apply the decision algorithm in Section 4 to theroots. Since the farthest-point geodesic Voronoi diagrams have already been constructed, therunning time for each call of the decision algorithm is O ( n ) . Then we can determine the sign ofthe value in O ( n ) time even though we still do not know the exact value r ∗ ij .After repeating this step O (log n ) times, we can finally find the subedge of e i containing φ ( g k ( r ∗ ij )) in O ( n log n ) time.Since the total number of indices is m = O ( n ) , we can compute the subedge of e i contain-ing φ ( g k ( r ∗ ij )) for all indices k ∈ [1 , m ] in O ( n log n ) time. To compute them efficiently, weparallelize this procedure using O ( n ) processors. A processor is assigned to each index. In eachiteration, we compute the roots of r − d ( p k , g k ( r )) = 0 for all indices k ∈ [1 , m ] and sort them,where p k is the median of the current search space of an index k . There are O ( n ) roots. We applybinary search on the roots using our decision algorithm and find the interval that containing r ∗ ij .Then in O ( n log n ) time, we can finish the comparisons in each iteration as we did in the proof ofLemma 22. We need O (log n ) iterations to find the subedges, so we can compute the subedgesfor all indices in O ( n log n ) time. We do this also for ψ ( x ) . Similarly, we compute the subedgescontaining the function values φ ( x ) , ψ ( x ) for all endpoints x in ∂I ( r ∗ ij ) in O ( n log n ) time.Then, we compute the algebraic functions φ ( g k ( r )) and φ ( g (cid:48) k (cid:48) ( r )) for all indices k ∈ [1 , m ] and all indices k (cid:48) ∈ [1 , m (cid:48) ] . Then we sort the points in L i and the points φ ( g k ( r ∗ ij )) , φ ( g (cid:48) k (cid:48) ( r ∗ ij )) for all indices k ∈ [1 , m ] and all indices k (cid:48) ∈ [1 , m (cid:48) ] in O ( n log n ) time using a way similar tothe algorithm in Lemma 22. Lemma 25 The points φ ( g k ( r ∗ ij )) and φ ( g (cid:48) k (cid:48) ( r ∗ ij )) for all indices k ∈ [1 , m ] and k (cid:48) ∈ [1 , m (cid:48) ] ,and the points in L i can be sorted in O ( n log n ) time. Consider a quadruple ( x , x , y , y ) , where x t is a finer arc of ∂I t ( r ∗ ij ) for t = 1 , , and y and y are subedges in e i and e j , respectively. We say the quadruple ( x , x , y , y ) is optimal if there21s a -center ( c , c ) such that c ∈ x , c ∈ x and α ∈ y , β ∈ y for some point-partition ( α, β ) with respect to ( c , c , r ∗ ij ) . Given an optimal quadruple, we can compute c and c in constanttime by the following lemma. Lemma 26 Given an optimal -tuple ( x , x , y , y ) , a -center ( c , c ) restricted to the candi-date edge pair ( e i , e j ) can be computed in constant time.Proof. Let ( c ∗ , c ∗ ) be the -center corresponding to the given -tuple. Consider the subdivision M t which is the overlay of the graph obtained by extending the edges of the shortest path treesrooted at v i , v i +1 , v j , v j +1 in both directions with FV t for t = 1 , . (We do not construct M and M explicitly. We introduce these subdivisions to make it easier to understand the analysisof our algorithm.) By the construction of finer arcs and subedges, x t is contained in a cell of M t for t = 1 , . Moreover, each endpoint of a finer arc lies either on an edge of a shortest pathmap or on an edge of a farthest-point geodesic Voronoi diagram. Let f t be the site of the cellof FV t containing x t . Let w ∗ , w ∗ , w ∗ and w ∗ be the points that minimize the following function g ( w , w , w , w ) for w ∈ x , w ∈ x , w ∈ y , and w ∈ y . g ( w , w , w , w ) = max { d ( w , f ) , d ( w , w ) , d ( w , w ) , d ( w , f ) , d ( w , w ) , d ( w , w ) } Then ( w ∗ , w ∗ ) is the -center restricted to ( e i , e j ) .Since each element of the quadruple is fully contained in some cell of M or M , g ( w , w , w , w ) is the maximum of the six algebraic functions of constant degree. Thus we can find the minimumof g ( w , w , w , w ) in constant time.However, there are more than quadratic number of such quadruples. Instead of consideringall of them, we construct a set of quadruples with size O ( n ) containing at least one optimalquadruple as follows.We first compute the event points on ∂I t ( r ∗ ij ) . An event point on ∂I t ( r ∗ ij ) is a point x with d ( x, p ) = r ∗ ij for some point p ∈ L i . We do not need to compute the exact positions for eventpoints. Instead, we compute their relative positions, i.e., we implicitly maintain those pointssorted in clockwise order along ∂I t ( r ∗ ij ) . We can do this in O ( n log n ) time as we did in theproof of Lemma 25.Now we have all the event points that subdivide the chain ∂I ( r ∗ ij ) and ∂I ( r ∗ ij ) into O ( n ) subarcs. Moreover, we have subdivided the edges e i and e j into O ( n ) subedges (refer to Sec-tion 4.4). Then, we construct the set of quadruples ( x , x , y , y ) such that there are eventpoints p ( r ) ∈ x and q ( r ) ∈ x , which are indeed algebraic functions, satisfying φ ( p ( r ∗ ij )) ∈ y , ψ ( p ( r ∗ ij )) ∈ y , φ ( q ( r ∗ ij )) ∈ y and ψ ( q ( r ∗ ij )) ∈ y . Note that each event point p ( r ) lies in thesame cell of M t for all r ∈ [ r L , r U ] by the construction. Using the information we computedbefore, we can construct the set of those quadruples in time linear to the size of the set, whichis O ( n ) ,Moreover, since we consider all quadruples one of which is an optimal -tuple, we can finda -center restricted to ( e i , e j ) using the procedure in this section in O ( n log n ) time. Thefollowing lemma and theorem summarize the our result. Lemma 27 A -center restricted to a candidate edge pair can be computed in O ( n log n ) time. Theorem 28 For a simple polygon P with n vertices, a -center of P can be computed in O ( n log n ) time. eferences [1] Hee-Kap Ahn, Luis Barba, Prosenjit Bose, Jean-Lou De Carufel, Matias Korman, andEunjin Oh. A linear-time algorithm for the geodesic center of a simple polygon. In , 2015.[2] Hee-Kap Ahn, Luis Barba, Prosenjit Bose, Jean-Lou De Carufel, Matias Korman, andEunjin Oh. A linear-time algorithm for the geodesic center of a simple polygon. Discrete& Computational Geometry , 56(4):836–859, 2016.[3] Boris Aronov, Steven Fortune, and Gordon Wilfong. The furthest-site geodesic voronoidiagram. Discrete & Computational Geometry , 9(1):217–255, 1993.[4] Tetsuo Asano and Godfried T. Toussaint. Computing geodesic center of a simple polygon.Technical Report SOCS-85.32, McGill University, 1985.[5] Magdalene G. Borgelt, Marc Van Kreveld, and Jun Luo. Geodesic disks and clusteringin a simple polygon. International Journal of Computational Geometry & Applications ,21(06):595–608, 2011.[6] Timothy M. Chan. More planar two-center algorithms. Computational Geometry ,13(3):189–198, 1999.[7] Hsien-Chih Chang, Jeff Erickson, and Chao Xu. Detecting weakly simple polygons. In Proceedings of the Twenty-Sixth Annual ACM-SIAM Symposium on Discrete Algorithms(SODA 2015) , pages 1655–1670, 2015.[8] Richard Cole. Parallel merge sort. SIAM Journal on Computing , 17(4):770–785, 1988.[9] Herbert Edelsbrunner and Ernst Peter Mücke. Simulation of simplicity: A technique to copewith degenerate cases in geometric algorithms. ACM Transactions on Graphics , 9(1):66–104, 1990.[10] Tomás Feder and Daniel H. Greene. Optimal algorithms for approximate clustering. In Proceedings of 20th ACM Symposium on Theory of Computing (STOC 1988) , pages 434–444, 1988.[11] Leonidas Guibas, John Hershberger, Daniel Leven, Micha Sharir, and RobertE. Tarjan.Linear-time algorithms for visibility and shortest path problems inside triangulated simplepolygons. Algorithmica , 2(1-4):209–233, 1987.[12] R.Z. Hwang, R.C.T. Lee, and R.C. Chang. The slab dividing approach to solve the Eu-clidean p -center problem. Algorithmica , 9(1):1–22, 1993.[13] A. K. Jain, M. N. Murty, and P. J. Flynn. Data clustering: a review. ACM ComputingSurveys , 31(3):264–323, 1999.[14] Sung Kwon Kim and Chan-Su Shin. Efficient algorithms for two-center problems for aconvex polygon. In Proceedings of the 6th International Computing and CombinatoricsConference (COCOON 2000) , pages 299–309, 2000.[15] Nimrod Megiddo. Applying parallel computation algorithms in the design of serial algo-rithms. Journal of ACM , 30(4):852–865, 1983.2316] Nimrod Megiddo. Linear-time algorithms for linear programming in R and related prob-lems. SIAM J. Comput. , 12(4):759–776, 1983.[17] Nimrod Megiddo. On the ball spanned by balls. Discrete & Computational Geometry ,4(1):605–610, 1989.[18] Eunjin Oh, Luis Barba, and Hee-Kap Ahn. The farthest-point geodesic Voronoi diagramof points on the boundary of a simple polygon. In Proceedings of the 32nd InternationalSymposium on Computational Geometry (SoCG 2016) , pages 56:1–56:15, 2016.[19] R. Pollack, M. Sharir, and G. Rote. Computing the geodesic center of a simple polygon.