Abstract 1 Introduction 2 Preliminaries 3 The first algorithm in the primal plane 4 The second algorithm in the dual plane 5 Combining the two algorithms References

An Optimal Algorithm for Computing Many Faces in Line Arrangements

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

Given a set of m points and a set of n lines in the plane, we consider the classical problem of computing the faces of the arrangement of the lines that contain at least one point. We present an algorithm of O(m2/3n2/3+(n+m)logn) time for the problem. We also prove that this matches the lower bound under the algebraic decision tree model and thus our algorithm is optimal. In particular, when m=n, the runtime is O(n4/3), which matches the worst case combinatorial complexity Ω(n4/3) of all output faces. This is the first optimal algorithm since the problem was first studied more than three decades ago [Edelsbrunner, Guibas, and Sharir, SoCG 1988].

Keywords and phrases:
Many faces, line arrangements, cuttings, Γ-algorithms, decision tree complexities
Copyright and License:
[Uncaptioned image] © Haitao Wang; licensed under Creative Commons License CC-BY 4.0
2012 ACM Subject Classification:
Theory of computation Computational geometry
; Theory of computation Design and analysis of algorithms
Related Version:
Full Version: https://arxiv.org/abs/2603.04863
Editors:
Hee-Kap Ahn, Michael Hoffmann, and Amir Nayyeri

1 Introduction

Let P be a set of m points and L a set of n lines in the plane. We consider the problem of computing the faces of the arrangement of the lines of L that contain at least one point of P; these faces are called non-empty faces. Note that each non-empty face only needs to be output once if it contains multiple points of P. Let 𝒜(L) denote the arrangement of L.

Previous work.

This is one of the most fundamental problems in computational geometry and has been studied extensively. A straightforward algorithm can implicitly determine the non-empty faces of 𝒜(L) in O(mlogn+n2) time, by first constructing 𝒜(L), building a point location data structure for 𝒜(L) [15, 21, 25], and then finding the non-empty faces using the point location queries for points of P. The following upper bounds have been proved on the combinatorial complexity of all non-empty faces of 𝒜(L): O(m2/3n2/3+n) [10], O(nm) [17], and O(n+mn) [17]. A lower bound of Ω(m2/3n2/3+n) [17] is also known, which matches the O(m2/3n2/3+n) upper bound in [10]. Note that the minimum of the above upper bounds is at most O(mlogn+n2) regardless of the values of m and n. Hence, using the above straightforward approach, O(mlogn+n2) time is also sufficient to output all non-empty faces explicitly. To have a more efficient algorithm, Edelsbrunner, Guibas, and Sharir [14] first studied the problem and gave a randomized algorithm of O(m2/3δn2/3+2δlogn+nlognlogm) expected time, for any δ>0. Subsequently, an improved deterministic algorithm of O(m2/3n2/3log5/3nlog1.11(m/n)+(m+n)logn) time was proposed by Agarwal [1]. Also, Agarwal, Matoušek, and Schwarzkopf [2] presented a randomized algorithm of O(m2/3n2/3log(n/m)+(m+n)logn) expected time. No progress had been made for a while until Wang [26] revisited the problem in SODA 2022 and derived a new deterministic algorithm of O(m2/3n2/3log2/3(n/m)+(m+n)logn) time.

On the other hand, Ω(m2/3n2/3+nlogn+m) is a lower bound for solving the problem due to the above Ω(m2/3n2/3+n) lower bound [17] on the combinatorial complexity of all non-empty faces and also because computing a single face in line arrangements requires Ω(nlogn) time in the algebraic decision tree model (indeed, a special case of the problem is to compute the lower envelope of all lines, which has an Ω(nlogn) time lower bound). In particular, in the symmetric case where m=n, Ω(n4/3) is a lower bound since the worst case combinatorial complexity of all non-empty faces is Ω(n4/3) [17].

Our result.

We propose a new (deterministic) algorithm of O(m2/3n2/3+(m+n)logn) time for the problem, which is O(n4/3) when m=n and matches the above Ω(n4/3) lower bound. For the asymmetric case where mn, using Ben-Or’s techniques [5], we prove that Ω(mlogn) is also a lower bound under the algebraic decision tree model. Combining with the above Ω(m2/3n2/3+nlogn+m) lower bound, we thus obtain the Ω(m2/3n2/3+(m+n)logn) lower bound for solving the problem. As such, our algorithm for the asymmetric case is also optimal. Although our solution only improves the previously best result of Wang [26] by a factor of log2/3(n/m), the result is important for providing the first optimal solution to a fundamental and classical problem in computational geometry.

Our algorithm takes a different approach than the previous work. For example, the most recent work of Wang [26] first solves the problem in O(nlogn+mnlogn) time in the dual setting. Then, the algorithm is plugged into the framework of Agarwal [1] as a subroutine. More specifically, the framework first utilizes a cutting of L to divide the problem into a collection of subproblems and then solves these subproblems using Wang’s new algorithm.

We dispense with the framework of Agarwal [1], and propose a new algorithm for the problem in the primal setting, which is different from that of Wang [26] in the dual setting. One key subproblem is to merge convex hulls, for which our techniques rely on a crucial observation that certain pairs of convex hull boundaries can intersect at most O(1) times. Using a hierarchical cutting of L [8] and combining our new algorithm with Wang’s, we obtain a recursive algorithm that runs in n4/32O(logn) time for the symmetric case m=n.

To further reduce the 2O(logn) factor, we resort to the recent techniques from Chan and Zheng [7]: the Γ-algorithm framework for bounding algebraic decision tree complexities. More specifically, after O(1) recursive steps in our recursive algorithm, we reduce the problem to O((n/b)4/3) subproblems of size O(b) each (i.e., in each subproblem, we need to compute the non-empty faces of an arrangement of b lines for b points), with b=O(loglogn). As b is very small, solving the problem efficiently under the algebraic decision tree model (i.e., only count the number of comparisons) can lead to an efficient algorithm under the conventional computational model (e.g., the real RAM model). With Chan and Zheng’s techniques, we developed an algorithm that solves each subproblem in O(b4/3) decision tree complexity (i.e., the algorithm uses O(b4/3) comparisons). Since b is small, we are able to build a decision tree for the algorithm in O(n) time. With the decision tree, each subproblem can then be solved in O(b4/3) time in the conventional computation model. Consequently, the original problem is solved in O(n4/3) time. In addition, using this algorithm as a subroutine, the asymmetric case of the problem where mn can be solved in O(m2/3n2/3+(m+n)logn) time.

Note that our algorithm is not a direct application of Chan and Zheng’s techniques. Nor it is a simple adaption of their algorithm for Hopcroft’s problem. Indeed, in order to fit the Γ-algorithm framework, we need to design new procedures for a number of subproblems (notably, our techniques involve shaving log factors to merge convex hulls), which may be interesting in their own right. This is also the case for solving other problems when Chan and Zheng’s techniques are applied. For instance, Chan, Cheng, and Zheng [6] recently used the technique to tackle the higher-order Voronoi diagram problem and presented an optimal algorithm by improving the previous best algorithm by a factor of 2O(logn). To this end, they had to develop new techniques and made a great effort. On the other hand, there are other problems whose current best solutions have 2O(logn) factors, but it is not clear whether the Γ-algorithm techniques [7, 6] can be used to further reduce these factors. For instance, the biclique partition problem for a set of n points in the plane can be solved in n4/32O(logn) time [20, 27]. It has been open whether an O(n4/3) time algorithm is possible.

Related work.

Other related problems have also been studied in the literature, e.g., the segment case where L consists of n line segments. Although faces in an arrangement of lines are convex, they may not even be simply connected in an arrangement of segments. Therefore, the segment case becomes more challenging. It has been proved that the combinatorial complexity of all non-empty faces of the segment arrangement is bounded by O(m2/3n2/3+nα(n)+nlogm) [4] and O(nmα(n)) [13], where α(n) is the inverse Ackermann function; a lower bound Ω(m2/3n2/3+nα(n)) [14] was also known. To compute all non-empty faces, Edelsbrunner, Guibas, and Sharir [14] first gave a randomized algorithm of O(m2/3δn2/3+2δlogn+nα(n)log2nlogm) expected time for any δ>0. Agarwal [1] presented an improved deterministic algorithm of O(m2/3n2/3lognlog2.11(n/m)+nlog3n+mlogn) time. Also, Agarwal, Matoušek, and Schwarzkopf [2] derived a randomized algorithm of O(n2/3m2/3log2n+(nα(n)+nlogm+m)logn) expected time. Wang [26] proposed an O(n2/3m2/3logn+τ(nα2(n)+nlogm+m)logn) time deterministic time, where τ=min{logm,log(n/m)}. An intriguing question is whether our new techniques for the line case can somehow be utilized to tackle the segment case. One obstacle, for example, is that the problem for the segment case in the dual setting is not “cleanly” defined and thus we do not have a corresponding algorithm in the dual setting.

In part because of the difficulty, a special case has been studied extensively, in which we wish to compute a single face in an arrangement of segments. The problem can be solved in O(nα(n)logn) expected time using a randomized algorithm [9], or in O(nα2(n)logn) time using a deterministic algorithm [3]. These algorithms provide improvements over the previous deterministic methods, which required O(nlog2n) time [23] and O(nα(n)log2n) time [14] respectively. An open problem in this field has been whether it is possible to have an O(nα(n)logn) time deterministic algorithm. It is worth noting that computing the upper envelope of all segments can be accomplished more efficiently in O(nlogn) time [19].

The online query problems have also been studied, i.e., preprocess a set of lines or segments so that the face containing a query point can be quickly computed; see, e.g., [12, 18, 26].

Outline.

After introducing notation in Section 2, we present an algorithm in Section 3 that solves the problem in the primal plane. Then, in Section 4, we describe the second algorithm (which is mainly from [26]) that tackles the problem in the dual plane. We combine the two algorithms in Section 5 to obtain our final algorithm. Due to the space limit, many details and proofs are omitted but can be found in the full paper.

2 Preliminaries

We follow the same notation as in Section 1, e.g., L, P, n, m, 𝒜(L). Our goal is to compute all nonempty cells of 𝒜(L). For ease of discussion, we assume that no point of P lies on a line of L. Note that this implies that each point of P is in the interior of a face of 𝒜(L). We also make a general position assumption that no line of L is vertical. These assumptions can be relaxed without difficulty by the standard perturbation techniques [16, 28].

For any point p, denote by Fp(L) the face of the arrangement 𝒜(L) that contains p. For a region R in the plane, we often use P(R) to denote the subset of P in R, i.e., P(R)=PR.

Cuttings.

A tool that will be frequently used in our algorithm is cuttings [8, 22]. For a region R in the plane, we use LR to denote the subset of lines of L that intersect the interior of R (we also say that these lines cross R and LR is the conflict list of R).

A cutting for L is a collection Ξ of closed cells (each of which is a possibly unbounded triangle) with disjoint interiors, which together cover the entire plane [8, 22]. The size of Ξ is defined to be the number of cells in Ξ. For a parameter r with 1rn, a cutting Ξ for L is a (1/r)-cutting if |Lσ|n/r holds for every cell σΞ.

We say that a cutting Ξ c-refines another cutting Ξ if each cell of Ξ is wholly contained within a single cell of Ξ, and if every cell in Ξ encompasses at most c cells from Ξ.

A hierarchical (1/r)-cutting, characterized by constants c and ρ, consists of a series of cuttings Ξ0,Ξ1,,Ξk with the following property. Ξ0 has a single cell that is the entire plane. For each 1ik, Ξi is a (1/ρi)-cutting of size O(ρ2i) that c-refines Ξi1. To make Ξk a (1/r)-cutting, we select k=Θ(logr) to ensure ρk1<rρk. Consequently, the size of Ξk is O(r2). As already shown in [8], it can be easily verified that the total number of cells of all cuttings Ξi, 0ik, is also O(r2), and the total size of the conflict lists Lσ for all cells σ of Ξi, 0ik, is bounded by O(nr). If a cell σ within Ξi1 contains a cell σ in Ξi, we call σ the parent of σ and σ a child of σ. In the following, we often use Ξ to denote the set of all cells of all cuttings Ξi, 0ik.

For any 1rn, a hierarchical (1/r)-cutting of size O(r2) for L (together with the conflict lists Lσ for all cells σ of Ξi for all i=0,1,,k) can be computed in O(nr) time [8].

3 The first algorithm in the primal plane

We present our first algorithm for the problem, which works in the primal plane.

For any subset LL, let 𝒰(L) denote the upper envelope of the lines of L.

Consider a point pP. Our algorithm needs to output the face Fp(L) of 𝒜(L) that contains p. Let L+(p) (resp., L(p)) denote the subset of lines of L that are below (resp., above) p. It is not difficult to see that the face Fp(L) is the common intersection of the region above the upper envelope 𝒰(L+(p)) and the region below the lower envelope of L(p); see Fig. 1. Our algorithm will compute binary search trees of height O(logn) that represent 𝒰(L+(p)) and the lower envelope of L(p), respectively. Using the two trees, Fp(L) can be computed in O(logn) time by computing the two intersections between 𝒰(L+(p)) and 𝒰(L(p)), and Fp(L) can then be output in additional O(|Fp(L)|) time. In what follows, we focus on computing 𝒰(L+(p)) since the lower envelope of L(p) can be treated likewise. In the following discussion, depending on the context, an upper envelope (or lower envelope) may refer to a binary search tree that represents it. For example, the phrase “computing 𝒰(L+(p))” means “computing a binary search tree that represents 𝒰(L+(p))”.

Figure 1: Fp(L): the grey cell; 𝒰(L+(p)): blue segments; lower envelope of L(p): red segments.

We start with computing a hierarchical (1/r)-cutting Ξ0,Ξ1,,Ξk for the lines of L in O(nr) time [8], for a parameter r[1,n] to be determined later. Let Ξ denote the set of all cells σΞi, 0ik. The algorithm also produces the conflict lists Lσ for all cells σΞ. For each cell σΞi, 1ik, we define L^σ as the subset of lines of Lσ that are completely below σ, where σ is the parent of σ (and thus σ is a cell of Ξi1). As Lσ is already available and σ has O(1) children, computing L^σ for all children σ of σ can be done in O(|Lσ|) time by brute force. As such, computing L^σ for all cells σΞ takes O(nr) time.

We wish to maintain a binary search tree to represent the upper envelope 𝒰(L^σ) of L^σ. To compute it in linear time, we need to have lines of L^σ in sorted order by their slopes. If we sort each L^σ individually, the total sorting time for all cells σΞ is O(nrlogn). To reduce the logn factor, we adopt the following strategy. We presort all lines of L in O(nlogn) time. Then, we have the following lemma (see the full paper for the proof).

Lemma 1.

Suppose we have a sorted list of the lines of L by their slopes. Then, L^σ for all cells σΞ can be sorted in O(nr) time.

After each L^σ is sorted, we compute its upper envelope 𝒰(L^σ), which takes O(|L^σ|) time. As such, computing 𝒰(L^σ) for all cells σΞ can be done in O(nr) time.

Next, we compute P(σ), which is defined to be Pσ, for all cells σΞ. This can be done in O(mlogr) time by point locations in a top-down manner in the hierarchical cutting. Specifically, for each point pP, starting from Ξ0, which comprises a single cell that is the entire plane, suppose the cell σ of Ξi containing p is known; then since σ has O(1) cells, locating the cell of Ξi+1 containing p can be done in O(1) time. As such, performing point locations for p takes O(logr) time. Note that σΞ|Pσ|=O(mlogr) as every point of P is stored in a single cell of Ξi for each 0ik.

For each cell σΞi, 0ik+1, define L+(σ) as the subset of the lines of L completely below σ. We have the following lemma (see the full paper for the proof).

Lemma 2.

For each cell σΞ, suppose σ is the parent of σ. Then, L+(σ)=L+(σ)L^σ and thus 𝒰(L+(σ)) is the upper envelope of 𝒰(L+(σ)) and 𝒰(L^σ).

We wish to compute the upper envelope 𝒰(L+(σ)) for every cell σ in the last cutting Ξk. For this, we show below 𝒰(L+(σ)) for all cells σΞ can be computed in O(r2logn) time.

We work on the hierarchical cutting in a top-down manner. Suppose 𝒰(L+(σ)) for a cell σ has been computed (which is true initially when σ is the only cell of Ξ, in which case L+(σ)= and thus 𝒰(L+(σ))=). Then, for each child σ of σ, we compute 𝒰(L+(σ)) as follows. By Lemma 2, 𝒰(L+(σ)) is the upper envelope of 𝒰(L+(σ)) and 𝒰(L^σ). The following Lemma 3 (see the full paper for the proof) provides an algorithm that computes 𝒰(L+(σ)) based on 𝒰(L+(σ)) and 𝒰(L^σ). The technical crux of the result is a crucial observation that the dual of 𝒰(L+(σ)), which is the lower hull of the dual points of the lines of L+(σ), has only O(1) intersections with the dual of 𝒰(L^σ), which is the lower hull of the dual points of the lines of L^σ. Note that the algorithm does not report 𝒰(L+(σ)) explicitly but rather returns a binary search tree representing 𝒰(L+(σ)), which is obtained by splitting and merging binary search trees of 𝒰(L+(σ)) and 𝒰(L^σ).

Lemma 3.

𝒰(L+(σ)) can be obtained from 𝒰(L+(σ)) and 𝒰(L^σ) in O(logn) time.

By virtue of Lemma 3, we can compute 𝒰(L+(σ)) for all cells σΞ in O(|Ξ|logn) time, which is O(r2logn) as Ξ has O(r2) cells.

Consider a cell σΞk. For any point pP(σ), let Lσ+(p) denote the subset of lines of Lσ below p. It is easy to see that L+(p)=L+(σ)Lσ+(p). Hence, 𝒰(L+(p)) is the lower envelope of 𝒰(L+(σ)) and 𝒰(Lσ+(p)). The above already computes 𝒰(L+(σ)). Suppose 𝒰(Lσ+(p)) is also available. Then, we compute 𝒰(L+(p)) by merging 𝒰(L+(σ)) and 𝒰(Lσ+(p)) in O(logn) time by the algorithm of Lemma 3. Indeed, since all lines of Lσ+(p) cross σ while all lines of L+(σ) are completely below σ, the same algorithm as Lemma 4 is also applicable here. Consequently, once the upper envelopes 𝒰(Lσ+(p)) for all points pP are computed, 𝒰(L+(p)) for all pP can be computed in additional O(mlogn) time.

It remains to compute 𝒰(Lσ+(p)). To this end, we recursively apply the above algorithm on Lσ and P(σ). A subtle issue is that while |Lσ|n/r, we do not have a good upper bound for P(σ). To address this issue, we do the following. If |P(σ)|>m/r2, then we arbitrarily partition P(σ) into groups of at most m/r2 points each. Since Ξk has O(r2) cells, the number of groups for all cells σΞk is still bounded by O(r2). Now for each cell σΞk, for each group P of P(σ), we apply the above algorithm recursively on P and Lσ. Thus, we obtain the following recurrence for the runtime of the entire algorithm (excluding the time for presorting L), for any 1rn:

T(m,n)=O(nr+mlogn+r2logn)+O(r2)T(m/r2,n/r). (1)

We will use the recurrence later in our combined algorithm in Section 5.

4 The second algorithm in the dual plane

We discuss another algorithm, which deals with the problem in the dual plane. It mostly follows Wang’s algorithm in [26] with a slight change to make the algorithm recursive.

Let P be the set of lines dual to the points of P and L the set of points dual to the lines of L. Consider a point pP. Recall that Fp(L) is the face of 𝒜(L) that contains p. Without loss of generality, we assume that the dual line p of p is horizontal. In the dual plane, p divides the points of L into two subsets and the portions of the convex hulls of the two subsets between their inner common tangents are dual to Fp(L) [1, 12]; see Fig 2. Specifically, define L+(p) (resp., L(p)) to be the subset of points of L above (resp., below) p. Let H+(p) be the lower hull of the convex hull of L+(p) and H(p) the upper hull of L(p); see Fig 2. Hence, the boundary of Fp(L) is dual to the portions of H+(p) and H(p) between their inner common tangents; let Fp(L) denote the dual of Fp(L).

Figure 2: Illustrating the notation in the dual plane: Fp(L), which is dual to Fp(L), is composed of the blue edges between the two inner common tangents (the dashed segments).

The algorithm will compute binary search trees of height O(logn) to represent H+(p) and H(p), respectively. Using the trees, their inner common tangents can be computed in O(logm) time [18] and then Fp(L) can be reported in additional O(|Fp(L)|) time. We only discuss how to compute H+(p) (i.e., compute the tree for it).

The algorithm uses a hierarchical (1/r)-cutting Ξ0,Ξ1,,Ξk for the lines of P. The following recurrence for the runtime of the whole algorithm can be obtained (excluding a presorting step), for any 1rm:

T(m,n)=O(mrlogn+nlogr)+O(r2)T(m/r,n/r2). (2)

See the full paper for the algorithm details. Recurrence (2) will be used in our combined algorithm in Section 5. We highlight some details below that are needed in Section 5.

 Remark.

For each dual line pP (assume it is horizontal), the algorithm for Recurrence (2) computes a set of convex hulls +(p) such that (1) they are completely above p; (2) they are pairwise disjoint and each of them is a convex hull of a subset of points of L; (3) H+(p) is the lower hull of them; (4) pP|+(p)|=O(n4/3). Again, for each convex hull of +(p), we have a binary search tree that represents it. As a final step, called the convex hull merge procedure, the algorithm computes the lower hull (which is H+(p)) of the vertices of all convex hulls of +(p), for all pP. The term O(mrlogn) in (2) is due to this convex hull merge procedure. If this procedure could be performed in O(mr) time (which is one of our goals in Section 5), then the term in (2) would become O(mr).

5 Combining the two algorithms

In this section, we combine the two algorithms presented in the last two sections to obtain a final algorithm to compute all non-empty faces of 𝒜(L) for the points of P.

We first discuss the symmetric case where m=n. If we apply (2) and then (1) using the same r, we can obtain: T(n,n)=O(nrlogn+r4log(n/r2))+O(r4)T(n/r3,n/r3). Setting r=n1/3/logn leads to the following

T(n,n)=O(n4/3)+O((n/log3n)4/3)T(log3n,log3n). (3)

The recurrence solves to T(n,n)=n4/32O(logn). In the following, we improve the algorithm to O(n4/3) time using the Γ-algorithm framework of Chan and Zheng [7].

5.1 Improvement

We apply the recurrence (3) one more time to obtain the following with b=(loglogn)3:

T(n,n)=O(n4/3)+O((n/b)4/3)T(b,b). (4)

As b is very small, we show that after O(n) time preprocessing, we can solve each subproblem T(b,b) of (4) in O(b4/3) time. Consequently, we obtain T(n,n)=O(n4/3).

More precisely, we will demonstrate that following a preprocessing step requiring O(2poly(b)) time, where poly() represents a polynomial function, each subproblem T(b,b) can be solved by performing only O(b4/3) comparisons. Alternatively, we can solve T(b,b) using an algebraic decision tree with a height of O(b4/3). Given that b=(loglogn)3, the term 2poly(b) remains bounded by O(n). To adapt this approach to the conventional computational model (such as the standard real RAM model), we explicitly construct the decision tree for the aforementioned algorithm. This construction, which can also be viewed as part of the preprocessing for solving T(b,b), can be accomplished in O(2poly(b)) time. Consequently, with just O(n) time spent on preprocessing, we can efficiently solve each subproblem T(b,b) in O(b4/3) time. In the subsequent discussion, for notational convenience, we will use n instead of b. Our objective is to establish the following lemma.

Lemma 4.

After O(2poly(n)) time preprocessing, T(n,n) can be solved using O(n4/3) comparisons.

We first apply recurrence (2) by setting m=n and r=n1/3, and obtain

T(n,n)=O(n4/3logn)+O(n2/3)T(n2/3,n1/3). (5)

As remarked at the end of Section 4, the O(n4/3logn) term is due to the convex hull merge procedure for computing H+(p) by merging the convex hulls of +(p), for all pP. If the procedure could be done using O(n4/3) comparisons, then the term would become O(n4/3). Note that pP|+(p)|=O(n4/3). As such, to solve T(n,n) by O(n4/3) comparisons, there are two challenges: (1) perform the merge procedure on the O(n4/3) convex hulls using O(n4/3) comparisons; (2) solve each subproblem T(n2/3,n1/3) using O(n2/3) “amortized” comparisons, so that all O(n2/3) such subproblems in (5) together cost O(n4/3) comparisons.

𝚪-algorithm framework.

To address these challenges, we resort to the Γ-algorithm framework for bounding decision tree complexities, as recently introduced by Chan and Zheng [7]. We provide a brief overview here, with more detailed information available in [7, Section 4.1].

In essence, this framework constitutes an algorithm that exclusively counts the number of comparisons, termed Γ-comparisons in [7], to determine if a point belongs to a semialgebraic set of degree O(1) within a constant-dimensional space. Solving our problem of finding the non-empty faces is equivalent to locating the cell C that contains a point p defined by the input (i.e., the lines of L and the points of P in our problem) within an arrangement 𝒜 comprising the boundaries of O(n) semialgebraic sets in an O(n)-dimensional space (because our input size is O(n)). Constructing this arrangement can be achieved in O(2poly(n)) time without inspecting the input values, thereby obviating the need for any comparisons. Notably, the number of cells in 𝒜 is bounded by nO(n).

As the Γ-algorithm progresses, it maintains a set Π consisting of cells from 𝒜. Initially, Π comprises all cells of 𝒜. During the algorithm’s execution, Π can only shrink, yet it always contains the sought-after cell C. Upon completion of the algorithm, C is located.

We define a potential function Φ as log|Π|. Given that 𝒜 contains nO(n) cells, initially Φ is O(nlogn). For any operation or subroutine of the algorithm, let ΔΦ denote the change in Φ. Since Φ monotonically decreases throughout the algorithm, we always have ΔΦ0. The sum of ΔΦ over the entire algorithm is O(nlogn). Consequently, this allows us to accommodate costly operations or subroutines, as long as they result in a decrease in Φ.

Two algorithmic tools are introduced in [7] under the framework: the basic search lemma [7, Lemma 4.1] and the search lemma [7, Lemma A.1]. Roughly speaking, these lemmas operate as follows: when presented with a set of r predicates, where each predicate assesses whether γ(x) holds true for the input vector x, it is guaranteed that at least one of these predicates is true for all inputs within the active cells. In such cases, the basic search lemma can identify a predicate that holds true by conducting O(1rΔΦ) comparisons. The search lemma is for scenarios involving a binary tree (or a more general directed acyclic graph of O(1) degree) with nodes v, each associated with a predicate γv, and where for each internal node v, γv implies γu for a child u of v across all inputs in the active cells. This lemma can compute a leaf node v for which γv holds true with O(1ΔΦ) comparisons.

As discussed in [7], intuitively the basic search lemma provides a mild form of nondeterminism, allowing us to “guess” which one of r choices is correct, with only O(1) amortized cost instead of O(r). This situation naturally occurs in the context of point location, where we seek to determine which one of the r cells contains a given point. Another noteworthy application of both lemmas, as also discussed in [7], is the task of finding the predecessor of a query number within a sorted list of input numbers. As will be seen later, some subproblems in our algorithm also involves point locations as well as finding predecessors within sorted lists, making both the basic search lemma and the search lemma highly applicable.

In the following two subsections, we will address the aforementioned challenges individually. Let P represent a set of n points and L a set of n lines, for the problem in Recurrence (5).

5.2 The convex hull merge procedure

We follow the notation in the remark of Section 4. Define Kp=|+(p)|. Hence, pPKp=O(n4/3). Our task is to compute (a binary search tree that represents) the lower hull (which is H+(p)) of the vertices of all convex hulls of +(p), for all pP. Wang [26] gave an algorithm that can constructs H+(p) in O(Kplogn) time, resulting in a total of O(n4/3logn) time for all pP. We will convert the algorithm to a more efficient Γ-algorithm that uses only O(n4/3) comparisons. Below, we first review Wang’s algorithm.

Constructing 𝑯+(𝒑): A conventional algorithm from Wang [26].

Since H+(p) is the lower hull of all convex hulls of +(p), it is only necessary to focus on the lower hull of each convex hull of +(p). For each convex hull of +(p), since we have its binary search tree, we can obtain a binary search tree only representing its lower hull in O(logn) time. This is achieved by initially identifying the leftmost and rightmost vertices of the convex hulls and subsequently executing split/merge operations on these trees. The total time for doing this for all convex hulls of +(p) is O(Kplogn).

Next we compute the portions of each lower hull H+(p) that are vertically visible from the line p. A point qH is vertically visible from p if the vertical segment connecting q to p does not intersect any other lower hull of +(p). Remarkably, these visible portions collectively form the lower envelope of +(p), denoted by (+(p)); see Fig. 3.

Figure 3: Illustrating the lower envelope (+(p)) (the thick blue edges) of the convex hulls of +(p). The dashed segments inside convex hulls are their representative segments.

For each convex hull H within +(p), we define its representative segment as the line segment connecting the leftmost and rightmost endpoints of H (see Fig. 3). Define S to be the set of the representative segments of all convex hulls of +(p). Because the convex hulls are pairwise disjoint, so are the segments of S. Observe that the lower envelope (S) of S corresponds to (+(p)) in the following manner. For each maximal segment ab¯ of (S), suppose it lies on the representative segment of a convex hull H of +(p). Then the vertical projection of ab¯ onto the lower hull of H constitutes a maximal portion of the lower hull of H on (+(p)). This specific portion can be obtained in O(logn) time by splitting the binary search tree representing the lower hull of H at the x-coordinates of a and b, respectively. Consequently, once (S) is available, (+(p)), where each maximal portion is represented by a binary search tree, can be obtained in additional O(|(S)|logn) time. Since segments of S are disjoint, we have |(S)|2Kp1 and constructing (S) can be accomplished in O(KplogKp) time by a straightforward plane sweeping algorithm. Note that Kpn since vertices of each convex hull of +(p) are all from L (whose size is n). As such, (+(p)) can be computed in O(Kplogn) time.

With (+(p)), we proceed to compute the lower hull H+(p). As previously discussed, (+(p)) comprises at most 2Kp1 pieces, ordered from left to right. Each piece is a portion of a lower hull of +(p) and is represented by a binary search tree.

To begin, we merge the first two pieces by computing their lower common tangent, a task achievable in O(logn) time [24], since these two pieces are separated by a vertical line. After that we obtain a binary search tree that represents the lower hull of the first two pieces of (+(p)). We proceed to merge this lower hull with the third piece of (+(p)) in a similar manner. This process continues until all pieces of (+(p)) have been merged, culminating in a binary search tree representing H+(p). The runtime is O(Kplogn), as each merge operation consumes O(logn) time, and (+(p)) has at most 2Kp1 pieces.

As such, the lower hull H+(p) can be computed in O(Kplogn) time. Applying the algorithm to all dual lines p of P will compute the lower hulls H+(p) for all pP. It should be noted that after the algorithm is applied to one line pP, binary search trees of convex hulls of +(p) may have been destroyed due to the split and merge operations during the algorithm. The destroyed convex hulls may be used later for other lines of P. To address the issue, we can use persistent binary search trees with path-copying [11, 25] to represent convex hulls so that standard operations on the trees (e.g., merge, split) can be performed in O(logn) time each and after each operation the original trees are still kept.

Constructing 𝑯+(𝒑): a new and faster 𝚪-algorithm.

We now convert the above algorithm to a faster Γ-algorithm. In the above algorithm, the procedures that take O(Kplogn) time are the following: (1) Computing the trees representing the lower hulls of +(p); (2) computing the lower envelope (S) of S; (3) computing the lower envelope (+(p)) of +(p) by using (S); (4) computing H+(p) by merging the pieces of (+(p)). Each of these procedures leads to an overall O(n4/3logn) time for all pP since pP|+(p)|=O(n4/3).

For each of these procedures, we will design a corresponding “Γ-procedure” that uses only O(n4/3) comparisons for all pP (thus the amortized cost for each p is O(Kp)). In particular, the fourth procedure poses the most challenge and its solution is also the most interesting. See the full paper for our Γ-algorithms for the first three procedures.

5.2.1 The fourth procedure

The fourth procedure is to compute H+(p). The idea is to merge pieces of (+(p)) one by one from left to right, and each merge is done by first computing the lower common tangent. Note that each piece is a portion of the lower hull of a convex hull of +(p) and is represented by a binary search tree. Specifically, suppose we have the lower hull Hi for the first i pieces, i.e., we have a binary search tree Ti for Hi. The next step is to merge Hi with the (i+1)-th piece H by first computing the lower common tangent of Hi and H. Let TH be the binary search tree for H. With the lower common tangent, we perform split and merge operations on Ti and TH for H to obtain a new tree Ti+1 for the lower hull of the first i+1 pieces. Finding the lower common tangent can be done in O(logn) time [24] and constructing the tree Ti+1 also takes O(logn) time.

In the following, we focus on describing a Γ-procedure that can compute the lower common tangent of Hi and H using O(1n1/4ΔΦ) comparisons. After the lower common tangent is computed, constructing Ti+1 does not need any comparisons because split and merge operations on Ti and TH do not involve any comparisons.

Notation and algorithm overview

For notational convenience, let H1=Hi, H2=H, T1=Ti, and T2=TH.

We will use the basic search lemma of the Γ-algorithm framework of Chan and Zheng [7] discussed above. We will also rely on the technique from Overmars and van Leeuwen [24] for computing common tangents of two convex hulls.

Let the line segment t1t2¯ be the lower common tangent between H1 and H2, with t1H1 and t2H2. We call t1 and t2 the tangent points. For ease of exposition, we assume that t1t2¯ is not collinear with any edge of H1H2. Thus, the tangent points t1 and t2 are unique.

For each i=1,2, since we are searching a vertex ti from Hi, from now on, we view Hi as a sequence of vertices ordered from left to right. We use a chain to refer to a contiguous subsequence of Hi. For two vertices u and v of Hi with u left of v, we use Hi[u,v] to denote the chain of Hi from u to v including both u and v, while Hi(u,v) is defined to be Hi[u,v]{u,v}. Similarly, Hi[u,v) refers to the chain of Hi from u to v including u but excluding v; Hi(u,v] is defined likewise. In addition, for any vertex u of Hi, we use u1 (resp., u+1) to refer to the left (resp., right) neighboring vertex of u in Hi; for convenience, if u is the leftmost (resp., rightmost) vertex of Hi, then u1 (resp., u+1) refers to u. For example, Hi(u,v)=Hi[u+1,v1]. The following lemma is based on the technique of Overmars and van Leeuwen [24], which will be used in our algorithm.

Lemma 5 (Overmars and van Leeuwen [24]).

Given two points p1H1 and p2H2, p1 (resp., p2) partitions H1 (resp., H2) into two chains (we assume that neither chain contains pi, i=1,2). Then, among the four chains of H1 and H2, we can determine at least one chain that does not contain a tangent point based on the following six points: p1 (resp., p2) and its two neighboring vertices of H1 (resp., H2); such a chain is called OvL-prunable111OvL is the last name initials of Overmars and van Leeuwen..

Lemma 5 provides a pruning criterion for the binary search algorithm of [24] that can compute t1t2¯ in O(logn) time. We will use the lemma in a different way. For any subchain of an OvL-prunable chain determined by the lemma, we also say that the subchain is OvL-prunable (a subchain is a contiguous subsequence of vertices of the chain).

For each i=1,2, we maintain two vertices ui and vi of Hi such that tiHi(ui,vi). After O(1) iterations, either Hi(u1,v1) or Hi(u2,v2) contains a single point. The single point is t1 in the former case and t2 in the latter one. In either case, one tangent point is determined. After that, the other tangent point can be computed by a similar (and simpler) procedure. For the simplicity of discussion, we assume ti is not an endpoint of Hi, for each i=1,2.

Computing a tangent point

Initially, for each i=1,2, we set ui and vi to be the two endpoints of Hi, respectively. This guarantees that the algorithm invariant holds, i.e., tiHi(ui,vi). We consider a general step of the algorithm. To apply the basic search lemma, we define a predicate γ(u1,v1,u2,v2) with respect to u1,v1,u2,v2, as follows.

Definition 6.

Define γ(u1,v1,u2,v2) to be true if neither H1(u1,v1) nor H2(u2,v2) is OvL-prunable when Lemma 5 is applied to (p1,p2) for any p1{u1,v1} and p2{u2,v2}.

By Lemma 5, whether γ is true can be determined by O(1) points of L, i.e., at most six points are needed for each pair (p1,p2) with p1{u1,v1} and p2{u2,v2}, and thus the predicate is of O(1) degree (where the variables are the coordinates of the O(1) points).

Each iteration of the algorithm proceeds as follows. For each i=1,2, partition Hi[ui,vi] into r chains of roughly equal lengths: Hi[uij,vij], 1jr, for a parameter r to be determined later. Define Ci={Hi[uij1,vij+1]| 1jr}. As such, the length of each chain of Ci is roughly equal to the length of Hi[ui,vi] divided by r. Define 𝒞=C1×C2, i.e., 𝒞 consists of O(r2) pairs of chains such that in each pair, the first chain is from C1 and the second one is from C2. We have the following observation (see the full paper for the proof).

Observation 7.

𝒞 must contain a pair of chains H1[u1j1,v1j1] and H2[u2j2,v2j2] such that the predicate γ(u1j1,v1j1,u2j2,v2j2) holds true.

In light of the above observation, we apply the basic search lemma on the O(r2) cells of 𝒞 to find a pair of chains H1[u1j1,v1j1] and H2[u2j2,v2j2] such that the predicate γ(u1j1,v1j1,u2j2,v2j2) is true. By the basic search lemma, this can be accomplished using O(1r2ΔΦ) comparisons. The subsequent lemma (see the full paper for the proof), which proves a key property, ensures our ability to recursively employ the algorithm.

Lemma 8.

If γ(u1j1,v1j1,u2j2,v2j2) is true, then either t1H1[u1j1,v1j1] or t2H2[u2j2,v2j2], and which case happens can be determined using O(1) comparisons.

By Lemma 8, without loss of generality, we assume t1H1[u1j1,v1j1] (and thus t1H1(u1j11,v1j1+1)). This finishes the current iteration. We proceed on the next iteration with the two chains H1[u1j11,v1j1+1] and H2[u2,v2], i.e., update u1=u1j11 and v1=v1j1+1 (and thus t1H1(u1,v1)). As t2H2(u2,v2), the algorithm invariant holds.

In this way, each iteration on H1[u1,v1] and H2[u2,v2] shrinks one of them to a subchain of size roughly 1/r of its original size. Since |H1|+|H2|n, after O(logrn) iterations, a tangent point can be found. The total number of comparisons is thus O(logrnr2ΔΦ).

The above finds one tangent point. The other one can be found by a similar but simpler algorithm, which uses O(logrnrΔΦ) comparisons. See the full paper for details.

In summary, with O(logrnr2ΔΦ) comparisons, the lower tangent t1t2¯ can be computed. Setting r=n1/8 leads to an upper bound of O(1n1/4ΔΦ) on the number of comparisons.

In this way, the total number of comparisons for constructing the lower hull H+(p) by merging the pieces of (+(p)) is O(Kpn1/4ΔΦ) since (+(p)) has at most 2Kp1 pieces. As pPKp=O(n4/3) and the sum of ΔΦ in the entire algorithm is O(nlogn), the total number of comparisons for computing H+(p) for all pP is O(n4/3).

5.3 Solving the subproblems 𝑻(𝒏𝟐/𝟑,𝒏𝟏/𝟑)

We can solve all O(n2/3) subproblems T(n2/3,n1/3) in Recurrence (5) using a total of O(n4/3) comparisons. See the full paper for details.

5.4 Putting it all together, the asymmetric case, and the lower bound

This proves Lemma 4, and thus T(n,n) in Recurrence (5) can be bounded by O(n4/3) after O(2poly(n)) time preprocessing, as discussed before. Equivalently, T(b,b) in Recurrence (4) is O(b4/3) after O(2poly(b)) time preprocessing. Notice that the preprocessing work is done only once and for all subproblems T(b,b) in (4). Since b=(loglogn)3, we have 2poly(b)=O(n). As such, T(n,n) in (4) solves to O(n4/3) and we thus obtain the following theorem.

Theorem 9.

Given a set of n points and a set of n lines in the plane, we can report all faces of the line arrangement that contain at least one point in O(n4/3) time.

The asymmetric case is handled in the following corollary; see the full paper for the proof.

Corollary 10.

Given a set of m points and a set of n lines in 2, we can report all faces of the line arrangement that contain at least one point in O(m2/3n2/3+(n+m)logn) time.

Theorem 11 finally proves the lower bound below, with the help of Ben-Or’s technique [5]. This justifies the optimality of Corollary 10. See the full paper for the proof.

Theorem 11.

Computing all non-empty faces of the line arrangement requires Ω(m2/3n2/3+(n+m)logn) time under the algebraic decision tree model.

References

  • [1] Pankaj K. Agarwal. Partitioning arrangements of lines II: Applications. Discrete and Computational Geometry, 5:533–573, 1990. doi:10.1007/BF02187809.
  • [2] Pankaj K. Agarwal, Jiří Matoušek, and Otfried Schwarzkopf. Computing many faces in arrangements of lines and segments. SIAM Journal on Computing, 27:491–505, 1998. doi:10.1137/S009753979426616X.
  • [3] Nancy M. Amato, Michael T. Goodrich, and Edgar A. Ramos. Computing faces in segment and simplex arrangements. In Proceedings of the 27th Annual ACM Symposium on Theory of Computing (STOC), pages 672–682, 1995. doi:10.1145/225058.225285.
  • [4] Boris Aronov, Herbert Edelsbrunner, Leonidas J. Guibas, and Micha Sharir. The number of edges of many faces in a line segment arrangement. Combinatorica, 12:261–274, 1992. doi:10.1007/BF01285815.
  • [5] Michael Ben-Or. Lower bounds for algebraic computation trees (preliminary report). In Proceedings of the 15th Annual ACM Symposium on Theory of Computing (STOC), pages 80–86, 1983. doi:10.1145/800061.808735.
  • [6] Timothy M. Chan, Pingan Cheng, and Da Wei Zheng. An optimal algorithm for higher-order voronoi diagrams in the plane: The usefulness of nondeterminism. In Proceedings of the 35th Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 4451–4463, 2024. doi:10.1137/1.9781611977912.156.
  • [7] Timothy M. Chan and Da Wei Zheng. Hopcroft’s problem, log-star shaving, 2D fractional cascading, and decision trees. In Proceedings of the 33rd Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 190–210, 2022. doi:10.1137/1.9781611977073.10.
  • [8] Bernard Chazelle. Cutting hyperplanes for divide-and-conquer. Discrete and Computational Geometry, 9(2):145–158, 1993. doi:10.1007/BF02189314.
  • [9] Bernard Chazelle, Herbert Edelsbrunner, Leonidas J. Guibas, Micha Sharir, and Jack Snoeyink. Computing a face in an arrangement of line segments and related problems. SIAM Journal on Computing, 22:1286–1302, 1993. doi:10.1137/0222077.
  • [10] Kenneth L. Clarkson, Herbert Edelsbrunner, Leonidas J. Guibas, Micha Sharir, and Emo Welzl. Combinatorial complexity bounds for arrangement of curves and spheres. Discrete and Computational Geometry, 5:99–160, 1990. doi:10.1007/BF02187783.
  • [11] James R. Driscoll, Neil Sarnak, Daniel D. Sleator, and Robert E. Tarjan. Making data structures persistent. Journal of Computer and System Sciences, 38(1):86–124, 1989. doi:10.1016/0022-0000(89)90034-2.
  • [12] Herbert Edelsbrunner, Leonidas J. Guibas, John Hershberger, Raimund Seidel, Micha Sharir, Jack Snoeyink, and Emo Welzl. Implicitly representing arrangements of lines or segments. Discrete and Computational Geometry, 4:433–466, 1989. doi:10.1007/BF02187742.
  • [13] Herbert Edelsbrunner, Leonidas J. Guibas, János Pach, Richard Pollack, Raimund Seidel, and Micha Sharir. Arrangements of curves in the plane topology, combinatorics, and algorithms. Theoretical Computer Science, 92(2):319–336, 1992. doi:10.1016/0304-3975(92)90319-B.
  • [14] Herbert Edelsbrunner, Leonidas J. Guibas, and Micha Sharir. The complexity and construction of many faces in arrangement of lines and of segments. Discrete and Computational Geometry, 5:161–196, 1990. doi:10.1007/BF02187784.
  • [15] Herbert Edelsbrunner, Leonidas J. Guibas, and Jorge Stolfi. Optimal point location in a monotone subdivision. SIAM Journal on Computing, 15(2):317–340, 1986. doi:10.1137/0215023.
  • [16] Herbert Edelsbrunner and Ernst P. Mücke. Simulation of simplicity: A technique to cope with degenerate cases in geometric algorithms. ACM Transactions on Graphics, 9:66–104, 1990. doi:10.1145/77635.77639.
  • [17] Herbert Edelsbrunner and Emo Welzl. On the maximal number of edges of many faces in an arrangement. Journal of Combinatorial Theory, Series A, 41:159–166, 1986. doi:10.1016/0097-3165(86)90078-6.
  • [18] Leonidas J. Guibas, John Hershberger, and Jack Snoeyink. Compact interval trees: A data structure for convex hulls. International Journal of Computational Geometry and Applications, 1(1):1–22, 1991. doi:10.1142/S0218195991000025.
  • [19] John Hershberger. Finding the upper envelope of n line segments in O(nlogn) time. Information Processing Letters, 33:169–174, 1989. doi:10.1016/0020-0190(89)90136-1.
  • [20] Matthew J. Katz and Micha Sharir. An expander-based approach to geometric optimization. SIAM Journal on Computing, 26(5):1384–1408, 1997. doi:10.1137/S0097539794268649.
  • [21] David G. Kirkpatrick. Optimal search in planar subdivisions. SIAM Journal on Computing, 12(1):28–35, 1983. doi:10.1137/0212002.
  • [22] Jir̆í Matoušek. Range searching with efficient hierarchical cuttings. Discrete and Computational Geometry, 10(1):157–182, 1993. doi:10.1007/BF02573972.
  • [23] Joseph S. B. Mitchell. On computing a single face in an arrangement of line segments. Manuscript, School of Operations Research and Industrial Engineering, Cornell University, Ithaca, NY, 1990.
  • [24] Mark H. Overmars and Jan van Leeuwen. Maintenance of configurations in the plane. Journal of Computer and System Sciences, 23(2):166–204, 1981. doi:10.1016/0022-0000(81)90012-X.
  • [25] Neil Sarnak and Robert E. Tarjan. Planar point location using persistent search trees. Communications of the ACM, 29:669–679, 1986. doi:10.1145/6138.6151.
  • [26] Haitao Wang. Constructing many faces in arrangements of lines and segments. Journal of Computational Geometry (JoCG), 14:287–308, 2023. doi:10.20382/jocg.v14i1a11.
  • [27] Haitao Wang and Yiming Zhao. Improved algorithms for distance selection and related problems. Algorithmica, 87:908–929, 2025. doi:10.1007/s00453-025-01305-z.
  • [28] Chee-Keng Yap. Symbolic treatment of geometric degeneracies. Journal of Symbolic Computation, 10:349–370, 1990. doi:10.1016/S0747-7171(08)80069-7.