This paper was converted on www.awesomepapers.org from LaTeX by an anonymous user.
Want to know more? Visit the Converter page.

11institutetext: Department of Computer Science
Utah State University, Logan, UT 84322, USA
11email: [email protected]

On the Planar Two-Center Problem and Circular Hullsthanks: A preliminary version of this paper will appear in the Proceedings of the 36th International Symposium on Computational Geometry (SoCG 2020).

Haitao Wang
Abstract

Given a set SS of nn points in the Euclidean plane, the two-center problem is to find two congruent disks of smallest radius whose union covers all points of SS. Previously, Eppstein [SODA’97] gave a randomized algorithm of O(nlog2n)O(n\log^{2}n) expected time and Chan [CGTA’99] presented a deterministic algorithm of O(nlog2nlog2logn)O(n\log^{2}n\log^{2}\log n) time. In this paper, we propose an O(nlog2n)O(n\log^{2}n) time deterministic algorithm, which improves Chan’s deterministic algorithm and matches the randomized bound of Eppstein. If SS is in convex position, then we solve the problem in O(nlognloglogn)O(n\log n\log\log n) deterministic time. Our results rely on new techniques for dynamically maintaining circular hulls under point insertions and deletions, which are of independent interest.

1 Introduction

In this paper, we consider the planar 2-center problem. Given a set SS of nn points in the Euclidean plane, we wish to find two congruent disks of smallest radius whose union covers all points of SS.

The classical 1-center problem for a set of points is to find the smallest disk covering all points, and the problem can be solved in linear time in any fixed dimensional space [9, 13, 23]. As a natural generalization, the 2-center problem has attracted much attention. Hershberger and Suri [18] first solved the decision version of the problem in O(n2logn)O(n^{2}\log n) time, which was later improved to O(n2)O(n^{2}) time [17]. Using this result and parametric search [22], Agarwal and Sharir [2] gave an O(n2log3n)O(n^{2}\log^{3}n) time algorithm for the 22-center problem. Katz and Sharir [20] achieved the same running time by using expanders instead of parametric search. Eppstein [15] presented a randomized algorithm of O(n2log2nloglogn)O(n^{2}\log^{2}n\log\log n) expected time. Later, Jaromczyk and Kowaluk [19] proposed an O(n2)O(n^{2}) time algorithm. A breakthrough was achieved by Sharir [27], who proposed the first subquadratic algorithm for the problem, and the running time is O(nlog9n)O(n\log^{9}n). Afterwards, following Sharir’s algorithmic scheme, Eppstein [16] derived a randomized algorithm of O(nlog2n)O(n\log^{2}n) expected time, and then Chan [6] developed an O(nlog2nlog2logn)O(n\log^{2}n\log^{2}\log n) time deterministic algorithm and a randomized algorithm of O(nlog2n)O(n\log^{2}n) time with high probability. Recently, Tan and Jiang [28] proposed a simple algorithm of O(nlog2n)O(n\log^{2}n) time based on binary search, but unfortunately, the algorithm is not correct (see the appendix for details). The problem has an Ω(nlogn)\Omega(n\log n) time lower bound in the algebraic decision tree model [16], by a reduction from the max-gap problem.

In this paper, we present a new deterministic algorithm of O(nlog2n)O(n\log^{2}n) time, which improves the O(nlog2nlog2logn)O(n\log^{2}n\log^{2}\log n) time deterministic algorithm by Chan [6] and matches the randomized bound of O(nlog2n)O(n\log^{2}n) [6, 16]. This is the first progress on the problem since Chan’s work [6] was published twenty years ago. Further, if SS is in convex position (i.e., every point of SS is a vertex of the convex hull of SS), then our technique can solve the 2-center problem on SS in O(nlognloglogn)O(n\log n\log\log n) time. Previously, Kim and Shin [21] announced an O(nlog2n)O(n\log^{2}n) time algorithm for this convex position case, but Tan and Jiang [28] found errors in their time analysis.

Some variations of the 2-center problem have also been considered in the literature. Agarwal et al. [3] studied the discrete 2-center problem where the centers of the two disks must be in SS, and they solved the problem in O(n4/3log5n)O(n^{4/3}\log^{5}n) time. Agarwal and Phillips [1] considered an outlier version of the problem where kk points of SS are allowed to be outside the two disks, and they presented a randomized algorithm of O(nk7log3n)O(nk^{7}\log^{3}n) expected time. Arkin et al. [4] studied a bichromatic 2-center problem for a set of nn pairs of points in the plane, and the goal is to assign a red color to a point and a blue color to the other point for every pair, such that max{r1,r2}\max\{r_{1},r_{2}\} is minimized, where r1r_{1} (resp., r2r_{2}) is the radius of the smallest disk covering all red (resp., blue) points. Arkin et al. [4] gave an O(n3log2n)O(n^{3}\log^{2}n) time algorithm, which was recently improved to O(n2log2n)O(n^{2}\log^{2}n) time by Wang and Xue [29]. The more general kk-center problem is NP-hard if kk is part of the input [24].

1.1 Our Techniques

Let D1D_{1}^{*} and D2D_{2}^{*} be two congruent disks in an optimal solution such that the distance of their centers is minimized. Let rr^{*} be their radius and δ\delta^{*} the distance of their centers. If δr\delta^{*}\geq r^{*}, we call it the distant case; otherwise, it is the nearby case.

Eppstein [16] already solved the distant case in O(nlog2n)O(n\log^{2}n) deterministic time. Solving the nearby case turns out to be the bottleneck in all previous three sub-quadratic time algorithms [6, 16, 27]. Specifically, Sharir [27] first solved it in O(nlog9n)O(n\log^{9}n) deterministic time. Eppstein [16] gave a randomized algorithm of O(nlognloglogn)O(n\log n\log\log n) expected time. Chan [16] proposed a randomized algorithm of O(nlogn)O(n\log n) time with high probability and another deterministic algorithm of O(nlog2nlog2logn)O(n\log^{2}n\log^{2}\log n) time. Our contribution is an O(nlognloglogn)O(n\log n\log\log n) time deterministic algorithm for the nearby case, which improves Chan’s algorithm by a factor of lognloglogn\log n\log\log n. Combining with the O(nlog2n)O(n\log^{2}n) time deterministic algorithm of Eppstein [16] for the distant case, the 2-center problem can now be solved in O(nlog2n)O(n\log^{2}n) deterministic time. Interestingly, solving the distant case now becomes the bottleneck of the problem.

Our algorithm (for the nearby case) is based on the framework of Chan [6]. Our improvement is twofold. First, Chan [6] derived an O(nlogn)O(n\log n) time algorithm for the decision problem, i.e., given rr, decide whether rrr^{*}\leq r. We improve the algorithm to O(n)O(n) time, after O(nlogn)O(n\log n) time preprocessing. Second, Chan [6] solved the optimization problem (i.e., the original 2-center problem) by parametric search. To this end, Chan developed a parallel algorithm for the decision problem and the algorithm runs in O(lognlog2logn)O(\log n\log^{2}\log n) parallel steps using O(nlogn)O(n\log n) processors. By applying Cole’s parametric search [10] and using his O(nlogn)O(n\log n) time decision algorithm, Chan solved the optimization problem in O(nlog2nlog2logn)O(n\log^{2}n\log^{2}\log n) time. We first notice that simply replacing Chan’s O(nlogn)O(n\log n) time decision algorithm with our new O(n)O(n) time algorithm does not lead to any improvement. Indeed, in Chan’s parallel algorithm, the number of processors times the number of parallel steps is O(nlog2nlog2logn)O(n\log^{2}n\log^{2}\log n). We further design another parallel algorithm for the decision problem, which runs in O(lognloglogn)O(\log n\log\log n) parallel steps using O(n)O(n) processors. Consequently, by applying Cole’s parametric search with our O(n)O(n) time decision algorithm, we solve the optimization problem in O(nlognloglogn)O(n\log n\log\log n) time. Note that although Cole’s parametric search is used, our algorithm mainly involves independent binary searches and no sorting networks are needed.

In addition, we show that our algorithm can be easily applied to solving the convex position case in O(nlognloglogn)O(n\log n\log\log n) time.

Circular hulls.

To obtain our algorithm for the decision problem, we develop new techniques for circular hulls [18] (also known as α\alpha-hulls with α=1\alpha=1 [14]). A circular hull of radius rr for a set QQ of points is the common intersection of all disks of radius rr containing QQ (to see how circular hulls are related to the two-center problem, notice that there exists a disk of radius rr covering all points of QQ if and only if the circular hull of QQ of radius rr exists). Although circular hulls have been studied before, our result needs more efficient algorithms for certain operations. For example, two algorithms [14, 18] were known for constructing the circular hull for a set of nn points; both algorithms run in O(nlogn)O(n\log n) time, even if the points are given sorted. We instead present a linear-time algorithm once the points are sorted. Also, Hershberger and Suri [18] gave a linear-time algorithm to find the common tangents of two circular hulls separated by a line, and we design a new algorithm of O(logn)O(\log n) time. We also need to maintain a dynamic circular hull for a set of points under point insertions and deletions. Hershberger and Suri [18] gave a semi-dynamic data structure that can support deletions in O(logn)O(\log n) amortized time each. In our problem, we need to handle both insertions and deletions but with the following special properties: the point in each insertion must be to the right of all points of QQ and the point in each deletion must be the leftmost point of QQ. Our data structure can handle each update in O(1)O(1) amortized time (which leads to the linear time decision algorithm for the 2-center problem111As will be clear later, the points processed in our dynamic circular hull problem are actually sorted radially around a point; we can extend the result for the left-right sorted case to the radically sorted case.). We believe that these results on circular hulls are interesting in their own right and undoubtedly have other applications.

Outline.

The rest of the paper is organized as follows. We introduce notation and review some previous work in Section 2. In Section 3, we present our decision algorithm, and the algorithm needs a data structure to maintain circular hulls dynamically, which is given in Section 6. Section 4 solves the optimization problem. Section 5 is concerned with the convex position case. Section 7 is devoted to proving a lemma that is used in Section 4.

2 Preliminaries

We begin with some notation, some of which is borrowed from [6]. It suffices to solve the nearby case. Thus, we assume that δ<r\delta^{*}<r^{*} in the rest of the paper. In the nearby case, it is possible to find in O(n)O(n) time a constant number of points such that at least one of them, denoted by oo, is in D1D2D_{1}^{*}\cap D_{2}^{*} [16]. We assume that oo is the origin of the plane. We make a general position assumption: no two points of SS are collinear with oo and no two points of SS have the same xx-coordinate. This assumption does not affect the running time of the algorithm, but simplifies the presentation.

For any set PP of points in the plane, let τ(P)\tau(P) denote the radius of the smallest enclosing disk of PP. For a connected region BB in the plane, let B\partial B denote the boundary of BB.

The boundaries of the two disks D1D^{*}_{1} and D2D^{*}_{2} have exactly two intersections, and let ρ1\rho_{1} and ρ2\rho_{2} be the two rays through these intersections emanating from oo (e.g., see Fig. 2). As argued in [6], one of the two coordinate axes must separate ρ1\rho_{1} and ρ2\rho_{2} since the angle between the two rays lies in [π/2,3π/2][\pi/2,3\pi/2], and without loss of generality, we assume it is the xx-axis.

Refer to caption
Figure 1: Illustrating the nearby case.
Refer to caption
Figure 2: Illustrating the points of S+S^{+} and SS^{-}.

Let S+S^{+} denote the subset of points of SS above the xx-axis, and S=SS+S^{-}=S\setminus S^{+}. For notational simplicity, let |S+|=|S|=n|S^{+}|=|S^{-}|=n. Let p1,p2,,pnp_{1},p_{2},\ldots,p_{n} be the sorted list of S+S^{+} counterclockwise around oo, and q1,q2,,qnq_{1},q_{2},\ldots,q_{n} the sorted list of SS^{-} also counterclockwise around oo (e.g., see Fig. 2). For each i=0,1,,ni=0,1,\ldots,n and j=0,1,,nj=0,1,\ldots,n, define Lij={pi+1,pn,q1,,qj}L_{ij}=\{p_{i+1}\ldots,p_{n},q_{1},\ldots,q_{j}\} and Rij={qj+1,,qn,p1,,pi}R_{ij}=\{q_{j+1},\ldots,q_{n},p_{1},\ldots,p_{i}\}. Note that if i=ni=n, then Lij={q1,,qj}L_{ij}=\{q_{1},\ldots,q_{j}\}, and if j=nj=n, then Rij={p1,,pi}R_{ij}=\{p_{1},\ldots,p_{i}\}. In words, if we consider a ray emanating from oo and between pip_{i} and pi+1p_{i+1}, and another ray emanating from oo and between qjq_{j} and qj+1q_{j+1}, then LijL_{ij} (resp., RijR_{ij}) consist of all points to the left (resp., right) of the two rays (e.g., see Fig. 2).

Note that the partition of SS by the two rays ρ1ρ2\rho_{1}\cup\rho_{2} is {Lij,Rij}\{L_{ij},R_{ij}\} for some ii and jj, and thus r=max{τ(Lij),τ(Rij)}r^{*}=\max\{\tau(L_{ij}),\tau(R_{ij})\}. Define A[i,j]=τ(Lij)A[i,j]=\tau(L_{ij}) and B[i,j]=τ(Rij)B[i,j]=\tau(R_{ij}), for all 0i,jn0\leq i,j\leq n. Then, r=min0i,jnmax{A[i,j],B[i,j]}r^{*}=\min_{0\leq i,j\leq n}\max\{A[i,j],B[i,j]\}. If we consider AA and BB as (n+1)×(n+1)(n+1)\times(n+1) matrices, then each row of AA (resp., BB) is monotonically increasing (resp., decreasing) and each column of AA (resp., BB) is monotonically decreasing (resp., increasing). For each i[0,n]i\in[0,n], define ri=min0jnmax{A[i,j],B[i,j]}r^{*}_{i}=\min_{0\leq j\leq n}\max\{A[i,j],B[i,j]\}. Thus, r=min0inrir^{*}=\min_{0\leq i\leq n}r_{i}^{*}.

2.1 Circular Hulls

For any point cc in the plane and a value rr, we use Dr(c)D_{r}(c) to denote the disk centered at cc with radius rr. For a set QQ of points in the plane, define r(Q)=cQDr(c)\mathcal{I}_{r}(Q)=\bigcap_{c\in Q}D_{r}(c), i.e., the common intersection of the disks Dr(c)D_{r}(c) for all points cQc\in Q. Note that r(Q)\mathcal{I}_{r}(Q) is convex. A dual concept of r(Q)\mathcal{I}_{r}(Q) is the circular hull [18] (also known as α\alpha-hull with α=1\alpha=1 [14]; e.g., see Fig 4), denoted by αr(Q)\alpha_{r}(Q), which is the common intersection of all disks of radius rr containing QQ. αr(Q)\alpha_{r}(Q) is convex and unique. The vertices of αr(Q)\alpha_{r}(Q) is a subset of QQ and the edges are arcs of circles of radius rr. r(Q)\mathcal{I}_{r}(Q) and αr(Q)\alpha_{r}(Q) are dual to each other: Every arc of αr(Q)\alpha_{r}(Q) is on the circle of radius rr centered at a vertex of r(Q)\mathcal{I}_{r}(Q) and every arc of r(Q)\mathcal{I}_{r}(Q) is on the circle of radius rr centered at a vertex of αr(Q)\alpha_{r}(Q). Note that αr(Q)\alpha_{r}(Q) exists if and only if r(Q)\mathcal{I}_{r}(Q)\neq\emptyset, which is true if and only τ(Q)r\tau(Q)\leq r. For brevity, we often drop the subscript rr from r(Q)\mathcal{I}_{r}(Q) and αr(Q)\alpha_{r}(Q) if it is clear from the context.

Refer to caption
Figure 3: Illustrating the circular hull of a set of points.
Refer to caption
Figure 4: Illustrating two minor arcs of pp and qq.

Circular hulls will play a very important role in our algorithm. As discussed in [18], circular hulls have many properties similar to convex hulls. However, circular hulls also have special properties that convex hulls do not possess. For example, the circular hull for a set of points may not exist. Also, the leftmost point of a set QQ of points must be a vertex of the convex hull of QQ, but this may not be the case for the circular hull. Due to these special properties, extending algorithms on convex hulls to circular hulls sometimes is not trivial, as will be seen later. In the following, we introduce some concepts on circular hulls that will be needed later.

We assume that r=1r=1 and thus a disk of radius rr is a unit disk (whose boundary is a unit circle). We use α(Q)\alpha(Q) to refer to αr(Q)\alpha_{r}(Q). We assume that α(Q)\alpha(Q) exists.

For any arc of a circle, the circle is called the supporting circle of the arc, and the disk enclosed in the circle is called the supporting disk of the arc. If a disk DD contains all points of a set PP, then we say that DD covers PP. We say that a set PP of points in the plane is unit disk coverable if there is a unit disk that contains all points of PP, which is true if and only if α(P)\alpha(P) exists.

Consider two points pp and qq that are unit disk coverable. There must be a unit circle with pp and qq on it, and we call the arc of the circle subtending an angle of at most 180180^{\circ} a minor arc [18]. Note that there are two minor arcs connecting pp and qq, we use cw(p,q)cw(p,q) to refer to the one clockwise around the center of the supporting circle of the arc from pp to qq, and use ccw(p,q)ccw(p,q) to refer to the other one (e.g., see Fig. 4). Note that cw(p,q)=ccw(q,p)cw(p,q)=ccw(q,p) and ccw(p,q)=cw(q,p)ccw(p,q)=cw(q,p). For any minor arc ww, we use D(w)D(w) to denote the supporting disk of ww, i.e., the disk whose boundary contains ww. Note that all arcs of α(Q)\alpha(Q) are minor arcs. We make a general position assumption that no point of QQ is on a minor arc of two other points of QQ. The following observation has already been discovered previously [14, 18].

Observation 1

[14, 18]

  1. 1.

    A point pp of QQ is a vertex of α(Q)\alpha(Q) iff there is a unit disk covering QQ and with pp on the boundary.

  2. 2.

    A minor arc connecting two points of QQ is an arc of α(Q)\alpha(Q) iff its supporting disk covers QQ.

  3. 3.

    α(Q)\alpha(Q) is the common intersection of the supporting disks of all arcs of α(Q)\alpha(Q).

  4. 4.

    A unit disk covers QQ iff it contains α(Q)\alpha(Q).

  5. 5.

    For any subset QQ^{\prime} of QQ, α(Q)α(Q)\alpha(Q^{\prime})\subseteq\alpha(Q).

For any vertex vv of α(Q)\alpha(Q), we refer to the clockwise neighboring vertex of vv on α(Q)\alpha(Q) the clockwise neighbor of vv, and the counterclockwise neighbor is defined analogously. We use cw(v)cw(v) and ccw(v)ccw(v) to denote vv’s clockwise and counterclockwise neighbors, respectively.

Tangents.

Consider a vertex vv in the circular hull α(Q)\alpha(Q). Consider the arc cw(ccw(v),v)cw(ccw(v),v) of α(Q)\alpha(Q). Let DD be the disk D(cw(ccw(v),v))D(cw(ccw(v),v)). By Observation 1(2) and (4), DD contains α(Q)\alpha(Q). Observe that if we rotate DD around vv clockwise until D\partial D contains the arc cw(v,cw(v))cw(v,cw(v)), DD always contains α(Q)\alpha(Q), and in fact, this continuum of disks DD are the only unit disks that contain α(Q)\alpha(Q) and have vv on the boundaries. For each of such disk DD, we say that DD (and any part of D\partial D containing vv) is tangent to α(Q)\alpha(Q) at vv. We have the following observation.

Observation 2

A unit disk DD that contains a vertex vv of α(Q)\alpha(Q) on its boundary is tangent to α(Q)\alpha(Q) at vv if and only if DD contains both cw(v)cw(v) and ccw(v)ccw(v).

Refer to caption
Figure 5: Illustrating the two tangents from pp to α(Q)\alpha(Q): cw(a,p)cw(a,p) and ccw(b,p)ccw(b,p).
Refer to caption
Figure 6: Illustrating the upper common tangent cw(a1,a2)cw(a_{1},a_{2}) and the lower common tangent ccw(b1,b2)ccw(b_{1},b_{2}) of α(Q1)\alpha(Q_{1}) and α(Q2)\alpha(Q_{2}).

Let pp be a point outside α(Q)\alpha(Q). If there is a vertex aa on α(Q)\alpha(Q) such that D(cw(a,p))D(cw(a,p)) is tangent to α(Q)\alpha(Q) at aa, then the arc cw(a,p)cw(a,p) is an upper tangent from pp to α(Q)\alpha(Q); e.g., see Fig 6. If there is a vertex bb on α(Q)\alpha(Q) such that D(ccw(b,p))D(ccw(b,p)) is tangent to α(Q)\alpha(Q) at bb, then the arc ccw(b,p)ccw(b,p) is a lower tangent from pp to α(Q)\alpha(Q). By replacing the arcs of α(Q)\alpha(Q) clockwise from aa to bb with the two tangents from pp, we obtain α(Q{p})\alpha(Q\cup\{p\}). This also shows that pp has tangents to α(Q)\alpha(Q) if and only if Q{p}Q\cup\{p\} is unit disk coverable and pp is outside α(Q)\alpha(Q). Note that a=ba=b is possible, in which case α(Q{p})=α({a,p})\alpha(Q\cup\{p\})=\alpha(\{a,p\}).

Common tangents of two circular hulls.

Let Q1Q_{1} and Q2Q_{2} be two sets of points in the plane such that all points of Q1Q_{1} (resp., Q2Q_{2}) are to the left (resp., right) of a vertical line \ell. Let Q=Q1Q2Q=Q_{1}\cup Q_{2}. A unit disk DD that is tangent to α(Q1)\alpha(Q_{1}), say at a vertex aa, and is also tangent to α(Q2)\alpha(Q_{2}), say at a vertex bb, is said to be commonly tangent to α(Q1)\alpha(Q_{1}) and α(Q2)\alpha(Q_{2}). The minor arc of DD connecting aa and bb is called a common tangent of the two circular hulls. It is an upper (resp, lower) tangent if it is clockwise (resp., counterclockwise) from aa to bb along the minor arc (e.g., see Fig. 6). The common tangents of α(Q1)\alpha(Q_{1}) and α(Q2)\alpha(Q_{2}) may not exist. Indeed, if α(Q)\alpha(Q) does not exist, then the common tangents do not exist. Otherwise the common tangents do not exist either if all points of Q2Q_{2} are contained in α(Q1)\alpha(Q_{1}), which happens only if Q2Q_{2} is covered by D(w)D(w) for the rightmost arc ww of α(Q1)\alpha(Q_{1}) and we call it the Q1Q_{1}-dominating case, or if all points of Q1Q_{1} are contained in α(Q2)\alpha(Q_{2}), which happens only if Q1Q_{1} is covered by D(w)D(w^{\prime}) for the leftmost arc ww^{\prime} of α(Q2)\alpha(Q_{2}) and we call it the Q2Q_{2}-dominating case. If none of the above cases happens, then there are exactly two common tangents between the two hulls. Each tangent intersects the vertical line \ell, which separates Q1Q_{1} and Q2Q_{2}, and the upper tangent intersects \ell higher than the lower tangent does.

Suppose \mathcal{L} is a sequence of points and pp and qq are two points of \mathcal{L}. We will adhere to the convention that a subsequence of \mathcal{L} from pp to qq includes both pp and qq, but a subsequence of \mathcal{L} strictly from pp to qq does not include either one. In many cases, \mathcal{L} is a cyclic sequence of points, e.g., vertices on a circular hull, and we often say points of \mathcal{L} clockwise/counterclockwise (strictly) from pp to qq.

3 The Decision Problem

This section is concerned with the decision problem: Given a value rr, decide whether rrr^{*}\leq r. Previously, Chan [6] solved the problem in O(nlogn)O(n\log n) time (Chan actually considered a slightly different problem: decide whether r<rr^{*}<r, but the idea is similar). We present an O(n)O(n) time algorithm, after O(nlogn)O(n\log n) time preprocessing to sort all points of S+S^{+} and SS^{-} to obtain the sorted lists p1,,pnp_{1},\ldots,p_{n} and q1,,qnq_{1},\ldots,q_{n}.

Given rr, we use the following algorithmic framework in Algorithm 1 from [6] (see Theorem 3.3), which can decide whether rrr^{*}\leq r, and if yes, report all indices ii with rirr_{i}^{*}\leq r.

1 j1j\leftarrow-1;
2 for i0i\leftarrow 0 to nn do
3      while A[i,j+1]rA[i,j+1]\leq r do  j++j++ ;
4      if B[i,j]rB[i,j]\leq r then  report ii ;
5     
6      end for
Algorithm 1 The decision algorithm of Chan [6]

The algorithm is simple, but the technical crux is in how to decide whether A[i,j+1]rA[i,j+1]\leq r and whether B[i,j]rB[i,j]\leq r. Chan [6] built a data structure in O(nlogn)O(n\log n) time so that each of these two steps can be done in O(logn)O(\log n) time, which leads to an overall O(nlogn)O(n\log n) time for his decision algorithm. Our innovation is a new data structure that can perform each of the two steps in O(1)O(1) amortized time, resulting in an O(n)O(n) time algorithm. Our idea is motivated by the following observation.

Observation 3

All such elements A[i,j+1]A[i,j+1] that are checked in the algorithms (i.e., Line 3) are in a path of the matrix AA from A[0,0]A[0,0] to an element in the bottom row and the path only goes rightwards or downwards. The same holds for the elements of BB that are checked in the algorithms (i.e., Line 4).

We call such a path in AA as specified in the observation a monotone path, which contains at most 2(n+1)2(n+1) elements of AA. We show that we can determine in O(n)O(n) time whether A[i,j]rA[i,j]\leq r for all elements A[i,j]A[i,j] in a monotone path of AA. The same algorithm works for BB as well.

Let π\pi be a monotone path of AA, starting from A[0,0]A[0,0]. Consider any element A[i,j]A[i,j] on π\pi. Recall that A[i,j]=τ(Lij)A[i,j]=\tau(L_{ij}). The next value of π\pi after A[i,j]A[i,j] is either A[i,j+1]A[i,j+1] or A[i+1,j]A[i+1,j], i.e., either τ(Li,j+1)\tau(L_{i,j+1}) or τ(Li+1,j)\tau(L_{i+1,j}). Note that Li,j+1L_{i,j+1} can be obtained from LijL_{ij} by inserting qj+1q_{j+1} and Li+1,jL_{i+1,j} can be obtained from LijL_{ij} by deleting pi+1p_{i+1}. Because the points p1,p2,,pn,q1,q2,qnp_{1},p_{2},\ldots,p_{n},q_{1},q_{2}\ldots,q_{n} are ordered around oo counterclockwise, our problem becomes the following. Maintain a sublist QQ of the above sorted list of SS, with Q=S+Q=S^{+} initially, to determine whether τ(Q)r\tau(Q)\leq r (or equivalently whether αr(Q)\alpha_{r}(Q) exists) under deletions and insertions, such that a deletion operation deletes the first point of QQ and an insertion operation inserts the point of SS following the last point of QQ. Further, deletions only happen to points of S+S^{+} (i.e., once pnp_{n} is deleted from QQ, no deletions will happen). We refer to the problem as the dynamic circular hull problem. We will show in Section 6 that the problem can be solved in O(n)O(n) time, i.e., each update takes O(1)O(1) amortized time. This leads to the following result.

Theorem 3.1

Assume that points of SS are sorted cyclically around oo. Given any rr, whether rrr^{*}\leq r can be decided in O(n)O(n) time.

Remark.

For the nearby case, Chan proposed (in Theorem 3.4 [16]) a randomized algorithm of O(nlogn)O(n\log n) time with high probability (i.e., 12Ω(n/log12n)1-2^{-\Omega(n/\log^{12}n)}) by using his O(nlogn)O(n\log n) time decision algorithm. Applying our linear time decision algorithm and following Chan’s algorithm (specifically, setting mm to n/log7n\lfloor n/\log^{7}n\rfloor instead of n/log6n\lfloor n/\log^{6}n\rfloor in the algorithm of Theorem 3.4 in [16]), we can obtain the following result: After O(nlogn)O(n\log n) deterministic time preprocessing, we can compute rr^{*} for the nearby case in O(n)O(n) time with high probability (i.e., 12Ω(n/log14n)1-2^{-\Omega(n/\log^{14}n)}).

4 The Optimization Problem

With Theorem 3.1, we solve the optimization problem by parametric search [10, 22]. As Chan’s algorithm [6], because our decision algorithm is inherently sequential, we need to design a parallel decision algorithm. Chan [6] gave a parallel decision algorithm that runs in O(lognlog2logn)O(\log n\log^{2}\log n) parallel steps using O(nlogn)O(n\log n) processors. Consequently, by using his O(nlogn)O(n\log n) time decision algorithm and applying Cole’s parametric search [10], Chan [6] solved the optimization problem in O(nlog2nlog2logn)O(n\log^{2}n\log^{2}\log n) time. By following Chan’s algorithmic scheme, we develop a new parallel decision algorithm that runs in O(lognloglogn)O(\log n\log\log n) parallel steps using O(n)O(n) processors. Then, with the serial decision algorithm in Theorem 3.1 and applying Cole’s parametric search [10] on our new parallel decision algorithm, we solve the optimization problem in O(nlognloglogn)O(n\log n\log\log n) time.

Our algorithm relies on the following lemma, whose proof is quite independent of the remainder of this section and will be given in Section 7. Note that Hershberger and Suri [18] gave a linear-time algorithm to achieve the same result as Lemma 1, which suffices for their purpose.

Lemma 1

Given the circular hull (with respect to a radius rr) of a set LL of points and the circular hull of another set RR of points such that the points of LL and RR are separated by a line, one can do the following in O(log(|L|+|R|))O(\log(|L|+|R|)) time (assuming that the vertices of each circular hull are stored in a data structure that supports binary search): determine whether the circular hull of LRL\cup R (with respect to rr) exists; if yes, either determine which dominating case happens (i.e., all points of a set are contained in the circular hull of the other set) or compute the two common tangents between the circular hulls of LL and RR.

For any 0ijn0\leq i\leq j\leq n, let S+[i,j]={pi,pi+1,,pj}S^{+}[i,j]=\{p_{i},p_{i+1},\ldots,p_{j}\} and S[i,j]={qi,qi+1,,qj}S^{-}[i,j]=\{q_{i},q_{i+1},\ldots,q_{j}\}. By using Lemma 1, we have the following lemma.

Lemma 2

We can preprocess SS and compute an interval (r1,r2](r_{1},r_{2}] containing rr^{*} in O(nlogn)O(n\log n) time so that given any r(r1,r2)r\in(r_{1},r_{2}) and any pair (i,j)(i,j) with 1ijn1\leq i\leq j\leq n, we can determine whether αr(S+[i,j])\alpha_{r}(S^{+}[i,j]) (resp., αr(S[i,j])\alpha_{r}(S^{-}[i,j])) exists, and if yes, return the root of a balanced binary search tree representing the circular hull, in O(logkloglogk)O(\log k\log\log k) parallel steps using O(logk)O(\log k) processors, or in O(log2k)O(\log^{2}k) time using one processor, where k=ji+1k=j-i+1.

Proof

As in [6, 16], we use the following geometric transformation. For any point p=(a,b)p=(a,b), let h(p)h(p) denote the halfspace {(x,y,z):za2+b22axaby}\{(x,y,z):z\geq a^{2}+b^{2}-2ax-aby\}. Then, for any set PP of points in the plane, (τ(P))2(\tau(P))^{2} is the minimum of x2+y2+zx^{2}+y^{2}+z over all points (x,y,z)(x,y,z) in the polyhedron (P)=pPh(p)\mathcal{H}(P)=\bigcap_{p\in P}h(p).

Preprocessing.

We build a complete binary search tree T+T^{+} on the set S+={p1,p2,,pn}S^{+}=\{p_{1},p_{2},\ldots,p_{n}\} such that the leaves of T+T^{+} from left to right storing the points of S+S^{+} in their index order. Each internal node vv of T+T^{+} stores a hierarchical representation [11] of the polyhedron (P)\mathcal{H}(P), where PP is the set of points stored in the leaves of the subtree rooted at vv (PP is called a canonical subset). Computing the polyhedrons of all internal nodes of T+T^{+} can be done in O(nlogn)O(n\log n) time in a bottom-up manner using linear time polyhedra intersection algorithms [7, 8]. Similarly, we build a tree TT^{-} on the set S={q1,q2,,qn}S^{-}=\{q_{1},q_{2},\ldots,q_{n}\}.

Consider a vertex v=(x,y,z)v=(x,y,z) of (P)\mathcal{H}(P) for a canonical subset PP of T+T^{+}. Define r(v)=x2+y2+zr(v)=\sqrt{x^{2}+y^{2}+z}. Let CC be the set of the values r(v)r(v) of all vertices vv of (P)\mathcal{H}(P) for all canonical subsets PP of T+T^{+}. Note that |C|=O(nlogn)|C|=O(n\log n). We find the smallest value r(v)Cr(v)\in C such that rr(v)r^{*}\leq r(v), and let r2r_{2} denote such r(v)r(v). The value r2r_{2} can be found in O(nlogn)O(n\log n) using our linear time decision algorithm and doing binary search on CC using the linear time selection algorithm [5]. Next, we find the largest value in CC that is smaller than r2r_{2}, and let r1r_{1} denote that value. By definition, r(r1,r2]r^{*}\in(r_{1},r_{2}] and (r1,r2)(r_{1},r_{2}) does not contain any element of CC.

Consider a canonical subset PP of T+T^{+} and any r(r1,r2)r\in(r_{1},r_{2}). We construct r(P)\mathcal{I}_{r}(P) for each canonical subset PP of T+T^{+} by intersecting the facets of (P)\mathcal{H}(P) with the paraboloid W(r)={(x,y,z):x2+y2+z=r2}W(r)=\{(x,y,z):x^{2}+y^{2}+z=r^{2}\} and projecting them vertically to the xyxy-plane. By the definitions of r1r_{1} and r2r_{2}, the paraboloid W(r)W(r) intersects the same set of edges of (P)\mathcal{H}(P) for all r(r1,r2)r\in(r_{1},r_{2}); this implies that r(P)\mathcal{I}_{r}(P) is combinatorially the same for all r(r1,r2)r\in(r_{1},r_{2}). Hence, we can consider αr(P)\alpha_{r}(P), which is the dual of r(P)\mathcal{I}_{r}(P), as a parameterized circular hull of PP. We store the (parameterized) vertices of αr(P)\alpha_{r}(P) in a balanced binary search tree. Since (P)\mathcal{H}(P) is convex, we can obtain r(P)\mathcal{I}_{r}(P) and thus the balanced binary search tree for αr(P)\alpha_{r}(P) in O(|P|)O(|P|) time; we associate the tree at the node of T+T^{+} for PP. Because the total size of (P)\mathcal{H}(P) for all canonical subsets PP in T+T^{+} is O(nlogn)O(n\log n), we can obtain the balanced binary search trees for αr(P)\alpha_{r}(P) of all canonical subsets PP in T+T^{+} in O(nlogn)O(n\log n) time.

We do the same for TT^{-} as above. The processing on TT^{-} will obtain two values r1r_{1}^{\prime} and r2r_{2}^{\prime} correspondingly as the above r1r_{1} and r2r_{2}. We update r1=max{r1,r1}r_{1}=\max\{r_{1},r_{1}^{\prime}\} and r2=min{r2,r2}r_{2}=\min\{r_{2},r_{2}^{\prime}\}; so r(r1,r2]r^{*}\in(r_{1},r_{2}] still holds. This finishes our processing on SS, which takes O(nlogn)O(n\log n) time and is independent of rr.

Queries.

Given any r(r1,r2)r\in(r_{1},r_{2}) and any pair (i,j)(i,j) with i<ji<j, we determine whether αr(S+[i,j])\alpha_{r}(S^{+}[i,j]) exists, and if yes, return the root of a balanced binary search tree representing it, as follows (the case for S[i,j]S^{-}[i,j] is similar). Let k=ji+1k=j-i+1 and let P=S+[i,j]P=S^{+}[i,j].

By the standard method, we first find O(logk)O(\log k) canonical subsets of T+T^{+} whose union is exactly S+[i,j]S^{+}[i,j]. Our following computation procedure can be described as a complete binary tree TT where the leaves corresponding to the above O(logk)O(\log k) canonical subsets. So TT has O(logk)O(\log k) leaves, and its height is O(loglogk)O(\log\log k). For each leave of TT, its circular hull is already available due to the preprocessing. For each internal node vv that is the parent of two leaves, we compute the circular hull of the union of the two subsets P1P_{1} and P2P_{2} of the two leaves. As the points of S+S^{+} are ordered radially by oo, the two subsets are separated by a line through oo. Hence, we can find the common tangents (if exist) using Lemma 1 in O(logk)O(\log k) time because the size of each subset is no more than kk. Recall that the circular hull of each canonical subset is represented by a balanced binary search tree. After having the common tangents, we split and merge the two balanced binary search trees to obtain a balanced binary search tree for αr(P1P2)\alpha_{r}(P_{1}\cup P_{2}). In addition, we keep unaltered the two original trees for αr(P1)\alpha_{r}(P_{1}) and αr(P2)\alpha_{r}(P_{2}) respectively, and this can be done by using persistent data structures (e.g., using the copy-path technique [12, 26]) in O(logk)O(\log k) time. In this way, the original trees for αr(P1)\alpha_{r}(P_{1}) and αr(P2)\alpha_{r}(P_{2}) can be used in parallel for other computations. If the algorithm detects that αr(P1P2)\alpha_{r}(P_{1}\cup P_{2}) does not exist, then we simply halt the algorithm and report that αr(S+[i,j])\alpha_{r}(S^{+}[i,j]) does not exist. Also, if the algorithm finds that a dominating case happens, e.g., the P1P_{1}-dominating case, then αr(P1P2)=αr(P1)\alpha_{r}(P_{1}\cup P_{2})=\alpha_{r}(P_{1}) and thus we simply return the root of the tree for αr(P1)\alpha_{r}(P_{1}).

We do this for all internal nodes in the second level of TT (i.e., the level above the leaves) in parallel by assigning a processor for each node. In this way, as TT has O(logk)O(\log k) leaves, we can compute the circular hulls for the second level in O(logk)O(\log k) parallel steps using O(logk)O(\log k) processors. Then, we proceed on the third level in the same way. At the root of TT, we will have the root of a balanced binary search tree for αr(P)\alpha_{r}(P). Using O(logk)O(\log k) processors, this takes O(logkloglogk)O(\log k\log\log k) parallel steps because each level needs O(logk)O(\log k) parallel steps and the height of TT is O(loglogk)O(\log\log k).

Alternatively, if we only use one processor, then since TT has O(logk)O(\log k) nodes and we spend O(logk)O(\log k) time on each node, the total time is O(log2k)O(\log^{2}k). ∎

Armed with Lemma 2, to determine whether rrr^{*}\leq r, we use the algorithm framework in Theorem 4.2 of Chan [6], but we provide a more efficient implementation, as follows.

Recall the definitions of the matrices AA and BB in Section 2, and in particular, each row of AA (resp., BB) is monotonically increasing while each column of AA (resp., BB) is monotonically decreasing. For convenience, let A[i,1]=0A[i,-1]=0 and A[i,n+1]=B[i,1]=A[i,n+1]=B[i,-1]=\infty for all 0in0\leq i\leq n. Let m=n/log6nm=\lfloor n/\log^{6}n\rfloor. Let jt=tn/mj_{t}=t\cdot\lfloor n/m\rfloor for t=1,2,,m1t=1,2,\ldots,m-1. Set j0=1j_{0}=-1 and jm=nj_{m}=n. For each t[0,m]t\in[0,m], find the largest it[0,n]i_{t}\in[0,n] with A[it,jt]B[it,jt]A[i_{t},j_{t}]\geq B[i_{t},j_{t}] (set it=1i_{t}=-1 if no such index exists; note that i0=1i_{0}=-1). Observe that i0i1imi_{0}\leq i_{1}\leq\cdots\leq i_{m}. Each iti_{t} can be found in O(log7n)O(\log^{7}n) time by binary search using Lemma 3. Hence, computing all iti_{t}’s takes O(nlogn)O(n\log n) time. This is part of our preprocessing, independent of rr.

Lemma 3

[6, 16] After O(nlogn)O(n\log n) time preprocessing, A[i,j]A[i,j] and B[i,j]B[i,j] can be computed in O(log6n)O(\log^{6}n) time for any given pair (i,j)(i,j).

Given r>0r>0, our goal is to decide whether rrr^{*}\leq r. Let (r1,r2](r_{1},r_{2}] be the interval obtained by the preprocessing of Lemma 2. Since r(r1,r2]r^{*}\in(r_{1},r_{2}], if rr1r\leq r_{1}, then r>rr^{*}>r; if rr2r\geq r_{2}, then rrr^{*}\leq r. It remains to resolve the case r(r1,r2)r\in(r_{1},r_{2}), as follows. In this case the result of Lemma 2 applies.

We will decide whether rirr_{i}^{*}\leq r for all i=0,1,,ni=0,1,\ldots,n (recall that rrr^{*}\leq r iff some rirr_{i}^{*}\leq r), as follows. Let t[0,m1]t\in[0,m-1] such that it<iit+1i_{t}<i\leq i_{t+1}. If A[i,jt]>rA[i,j_{t}]>r, then return ri>rr_{i}^{*}>r. Otherwise, find (by binary search) the largest j[jt,jt+1]j\in[j_{t},j_{t+1}] with A[i,j]rA[i,j]\leq r, and return rirr_{i}^{*}\leq r if and only if B[i,j]rB[i,j]\leq r. Algorithm 2 gives the pseudocode. See Theorem 4.2 of [6] for the algorithm correctness.

1 Let t[0,m1]t\in[0,m-1] such that it<iit+1i_{t}<i\leq i_{t+1};
2 if A[i,jt]>rA[i,j_{t}]>r then  return ri>rr_{i}^{*}>r ;
3 find the largest j[jt,jt+1]j\in[j_{t},j_{t+1}] with A[i,j]rA[i,j]\leq r;
4 return rirr_{i}^{*}\leq r iff B[i,j]rB[i,j]\leq r;
Algorithm 2 The decision algorithm of Theorem 4.2 by Chan [6]

Chan [6] implemented the algorithm in O(lognlog2logn)O(\log n\log^{2}\log n) parallel steps using O(nlogn)O(n\log n) processors. In what follows, with the help of Lemma 2, we provide a more efficient implementation of O(lognloglogn)O(\log n\log\log n) parallel steps using O(n)O(n) processors. Line 1 can be done in O(n)O(n) time as part of the preprocessing, independent of rr. We first discuss how to implement Line 3 for all indices ii, and we will show later that Lines 2 and 4 can be implemented in a similar (and faster) way.

For each t=0,1,,m1t=0,1,\ldots,m-1, if it+1itlog6ni_{t+1}-i_{t}\leq\log^{6}n, then we form a group of at most log6n\log^{6}n indices: it+1,it+2,,it+1i_{t}+1,i_{t}+2,\ldots,i_{t+1}. Otherwise, starting from it+1i_{t}+1, we form a group for every consecutive log6n\log^{6}n indices until it+1i_{t+1}, so every group has exactly log6n\log^{6}n indices except that the last group may have less than log6n\log^{6}n indices. In this way, we have at most 2m2m groups, each of which consists of at most log6n\log^{6}n consecutive indices in (it,it+1](i_{t},i_{t+1}] for some t[0,m1]t\in[0,m-1].

Consider a group G={a,a+1,,a+b}G=\{a,a+1,\ldots,a+b\} of indices in (it,it+1](i_{t},i_{t+1}]. Note that b<log6nb<\log^{6}n. For each i[a,a+b]i\in[a,a+b] such that A[i,jt]rA[i,j_{t}]\leq r, we need to perform binary search on [jt,jt+1][j_{t},j_{t+1}] to find the largest index jj with A[i,j]rA[i,j]\leq r. To this end, we do the following. We compute the two circular hulls α(S+[a+b,n])\alpha(S^{+}[a+b,n]) and α(S[1,jt])\alpha(S^{-}[1,j_{t}]), in O(lognloglogn)O(\log n\log\log n) parallel steps using O(logn)O(\log n) processors by Lemma 2. Note that by “compute the two circular hulls”, we mean that the two circular hulls are computed implicitly in the sense that each of them is represented by a balanced binary search tree and we have the access of its root. If α(S+[a+b,n])\alpha(S^{+}[a+b,n]) (resp., α(S[1,jt])\alpha(S^{-}[1,j_{t}])) does not exist, then we set it to nullnull. We do this for all 2m2m groups in parallel, which takes O(lognloglogn)O(\log n\log\log n) parallel steps using O(mlogn)O(n)O(m\log n)\in O(n) processors.

Consider the group GG defined above again. For each i[a,a+b]i\in[a,a+b], we need to do binary search on [jt,jt+1][j_{t},j_{t+1}] for O(log(jt+1jt))=O(loglogn)O(\log(j_{t+1}-j_{t}))=O(\log\log n) iterations. In each iteration, the goal is to determine whether A[i,j]rA[i,j]\leq r for an index j[jt,jt+1]j\in[j_{t},j_{t+1}]. To this end, it suffices to determine whether α(Uij)\alpha(U_{ij}) exists. Notice that Uij=S+[i+1,a+b1]S+[a+b,n]S[1,jt]S[jt+1,j]U_{ij}=S^{+}[i+1,a+b-1]\cup S^{+}[a+b,n]\cup S^{-}[1,j_{t}]\cup S^{-}[j_{t}+1,j]. α(S+[a+b,n])\alpha(S^{+}[a+b,n]) and α(S[1,jt])\alpha(S^{-}[1,j_{t}]) are already computed above. If one of them does not exist, then α(Uij)\alpha(U_{ij}) does not exist and thus A[i,j]>rA[i,j]>r. Otherwise, we compute the circular hull α(S+[i+1,a+b1])\alpha(S^{+}[i+1,a+b-1]), which can be done in O(log2logn)O(\log^{2}\log n) time using one processor by Lemma 2 because a+b1ib1log6na+b-1-i\leq b-1\leq\log^{6}n. We also compute α(S[jt+1,j])\alpha(S^{-}[j_{t}+1,j]) in O(log2logn)O(\log^{2}\log n) time using one processor. Then, we compute the common tangents of α(S+[i+1,a+b1])\alpha(S^{+}[i+1,a+b-1]) and α(S+[a+b,n])\alpha(S^{+}[a+b,n]) by Lemma 1 (note that S+[i+1,a+b1]S^{+}[i+1,a+b-1] and S+[a+b,n]S^{+}[a+b,n] are separated by a line through oo), in O(logn)O(\log n) time using one processor. Then, we merge the two hulls with the two common tangents to obtain a balanced binary search tree for α(S+[i+1,n])\alpha(S^{+}[i+1,n]). Because we want to keep the tree for α(S+[a+b,n])\alpha(S^{+}[a+b,n]) unaltered so that it can participate in other computations in parallel, we use a persistent tree to represent it. Similarly, we obtain a tree for α(S[1,j])\alpha(S^{-}[1,j]), in O(logn)O(\log n) time using one processor. If one of α(S+[i+1,n])\alpha(S^{+}[i+1,n]) and α(S[1,j])\alpha(S^{-}[1,j]) does not exist, then we return A[i,j]>rA[i,j]>r. Note that S+[a+b,n]S^{+}[a+b,n] and S[1,j]S^{-}[1,j] are separated by \ell and Uij=S+[a+b,n]S[1,j]U_{ij}=S^{+}[a+b,n]\cup S^{-}[1,j]. By applying Lemma 1, we can determine whether α(Uij)\alpha(U_{ij}) exists in O(logn)O(\log n) time using one processor and consequently determine whether A[i,j]rA[i,j]\leq r. Therefore, the above algorithm determines whether A[i,j]rA[i,j]\leq r in O(logn)O(\log n) time using one processor.

If we do the above for all ii’s in parallel, then we can determine whether A[i,j]rA[i,j]\leq r in O(logn)O(\log n) time using n+1n+1 processors, for each iteration of the binary search. As there are O(loglogn)O(\log\log n) iterations, the binary search procedure (i.e., Line 3) for all i=0,1,,ni=0,1,\ldots,n runs in O(lognloglogn)O(\log n\log\log n) parallel steps using n+1n+1 processors.

For implementing Line 2, we can use the same approach as above by grouping the indices ii into 2m2m groups. The difference is that now each ii has a specific index jj, i.e., j=jtj=j_{t}, for deciding whether A[i,j]rA[i,j]\leq r, and thus we do not have to do binary search. Hence, using n+1n+1 processors, we can implement Line 2 for all i=0,1,,ni=0,1,\ldots,n in O(logn)O(\log n) parallel steps. We can do the same for Line 4.

As a summary, we have the following theorem.

Theorem 4.1

After O(nlogn)O(n\log n) time preprocessing on SS, given any rr, we can decide whether rrr^{*}\leq r in O(lognloglogn)O(\log n\log\log n) parallel steps using O(n)O(n) processors.

With the serial decision algorithm in Theorem 3.1 and applying Cole’s parametric search [10] on the parallel decision algorithm in Theorem 4.1, the following result follows.

Theorem 4.2

The value rr^{*} can be computed in O(nlognloglogn)O(n\log n\log\log n) time.

Proof

Suppose there is a serial decision algorithm of time TST_{S} and another parallel decision algorithm that runs in TpT_{p} parallel steps using PP processors. Then, Megiddo’s parametric search [22] can compute rr^{*} in O(PTp+TsTplogP)O(PT_{p}+T_{s}T_{p}\log P) time by simulating the parallel decision algorithm on rr^{*} and using the serial decision algorithm to resolve comparisons with rr^{*}. If the parallel decision algorithm has a “bounded fan-in or bounded fan-out” property, then Cole’s technique [10] can reduce the time complexity to O(PTp+Ts(Tp+logP))O(PT_{p}+T_{s}(T_{p}+\log P)). Like Chan’s algorithm [6], our algorithm has this property because it mainly consists of O(loglogn)O(\log\log n) rounds of independent binary search (i.e., the algorithm of Lemma 1). In our case, Ts=O(n)T_{s}=O(n), Tp=O(lognloglogn)T_{p}=O(\log n\log\log n), and P=O(n)P=O(n). Thus, applying Cole’s technique, rr^{*} can be computed in O(nlognloglogn)O(n\log n\log\log n) time. ∎

Note that once rr^{*} is computed, we can apply the seriel decision algorithm to obtain in additional O(n)O(n) time a pair of congruent disks of radius rr^{*} covering SS.

Corollary 1

The planar two-center problem can be solved in O(nlog2n)O(n\log^{2}n) time.

Proof

This follows by combining Theorem 4.2, which is for the nearby case, with the O(nlog2n)O(n\log^{2}n) time algorithm for the distant case [16]. ∎

5 The Convex Position Case

In this section, we consider the case where SS is in convex position (i.e., every point of SS is a vertex of the convex hull of SS). We show that our above O(nlognloglogn)O(n\log n\log\log n) time algorithm can be applied to solving this case in the same time asymptotically.

We first compute the convex hull CH(S)\mbox{$C\!H$}(S) of SS and order all vertices clockwise as p1,p2,,pnp_{1},p_{2},\ldots,p_{n}. A key observation [21] is that there is an optimal solution with two congruent disks D1D_{1}^{*} and D2D_{2}^{*} of radius rr^{*} such that D1D_{1}^{*} covers the points of SS in a chain of CH(S)\partial\mbox{$C\!H$}(S) and D2D_{2}^{*} covers the rest of the points. In other words, the cyclic list of p1,p2,,pnp_{1},p_{2},\ldots,p_{n} can be cut into two lists such that one list is covered by D1D_{1}^{*} and the other list is covered by D2D_{2}^{*}.

Let oo be any point in the interior of CH(S)\mbox{$C\!H$}(S). By the above observation, there exists a pair of rays ρ1\rho_{1} and ρ2\rho_{2} emanating from oo such that D1D_{1}^{*} covers all points of SS on one side of the two rays and D2D_{2}^{*} covers the points of SS in the other side. In order to apply our previous algorithm, we need to find a line \ell that separates the two rays. For this, we propose the following approach.

For any i,j[1,n]i,j\in[1,n], let Scw[i,j]S_{cw}[i,j] denote the subset of vertices on CH(S)\mbox{$C\!H$}(S) clockwise from pip_{i} to pjp_{j}, and Scw[i,j]={pi}S_{cw}[i,j]=\{p_{i}\} if i=ji=j. Due to the above key observation, r=mini,j[1,n]max{τ(Scw[i,j]),τ(Scw[j+1,i1])}r^{*}=\min_{i,j\in[1,n]}\max\{\tau(S_{cw}[i,j]),\tau(S_{cw}[j+1,i-1])\}, with indices modulo nn. For each i[1,n]i\in[1,n], define r(i)=minh[i,i+n1]max{τ(Scw[i,h]),τ(Scw[h+1,i1])}r(i)=\min_{h\in[i,i+n-1]}\max\{\tau(S_{cw}[i,h]),\tau(S_{cw}[h+1,i-1])\}. Notice that as hh increases in [1,n1][1,n-1], τ(Scw[1,h])\tau(S_{cw}[1,h]) is monotonically increasing while τ(Scw[h+1,n])\tau(S_{cw}[h+1,n]) is monotonically decreasing. Define kk to be the largest index in [1,n1][1,n-1] such that τ(Scw[1,k])τ(Scw[k+1,n])\tau(S_{cw}[1,k])\leq\tau(S_{cw}[k+1,n]). We have the following lemma.

Lemma 4

rr^{*} is equal to the minimum of the following four values: r(1)r(1), r(k+1)r(k+1), r(k+2)r(k+2), and max{τ(Scw[i,j]),τ(Scw[j+1,i1])\max\{\tau(S_{cw}[i,j]),\tau(S_{cw}[j+1,i-1]) for all indices ii and jj with i[1,k]i\in[1,k] and j[k+2,n]j\in[k+2,n].

Proof

Observe that r=mini,j[1,n]max{τ(Scw[i,j]),τ(Scw[j+1,i1])}=min1hnr(h)r^{*}=\min_{i,j\in[1,n]}\max\{\tau(S_{cw}[i,j]),\tau(S_{cw}[j+1,i-1])\}=\min_{1\leq h\leq n}r(h). Hence, rr^{*} is no larger than any of the values specified in the lemma statement.

Let ii and jj be two indices such that r=max{τ(Scw[i,j]),τ(Scw[j+1,i1])}r^{*}=\max\{\tau(S_{cw}[i,j]),\tau(S_{cw}[j+1,i-1])\} with 1ijn1\leq i\leq j\leq n. We claim that r=r(i)r^{*}=r(i). Indeed, since r=min1hnr(h)r^{*}=\min_{1\leq h\leq n}r(h), we have rr(i)r^{*}\leq r(i). On the other hand, as r(i)max{τ(Scw[i,j]),τ(Scw[j+1,i1])}=rr(i)\leq\max\{\tau(S_{cw}[i,j]),\tau(S_{cw}[j+1,i-1])\}=r^{*}, we obtain r(i)=rr(i)=r^{*}. By a similar argument, r=r(j+1)r^{*}=r(j+1) also holds.

Without loss of generality, we assume that r=τ(Scw[i,j])τ(Scw[j+1,i1])r^{*}=\tau(S_{cw}[i,j])\geq\tau(S_{cw}[j+1,i-1]).

If i[1,k]i\in[1,k] and j[k+2,n]j\in[k+2,n], then the lemma follows. Otherwise, one of the following four cases must hold: i=k+1i=k+1, j=k+1j=k+1, [i,j][1,k][i,j]\subseteq[1,k], and [i,j][k+2,n][i,j]\subseteq[k+2,n]. If i=k+1i=k+1, then r=r(k+1)r^{*}=r(k+1). If j=k+1j=k+1, then r=r(k+2)r^{*}=r(k+2). Below we show that r=r(1)r^{*}=r(1) if [i,j][1,k][i,j]\subseteq[1,k] and we also show that the case [i,j][k+2,n][i,j]\subseteq[k+2,n] cannot happen, which will prove the lemma.

If [i,j][1,k][i,j]\subseteq[1,k], then τ(Scw[j+1,i1])τ(Scw[k+1,n])\tau(S_{cw}[j+1,i-1])\geq\tau(S_{cw}[k+1,n]), for Scw[k+1,n]Scw[j+1,i1]S_{cw}[k+1,n]\subseteq S_{cw}[j+1,i-1]. By the definition of kk, we have τ(Scw[k+1,n])τ(Scw[1,k])\tau(S_{cw}[k+1,n])\geq\tau(S_{cw}[1,k]). Because [i,j][1,k][i,j]\subseteq[1,k], τ(Scw[1,k])τ(Scw[i,j])\tau(S_{cw}[1,k])\geq\tau(S_{cw}[i,j]). Combining the above three inequalities leads to the following: τ(Scw[j+1,i1])τ(Scw[k+1,n])τ(Scw[1,k])τ(Scw[i,j])\tau(S_{cw}[j+1,i-1])\geq\tau(S_{cw}[k+1,n])\geq\tau(S_{cw}[1,k])\geq\tau(S_{cw}[i,j]). Because r=τ(Scw[i,j])τ(Scw[j+1,i1])r^{*}=\tau(S_{cw}[i,j])\geq\tau(S_{cw}[j+1,i-1]), we obtain r=τ(Scw[j+1,i1])=τ(Scw[k+1,n])=τ(Scw[1,k])=τ(Scw[i,j])r^{*}=\tau(S_{cw}[j+1,i-1])=\tau(S_{cw}[k+1,n])=\tau(S_{cw}[1,k])=\tau(S_{cw}[i,j]). Notice that r(1)max{τ(Scw[1,k]),τ(Scw[k+1,n])}r(1)\leq\max\{\tau(S_{cw}[1,k]),\tau(S_{cw}[k+1,n])\}. Thus, we derive r(1)rr(1)\leq r^{*}. Since rr(1)r^{*}\leq r(1), we finally have r=r(1)r^{*}=r(1).

If [i,j][k+2,n][i,j]\subseteq[k+2,n], then τ(Scw[j+1,i1])τ(Scw[1,k+1])\tau(S_{cw}[j+1,i-1])\geq\tau(S_{cw}[1,k+1]). By the definition of kk, we have τ(Scw[1,k+1])>τ(Scw[k+2,n])\tau(S_{cw}[1,k+1])>\tau(S_{cw}[k+2,n]). Also, since [i,j][k+2,n][i,j]\subseteq[k+2,n], τ(Scw[k+2,n])τ(Scw[i,j])\tau(S_{cw}[k+2,n])\geq\tau(S_{cw}[i,j]) holds. Therefore, we obtain τ(Scw[j+1,i1])τ(Scw[1,k+1])>τ(Scw[k+2,n])τ(Scw[i,j])\tau(S_{cw}[j+1,i-1])\geq\tau(S_{cw}[1,k+1])>\tau(S_{cw}[k+2,n])\geq\tau(S_{cw}[i,j]), which incurs contradiction since r=τ(Scw[i,j])τ(Scw[j+1,i1])r^{*}=\tau(S_{cw}[i,j])\geq\tau(S_{cw}[j+1,i-1]). Thus, the case [i,j][k+2,n][i,j]\subseteq[k+2,n] cannot happen. ∎

Based on the above lemma, our algorithm works as follows.

We first compute r(1)r(1) and the index kk. This can be easily done in O(nlogn)O(n\log n) time. Indeed, as hh increases in [1,n1][1,n-1], τ(Scw[1,h])\tau(S_{cw}[1,h]) is monotonically increasing while τ(Scw[h+1,n])\tau(S_{cw}[h+1,n]) is monotonically decreasing. Therefore, r1r^{*}_{1} and kk can be found by binary search on [1,n1][1,n-1]. As both τ(Scw[1,h])\tau(S_{cw}[1,h]) and τ(Scw[h+1,n])\tau(S_{cw}[h+1,n]) can be computed in O(n)O(n) time, the binary search takes O(nlogn)O(n\log n) time. For the same reason, we can compute r(k+1)r(k+1) and r(k+2)r(k+2) in O(nlogn)O(n\log n) time.

If r{r(1),r(k+1),r(k+2)}r^{*}\not\in\{r(1),r(k+1),r(k+2)\}, then r=max{τ(Scw[i,j]),τ(Scw[j+1,i1])r^{*}=\max\{\tau(S_{cw}[i,j]),\tau(S_{cw}[j+1,i-1]) for two indices ii and jj with i[1,k]i\in[1,k] and j[k+2,n]j\in[k+2,n]. We can compute it as follows. Let \ell be a line through vk+1v_{k+1} and intersecting the interior of pnp1¯\overline{p_{n}p_{1}}. Let oo be any point on \ell in the interior of CH(S)\mbox{$C\!H$}(S). Lemma 4 implies \ell and oo satisfy the property discussed above, i.e., \ell separates the two rays ρ1\rho_{1} and ρ2\rho_{2}. Consequently, we can apply our algorithm for Theorem 4.2 to compute rr^{*} in O(nlognloglogn)O(n\log n\log\log n) time.

Theorem 5.1

The planar two-center problem for a set of nn points in convex position can be solved in O(nlognloglogn)O(n\log n\log\log n) time.

Remark.

The randomized result remarked after Theorem 3.1 also applies to the convex position case, i.e., after O(nlogn)O(n\log n) deterministic time preprocessing, we can compute rr^{*} in O(n)O(n) time with high probability (i.e., 12Ω(n/log14n)1-2^{-\Omega(n/\log^{14}n)}).

6 The Dynamic Circular Hull Problem

In this section, we give an O(n)O(n) time algorithm for the dynamic circular hull problem needed in our decision algorithm in Section 3.

Recall that the points of SS are ordered around oo cyclically. To simplify the exposition, we first work on a slightly different problem setting in which points are sorted by their xx-coordinates; we will show later that the algorithm can be easily adapted to the original problem setting.

Specifically, let L={p1,p2,,pn}L=\{p_{1},p_{2},\ldots,p_{n}\} be a set of nn points sorted from left to right and R={q1,q2,,qn}R=\{q_{1},q_{2},\ldots,q_{n}\} be a set of nn points sorted from left to right, such that all points of LL are strictly to the left of a vertical line \ell and all points of RR are strictly to the right of \ell. The problem is to maintain a sublist QQ of the sorted list of LRL\cup R, with Q=LQ=L initially, to determine whether αr(Q)\alpha_{r}(Q) exists under deletions and insertions, such that a deletion operation deletes the leftmost point of QQ and an insertion operation inserts the point of RR after the rightmost point of QQ. Further, deletion operations only happen to points of LL. In the following, we build a data structure in O(n)O(n) time that can handle each update in O(1)O(1) amortized time (i.e., after each update, we know whether αr(Q)\alpha_{r}(Q) exists). We make a general position assumption that no two points of LRL\cup R have the same xx-coordinate.

Since initially Q=LQ=L, we need to compute αr(Q)\alpha_{r}(Q). Hershberger and Suri [18] gave an O(nlogn)O(n\log n) time algorithm using divide-and-conquer. The algorithm of Edelsbrunner et al. [14] can also compute αr(Q)\alpha_{r}(Q) in O(nlogn)O(n\log n) time by first computing the farthest Delaunay triangulation of QQ. Both algorithms still take Θ(nlogn)\Theta(n\log n) time even if points of QQ are sorted (indeed, the algorithm of [18] spends O(n)O(n) time for each combine/merge step and the algorithm of [14] needs to compute the farthest Delaunay triangulation first). We instead exhibit an O(n)O(n) time incremental algorithm, which can be considered an extension of Graham’s scan for convex hulls, although the extension is not straightforward at all. Before we are able to describe the algorithm, we need to discuss some properties of the circular hulls.

The remainder of this section is organized as follows. In Section 6.1, we show some properties of circular hulls that will be useful for our algorithm. In Section 6.2, we present our linear-time algorithm for constructing the circular hull for a set of sorted points. In Section 6.3, we elaborate on our data structure for maintaining αr(Q)\alpha_{r}(Q) for a dynamic set QQ. Section 6.4 sets up the data structure initially when Q=LQ=L (e.g., invokes the algorithm given in Section 6.2). Our algorithms for processing deletions and insertions will be described in Sections 6.5 and 6.6, respectively. Finally in Section 6.7 we adapt the algorithm to our original problem setting where points are sorted radially around the origin oo.

6.1 Observations and Properties of Circular Hulls

From now on, we assume r=1r=1 and thus a disk of radius rr is a unit disk (whose boundary is a unit circle). We use α(Q)\alpha(Q) to refer to αr(Q)\alpha_{r}(Q). We assume that QQ is a subset of LRL\cup R and α(Q)\alpha(Q) exists.

Recall that every arc of α(Q)\alpha(Q) is a minor arc. In the following, unless otherwise stated, an arc refers to a minor arc and a disk refers to a unit disk. For ease of exposition, we make a general position assumption that no point of LRL\cup R is on a minor arc of two other points of LRL\cup R.

We define the upper hull of α(Q)\alpha(Q) as the boundary of α(Q)\alpha(Q) from the leftmost vertex to the rightmost vertex. The remaining arcs of α(Q)\alpha(Q) comprise the lower hull. Unlike convex hulls, the upper hull (resp., the lower hull) of α(Q)\alpha(Q) may not be xx-monotone due to that the leftmost/rightmost arc may not be xx-monotone. If the rightmost point pp of α(Q)\alpha(Q) is in the interior of an arc, then we refer to the arc as the rightmost arc of α(Q)\alpha(Q); otherwise, the rightmost arc is nullnull (and its supporting disk is defined to be \emptyset). We define the leftmost arc of α(Q)\alpha(Q) likewise.

Refer to caption
Figure 7: Illustrating D1(cw(p,q))D_{1}(cw(p,q)).
Refer to caption
Figure 8: Illustrating α({p,q})\alpha(\{p,q\}).

For a minor arc ww, recall that D(w)D(w) is the supporting disk of ww. We further use D1(w)D_{1}(w) to denote the region of D(w)D(w) bounded by ww and the chord of D(w)D(w) connecting the two endpoints of ww (e.g., see Fig. 8). Observe that α({p,q})=D1(cw(p,q))D1(ccw(p,q))=D(cw(p,q))D(ccw(p,q))\alpha(\{p,q\})=D_{1}(cw(p,q))\cup D_{1}(ccw(p,q))=D(cw(p,q))\cap D(ccw(p,q)); e.g., see Fig. 8. For notational simplicity, we use α(p,q)\alpha(p,q) to refer to α({p,q})\alpha(\{p,q\}). The following observation, which is due to the convexity of the circular hull, was already shown in [18].

Observation 4

[18] Suppose pp is a point to the right (resp., left) of all points of QQ and α({p}Q)\alpha(\{p\}\cup Q) exists. Then, pp is not a vertex of α({p}Q)\alpha(\{p\}\cup Q) if and only if pp is in D1(w)D_{1}(w), where ww is the rightmost (reps., leftmost) arc of α(Q)\alpha(Q). We say that pp is redundant (with respect to α(Q)\alpha(Q)) if pD1(w)p\in D_{1}(w).

Recall that in Graham’s scan for computing convex hulls, the algorithm uses “left turn” and “right turn”. Here instead we find it more informative to use inner turn and outer turn, defined as follows. Note that these concepts are new. Suppose two points pp and qq are unit disk coverable. Consider the minor arc cw(p,q)cw(p,q), and a point tt. We say that cw(p,q)cw(p,q) and tt form an inner turn if tD(cw(p,q))t\in D(cw(p,q)) and outer turn otherwise. The following observation will help prove the correctness of our algorithm.

Refer to caption
Figure 9: Illustrating Observation 5(1). The dotted circle depicts D(cw(q,t))D(cw(q,t)).
Refer to caption
Figure 10: Illustrating Observation 5(2). The dotted circle depicts D(cw(p,t))D(cw(p,t)).
Observation 5

Consider a minor arc cw(p,q)cw(p,q) and a point tt.

  1. 1.

    Suppose cw(p,q)cw(p,q) and tt form an inner turn. If tt is not in the interior of α(p,q)\alpha(p,q), then pp is contained in the disk D(cw(q,t))D(cw(q,t)); e.g., see Fig. 10.

  2. 2.

    Suppose cw(p,q)cw(p,q) and tt form an outer turn. If {p,q,t}\{p,q,t\} is unit disk coverable and pp is not in the interior of α(q,t)\alpha(q,t), then qq is contained in the disk D(cw(p,t))D(cw(p,t)); e.g., see Fig. 10.

Proof

For the first statement, since cw(p,q)cw(p,q) and tt form an inner turn, tD(cw(p,q))t\in D(cw(p,q)). As tt is not in the interior of α(p,q)\alpha(p,q), one can verify from Fig. 10 that D(cw(q,t))D(cw(q,t)) must contain pp.

We next prove the second statement. Because {p,q,t}\{p,q,t\} is unit disk coverable, α({p,q,t})\alpha(\{p,q,t\}) exists. As pp is not in the interior of α(q,t)\alpha(q,t), pp must be a vertex of α({p,q,t})\alpha(\{p,q,t\}). Let aa be the clockwise neighbor of pp on α({p,q,t})\alpha(\{p,q,t\}). Hence, cw(p,a)cw(p,a) is an arc of α({p,q,t})\alpha(\{p,q,t\}) and aa is either qq or tt. Also, D(cw(p,a))D(cw(p,a)) covers {p,q,t}\{p,q,t\} by Observation 1(2). If a=qa=q, then D(cw(p,q))D(cw(p,q)) contains tt, which contradicts with that cw(p,q)cw(p,q) and tt form an outer turn. Thus, a=ta=t, and D(cw(p,t))D(cw(p,t)) contains qq. ∎

For any two vertices v1v_{1} and v2v_{2} on α(Q)\alpha(Q), we use α(Q)[v1,v2]\partial{\alpha(Q)}[v_{1},v_{2}] to denote the set of vertices of α(Q)\alpha(Q) clockwise from v1v_{1} to v2v_{2}. In particular, if v1=v2v_{1}=v_{2}, then we let α(Q)[v1,v2]\partial_{\alpha(Q)}[v_{1},v_{2}] consist of all vertices of α(Q)\alpha(Q). Define α(Q)(v1,v2)=α(Q)[v1,v2]{v1,v2}\partial_{\alpha(Q)}(v_{1},v_{2})=\partial_{\alpha(Q)}[v_{1},v_{2}]\setminus\{v_{1},v_{2}\}. We use α(Q)[v1,v2]¯\overline{\partial_{\alpha(Q)}[v_{1},v_{2}]} to refer to the subset of vertices of α(Q)\alpha(Q) not in α(Q)[v1,v2]\partial_{\alpha(Q)}[v_{1},v_{2}], and define α(Q)(v1,v2)¯\overline{\partial_{\alpha(Q)}(v_{1},v_{2})} similarly.

Let pp be a point outside α(Q)\alpha(Q), and cw(a,p)cw(a,p) and ccw(b,p)ccw(b,p) are the upper and lower tangents from pp to α(Q)\alpha(Q), respectively; e.g., see Fig 6. Recall that by replacing the arcs of α(Q)\alpha(Q) clockwise from aa to bb with the two tangents, we can obtain α(Q{p})\alpha(Q\cup\{p\}). Hence, α(Q)(a,b)\partial_{\alpha(Q)}(a,b) consists of exactly those vertices of α(Q)\alpha(Q) that are not vertices of α(Q{p})\alpha(Q\cup\{p\}). We further have the following observation.

Observation 6

Suppose cw(a,p)cw(a,p) and ccw(b,p)ccw(b,p) are the upper and lower tangents from a point pp to α(Q)\alpha(Q), respectively; e.g., see Fig. 6.

  1. 1.

    For any vertex cc in α(Q)(a,b)\partial_{\alpha(Q)}(a,b), there is no disk with cc on the boundary that contains Q{p}Q\cup\{p\}.

  2. 2.

    For any vertex cc in α(Q)[a,b]¯\overline{\partial_{\alpha(Q)}[a,b]}, any disk tangent to α(Q)\alpha(Q) at cc covers Q{p}Q\cup\{p\}.

  3. 3.

    If pp is strictly to the right of all points of QQ, then the rightmost vertex of α(Q)\alpha(Q) must be in α(Q)[a,b]\partial_{\alpha(Q)}[a,b].

  4. 4.

    If there is a line ll through a vertex vv of α(Q)\alpha(Q) such that all vertices of QQ are on the same side of ll while pp is on the other side, then vv must be in α(Q)[a,b]\partial_{\alpha(Q)}[a,b].

Proof

The first two statements can be easily seen by knowing that α(Q{p})\alpha(Q\cup\{p\}) can be obtained by replacing the arcs of α(Q)\alpha(Q) clockwise from aa to bb by the two tangents cw(a,p)cw(a,p) and ccw(b,p)ccw(b,p).

For the third statement, assume to the contrary that vα(Q)[a,b]v\not\in\partial_{\alpha(Q)}[a,b], where vv is the rightmost vertex of α(Q)\alpha(Q). Then, vα(Q)[a,b]¯v\in\overline{\partial_{\alpha(Q)}[a,b]}, and by the second statement, any disk tangent to α(Q)\alpha(Q) at vv covers Q{p}Q\cup\{p\}. Let v1=cw(v)v_{1}=cw(v) and v2=ccw(v)v_{2}=ccw(v). Since D(cw(v,v1))D(cw(v,v_{1})) and D(ccw(v,v2))D(ccw(v,v_{2})) are both tangent to α(Q)\alpha(Q) at vv, both disks cover Q{p}Q\cup\{p\}. Hence, Z=D(cw(v,v1))D(ccw(v,v2))Z=D(cw(v,v_{1}))\cap D(ccw(v,v_{2})) contains pp. Since D(cw(v,v1))D(cw(v,v_{1})) covers QQ, it contains v2v_{2}. Since D(ccw(v,v2))D(ccw(v,v_{2})) covers QQ, it contains v1v_{1}. Let lvl_{v} be the vertical line through vv. We claim that lvl_{v} must intersect one of cw(v,v1)cw(v,v_{1}) and ccw(v,v2)ccw(v,v_{2}) twice. Indeed, since lvl_{v} contains vv, it intersects each of the two arcs at least once. If lvl_{v} does not intersect either arc twice, then since D(cw(v,v1))D(cw(v,v_{1})) contains v2v_{2} and D(ccw(v,v2))D(ccw(v,v_{2})) contains v1v_{1}, and both v1v_{1} and v2v_{2} are to the left of vv, ZZ must be to the left of lvl_{v}. As pp is strictly to the right of lvl_{v}, pp cannot be in ZZ, incurring contradiction. Hence, lvl_{v} intersects one of cw(v,v1)cw(v,v_{1}) and ccw(v,v2)ccw(v,v_{2}) twice. Assume without loss of generality that lvl_{v} intersects cw(v,v1)cw(v,v_{1}) twice. This implies that the region of D(cw(v,v1))D(cw(v,v_{1})) to the right of lvl_{v} is a subset of D1(cw(v,v1))D_{1}(cw(v,v_{1})). Since pp is to the right of lvl_{v} and pp is in D(cw(v,v1))D(cw(v,v_{1})), pp must be in the region of D(cw(v,v1))D(cw(v,v_{1})) to the right of lvl_{v} and thus is in D1(cw(v,v1))D_{1}(cw(v,v_{1})). Because D1(cw(v,v1))α(Q)D_{1}(cw(v,v_{1}))\subseteq\alpha(Q), pp is in α(Q)\alpha(Q). But this means that there are no tangents from pp to α(Q)\alpha(Q), incurring contradiction.

The fourth statement can be proved in the same way as above by rotating the coordinate system so that ll is vertical and pp is on its right side. ∎

Let Q1Q_{1} be the subset of QQ to the left of the vertical line \ell and Q2=QQ1Q_{2}=Q\setminus Q_{1}. Let cw(a1,a2)cw(a_{1},a_{2}) and ccw(b1,b2)ccw(b_{1},b_{2}) be the upper and lower common tangents of α(Q1)\alpha(Q_{1}) and α(Q2)\alpha(Q_{2}), respectively, i.e., a1a_{1} and b1b_{1} are the tangent points on α(Q1)\alpha(Q_{1}) and a2a_{2} and b2b_{2} are the tangent points on α(Q2)\alpha(Q_{2}); e.g., see Fig. 6. Then, the following arcs constitute the boundary of α(Q)\alpha(Q) in clockwise order: arcs of α(Q1)\alpha(Q_{1}) clockwise from b1b_{1} to a1a_{1}, cw(a1,a2)cw(a_{1},a_{2}), arcs of α(Q2)\alpha(Q_{2}) clockwise from a2a_{2} to b2b_{2}, and cw(b2,b1)cw(b_{2},b_{1}). The following observation generalizes Observation 6.

Observation 7

Suppose cw(a1,a2)cw(a_{1},a_{2}) and ccw(b1,b2)ccw(b_{1},b_{2}) are the upper and lower common tangents of α(Q1)\alpha(Q_{1}) and α(Q2)\alpha(Q_{2}), respectively; e.g., see Fig. 6.

  1. 1.

    For any vertex cc in α(Q1)(a1,b1)α(Q2)(b2,a2)\partial_{\alpha(Q_{1})}(a_{1},b_{1})\cup\partial_{\alpha(Q_{2})}(b_{2},a_{2}), there is no disk with cc on the boundary that contains QQ.

  2. 2.

    For any vertex cc in α(Q1)[a1,b1]¯\overline{\partial_{\alpha(Q_{1})}[a_{1},b_{1}]}, any disk tangent to α(Q1)\alpha(Q_{1}) at cc contains QQ. For any vertex cc in α(Q2)[b2,a2]¯\overline{\partial_{\alpha(Q_{2})}[b_{2},a_{2}]}, any disk tangent to α(Q2)\alpha(Q_{2}) at cc contains QQ.

  3. 3.

    The rightmost vertex of α(Q1)\alpha(Q_{1}) must be in α(Q1)[a1,b1]\partial_{\alpha(Q_{1})}[a_{1},b_{1}]. The leftmost vertex of α(Q2)\alpha(Q_{2}) must be in α(Q2)[b2,a2]\partial_{\alpha(Q_{2})}[b_{2},a_{2}].

Proof

The first two statements simply follow from how we can obtain α(Q)\alpha(Q) from α(Q1)\alpha(Q_{1}) and α(Q2)\alpha(Q_{2}) using the two common tangents.

For the third statement, we only show the case for the rightmost vertex of α(Q1)\alpha(Q_{1}) and the other case can be treated likewise. The proof is similar to that for Observation 6 and we briefly discuss it. Let vv be the rightmost vertex of α(Q1)\alpha(Q_{1}). Assume to the contrary that vv is not in α(Q1)[a1,b1]\partial_{\alpha(Q_{1})}[a_{1},b_{1}]. Then, by the second statement, both D(cw(v,v1))D(cw(v,v_{1})) and D(ccw(v,v2))D(ccw(v,v_{2})) cover QQ, where v1=cw(v)v_{1}=cw(v) and v2=ccw(v)v_{2}=ccw(v). Hence, Z=D(cw(v,v1))D(ccw(v,v2))Z=D(cw(v,v_{1}))\cap D(ccw(v,v_{2})) covers QQ. Since Q1Q_{1} is to the left of \ell while Q2Q_{2} is to the right of \ell, by the same analysis as that for Observation 6 we can show that \ell must intersect one of cw(v,v1)cw(v,v_{1}) and ccw(v,v2)ccw(v,v_{2}) twice. Assume without loss of generality that ll intersects cw(v,v1)cw(v,v_{1}) twice. This implies D1(cw(v,v1))D_{1}(cw(v,v_{1})) contains all points of Q2Q_{2}. Since D1(cw(v,v1))α(Q1)D_{1}(cw(v,v_{1}))\subseteq\alpha(Q_{1}), we obtain that α(Q1)\alpha(Q_{1}) contains all points of Q2Q_{2}. But this means that there are no common tangents between α(Q1)\alpha(Q_{1}) and α(Q2)\alpha(Q_{2}), incurring contradiction. ∎

6.2 The Static Algorithm

In this subsection, we assume that Q=L={p1,p2,,pn}Q=L=\{p_{1},p_{2},\ldots,p_{n}\} and we provide an O(n)O(n) time algorithm for computing α(Q)\alpha(Q). The algorithm incrementally processes the points from p1p_{1} to pnp_{n}. Hence, one may either consider it as a static algorithm or a semi-dynamic algorithm for point insertions only. The algorithm will determine whether α(Q)\alpha(Q) exists, and if yes, compute and store the vertices of α(Q)\alpha(Q) in a circular doubly linked list.

The algorithm is similar in spirit to Graham’s scan for computing convex hulls. However, unlike the convex hull case, where it is possible to compute the upper and lower hulls separately, here we need to compute α(Q)\alpha(Q) as a whole because updating either the upper or the lower hull may end up with updating the other hull. Our algorithm relies on the following lemma.

Lemma 5

Suppose pp is a point outside the circular hull α(P)\alpha(P) of a point set PP. Then, {p}P\{p\}\cup P is unit disk coverable if and only if one of the following is true.

  1. 1.

    pp is in the supporting disk of an arc of α(P)\alpha(P).

  2. 2.

    α(P)\alpha(P) has a vertex vv such that α(P)\alpha(P) is contained in α(v,p)\alpha(v,p). Further, this is true if and only if both cw(v)cw(v) and ccw(v)ccw(v) are in α(v,p)\alpha(v,p).

Proof

The “if” direction is easy. If pp is in the supporting disk DD of an arc of α(P)\alpha(P), then since DD also covers PP, DD covers P{p}P\cup\{p\}. If α(P)\alpha(P) has a vertex vv such that α(P)\alpha(P) is contained in α(v,p)\alpha(v,p), then D(cw(v,p))D(cw(v,p)) contains α(v,p)\alpha(v,p) and thus contains α(P)\alpha(P). Hence, D(cw(v,p))D(cw(v,p)) covers P{p}P\cup\{p\}. In the following, we prove the “only if” direction.

Let DD be a disk that contains P{p}P\cup\{p\}. Clearly, it is possible to move DD such that DD covers P{p}P\cup\{p\} and D\partial D contains a point vv of PP. By Observation 1(1), vv is a vertex of α(P)\alpha(P). Now we rotate DD around vv clockwise (so that vv is always on D\partial D) and keep DD covering P{p}P\cup\{p\} until D\partial D meets another point zP{p}z\in P\cup\{p\}. If zPz\in P, then zz must be the clockwise neighbor of vv on α(P)\alpha(P) and now D=D(cw(v,z))D=D(cw(v,z)). Since pp is in DD, the first lemma statement holds. Below we assume that zPz\not\in P, i.e., z=pz=p.

Since z=pz=p, DD is D(cw(v,p))D(cw(v,p)), and thus D(cw(v,p))D(cw(v,p)) covers PP. By Observation 1(4), D(cw(v,p))D(cw(v,p)) also contains α(P)\alpha(P). Now, we rotate DD around vv counterclockwise and keep DD containing P{p}P\cup\{p\} until D\partial D meets another point zP{p}z^{\prime}\in P\cup\{p\}. Depending on whether zPz^{\prime}\in P, there are two cases. If zPz^{\prime}\in P, then by the same analysis as above, the first lemma statement follows. Otherwise, as above, we can obtain that D(ccw(v,p))D(ccw(v,p)) contains α(P)\alpha(P). Because α(v,p)=D(cw(v,p))D(ccw(v,p))\alpha(v,p)=D(cw(v,p))\cap D(ccw(v,p)) and both D(cw(v,p))D(cw(v,p)) and D(ccw(v,p))D(ccw(v,p)) contain α(P)\alpha(P), we obtain that α(v,p)\alpha(v,p) contains α(P)\alpha(P). Therefore, the second lemma statement holds.

It remains to show that α(P)α(v,p)\alpha(P)\subseteq\alpha(v,p) if and only if both cw(v)cw(v) and ccw(v)ccw(v) are in α(v,p)\alpha(v,p). If α(P)\alpha(P) is contained in α(v,p)\alpha(v,p), then it is obviously true that both cw(v)cw(v) and ccw(v)ccw(v) are in α(v,p)\alpha(v,p). Now assume that both cw(v)cw(v) and ccw(v)ccw(v) are in α(v,p)\alpha(v,p). Since α(v,p)=D(cw(v,p))D(ccw(v,p))\alpha(v,p)=D(cw(v,p))\cap D(ccw(v,p)), both cw(v)cw(v) and ccw(v)ccw(v) are in D(cw(v,p))D(cw(v,p)) and also in D(ccw(v,p))D(ccw(v,p)). By Observation 2, both D(cw(v,p))D(cw(v,p)) and D(ccw(v,p))D(ccw(v,p)) are tangent to α(P)\alpha(P) at vv and thus both disks contain α(P)\alpha(P). Therefore, α(P)D(cw(v,p))D(ccw(v,p))=α(v,p)\alpha(P)\subseteq D(cw(v,p))\cap D(ccw(v,p))=\alpha(v,p). ∎

We process the vertices of Q={p1,p2,,pn}Q=\{p_{1},p_{2},\ldots,p_{n}\} incrementally from p1p_{1} to pnp_{n}. We use a circular doubly linked list \mathcal{L} to maintain the vertices of the current circular hull that has been computed. Each vertex in the list has a cwcw pointer and a ccwccw pointer to refer to its clockwise and counterclockwise neighbors on the current hull, respectively. In addition, we maintain the rightmost vertex vv^{*} of the current hull, which is also the access we have to \mathcal{L}. Initially we directly compute α(q1,q2)\alpha(q_{1},q_{2}) and set up the list \mathcal{L}, with v=q2v^{*}=q_{2}. For each i=1,,ni=1,\ldots,n, let Qi={p1,p2,,pi}Q_{i}=\{p_{1},p_{2},\ldots,p_{i}\}.

Consider a general step for processing a new vertex pip_{i} with i3i\geq 3, and suppose \mathcal{L} now stores the circular hull of Qi1Q_{i-1}. With vv^{*}, we can find the rightmost arc ww of the current hull. If pip_{i} is in D1(w)D_{1}(w), then pip_{i} is “redundant” by Observation 4, i.e., pip_{i} does not affect the current circular hull, so we do not need to do anything (i.e., no need to update \mathcal{L}). Otherwise, our goal is to find the two tangents from pip_{i} to the current hull, or decide that they do not exist. Starting from vv^{*}, we first run a counterclockwise scanning procedure to search the upper tangent, as follows (see Algorithm 3 for the pseudocode). Starting with v=vv=v^{*}, we check vv in the following way. We first check whether both cw(v)cw(v) and ccw(v)ccw(v) are in α(v,pi)\alpha(v,p_{i}). If yes, then we stop the procedure and return cw(v,pi)cw(v,p_{i}) as the upper tangent. Otherwise, we check whether cw(ccw(v),v)cw(ccw(v),v) and pip_{i} form an inner turn. If yes, then we stop the procedure and return cw(v,pi)cw(v,p_{i}) as the upper tangent. Assume that they form an outer turn. Then, if ccw(v)vccw(v)\neq v^{*}, then we set v=ccw(v)v=ccw(v) and proceed as above; otherwise, we stop the procedure and conclude that QiQ_{i} (and thus QQ) is not unit disk coverable.

1 vvv\leftarrow v^{*};
2 while true  do
3      if both cw(v)cw(v) and ccw(v)ccw(v) are in α(v,pi)\alpha(v,p_{i}) then
4           return cw(v,pi)cw(v,p_{i}) as the upper tangent;
5          
6           else
7                if cw(ccw(v),v)cw(ccw(v),v) and pip_{i} form an inner turn then
8                     return cw(v,pi)cw(v,p_{i}) as the upper tangent;
9                    
10                     else
11                          if ccw(v)vccw(v)\neq v^{*} then
12                               vccw(v)v\leftarrow ccw(v);
13                              
14                               else
15                                    return null and conclude that α(Qi)\alpha(Q_{i}) (and thus α(Q)\alpha(Q)) does not exist;
16                                   
17                                    end if
18                                   
19                                    end if
20                                   
21                                    end if
22                                   
23                                    end while
Algorithm 3 The counterclockwise scanning procedure searching the upper tangent

It is not difficult to see that the algorithm will eventually stop. The following lemma proves the correctness of the algorithm.

Lemma 6

The counterclockwise scanning procedure will decide whether α(Qi)\alpha(Q_{i}) exists, and if yes, find the upper tangent from pip_{i} to α(Qi1)\alpha(Q_{i-1}) unless pip_{i} is redundant.

Proof

First of all, if pip_{i} is redundant, then our algorithm correctly determines it. Below we assume that pip_{i} is not redundant. Suppose the procedure is checking the vertex vv. There are three cases for the procedure to stop: cw(v)cw(v) and ccw(v)ccw(v) are in α(v,pi)\alpha(v,p_{i}); cw(ccw(v),v)cw(ccw(v),v) and pip_{i} form an inner turn; cw(ccw(v),v)cw(ccw(v),v) and pip_{i} form an outer turn and v=ccw(v)v^{*}=ccw(v). In the first two cases, we will show that cw(v,pi)cw(v,p_{i}) is the upper tangent. In the third case, we will show that QiQ_{i} is not unit disk coverable.

If cw(v)cw(v) and ccw(v)ccw(v) are in α(v,pi)\alpha(v,p_{i}), then by Lemma 5(2), α(Qi1)α(v,pi)\alpha(Q_{i-1})\subseteq\alpha(v,p_{i}). Hence, α(v,pi)=α(Qi)\alpha(v,p_{i})=\alpha(Q_{i}). Since cw(v,pi)cw(v,p_{i}) is an arc of α(v,pi)\alpha(v,p_{i}), D(cw(v,pi))D(cw(v,p_{i})) contains α(v,pi)\alpha(v,p_{i}) and thus α(Qi1)\alpha(Q_{i-1}). Therefore, cw(v,pi)cw(v,p_{i}) is the upper tangent from pip_{i} to α(Qi1)\alpha(Q_{i-1}).

If cw(ccw(v),v)cw(ccw(v),v) and pip_{i} form an inner turn, to show that cw(v,pi)cw(v,p_{i}) is tangent to α(Qi1)\alpha(Q_{i-1}) at vv, by Observation 2 it suffices to show that D(cw(v,pi))D(cw(v,p_{i})) contains both cw(v)cw(v) and ccw(v)ccw(v). Since pip_{i} is not redundant and pip_{i} is to the right of both ccw(v)ccw(v) and vv, pip_{i} is not in α(ccw(v),v)\alpha(ccw(v),v). Because cw(ccw(v),v)cw(ccw(v),v) and pip_{i} form an inner turn, by Observation 5(1), D(cw(v,pi))D(cw(v,p_{i})) contains ccw(v)ccw(v). Next we prove cw(v)D(cw(v,pi))cw(v)\in D(cw(v,p_{i})). Depending on whether v=vv=v^{*}, there are two subcases.

  • If vvv\neq v^{*}, then according to our algorithm, cw(v,cw(v))cw(v,cw(v)) and pip_{i} form an outer turn. Because cw(ccw(v),v)cw(ccw(v),v) and pip_{i} form an inner turn, piD(cw(ccw(v),v))p_{i}\in D(cw(ccw(v),v)). Since cw(ccw(v),v)cw(ccw(v),v) is an arc of α(Qi1)\alpha(Q_{i-1}), D(cw(ccw(v),v))D(cw(ccw(v),v)) contains Qi1Q_{i-1} and thus cw(v)cw(v). Hence, D(cw(ccw(v),v))D(cw(ccw(v),v)) contains {v,cw(v),pi}\{v,cw(v),p_{i}\}, and thus, {v,cw(v),pi}\{v,cw(v),p_{i}\} is unit disk coverable.

    We claim that vv is not in the interior of α(pi,cw(v))\alpha(p_{i},cw(v)). Indeed, assume to the contrary this is not true. Then, since vv is on the boundary of D(cw(ccw(v),v))D(cw(ccw(v),v)), one of pip_{i} and cw(v)cw(v), as two vertices of α(pi,cw(v))\alpha(p_{i},cw(v)) must be outside D(cw(ccw(v),v))D(cw(ccw(v),v)). However, we have proved above that D(cw(ccw(v),v))D(cw(ccw(v),v)) contains both pip_{i} and cw(v)cw(v), incurring contradiction.

    Since vv is not in the interior of α(pi,cw(v))\alpha(p_{i},cw(v)), by Observation 5(2), D(cw(v,pi))D(cw(v,p_{i})) contains cw(v)cw(v).

  • If v=vv=v^{*}, then in the same way as the above case we can show that D(cw(ccw(v),v))D(cw(ccw(v),v)) contains {v,cw(v),pi}\{v,cw(v),p_{i}\}, and thus, {v,cw(v),pi}\{v,cw(v),p_{i}\} is unit disk coverable.

    We claim that cw(v,cw(v))cw(v,cw(v)) and pip_{i} form an outer turn. Assume to the contrary that they form an inner turn. Then, piD(cw(v,cw(v)))p_{i}\in D(cw(v,cw(v))). As piD(cw(ccw(v),v))p_{i}\in D(cw(ccw(v),v)), we obtain that piD(cw(v,cw(v)))D(cw(ccw(v),v))p_{i}\in D(cw(v,cw(v)))\cap D(cw(ccw(v),v)). Since cw(v)cw(v) and ccw(v)ccw(v) are to the left of vv and pip_{i} is to the right of vv, by a similar argument as in the proof of Observation 6(3), we can show that pip_{i} is inside α(Qi1)\alpha(Q_{i-1}), implying that pip_{i} is redundant, which incurs contradiction because pip_{i} is not redundant.

    Further, using the same analysis as the above subcase vvv\neq v^{*}, we can show that vv is not in the interior of α(pi,cw(v))\alpha(p_{i},cw(v)). Consequently, by Observation 5(2), cw(v)cw(v) is in D(cw(v,pi))D(cw(v,p_{i})).

It remains to discuss the third case where cw(ccw(v),v)cw(ccw(v),v) and pip_{i} form an outer turn and v=ccw(v)v^{*}=ccw(v). According to our algorithm, this case happens only if both of the followings are true: (1) for each vertex vv of α(Qi1)\alpha(Q_{i-1}), α(v,pi)\alpha(v,p_{i}) does not contain both cw(v)cw(v) and ccw(v)ccw(v); (2) for each arc cw(ccw(v),v)cw(ccw(v^{\prime}),v^{\prime}) of α(Qi1)\alpha(Q_{i-1}), it does not form an inner turn with pip_{i} (i.e., piD(cw(ccw(v),v))p_{i}\not\in D(cw(ccw(v^{\prime}),v^{\prime}))), implying that pip_{i} is not in the supporting disk of any arc of α(Qi1)\alpha(Q_{i-1}). According to Lemma 5, QiQ_{i} is not unit disk coverable. ∎

If the above procedure finds the upper tangent, then we run a symmetric clockwise scanning procedure to find the lower tangent (which guarantees to exist, for the upper tangent exists). Next, we replace the vertices in \mathcal{L} clockwise strictly from the upper tangent point to the lower tangent point by pip_{i}, and then reset vv^{*} to pip_{i}. The runtime of the two procedures is O(1+k)O(1+k), where kk is the number of vertices removed from \mathcal{L}. After a point is removed from \mathcal{L}, it will never appear in \mathcal{L} again. Hence the total time of the algorithm for processing all points {p1,,pn}\{p_{1},\ldots,p_{n}\} is O(n)O(n).

Theorem 6.1

We can maintain the circular hull of a set QQ of points such that if a new point to the right of all points of QQ is inserted, in O(1)O(1) amortized time we can decide whether α(Q)\alpha(Q) exists, and if yes, update α(Q)\alpha(Q).

Corollary 2

Given a set of points in the plane sorted by xx-coordinates, there exists a linear time algorithm that can decide whether its circular hull exists, and if yes, compute the circular hull.

6.3 The Data Structure for Dynamically Maintaining α(Q)\alpha(Q)

In this subsection, we explain our data structure for maintaining α(Q)\alpha(Q) under both insertions and deletions on QQ. Recall that QQ is a subset of LRL\cup R and the vertical line \ell separates LL and RR. Let Q1=QLQ_{1}=Q\cap L and Q2=QRQ_{2}=Q\cap R. Our data structure will maintain α(Q1)\alpha(Q_{1}) and α(Q2)\alpha(Q_{2}) separately. Recall that each insertion happens to a point in RR and each deletion happens to a point in LL. Our goal is determine whether α(Q)\alpha(Q) exists after each update.

For Q2Q_{2}, we use a circular doubly linked list to maintain α(Q2)\alpha(Q_{2}), in the same way as in the static algorithm. As such, from any vertex vv of α(Q2)\alpha(Q_{2}), we can visit its two neighbors cw(v)cw(v) and ccw(v)ccw(v) in constant time. If a point is inserted, then we update α(Q2)\alpha(Q_{2}) as in the static algorithm. In addition, we also store explicitly the leftmost arc of α(Q2)\alpha(Q_{2}) whenever it is updated, which introduces only a constant time to the previous algorithm. If α(Q2)\alpha(Q_{2}) does not exist after an insertion, then since Q2QQ_{2}\subseteq Q and no point from Q2Q_{2} will be deleted, α(Q)\alpha(Q) will not exist after any update in future and thus we can halt the entire algorithm. Without loss of generality, we assume that α(R)\alpha(R) exists and thus α(Q2)\alpha(Q_{2}) always exists.

For Q1Q_{1}, because points of Q1Q_{1} are deleted in order from left to right, initially when Q1=LQ_{1}=L, we build the circular doubly linked list by processing points of LL from right to left, i.e., from pnp_{n} to p1p_{1}. Further, in order to maintain some historical information, we have each vertex vv of α(Q2)\alpha(Q_{2}) associated with two stacks Scw(v)S_{cw}(v) and Sccw(v)S_{ccw}(v), which are empty initially. Specifically, initially we process the points of LL incrementally from pnp_{n} to p1p_{1}. Consider a general step of the algorithm processing a point pip_{i}. Suppose cw(v1,pi)cw(v_{1},p_{i}) and ccw(v2,pi)ccw(v_{2},p_{i}) are the two tangents found by using our static algorithm. Then, in addition to the processing in the static algorithm, we push v1v_{1} into Sccw(pi)S_{ccw}(p_{i}), push v2v_{2} into Scw(pi)S_{cw}(p_{i}), and push pip_{i} into both Scw(v1)S_{cw}(v_{1}) and Sccw(v2)S_{ccw}(v_{2}). Note that this does not change the time complexity of our previous static algorithm asymptotically. Later when pip_{i} is deleted, we simply pop pip_{i} out of both Scw(v1)S_{cw}(v_{1}) and Sccw(v2)S_{ccw}(v_{2}). In this way, at any moment during processing the deletions of Q1Q_{1}, for any vertex vv in the current circular hull α(Q1)\alpha(Q_{1}), the top of Scw(v)S_{cw}(v) (resp., Sccw(v)S_{ccw}(v)) is always the clockwise (resp., counterclockwise) neighbor of vv on α(Q1)\alpha(Q_{1}), which can be accessed in constant time from the vertex vv. So we can use these stacks to replace the circular doubly linked list, and we call it the stack data structure. In addition, for handling insertions, we also explicitly store, say in an array AA, the rightmost arc of the current circular hull after processing each point of LL (i.e., given ii, A[i]A[i] stores the rightmost arc of the circular hull of {pi,pi+1,,pn}\{p_{i},p_{i+1},\ldots,p_{n}\}). These only introduces constant time to our original static algorithm. If during processing a new point pip_{i} we find that the circular hull of {pi,,pn}\{p_{i},\ldots,p_{n}\} does not exist, then we stop the algorithm and set start=istart=i. In this way, whenever we process a deletion on LL, if the index of the deleted point is smaller than or equal to startstart, then we know that α(Q1)\alpha(Q_{1}) and thus α(Q)\alpha(Q) does not exist and we do not need to do anything. Without loss of generality, we assume that α(L)\alpha(L) exists and thus α(Q1)\alpha(Q_{1}) always exists (so the variable startstart is not needed any more).

The above describes our data structure for maintaining α(Q1)\alpha(Q_{1}) and α(Q2)\alpha(Q_{2}). We also need to maintain other information. To explain them, we first show a property, as follows.

Although Q1Q_{1} is to the left of \ell, α(Q1)\alpha(Q_{1}) may cover some region of the plane to the right of \ell, denoted by α(Q1)\alpha^{\prime}(Q_{1}), and if ww is the rightmost arc of α(Q1)\alpha(Q_{1}), then α(Q1)\alpha^{\prime}(Q_{1}) is exactly the portion of D1(w)D_{1}(w) to the right of \ell due to the convexity of α(Q1)\alpha(Q_{1}) [18]. Symmetrically, we define α(Q2)\alpha^{\prime}(Q_{2}) as the region of α(Q2)\alpha(Q_{2}) to the left of \ell. The following lemma shows that as points are deleted from Q1Q_{1}, α(Q1)\alpha^{\prime}(Q_{1}) becomes monotonically smaller, and as points are inserted into Q2Q_{2}, α(Q2)\alpha^{\prime}(Q_{2}) becomes monotonically larger.

Refer to caption
Figure 11: Illustrating Lemma 7, where Q1=Q1{p}Q_{1}=Q_{1}^{\prime}\cup\{p\}. The light (resp., dark) gray region is α(Q1)\alpha^{\prime}(Q_{1}) (resp., α(Q1)\alpha^{\prime}(Q_{1}^{\prime})).
Lemma 7

If Q1Q1Q^{\prime}_{1}\subseteq Q_{1}, then α(Q1)α(Q1)\alpha^{\prime}(Q_{1}^{\prime})\subseteq\alpha^{\prime}(Q_{1}); e.g., see Fig. 11. Similarly, if Q2Q2Q^{\prime}_{2}\subseteq Q_{2}, then α(Q2)α(Q2)\alpha^{\prime}(Q_{2}^{\prime})\subseteq\alpha^{\prime}(Q_{2}).

Proof

We only prove the case for Q1Q_{1}, and the other case for Q2Q_{2} can be treated likewise. Indeed, let ww and ww^{\prime} be the rightmost arcs of Q1Q_{1} and Q1Q_{1}^{\prime}, respectively. If w=nullw=null, then ww^{\prime} must be nullnull due to Q1Q1Q_{1}^{\prime}\subseteq Q_{1}, and thus we have α(Q1)=α(Q1)=\alpha^{\prime}(Q_{1}^{\prime})=\alpha^{\prime}(Q_{1})=\emptyset. Assume that wnullw\neq null. If w=nullw^{\prime}=null, then since α(Q1)=\alpha^{\prime}(Q_{1}^{\prime})=\emptyset and α(Q1)\alpha^{\prime}(Q_{1})\neq\emptyset, α(Q1)α(Q1)\alpha^{\prime}(Q_{1}^{\prime})\subseteq\alpha^{\prime}(Q_{1}) holds. Assume that wnullw^{\prime}\neq null (e.g., see Fig. 11). Since ww is an arc of α(Q1)\alpha(Q_{1}), D(w)D(w) contains Q1Q_{1} and thus Q1Q_{1}^{\prime}. By Observation 1(4), D(w)D(w) contains α(Q1)\alpha(Q_{1}^{\prime}), and thus, D(w)D(w) contains the arc ww^{\prime}. Note that α(Q1)\alpha^{\prime}(Q_{1}^{\prime}) is bounded from the left by \ell and bounded from the right by the portion of ww^{\prime} to the right of \ell. Since α(Q1)\alpha^{\prime}(Q_{1}) is the region of D(w)D(w) to the right of \ell and D(w)D(w) contains ww^{\prime}, it must hold that α(Q1)α(Q1)\alpha^{\prime}(Q_{1}^{\prime})\subseteq\alpha^{\prime}(Q_{1}).∎

In addition to the data structures for α(Q1)\alpha(Q_{1}) and α(Q2)\alpha(Q_{2}) described above, our dynamic algorithm also maintains the following information. Recall that based on our assumption both α(Q1)\alpha(Q_{1}) and α(Q2)\alpha(Q_{2}) always exist.

  1. 1.

    If Q2Q_{2} is contained in α(Q1)\alpha(Q_{1}), i.e., the Q1Q_{1}-dominating case, then our algorithm will detect it, and in this case α(Q)=α(Q1)\alpha(Q)=\alpha(Q_{1}) and α(Q)\alpha(Q) exists.

  2. 2.

    If Q1Q_{1} is contained in α(Q2)\alpha(Q_{2}), i.e., the Q2Q_{2}-dominating case, then our algorithm will detect it, and in this case α(Q)=α(Q2)\alpha(Q)=\alpha(Q_{2}) and α(Q)\alpha(Q) exists. Further, because in future deletions will only happen to Q1Q_{1} and insertions will only happen to Q2Q_{2}, Lemma 7 implies that α(Q)=α(Q2)\alpha(Q)=\alpha(Q_{2}) always holds. Therefore, in future we can ignore all deletions and only handle insertions, which can be done by simply applying the static algorithm on Q2Q_{2}.

  3. 3.

    If neither of the above cases happens, then our algorithm will detect whether α(Q)\alpha(Q) exists, and if yes, the two common tangents of α(Q1)\alpha(Q_{1}) and α(Q2)\alpha(Q_{2}) will be explicitly maintained.

6.4 Initialization

Initially, Q=Q1=LQ=Q_{1}=L, so we build the data structure for α(Q1)\alpha(Q_{1}) as discussed before. This takes O(n)O(n) time. Since there are 2n2n update operations, the amortized cost is O(1)O(1).

One annoying issue is to check whether Q1Q_{1}- or Q2Q_{2}-dominating case will happen after each update. We show how to resolve the issue. We discuss the Q1Q_{1}-dominating case first.

Recall R={q1,q2,,qn}R=\{q_{1},q_{2},\ldots,q_{n}\} is sorted from left to right. When q1q_{1} is inserted into QQ (i.e., this is the first insertion), it is quite trivial to determine whether the Q1Q_{1}-dominating case happens, which can be done in constant time by checking whether q1q_{1} is contained in the supporting circle of the rightmost arc of α(Q1)\alpha(Q_{1}) (which is maintained after each deletion). However, the problem becomes challenging after more points are inserted. We use the following strategy to resolve the problem “once for all”.

An easy observation is that once the Q1Q_{1}-dominating case does not happen for the first time after an update (which may be either an insertion or a deletion), in light of Lemma 7, it will not never happen in future, because Q1Q_{1} will become smaller while Q2Q_{2} will become larger. Also, before that particular update, α(Q)=α(Q1)\alpha(Q)=\alpha(Q_{1}) holds and thus α(Q)\alpha(Q) exists. Lemma 8 gives an O(n)O(n) time algorithm to find that particular update. Note that this procedure is only performed once in the entire algorithm.

Lemma 8

The first update after which the Q1Q_{1}-dominating case does not happen can be determined in O(n)O(n) time.

Proof

For each i=1,2,,ni=1,2,\ldots,n, we use α[i,n]\alpha^{\prime}[i,n] to refer to α({pi,pi+1,,pn})\alpha^{\prime}(\{p_{i},p_{i+1},\ldots,p_{n}\}). As discussed before, each α[i,n]\alpha^{\prime}[i,n] is the part of a unit disk on the right side of the line \ell. By Lemma 7, it holds that α[i,n]α[i1,n]\alpha^{\prime}[i,n]\subseteq\alpha^{\prime}[i-1,n] for all i=2,3,,ni=2,3,\ldots,n. Recall that the rightmost arc is maintained by our algorithm after each deletion of LL. Thus, given ii, α[i,n]\alpha^{\prime}[i,n] can be obtained in O(1)O(1) time.

From the outset, we process insertions and deletions as follows. During the algorithm, we maintain a variable ii^{*}, which is the first deletion after which the Q1Q_{1}-dominating case will not happen for the points in the current set Q2Q_{2}. Initially before any deletion or insertion, Q1=LQ_{1}=L and Q2=Q_{2}=\emptyset, and thus we set i=ni^{*}=n. For each deletion of a point pip_{i}, if i<ii<i^{*}, then we proceed on the next update; otherwise we return the deletion of pip_{i} as the answer to the problem. Consider an insertion of a point qjq_{j}. We first check whether qjq_{j} is in α[i,n]\alpha^{\prime}[i^{*},n]. If yes, we proceed on the next update. Otherwise, we keep decrementing ii^{*} until qjα[i,n]q_{j}\in\alpha^{\prime}[i^{*},n] or i=0i^{*}=0. Then we check whether i<ii^{*}<i, where ii is the index of the leftmost point of the current set Q1Q_{1} (i.e., Q1={pi,,pn}Q_{1}=\{p_{i},\ldots,p_{n}\}). If i<ii^{*}<i, then we return the insertion of qjq_{j} as the answer to the problem. Otherwise, we proceed on the next update.

The correctness of the algorithm is based on Lemma 7. It is not difficult to see that the algorithm runs in O(n)O(n) time. ∎

Lemma 8 finds the update after which the Q1Q_{1}-dominating case does not happen for the first time. Regardless of whether it is an insertion or a deletion, let Q1Q_{1} and Q2Q_{2} be the two subsets right after the update. So we know that both α(Q1)\alpha(Q_{1}) and α(Q2)\alpha(Q_{2}) exist, and the Q1Q_{1}-dominating case does not happen.

Next, we discuss how to detect whether the Q2Q_{2}-dominating case happens after each update in future (starting from the update found in Lemma 8), by a Q2Q_{2}-dominating case detection procedure, as follows. As discussed before, once we find the Q2Q_{2}-dominating case happens for the first time after an update, we can simply use our static algorithm to handle the deletions only in future. Starting from j=nj^{*}=n, we check whether pjp_{j^{*}} is in the supporting disk DD of the leftmost arc of the current α(Q2)\alpha(Q_{2}). Recall that the leftmost arc of α(Q2)\alpha(Q_{2}) is explicitly stored (and if it is nullnull, then its supporting disk is \emptyset). If yes, we decrement jj^{*} until j=0j^{*}=0 or pjDp_{j^{*}}\not\in D (thus all points of LL from pj+1p_{j^{*}+1} to pnp_{n} are in DD). Now consider an insertion to Q2Q_{2}. If the leftmost arc of α(Q2)\alpha(Q_{2}) gets updated, then by Lemma 7, all points of LL from pj+1p_{j^{*}+1} to pnp_{n} are still contained in the supporting disk DD of the new leftmost arc. We further check whether pjp_{j^{*}} is in DD. If yes, we decrement jj^{*} until j=0j^{*}=0 or pjDp_{j^{*}}\not\in D. Let ii^{*} be the index of the leftmost point of the current set Q1Q_{1}. Whenever jj^{*} decrements as above, if i>ji^{*}>j^{*}, then we know the Q2Q_{2}-dominating case happens and then we only need to process the insertions using the static algorithm in future. Similarly, when pip_{i^{*}} is deleted, we increment ii^{*} by one, and if i>ji^{*}>j^{*}, and we again run into the Q2Q_{2}-dominating case.

In the following discussion on processing updates, before actually processing each update, we run the above procedure to check whether the Q2Q_{2}-dominating case happens. If yes, then the rest of the algorithm is trivial. Otherwise, we will perform the corresponding algorithm (to be discussed below) for processing the update. Hence, the Q2Q_{2}-dominating case detection procedure is actually part of the update processing algorithm. In the following discussion whenever we process an insertion or a deletion, we assume that the Q2Q_{2}-dominating case will not happen after the operation. It is easy to see that the procedure takes O(n)O(n) time in the entire algorithm for processing all 2n2n updates.

According to the above discussion, we start from the update found by Lemma 8, and neither dominating case will happen. This implies that the common tangents of α(Q1)\alpha(Q_{1}) and α(Q2)\alpha(Q_{2}) exist if and only if α(Q)\alpha(Q) exists. Next, we present an O(n)O(n) time procedure to decide whether α(Q)\alpha(Q) exists, and if yes, find the two common tangents. Note that this procedure is performed only once, e.g., after the update of Lemma 8, which does not affect the O(1)O(1) amortized time performance per update.

Because we do not know whether α(Q)\alpha(Q) exists, we apply our static algorithm processing the points of QQ from right to left. If during processing a point we determine the current circular hull does not exist, then we stop the algorithm and let pp refer to the point; otherwise let p=nullp=null. If p=nullp=null, then α(Q)\alpha(Q) exists and we compute the common tangents of α(Q1)\alpha(Q_{1}) and α(Q2)\alpha(Q_{2}) by an algorithm given below. Assume that pnullp\neq null. Since α(Q2)\alpha(Q_{2}) exists, pp must be from Q1Q_{1}. Observe that before pp is deleted, α(Q)\alpha(Q) cannot exist. Suppose we consider the next update. If it is a deletion of a point to the left of pp, then we do nothing but we know α(Q)\alpha(Q) does not exist. If it is an insertion of a point qjq_{j}, then we know that α(Q)\alpha(Q) does not exist, but instead of immediately inserting qjq_{j} to our data structure for Q2Q_{2}, we hold qjq_{j} in a first-in-first-out queue 𝒬\mathcal{Q}, which is \emptyset initially. If it is the deletion of pp, then we know that α(Q)\alpha(Q) exist, where QQ does not include the points held in 𝒬\mathcal{Q}. In this case (and also the case p=nullp=null), we find the two common tangents of α(Q1)\alpha(Q_{1}) and α(Q2)\alpha(Q_{2}), as follows.

The algorithm is similar to that for finding common tangents of two convex hulls. Hershberger and Suri gave a linear time algorithm for that [18] (see Lemma 4.12). To make the paper self-contained, we sketch a slightly different algorithm. We first find the upper common tangent as follows. Starting from the leftmost vertex, we consider the vertices of α(Q2)\alpha(Q_{2}) in the clockwise order. For each vertex, we find its upper tangent to α(Q1)\alpha(Q_{1}) by using the counterclockwise scanning procedure in our static algorithm. Once we find the upper tangent, we check whether it is also tangent to α(Q2)\alpha(Q_{2}). If yes, we have found the upper common tangent. Otherwise, we consider the next vertex of α(Q2)\alpha(Q_{2}), but start the counterclockwise scanning procedure from the current tangent point on α(Q1)\alpha(Q_{1}). As the upper common tangent exists, the algorithm will eventually find it. We find the lower common tangent in a similar way using the clockwise scanning procedure of our static algorithm. The time is linear in the total number of vertices of α(Q1)\alpha(Q_{1}) and α(Q2)\alpha(Q_{2}).

After the common tangents are found, if 𝒬\mathcal{Q}\neq\emptyset (which only happens if pnullp\neq null), then we need to process the insertions on the points in 𝒬\mathcal{Q} in order to know whether α(Q)\alpha(Q) exists after the deletion of pp. For this, we will apply on these points the insertion algorithm to be given below.

The above describes our initialization procedure, which takes O(n)O(n) time. In the following, we present our algorithm for handling future insertions (including those in 𝒬\mathcal{Q}) and deletions. Our algorithm maintains an invariant that is stated in the following observation.

Observation 8

Suppose the algorithm is about to process an update.

  1. 1.

    Before the update, the Q1Q_{1}-dominating case does not happen,

  2. 2.

    Before the update, the two common tangents of α(Q1)\alpha(Q_{1}) and α(Q2)\alpha(Q_{2}) exist and are explicitly computed.

  3. 3.

    After the update, the Q2Q_{2}-dominating case does not happen.

The first invariant is established due to that we always process updates after the update computed in Lemma 8. The third invariant is established by our Q2Q_{2}-dominating case detection procedure. More precisely, once the procedure detects that the Q2Q_{2}-dominating case happens after an update, then we will apply our static algorithm on α(Q2)\alpha(Q_{2}) with insertions only. The second invariant has been established above for the moment, and we will show later that it will be re-established after each future update is processed. We are able to do so because our insertion processing algorithm may also involve performing point deletions. For this reason, in the following we discuss the deletion processing algorithm first.

6.5 Deletions

Suppose a point pip_{i} is deleted from Q1Q_{1}. Let Q1=Q1{pi}Q_{1}^{\prime}=Q_{1}\setminus\{p_{i}\} and let Q1Q_{1} still be the original set before the deletion. Let Q=Q1Q2Q=Q_{1}\cup Q_{2} and Q=Q1Q2Q^{\prime}=Q_{1}^{\prime}\cup Q_{2}. Since α(Q)\alpha(Q) exists (due to Observation 8(2)), α(Q)\alpha(Q^{\prime}) exists. Thus, our task is to update the common tangents if they are changed. We show that we can do so in O(1)O(1) amortized time. Let cw(a1,a2)cw(a_{1},a_{2}) and cw(b1,b2)cw(b_{1},b_{2}) denote the upper and lower common tangents of α(Q1)\alpha(Q_{1}) and α(Q2)\alpha(Q_{2}), respectively, which have been computed by Observation 8(2).

First of all, if pip_{i} is not the leftmost vertex of α(Q1)\alpha(Q_{1}) (which has been explicitly stored when we build the data structure for Q1=LQ_{1}=L initially), then pip_{i} is in the interior of α(Q1)\alpha(Q_{1}) and thus nothing needs to be done (i.e., the common tangents do not change). Otherwise, let p=cw(pi)p=cw(p_{i}), which can be accessed in O(1)O(1) time using our stack data structure for Q1Q_{1}. According to our stack data structure, pip_{i} is at the top of the stack Sccw(p)S_{ccw}(p). We pop pip_{i} out of Sccw(p)S_{ccw}(p). We also pop pip_{i} out of Scw(p)S_{cw}(p^{\prime}), where p=ccw(pi)p^{\prime}=ccw(p_{i}). If pi{a1,b1}p_{i}\not\in\{a_{1},b_{1}\}, then the common tangents do not change and thus we are done with the deletion. Otherwise, we assume that pi=a1p_{i}=a_{1} (the other case can be treated likewise). Depending on whether a1=b1a_{1}=b_{1}, there are two cases.

If b1a1b_{1}\neq a_{1}, then after a1a_{1} is deleted, b1b_{1} is still a vertex of α(Q1)\alpha(Q_{1}^{\prime}) and thus ccw(b1,b2)ccw(b_{1},b_{2}) is still the lower common tangent. To find the new upper common tangent, we move pp counterclockwise on α(Q1)\alpha(Q_{1}^{\prime}) and simultaneously move a2a_{2} counterclockwise on α(Q2)\alpha(Q_{2}). This procedure is similar in spirit to finding common tangent for two convex hulls separated by a vertical line, and we sketch it below (e.g., see Fig. 12).

We first check whether cw(p,a2)cw(p,a_{2}) is tangent to α(Q1)\alpha(Q^{\prime}_{1}) at pp. Recall that by Observation 2 this is can be done by checking whether D(cw(p,a2))D(cw(p,a_{2})) contains ccw(p)ccw(p) and cw(p)cw(p) (which can be accessed from pp in constant time using our stack data structure). If not, then we move pp counterclockwise on α(Q1)\alpha(Q_{1}^{\prime}) until cw(p,a2)cw(p,a_{2}) is tangent to α(Q1)\alpha(Q^{\prime}_{1}) at pp. Then, we check whether cw(p,a2)cw(p,a_{2}) is tangent to α(Q2)\alpha(Q_{2}) at a2a_{2}. If not, then we move a2a_{2} counterclockwise on α(Q2)\alpha(Q_{2}) until cw(p,a2)cw(p,a_{2}) is tangent to α(Q2)\alpha(Q_{2}) at a2a_{2}. If the new cw(p,a2)cw(p,a_{2}) is not tangent to α(Q1)\alpha(Q^{\prime}_{1}) at pp, then we move pp counterclockwise again. We repeat the algorithm until cw(p,a2)cw(p,a_{2}) is both tangent to α(Q1)\alpha(Q^{\prime}_{1}) at pp and tangent to α(Q2)\alpha(Q_{2}) at a2a_{2}. As the upper common tangent exists, the procedure will eventually find it.

Refer to caption
Figure 12: Illustrating the new upper common tangent (the dashed one) after a1a_{1} is deleted. The dotted curves are arcs on α(Q1)\alpha(Q_{1}^{\prime}) but not on α(Q)\alpha(Q). To find the new upper common tangent, one can simultaneously rotate pp counterclockwise on α(Q1)\alpha(Q_{1}^{\prime}) and rotate a2a_{2} counterclockwise on α(Q2)\alpha(Q_{2}).

We then consider the case where a1=b1a_{1}=b_{1}. In this case, the lower common tangent is also changed and we need to compute it as well. As the Q2Q_{2}-dominating case does not happen, both upper and lower common tangents exist. Thus, we can use the same algorithm as above to find the upper common tangent and use a symmetric algorithm to find the lower common tangent.

In either case above, we call the procedure for finding the upper common tangent the deletion-type upper common tangent searching procedure, which takes O(1+k1+k2)O(1+k_{1}+k_{2}) time, where k1k_{1} is the number of vertices of α(Q1)\alpha(Q^{\prime}_{1}) strictly counterclockwise from the original pp to its new position when the algorithm finishes and k2k_{2} is the number of vertices of α(Q2)\alpha(Q_{2}) strictly counterclockwise from the original a2a_{2} to its new position after the algorithm finishes (we say that these vertices are involved in the procedure). If the lower common tangent is also updated, we call it the deletion-type lower common tangent searching procedure. Lemma 9 shows that each point can involve in at most one such procedure in the entire algorithm, and thus the amortized cost of the two procedures is O(1)O(1).

Lemma 9

Each point of LRL\cup R can involve in at most one deletion-type upper tangent searching procedure and at most one deletion-type lower tangent searching procedure in the entire algorithm (for processing all 2n2n updates).

Proof

We only discuss the upper tangent case, for the lower tangent case is similar. Let vv be a vertex on α(Q1)\alpha(Q^{\prime}_{1}) involved in the procedure. We show that vv cannot involve in the procedure again. Indeed, vv was not a vertex of α(Q1)\alpha(Q_{1}) before pip_{i} is deleted. After pip_{i} is delete, since vv is involved in the procedure, vv must be a vertex of α(Q1)\alpha(Q_{1}^{\prime}). As only deletions will happen on Q1Q_{1}, vv will always be a vertex of the circular hull of Q1Q_{1} until it is deleted. Hence, vv will never be involved in the procedure again (because to involve in the procedure, vv cannot be a vertex of the circular hull of Q1Q_{1}).

Let qq be a vertex on α(Q2)\alpha(Q_{2}) involved in the procedure. Let a2a_{2} and a2a_{2}^{\prime} be the old and new upper common tangent points on α(Q2)\alpha(Q_{2}), respectively. Let b2b_{2} and b2b_{2}^{\prime} be the old and new lower common tangent points on α(Q2)\alpha(Q_{2}), respectively. Then, qα(Q2)(a2,a2)q\in\partial_{\alpha(Q_{2})}(a_{2}^{\prime},a_{2}). Notice that α(Q2)(a2,a2)α(Q2)(b2,a2)\partial_{\alpha(Q_{2})}(a_{2}^{\prime},a_{2})\subseteq\partial_{\alpha(Q_{2})}(b_{2},a_{2}). By Observation 7(1), any disk tangent to α(Q2)\alpha(Q_{2}) at qq does not contain Q1Q_{1}. On the other hand, since qq is involved in the procedure, we have qα(Q2)(a2,b2)q\in\partial_{\alpha(Q_{2})}(a_{2}^{\prime},b_{2}^{\prime}) because a2a_{2} is moving counterclockwise to a2a_{2}^{\prime} while b2b_{2} is moving clockwise to b2b_{2}^{\prime} according to our algorithm. Thus, any disk tangent to α(Q2)\alpha(Q_{2}) at qq must contain the new set Q1Q_{1}^{\prime} after the deletion.

Now consider another deletion operation later. We argue that qq will not be involved in the same procedure for the deletion. Let Q′′Q^{\prime\prime} be the set of QQ right before the deletion, and let Q1′′=Q′′LQ_{1}^{\prime\prime}=Q^{\prime\prime}\cap L and Q2′′=Q′′RQ_{2}^{\prime\prime}=Q^{\prime\prime}\cap R. Clearly, Q1′′Q1Q_{1}^{\prime\prime}\subseteq Q_{1}^{\prime} and Q2Q2′′Q_{2}\subseteq Q_{2}^{\prime\prime}. Assume to the contrary that qq involves in the procedure again. Then, qq is a vertex of α(Q2′′)\alpha(Q_{2}^{\prime\prime}). Let DD be a disk tangent to α(Q2′′)\alpha(Q_{2}^{\prime\prime}) at qq. Hence, DD covers Q2′′Q_{2}^{\prime\prime} and thus Q2Q_{2}. This implies that DD is also tangent to α(Q2)\alpha(Q_{2}) at qq. Thus, DD contains Q1Q_{1}^{\prime}. On the other hand, because qq is involved in the procedure, as discussed above, any disk tangent to α(Q2′′)\alpha(Q_{2}^{\prime\prime}) at qq does not contain Q1′′Q_{1}^{\prime\prime}. Hence, DD does not contain Q1′′Q_{1}^{\prime\prime}. Because Q1′′Q1Q_{1}^{\prime\prime}\subseteq Q_{1}^{\prime}, we obtain that DD does not contain Q1Q_{1}^{\prime}, incurring contradiction. ∎

This finishes the description of our deletion algorithm, which takes O(1)O(1) amortized time. Note that the second invariant in Observation 8 is established.

6.6 Insertions

Consider an insertion of a point qjq_{j} into Q2Q_{2}. We first update the hull α(Q2)\alpha(Q_{2}) as in our static algorithm. If qjq_{j} is redundant, then we are done for the insertion because α(Q)\alpha(Q) still exists (by Observation 8(2)) and the common tangents do not change. Otherwise, qjq_{j} appears as the rightmost vertex in the new α(Q2)\alpha(Q_{2}) (recall that we have assumed that α(R)\alpha(R) exists and thus α(Q2)\alpha(Q_{2}) always exists). Let Q2Q_{2}^{\prime} be the set of Q2Q_{2} before qjq_{j} is inserted and Q2Q_{2} the set after the insertion. Let Q=Q1Q2Q^{\prime}=Q_{1}\cup Q_{2}^{\prime} and Q=Q1Q2Q=Q_{1}\cup Q_{2}. Let z1z_{1} and z2z_{2} be the counterclockwise and clockwise neighbors of qjq_{j} in the α(Q2)\alpha(Q_{2}), or equivalently, they are the upper and lower tangent points from qjq_{j} to α(Q2)\alpha(Q^{\prime}_{2}). For a purpose that will be clear later, we temporarily keep the circular hull of α(Q2)\alpha(Q^{\prime}_{2}) unaltered.

Since the Q2Q_{2}-dominating case does not happen, one of the following two cases will happen: (1) the common tangents of α(Q1)\alpha(Q_{1}) and α(Q2)\alpha(Q_{2}) exist; (2) α(Q)\alpha(Q) does not exist. Our algorithm will detect which case happens. In the first case, the algorithm will find the new common tangents. In the second case, some further processing that involves deleting points from Q1Q_{1} will follow (the deletion processing algorithm in Section 6.5 will be invoked). Before describing our algorithm, we give two lemmas that will help demonstrate the correctness of our algorithm. Let cw(a1,a2)cw(a_{1},a_{2}) and ccw(b1,b2)ccw(b_{1},b_{2}) be the upper and lower common tangents of α(Q1)\alpha(Q_{1}) and α(Q2)\alpha(Q_{2}^{\prime}), respectively, which are already known by Observation 8(2). We use β(a2,b2)\beta(a_{2},b_{2}) denote the subset of vertices of α(Q2)\alpha(Q_{2}^{\prime}) clockwise from a2a_{2} to b2b_{2} excluding a2a_{2} and b2b_{2}, and β(a2,b2)=\beta(a_{2},b_{2})=\emptyset if a2=b2a_{2}=b_{2}. In fact, β(a2,b2)=α(Q2)[b2,a2]¯\beta(a_{2},b_{2})=\overline{\partial_{\alpha(Q_{2}^{\prime})}[b_{2},a_{2}]}. Let β[a2,b2]=β(a2,b2){a2,b2}\beta[a_{2},b_{2}]=\beta(a_{2},b_{2})\cup\{a_{2},b_{2}\}.

Lemma 10
  1. 1.

    The rightmost vertex of α(Q)\alpha(Q^{\prime}) is also the rightmost vertex of α(Q2)\alpha(Q_{2}^{\prime}), which must be in β[a2,b2]\beta[a_{2},b_{2}].

  2. 2.

    The rightmost arc of α(Q)\alpha(Q^{\prime}) is one of the following three arcs: the rightmost arc of α(Q2)\alpha(Q_{2}^{\prime}), cw(a1,a2)cw(a_{1},a_{2}), and ccw(b1,b2)ccw(b_{1},b_{2}).

Proof

Let vv be the rightmost vertex of α(Q)\alpha(Q^{\prime}). We first show that vv must be in Q2Q_{2}^{\prime}. Assume to the contrary that this is not true. Then, vQ1v\in Q_{1}. Since all points of Q2Q_{2}^{\prime} are to the right of \ell and all points of Q1Q_{1} are to the left of \ell, none of the points of Q2Q_{2}^{\prime} is a vertex of α(Q)\alpha(Q^{\prime}), which implies that all points of Q2Q_{2}^{\prime} are in α(Q)\alpha(Q^{\prime}), and thus α(Q)=α(Q1)\alpha(Q^{\prime})=\alpha(Q_{1}). Therefore, we obtain that all points of Q2Q_{2}^{\prime} are in α(Q1)\alpha(Q_{1}), which is the Q1Q_{1}-dominating case. This contradicts Observation 8(1) that the Q1Q_{1}-dominating case does not happen. Hence, vv is in Q2Q_{2}^{\prime}.

Since Q2QQ_{2}^{\prime}\subseteq Q^{\prime}, it is not difficult to see that vv is also the rightmost vertex of α(Q2)\alpha(Q_{2}^{\prime}). Since β[a2,b2]\beta[a_{2},b_{2}] consists of all vertices of α(Q2)\alpha(Q_{2}^{\prime}) that are also vertices of α(Q)\alpha(Q^{\prime}), vv must be in β[a2,b2]\beta[a_{2},b_{2}].

The above proves the first statement of the lemma. The second statement follows from vβ[a2,b2]v\in\beta[a_{2},b_{2}], which consists of all vertices of α(Q2)\alpha(Q_{2}^{\prime}) that are also vertices of α(Q)\alpha(Q^{\prime}). ∎

If qjq_{j} is in the supporting disk of the rightmost arc of α(Q)\alpha(Q^{\prime}), i.e., qjq_{j} is redundant with respect to α(Q)\alpha(Q^{\prime}), then α(Q)\alpha(Q) exists and cw(a1,a2)cw(a_{1},a_{2}) and ccw(b1,b2)ccw(b_{1},b_{2}) are still the common tangents of α(Q1)\alpha(Q_{1}) and α(Q2)\alpha(Q_{2}). Otherwise, α(Q)\alpha(Q) exists if and only if the tangents from qjq_{j} to α(Q)\alpha(Q^{\prime}) exist. If α(Q)\alpha(Q) exists, we use aa and bb to denote the upper and lower tangent points from qjq_{j} to α(Q)\alpha(Q^{\prime}), respectively.

Refer to caption
Figure 13: Illustrating Lemma 11(1).
Refer to caption
Figure 14: Illustrating Lemma 11(2).
Lemma 11

Assume that qjq_{j} is not in the supporting disk of the rightmost arc of α(Q)\alpha(Q^{\prime}) and α(Q)\alpha(Q) exists.

  1. 1.

    If z1β(a2,b2)z_{1}\in\beta(a_{2},b_{2}), or if z1=a2z_{1}=a_{2} and cw(a1,a2)cw(a_{1},a_{2}) and qjq_{j} form an inner turn, then cw(a1,a2)cw(a_{1},a_{2}) is still the upper tangent of α(Q1)\alpha(Q_{1}) and α(Q2)\alpha(Q_{2}); e.g., see Fig. 14.

  2. 2.

    If z1β[a2,b2]z_{1}\not\in\beta[a_{2},b_{2}], or z1=a2z_{1}=a_{2} and cw(a1,a2)cw(a_{1},a_{2}) and qjq_{j} form an outer turn, then cw(a,qj)cw(a,q_{j}) is the new upper common tangent of α(Q1)\alpha(Q_{1}) and α(Q2)\alpha(Q_{2}) as well as the upper tangent from qjq_{j} to α(Q1)\alpha(Q_{1}), and further, aα(Q1)(a1,b1)¯a\in\overline{\partial_{\alpha(Q_{1})}(a_{1},b_{1})}; e.g., see Fig. 14.

  3. 3.

    If z2z_{2} is in β(a2,b2)\beta(a_{2},b_{2}), or if z2=b2z_{2}=b_{2} and ccw(b1,b2)ccw(b_{1},b_{2}) and qjq_{j} form an inner turn, then ccw(b1,b2)ccw(b_{1},b_{2}) is still the upper tangent of α(Q1)\alpha(Q_{1}) and α(Q2)\alpha(Q_{2}).

  4. 4.

    If z2β[a2,b2]z_{2}\not\in\beta[a_{2},b_{2}], or z2=b2z_{2}=b_{2} and ccw(b1,b2)ccw(b_{1},b_{2}) and qjq_{j} form an outer turn, then ccw(b,qj)ccw(b,q_{j}) is the new lower common tangent of α(Q1)\alpha(Q_{1}) and α(Q2)\alpha(Q_{2}) as well as the lower tangent from qjq_{j} to α(Q1)\alpha(Q_{1}), and further, bα(Q1)(a1,b1)¯b\in\overline{\partial_{\alpha(Q_{1})}(a_{1},b_{1})}.

Proof

We only prove (1) and (2), since (3) and (4) can be proved analogously.

Assume that z1β(a2,b2)z_{1}\in\beta(a_{2},b_{2}). Then, by the definition of β(a2,b2)\beta(a_{2},b_{2}), D(cw(z1,qj))D(cw(z_{1},q_{j})) is tangent to α(Q)\alpha(Q^{\prime}) at z1z_{1}, and thus cw(z1,qj)cw(z_{1},q_{j}) is also the upper tangent from qjq_{j} to α(Q)\alpha(Q^{\prime}) and z1=az_{1}=a. To show that cw(a1,a2)cw(a_{1},a_{2}) is still the upper common tangent, it suffices to show that both a1a_{1} and a2a_{2} are still vertices of α(Q)\alpha(Q). Assume to the contrary this is not true. Then, because z1β(a2,b2)z_{1}\in\beta(a_{2},b_{2}), cw(z1,qj)cw(z_{1},q_{j}) is the upper tangent from qjq_{j} to α(Q)\alpha(Q^{\prime}), and the rightmost vertex of α(Q)\alpha(Q^{\prime}) is in β[a2,b2]\beta[a_{2},b_{2}] by Lemma 10, if we apply the clockwise scanning procedure on α(Q)\alpha(Q^{\prime}) to search the lower tangent ccw(b,qj)ccw(b,q_{j}), then at least one of a1a_{1} and a2a_{2} will be removed from the vertex list of α(Q)\alpha(Q) during procedure. As at least one of a1a_{1} and a2a_{2} is not a vertex of α(Q)\alpha(Q) and the scanning procedure starts from the rightmost vertex of α(Q2)\alpha(Q_{2}^{\prime}), a1a_{1} cannot be a vertex of α(Q)\alpha(Q) and bb must be in Q2Q_{2}^{\prime}, and further, ccw(b,qj)ccw(b,q_{j}) must cross the vertical line \ell twice because both bb and qjq_{j} are to the right of \ell while a1a_{1} is to the left of \ell. Hence, ccw(b,qj)ccw(b,q_{j}) is the leftmost arc of α(Q)\alpha(Q). In addition, since bQ2b\in Q_{2}^{\prime}, α(Q)\alpha(Q) is actually α(Q2)\alpha(Q_{2}), implying that all points of Q1Q_{1} are in α(Q2)\alpha(Q_{2}). Therefore, we obtain that this is the Q2Q_{2}-dominating case, contradicting with Observation 8(3) that the Q2Q_{2}-dominating case does not happen after qjq_{j} is inserted. Hence, cw(a1,a2)cw(a_{1},a_{2}) is still the upper tangent of α(Q1)\alpha(Q_{1}) and α(Q2)\alpha(Q_{2}).

Assume that z1=a2z_{1}=a_{2} and cw(a1,a2)cw(a_{1},a_{2}) and qjq_{j} form an inner turn. Then, because by Lemma 10 the rightmost vertex of α(Q)\alpha(Q^{\prime}) is also the rightmost vertex of α(Q2)\alpha(Q_{2}^{\prime}), which is in β[a2,b2]\beta[a_{2},b_{2}], if we apply the counterclockwise scanning procedure on α(Q)\alpha(Q^{\prime}) to search the upper tangent from qjq_{j} to α(Q)\alpha(Q^{\prime}), then the procedure will return cw(z1,qj)cw(z_{1},q_{j}), and thus z1=az_{1}=a. Consequently, following the same proof as above, we can show that cw(a1,a2)cw(a_{1},a_{2}) is still the upper tangent of α(Q1)\alpha(Q_{1}) and α(Q2)\alpha(Q_{2}). The proves the lemma statement (1).

Next we prove the lemma statement (2).

Assume z1β[a2,b2]z_{1}\not\in\beta[a_{2},b_{2}]. Consider the counterclockwise scanning procedure on α(Q2)\alpha(Q^{\prime}_{2}) for searching cw(z1,qj)cw(z_{1},q_{j}) and the counterclockwise scanning procedure on α(Q)\alpha(Q^{\prime}) for searching cw(a,qj)cw(a,q_{j}). As the rightmost vertex vv of α(Q)\alpha(Q^{\prime}) is also the rightmost vertex of α(Q2)\alpha(Q_{2}^{\prime}), the two procedures both start from vv. Further, since vβ[a2,b2]v\in\beta[a_{2},b_{2}] and z1β[a2,b2]z_{1}\not\in\beta[a_{2},b_{2}], the counterclockwise scanning procedure on α(Q2)\alpha(Q^{\prime}_{2}) for cw(z1,qj)cw(z_{1},q_{j}) will process vertices of β[a2,b2]\beta[a_{2},b_{2}] counterclockwise from vv to a2a_{2}, after which the counterclockwise neighbor of a2a_{2} on α(Q2)\alpha(Q_{2}^{\prime}) will be processed. This means that the counterclockwise scanning procedure on α(Q)\alpha(Q^{\prime}) for cw(a,qj)cw(a,q_{j}) will also process vertices of β[a2,b2]\beta[a_{2},b_{2}] counterclockwise from vv to a2a_{2}, after which the counterclockwise neighbor of a2a_{2} on α(Q)\alpha(Q^{\prime}) will be processed, which is a1a_{1}. We claim that aa is not in Q2Q_{2}, since otherwise by the similar analysis as above the Q2Q_{2}-dominating case would happen, incurring contradiction. Hence, aa is a vertex on α(Q1)\alpha(Q_{1}). As cw(a,qj)cw(a,q_{j}) is the upper tangent of from qjq_{j} to α(Q)\alpha(Q^{\prime}), D(cw(a,qj))D(cw(a,q_{j})) contains QQ^{\prime} and thus Q1Q_{1}. Hence, D(cw(a,qj))D(cw(a,q_{j})) is tangent to α(Q1)\alpha(Q_{1}) at aa, and thus cw(a,qj)cw(a,q_{j}) is an upper tangent from qjq_{j} to α(Q1)\alpha(Q_{1}). On the other hand, since D(cw(a,qj))D(cw(a,q_{j})) contains QQ^{\prime} and also qjq_{j}, cw(a,qj)cw(a,q_{j}) is an arc of α(Q)\alpha(Q). Since aQ1a\in Q_{1} and qjQ2q_{j}\in Q_{2}, cw(a,qj)cw(a,q_{j}) is the upper common tangent of α(Q1)\alpha(Q_{1}) and α(Q2)\alpha(Q_{2}).

We next discuss the case where z1=a2z_{1}=a_{2} and cw(a1,a2)cw(a_{1},a_{2}) and qjq_{j} form an outer turn. As above, we consider the two counterclockwise scanning procedures. Since z1=a2z_{1}=a_{2}, the two procedures will both process vertices on β[a2,b2]\beta[a_{2},b_{2}] from vv until a2a_{2}. As cw(a1,a2)cw(a_{1},a_{2}) and qjq_{j} form an outer turn, according to our counterclockwise searching procedure on α(Q)\alpha(Q^{\prime}) for cw(a,qj)cw(a,q_{j}), when we process a2a_{2}, we need to further check whether the two neighbors of a2a_{2} in α(Q)\alpha(Q^{\prime}) are both in α(a2,qj)\alpha(a_{2},q_{j}). We claim that this is not true. Indeed, assume to the contrary that this is true. Then, we obtain that α(a2,qj)=α(Q)\alpha(a_{2},q_{j})=\alpha(Q). But this means that the Q2Q_{2}-dominating case happens since both a2a_{2} and qjq_{j} are in Q2Q_{2}, incurring contradiction. Because the two neighbors of a2a_{2} in α(Q)\alpha(Q^{\prime}) are not both in α(a2,qj)\alpha(a_{2},q_{j}), according to our counterclockwise searching procedure, we will proceed on processing the counterclockwise neighbor of a2a_{2} on α(Q)\alpha(Q^{\prime}), which is a1a_{1}. Then, following the same analysis as the above case, we can show that cw(a,qj)cw(a,q_{j}) is the upper tangent from qjq_{j} to α(Q1)\alpha(Q_{1}) and also the upper common tangent of α(Q1)\alpha(Q_{1}) and α(Q2)\alpha(Q_{2}).

It remains to show that aα(Q1)(a1,b1)¯a\in\overline{\partial_{\alpha(Q_{1})}(a_{1},b_{1})}. Since cw(a,qj)cw(a,q_{j}) is the upper tangent from qjq_{j} to α(Q)\alpha(Q^{\prime}) and also the upper tangent from qjq_{j} to α(Q1)\alpha(Q_{1}), aa must be a vertex of both α(Q)\alpha(Q^{\prime}) and α(Q1)\alpha(Q_{1}). Because α(Q1)(a1,b1)¯\overline{\partial_{\alpha(Q_{1})}(a_{1},b_{1})} consists of all points that are vertices of both α(Q)\alpha(Q^{\prime}) and α(Q1)\alpha(Q_{1}), it must contain aa. This proves the lemma statement (2) ∎

In light of Lemma 11, our algorithm works as follows. We first check whether qjq_{j} is in the supporting circle of the rightmost arc of α(Q)\alpha(Q^{\prime}). By Lemma 10, this can be done in constant time. If yes, then cw(a1,a2)cw(a_{1},a_{2}) and ccw(b1,b2)ccw(b_{1},b_{2}) are still the common tangents of α(Q1)\alpha(Q_{1}) and α(Q2)\alpha(Q_{2}), and we are done with the insertion. In the following, we assume otherwise. Depending on whether z1z_{1} satisfies the condition in Lemma 11(1) or Lemma 11(2), and whether z2z_{2} satisfies the condition in Lemma 11(3) or Lemma 11(4), there are four cases.

If z1z_{1} satisfies Lemma 11(1) and z2z_{2} satisfies Lemma 11(3), then cw(a1,a2)cw(a_{1},a_{2}) and ccw(b1,b2)ccw(b_{1},b_{2}) are still the common tangents of α(Q1)\alpha(Q_{1}) and α(Q2)\alpha(Q_{2}) . So α(Q)\alpha(Q) exists and we are done with the insertion.

If z1z_{1} satisfies Lemma 11(2) and z2z_{2} satisfies Lemma 11(3), then ccw(b1,b2)ccw(b_{1},b_{2}) is still the lower common tangent but cw(a1,a2)cw(a_{1},a_{2}) is not the upper common tangent any more. This also implies that α(Q)\alpha(Q) exists. Next, we find the new upper common tangent, as follows. We apply the counterclockwise scanning procedure on α(Q1)\alpha(Q_{1}) as in the static algorithm, but it is sufficient for the scanning procedure to start from a1a_{1} (as discussed in the proof of Lemma 11). As the upper common tangent exists, this procedure will find it. We call the procedure the insertion-type upper common tangent searching procedure. The running time of the procedure is O(1+k)O(1+k), where kk is the number of vertices of α(Q1)\alpha(Q_{1}) counterclockwise strictly from a1a_{1} to the new upper tangent point (we say that these vertices are involved in the procedure). By the following lemma, the amortized cost of the procedure is O(1)O(1).

Lemma 12

Each point of LRL\cup R can involve in the insertion-type upper common tangent searching procedure at most once in the entire algorithm.

Proof

Let vv be a point involved in the procedure, which is a vertex of α(Q1)\alpha(Q_{1}). Let v1v_{1} and v2v_{2} be vv’s counterclockwise and clockwise neighbors on α(Q1)\alpha(Q_{1}), respectively. According to our counterclockwise scanning procedure, cw(v,v2)cw(v,v_{2}) and qjq_{j} form an outer turn, and thus the disk D(cw(v,v2))D(cw(v,v_{2})) does not contain qjq_{j}, and similarly, cw(v1,v)cw(v_{1},v) and qjq_{j} form an outer turn and D(cw(v1,v))D(cw(v_{1},v)) does not contain qjq_{j}.

We claim that at least one of v1v_{1} and v2v_{2} are to the right of vv. To prove the claim, it is sufficient to show that vv is not the rightmost vertex of α(Q1)\alpha(Q_{1}). Indeed, since vv is involved in the procedure, vv is in α(Q1)[a1,b1]¯\overline{\partial_{\alpha(Q_{1})}[a_{1},b_{1}]}. By Observation 7(3), the rightmost vertex of α(Q1)\alpha(Q_{1}) is in α(Q1)[a1,b1]{\partial_{\alpha(Q_{1})}[a_{1},b_{1}]}. Therefore, vv is not the rightmost vertex of α(Q1)\alpha(Q_{1}). The claim is thus proved. Without loss of generality, we assume that v2v_{2} is to the right of vv.

We argue that vv will not be involved in the same procedure again in future. Assume to the contrary that vv is involved in the same procedure again during another insertion of qkq_{k}, with k>jk>j. Let Q1′′Q^{\prime\prime}_{1}, Q2′′Q^{\prime\prime}_{2}, and Q′′Q^{\prime\prime} refer to the corresponding sets right before the insertion. Since vv is involved in the procedure, vv has not been deleted and thus is in Q1′′Q^{\prime\prime}_{1}. Since v2v_{2} is to the right of vv, v2v_{2} has also not been deleted and thus is in Q1′′Q^{\prime\prime}_{1} as well. As cw(v,v2)cw(v,v_{2}) is an arc of α(Q1)\alpha(Q_{1}) and Q1′′Q1Q_{1}^{\prime\prime}\subseteq Q_{1}, cw(v,v2)cw(v,v_{2}) is also an arc of α(Q1′′)\alpha(Q_{1}^{\prime\prime}).

Let a1′′a_{1}^{\prime\prime} (resp., b1′′b_{1}^{\prime\prime}) be the tangent point on α(Q1′′)\alpha(Q_{1}^{\prime\prime}) of the upper (resp., lower) common tangent of α(Q1′′)\alpha(Q_{1}^{\prime\prime}) and α(Q2′′)\alpha(Q_{2}^{\prime\prime}). Since vv is involved in the procedure for inserting qkq_{k}, vv must be a vertex of α(Q1′′)\alpha(Q^{\prime\prime}_{1}) in α(Q1′′)[a1′′,b1′′]¯\overline{\partial_{\alpha(Q_{1}^{\prime\prime})}[a^{\prime\prime}_{1},b^{\prime\prime}_{1}]}. As cw(v,v2)cw(v,v_{2}) is an arc of α(Q1′′)\alpha(Q^{\prime\prime}_{1}) and vα(Q1′′)[a1′′,b1′′]¯v\in\overline{\partial_{\alpha(Q_{1}^{\prime\prime})}[a^{\prime\prime}_{1},b^{\prime\prime}_{1}]}, cw(v,v2)cw(v,v_{2}) must be an arc of α(Q′′)\alpha(Q^{\prime\prime}) and thus the disk D(cw(v,v2))D(cw(v,v_{2})) must cover Q′′Q^{\prime\prime}. Hence, D(cw(v,v2))D(cw(v,v_{2})) covers Q2′′Q_{2}^{\prime\prime}. Notice that qjq_{j} is in Q2′′Q_{2}^{\prime\prime}, for j<kj<k. Therefore, qjq_{j} is contained in D(cw(v,v2))D(cw(v,v_{2})). But we have obtained above that D(cw(v,v2))D(cw(v,v_{2})) does not contain qjq_{j}. Hence, we obtain contradiction. ∎

If z1z_{1} satisfies Lemma 11(1) and z2z_{2} satisfies Lemma 11(4), then cw(a1,a2)cw(a_{1},a_{2}) is still the upper common tangent but ccw(b1,b2)ccw(b_{1},b_{2}) is not the lower common tangent any more. This is a symmetric case to the above case, and we can apply the clockwise scanning procedure on α(Q1)\alpha(Q_{1}) (starting from b1b_{1}) to find the new lower common tangent. We call this the insertion-type lower common tangent searching procedure, which takes O(1)O(1) amortized time by a similar analysis as Lemma 12.

If z1z_{1} satisfies Lemma 11(2) and z2z_{2} satisfies Lemma 11(4), e.g., see Fig. 15, then neither cw(a1,a2)cw(a_{1},a_{2}) nor ccw(b1,b2)ccw(b_{1},b_{2}) is a common tangent any more. Indeed, this is the most challenging case. One reason is that we do not know whether α(Q)\alpha(Q) exists. Therefore, our algorithm needs to determine whether α(Q)\alpha(Q) exists, and if yes, find the new common tangents, which are the tangents from qjq_{j} to α(Q1)\alpha(Q_{1}) by Lemma 11. Further, if α(Q)\alpha(Q) does not exist, then our algorithm will find a special vertex pp^{*} on α(Q1)\alpha(Q_{1}) such that there is no unit disk that can cover Q2Q_{2} and the points of Q1Q_{1} to the right of pp^{*} including pp^{*}. As such, before pp^{*} is deleted, α(Q)\alpha(Q) always does not exist (but α(Q)\alpha(Q) may still not exist even after pp^{*} is deleted). The following lemma will be useful later.

Lemma 13

Assume that α(Q)\alpha(Q) does not exist. If PP is a subset of Q1Q_{1} such that α(PQ2)\alpha(P\cup Q_{2}) exists, then there is a unit disk tangent to α(Q2)\alpha(Q_{2}) at qjq_{j} that contains all points of PQ2P\cup Q_{2}.

Proof

If qjq_{j} is a vertex of α(PQ2)\alpha(P\cup Q_{2}), then by Observation 1(1) there is a disk DD with qjq_{j} on its boundary and covering PQ2P\cup Q_{2}. Since DD covers Q2Q_{2} and has qjq_{j} on its boundary, DD is tangent to α(Q2)\alpha(Q_{2}) at qjq_{j}. This proves the lemma. Below we show that the case where qjq_{j} is not a vertex of α(PQ2)\alpha(P\cup Q_{2}) cannot happen.

Assume to the contrary qjq_{j} is not a vertex of α(PQ2)\alpha(P\cup Q_{2}). Then qjq_{j} is in the interior of α(PQ2)\alpha(P\cup Q_{2}). Thus, removing qjq_{j} from Q2Q_{2} will not affect α(PQ2)\alpha(P\cup Q_{2}), i.e., α(PQ2)=α(PQ2)\alpha(P\cup Q_{2}^{\prime})=\alpha(P\cup Q_{2}), where Q2=Q2{qj}Q_{2}^{\prime}=Q_{2}\setminus\{q_{j}\}. Recall that by our algorithm invariant Observation 8(2), α(Q1Q2)\alpha(Q_{1}\cup Q_{2}^{\prime}) exists. Since PQ1P\subseteq Q_{1}, α(PQ2)α(Q1Q2)\alpha(P\cup Q_{2}^{\prime})\subseteq\alpha(Q_{1}\cup Q_{2}^{\prime}). Since qjq_{j} is in the interior of α(PQ2)\alpha(P\cup Q_{2}^{\prime}), qjq_{j} must be in the interior of α(Q1Q2)\alpha(Q_{1}\cup Q_{2}^{\prime}), and thus α(Q1Q2)=α(Q1Q2{qj})\alpha(Q_{1}\cup Q_{2}^{\prime})=\alpha(Q_{1}\cup Q_{2}^{\prime}\cup\{q_{j}\}). But this implies that α(Q)\alpha(Q) exists as Q=Q1Q2{qj}Q=Q_{1}\cup Q_{2}^{\prime}\cup\{q_{j}\}, which contradicts with the fact that α(Q)\alpha(Q) does not exist. ∎

We next elaborate on the algorithm. It is possible that a1a_{1} is not in the upper hull or b1b_{1} is not in the lower hull of α(Q1)\alpha(Q_{1}). We first consider the case where a1a_{1} is in the upper hull and b1b_{1} is in the lower hull; other cases can be handled in a similar (and easier) way and will be discussed later.

Refer to caption
Figure 15: Illustrating the case where z1z_{1} satisfies Lemma 11(2) and z2z_{2} satisfies Lemma 11(4). The two new tangents cw(a,qj)cw(a,q_{j}) and ccw(b,qj)ccw(b,q_{j}) are also shown, with b=b1b=b_{1}.

If α(Q)\alpha(Q) exists, then as those previous cases, we could find the upper tangent from qjq_{j} to α(Q1)\alpha(Q_{1}) by a counterclockwise scanning procedure on α(Q1)\alpha(Q_{1}), starting from a1a_{1}, and similarly, find the lower tangent from qjq_{j} to α(Q1)\alpha(Q_{1}) by a clockwise scanning procedure on α(Q1)\alpha(Q_{1}), starting from b1b_{1}. The two procedures could run independently. However, since we do not know whether α(Q)\alpha(Q) exists and in the case where α(Q)\alpha(Q) does not exist we need to find a particular vertex pp^{*}, we will coordinate the two scanning procedures by processing vertices in order of decreasing xx-coordinate. Specifically, starting from pa=a1p_{a}=a_{1}, we will process pap_{a} and scan α(Q1)\alpha(Q_{1}) counterclockwise, and simultaneously, starting from pb=b1p_{b}=b_{1}, we will process pbp_{b} and scan α(Q1)\alpha(Q_{1}) clockwise, in the same way as the static algorithm. We coordinate the two scanning procedures by the following rule: if pap_{a} is to the right of pbp_{b}, then we process pap_{a} first; otherwise we process pbp_{b} first. In addition, our algorithm maintains the following invariant: There is a unit disk with qjq_{j} on the boundary covering both z2z_{2} and cw(pa)cw(p_{a}), and there is a unit disk with qjq_{j} on the boundary covering both z1z_{1} and ccw(pb)ccw(p_{b}). For the purpose of describing our algorithm, we temporarily set cw(a1)cw(a_{1}) to a2a_{2} and set ccw(b1)ccw(b_{1}) to b2b_{2}222One could consider that we are working on α(Q)\alpha(Q^{\prime}), and thus cw(a1)cw(a_{1}) is indeed a2a_{2} and ccw(b1)ccw(b_{1}) is indeed b2b_{2}.. The above invariant holds initially when pa=a1p_{a}=a_{1} and pb=b1p_{b}=b_{1}, because cw(pa)=a2Q2D(cw(qj,z2))cw(p_{a})=a_{2}\in Q_{2}\subseteq D(cw(q_{j},z_{2})) and ccw(pb)=b2Q2D(cw(qj,z1))ccw(p_{b})=b_{2}\in Q_{2}\subseteq D(cw(q_{j},z_{1})).

Without loss of generality, we assume that pap_{a} is to the right of pbp_{b}. So we process pap_{a}, as follows. We first check whether there is a unit disk with qjq_{j} on the boundary covering both pap_{a} and z2z_{2}. If not, then we stop the algorithm and return p=pap^{*}=p_{a}. If yes, we proceed as follows.

We check whether cw(ccw(pa),pa)cw(ccw(p_{a}),p_{a}) and qjq_{j} form an inner turn. If yes, then cw(pa,qj)cw(p_{a},q_{j}) is the upper tangent from qjq_{j} to α(Q1)\alpha(Q_{1}) and thus is the new upper common tangent by Lemma 11. Then, we proceed to find the lower tangent, which is guaranteed to exist, by running the clockwise scanning procedure. If it is an outer turn, then we check whether α(pa,qj)\alpha(p_{a},q_{j}) contains cw(pa)cw(p_{a}) and ccw(pa)ccw(p_{a}). If yes, then we return cw(pa,qj)cw(p_{a},q_{j}) as the upper common tangent and also return ccw(pa,qj)ccw(p_{a},q_{j}) as the lower common tangent. Otherwise, if ccw(pa)ccw(p_{a}) is to the left of pap_{a} (i.e., pap_{a} is not the leftmost vertex of α(Q1)\alpha(Q_{1})), then we set pa=ccw(pa)p_{a}=ccw(p_{a}) and proceed as above; otherwise, we set p=pap^{*}=p_{a} and stop the algorithm.

The above describes our algorithm. For the correctness, in addition to Lemma 11, it is sufficient to show that if the algorithm returns pp^{*}, then pp^{*} is correctly computed, as proved in Lemma 14.

Lemma 14

Suppose the algorithm returns pp^{*}. Then, there is no unit disk that can cover all points of Q2Q_{2} and the points of Q1Q_{1} to the right of pp^{*} including pp^{*}.

Proof

Suppose we are processing a vertex pap_{a}. There are two ways that pp^{*} is returned: (1) when there is no unit disk with qjq_{j} on the boundary covering both pap_{a} and z2z_{2}; (2) when pap_{a} is the leftmost vertex of α(Q1)\alpha(Q_{1}) and we still attempt to set pa=ccw(pa)p_{a}=ccw(p_{a}). In both cases, p=pap^{*}=p_{a}. Our goal is to show that PQ2P\cup Q_{2} is not unit disk coverable, where PP is the subset of points of Q1Q_{1} to the right of pap_{a} including pap_{a}.

In the first case, assume to the contrary that PQ2P\cup Q_{2} are unit disk coverable. Then, by Lemma 13, there is a unit disk with qjq_{j} on the boundary covering PQ2P\cup Q_{2}. Thus, we obtain contradiction since paPp_{a}\in P and z2Q2z_{2}\in Q_{2}.

In the second case, we have P=Q1P=Q_{1} and Q=PQ2Q=P\cup Q_{2}. So it suffices to show that α(Q)\alpha(Q) does not exist. Assume to the contrary that α(Q)\alpha(Q) exists. By Lemma 11, the tangents from qjq_{j} to α(Q1)\alpha(Q_{1}) are the tangents from qjq_{j} to α(Q)\alpha(Q^{\prime}), and aα(Q1)(a1,b1)¯a\in\overline{\partial_{\alpha(Q_{1})}(a_{1},b_{1})}. According to our algorithm, aa cannot be a vertex of α(Q1)\alpha(Q_{1}) counterclockwise from a1a_{1} to pap_{a}. Thus, aa is a vertex of α(Q1)\alpha(Q_{1}) counterclockwise from ccw(pa)ccw(p_{a}) to b1b_{1}. Further, aa must be a vertex α(Q1)\alpha(Q_{1}) counterclockwise from a1a_{1} to bb. On the other hand, since pap_{a} is the leftmost vertex of α(Q1)\alpha(Q_{1}) and pap_{a} is currently being processed, it must be the case that pb=pap_{b}=p_{a} and vv has already been processed, where v=ccw(pb)v=ccw(p_{b}). This means that bb cannot be a vertex of α(Q1)\alpha(Q_{1}) counterclockwise from vv to b1b_{1}, and thus bb must be a vertex of α(Q1)\alpha(Q_{1}) counterclockwise from a1a_{1} to pap_{a}. Since aa is a vertex α(Q1)\alpha(Q_{1}) counterclockwise from a1a_{1} to bb, we obtain that aa must be a vertex of α(Q1)\alpha(Q_{1}) counterclockwise from a1a_{1} to pap_{a}. But this contradicts with that aa is a vertex of α(Q1)\alpha(Q_{1}) counterclockwise from ccw(pa)ccw(p_{a}) to b1b_{1}. ∎

As in the third case, we also call the above algorithm the insertion-type common tangent points searching procedure, and its runtime is O(1+k)O(1+k) time, where kk is the number the vertices of α(Q1)\alpha(Q_{1}) counterclockwise strictly from a1a_{1} to the final position of pap_{a} when the algorithm stops and the number of vertices α(Q1)\alpha(Q_{1}) clockwise strictly from b1b_{1} to the final position of pbp_{b} when the algorithm stops (we say that those vertices are involved in the procedure). We can use literally the same proof as Lemma 12 to show that each point of LRL\cup R can involve in the procedure at most once in the entire algorithm. In fact, the proof of Lemma 12 shows that each point of LRL\cup R can involve in the insertion-type common tangent points searching procedure in both this case and the above third case at most once in the entire algorithm. Hence, the amortized cost is O(1)O(1).

One of the following cases happens after the above algorithm: (1) the two common tangents of Q1Q_{1} and Q2Q_{2} are found; (2) a vertex pp^{*} (which is either pap_{a} or pbp_{b}) is returned. In the first case, we are done with the insertion, and Observation 8(2) is established. In the second case, α(Q)\alpha(Q) does not exist and we further perform the following processing. Without loss of generality, we assume that p=pap^{*}=p_{a}. According to our algorithm, pbp_{b} is either pap_{a} or to the left of pap_{a}, and ccw(pb)ccw(p_{b}) must be to the right of pbp_{b} because it was processed before pap_{a}.

We perform deletions to delete points from Q1Q_{1} in order from left to right until pap_{a}. By the definition of pp^{*}, after each deletion except the last deletion of pap_{a}, α(Q)\alpha(Q) does not exist. Note that these deletions actually have not been invoked yet, so we perform them ahead of time in the sense that when they are actually invoked in future we know that α(Q)\alpha(Q) does not exist.

To process these deletions efficiently, the key idea is that we process the deletions by pretending qjq_{j} has not been inserted yet, or equivalently, we process the deletions with respect to Q2Q_{2}^{\prime}. Because α(Q)\alpha(Q^{\prime}) exists before any deletion, we know that it still exists after each deletion. After all these deletions are completed, we will insert qjq_{j} again (by “resuming” our previous work on processing the insertion; see below for the details). This is the reason we temporarily kept the circular hull α(Q2)\alpha(Q_{2}^{\prime}) unaltered before.

We again assume that the Q2Q_{2}-dominating case does not happen (with respect to Q2Q_{2}^{\prime}) after each deletion, which can be determined by our Q2Q_{2}-dominating case detection procedure by changing jj^{*} back to its value before qjq_{j} was inserted. Note that we also need to store the current value jj^{*} in another variable so that when we resume processing the insertion of qjq_{j} again (which will be discuss below) we simply reset jj^{*} to that value, which only introduces a constant time.

For each deletion, we update the common tangents of α(Q1)\alpha(Q_{1}) and α(Q2)\alpha(Q_{2}^{\prime}) by using the algorithm in Section 6.5. Once pap_{a} is deleted, we insert qjq_{j} again by “resuming” our previous work of the insertion of qjq_{j}, as follows. Let Q1Q_{1}^{\prime} refer to the set of Q1Q_{1} after pap_{a} is deleted. Let cw(a1,a2)cw(a_{1}^{\prime},a_{2}^{\prime}) and ccw(b1,b2)ccw(b_{1}^{\prime},b_{2}^{\prime}) be the common tangents of α(Q1)\alpha(Q_{1}^{\prime}) and α(Q2)\alpha(Q_{2}^{\prime}). Let β(a2,b2)\beta(a^{\prime}_{2},b^{\prime}_{2}) denote the set of vertices α(Q2)\alpha(Q_{2}^{\prime}) clockwise from a2a_{2}^{\prime} to b2b_{2}^{\prime} excluding a2a_{2}^{\prime} and b2b_{2}^{\prime}, and β(a2,b2)=\beta(a_{2}^{\prime},b_{2}^{\prime})=\emptyset if a2=b2a_{2}^{\prime}=b_{2}^{\prime}. Let β[a2,b2]=β(a2,b2){a2,b2}\beta[a_{2}^{\prime},b_{2}^{\prime}]=\beta(a_{2}^{\prime},b_{2}^{\prime})\cup\{a_{2}^{\prime},b_{2}^{\prime}\}. Recall that pap_{a} and pbp_{b} refer to the vertices of α(Q1)\alpha(Q_{1}) when our earlier algorithm for processing the insertion of qjq_{j} stops (and returns pp^{*}). Depending on whether pa=a1p_{a}=a_{1} and whether pb=b1p_{b}=b_{1}, there are four cases.

  • If paa1p_{a}\neq a_{1} and pbb1p_{b}\neq b_{1}, then cw(pa)cw(p_{a}) is to the left of or at a1a_{1} and ccw(pb)ccw(p_{b}) is to the left of or at b1b_{1}. In this case, cw(a1,a2)cw(a_{1},a_{2}) and ccw(b1,b2)ccw(b_{1},b_{2}) are still the common tangents of α(Q1)\alpha(Q^{\prime}_{1}) and α(Q2)\alpha(Q_{2}^{\prime}), i.e., cw(a1,a2)=cw(a1,a2)cw(a_{1},a_{2})=cw(a^{\prime}_{1},a^{\prime}_{2}) and cw(b1,b2)=cw(b1,b2)cw(b_{1},b_{2})=cw(b^{\prime}_{1},b^{\prime}_{2}). So β(a2,b2)=β(a2,b2)\beta(a_{2}^{\prime},b_{2}^{\prime})=\beta(a_{2},b_{2}). If we apply the same algorithm as before for processing the insertion of qjq_{j}, we are still at the fourth case, i.e., z1z_{1} satisfies Lemma 11(2) and z2z_{2} satisfies Lemma 11(4). But the crux of the idea is that instead of starting over the two scanning procedures from a1a_{1} and b1b_{1}, respectively, we “resume” the previous work by starting the counterclockwise scanning procedure from cw(pa)cw(p_{a}) on α(Q1)\alpha(Q_{1}^{\prime}) and starting the clockwise scanning procedure from ccw(pb)ccw(p_{b}) on α(Q1)\alpha(Q_{1}^{\prime}). In this way, we avoid processing a vertex twice except cw(pa)cw(p_{a}) and ccw(pb)ccw(p_{b}), for which we can charge the time to the deletion of pap_{a}.

  • If pa=a1p_{a}=a_{1} but pbb1p_{b}\neq b_{1}, then ccw(pb)ccw(p_{b}) is to the left of or at b1b_{1} and cw(b1,b2)cw(b_{1},b_{2}) is still the lower common tangent of α(Q1)\alpha(Q^{\prime}_{1}) and α(Q2)\alpha(Q_{2}^{\prime}), i.e., cw(b1,b2)=cw(b1,b2)cw(b_{1},b_{2})=cw(b^{\prime}_{1},b^{\prime}_{2}), but the upper one changes, i.e., cw(a1,a2)cw(a1,a2)cw(a_{1},a_{2})\neq cw(a^{\prime}_{1},a^{\prime}_{2}). Consequently, it is possible that z1z_{1} now satisfies Lemma 11(1), which can be determined when we process the deletion of pap_{a}. We resume the same algorithm as before for the insertion of qjq_{j}, i.e., regardless of which case happens, when we search the lower common tangent point on α(Q1)\alpha(Q_{1}^{\prime}) by running the clockwise scanning procedure, we start from ccw(pb)ccw(p_{b}). However, in the counterclockwise scanning procedure for searching the upper common tangent point, we need to start from the new upper tangent point a1a_{1}^{\prime} because a1a_{1} has been deleted.

  • If paa1p_{a}\neq a_{1} but pb=b1p_{b}=b_{1}, then this is symmetric to the above second case. We start the clockwise scanning procedure from b1b_{1}^{\prime} and start the counterclockwise scanning procedure from cw(pa)cw(p_{a}).

  • If pa=a1p_{a}=a_{1} and pb=b1p_{b}=b_{1}, then both a1a_{1} and b1b_{1} have been deleted since pap_{a} is deleted and pbp_{b} is either pap_{a} or to the left of pap_{a}. Hence, both upper and lower common tangents get changed, i.e., cw(a1,a2)cw(a1,a2)cw(a_{1},a_{2})\neq cw(a^{\prime}_{1},a^{\prime}_{2}) and cw(b1,b2)cw(b1,b2)cw(b_{1},b_{2})\neq cw(b^{\prime}_{1},b^{\prime}_{2}). We start the new algorithm exactly the same as before, i.e., start the two scanning procedures from a1a_{1}^{\prime} and b1b_{1}^{\prime}, respectively.

Other than the time for computing the new common tangents after each deletion (whose amortized time is O(1)O(1) as shown in Section 6.5), the amortized cost of processing the insertion of qjq_{j} is O(1)O(1). After the above processing, if α(Q1Q2)\alpha(Q_{1}^{\prime}\cup Q_{2}) exists, then we are done with the insertion of qjq_{j} (and Observation 8(2) is established). Otherwise, the algorithm will return a new vertex pp^{*} and we will repeat the same algorithm. As more and more points are deleted from Q1Q_{1}^{\prime}, eventually we will encounter a situation where α(Q1Q2)\alpha(Q_{1}^{\prime}\cup Q_{2}) exists since α(Q2)\alpha(Q_{2}) exists (e.g., when all points of Q1Q^{\prime}_{1} are deleted).

Recall that the above algorithm is for the situation where a1a_{1} is on the upper hull and b1b_{1} is on the lower hull of α(Q1)\alpha(Q_{1}). If this is not the case, then a1a_{1} and b1b_{1} are either both on the upper hull or both on the lower hull. Without loss of generality, assume that they are both on the upper hull. Then, we can change the algorithm in the following way. We only perform the counterclockwise scanning procedure on the upper hull, starting from pa=a1p_{a}=a_{1}. The algorithm for processing each vertex is the same as before except the following: if pap_{a} arrives at b1b_{1} and we still want to set pa=ccw(pa)p_{a}=ccw(p_{a}), then we stop the algorithm and return p=pap^{*}=p_{a}. If the procedure finds the new upper common tangent, then the lower common tangent exists and we find it by running the clockwise scanning procedure starting from b1b_{1}. If the procedure returns pp^{*}, then we perform deletions as above until pap_{a}. Note that the lower common tangent must get changed, i.e., cw(b1,b2)cw(b1,b2)cw(b_{1},b_{2})\neq cw(b^{\prime}_{1},b^{\prime}_{2}), because b1b_{1} is to the left of pp^{*} and thus must be deleted. So we run into either the third or the four case as above (i.e., the two cases with pb=b1p_{b}=b_{1}). The correctness is still based on Lemma 11 and a similar proof for Lemma 14. The amortized cost analysis of Lemmas 12 still applies.

6.7 Adapting the Algorithm to the Radially Sorted Case

The above gives our algorithm in the problem setting where points in LRL\cup R are sorted from left to right. We show that we can adapt the algorithm easily to the radially sorted case where points in LRL\cup R are radially sorted around a point oo such that LL and RR are still separated by a line \ell through oo (this is actually our original problem setting on S=S+SS=S^{+}\cup S^{-}).

Without loss of generality, we assume that \ell is vertical, and L={q1,,qn}L=\{q_{1},\ldots,q_{n}\} and R={p1,,pn}R=\{p_{1},\ldots,p_{n}\} are sorted clockwise around oo such that all points of LL are to the left of \ell and all points of RR are to the right of \ell. We first discuss how to update the circular hull of Q2Q_{2} under insertions when Q1=Q_{1}=\emptyset (i.e., extending the static algorithm to the radially sorted case). We still consider the points of RR following their index order. To handle each insertion of qjq_{j}, we still run a counterclockwise scanning procedure to find the upper tangent from qjq_{j} to the current α(Q2)\alpha(Q_{2}) and a clockwise scanning procedure to find the lower tangent. Recall that our previous algorithm starts the two procedure from the rightmost vertex of α(Q2)\alpha(Q_{2}). Here, the difference is that we start the two procedures from the vertex vv, where vv has the largest index among all vertices of α(Q2)\alpha(Q_{2}). This will be consistent with our previous algorithm. Indeed, because the points of RR are right of \ell and radially sorted around oo, all vertices of α(Q2)\alpha(Q_{2}) are on one side of the line ll through oo and vv while qjq_{j} is on the other side of ll. Based on Observation 6(4), searching the two tangents from vv will be successful, and we can use the similar analysis to prove the correctness of this adapted algorithm. Note that this requires our algorithm to keep track of the vertex of the largest index of α(Q2)\alpha(Q_{2}), which only introduces O(n)O(n) overall time for all points of RR, just like in the previous algorithm where we need to keep track of the rightmost vertex (which is actually also the vertex of the largest index in the previous problem setting where points of RR are sorted from left to right; this means that if we describe the algorithm as maintaining the vertex of α(Q2)\alpha(Q_{2}) with the largest index then the same algorithm works on both problem settings without any change).

Further, exactly the same as before, we maintain the leftmost arc of α(Q2)\alpha(Q_{2}) after each insertion. This is for handling the case where Q1Q_{1}\neq\emptyset. We still need the leftmost arc because Q1Q_{1} and Q2Q_{2} are still separated by a vertical line, in the same way as before, so we can use the same method as before to handle the interactions between α(Q1)\alpha(Q_{1}) and α(Q2)\alpha(Q_{2}), such as computing their common tangents, determining dominating cases, etc. For example, when the common tangents of α(Q1)\alpha(Q_{1}) and α(Q2)\alpha(Q_{2}) exist, after qjq_{j} is inserted, we need to update the common tangents. To this end, we first compute the two tangent points z1z_{1} and z2z_{2} from qjq_{j} to α(Q2)\alpha(Q_{2}) in the way described above, and then we follow exactly the same algorithm as before, i.e.,, there are four cases depending the locations of z1z_{1} and z2z_{2} with respect to Lemma 11.

For computing α(Q1)\alpha(Q_{1}) initially when Q1=LQ_{1}=L, we consider the points of LL in the inverse index order, in a similar way as the above for RR, but now we also need to associate stacks with vertices as in the previous algorithm. The rest of the algorithm follows the same as before.

In summary, we can solve the dynamic circular hull problem on S=S+SS=S^{+}\cup S^{-} in O(n)O(n) time, and thus Theorem 3.1 is proved.

7 Computing Common Tangents of Two Circular Hulls in O(logn)O(\log n) Time

In this section, we prove Lemma 1. Without loss of generality, let |L|=|R|=n|L|=|R|=n and assume that LL and RR are separated by a vertical line \ell with LL on the left side. Let α1\alpha_{1} and α2\alpha_{2} denote the circular hulls of LL and RR, respectively. Also, we assume that the vertices of α1\alpha_{1} in counterclockwise order starting from the rightmost vertex c1c_{1} of α1\alpha_{1} are stored in a balanced binary search tree T1T_{1}, and each vertex of α1\alpha_{1} is associated with its two neighbors (so that given a node of T1T_{1} storing a vertex vv of α1\alpha_{1} we can access cw(v)cw(v) and ccw(v)ccw(v) in O(1)O(1) time). Similarly, vertices of α2\alpha_{2} in clockwise order starting from the leftmost vertex c2c_{2} of α2\alpha_{2} are stored in another balanced binary search tree T2T_{2}.

In the following, we present an O(logn)O(\log n) time algorithm for Lemma 1, i.e., determine whether α(LR)\alpha(L\cup R) exists; if yes, then determine whether the LL-dominating case or the RR-dominating case happens; if neither dominating case happens, then compute the two common tangents of α1\alpha_{1} and α2\alpha_{2}. Our algorithm is similar in spirit to the binary search algorithm given by Overmars and van Leeuwen [25] for finding common tangents of two convex hulls separated by a line, but the technical crux is in finding the criteria on which the binary search is based.

7.1 A Special Case

We first consider a special case where RR has only one point qq, but LL has nn vertices. We first check whether the LL-dominating case happens, by checking whether qq is in the supporting disk of the rightmost arc of α1\alpha_{1}. Using T1T_{1}, the rightmost arc can be found in O(logn)O(\log n) time. In the following, we assume that qq is outside the disk. Next, we will determine whether α(L{q})\alpha(L\cup\{q\}) exists, and if yes, find the two tangents from qq to α1\alpha_{1}. To this end, we first assume that the tangents exist and give an algorithm to find them. Later we will show that the algorithm can be slightly modified to determine whether the tangents exist (i.e., whether α(L{q})\alpha(L\cup\{q\}) exists).

We only show how to find the upper tangent point aa, and the lower tangent point can be found in a similar way. If we order the vertices of α1\alpha_{1} counterclockwise starting from c1c_{1} as a sequence 1\mathcal{L}_{1}, then we partition the sequence into three subsequences: A,B,CA,B,C, defined as follows. If c1ac_{1}\neq a, then AA consists of all vertices from c1c_{1} to cw(a)cw(a); otherwise A=A=\emptyset. B={a}B=\{a\}. CC consists of the rest of vertices. By Observation 2, a vertex vv of α1\alpha_{1} is aa if and only if D(cw(v,q))D(cw(v,q)) contains both cw(v)cw(v) and ccw(v)ccw(v). Lemma 15 provides a criteria on which our binary search algorithm is based to find aa.

Lemma 15

Assume that ac1a\neq c_{1}. Consider a vertex vACv\in A\cup C. If v=c1v=c_{1}, then vAv\in A. Otherwise, vv is in AA if and only if the four vertices cw(v),v,c1,ccw(c1)cw(v),v,c_{1},ccw(c_{1}) are all in D(cw(v,q))D(cw(v,q)) or all in D(cw(c1,q))D(cw(c_{1},q)).

Proof

If v=c1v=c_{1}, then since c1ac_{1}\neq a and c1c_{1} is the first vertex of 1\mathcal{L}_{1}, vv must be in AA.

Assume that vv is in A{c1}A\setminus\{c_{1}\}. We show that the four points cw(v),v,c1,ccw(c1)cw(v),v,c_{1},ccw(c_{1}) are all in D(cw(v,q))D(cw(v,q)) or all in D(cw(c1,q))D(cw(c_{1},q)).

We first give an observation: for any subsequence FF of 1\mathcal{L}_{1}, FF is the cyclic sequence of all vertices on the circular hull α(F)\alpha(F) of FF. To see this, let ww be an arc of α1\alpha_{1} connecting two adjacent vertices of FF. Then D(w)D(w) contains all vertices of α1\alpha_{1}, and thus it covers FF. Therefore, by Observation 1(2), ww is also an arc of α(F)\alpha(F). Hence, the arc set of α(F)\alpha(F) consists of all arcs of α1\alpha_{1} connecting all pairs of adjacent vertices of FF plus another arc connecting the first vertex and the last vertex of FF.

Let FF be the subsequence of 1\mathcal{L}_{1} from c1c_{1} to vv. By the above observation, FF is the vertex set of α(F)\alpha(F). Recall our counterclockwise scanning procedure for finding aa in our static algorithm in Section 6.2, which starts from c1c_{1}. When a vertex vv^{\prime} is processed, the result only depends on the two neighbors of vv^{\prime}. Hence, if we run our counterclockwise scanning procedure on both α1\alpha_{1} and α(F)\alpha(F), the result of the algorithm after processing a vertex vv^{\prime} is the same for any vF{c1,v}v^{\prime}\in F\setminus\{c_{1},v\}. However, when vv^{\prime} is c1c_{1} or vv, the result of processing vv^{\prime} may be different as one of its neighbors gets changed from α1\alpha_{1} to α(F)\alpha(F). As each vertex of F{c1,v}F\setminus\{c_{1},v\} is not a tangent point from qq to α1\alpha_{1} (because vA{c1}v\in A\setminus\{c_{1}\}), it is not a tangent point from pp to α(F)\alpha(F) either. Hence, the upper tangent point from qq to α(F)\alpha(F) is either c1c_{1} or vv. If it is c1c_{1}, then D(cw(c1,q))D(cw(c_{1},q)) covers FF; otherwise, D(cw(v,q))D(cw(v,q)) covers FF. Notice that all four points cw(v),v,c1,ccw(c1)cw(v),v,c_{1},ccw(c_{1}) are in FF. Thus, either D(cw(c1,q))D(cw(c_{1},q)) or D(cw(v,q))D(cw(v,q)) contains all the four points.

Now assume that vv is in CC. We show that neither D(cw(v,q))D(cw(v,q)) nor D(cw(c1,q))D(cw(c_{1},q)) contains all four points cw(v),v,c1,ccw(c1)cw(v),v,c_{1},ccw(c_{1}), which will prove the lemma.

By the definition of CC, vav\neq a. Let FF be the subsequence of 1\mathcal{L}_{1} from aa to c1c_{1}. According to the above observation, FF is the cyclic sequence of vertices of α(F)\alpha(F). Thus, cw(v)cw(v) and c1c_{1} are the two neighbors of vv in α(F)\alpha(F), and vv and ccw(c1)ccw(c_{1}) are two neighbors of c1c_{1} in α(F)\alpha(F). Assume to the contrary that either D(cw(v,q))D(cw(v,q)) or D(cw(c1,q))D(cw(c_{1},q)) contains all four points cw(v),v,c1,ccw(c1)cw(v),v,c_{1},ccw(c_{1}). We obtain contradiction below for either case.

In the first case (i.e., D(cw(v,q))D(cw(v,q)) contains all four points), since cw(v)cw(v) and c1c_{1} are the two neighbors of vv in α(F)\alpha(F) and both of them are in D(cw(v,q))D(cw(v,q)), D(cw(v,q))D(cw(v,q)) is tangent to α(F)\alpha(F) at vv. Thus, cw(v,q)cw(v,q) is the upper tangent from qq to α(F)\alpha(F). We claim that a=va=v. Indeed, since vCv\in C, FF contains aa by the definition of FF. Because cw(a,q)cw(a,q) is the upper tangent from qq to α1\alpha_{1}, D(cw(a,q))D(cw(a,q)) contains all vertices of α1\alpha_{1} and thus covers FF. Hence, cw(a,q)cw(a,q) is the upper tangent from qq to α(F)\alpha(F) and aa is the tangent point. Thus, it holds that v=av=a. However, this contradicts with that vCv\in C.

In the second case, since vv and ccw(c1)ccw(c_{1}) are the two neighbors of c1c_{1} in α(F)\alpha(F) and both of them are in D(cw(c1,q))D(cw(c_{1},q)), D(cw(c1,q))D(cw(c_{1},q)) is tangent to α(F)\alpha(F) at c1c_{1}. Thus, cw(c1,q)cw(c_{1},q) is the upper tangent from qq to α(F)\alpha(F). Following the same analysis as above, we can show that c1=ac_{1}=a. However, this contradicts with that ac1a\neq c_{1}. ∎

In light of Lemma 15, we can compute aa in O(logn)O(\log n) time using the tree T1T_{1}, as follows. First, we check whether c1c_{1} is aa, which can be done in constant time after c1c_{1} is accessed in O(logn)O(\log n) time from T1T_{1}. If not, let vv be the vertex of α1\alpha_{1} at the root of T1T_{1}. We check whether v=av=a in O(1)O(1) time. If yes, we stop the algorithm. Otherwise, we check whether vAv\in A using Lemma 15. If yes, then we proceed on the right child; otherwise we proceed on the left child. The running time is O(logn)O(\log n), which is the height of T1T_{1}. The lower tangent from qq to α1\alpha_{1} can be found likewise.

The above algorithm finds the tangents if they exist. If we do not know whether they exist, then we slightly change the algorithm as follows. Whenever we check whether a vertex vv is the tangent point, we also check whether vv and qq can be covered by a unit disk. If not, then no tangents exist and we stop the algorithm; otherwise we proceed in the same way as before. But if we reach a leaf vv and vv is still not the tangent point, then no tangents exist. The time of the algorithm is still O(logn)O(\log n).

7.2 The General Case

In the following, we discuss the general case where LL and RR each have nn vertices. Our algorithm begins with checking whether a dominating case happens in the following lemma.

Lemma 16

Whether the LL-dominating case (resp., the RR-dominating case) happens can be determined in O(logn)O(\log n) time.

Proof

We only show how to determine whether the RR-dominating case happens, and the other case is similar. Recall that the RR-dominating case refers to the case where LL is covered by the supporting disk DD of the leftmost arc of α2\alpha_{2}, which is true if and only if all vertices of α1\alpha_{1} are in DD by Observation 1(4). We first check whether the leftmost arc of α2\alpha_{2} is nullnull. If yes, then the case does not happen. Otherwise, we have the disk DD and proceed as follows.

Let vv be the vertex at the root of T1T_{1}. The vertex vv and the rightmost vertex c1c_{1} of α1\alpha_{1} partition the boundary of α1\alpha_{1} into two chains with a roughly equal number of vertices. We check whether both vv and c1c_{1} are in DD. If not, then the RR-dominating case does not happen and we stop the algorithm. Otherwise, by Lemma 4.6 of [18], one of the chains of α1\alpha_{1} partitioned by vv and c1c_{1} is entirely in DD, and that chain can be determined in O(1)O(1) time by knowing the neighbors of vv and c1c_{1}. If the chain counterclockwise from c1c_{1} to vv is in DD, then we go to the right child of vv, i.e., working on the other chain recursively; otherwise, we go to the left child of vv. If we reach a leaf vv, then the RR-dominating case happens if and only if vDv\in D. Clearly, the runtime of the algorithm is O(logn)O(\log n). ∎

In the following, we assume that neither dominating case happens. Our goal is to determine whether α(LR)\alpha(L\cup R) exists, and if yes, compute the two common tangents of α1\alpha_{1} and α2\alpha_{2}. We first show how to find the common tangents by assuming that α(LR)\alpha(L\cup R) exists. We follow the binary search scheme of Overmars and van Leeuwen [25] for convex hulls but resort to the criteria in Lemma 15.

With respect to any vertex qq of α2\alpha_{2}, we define three sets of vertices of α1\alpha_{1}: A,B,CA,B,C in the same way as in Section 7.1. We further partition CC into two subsets: C1C_{1} and C2C_{2} as follows. A vertex vCv\in C is in C1C_{1} if vv is on α1\alpha_{1} counterclockwise from aa to bb, where aa and bb are the upper and lower tangent points from qq to α1\alpha_{1}, respectively. Let C2=CC1C_{2}=C\setminus C_{1}. Note that C1=C_{1}=\emptyset if a=ba=b, for aCa\not\in C. By Observation 2, a vertex vCv\in C is in C1C_{1} if and only if there is a unit disk DD tangent to α1\alpha_{1} at vv containing qq, which can be determined in O(1)O(1) time given the two neighbors of vv. A vertex pp of α1\alpha_{1} is called an EE-vertex with respect to qq if pEp\in E for any E{A,B,C,C1,C2}E\in\{A,B,C,C_{1},C_{2}\}.

Symmetrically, with respect to a vertex pα1p\in\alpha_{1}, we also define EE-vertices of α2\alpha_{2} following the clockwise order from the leftmost vertex c2c_{2} of α2\alpha_{2}, for E{A,B,C,C1,C2}E\in\{A,B,C,C_{1},C_{2}\}. For a pair of vertices (p,q)(p,q) with pα1p\in\alpha_{1} and qα2q\in\alpha_{2}, we say that the pair is an (E,F)(E,F) case if pp is an EE-vertex of α1\alpha_{1} with respect to qq and qq is an FF-vertex of α2\alpha_{2} with respect to pp, with E,F{A,B,C,C1,C2}E,F\in\{A,B,C,C_{1},C_{2}\}.

We describe an algorithm to compute the upper common tangent cw(a1,b1)cw(a_{1},b_{1}) with a1a_{1} and b1b_{1} as the tangent points on α1\alpha_{1} and α2\alpha_{2}, respectively. Suppose pp and qq are vertices at the roots of T1T_{1} and T2T_{2}, respectively. Depending on whether (p,q)(p,q) is an (E,F)(E,F) case, for E,F{A,B,C}E,F\in\{A,B,C\}, there are nine cases (several subcases arise for the case (C,C)(C,C)). We show below that in each case we can disregard half of the remaining vertices of either α1\alpha_{1} or α2\alpha_{2}. Let 1\mathcal{L}_{1} be the list of vertices of α1\alpha_{1} following their order in T1T_{1}, i.e., counterclockwise from c1c_{1}. Let 2\mathcal{L}_{2} be the list of vertices of α2\alpha_{2} following their order in T2T_{2}, i.e., clockwise from c2c_{2}. We discuss the nine cases in order corresponding to those in [25], as follows.

  1. 1.

    Case (B,B)(B,B), which corresponds to Case a. in [25]; e.g., see Fig. 17. In this case, a1=pa_{1}=p and b1=qb_{1}=q. We can stop the algorithm.

    Refer to caption
    Figure 16: Illustrating the case (B,B)(B,B).
    Refer to caption
    Figure 17: Illustrating the case (A,B)(A,B).
  2. 2.

    Case (A,B)(A,B), which corresponds to Case b. in [25] (with the notation pp and qq switched; the same applies below); e.g., see Fig. 17. In this case, the part of 1\mathcal{L}_{1} before pp and the part of 2\mathcal{L}_{2} before qq can be disregarded, i.e., we move pp to its right child and move qq to its right child.

  3. 3.

    Case (C,B)(C,B), which corresponds to Case c. in [25]; e.g., see Fig. 19. In this case, the part of 1\mathcal{L}_{1} after pp and the part of 2\mathcal{L}_{2} before qq can be disregarded, i.e., we move pp to its left child and move qq to its right child.

    Refer to caption
    Figure 18: Illustrating the case (C,B)(C,B).
    Refer to caption
    Figure 19: Illustrating the case (B,A)(B,A).
  4. 4.

    Case (B,A)(B,A), which corresponds to Case d. in [25]; e.g., see Fig. 19. In this case, the part of 1\mathcal{L}_{1} before pp and the part of 2\mathcal{L}_{2} before qq can be disregarded.

  5. 5.

    Case (B,C)(B,C), which corresponds to Case e. in [25]; e.g., see Fig. 21. In this case, the part of 1\mathcal{L}_{1} before pp and the part of 2\mathcal{L}_{2} after qq can be disregarded.

    Refer to caption
    Figure 20: Illustrating the case (B,C)(B,C).
    Refer to caption
    Figure 21: Illustrating the case (A,A)(A,A).
  6. 6.

    Case (A,A)(A,A), which corresponds to Case f. in [25]; e.g., see Fig. 21. In this case, the part of 1\mathcal{L}_{1} before pp and the part of 2\mathcal{L}_{2} before qq can be disregarded.

  7. 7.

    Case (A,C)(A,C), which corresponds to Case g. in [25]; e.g., see Fig. 23. In this case, the part of 1\mathcal{L}_{1} before pp can be disregarded.

    Refer to caption
    Figure 22: Illustrating the case (A,C)(A,C).
    Refer to caption
    Figure 23: Illustrating the case (C,A)(C,A).
  8. 8.

    Case (C,A)(C,A), which corresponds to Case h. in [25]; e.g., see Fig. 23. In this case, the part of 2\mathcal{L}_{2} before qq can be disregarded.

  9. 9.

    Case (C,C)(C,C), which corresponds to Case i. in [25]. In this case, two subcases are further considered in [25]. Here, however, we need more subcases. Depending on whether (p,q)(p,q) is an (E,F)(E,F) case, for E,F{C1,C2}E,F\in\{C_{1},C_{2}\}, there are four subcases.

    1. (a)

      Case (C1,C2)(C_{1},C_{2}); e.g., see Fig. 25. In this case, the part of 2\mathcal{L}_{2} after qq can be disregarded. Indeed, for each vertex qq^{\prime} in that part, qq^{\prime} is in C2C_{2} of 2\mathcal{L}_{2} with respect to pp. By the definition of C2C_{2}, there is no unit disk tangent to α2\alpha_{2} at qq^{\prime} that covers pp (and thus LL). Therefore, qq^{\prime} cannot be the upper common tangent point, and thus can be disregarded.

      Refer to caption
      Figure 24: Illustrating the case (C1,C2)(C_{1},C_{2}). Also shown are the two tangents from pp to α2\alpha_{2} (red dash-dotted arcs) and the two tangents from qq to α1\alpha_{1} (blue dash-dotted arcs).
      Refer to caption
      Figure 25: Illustrating the case (C2,C1)(C_{2},C_{1}).
    2. (b)

      Case (C2,C1)(C_{2},C_{1}); e.g., see Fig. 25. In this case, the part of 1\mathcal{L}_{1} after pp can be disregarded, for the similar reason discussed above.

    3. (c)

      Case (C2,C2)(C_{2},C_{2}). In this case, the part of 1\mathcal{L}_{1} after pp and the part of 2\mathcal{L}_{2} after qq can be disregarded.

    4. (d)

      Case (C1,C1)(C_{1},C_{1}). In this case, we can find a unit disk D1D_{1} that is tangent to α1\alpha_{1} at pp and covers qq and a unit disk D2D_{2} that is tangent to α2\alpha_{2} at qq and covers pp. Clearly, D1D_{1} intersects D2D_{2}, because each of them contains both pp and qq.

      If D1=D2D_{1}=D_{2}, then we claim that ccw(p,q)ccw(p,q) is the lower common tangent. Indeed, since D1=D2D_{1}=D_{2}, D1D_{1} is tangent to α1\alpha_{1} at pp and also tangent to α2\alpha_{2} at qq. Thus, either cw(p,q)cw(p,q) is the upper common tangent or ccw(p,q)ccw(p,q) is the lower common tangent. As we know that pp is a CC-vertex of 1\mathcal{L}_{1} with respect to qq, pp cannot be the upper common tangent point and thus cw(p,q)cw(p,q) cannot be the upper common tangent. Hence, ccw(p,q)ccw(p,q) is the lower common tangent.

      The claim implies that a1a_{1} cannot be after pp in 1\mathcal{L}_{1} and a2a_{2} cannot be after qq in 2\mathcal{L}_{2}. Therefore, in this case, the part of 1\mathcal{L}_{1} after pp and the part of 2\mathcal{L}_{2} after qq can be disregarded.

      If D1D2D_{1}\neq D_{2}, then their boundaries intersect at two points. Let ss be the intersection point such that if we move from pp around D1\partial D_{1} clockwise, we will encounter ss before the other insertion. Depending on whether ss is to the left or right of \ell, there are two subcases, which correspond to the two subcases of Case i. in [25].

      Refer to caption
      Figure 26: Illustrating the case (C1,C1)(C_{1},C_{1}), and the intersection ss is to the left of \ell.
      Refer to caption
      Figure 27: Illustrating the case (C1,C1)(C_{1},C_{1}), and the intersection ss is to the right of \ell
      1. i.

        If ss is to the left of \ell, e.g., see Fig. 27, which corresponds to Case i1.in [25], then the part of 1\mathcal{L}_{1} after pp can be disregarded.

      2. ii.

        If ss is to the right of \ell, e.g., see Fig. 27, which corresponds to Case i2.in [25], then the part of 2\mathcal{L}_{2} after qq can be disregarded.

By Lemma 15, with the two neighbors of pp and the two neighbors of qq, each of the above nine cases can be determined in constant time. For the subcases in Case (C,C)(C,C), recall that given the two neighbors of pp in α1\alpha_{1}, whether pp is a C1C_{1}-vertex with respect to qq can be determined in constant time. Similarly, given the two neighbors of qq in α2\alpha_{2}, whether qq is a C1C_{1}-vertex with respect to pp can also be determined in constant time. Hence, determining all cases and subcases can be done in constant time. Therefore, the upper common tangent can be found in O(logn)O(\log n) time. By a symmetric algorithm, we can compute the lower common tangent in O(logn)O(\log n) time.

The above algorithm is based on the assumption that α(LR)\alpha(L\cup R) exists (and thus the common tangents of α1\alpha_{1} and α2\alpha_{2} exist). If we do not know whether this is true, then we slightly change the algorithm as follows. Suppose we are considering a pair of vertices (p,q)(p,q) as above. Then, we first check whether {p,q}\{p,q\} is unit disk coverable. If not, then α(LR)\alpha(L\cup R) does not exist and we stop the algorithm. Otherwise, we proceed in the same way as before. In addition, if one of pp and qq is a leaf in its tree and the algorithm still wants to go to a child of that leaf, then we know that the common tangents do not exist and we stop the algorithm. The runtime of the algorithm is still O(logn)O(\log n). This proves Lemma 1.

References

  • [1] P.K. Agarwal and J.M. Phillips. An efficient algorithm for 2D Euclidean 2-center with outliers. In Proceedings of the 16th Annual European Symposium on Algorithms (ESA), pages 64–75, 2008.
  • [2] P.K. Agarwal and M. Sharir. Planar geometric location problems. Algorithmica, 11:185–195, 1994.
  • [3] P.K. Agarwal, M. Sharir, and E. Welzl. The discrete 2-center problem. Discrete and Computational Geometry, 20:287–305, 1998.
  • [4] E.M. Arkin, J.M. Díaz-Báñez, F. Hurtado, P. Kumar, J.S.B. Mitchell, B. Palop, P. Pérez-Lantero, M. Saumell, and R.I. Silveira. Bichromatic 2-center of pairs of points. Computational Geometry: Theory and Applications, 48:94–107, 2015.
  • [5] M. Blum, R.W. Floyd, V. Pratt, R.L. Rivest, and R.E. Tarjan. Time bounds for selection. Journal of Computer and System Sciences, 7:448–461, 1973.
  • [6] T.M. Chan. More planar two-center algorithms. Computational Geometry: Theory and Applications, 13:189–198, 1999.
  • [7] T.M. Chan. A simpler linear-time algorithm for intersecting two convex polyhedra in three dimensions. Discrete and Computational Geometry, 56:860–865, 2016.
  • [8] B. Chazelle. An optimal algorithm for intersecting three-dimensional convex polyhedra. SIAM Journal on Computing, 21(4):671–696, 1992.
  • [9] B. Chazelle and J. Matoušek. On linear-time deterministic algorithms for optimization problems in fixed dimension. Journal of Algorithms, 21:579–597, 1996.
  • [10] R. Cole. Slowing down sorting networks to obtain faster sorting algorithms. Journal of the ACM, 34(1):200–208, 1987.
  • [11] D.P. Dobkin and D.G. Kirkpatrick. Determining the separation of preprocessed polyhedra – A unified approach. In Proc. of the 17th International Colloquium on Automata, Languages and Programming, volume 443 of Lecture Notes in Computer Science, pages 400–413. Springer, 1990.
  • [12] J. Driscoll, N. Sarnak, D. Sleator, and R.E. Tarjan. Making data structures persistent. Journal of Computer and System Sciences, 38(1):86–124, 1989.
  • [13] M.E. Dyer. On a multidimensional search technique and its application to the Euclidean one centre problem. SIAM Journal on Computing, 15(3):725–738, 1986.
  • [14] H. Edelsbrunner, D. Kirkpatrick, and R. Seidel. On the shape of a set of points in the plane. IEEE Transactions on Information Theory, 29:551–559, 1983.
  • [15] D. Eppstein. Dynamic three-dimensional linear programming. ORSA Journal on Computing, 4:360–368, 1992.
  • [16] D. Eppstein. Faster construction of planar two-centers. In Proc. of the 8th Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 131–138, 1997.
  • [17] J. Hershberger. A faster algorithm for the two-center decision problem. Information Processing Letters, 1:23–29, 1993.
  • [18] J. Hershberger and S. Suri. Finding tailored partitions. Journal of Algorithms, 3:431–463, 1991.
  • [19] J. Jaromczyk and M. Kowaluk. An efficient algorithm for the Euclidean two-center problem. In Proceedings of the 10th Annual Symposium on Computational Geometry (SoCG), pages 303–311, 1994.
  • [20] M. Katz and M. Sharir. An expander-based approach to geometric optimization. SIAM Journal on Computing, 26(5):1384–1408, 1997.
  • [21] S.K. Kim and C.-S. Shin. Efficient algorithms for two-center problems for a convex polygon. In Proceedings of the 6th International Computing and Combinatorics Conference (COCOON), pages 299–309, 2000.
  • [22] N. Megiddo. Applying parallel computation algorithms in the design of serial algorithms. Journal of the ACM, 30(4):852–865, 1983.
  • [23] N. Megiddo. Linear-time algorithms for linear programming in R3R^{3} and related problems. SIAM Journal on Computing, 12(4):759–776, 1983.
  • [24] N. Megiddo and K.J. Supowit. On the complexity of some common geometric location problems. SIAM Journal on Computing, 13:182–196, 1984.
  • [25] M. Overmars and J. van Leeuwen. Maintenance of configurations in the plane. Journal of Computer System Sciences, 23(2):166–204, 1981.
  • [26] N. Sarnak and R.E. Tarjan. Planar point location using persistent search trees. Communications of the ACM, 29:669–679, 1986.
  • [27] M. Sharir. A near-linear algorithm for the planar 2-center problem. Discrete and Computational Geometry, 18:125–134, 1997.
  • [28] X. Tan and B. Jiang. Simple O(nlog2n)O(n\log^{2}n) algorithms for the planar 2-center problem. In Proceedings of the 23rd International Computing and Combinatorics Conference (COCOON), pages 481–491, 2017.
  • [29] H. Wang and J. Xue. Improved algorithms for the bichromatic two-center problem for pairs of points. In Proceedings of the 16th Algorithms and Data Structures Symposium (WADS), pages 578–591, 2019.

Appendix

We provide a counterexample to show that Tan and Jiang’s algorithm [28] is not correct. We follow the same notation as in [28] without further explanations. The authors first gave an algorithm for the convex position case where SS is in convex position, and then use it to solve the general case. Their algorithm uses binary search that relies on a monotonicity property given in Theorem 1. The argument of the proof does not stand. For example, because r1r_{1}^{*} is adjustable, the authors claim that r1r2r_{1}^{*}\geq r_{2}^{*} due to Lemma 3. But Lemma 3 does not imply that at all. Nevertheless, we provide a counterexample to demonstrate that the monotonicity property claimed in Theorem 1 does not hold.

Refer to caption
Figure 28: Illustrating a counterexample for Theorem 1 in [28].

Refer to Fig. 28. S={s1,a,b,c,s2}S=\{s_{1},a,b,c,s_{2}\}. A circle CC centered at the origin oo contains all five points. s1s_{1} and s2s_{2} are the two intersections of xx-axis and CC. a,b,ca,b,c are all in the interior of CC. Hence, CC is the smallest enclosing circle of SS. By definition, we have s2=s3s_{2}=s_{3}. aa and bb are on a line ll through oo such that aa is in the second quadrant and bb is in the fourth quadrant. ll and yy-axis form a relatively small angle. Both aa and bb are arbitrarily close to the boundary of CC so that any circle enclosing both aa and bb has a radius very close to rr or larger than rr.

For any two points pp and qq, let |pq||pq| denote their Euclidean distance.

We can pick the points a,b,ca,b,c to guarantee the following properties (although we do not provide their exact coordinates, one can verify that the example in Fig. 28 satisfies these properties): (1) |oa|=|ob||oa|=|ob| (and thus |s1b|=|s2a||s_{1}b|=|s_{2}a| and |s2b|=|s1a||s_{2}b|=|s_{1}a|); (2) |s1a|<|s1c|<|s1b|<|bc||s_{1}a|<|s_{1}c|<|s_{1}b|<|bc|; (3) r({s1,a,c})=|s1c|/2r(\{s_{1},a,c\})=|s_{1}c|/2; (4) r({c,s2,b})=|bc|/2r(\{c,s_{2},b\})=|bc|/2; (5) r({a,c,s2})=|as2|/2r(\{a,c,s_{2}\})=|as_{2}|/2.

With the above properties, one can verify that the following holds (again, refer to [28] for the definitions of the notation). r1=max{r({s1,b}),r({a,c,s2})}=max{|s1b|/2,|as2|/2}r_{1}^{*}=\max\{r(\{s_{1},b\}),r(\{a,c,s_{2}\})\}=\max\{|s_{1}b|/2,|as_{2}|/2\}=|s1b|/2|s_{1}b|/2. r2=max{r({s1,a}),r({c,s2,b})}=max{|s1a|/2,|bc|/2}=|bc|/2r_{2}^{*}=\max\{r(\{s_{1},a\}),r(\{c,s_{2},b\})\}=\max\{|s_{1}a|/2,|bc|/2\}=|bc|/2. r3=max{r({s1,a,c}),r({s2,b})}=max{|s1c|/2,|s2b|/2}=|s1c|/2r_{3}^{*}=\max\{r(\{s_{1},a,c\}),r(\{s_{2},b\})\}=\max\{|s_{1}c|/2,|s_{2}b|/2\}=|s_{1}c|/2. Due to that |s1c|<|s1b|<|bc||s_{1}c|<|s_{1}b|<|bc|, we obtain r3<r1<r2r_{3}^{*}<r_{1}^{*}<r_{2}^{*}. Therefore, r=r3r^{*}=r_{3}^{*}, and according to Theorem 1 of [28], r1r2r3r_{1}^{*}\geq r_{2}^{*}\geq r_{3}^{*} should hold, which contradicts with r3<r1<r2r_{3}^{*}<r_{1}^{*}<r_{2}^{*}. Hence, Theorem 1 is not correct.