<<

Exact Construction of Minimum-Width Annulus of Disks in the

Ophir Setter† Dan Halperin†

Abstract outer and inner [15]. Hence, the center of a minimum-width annulus must lie on an intersec- The construction of a minimum-width annulus of a set tion of the nearest-neighbor and the farthest- of objects in the plane has useful applications in di- neighbor Voronoi diagrams of the points. Using this verse fields, such as tolerancing metrology and facility observation, an algorithm for finding a minimum- location. We present a novel implementation of an al- width annulus of planar points was developed [5, 16]. gorithm for obtaining a minimum-width annulus con- Similar methods were used to solve different vari- taining a given set of disks in the plane, in case one ex- ations of the problem, such as finding a minimum- ists. The algorithm extends previously known meth- width annulus of point sets with different constraints ods for constructing minimum-width annuli of sets on its radii (e.g., fixed inner radius) [3], and finding of points. The algorithm for disks requires the con- a minimum-width annulus bounding a polygon [10]. struction of two Voronoi diagrams of different types, For some special cases there are specific deterministic one of which we call the “farthest-point farthest-site” sub-quadratic algorithms [4, 8, 17]. Voronoi diagram and appears not to have been inves- Agarwal and Sharir introduced the most efficient tigated before. The vertices of the overlay of these (randomized) algorithm to date for constructing a two diagrams are candidates for the annulus’ center. minimum-width annulus of planar points, which The implementation employs an asymptotically near- achieves an expected running time of O(n3/2+ε) [1]. optimal randomized divide-and-conquer algorithm for constructing two-dimensional Voronoi diagrams. Our software utilizes components from Cgal, the Com- 2 Solving the Problem for Disks putational Geometry Algorithms Library, and follows Given a set of objects O in the plane (also called the exact computation paradigm. We do not assume Voronoi sites) and a distance function ρ, the nearest- general position. Namely, we handle degenerate input neighbor Voronoi diagram of O with respect to ρ is and produce exact results. the partition of the plane into maximally connected cells, where each cell consists of points that are closer 1 Introduction to one particular site (or a set of sites) than to any other site. The bisector of two Voronoi sites is the annulus An is the bounded area between two concen- locus of all points that have an equal distance to tric circles. The width of an annulus is the difference both sites. A similar definition is used to define the between the radii of its outer and inner bounding cir- farthest-neighbor Voronoi diagram. cles. Given a set of objects in the plane, the objec- Recall that in the case of point sets, a minimum- tive is to find a minimum-width annulus containing width annulus can be found by overlaying the nearest- those objects. Figure 1(c) shows such an annulus for a neighbor and farthest-neighbor Voronoi diagrams of set of disks. Constructing a minimum-width annulus the points. We show that a similar approach applies has applications in various fields including tolerancing to the case of sets of disks, but the relevant diagrams metrology and facility location [11, 19]. require more careful definitions. A minimum-width annulus does not always exist. Instead of constructing the nearest-neighbor If the width of the set of objects1 is smaller than Voronoi diagram of the points we construct the the width of any containing annulus, then there is additively-weighted Voronoi diagram of the disks, also no minimum-width annulus. known as the Apollonius diagram [14]. In the case of point sets, a minimum-width annu- The Apollonius diagram is the Voronoi diagram de- lus must have (at least) two points on each of its fined for disks with respect to the following distance ∗This work has been supported in part by the Israel Science function ρ. For a point p and a D with a center Foundation (grant no. 236/06), by the German-Israeli Foundation c and radius r, we define ρ(p,D)= ||p − c|| − r. The (grant no. 969/07), and by the Hermann Minkowski–Minerva Cen- ter for Geometry at Tel Aviv University. distance between a point outside a disk and the disk †School of Computer Science, Tel-Aviv University, 69978, is the Euclidean distance. Apollonius bisectors, which Israel. {ophirset,danha}@post.tau.ac.il compose the diagram, are branches of hyperbolas. 1The width of a set is defined to be the width of the thinest strip (i.e., the area bounded between two parallel lines) con- Instead of constructing a farthest-neighbor Voronoi taining it. diagram of points we construct a different diagram,

1 which requires the definition of another distance func- 1. |IN | ≥ 3 and |ON | = 1 – the center coincides tion. Consider the following farthest-point distance with a vertex of the Apollonius diagram. 2 2 function from a point p ∈ R to a set of points S ⊂ R : 2. |IN | = 1 and |ON | ≥ 3 – the center coincides with a vertex of the FPFS Voronoi diagram. ρ(p,S) = sup ||p − x||, x∈S 3. |IN | ≥ 2 and |ON | ≥ 2 – the center lies on an intersection point of the Apollonius diagram and which measures the farthest distance from the point p the FPFS Voronoi diagram. to the set S. Consider the farthest-neighbor Voronoi We therefore construct each of the diagrams and over- diagram with respect to this distance function. We lay them. For each vertex of the overlay, we retrieve call this diagram the “farthest-point farthest-site” four relevant disks (either three touching the inner cir- (FPFS) Voronoi diagram. The distance function ρ cle and the one touching the outer , in case 1, or becomes the Euclidean distance when the set S con- three touching the outer circle and the one touching sists of a single point. However, this is not the case the inner circle, in case 2, or two pairs of disks touch- when the set S is, say, a disk in the plane. ing respectively the inner and outer circles), and com- The following lemma characterizes the FPFS pute the width of the resulting annulus. We output Voronoi diagram of disks in the plane, showing that the annulus of the smallest width. Figure 1 illustrates the bisectors induced by its sites are hyperbolic arcs. the algorithm for computing a minimum-width annu- lus of a set of disks and a highly degenerate input, which is handled properly by our implementation. Lemma 1 The bisector of two disks in the plane in- The FPFS Voronoi diagram can be defined as a duced by the farthest-point distance function is one farthest site abstract Voronoi diagram [12]. Hence, branch of a hyperbola, and is identical to the Apollo- FPFS Voronoi diagrams are of linear complexity in nius bisector of the disks with swapped radii. the size of the input (as are Apollonius diagrams).

Proof. Let (cA, rA), (cB, rB ) be two disks in the plane with respective centers c ,c and radii r , r . A B A B 3 Constructing General Voronoi Diagrams with Their farthest-point distance bisector is the zero set CGAL of the equation ||x − cA|| + rA = ||x − cB|| + rB, which is the same as the zero set of ||x − c || − r = A B As described in Section 2 above, the process of con- x c r || − B||− A. The latter equation describes the Apol- structing a minimum-width annulus bounding a set lonius bisector of (c , r ), (c , r ).  A B B A of disks mainly comprises three geometric operations: We now prove that there is a minimum-width an- (i) construction of the Apollonius diagram, (ii) con- nulus (in case one exists) whose center is a vertex of struction of the FPFS Voronoi diagram, and (iii) over- the overlay of the Apollonius diagram and the FPFS lay of the two diagrams. This section describes some Voronoi diagram of the disks. of the software components which our implementa- Let D = {d1,...,dn} be a collection of disks in the tion is based on, their various ramifications on the algorithm, and how they work in synergy to yield an plane, such that for all i, di 6⊆ Sj=6 i dj . For simplicity of exposition, we assume here that n ≥ 3; the case of exact and robust implementation, which can handle n < 3 is simple to handle. Let IN , ON ⊆ D denote input that is not necessarily in general position and the set of disks that touch the inner and outer cir- produce results of arbitrary precision. cles of a bounding annulus N, respectively. We show The connection between Voronoi diagrams and en- that there is a minimum-width annulus whose circles velopes is long-known [6], and yields a useful approach intersect the disks of D in at least 4 points. for constructing various types of Voronoi diagrams. Cgal,2 the Computational Geometry Algorithms Li- Theorem 2 If there is a minimum-width annulus brary, contains a robust and efficient implementation containing D, then there is a minimum-width annulus of a divide-and-conquer algorithm for constructing en- N such that |IN | + |ON |≥ 4. velopes of general surfaces in 3-space [13]. This im- plementation was employed to yield a general frame- We omit the detailed proof in this extended abstract. work for constructing two-dimensional Voronoi dia- Each minimum-width annulus must touch the disks grams [9]. of D in at least two points, as we can shrink O and N Like most algorithms and data-structures in Cgal, expand I until each of them touches a disk. In the N the framework follows the generic programming case where N does not touch the disks of D in at least paradigm, and is independent of the type of input 4 points, we can move N and obtain a smaller width sites. The generic implementation is parameterized annulus. with a traits class that must provide all required types Applying Theorem 2, we distinguish between three and methods to construct and handle bisector curves cases for a possible location of the center of a minimum-width annulus: 2http://www.cgal.org

2 (a) (b) (c) (d) Figure 1: Constructing a minimum-width annulus of a set of disks. (a) The Apollonius diagram of the set of disks. (b) The FPFS Voronoi diagram of the set of disks. (c) A minimum-width annulus of the set of disks. The center of the annulus is a vertex in the overlay of the Apollonius and the FPFS Voronoi diagrams. (d) A highly degenerate scenario for constructing a minimum-width annulus of a set of disks.

(e.g., intersecting bisector curves, comparing the y- expected time complexity is, in many cases, smaller. coordinates of a point and its vertical projection on Indeed, we may have Θ(n2) intersections between the a curve), and to answer proximity queries (see Sec- two diagrams, but, though not proven for disks, for tion 4). random point sets it is known that the expected num- The decision to use the aforementioned framework ber of intersections between the farthest and the near- to construct both Voronoi diagrams required in the est Voronoi diagrams is linear [2]. minimum-width annulus algorithm has two major ad- vantages. First, the framework is bisector-based; 4 Implementation Details namely, the main basic operation it requires is the construction of bisectors of Voronoi sites. This sim- Following the description of the framework for plifies the implementation of the diagrams as both Voronoi diagrams, we have implemented two have the same bisector type (Lemma 1). Second, the traits classes for constructing Apollonius diagrams resulting diagrams are represented as Cgal arrange- and FPFS Voronoi diagrams named Algebraic - ments, which can be passed as input to consecutive apollonius traits 2 and Algebraic farthest point - operations supported by Cgal. One of those oper- farthest site traits 2, respectively. ations is a sweep-based overlay [18] that is used to Both traits classes are based on the algebraic plane carry out the next step of our algorithm. curves traits for the arrangement package [7], which A straightforward application of the divide-and- provides all the algebraic functionality needed to han- conquer approach for Voronoi diagrams yields algo- dle algebraic bisector curves in a robust and exact rithms with worst-case running time of O(n2+ε) even manner. The remaining functors required by the for diagrams of linear complexity. Through random- framework are functors for constructing the bisectors ization, it has been shown that the expected running of two disks (which consist of selecting the correct time is lower: branch of a hyperbola) and functors to answer differ- ent proximity queries. Theorem 3 [9] For a specific type of two- Each required proximity predicate is given a set of dimensional Voronoi diagrams, so that the worst-case points P in the plane (e.g., an edge) and two Voronoi complexity of the diagram of any set of at most n sites, and should indicate which of the sites is closer sites is O(n), the divide-and-conquer envelope algo- to P . All required proximity predicates are imple- rithm computes it in expected O(n log2 n) time. mented similarly as follows: we construct a point p inside P using the algebraic infrastructure, and then In our case, applying Theorem 3 yields an expected answer the proximity query by comparing the Apol- construction time of O(n log2 n) for both the Apollo- lonius (or the farthest-point) distances from p to the nius and the FPFS Voronoi diagrams using the divide- sites. We expedite the comparisons here, as well as and-conquer algorithm. Overlaying the two diagrams the comparisons of widths of annuli later, by using ra- with the sweep-based algorithm has O((n + k)log n) tional interval arithmetic, alleviating the need for the worst-case time complexity where k is the number heavier exact algebraic machinery wherever possible. of intersections between the diagrams. The total As both the Apollonius and the FPFS Voronoi expected running time of the algorithm is therefore diagrams have the same bisectors type and simi- O(n log2 n + k log n), where k can be Θ(n2). lar distance functions (Lemma 1), both Algebraic - Though the worst-case complexity of the algorithm apollonius traits 2 and Algebraic farthest point - is super-quadratic, it is reasonable to assume that the farthest site traits 2 inherit from the same base

3 class, and define only a distance function and a func- [4] O. Devillers and P. A. Ramos. Computing roundness tor for bisectors’ construction (Algebraic farthest - is easy if the set is almost round. Int. J. Comput. point farthest site traits 2 swaps the radii of the Geom. Appl., 12:229–248, 2002. disks and then calls the same function as Algebraic - [5] H. Ebara, N. Fukuyama, H. Nakano, and Y. Nakan- apollonius traits 2), maximizing code reuse. ishi. Roundness algorithms using the Voronoi dia- We use the generic overlay function from Cgal’s grams. In Proc. 16th The Canadian Conf. on Com- arrangement package to overlay the Apollonius di- put. Geom., volume 41, 1989. agram and the FPFS Voronoi diagram. The over- [6] H. Edelsbrunner and R. Seidel. Voronoi diagrams and lay function is parameterized with an overlay-traits arrangements. Disc. Comput. Geom., 1:25–44, 1986. class, which updates the resulting arrangement’s fea- tures based on data associated with the input arrange- [7] A. Eigenwillig and M. Kerber. Exact and efficient 2D- ments’ features [18]. We have created a specially- arrangements of arbitrary algebraic curves. In Proc. 19th Annu. ACM-SIAM Symp. Disc. Alg. tailored overlay-traits class for updating the features , pages 122– 131. Soc. for Industrial and Applied Math., 2008. of the overlay with sites from both diagrams. [8] J. Garcia-Lopez, P. A. Ramos, and J. Snoeyink. Fit- Disks Time V E F On the left you can see the time ting a set of points by a circle. Disc. Comput. Geom., 50 10.741 126 213 88 consumption (in 20(3):389–402, 1998. 100 26.994 238 395 158 seconds) of the [9] D. Halperin, O. Setter, and M. Sharir. Construct- 200 62.968 416 659 244 algorithm execu- ing two-dimensional voronoi diagrams via divide-and- 500 185.244 775 1174 400 tion on different conquer of envelopes in space. ACS technical report 1000 405.405 1242 1894 653 input sizes, as ACS-TR-361601-01, TAU, 2008. well as the size of the final overlay (the vertices of [10] V.-B. Le and D.-T. Lee. Out-of-roundness problem which are the candidates for the center of the annu- revisited. IEEE Trans. Pattern Anal. Mach. Intell., lus). The experiments were carried out on an Intel R 13(3):217–223, 1991. CoreTM2 Duo 2.00GHz processor with 1GB memory. [11] M. T. Marsh and D. A. Schilling. Equity mea- surement in facility location analysis: A review and 5 Future Work framework. European Journal of Operational Re- search, 74(1):1–17, April 1994. It would be interesting to further investigate the [12] K. Mehlhorn, S. Meiser, and R. Rasch. Furthest site farthest-point farthest-site Voronoi diagram, pre- abstract Voronoi diagrams. Int. J. of Comput. Geom. sented above, for disk sites in particular and for other Appl., 11(6):583–616, 2001. objects in general, and find additional applications for this type of diagrams. [13] M. Meyerovitch. Robust, generic and efficient con- Another direction to pursue is the application of struction of envelopes of surfaces in three-dimensional Proc. 14th Annu. Eur. Symp. Alg. this approach to objects other than points [5, 16], space. In , pages 792–803, 2006. polygons [10], or disks, as described in this paper. [14] A. Okabe, B. Boots, K. Sugihara, and S. N. Chiu. Spatial Tessellations: Concepts and Applications of Acknowledgments Voronoi Diagrams. Wiley, NYC, 2nd edition, 2000.

The authors are grateful to all those who have supported [15] T. J. Rivlin. Approximating by circles. Computing, this work by advice, discussion, or fruitful cooperation. 21:93–104, 1979. Special thanks are given to Efi Fogel, Eric Berberich, and [16] U. Roy and X. Zhang. Establishment of a pair of Barak Raveh. concentric circles with the minimum radial separa- tion for assessing roundness error. Computer-Aided References Design, 24(3):161–168, 1992. [17] K. Swanson, D.-T. Lee, and V. L. Wu. An optimal al- [1] P. K. Agarwal and M. Sharir. Efficient randomized al- gorithm for roundness determination on convex poly- gorithms for some geometric optimization problems. gons. In Comput. Geom. Theory Appl., pages 601– Disc. Comput. Geom., 16:317–337, 1996. 609, 1993. [2] P. Bose and L. Devroye. Intersections with random [18] R. Wein, E. Fogel, B. Zukerman, and D. Halperin. geometric objects. Comput. Geom. Theory Appl., Advanced programming techniques applied to Cgal’s 10(3):139–154, June 1998. arrangement package. Comput. Geom. Theory Appl., 38(1–2):37–63, 2007. Special issue on Cgal. [3] M. de Berg, P. Bose, D. Bremner, S. Ramaswami, and G. T. Wilfong. Computing constrained minimum- [19] C. K. Yap. Exact computational geometry and tol- width annuli of point sets. Computer-Aided Design, erancing metrology. Technical Report SOCS-94.50, 30(4):267–275, 1998. McGill School of Computer Science, 1994.

4