Abstract 1 Introduction 2 The doubling dimension of fat polygons 3 The perimeter of geodesically convex regions in fat polygonal domains 4 Closest pair in an (𝜶,𝜷)-covered polygon References

On the Doubling Dimension and the Perimeter of Geodesically Convex Sets in Fat Polygons

Mark de Berg ORCID Department of Mathematics and Computer Science, TU Eindhoven, The Netherlands    Prosenjit Bose ORCID School of Computer Science, Carleton University, Ottawa, Canada    Leonidas Theocharous ORCID School of Electrical Engineering and Computer Science, University of Ottawa, Canada
Abstract

Many algorithmic problems can be solved (almost) as efficiently in metric spaces of bounded doubling dimension as in Euclidean space. Unfortunately, the metric space defined by points in a simple polygon equipped with the geodesic distance does not necessarily have bounded doubling dimension. We therefore study the doubling dimension of fat polygons, for two well-known fatness definitions. We prove that locally-fat simple polygons do not always have bounded doubling dimension, while any (α,β)-covered polygon does have bounded doubling dimension (even if it has holes). We also study the perimeter of geodesically convex sets in (α,β)-covered polygons (possibly with holes), and show that this perimeter is at most a constant times the Euclidean diameter of the set.

Using these two results, we obtain new results for several problems on (α,β)-covered polygons, including an algorithm that computes the closest pair of a set of m points in an (α,β)-covered polygon with n vertices that runs in O(n+mlogn) expected time.

Keywords and phrases:
Fat polygons, doubling dimension
Funding:
Mark de Berg: MdB is supported by the Dutch Research Council (NWO) through Gravitation-grant NETWORKS-024.002.003.
Prosenjit Bose: PB is supported in part by the Natural Sciences and Engineering Research Council of Canada (NSERC).
Leonidas Theocharous: LT is supported in part by the Natural Sciences and Engineering Research Council of Canada (NSERC).
Copyright and License:
[Uncaptioned image] © Mark de Berg, Prosenjit Bose, and Leonidas Theocharous; licensed under Creative Commons License CC-BY 4.0
2012 ACM Subject Classification:
Theory of computation Design and analysis of algorithms
Editor:
Pierre Fraigniaud

1 Introduction

Motivation and background.

In computational geometry, the standard way to model planar objects or regions is by polygons. Because polygons can have very complicated shapes and/or interact with each other in complicated ways, developing efficient solutions for algorithmic problems involving polygons is not always easy. In practice, however, the objects or regions under consideration are usually fairly well-behaved. The realistic input models paradigm [13] suggests to make this precise by defining properties of the input that are expected to be satisfied in practice and that allow for easier and/or more efficient algorithmic solutions.

One such property that has been studied extensively is fatness, where the underlying assumption is that real-world objects or regions are not extremely thin; see below for more precise definitions. For example, there have been results on motion-planning in environments where the obstacles are fat [26, 27] on various graphics-related problems involving fat objects [1, 21, 11, 10], on flow problems on terrains consisting of fat triangles [9], on various data-structure problems for fat objects [16, 20, 23], and more. Many of these results use one of the following two fundamental results: (i) the union complexity of n constant-complexity fat polygons in the plane is near-linear; see [3] and the references therein; and (ii) any set of n constant-complexity disjoint fat objects in the plane admits a hierarchical decomposition of the plane into constant-complexity cells that each intersect O(1) objects [7]. Note that both results concern constant-complexity objects and that they essentially say something about the part of the space outside the objects. We are interested in what happens inside a fat polygon. In particular, we are interested in properties of the metric space (P,distg) where P is a fat polygon (possibly with holes) and distg is the geodesic distance. In other words, distg(p,q) is the length of a shortest path between two points p and q in P. There has been work on guarding and triangulating fat polygons [2], but the special properties that the metric space (P,distg) may or may not have for fat polygons have not been studied much, to the best of our knowledge. This is surprising as problems involving shortest paths in polygons have received widespread attention, and fatness has been studied and used extensively as well. The only paper that is closely related to our work is by Bose, Cheong, and Dujmovic [5], who study the perimeter of fat objects, as discussed below.

Fatness variants.

The study of fat polygons was initiated by Matoušek et al. [22], who studied the union complexity of α-fat triangles, which are triangles whose angles are at least α, for some fixed constant α>0. Since then, the concept of fatness has been generalized in different ways, both to convex and to non-convex objects. For convex objects, all definitions are equivalent in the sense that a convex object that is fat under one definition is also fat under the other definitions [25, 28]. Our interest lies in non-convex objects, since inside a convex object the geodesic distance is identical to the Euclidean distance. For non-convex objects, different fatness definitions have been proposed as well, but these are no longer equivalent. We discuss the most popular ones, focusing on definitions that apply to polygons.

Overmars, Halperin, and Van der Stappen [26] define a polygon P to be γ-fat if, for any Euclidean disk D centered inside P and not fully containing P, we have area(PD)γarea(D), for some fixed constant γ>0. This definition still allows the polygon to have very thin parts, as shown in Figure 1(i).

Figure 1: (i) A γ-fat polygon that is not locally γ-fat. (ii) A locally γ-fat polygon. (iii) An (α,β)-covered polygon.

As a result, a collection of n γ-fat, constant-complexity polygons can have quadratic union complexity. Hence, De Berg [8] introduced locally γ-fat polygons; here we require that for any Euclidean disk D centered inside P and not fully containing P, we have area(PD)γarea(D), where DP denotes the connected component of DP that contains the center of D; see Figure 1(ii).

A third definition, by Efrat [15], is the following: a polygon is (α,β)-covered if for every p on the boundary P, there exists an α-fat triangle TpP with p as a vertex such that each side of Tp has length at least βdiam(P), where α and β are fixed positive constants. We will refer to such a triangle Tp as a witness triangle for the point p; see Figure 1(i). This is a stronger condition than local fatness: any (α,β)-covered polygon is locally γ-fat for a constant γ that depends only on the constants α and β, but the reverse is not true [8].

The three definitions above also apply to non-polygonal domains, even if they have holes.

Our contribution.

Recall that a metric space (𝒳,d) is c-doubling if every ball of radius r in the space 𝒳 can be covered by c balls of radius r/2. The doubling dimension of the metric space is defined to be log2c. If c is a constant, then we say that the metric space has bounded doubling dimension. Spaces of bounded doubling dimension generalize Euclidean space of constant dimension, and many problems can be solved (almost) as efficiently on spaces of bounded doubling dimension as they can in Euclidean space. Unfortunately, if P is an arbitrary polygon then the metric space (P,distg) may not have bounded doubling dimension. The first problem we study is therefore: does the metric space (P,distg) necessarily have bounded doubling dimension when P is fat?

For the fatness definition of Overmars et al. [26], the answer is easily seen to be no, as exemplified by the polygon in Figure 1(i): the ball centered at the red point in the middle of the polygon and whose radius r is the geodesic distance to the top-right vertex, needs Ω(n) geodesic balls of radius r/2 to be covered. Our first two results, presented in Section 2, concern the doubling dimension of locally-fat polygons and (α,β)-covered polygons.

  • We show that locally-fat polygons do not necessarily have bounded doubling dimension. More precisely, we show that for any n3 there exists a simple polygon P with n vertices and a geodesic disk D in P such that Ω(n1/3) geodesic disks of radius r are needed to cover D, where r=radius(D).

  • On the positive side, we prove that the doubling dimension of any (α,β)-covered polygon is upper bounded by a constant that only depends on the constants α and β and not on the number of vertices of the polygon. This result even holds for (α,β)-covered domains with curved boundaries and holes.

The fact that (α,β)-covered polygonal regions have bounded doubling dimension immediately implies a plethora of results that improve upon known results for non-fat polygons; we mention several of them at the end of Section 2.

After studying the doubling dimension of fat polygons, we turn our attention in Section 3 to the following problem: can the perimeter per(R) of a geodesically convex polygonal region R be bounded in terms of its geodesic diameter diamg(R), or perhaps even in terms of its Euclidean diameter diam(R)? For arbitrary polygons the answer is clearly no. In the polygon of Figure 1(i) the perimeter per(P) of P, which is geodesically convex, is Ω(ndiamg(P)), and hence arbitrarily larger than diam(P). Bose, Cheong, and Dujmović [5] showed that the same can happen for locally-fat polygons, via the Koch snowflake. For (α,β)-covered simple polygons, on the other hand, they showed that per(P)=O(diam(P)), where the constant of proportionality only depends on the constants α and β and not on the number of vertices of the polygon. The applicability of this result is limited, because it only bounds the perimeter of the polygon itself and not of geodesically convex sets inside the polygon. We show that the result also holds in this much more general setting.

  • For any geodesically convex polygonal set R in an (α,β)-covered polygonal domain P, we have per(R)=O(diam(R)).

A fairly immediate consequence of this result is the existence of an ε-coreset of size O(1/ε) for furthest-neighbor queries in an (α,β)-covered simple polygon P. This improves on the O(1/ε2) bound recently proved by De Berg and Theocharous [12] for general simple polygons. The result can also be used to obtain an algorithm for the closest-pair problem on a set S of m points in P whose expected running time is linear in m, as explained in Section 4.

Notation.

We denote the Euclidean disk of radius r centered at a point p2 by D(p,r) and we denote the Euclidean distance between two points p,q by |pq|. For a polygon P, which will always be clear from the context, and two points p,qP, we use π(p,q) to denote the shortest path between p and q inside P, and we denote the length of this path by π(p,q). Thus, distg(p,q)=π(p,q). The geodesic disk of radius r centered at a point pP is denoted by Dg(p,r). Recall that diam(P) denotes the Euclidean diameter of P and that diamg(P) denotes the geodesic diameter. From now on, when we speak of the doubling dimension of P, we always refer to the doubling dimension of the metric space (P,distg).

2 The doubling dimension of fat polygons

In this section we investigate the doubling dimension of fat polygons. We first show that locally-fat polygons do not necessarily have bounded doubling dimension, and then we show that (α,β)-covered polygons do have bounded doubling dimension.

2.1 Locally-fat polygons do not have bounded doubling dimension

To prove that locally-fat polygons do not have bounded doubling dimension, we first construct a family of locally-fat polygons Pm, for m1, such that diam(Pm)=2 and diamg(Pm)2m. The polygon Pm will be constructed recursively inside the unit square [0,1]2, in such a way that the shortest path from the lower-left corner (0,0) to the lower-right corner (1,0) resembles the order-m Hilbert curve.

The initial polygon P1, illustrated in Figure 2(i), is constructed as follows. Take the unit square [0,1]2 and a small value ε>0, and add the horizontal segment [ε,1ε]×12 and the vertical segments 12×[0,12] and 12×[12+ε,1]. Then slightly inflate these segments to give them width ε, thus obtaining a non-degenerate simple polygon. Note that the length of the shortest path from (0,0) to (1,0) approaches 2 as ε0; see the red path in Figure 2(i). This shortest path resembles the order-1 Hilbert curve, except that the middle link has twice the length of the first and last link, whereas in the Hilbert curve all links have the same length.

Figure 2: (i) The basic building block P1 and the shortest path from (0,0) to (1,0) in P1. (ii) Schematic illustration of P2. (iii) The shortest path from (0,0) to (1,0) in P2.

We will recursively construct Pm, for m2, such that the shortest path π((0,0),(1,0)) from (0,0) to (1,0) resembles the order-m Hilbert curve as ε0. We construct Pm from Pm1 as follows. We scale Pm1 by 12 and place four copies of it in a 2×2 grid whose cells have size 12m1, where the south-west copy is rotated clockwise by π2 and the south-east copy is rotated counter-clockwise by π2. Finally, we create small openings in the top-left corner of the south-west copy, in the bottom-right corner of the north-west copy, and in the top-right corner of the south-east copy. This ensures that Pm is a simple polygon and that the only way to go from (0,0) to (1,0) is to pass through these openings and visit all four copies See Figure 2(ii) for an illustration of P2. Note that the Euclidean diameter of Pm equals 2. Furthermore, the length Lm of the shortest path π((0,0),(1,0)) in Pm (as ε0) satisfies

Lm=4(12Lm1)=2Lm1,

where L1=2. Thus, Lm=2m. We obtain the following observation.

Observation 1.

The polygon Pm has O(4m) vertices and is such that diam(Pm)=2 and Lm2m as ε0, where Lm is the length of the shortest path in Pm from (0,0) to (1,0).

The next lemma shows that Pm is locally fat.

Lemma 2.

The polygon Pm is locally γ-fat for γ=18π.

Proof.

For simplicity we assume in the computations below that ε is infinitesimally small. Let D(p,r) be a disk centered at a point pPm such that D(p,r) does not contain Pm in its interior. Consider a hierarchical grid inside the unit square [0,1]2, where the cells at level have side length 12 and diameter 22. Let S0,S1,,Sm be the squares of level 0,1,,m containing p. Since PmD(p,r), we have r<2. We consider three cases.

  • Case I: r<diam(Sm)2. Then D(p,r) does not contain Sm. Moreover, since Sm is a square at the deepest level, it doesn’t contain any parts of P in its interior by construction. This implies that area(D(p,r)Pm)πr24. Hence,

    area(D(p,r)Pm)area(D(p,r)Sm)πr2414area(D(p,r)).
  • Case II: diam(Sm)2r<diam(Sm). Then D(p,r) contains more than 1/4 of the area of Sm, and so

    area(D(p,r)Pm)>14(12m)2=18ππ(22m)2>18πarea(D(p,r)).
  • Case III: rdiam(Sm). Then there exists an with 0<n such that diam(S+1)rdiam(S). Since pS+1, we thus have S+1D(p,r). Moreover, by construction, all points of Pm within S+1 are connected via a path that stays inside S+1. This means S+1D(p,r)Pm. Since rdiam(S), we also have area(D(p,r))π(22)2. Hence,

    area(D(p,r)Pm)(12+1)2=18ππ(22)218πarea(D(p,r)),

    which concludes the proof.

One may think that we now only need to show that Pm does not have bounded doubling dimension but, even though limmdiamg(Pm)diam(Pm)=, this is not the case.

Lemma 3 (restate=ddPn,name=).

The doubling dimension of the polygon Pm is O(1).

Proof.

As in the proof of Lemma 2, we will assume that ε is infinitesimally small. It will also be convenient to scale the polygon Pm by a factor 2m. Thus Pm consists of 2m×2m cells that are unit squares. We number these cells s1,,sk, where k=4m, in the order in which they are visited by the shortest path from the lower-left corner of Pm to its lower-right corner. Observe that the only way to enter a cell si is from the previous cell si1 or the next cell si+1.

Now consider a geodesic disk Dg(p,r).

We must show that Dg(p,r) can be covered by O(1) geodesic disks of radius r/2. Let sj be the cell containing the point p. Then Dg(p,r) consists of z0 consecutive cells si,,si+z1 that are fully contained in Dg(p,r) plus at most four cells that are partially contained in Dg(p,r); see Figure 3 (i).

Figure 3: Illustration for the proof of Lemma 3. Note that only the relevant part of Pm is shown.

Because any Euclidean disk can be covered by seven Euclidean disks of half its radius and the cells st are convex, we know that Dg(p,r)st can be covered by at most seven geodesic disks of radius r/2, for any cell st. Hence, the part of Dg(p,r) inside the four partially covered cells can be covered by 28 geodesic disks of radius r/2.

Now consider the z cells si,,si+z1 that are fully contained in Dg(p,r). Assume that z>0, otherwise we are done. Since diamg(sisi+z1)z, we must have rz212. We now have two cases.

  • If z7 then we can cover each of the z cells by seven geodesic disks of radius r/2, using at most 49 disks in total.

  • If z8 then we partition the sequence si,,si+z1 into eight subsequences, each consisting of at most z/8 cells. Note that any sequence of z cells can be covered by a geodesic disk of radius (z2)/2+2. This is done by placing such a disk at the midpoint q of a longest path between the first and last cell of that sequence; see Figure 3(ii). Hence, a sequence of z/8 cells can be covered by a geodesic disk of radius

    z/822+2<z16+(212)z16+z8<z4r/2

    Thus, in this case we use eight disks to cover the full sequence of z cells.

We conclude that Dg(p,r) can be covered by at most 28+49 disks of radius r/2. Hence, the doubling constant is at most 77, and the doubling dimension is at most log776.27.

The lemma above shows that by itself, the polygon Pm does not show that there are locally-fat polygons with unbounded doubling dimension. However, we can glue copies of Pm together to form a locally-fat polygon with unbounded doubling dimension.

Figure 4: A chain of scaled copies Q1,,Q2m of the polygon Pm – in this example m=2 – and the final polygon Pm obtained by attaching an equilateral triangle with apex c. The red curves show the paths from c (slightly displaced for clarity) to the points pi.
Theorem 4.

For any n3 there exists a simple polygon P with n vertices that is locally fat and whose doubling constant is Ω(n1/3).

Proof.

Let Q1,Q2,,Qk be k:=2m copies of Pm scaled by a factor of 12m. By Observation 1 each Qi has geodesic diameter 1. We place the Qi next to each other such that the right side of Qi coincides with the left side of Qi+1, for 1ik1; see Figure 4. We make a small opening at the lower-left corner of each Qi. Let u be the lower-left corner of Q1 and v be the lower-right corner Qk. Clearly, |uv|=1. Consider the point c below uv such that cuv is equilateral. The polygons Q1,,Qk, together with the segments cu and cv define a polygon, which we denote by Pm. Since the Qi are locally fat, the polygon Pm is fat as well. However, the geodesic disk D(c,2) cannot be covered by a constant number of geodesic disks of radius 1. Indeed, if pi is the point of Qi at furthest geodesic distance from c, then any two pi,pj have geodesic distance distg(pi,pj)>2 and can thus never be covered by the same geodesic disk of radius one. Hence, the doubling constant of Pm is at least 2m.

Note that each Qi has O(4m) vertices. Hence, if n denotes the number of vertices of Pm then n=O(8m). Thus, the doubling constant of Pm is Ω(n1/3).

2.2 (𝜶,𝜷)-covered domains have bounded doubling dimension

Recall that a domain P, possibly with holes and a curved boundary, is (α,β)-covered if for every pP there exists a triangle TpP with p as a vertex such that Tp is α-fat – each angle is at least α – and such that each side of Tp has length at least βdiam(P).

Theorem 5.

Any (α,β)-covered domain P has bounded doubling dimension. In particular, it is at most logc(α,β), where c(α,β):=max((48sinα+1)2,(16βsinα+1)2).

Proof.

Consider a geodesic disk D:=Dg(p,r) with center p and radius r in P. Let B be the square of side 3r centered at p. We partition B into a regular square grid G with g×g cells, where g:=max(48sinα,16βsinα); see Figure 5. Let s denote the side length of a cell. Then we can see that s=3rgmsinα16, where m:=min(r,βdiam(P)).

Figure 5: Construction of the grid G. The geodesic disk D is shown in red. The figure is schematic and not to scale.

Now consider the set 𝒟={Dg(q,r/2):qGP} of geodesic balls of radius r/2 centered at the grid points inside P. Note that |𝒟|c(α,β). To prove Theorem 5, it suffices to show that the disks in 𝒟 cover D. In other words, we need to show that for any point uD there exists a grid point qGP with distg(u,q)r/2. We need the following well-known fact. For completenes, we give a proof.

Fact 5 (restate=triangleingrid,name=).

Let G be a regular grid in 2 whose cells have side length x. Let T be an isosceles triangle whose two equal sides have length t and meet at angle ϕ. If t4xsinϕ, then T contains a grid point of G.

Proof.

Every point of 2 is within Euclidean distance x – in fact, within distance 22x – of some grid point. It therefore suffices to show that rin, the radius of the incircle of T, is at least x. We have rin=2area(T)per(T). Using area(T)=12t2sinϕ and per(T)=2t+2tsin(ϕ/2) we obtain

rin=t2sinϕ2t(1+sin(ϕ/2))tsinϕ4.

Thus, if t4x/sinϕ then rinx, which finishes the proof. We now consider two cases.

  • Case 1: D(u,r/4)P. Since sr(sinα/16)r/4, the disk D(u,r/4) contains a grid point q. Since D(u,r/4)P we therefore have distg(u,q)=|uq|r/4r/2.

  • Case 2: D(u,r/4) intersects P. This case is illustrated in Figure 5(ii). Let uP be a point closest to u. Then |uu|<r/4 and uuP. Let TuP be an α-fat triangle with vertex u and all of whose edges have length at least βdiam(P), which is guaranteed to exist because P is (α,β)-covered.

    If r<βdiam(P) then every side of Tu has length at least r. Thus, Tu contains an isosceles α-fat triangle T with apex u and side length t=r/4. Because TPB and r/4=m/44s/sinα, the triangle T contains a grid point q by Subsection 2.2. Since |uq|r/4, we thus have

    distg(u,q)|uu|+|uq|r4+r4=r2.

    On the other hand, if rβdiam(P) then Tu contains an isosceles α-fat triangle with side length t=βdiam(P)/4=m/44s/sinα. Again by Subsection 2.2 it contains a grid point q, and since tr/4 we also have distg(u,q)r/2.

We conclude that every uD lies in some disk of 𝒟, which finishes the proof of Theorem 5.

Applications.

The fact that (α,β)-covered domains have bounded doubling dimension immediately gives a plethora of results that improve on the state-of-the-art for arbitrary (non-fat) domains. We mention results on spanners and WSPDs, because they form the basis of many other results.

Corollary 6.

Let P be an (α,β)-covered domain and let SP be a set of m points.

  1. (i)

    Let G=(S,E) be the complete graph on S such that the weight of an edge (p,q)S×S is its geodesic distance distg(p,q). Then there exists a (1+ε)-spanner of G consisting of m(1/ε)O(1) edges.

  2. (ii)

    For any fixed s>1, there exists an s-well seperated pair decomposition (WSPD) of S of size msO(1).

Proof.

Part (i) follows from the result of Gao, Guibas, and Nguyen [17], who showed that a set of m points in a space of doubling dimension 𝑑𝑖𝑚 has a (1+ε)-spanner of size m(1/ε)O(𝑑𝑖𝑚) edges. For part (ii), we use the WSPD construction by Har-peled and Mendel [19], which has size msO(𝑑𝑖𝑚). Note that the bound on the spanner size in part (i) of Corollary 6 is linear in m and does not depend on the size of the polygon. A similar result is not possible for non-fat polygons: for any ε>0 and any m there is a polygon P and a set of m points such that any spanner of subquadratic size has spanning ratio at least 2ε. (Take the polygon of Figure 1(i) and put a point in each of the spikes.) Also note that there are more results on spanners in spaces of bounded doubling dimension – for example on the lightness of the spanner [4] – and that any such result immediately applies to point sets in an (α,β)-covered polygonal domain.

3 The perimeter of geodesically convex regions in fat polygonal domains

Recall that Bose et al. [5] showed that for any (α,β)-covered simple polygon P there exists a constant μ(α,β), depending only on α and β, such that per(P)μ(α,β)diam(P). Theorem 7 generalizes this result to arbitrary geodesically convex polygonal sets in P, and extends it from simple polygons to general polygonal domains. As we will see in the next section, this is useful in several applications. Note that we cannot hope to generalize the result to locally-fat polygons. Indeed, there are locally-fat polygons for which we do not even have per(P)=O(diam(P)) – the polygon Pn from Section 2 is an example.

Theorem 7.

Let P be an (α,β)-covered polygonal domain, possibly with holes. Let RP be a geodesically convex set in P such that RP is polygonal. Then there exists a constant ν(α,β) such that per(R)ν(α,β)diam(R).

To prove Theorem 7, define Γ1:=RP and Γ2:=RΓ1, and note that per(R)=Γ1+Γ2. Refer to Figure 6 for an illustration of these sets. We will bound Γ1 and Γ2 separately.

Figure 6: The shaded region R is geodesically convex. The blue curves (and points) are the connected components of Γ1, while the red curves are the connected components of Γ2.

Bounding 𝚪𝟏.

Let S be an axis-aligned square of side length diam(R) that contains R. We partition S into a regular g×g grid 𝒢, where g:=2βsinα. Let s:=diam(R)/g be the side length of a grid cell. Then sβsinα2diam(R), and each cell C𝒢 satisfies

diam(C)=2s<βsinαdiam(R). (1)

Moreover,

C𝒢per(C)=g24s= 4gdiam(R)=O(1αβdiam(R)). (2)

We will need the following lemma.

Lemma 8.

Let pPC for some cell C𝒢. Then any ray ρ emanating from p and going into the witness triangle Tp, will hit C before exiting Tp.

Proof.

It suffices to prove that the side e of Tp opposite to p lies fully outside C. Assume for a contradiction that there exists a point qe that is contained in C. Since pC and qC, we have that diam(C)|pq|. Moreover, |pq|hp, where hp is the height of Tp from p. Since hpsinαβdiam(R), we have

diam(C)|pq|hpsinαβdiam(R),

which contradicts Inequality (1). Let 𝒟={di:=iα4i and 0i8πα} be a set of canonical directions.111With a slight abuse of terminology, we identify an angle di𝒟 with the direction of a vector whose counterclockwise angle with the positive x-axis is di. For a point pP and a direction d, let ρ(p,d) be the ray starting from p and going into the direction d. Let C be a cell in 𝒢 and consider a point pPC that lies in the relative interior of an edge e of P. We say a direction di𝒟 is good for p if the following holds for the ray ρ(p,di):

  1. (i)

    ρ(p,di) makes an angle of at least α/4 with the edge e, and

  2. (ii)

    ρ(p,di) hits C before hitting P.

The following lemma will allow us to bound Γ1.

Lemma 9.

Let C be a cell in 𝒢 and let XPC be a point set that consists of finitely many connected components. Assume that every pX that is not a vertex of P, has at least one good direction in 𝒟. Then

Xc(α)per(C)wherec(α):=8παsin(α/4).

Proof.

For each di𝒟, let XiX be the set of points where di is good. Note that Xdi𝒟Xi.

Fix a direction di and consider Xi. Assume wlog that di is the vertically upward direction. We define a mapping fi:XiC such that fi(p) is the point where ρ(p,di) hits C; see Figure 7.

Figure 7: (i) The vertical decomposition of part of the polygon from Figure 6. (ii) Part of the grid 𝒢. In the cell C, the direction di is good for p (and in this example it is good for all points of PC).

Observe that fi is injective. Indeed, if q=fi(p) then p is the unique point in Xi that is hit by a vertically downward ray from q. Let vd(P) be the vertical decomposition of P, and consider a trapezoid Δvd(P). Let Xi(Δ) be the part of Xi contained in the bottom side of Δ – the top side cannot contain any part of Xi – and assume that Xi(Δ). Observe that fi(p)ΔC for all pXi(Δ). Since the angle between ρ(p,di) and the bottom side of Δ is at least α/4, we thus have Xi(Δ)1sin(α/4)CΔ. Hence,

Xi=ΔXi(Δ)1sin(α/4)CΔ=1sin(α/4)C.

Finally, we bound X by summing over all canonical directions:

Xdi𝒟Xi|𝒟|1sin(α/4)C8παsin(α/4)C.

This proves the lemma. We can now bound PS. Note that this immediately implies the same bound for Γ1, since Γ1PS.

Lemma 10.

PS=O(1βα3diam(R)).

Proof.

Fix a grid cell C𝒢 and consider X:=PC. Let pX be a point that lies in the relative interior of an edge e of P, and let Tp be its witness triangle. Since the angle of Tp at p is at least α, there are at least three canonical directions di1,di,di+1 such that the rays ρ(p,di1), ρ(p,di), and ρ(p,di+1) go into Tp. The ray ρ(p,di) must therefore make an angle of at least α/4 with the edge e. Lemma 8 implies that the ray ρ(p,di) will hit C before exiting Tp. As a result, the direction di is good for p. Hence, we can apply Lemma 9 to X and conclude that

PC=X8παsin(α/4)per(C).

Summing over all cells C𝒢 and using Equation (2) gives

PS8παsin(α/4)CGper(C)=O(1βα3diam(R)).

As mentioned, the fact that Γ1PS immediately gives us the following corollary.

Corollary 11.

The total length of Γ1 is O(1βα3diam(R)).

Bounding 𝚪𝟐.

We now bound the contribution to the perimeter coming from Γ2, the part of R that lies in the interior of P.

For a grid cell C𝒢, let Ev(C) be the set of edges of Γ2C that are mostly vertical, in the sense that their angle with the x-axis is at least π/4. Define Eh(C) analogously for mostly horizontal edges. Note that any edge is mostly vertical or mostly horizontal (or both, when it’s slope is exactly 1).

Lemma 12.

For any cell C𝒢 we have

Γ2C=O(per(C)+PC).

Proof.

We prove the bound for Ev(C); the bound for Eh(C) is symmetric. Since Γ2C=Ev(C)+Eh(C), the lemma then follows.

Consider the edges of Ev(C) that bound R from the left, that is, the interior of R lies locally to their right. Let p be a point on such an edge and shoot a ray ρ from p horizontally to the right. We claim that ρ cannot hit another edge of Ev(C) that bounds R from the left before hitting P, and thus it either hits P first or exits C.

Indeed, if ρ would hit another such edge at a point q before hitting P, then the horizontal segment pq is contained in P. Hence, pq is a shortest path in P between p and q, and because R is geodesically convex, we must have pqR. This contradicts that q lies on an edge that bounds R from the left.

Figure 8: The two red edges in cell C bound R from the left and are mostly vertical. The two shown horizontal rays hit C before hitting P.

We now charge any such point p on a left-bounding edge to where the ray ρ hits P (if it hits P first) or to where it exits C (if it does not hit P inside C); see Figure 8. This is analogous to the method used in Lemma 9: since we consider mostly vertical edges, we know that ρ forms an angle of at least π/4 with the corresponding edge of P (whereas in Lemma 9 this bound was α/4). Therefore, by using a horizontal decomposition of P, we can similarly argue that the total length charged to P is O(PC) and the total length charged to C is O(per(C)). In total we have

Ev(C)=O(per(C)+PC).

A similar argument applies to the edges of Ev(C) that bound R from the right. Summing the bound from Lemma 12 over all grid cells yields

Γ2=C𝒢Γ2C=O(C𝒢per(C)+PS)=O(1βα3diam(R)),

where the last step uses Lemma 10 and the bound on C𝒢per(C) given in Equation (2).

Since per(R)=Γ1+Γ2, we conclude that

per(R)=O(1βα3diam(R)).

This proves Theorem 7 with ν(α,β)=O(1βα3).

Application to coresets for furthest-neighbor queries.

Let S be a point set in a simple polygon P. Recall that an ε-coreset of S for furthest-neighbor queries is a set CS such that for any query point qP we have distg(q,fn(q,C))(1ε)distg(q,fn(q,S)), where fn(p,Q) denotes the furthest neighbor of q in a set Q. By applying Theorem 7 for R=rch(S), we obtain the following result.

Corollary 13 (restate=coreset,name=).

Let S be a point set of size m in an (α,β)-covered simple polygon P with n vertices. For any 0<ε1, there exists an ε-coreset CS of size O(1/ε) for furthest-neighbor queries. The coreset C can be constructed in O(n+mlog(n+m)) time.

Proof.

For any query point q, its furthest neighbor fn(q,S) is a vertex of the relative convex hull rch(S) of S inside P [12]. Moreover, distg(q,fn(q,S))12diamg(rch(S)). Hence, we can compute an ε-coreset as follows. First, we compute rch(S) in O(n+mlog(n+m)) time [24, 6, 18]. Then we traverse rch(S) to select a subset C of O(1/ε) vertices of rch(S) such that for any vertex p of rch(S), there is a vertex pC whose distance to p along rch(S) is at most ε2ν(α,β)per(rch(S)), where ν(α,β) is the constant in Theorem 7.

To see that C is an ε-coreset, recall that per(rch(S))ν(α,β)diam(rch(S)) by Theorem 7. Now consider a query point q. Let p be a point in C whose distance to fn(q,S) along rch(S) is at most ε2ν(α,β)per(rch(S)). Then distg(p,fn(q,S))ε2ν(α,β)per(rch(S)), and so

distg(q,fn(q,S)) distg(q,p)+distg(p,fn(q,S))
distg(q,fn(q,C))+ε2ν(α,β)per(rch(S))
distg(q,fn(q,C))+ε12diam(rch(S))
distg(q,fn(q,C))+εdistg(q,fn(q,S)),

which proves that C is an ε-coreset.

4 Closest pair in an (𝜶,𝜷)-covered polygon

Let Q be a set of m points contained in an (α,β)-covered polygon P. The closest-pair problem asks for a pair of points p,qQ minimizing the geodesic distance distg(p,q). Using Theorem 7 we prove the following lemma, which will allow us to adapt the classical linear-time closest-pair algorithm for the plane [14] to the geodesic metric in P.

Figure 9: Illustration for the proof of Lemma 14.
Lemma 14.

Let P be an (α,β)-covered simple polygon, and let S be a square that intersects the interior of P. Let C1,,Cm be the connected components of SP. Then there exists a partition of {C1,,Cm} into t=O(1) classes 𝒞1,,𝒞t such that the following holds:

There is constant M such that for every class 𝒞j and every pair of components Ca,Cb𝒞j we have distg(x,y)Mdiam(S) for all points xCa and yCb.

Proof.

If SP then m=1 and the statement is trivial since any two points x,ySP can be connected by a segment of length at most diam(S). Hence, we assume that P intersects the interior of S. Let be the side-length of S. We have two cases.

Case 1: 𝜷𝐝𝐢𝐚𝐦(𝑷)𝟖.

Then, for any x,ySP,

distg(x,y)diamg(P)per(P)μ(α,β)diam(P)8μ(α,β)β8μ(α,β)βdiam(S).

So in this case we may put all components Ci into a single class and the lemma holds.

Case 2: <𝜷𝐝𝐢𝐚𝐦(𝑷)𝟖.

Observe that any connected component Ci of SP, is a geodesically convex region. Indeed, if there were x,yCi such that a shortest path π(x,y) leaves Ci, then π(x,y) must exit S at a point a and re-enter S at a point b. Let π(a,b)π(x,y) be the subpath of π(x,y) from a to b. Since Ci is connected, there is a path π(a,b)Ci. Since P is a simple polygon, the cycle π(a,b)π(a,b) does not contain a part of P. But then we can replace π(a,b) by the part of S that lies inside the cycle, and obtain a shorter path from x to y, which is a contradiction. Hence, Ci must be a geodesically convex, as claimed. Applying Theorem 7 with R:=Ci we have per(Ci)ν(α,β)diam(Ci). Since CiS, we have diam(Ci)diam(S), and hence for any x,yCi

distg(x,y)per(Ci)ν(α,β)diam(Ci)ν(α,β)diam(S). (3)

Since P meets the interior of S, every component Ci satisfies CiP. For each i choose a point piCiP and let Ti be its witness triangle. Let S be the square with the same center as S and with side length 3, and let A:=Sint(S) be the annulus between the two squares. The maximum Euclidean distance from a point in S to a point in A is 2diam(S); see Figure 9. An edge of Ti incident to pi has length at least βdiam(P)84diam(S). This implies that the two sides of Ti incident to pi exit S, and because the angle between them is at least α we can conclude that area(TiA)=Ω(area(A)). This implies that we can stab the collection of objects {TiA}i=1m, with a constant number of points q1,q2,,qt. Our classes 𝒞1,𝒞2,,𝒞t are now defined by assigning each component Cj to the class 𝒞i such that i is the smallest index for which qi stabs TjA.

Now fix a class 𝒞j and components Ca,Cb𝒞j. Let xCa and yCb. To bound distg(x,y), consider the path π=π(x,pa)paqjqjpbπ(pb,y). By Inequality (3) we have

π(x,pa)+π(pb,y)=distg(x,pa)+distg(y,pb)=2ν(α,β)diam(S).

Moreover the points pa,pb,qj lie in S, which implies that |paqj|diam(S)=3diam(S) and |qjpb|3diam(S). Therefore distg(x,y)(2ν(α,β)+6)diam(S).

Combining the two cases, the lemma holds for all squares S.

The algorithm.

We adapt the algorithm by Dietzfelbinger et al. [14] that solves the problem in expected linear time in the Euclidean plane. We process the points of Q in random order, and maintain the current minimum distance δ and a grid of squares of side length s:=δ/(2M), stored in a hash table. As long as δ is the smallest geodesic distance among the processed points, Lemma 14 implies that each grid cell contains at most t=O(1) points. Indeed, if |X(S)|>t then two points of X(S) would lie in components belonging to the same class of Lemma 14, implying distg(x,y)Mdiam(S)=22δ<δ, a contradiction.

Now let q1,,qm be the points from Q, in random order, and suppose that the insertion of some point qj changes the closest pair. Let S be the cell of the current grid that contains the new point qj, and let qi,qj be the new closest pair. Since distg(qi,qj)<δ we know that qi must lie in cell S such that the Euclidean distance between S and S is smaller than δ. Thus, to find qi we can restrict our attention to the O(M2) cells within distance δ of S (including S itself). Since each cell contains at most t points, only O(1) candidates must be checked, which we can do in O(logn) time using a shortest-path query. When a smaller distance is found, we update δ and rebuild the grid. The analysis of the expected running time is identical to the Euclidean case [14], except that computing the distance between two given points incurs a logarithmic overhead (after preprocessing P for shortest-path queries in O(n) time [18]). We obtain the following theorem.

Theorem 15.

Let P be an (α,β)-covered simple polygon with n vertices and let Q be a set of m points in P. A closest pair of Q under the geodesic distance can be found in expected time O(n+κ(α,β)mlogn), where κ(α,β) is a constant depending only on α and β.

References

  • [1] Pankaj K. Agarwal, Matthew J. Katz, and Micha Sharir. Computing depth orders for fat objects and related problems. Comput. Geom., 5:187–206, 1995. doi:10.1016/0925-7721(95)00005-8.
  • [2] Greg Aloupis, Prosenjit Bose, Vida Dujmovic, Chris Gray, Stefan Langerman, and Bettina Speckmann. Triangulating and guarding realistic polygons. Comput. Geom., 47(2):296–306, 2014. doi:10.1016/J.COMGEO.2013.03.005.
  • [3] Boris Aronov, Mark de Berg, Esther Ezra, and Micha Sharir. Improved bounds for the union of locally fat objects in the plane. SIAM J. Comput., 43(2):543–572, 2014. doi:10.1137/120891241.
  • [4] Glencora Borradaile, Hung Le, and Christian Wulff-Nilsen. Greedy spanners are optimal in doubling metrics. In Proceedings of the 30th Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 2371–2379, 2019. doi:10.1137/1.9781611975482.145.
  • [5] Prosenjit Bose, Otfried Cheong, and Vida Dujmović. A note on the perimeter of fat objects. Computational Geometry, 44(1):1–8, 2011. doi:10.1016/j.comgeo.2010.06.002.
  • [6] Bernard Chazelle. Triangulating a simple polygon in linear time. Discret. Comput. Geom., 6:485–524, 1991. doi:10.1007/BF02574703.
  • [7] Mark de Berg. Linear size binary space partitions for uncluttered scenes. Algorithmica, 28(3):353–366, 2000. doi:10.1007/S004530010047.
  • [8] Mark de Berg. Improved bounds on the union complexity of fat objects. Discret. Comput. Geom., 40(1):127–140, 2008. doi:10.1007/S00454-007-9029-7.
  • [9] Mark de Berg, Otfried Cheong, Herman J. Haverkort, Jung Gun Lim, and Laura Toma. The complexity of flow on fat terrains and its i/o-efficient computation. Comput. Geom., 43(4):331–356, 2010. doi:10.1016/J.COMGEO.2008.12.008.
  • [10] Mark de Berg and Chris Gray. Vertical ray shooting and computing depth orders for fat objects. SIAM J. Comput., 38(1):257–275, 2008. doi:10.1137/060672261.
  • [11] Mark de Berg and Chris Gray. Computing the visibility map of fat objects. Comput. Geom., 43(4):410–418, 2010. doi:10.1016/J.COMGEO.2008.12.010.
  • [12] Mark de Berg and Leonidas Theocharous. A coreset for approximate furthest-neighbor queries in a simple polygon. In 40th International Symposium on Computational Geometry (SoCG), volume 293 of LIPIcs, pages 16:1–16:16, 2024. doi:10.4230/LIPIcs.SOCG.2024.16.
  • [13] Mark de Berg, A. Frank van der Stappen, Jules Vleugels, and Matthew J. Katz. Realistic input models for geometric algorithms. Algorithmica, 34(1):81–97, 2002. doi:10.1007/S00453-002-0961-X.
  • [14] Martin Dietzfelbinger, Torben Hagerup, Jyrki Katajainen, and Martti Penttonen. A reliable randomized algorithm for the closest-pair problem. Journal of Algorithms, 25(1):19–51, 1997. doi:10.1006/jagm.1997.0873.
  • [15] Alon Efrat. The complexity of the union of (alpha, beta)-covered objects. SIAM J. Comput., 34(4):775–787, 2005. doi:10.1137/S0097539702407515.
  • [16] Alon Efrat, Matthew J. Katz, Frank Nielsen, and Micha Sharir. Dynamic data structures for fat objects and their applications. Comput. Geom., 15(4):215–227, 2000. doi:10.1016/S0925-7721(99)00059-0.
  • [17] Jie Gao, Leonidas J. Guibas, and An Thai Nguyen. Deformable spanners and applications. Comput. Geom., 35(1-2):2–19, 2006. doi:10.1016/J.COMGEO.2005.10.001.
  • [18] Leonidas J. Guibas and John Hershberger. Optimal shortest path queries in a simple polygon. J. Comput. Syst. Sci., 39(2):126–152, 1989. doi:10.1016/0022-0000(89)90041-X.
  • [19] Sariel Har-Peled and Manor Mendel. Fast construction of nets in low-dimensional metrics and their applications. SIAM Journal on Computing, 35(5):1148–1184, 2006. doi:10.1137/S0097539704446281.
  • [20] Matthew J. Katz. 3-d vertical ray shooting and 2-d point enclosure, range searching, and arc shooting amidst convex fat objects. Comput. Geom., 8:299–316, 1997. doi:10.1016/S0925-7721(96)00027-2.
  • [21] Matthew J. Katz, Mark H. Overmars, and Micha Sharir. Efficient hidden surface removal for objects with small union size. Comput. Geom., 2:223–234, 1992. doi:10.1016/0925-7721(92)90024-M.
  • [22] Jirí Matousek, János Pach, Micha Sharir, Shmuel Sifrony, and Emo Welzl. Fat triangles determine linearly many holes. SIAM J. Comput., 23(1):154–169, 1994. doi:10.1137/S009753979018330X.
  • [23] Mark H. Overmars and A. Frank van der Stappen. Range searching and point location among fat objects. J. Algorithms, 21(3):629–656, 1996. doi:10.1006/JAGM.1996.0063.
  • [24] Godfried Toussaint. An optimal algorithm for computing the relative convex hull of a set of points in a polygon. In Proceedings of EURASIP, Signal Processing III: Theories and Applications, Part 2, volume 293, pages 853–856, 1986.
  • [25] A. Frank van der Stappen. Motion planning amidst fat obstacles. PhD thesis, University Utrecht, 1994.
  • [26] A. Frank van der Stappen, Dan Halperin, and Mark H. Overmars. The complexity of the free space for a robot moving amidst fat obstacles. Comput. Geom., 3:353–373, 1993. doi:10.1016/0925-7721(93)90007-S.
  • [27] A. Frank van der Stappen, Mark H. Overmars, Mark de Berg, and Jules Vleugels. Motion planning in environments with low obstacle density. Discret. Comput. Geom., 20(4):561–587, 1998. doi:10.1007/PL00009402.
  • [28] J. Vleugels. On Fatness and Fitness—Realistic Input Models for Geometric Algorithms. PhD thesis, University Utrecht, 1997.