Abstract 1 Introduction 2 Preliminaries 3 The weighted case in a simple polygon 4 Deletion-only geodesic unit-disk range emptiness (GUDRE) queries 5 The unweighted simple polygon case 6 The unweighted polygonal domain case References

Shortest Paths in Geodesic Unit-Disk Graphs

Bruce W. Brewer ORCID Kahlert School of Computing, University of Utah, Salt Lake City, UT, USA    Haitao Wang ORCID Kahlert School of Computing, University of Utah, Salt Lake City, UT, USA
Abstract

Let S be a set of n points in a polygon P with m vertices. The geodesic unit-disk graph G(S) induced by S has vertex set S and contains an edge between two vertices whenever their geodesic distance in P is at most one. In the weighted version, each edge is assigned weight equal to the geodesic distance between its endpoints; in the unweighted version, every edge has weight 1. Given a source point sS, we study the problem of computing shortest paths from s to all vertices of G(S). To the best of our knowledge, this problem has not been investigated previously. A naive approach constructs G(S) explicitly and then applies a standard shortest path algorithm for general graphs, but this requires quadratic time in the worst case, since G(S) may contain Ω(n2) edges. In this paper, we give the first subquadratic-time algorithms for this problem. For the weighted case, when P is a simple polygon, we obtain an O(m+nlog3nlog2m)-time algorithm. For the unweighted case, we provide an O(m+nlognlog2m)-time algorithm for simple polygons, and an O(n(n+m)log(n+m))-time algorithm for polygons with holes.

Keywords and phrases:
unit-disk graph, geodesic distance, shortest paths, geodesic Voronoi diagrams, range emptiness queries, dynamic data structures
Copyright and License:
[Uncaptioned image] © Bruce W. Brewer and Haitao Wang; licensed under Creative Commons License CC-BY 4.0
2012 ACM Subject Classification:
Theory of computation Computational geometry
; Theory of computation Design and analysis of algorithms
Related Version:
Full Version: https://arxiv.org/abs/2603.24872
Editors:
Hee-Kap Ahn, Michael Hoffmann, and Amir Nayyeri

1 Introduction

Let S be a set of n points in the plane. The unit-disk graph induced by S has vertex set S and contains an edge between two vertices if their Euclidean distance is at most one. Equivalently, the unit-disk graph is the intersection graph of the set of congruent disks of radius 1/2 centered at the points of S: each disk corresponds to a vertex, and two disks are adjacent precisely when they intersect. Unit-disk graphs are extensively studied in computational geometry due to their rich geometric structure and numerous applications [12]. One motivation arises from wireless ad-hoc networks. Here, each point of S models a device capable of transmitting and receiving wireless signals within a fixed range, which we normalize to one. Thus, two devices can communicate directly exactly when they are connected by an edge in the corresponding unit-disk graph. Many fundamental algorithmic tasks for wireless networks reduce to classical graph problems on unit-disk graphs, such as coloring, independent set, and dominating set [12]. A central question is how to route a message between two devices s and t. If s and t are not within communication range, then the message must be relayed via intermediate devices. In graph terms, the message must follow an s-t path in the unit-disk graph, and ideally one of minimum length. For this reason, the shortest path problem in unit-disk graphs plays a key role in both theory and applications.

Another natural application of unit-disk graphs arises in motion planning with recharging/refueling. Suppose a vehicle (for example, a delivery drone) must travel from a start point s to a target point t, but lacks sufficient battery capacity to traverse this distance directly. Instead, it may need to stop at intermediate charging stations. Consider the graph whose vertices represent charging stations and where two stations are connected by an edge if the vehicle can travel between them on a full charge. After scaling the maximum travel distance on a full charge to one, this graph is precisely a unit-disk graph. Thus, the motion planning problem reduces to finding a shortest s-t path in the unit-disk graph.

Now consider the above applications in the presence of obstacles that must be avoided. In wireless ad-hoc networks, an obstacle may prevent a signal from traveling directly between two devices, forcing it to bend around buildings or terrain features. In the motion planning scenario, obstacles may correspond to physical barriers or restricted regions. In such environments, Euclidean distance no longer reflects the true travel cost between two points. Instead, the relevant distance is the geodesic distance, i.e., the length of a shortest obstacle-avoiding path between two points. Figure 1 illustrates a “geodesic unit disk”.

Refer to caption
Figure 1: Illustrating a geodesic unit disk centered at s (the black solid curve is the boundary of the disk). A unit-length s-t path under geodesic distance (the dashed path) is also shown.

Problem definition.

Motivated by these applications, we study geodesic unit-disk graphs, defined as follows. Let P be a polygonal domain with h holes and a total of m vertices in the plane. Thus, P is a closed, multiply connected region whose boundary consists of h+1 disjoint polygonal cycles. The holes of P, together with the region outside P, are referred to as obstacles. For any two points in P, their geodesic distance is the length of a shortest path between them in P. Let S be a set of points (also called sites) contained in P. The geodesic unit-disk graph G(S) induced by S has vertex set S and contains an edge between two sites whenever their geodesic distance is at most one. In the unweighted case, every edge of G(S) has weight 1; in the weighted case, the weight of an edge is the geodesic distance between its endpoints. The appropriate choice of model depends on the application. Given a source site sS, we consider the single-source shortest-path (SSSP) problem in G(S): for a given polygonal domain P, site set S, and source s, compute shortest paths in G(S) from s to all other vertices. To the best of our knowledge, this problem has not been studied previously.

Related work.

As discussed above, problems on Euclidean unit-disk graphs (i.e., when S is given in the plane without obstacles) are well studied [12]. For the unweighted case, Cabello and Jejčič [8] gave an O(nlogn)-time algorithm for the SSSP problem, matching an Ω(nlogn) lower bound [8]. Chan and Skrepetos [9] later obtained an O(n)-time algorithm under the assumption that the points are presorted by x- and y-coordinates.

For the weighted case, Roditty and Segal [28] obtained an O(n4/3+ϵ)-time algorithm for any ϵ>0. Cabello and Jejčič [8] improved this to O(n1+ϵ) time. Their runtime has since been reduced due to improvements in dynamic bichromatic closest-pair structures, first by Kaplan, Mulzer, Roditty, Seiferth, and Sharir [20] and then by Liu [23]. Most recently, Wang and Xue [29] proposed a new algorithm that avoids dynamic bichromatic closest-pair structures, and their algorithm runs in O(nlog2n) time; Brewer and Wang [7] further improved the time to O(nlog2n/loglogn) by refining a key bottleneck subproblem.

We note that various other problems involving geodesic disks in polygons have also been studied, including separators [4], clustering [5], and piercing [6], among others.

1.1 Our results

A straightforward approach is to construct G(S) explicitly and then run a standard SSSP algorithm. However, G(S) may contain Ω(n2) edges, leading to quadratic time in the worst case. In this paper, we present three subquadratic-time algorithms for three problem variants.

  1. 1.

    For the weighted case, when P is a simple polygon, we obtain an O(m+nlog3nlog2m)-time algorithm. When applied to the Euclidean setting by taking m=O(1) (i.e., P is the entire plane), our runtime is only roughly a logarithmic factor slower than the current best bound of O(nlog2n/loglogn) [29, 7]. The Euclidean algorithms in [29, 7] rely crucially on a grid decomposition of the plane, a technique that does not extend naturally to the polygon setting since a grid cell may be fragmented into multiple disconnected components by the boundary of P. We therefore use a different algorithmic strategy.

  2. 2.

    For the unweighted case in a simple polygon, we give an O(m+nlognlog2m)-time algorithm. Applied to the Euclidean setting, this matches the Ω(nlogn) lower bound [8].

  3. 3.

    When P has holes, the problem becomes substantially more challenging. For the unweighted case in this setting, we develop an O(n(n+m)log(n+m))-time algorithm.

Our techniques involve solving two subproblems that may be interesting in their own rights. Indeed, solving these problems is one of the major contributions of this paper.

Subproblem 1: Deletion-only geodesic unit-disk range emptiness queries.

In this problem, we preprocess a set S of n points inside a simple polygon P of m vertices to support two operations: (1) given a query point q, determine whether there exists a point pS whose geodesic distance to q is at most 1, and if so return such a point; and (2) delete a point from S. We refer to the first operation as a geodesic unit-disk range emptiness (GUDRE) query.

Using the dynamic randomized nearest neighbor data structure of Agarwal, Arge, and Staals [1], each deletion can be supported in O(log7nlogm+log6nlog3m) expected amortized time, and each GUDRE query can be answered in O(log2nlog2m) time. In the Euclidean case (i.e., when P is the entire plane), one can preprocess S in O(nlogn) time and support both queries and deletions in O(logn) time [14, 30].

We obtain the following result. After an O(m)-time global preprocessing step for P, we can, for any given set S of n points in P, build a data structure in O(nlog3m+nlog2mlogn) time such that deletions take O(lognlog3m) amortized time and GUDRE queries take O(lognlog2m) time. Our result is remarkable in three aspects. First, compared to applying [1], our result improves deletion time by a factor of O(log5n) and improves query time by a factor of O(logn), while being deterministic rather than randomized (note that [1] also supports insertions and more general queries). Second, when applied to the Euclidean case (with m=O(1)), our bounds match the optimal Euclidean results of [14, 30]. Third, our result has an interesting implicit nature: after the global preprocessing of P, the construction time for any given S depends only logarithmically on m.

Subproblem 2: Implicit additively weighted geodesic Voronoi diagram.

In this problem, we wish to construct a nearest neighbor data structure for a set S of n additively weighted points in a simple polygon P with m vertices, under the requirement that the data structure be implicitly constructed. That is, after a global preprocessing of P, the time to build the data structure for S should depend only logarithmically on m. Such a data structure is referred to as an implicit Voronoi diagram.

An explicit diagram for S can be built in O((n+m)log(n+m)) time [19], after which weighted nearest neighbor queries can be answered in O(log(n+m)) time via standard point location queries [21, 13]. However, this explicit approach cannot be used in the implicit setting, as even constructing a point location data structure requires Ω(m) time.

For the unweighted version of this implicit problem, the method in [1] obtains the following: after O(m)-time global preprocessing, one can build a structure for S in O(nlognlogm+nlog3m) time that answers nearest neighbor queries in O(lognlog2m) time.

The weighted case is more challenging, as several geometric properties used in [1] no longer hold in the presence of weights. We develop a new method and show that, after O(m)-time global preprocessing of P, a data structure for S can be built in O(nlognlog2m+nlog3m) time, and each weighted nearest neighbor query can be answered in O(lognlog2m) time.

Outline.

In the rest of the paper, after introducing preliminary concepts in Section 2, we present our algorithm for the weighted case in simple polygons in Section 3. This algorithm relies on the solutions to the two subproblems. Section 4 discusses the first subproblem. For the unweighted case, we describe our algorithm for simple polygons in Section 5, and extend it to polygons with holes in Section 6. Thus, Section 6 is the only section dealing with polygons with holes. Due to space constraints, many details and proofs are omitted but can be found in the full paper.

2 Preliminaries

We follow the notation in Sect. 1, e.g., m, n, S, P, s, and G(S). Throughout the paper, P is a simple polygon unless stated otherwise (an exception is Sect. 6, where P may have holes).

We use pq¯ to denote the line segment connecting points p and q, and |pq¯| to denote its (Euclidean) length. For any geometric object R in the plane, let R denote its boundary.

For any two points s,tP, let π(s,t) denote a shortest s-t path in P. If multiple shortest paths exist (which can happen only when P has holes), π(s,t) may refer to an arbitrary one. Let d(s,t) denote the geodesic distance between s and t, i.e., the length of π(s,t). We assume that π(s,t) is oriented from s to t. It is known that every interior vertex of π(s,t) (i.e., except s and t) is a vertex of P. The vertex of π(s,t) adjacent to t is called the anchor of t in π(s,t), and the vertex of π(s,t) adjacent to s is called the anchor of s.

Notation for the simple polygon case.

When P is a simple polygon, for any three points s,t,rP, the vertex of π(s,t)π(s,r) farthest from s is called the junction vertex of π(s,t) and π(s,r). For a point sP and a segment tr¯P, let c be the junction vertex of π(s,t) and π(s,r). Following standard terminology [22, 16], the paths π(c,t) and π(c,r) together with tr¯ form a funnel, denoted Fs(tr¯); see Figure 2. The point c is the cusp of the funnel, and π(c,t) and π(c,r) are the two sides, each of which is a concave chain.

Figure 2: Illustrating a funnel Fs(tr¯) (the light blue region).

When P is a simple polygon, we will frequently use the data structure of Guibas and Hershberger [15, 17], referred to as the GH data structure. It can be built in O(m) time and supports computing d(s,t) in O(logm) time for any s,tP. It can also return the anchors of s and t on π(s,t), and even a compact representation of π(s,t) that supports binary search along the path. Furthermore, it can compute the junction vertex of π(s,t) and π(s,r) for any s,t,rP.

Balanced polygon decomposition (BPD).

For a simple polygon P, we will use a balanced polygon decomposition (BPD) [16, 15, 11]. A line segment inside P connecting two vertices of P that is not an edge of P is called a diagonal. Chazelle [10] proved that P must contain a diagonal d that partitions P into two subpolygons, each with at most 2n/3 vertices. Recursively decomposing the subpolygons until each becomes a triangle yields the BPD.

The BPD can be represented by a tree TP, called the BPD-tree. Each node v of TP corresponds to a subpolygon Pv of P: the root corresponds to P itself, and each leaf corresponds to a triangle. Let dv denote the diagonal used to split Pv into its two child subpolygons. The triangles at the leaves of TP form a triangulation of P. The entire decomposition and TP can be constructed in O(m) time [15].

Geodesic Voronoi diagram.

We will also make extensive use of the geodesic Voronoi diagram of S in P [2, 24, 19, 27]. For a site uS, its Voronoi region is defined as

Vor(u)={pP:d(u,p)d(v,p) for all vS{u}}.

We treat Vor(u) as including its boundary. For two sites u,vS, the Voronoi edge (u,v) is the locus of points pP satisfying d(u,p)=d(v,p)d(z,p) for all zS{u,v}.

If P is a simple polygon, then (u,v) has a single connected component [2], while in general polygonal domains it may have multiple components [19]. Each component consists of a sequence of hyperbolic arcs (including line segments as a degenerate case). We do not use special notation for Voronoi vertices, i.e., points equidistant to at least three sites and strictly farther from all others. Let 𝒱𝒟(S) denote the geodesic Voronoi diagram of S in P.

The definitions extend naturally to the additively weighted case. Each site u has a weight w(u), and the weighted distance from u to any pP is w(u)+d(u,p). Replacing geodesic distances by weighted distances yields the weighted geodesic Voronoi diagram. Note that all weights considered in this paper are additive.

3 The weighted case in a simple polygon

We now consider the SSSP problem in weighted geodesic unit-disk graphs within a simple polygon. Here, S lies inside a simple polygon P, and for every edge e(u,v) of G(S) connecting two sites u,vS, the weight of e(u,v) is defined to be the geodesic distance d(u,v).

To solve the problem, as discussed in Section 1.1, it seems difficult to extend the Euclidean case algorithm in [29, 7]. Another direction is to extend the O(n1+ϵ)-time algorithm of Cabello and Jejčič [8], which relies on a dynamic weighted bichromatic closest pair (BCP) data structure. Combining with the randomized dynamic BCP structures [20, 23], the runtime improves to O(nlog4n) expected time. But this approach does not seem to generalize to the polygon case due to the lack of an efficient dynamic weighted BCP structure under geodesic distance.

We instead take a different approach that avoids BCP altogether. Our algorithm runs in O(m+nlog3nlog2m) deterministic time. Notably, when applied to the Euclidean case by treating P as the whole plane (i.e., m=O(1)), the running time becomes O(nlog3n), which is even faster than the algorithm of [8] combined with dynamic BCP structures [20, 23].

In what follows, we first describe the algorithm and then discuss its implementation.

3.1 Algorithm description

Given a source point sS, our goal is to compute shortest paths from s to all other vertices v in G(S). Let dG(v) denote the shortest-path distance from s to v in G(S). Our algorithm maintains an array dist[] such that, at termination, dist[v]=dG(v) for all vS. With standard modifications, the predecessor information can also be maintained so that the shortest path tree from s can be obtained.

We maintain two subsets A and B of S. The set A consists of all sites v whose values dist[v] have been finalized, and B=SA. We further partition A into two subsets, A1 and A2, such that no site of A1 is adjacent to any site of B in G(S). Initially, we set dist[s]=0, A2=A={s}, A1=, and B=S{s}. We also initialize dist[v]= for every vS{s}.

In each iteration, we select a=argminvA2dist[v], and perform two subroutines:

Subroutine I.

Compute the set Ba={bB:d(a,b)1}, i.e., all sites in B that are adjacent to a in G(S).

Subroutine II.

For each site bBa, compute σb=argminpA2(dist[p]+d(p,b)), and set dist[b]=dist[σb]+d(σb,b).

Afterward, we move all sites of Ba from B into A2, and we move a from A2 into A1. This completes one iteration. The algorithm terminates once A2 becomes empty.

Algorithm correctness.

Although the algorithm looks simple, its correctness is not immediate. See the full paper for the proof. In particular, we show that the algorithm maintains the following two invariants. (I) For every site vA, we have dist[v]=dG(v). (II) For every site vA1, every site u adjacent to v in G(S) is already in A. Using these, we can show that after the algorithm terminates, dist[v]=dG(v) holds for every site vS.

3.2 Algorithm implementation and time analysis

The main difficulty lies in implementing the two subroutines efficiently. Indeed, each subroutine corresponds precisely to one of the two subproblems introduced in Section 1.1.

We maintain the set A2 in a min-heap with dist[v] as the key for all vA2. Thus, extracting a=argminvA2dist[v] takes O(logn) time, and each insertion into A2 also takes O(logn) time. We now discuss the implementation of the two subroutines.

Subroutine I.

To compute Ba, we repeatedly locate a point bB with d(a,b)1 and delete it from B, stopping once no such point remains. Thus, the task reduces exactly to supporting deletion-only geodesic unit-disk range emptiness (GUDRE) queries, as introduced in Section 1.1. Given a set B of points in P, we require a data structure that supports:

Delete:

Remove a point from B.

GUDRE query:

Given a point aP, determine whether there exists bB with d(a,b)1, and if so, return such a point.

One of our main results in this paper is the following theorem, proved in Section 4.

Theorem 1.

Let P be a simple polygon with m vertices, and assume that a GH data structure for P has been built in O(m) time. For any set S of n points in P, we can construct a data structure for S in O(nlog3m+nlognlog2m) time such that each deletion takes O(lognlog3m) amortized time and each GUDRE query takes O(lognlog2m) time.

Using Theorem 1, we implement Subroutine I as follows. Initially, B=S{s}. We build the GUDRE data structure for B in O(m+nlog3m+nlognlog2m) time, where the O(m) term is for constructing the GH data structure. Since the algorithm performs O(n) deletions and GUDRE queries overall, the total time spent in Subroutine I is O(m+nlognlog3m).

Subroutine II.

For the second subroutine, observe that each σb is essentially the (additively) weighted nearest neighbor of b in A2, where each site pA2 has weight dist[p], and the weighted distance from p to a query point q is defined as dist[p]+d(p,q). Thus, we require a weighted nearest neighbor data structure for A2.

Furthermore, since at the end of each iteration, we will move all points of Ba from B to A2 and move a from A2 to A1, we need a dynamic data structure for A2 that supports both insertions and deletions. A direct dynamic data structure supporting both insertions and deletions appears difficult to obtain. However, we show that the problem can be reduced so that only insertions are needed. The key is the following Lemma 2.

Lemma 2.

For any site p1A1 and any site p2A2, we have dist[p1]dist[p2]. Moreover, whenever a site b is added to A2, we have dist[a]<dist[b], and dist[p1]<dist[b] holds for all p1A1.

We maintain a balanced binary search tree TA whose leaves store the sites of A in increasing order of dist[]. By Lemma 2, the points of A can always be arranged so that all sites of A1 appear to the left of all sites of A2; we refer to this as the ordering property of TA. For each node v of TA, let Av denote the set of sites whose leaves lie in the subtree rooted at v. For each v, we construct a weighted nearest neighbor data structure 𝒟v for Av, where each pAv has weight dist[p].

Given a point bB, we compute σb as follows. Because of the ordering property and the definition of a, all sites of A2{a} lie in leaves strictly to the right of the leaf of a. In TA, we find a set Vb of O(logn) nodes whose leaf ranges form a partition of the leaves to the right of a (including the leaf of a). For each vVb, using 𝒟v, we compute a weighted nearest neighbor pv of b in Av and treat each pv as a candidate for σb. We then return the candidate minimizing dist[pv]+d(pv,b). Thus, computing σb requires O(logn) weighted nearest neighbor queries plus O(logn) geodesic distance queries. Recall that a GH data structure for P can be built in O(m) time, after which each distance query d(pv,b) is computable in O(logm) time.

Next we address updates. At the end of each iteration, for every bBa, after computing dist[b], we insert b into TA. This places b at a leaf, and for each node v on the path to the root, we insert b into 𝒟v. By Lemma 2, the ordering property of TA is preserved automatically. Therefore, there is no need to delete a from TA, and each 𝒟v need only support insertions.

To build an insertion-only data structure 𝒟v, one might attempt Bentley’s logarithmic method [3] together with a static geodesic Voronoi diagram for Av. Since computing the geodesic Voronoi diagram of Av in P requires Ω(m) time (note that the best algorithm can compute the diagram in O(m+|Av|log|Av|) time [24]), rebuilding these diagrams n times would lead to Ω(mn) total time, which is too slow. Instead, we require an implicit construction whose dependence on m is only polylogarithmic. This is exactly the subproblem introduced in Section 1.1. In the full paper, we establish the following result.

Theorem 3.

Let P be a simple polygon with m vertices, and assume that a GH data structure for P has been built in O(m) time. Given a set S of n weighted sites in P, we can construct a weighted nearest neighbor data structure for S in O(nlog3m+nlognlog2m) time such that each query can be answered in O(lognlog2m) time.

With Theorem 3, we construct 𝒟v for every node v of TA. Using Bentley’s method, each insertion into 𝒟v takes amortized O(lognlog3m+log2nlog2m) time. Each weighted nearest neighbor query takes O(log2nlog2m) time. Since TA has height O(logn), computing σb takes O(log3nlog2m) time, and inserting a site b into TA takes amortized O(log2nlog3m+log3nlog2m) time. Thus, the total running time of Subroutine II over the entire algorithm is O(m+nlog2nlog3m+nlog3nlog2m), including the O(m) time required to build the GH data structure for P in Theorem 3. It is actually bounded by O(m+nlog3nlog2m).

Theorem 4.

The SSSP problem in the weighted geodesic unit-disk graph in a simple polygon of m vertices for a set of n points can be solved in O(m+nlog3nlog2m) time.

4 Deletion-only geodesic unit-disk range emptiness (GUDRE) queries

In this section, we prove Theorem 1 for the deletion-only GUDRE query problem. The problem can be reduced to a diagonal-separated problem by using the balanced polygon decompositions (BPD) of simple polygons as described in Section 2.

Diagonal-separated deletion-only GUDRE queries.

Consider a diagonal d that partitions P into two subpolygons PL and PR. In the diagonal-separated setting, we assume that all points of S lie in PL, and every query point q lies in PR. We have the following result.

Lemma 5.

Let P be a simple polygon with m vertices, and assume that a GH data structure has been built for P. Given a diagonal d that partitions P into two subpolygons PL and PR, and a set S of n points contained in PL, we can construct a data structure for S in O(nlog2m+nlognlogm) time that supports the following operations:

  1. 1.

    Delete: delete a point from S in O(lognlog2m) amortized time.

  2. 2.

    GUDRE query: for any query point qPR, determine whether there exists a point pS with d(p,q)1, and if so, return such a point as a witness, in O(lognlogm) time.

Theorem 1 can be proved using Lemma 5 and the BPD of P.

4.1 Proof of Lemma 5 – a very brief sketch

We give a very brief sketch of the proof of Lemma 5. See the full paper for all details. We follow the notation in the lemma statement, e.g., P, S, d, PL, PR, n, m. Without loss of generality, we assume that d is vertical and PR is locally to the right of d. Let z0 and z1 denote the lower and upper endpoints of d, respectively.

For each point pP, we define Dp as the geodesic unit-disk centered at p, which consists of all points qP with d(p,q)1. We define PR to be PPR.

For any query point qPR, we need to know whether DqS=. Observe that DqS if and only if qpSDp. Based on this observation, our strategy is to maintain an implicit representation of 𝒟R(S), where 𝒟R(S) is the portion of sSDs in PR. To this end, we propose a concept right envelope as follows.

Right envelope.

Roughly speaking, the right envelope Ξ(S) of 𝒟R(S) is the boundary of 𝒟R(S) excluding d. Specifically, Ξ(S) is union of Ξ(S) and Ξ(S), with Ξ(S)={pPR:d(S,p)=1} and Ξ(S)={pPR:d(S,p)<1}. In general, Ξ(S) is a collection of circular arcs each belonging to Ds for some point sS, while Ξ(S) is a collection of segments on PR; see Figure 3(a).

Note that 𝒟R(S) may have multiple connected components. We can show that for each connected component 𝒟 of 𝒟R(S), 𝒟d consists of a single segment of d and 𝒟 is simply connected (i.e., there are no holes), meaning that 𝒟 is composed of a segment of d and a simple curve connecting the two endpoints of 𝒟d.

For any point sS, define ξs(S) as the set of points pΞ(S) such that d(s,p)d(s,p) for any other point sS. In other words, if we consider the geodesic Voronoi diagram 𝒱𝒟(S) of S, then ξs(S) consists of all points pΞ(S) in the Voronoi region of s; see Figure 3(b). A useful property is that if ξs(S), then ξs(S) is a single connected portion of Ξ(S).

Refer to caption
(a) Ξ(S) is red and Ξ(S) is green.
Refer to caption
(b) ξs(S) is colored with red.
Figure 3: Illustrations of Ξ(S). The region bounded by Ξ(S) and d is 𝒟R(S).

Answering queries using the right envelope.

Intuitively, for any point qPR, q𝒟R(S) if and only if q is “to the left of” Ξ(S). However, the question is how to interpret “left.”

In the Euclidean case where P is the entire plane and d becomes a vertical line, Ξ(S) is a y-monotone curve. Due to this property, there is a trivial way to determine whether q is to the left of Ξ(S): First find by binary search the arc of Ξ(S) intersecting the horizontal line through q, and then determine whether q is to the left of the arc [14, 30].

In our problem, however, Ξ(S) is no longer y-monotone. Intuitively, this is because P is not “large enough” and P changes the “shape” of Ξ(S). Thus, we need a new approach. At a very high level, our strategy is to develop some concepts analogous to those in the Euclidean case. Specifically, we introduce an order R for any two points of PR; this order corresponds to the y-coordinate order in the Euclidean case. We also define a traversal order Ξ for any two points of Ξ(S); in the Euclidean case, this would be the order of traversing on Ξ(S) from bottom to top as Ξ(S) is y-monotone. In addition, we define an order L for all points of S based on their geodesic distances to the lower endpoint z0 of d (i.e., for any two points s,tS, define sLt if d(s,z0)<d(t,z0)). A useful property is that these three orders are consistent with each other, which is crucial to the success of our approach.

A brief data structure description.

Our data structure Ψ(S) is a complete binary tree whose leaves from left to right store the points of S under the order L. For each node v, let Sv be the subset of points S stored in the leaves of the subtree rooted at v. We wish to store an implicit representation of Ξ(Sv) at v. Let I(Sv) be the set of points sSv such that ξs(Sv). We consider I(Sv) a list of its points sorted under L.

If v is the root, then we store I(Sv) at v explicitly. If we store I(Sv) at v explicitly for all nodes vΨ(S), then Ψ(S) would take super-linear space. We instead employ a standard space saving technique [18, 26], where we store a point sS in the highest node v such that sI(Sv). Using this strategy, the total space of Ψ(S) is O(n).

For a node v with left child u and right child w, define ru=maxLI(Sv)I(Su), i.e., among all points in I(Sv)I(Su), ru is the largest one following the order L. Symmetrically, define rw=minLI(Sv)I(Sw). We can show that I(Su)I(Sv) is a prefix of I(Su) and I(Sw)I(Sv) is a suffix of I(Sw). Hence, I(Sv) is the concatenation of I(Su)ru and I(Sw)rw, where the notation I(Su)ru represents the prefix of I(Su) up to and including ru and I(Sw)rw represents the suffix of I(Sw) from and including rw. We store both ru and rw at v. As I(Sv) is the concatenation of I(Su)ru and I(Sw)rw, we only store I(Su)>ru in a list arcs(u) at u and similarly store I(Sw)<rw in arcs(w) at w. This means that in a descent from the root of Ψ(S), we can do the following. Let v be the current node in our descent and assume arcs(v)=I(Sv), which is true initially when v is the root. Suppose v has left child u and right child w. We can cut arcs(v) at ru to obtain I(Su)ru and I(Sw)rw. As I(Su)>ru is stored in arcs(u), we can concatenate I(Su)ru and I(Su)>ru to obtain I(Su). We can do likewise to obtain I(Sw). In an ascent, we can simply reverse this process to obtain I(Sv) from I(Su) and I(Sw) using ru and rw. To facilitate the queries, additional information will also be maintained such as the endpoints of ξs(Sv) for each point sarcs(v).

5 The unweighted simple polygon case

In this section, we present our SSSP algorithm for unweighted G(S) when P is a simple polygon. To solve the problem, a natural idea is to see whether the algorithms for the Euclidean case can be adapted. Two algorithms are known that can solve the Euclidean case in O(nlogn) time [8, 9]. The algorithm in [9] relies on constructing a grid in the plane, which seems inherently not applicable to the polygon setting as explained in Section 1.1.

We therefore adapt the approach of [8]. After introducing notation, we first describe the algorithm at a high level and then discuss its implementation and time analysis.

5.1 Notation

We follow the notation already defined in Sections 1 and 2, including m, n, S, P, s, G(S), 𝒱𝒟(S), (u,v), Vor(u). For any subset SS and a point pP, let βp(S) denote the nearest neighbor of p in S and d(S,p)=minqSd(q,p). Note that d(βp(S),p)=d(S,p).

We define Si for i=0,1,2, to be the set of vertices of G(S) whose shortest path lengths from s in G(S) are equal to i. Clearly, S0={s}. Define Si=jiSj.

Our goal is to compute the sets Si, for i=0,1,2,. In our discussion, we will focus on describing the algorithm to compute these sets. By slightly modifying the algorithm, we can also compute the predecessor information of the shortest paths.

Let V(P) denote the set of vertices of P, which are also referred to as obstacle vertices. For ease of exposition, we make the following general position assumptions: (1) the shortest paths in P between any two points in V(P)S are unique, and (2) no point in V(P)S is equidistant (in geodesic distance) to two other points in V(P)S. Note that the second assumption implies that no obstacle vertex lies on a Voronoi edge of 𝒱𝒟(S), which further means that each Voronoi edge of 𝒱𝒟(S) is one-dimensional. The second assumption also implies that the nearest neighbor of a site pS in any subset SS, i.e., βp(S), is unique.

We use 𝒟𝒯(S) to denote the dual graph of 𝒱𝒟(S). Specifically, the vertex set of 𝒟𝒯(S) is S, and two sites u,vS have an edge in 𝒟𝒯(S) if their Voronoi regions in 𝒱𝒟(S) share a Voronoi edge, i.e., (u,v). For any site uS, we define N𝒟𝒯(u) as the set of vertices of 𝒟𝒯(S) adjacent to u; we also refer to sites of N𝒟𝒯(u) as neighbors of u in 𝒟𝒯(S). For a subset SS, by slightly abusing the notation, we let N𝒟𝒯(S)=uSN𝒟𝒯(u).

5.2 Algorithm description

We first construct the geodesic Voronoi diagram 𝒱𝒟(S). The algorithm then proceeds in iterations. Initially, we have S0={s}. In the i-th iteration for i1, we compute the set Si as follows. We assume that Si1 is available. Let Q=N𝒟𝒯(Si1)Si1, i.e., the sites in S adjacent to those of Si1 in 𝒟𝒯(S) but not in Si1. For each site pQ, we remove p from Q and determine whether d(Si1,p)1. If so, we add p to Si. In addition, we update Q=Q(N𝒟𝒯(p)Si), i.e., add the sites of N𝒟𝒯(p) that are not in QSi to Q for the current Si. We repeat this until Q becomes empty. The i-th iteration finishes once Q become empty. If Si=, then the algorithm stops; otherwise, we proceed with the next iteration. See Algorithm 1 for the pseudocode.

Correctness.

It is not obvious why the algorithm is correct. See the full paper for the proof.

Algorithm 1 SSSP algorithm for the simple polygon case.

5.3 Algorithm implementation and time analysis

First of all, computing 𝒱𝒟(S) can be done in O(m+nlogn) time [24] (see also [2, 27, 25] for other algorithms). Note that the combinatorial size of 𝒱𝒟(S) is O(n+m) [2]. Therefore, 𝒟𝒯(S) can be obtained from 𝒱𝒟(S) in additional linear time. In addition, since 𝒟𝒯(S) has n vertices and is a planar graph, 𝒟𝒯(S) has O(n) edges.

Throughout the whole algorithm, each edge of 𝒟𝒯(S) is considered at most four times (twice for each vertex) in the construction of the neighborhood sets. Specifically, the edge (u,v) for uSi will be considered by Line 9 in the i-th iteration and by Line 4 in the i+1-th iteration. There are O(n) edges in 𝒟𝒯(S), so there are at most O(n) insertions (and thus pop operations) to Q. Hence, the while loop on Line 5 has at most O(n) iterations throughout the whole algorithm. It remains to determine the time complexity for the operation of checking whether d(Si1,p)1 on Line 7.

Notice that d(Si1,p)1 if and only if Si1 has a point q with d(q,p)1. Hence, the problem can be solved by a geodesic unit-disk range emptiness (GUDRE) query. Using Theorem 1, we construct a GUDRE data structure for Si1 in O(|Si1|(log3m+lognlog2m)) time at the beginning of each i-th iteration of Algorithm 1. Using a GUDRE query, whether d(Si1,p)1 can be determined in O(lognlog2m) time by Theorem 1. Note that no deletions on Si1 are needed. Since i|Si1|=n, the overall time for constructing the GUDRE data structure for Si1 in all iterations of the algorithm is O(n(log3m+lognlog2m)).

We conclude that the total time of the algorithm is O(m+nlogn+n(log3m+lognlog2m)), which is O(m+nlognlog2m).

Theorem 6.

Given a simple polygon P of m vertices, a set S of n points in P, and a source point sS, we can compute shortest paths from s to all points of S in the geodesic unit-disk graph of S in O(m+nlognlog2m) time.

6 The unweighted polygonal domain case

When P is a polygonal domain with holes, the framework of Algorithm 1 continues to apply. The main difficulty is algorithmic. Unlike the simple polygon setting, we do not have an efficient analogue of Theorem 1 for polygonal domains (even without deletions) that would allow us to evaluate the condition d(Si1,p)1 on Line 7.

As before, the algorithm proceeds in iterations, with the ith iteration responsible for computing Si. Our key idea is to distinguish between iterations based on the size of Si. If |Si|n, we classify the iteration as heavy; otherwise, it is light. We design separate procedures for these two types, referred to as the heavy-iteration procedure and the light-iteration procedure, respectively. At the start of iteration i, the value of |Si| is not known in advance. Our strategy is therefore to always begin with the light-iteration procedure. If, during its execution, more than n sites are discovered for Si, we immediately abort the light-iteration procedure and switch to the heavy-iteration procedure.

A useful observation is that there can be at most n heavy iterations, since the sets S1,S2, are disjoint, their union is S, and each heavy iteration has at least n sites.

We only give a very brief sketch below. See the full paper for the details. We follow the notation and the discussion in Section 5.1. While the heavy-iteration procedure is relatively easy, the light procedure is quite interesting.

Heavy-iteration procedure.

We compute the geodesic Voronoi diagram 𝒱𝒟(Si1) of Si1 in P in O((|Si1|+m)log(|Si1|+m)) time. With the diagram and a point location data structure, for each site pSSi1, we can compute βp(Si1) and its geodesic distance from p in O(log(m+|Si1|)) time [19]; note that their geodesic distance is d(Si1,p). If d(Si1,p)1, we add p to Si. This computes Si in O((|Si|+m)log(|Si1|+m)+nlog(|Si1|+m)) time, which is O((n+m)log(n+m)). Since the number of heavy iterations in the entire algorithm is O(n), the total time of all heavy procedures in the algorithm is O(n(n+m)log(n+m)).

Light-iteration procedure.

The procedure runs in rounds, and each round computes at least one new point for Si. If a round does not compute any new point for Si, then we can assert that all sites of Si have been computed. If after a round |Si| becomes larger than or equal to n, then we terminate the procedure and switch to the heavy-iteration procedure.

Figure 4: The gray polygons are obstacles. The path π(Si1,v) (dashed polyline) passes through the connected component e1 (dotted curve) of (u,v), so π(Si1,v)Vor(v) is contained in Δv(e1) (the upper light blue region).
Refer to caption
Figure 5: The Voronoi diagram is drawn with solid segments. The shaded region is (u).

In each round, we search in the neighborhoods of the sites of Si1 and the current Si. We find that we do not need 𝒱𝒟(Si1) in the entire P to conduct this search, and only a “small portion” of it suffices. More specifically, suppose there is a shortest path π(Si1,v) from a site of Si1 to v and π(Si1,v) enters Vor(v) through Vor(u) for a neighbor uN𝒟𝒯(v). Consider the Voronoi edge (u,v) of 𝒱𝒟(S) between u and v. This edge may be comprised of multiple connected components e1,,ek where each component is a sequence of hyperbolic arcs. For each component e, let Δv(e) be the subregion of Vor(v) bounded by π(v,a), π(v,b), and e, where a and b are the two endpoints of e (note that π(v,a) and π(v,b) must be in Vor(v)). We observe that for any point p in e, there exists a shortest path π(p,v) that is inside Δv(e). Therefore, if we want to include the shortest path π(Si1,v) through (u,v), the only portion of Vor(v) that we need to include when constructing the Voronoi diagram for Si1 is union of Δv(e) for all components e(u,v). See Figure 4. Motivated by this, for each site u, we define (u) to be the union of Vor(u) and all Δv(e) for all vN𝒟𝒯(u) and all connected components e(u,v); see Figure 5. By including (u) in our “work region” for computing the Voronoi diagram for Si1, we ensure that for all vN𝒟𝒯(u), if π(Si1,v) crosses (u,v), then this path will be included in our work region. This leads to a total of O(n(n+m)log(n+m)) time for all light procedures.

References

  • [1] Pankaj K. Agarwal, Lars Arge, and Frank Staals. Improved Dynamic Geodesic Nearest Neighbor Searching in a Simple Polygon. In Proceedings of the 34th International Symposium on Computational Geometry (SoCG), pages 4:1–4:14, 2018. doi:10.4230/LIPIcs.SoCG.2018.4.
  • [2] Boris Aronov. On the geodesic Voronoi diagram of point sites in a simple polygon. Algorithmica, 4:109–140, 1989. doi:10.1007/BF01553882.
  • [3] Jon L. Bentley. Decomposable searching problems. Information Processing Letters, 8:244–251, 1979. doi:10.1016/0020-0190(79)90117-0.
  • [4] Mark de Berg, Sándor Kisfaludi-Bak, Morteza Monemizadeh, and Leonidas Theocharous. Clique-based separators for geometric intersection graphs. Algorithmica, 85:1652–1678, 2022. doi:10.1007/s00453-022-01041-8.
  • [5] Magdalene G. Borgelt, Marc van Kreveld, and Jun Luo. Geodesic disks and clustering in a simple polygon. In Proceedings of the 18th International Conference on Algorithms and Computation (ISAAC), pages 656–667, 2007. doi:10.5555/1781574.1781647.
  • [6] Prosenjit Bose, Paz Carmi, and Thomas C. Shermer. Piercing pairwise intersecting geodesic disks. Computational Geometry: Theory and Applications, 98(101774), 2021. doi:10.1016/j.comgeo.2021.101774.
  • [7] Bruce W. Brewer and Haitao Wang. An improved algorithm for shortest paths in weighted unit-disk graphs. In Proceedings of the 36th Canadian Conference on Computational Geometry (CCCG), pages 57–64, 2024. arXiv:2407.03176.
  • [8] Sergio Cabello and Miha Jejčič. Shortest paths in intersection graphs of unit disks. Computational Geometry: Theory and Applications, 48:360–367, 2015. doi:10.1016/j.comgeo.2014.12.003.
  • [9] Timothy M. Chan and Dimitrios Skrepetos. All-pairs shortest paths in unit-disk graphs in slightly subquadratic time. In Proceedings of the 27th International Symposium on Algorithms and Computation (ISAAC), pages 24:1–24:13, 2016. doi:10.4230/LIPIcs.ISAAC.2016.24.
  • [10] Bernard Chazelle. Cutting hyperplanes for divide-and-conquer. Discrete and Computational Geometry, 9(2):145–158, 1993. doi:10.1007/BF02189314.
  • [11] Bernard Chazelle and Leonidas J. Guibas. Visibility and intersection problems in plane geometry. Discrete and Computational Geometry, 4:551–589, 1989. doi:10.1007/BF02187747.
  • [12] Brent N. Clark, Charles J. Colbourn, and David S. Johnson. Unit disk graphs. Discrete Mathematics, 86:165–177, 1990. doi:10.1016/0012-365X(90)90358-O.
  • [13] Herbert Edelsbrunner, Leonidas J. Guibas, and Jorge Stolfi. Optimal point location in a monotone subdivision. SIAM Journal on Computing, 15(2):317–340, 1986. doi:10.1137/0215023.
  • [14] Alon Efrat, A. Itai, and Matthew J. Katz. Geometry helps in bottleneck matching and related problems. Algorithmica, 31(1):1–28, 2001. doi:10.1007/s00453-001-0016-8.
  • [15] Leonidas J. Guibas and John Hershberger. Optimal shortest path queries in a simple polygon. Journal of Computer and System Sciences, 39:126–152, 1989. doi:10.1016/0022-0000(89)90041-X.
  • [16] Leonidas J. Guibas, John Hershberger, Daniel Leven, Micha Sharir, and Robert E. Tarjan. Linear-time algorithms for visibility and shortest path problems inside triangulated simple polygons. Algorithmica, 2:209–233, 1987. doi:10.1007/BF01840360.
  • [17] John Hershberger. A new data structure for shortest path queries in a simple polygon. Information Processing Letters, 38(5):231–235, 1991. doi:10.1016/0020-0190(91)90064-O.
  • [18] John Hershberger and Subhash Suri. Applications of a semi-dynamic convex hull algorithm. BIT, 32:249–267, 1992. doi:10.1007/BF01994880.
  • [19] John Hershberger and Subhash Suri. An optimal algorithm for Euclidean shortest paths in the plane. SIAM Journal on Computing, 28(6):2215–2256, 1999. doi:10.1137/S0097539795289604.
  • [20] Haim Kaplan, Wolfgang Mulzer, Liam Roditty, Paul Seiferth, and Micha Sharir. Dynamic planar Voronoi diagrams for general distance functions and their algorithmic applications. Discrete and Computational Geometry, 64:838–904, 2020. doi:10.1007/s00454-020-00243-7.
  • [21] David G. Kirkpatrick. Optimal search in planar subdivisions. SIAM Journal on Computing, 12:28–35, 1983. doi:10.1137/0212002.
  • [22] D.T. Lee and Franco P. Preparata. Euclidean shortest paths in the presence of rectilinear barriers. Networks, 14(3):393–410, 1984. doi:10.1002/net.3230140304.
  • [23] Chih-Hung Liu. Nearly optimal planar k nearest neighbors queries under general distance functions. SIAM Journal on Computing, 51:723–765, 2022. doi:10.1137/20M1388371.
  • [24] Eunjin Oh. Optimal algorithm for geodesic nearest-point Voronoi diagrams in simple polygons. In Proceedings of the 20th Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 391–409, 2019. doi:10.1137/1.9781611975482.25.
  • [25] Eunjin Oh and Hee-Kap Ahn. Voronoi diagrams for a moderate-sized point-set in a simple polygon. Discrete and Computational Geometry, 63:418–454, 2020. doi:10.1007/s00454-019-00063-4.
  • [26] Mark H. Overmars and Jan van Leeuwen. Maintenance of configurations in the plane. Journal of Computer and System Sciences, 23(2):166–204, 1981. doi:10.1016/0022-0000(81)90012-X.
  • [27] Evanthia Papadopoulou and D.T. Lee. A new approach for the geodesic Voronoi diagram of points in a simple polygon and other restricted polygonal domains. Algorithmica, 20:319–352, 1998. doi:10.1007/PL00009199.
  • [28] Liam Roditty and Michael Segal. On bounded leg shortest paths problems. Algorithmica, 59:583–600, 2011. doi:10.1007/s00453-009-9322-3.
  • [29] Haitao Wang and Jie Xue. Near-optimal algorithms for shortest paths in weighted unit-disk graphs. Discrete and Computational Geometry, 64:1141–1166, 2020. doi:10.1007/s00454-020-00219-7.
  • [30] Haitao Wang and Yiming Zhao. Computing the minimum bottleneck moving spanning tree. Algorithmica, 22:6:1–6:22, 2026. doi:10.1007/s00453-025-01358-0.