Abstract 1 Introduction 2 Preliminaries 3 Ingredients 4 One Fixed Orientation 5 General Two-Line-Center References

Linear-Time (1+ε)-Approximation Algorithms for Two-Line-Center Problems

Chaeyoon Chung ORCID Department of Computer Science and Engineering, Pohang University of Science and Technology, South Korea    Anil Maheshwari ORCID School of Computer Science, Carleton University, Ottawa, Canada    Michiel Smid ORCID School of Computer Science, Carleton University, Ottawa, Canada
Abstract

Given a set S of n points in the plane, we study the two-line-center problem: finding two lines that minimize the maximum distance from each point in S to its closest line. We present a (1+ε)-approximation algorithm for the two-line-center problem that runs in O((n/ε)log(1/ε)) time, which improves the previously best O(nlogn+(n/ε2)log(1/ε)+(1/ε3)log(1/ε))-time algorithm. We also consider three variants of this problem, in which the orientations of the two lines are restricted: (1) the orientation of one of the two lines is fixed, (2) the orientations of both lines are fixed, and (3) the two lines are required to be parallel. For each of these three variants, we give the first (1+ε)-approximation algorithm that runs in linear time. In particular, for the variant where the orientation of one of the two lines is fixed, we also give an improved exact algorithm that runs in O(nlogn) time and show that it is optimal.

Keywords and phrases:
Approximation algorithm, two-line-center problem, k-line-center problem, projective clustering, ε-certificate, ε-coreset, width of a point set
Copyright and License:
[Uncaptioned image] © Chaeyoon Chung, Anil Maheshwari, and Michiel Smid; licensed under Creative Commons License CC-BY 4.0
2012 ACM Subject Classification:
Theory of computation Computational geometry
Related Version:
Full Version: https://arxiv.org/pdf/2601.03516
Acknowledgements:
This work was done while Chaeyoon Chung was visiting Carleton University.
Funding:
Chaeyoon Chung was supported by Basic Science Research Program through the National Research Foundation of Korea (NRF) funded by the Ministry of Education(RS-2025-25436016). Anil Maheshwari and Michiel Smid were supported by NSERC.
Editors:
Hee-Kap Ahn, Michael Hoffmann, and Amir Nayyeri

1 Introduction

Given a set S of n points in the plane, we study the two-line-center problem: finding two lines that minimize the maximum distance from each point in S to its closest line. This is a special case of the k-line-center problem, which asks, for a given set S of n points in the plane, to find k lines minimizing the maximum distance from each point in S to its closest line. A more general framework is projective clustering: Given Pd, the goal is to find k flats of dimension j that best fit P under a given distance measure. It has wide applications in data mining [4, 5], unsupervised learning [23], database management [10], and computer vision [24].

The k-line-center problem is known to be NP-hard [21] when k is part of the input (even in the plane), and various approaches including approximation algorithms and randomized methods [1, 3, 7, 9, 11, 13, 16, 17, 18] have been studied.

When k=1, the problem becomes computing the width of a point set. This can be done exactly in O(nlogn) time [22], and an Ω(nlogn) lower bound is known [20]. A (1+ε)-approximation algorithm running in O(n+1/ε) time was given in [11].

When k=2, i.e., the two-line-center problem, an exact algorithm with running time O(n2log2n) is known [19]. The authors in [2] presented a (1+ε)-approximation algorithm that runs in O(nlogn+(n/ε2)log(1/ε)+ε7/2log(1/ε)) time. Later, as the (1+ε)-approximation algorithm for the width problem was improved from O(n+ε3/2) to O(n+1/ε) [11], their algorithm is consequently improved to O(nlogn+(n/ε2)log(1/ε)+(1/ε3)log(1/ε)), even though it is not explicitly mentioned.

Observe that the two-line-center problem is equivalent to finding a pair of slabs whose union covers the input point set while minimizing their maximum width.

We study the two-line-center problem and three natural variants. Let μ=min{n, 1/ε2}, and let w denote the maximum width of an optimal pair of slabs in each problem. Each variant is illustrated in Figure 1. Table 1 summarizes the previous and new results.

Figure 1: In each case, both yellow and gray pairs satisfy the restriction, but the yellow pair has the smaller maximum width.
  1. 1.

    General: Given a set S of n points in the plane, we study the problem of finding a pair of slabs whose union covers S while minimizing the maximum of their widths. We present an O(n+(μ/ε)logμ)-time algorithm that finds a pair of slabs whose union covers S and whose maximum width is at most (1+ε)w. The running time can be expressed as both O((n/ε)log(1/ε)) and O(n+(1/ε3)log(1/ε)).

  2. 2.

    One Fixed Orientation: Given a set S of n points in the plane and an orientation θ, we study the problem of finding a pair of slabs such that one of them has orientation θ and their union covers S while minimizing the maximum of their widths. We present an exact algorithm that runs in O(nlogn) time, improving the previously best O(nlog3n)-time algorithm [6], and show that this is optimal.

      We also present an O(n+μlogμ)-time algorithm that finds a pair of slabs such that one of them has orientation θ, their union covers S, and their maximum width is at most (1+ε)w. The running time can be expressed as O(nlog(1/ε)) and O(n+1/ε2log(1/ε)).

  3. 3.

    Two Fixed Orientations: Given a set S of n points in the plane and two orientations, θ1 and θ2, we study the problem of finding two slabs, one has orientation θ1 and the other has orientation θ2, whose union covers S while minimizing the maximum of their widths. We present an O(n+1/ε)-time algorithm that finds a pair of slabs such that one has orientation θ1 and the other has orientation θ2, their union covers S, and their maximum width is at most (1+ε)w.

  4. 4.

    Parallel: Given a set S of n points in the plane, we study the problem of finding a pair of parallel slabs whose union covers S while minimizing the maximum of their widths. We present an O(n+μ/ε)-time algorithm that finds a pair of parallel slabs such that their union covers S and their maximum width is at most (1+ε)w.

Table 1: A summary of our results and previous work.
Exact Approximation
General O(n2log2n) [19] O(nlogn+nε2log1ε+1ε3log1ε) [2, 11]
𝑶(𝒏𝜺𝐥𝐨𝐠𝟏𝜺), 𝑶(𝒏+𝟏𝜺𝟑𝐥𝐨𝐠𝟏𝜺) (Sec. 5)
One fixed orientation O(nlog3n) [6] -
𝑶(𝒏𝐥𝐨𝐠𝒏) (Sec. 4) 𝑶(𝒏𝐥𝐨𝐠𝟏𝜺), 𝑶(𝒏+𝟏𝜺𝟐𝐥𝐨𝐠𝟏𝜺) (Sec. 4)
Two fixed orientations O(nlogn) [6] -
𝑶(𝒏+𝟏𝜺) (full version)
Parallel O(n2) [8] -
𝑶(𝒏𝜺), 𝑶(𝒏+𝟏𝜺𝟑) (full version)

1.1 Outline

In Section 2, we introduce the notation that will be used throughout the paper.

In Section 3, we introduce three key ingredients used throughout the paper. In Section 3.1, we modify the concept of an anchor pair (as introduced in [2]) and show how to compute it. In Section 3.2, we use an anchor pair to compute a 10-approximation for the general two-line-center problem in O(n) time. In Section 3.3, we recall the concept of an ε-certificate (as defined in [3]), a subset of the input point set that suffices to obtain a (1+ε)-approximate solution, and show how to compute it in O(n) time using an anchor pair from Section 3.1 and a 10-approximate solution from Section 3.2.

In Section 4, we address the one-fixed-orientation two-line-center problem. In Section 4.2, we give an O(n)-time decision algorithm, assuming the points are sorted. In Section 4.3, we present an O(nlogn)-time exact algorithm and prove its optimality. In Section 4.4, we give a (1+ε)-approximation algorithm.

In Section 5, we address the general two-line-center problem. Using an anchor pair (Section 3.1) and a 10-approximate solution (Section 3.2), we compute a candidate set of orientations for one of the slabs of a (1+ε)-approximate solution. Combining this with the algorithm from Section 4 and an ε-certificate (Section 3.3), we obtain a (1+ε)-approximation algorithm.

Due to space constraints, we address the remaining two problems in the full version.

For the two-fixed-orientations two-line-center problem, we first present a 2-approximation algorithm, and then refine it to obtain a (1+ε)-approximation.

For the parallel two-line-center problem, we use the gap-ratio of a pair of slabs (as defined in [12]) and consider two cases separately, depending on whether the gap-ratio of an optimal pair is small or large. Combining these with an ε-certificate, we obtain a (1+ε)-approximation algorithm.

2 Preliminaries

For a set P of points in the plane, we denote its diameter by diam(P), its width by 0pt(P), and its convex hull by conv(P). If P=, then 0pt(P)=0. For a slab σ, we denote its width by w(σ), which is the distance between the two bounding lines of σ (see Figure 2(a)).

For a line , we say that has orientation θ[0,π) if θ is the counterclockwise angle from the x-axis to . A slab σ is said to have orientation θ[0,π) if its two bounding lines have orientation θ (see Figure 2(a)). For a finite set P of points in the plane, let σθ(P) denote the minimum-width slab of orientation θ that encloses P, and define 0ptθ(P)=w(σθ(P)) (see Figure 2(b)).

Figure 2: (a) The orientation of σ is α. (b) For a set P of points and an orientation θ, σθ(P) and 0ptθ(P) are shown. Observe that (p,q) is an antipodal pair of P with respect to θ.

For a set P of points in the plane and an orientation θ[0,π), we say that a pair (p,q) with p,qP is an antipodal pair of P with respect to θ if p lies on one bounding line of σθ(P) and q lies on the other (see Figure 2(b)).

For two finite sets A and B in the plane, let d(A,B) denote the minimum distance between a point of A and a point of B. For two points p and q in the plane, let pq be the line passing through p and q.

For each of the four problems, we assume that w>0, where w denotes the maximum width of an optimal pair of slabs for that problem. The case where w=0 can be detected and handled in linear time. See the appendix in the full version.

Throughout the paper, let ε>0 be a sufficiently small real number and let S denote an input set of n points in the plane. Due to space constraints, the proofs of the theorems and lemmas marked with a star() are provided in the full version.

3 Ingredients

In this section, we describe three key ingredients used throughout the paper: (1) an anchor pair, (2) a linear-time 10-approximation algorithm, and (3) an ε-certificate.

Throughout this section, we denote by Σ=(σ1,σ2) an optimal pair of slabs for the general two-line-center problem, and let w=max{w(σ1),w(σ2)}.

3.1 An Anchor Pair and Its Candidate Set

We first define an anchor pair and show that a candidate set for an anchor pair of Σ of constant size can be computed in O(n) time. Recall that S denotes the input set of n points in the plane.

Definition 1 (Anchor pair).

For a pair of slabs Σ=(σ1,σ2), we call a pair of points p,q2 an anchor pair of Σ if

  1. (1)

    p,qσ1 and d(p,q)diam((σ1σ2)S)/4, or

  2. (2)

    p,qσ2 and d(p,q)diam((σ2σ1)S)/4.

Note that p or q may lie in σ1σ2. (See Figure 3.)

Figure 3: (a) Both (p2,p3) and (p3,p4) are anchor pairs of Σ, satisfying (1) and (2), respectively. (b) (p1,p2) is an anchor pair of Σ, satisfying (1), but (p4,p6) is not.

We remark that the authors in [2] used the concept of an anchor pair, defined slightly differently. They showed that a candidate set of constant size can be computed in O(nlogn) time. In the proof of the following lemma, we point out a gap in their proof. By adopting our definition of an anchor pair, we both resolve this gap and obtain its candidate set in O(n) time.

 Lemma 1

We can compute, in O(n) time, a set of at most 11 pairs of points such that for any pair Σ of slabs whose union covers S, at least one of them is an anchor pair of Σ.

3.2 A Linear-Time 𝟏𝟎-Approximation Algorithm

In this section, we give a 10-approximation algorithm for the general two-line-center problem that runs in O(n) time. We remark that the authors in [2] gave a 6-approximation algorithm that runs in O(nlogn) time.

By Lemma 3.1, we can find a set of at most 11 pairs of points, at least one of which is an anchor pair of Σ in O(n) time. For the moment, assume that we have an anchor pair (p,q) of Σ. Without loss of generality, assume that p,qσ1 and d(p,q)diam((σ1σ2)S)/4.

Let p1,p2,,pn be the points of S, indexed in increasing order of their distance from pq. (We do not actually sort them. The indices are used only for reference.) For three points α,β,γ2, let σ(α,β;γ) denote the slab whose center line is αβ and one bounding line passes through γ (see Figure 4).

Figure 4: For three points α,β,γ2, the gray region represents σ(α,β;γ).

The following lemma implies the existence of a pair of slabs whose maximum width is at most 10w, and one of which is parallel to pq.

 Lemma 1

There exists a point rS such that σ(p,q;r) covers all points of (σ1σ2)S and w(σ(p,q;r))10w. For such r, 0pt(Sσ(p,q;r))w.

Naive Approach and Idea

By Lemma 3.2, there exists a point rS such that both w(σ(p,q;r)) and 0pt(Sσ(p,q;r)) are at most 10w. We now give a brief idea of using a binary search to find such a point r.

Consider the slab σ(p,q;pi) and the set Sσ(p,q;pi) for 1in. Observe that as i increases, the width w(σ(p,q;pi)) increases, while 0pt(Sσ(p,q;pi)) decreases111Throughout this section, we refer to a non-decreasing (resp., non-increasing) function simply as an increasing (resp., decreasing) function.. Using this monotonicity, we can find an index i that minimizes the unimodal function max{w(σ(p,q;pi)),0pt(Sσ(p,q;pi))}.

More specifically, at each step of the binary search over a range of indices [s,e][1,n], we compute the median index m and evaluate w(σ(p,q;pm)) and 0pt(Sσ(p,q;pm)). If w(σ(p,q;pm))0pt(Sσ(p,q;pm)), we set the range to [s,m]. Otherwise, we set it to [m,e]. Let j be the index obtained by the binary search. Observe that j minimizes max{w(σ(p,q;pi)),0pt(Sσ(p,q;pi))} over all 1in. By Lemma 3.2, we have max{w(σ(p,q;pj)),0pt(Sσ(p,q;pj))}10w.

Note that the time required in each step is dominated by computing 0pt(Sσ(p,q;pm)), which takes O(nlogn) time [22]. Therefore, the overall running time is O(nlog2n).

To reduce the time complexity, we avoid computing width(Sσ(p,q;pm)) from scratch at every step by sacrificing exactness. We remark that the authors in [2] presented an O(nlogn)-time binary search algorithm by reducing the time for each step to O(n). We present an O(n)-time binary search algorithm in which each step takes time linear in the size of the current range of indices, even when the points are not sorted. Our algorithm uses the following incremental algorithm that computes a 6-approximation of the width of a point set.

Theorem 2 (Theorem A.3 of [11]).

Given an online sequence of points in the plane, we can maintain a 6-approximation of the width with O(1) space and update time.

We show the following theorem. See the full version for the proof.

 Theorem 3

In O(n) time, we can compute a pair of slabs that forms a 10-approximation for the general two-line-center problem.

3.3 An 𝜺-certificate

Before defining an ε-certificate, we first define the notion of an ε-expansion. We remark that the definitions in this section are from [3].

Definition 4 (ε-expansion).
  1. (i)

    For an interval [a,b], we define its ε-expansion to be the interval [aε(ba)/2,b+ε(ba)/2]. See Figure 5(a).

  2. (ii)

    For a slab centered on a line with width w, we define its ε-expansion to be the slab centered on the line having width (1+ε)w. See Figure 5(b).

Figure 5: (a) The ε-expansion of an interval. (b) The ε-expansion of a slab.

Now we define an ε-certificate in both 1 and 2.

Definition 5 (ε-certificate).
  1. (i)

    Let P be a set of n points on the real line and ε>0. We say that a subset QP is an ε-certificate of P if for any pair of intervals whose union covers Q, the union of their ε-expansions covers P.

  2. (ii)

    Let P be a set of n points in the plane and ε>0. We say that a subset QP is an ε-certificate of P if for any pair of slabs with the same width whose union covers Q, the union of their ε-expansions covers P. We emphasize that the two slabs must have the same width.

We note that the existence of an ε-certificate of size 1/εO(1) was shown in [3]. By proving the following theorem, we refine the hidden constant and show how to construct such an ε-certificate in linear time.

 Theorem 6

For a set S of n points in the plane and ε>0, an ε-certificate of S of size O(1/ε2) can be computed in O(n) time.

We show that Theorem 6 directly gives a (1+ε)-approximation algorithm that runs in O(n+poly(1/ε)) time for each of the four problems.

 Theorem 7

For each of the four problems whose optimal solution can be found in T(n) time, we can compute a (1+ε)-approximate solution in O(n+T(1/ε2)) time.

For the general two-line-center problem, T(n)=O(n2log2n) [19]. By Theorem 7, we obtain a (1+ε)-approximation algorithm running in O(n+(1/ε4)log2(1/ε)) time. In Section 5, however, we present another algorithm with an improved running time. For the other variants as well, we present (1+ε)-approximation algorithms with better running times than those obtained by applying Theorem 7 with a known exact algorithm as T(n) (see Table 1).

4 One Fixed Orientation

By rotating the coordinate system, we assume without loss of generality that the given orientation θ is 0. Throughout this section, we denote by (σ1,σ2) an optimal pair of slabs for the one-fixed-orientation problem, where σ1 is horizontal. Let w=max{w(σ1),w(σ2)}.

4.1 Orientation-constrained Width and Dominance

In this section, we recall the concept of an orientation-constrained width and present geometric properties as introduced in [6]. Let θ1θ2 be two orientations. For a set P of points in the plane, we define the [θ1,θ2]-constrained width of P as 0pt[θ1,θ2](P)minθ[θ1,θ2]0ptθ(P). We also define σ[θ1,θ2](P)θ[θ1,θ2]σθ(P) (see Figure 6(a)).

Consider two non-empty sets P and Q of points in the plane that can be separated by a horizontal line, thus conv(P)conv(Q)=. Then, there are exactly two outer common tangents. Let θminθmax be the orientations of these lines. We say that P dominates Q if σ[θmin,θmax](Q)σ[θmin,θmax](P). See Figure 6. By construction, note that either P or Q dominates the other.

Figure 6: (a) For a point set S and orientations θ1 and θ2, the gray region represents σ[θ1,θ2](S). (b, c) For two point sets P (red) and Q (blue), the two lines represent their outer common tangents.
(b) P dominates Q. (c) Q dominates P.
Lemma 8 ([6]).

With the above notation, suppose that P dominates Q. Then

  1. (i)

    0pt[θmin,θmax](PQ)=0pt[θmin,θmax](P), and

  2. (ii)

    If 0pt(PQ)<d(conv(P),conv(Q)), then 0pt(PQ)=0pt[θmin,θmax](P).

4.2 Decision algorithm

In this section, we present a decision algorithm for a given parameter ω>0. The algorithm determines whether there exists a pair of slabs of width ω such that one of them is horizontal and their union covers S. If such a pair exists, we report YES. Otherwise, we report NO.

The points s1,s2,,sn of S are assumed to be sorted in decreasing order of their y-coordinates. For simplicity, we assume that no two input points have the same y-coordinate. Our approach follows that of the previously known algorithm from [6] but removes the dependency on the data structures they used. As a result, we obtain an O(n)-time decision algorithm (after sorting), improving upon the previous O(nlog2n) bound.

Consider a horizontal slab σω of width ω, and imagine sweeping σω downward over the plane. For a fixed position of σω, let SaS be the set of points strictly above σω, and let SbS be the set of points strictly below σω. Referring to Figure 7, observe that Sb dominates Sa from the beginning until a certain moment, after which Sa dominates Sb until the end, assuming that both Sa and Sb are non-empty. Observe that the answer to the decision problem is YES if and only if there exists a placement of σω such that 0pt(Sσω)ω (equivalently, 0pt(SaSb)ω).

Assumption.

For the case where the answer is YES, we assume that there exists a placement of σω such that Sa dominates Sb. The other case can be handled symmetrically by sweeping σω upward from the bottom.

Notation.

If both Sa and Sb are non-empty, there exist two outer common tangents of them. Observe that these tangent lines do not intersect each other inside σω. Let 1 denote the right tangent and 2 denote the left tangent. We denote their orientations by θ1 and θ2, respectively. See Figure 7(a). Let a1Sa and b1Sb be the points of tangency defining 1, and similarly, let a2Sa and b2Sb be the points of tangency defining 2. If either Sa or Sb is empty, then 1 and 2 (and consequently {ai,bi,θii=1,2}) are undefined.

Figure 7: Three snapshots of the sweeping process for a point set. (a) Sa, Sb, and {i,ai,bi,θii=1,2} are shown according to the notation defined above. Observe that Sb dominates Sa. (b, c) We use the notations Sa,Sb and Sa′′,Sb′′ (and the associated primed and double-primed variables) analogously for the two horizontal slabs positioned below. Observe that Sa (resp., Sa′′) dominates Sb (resp., Sb′′). (a–c) Observe that θ1θ1θ1′′ and θ2θ2θ2′′.
 Observation 8

With the above notation, Sa dominates Sb if and only if θ1θ2.

4.2.1 Overview of the Algorithm

In this section, we give an overview of the data structures maintained throughout the algorithm and explain how the main loop proceeds. We begin by recalling a data structure for maintaining the convex hull of a point set under a special sequence of insertions and deletions.

Lemma 9 ([25]).

We can dynamically maintain the convex hull of a set P of points in the plane to support each window-sliding update (i.e., either insert a point below all points of P or delete the topmost point of P) in O(1) amortized time. The convex hull can be explicitly reported in O(h) time, where h is the number of vertices of the convex hull.

We note that in the above data structure, the neighbors of any given vertex on the convex hull can be found in O(1) time. Although it is not explicitly mentioned in [25], it can be achieved since each point p (implicitly) maintains two pointers to its left and right neighbors, respectively, if p is a vertex of the current convex hull (see Sections 3.1 and 4 of [25]).

Observe that as σω moves downward, a point is inserted into Sa below all existing points of Sa, or the topmost point of Sb is deleted from Sb. We refer to each such moment as an event. Each event corresponds to a window-sliding update of either Sa or Sb, and we have at most 2n events.

Data structures and Main loop

As σω moves downward, we maintain the following using the notation defined above:

  • the dynamic data structures for conv(Sa) and conv(Sb) (from Lemma 9),

  • the tangent lines 1 and 2, with their corresponding points a1, b1, a2, and b2,

  • the two antipodal pairs of Sa with respect to the orientations θ1 and θ2, respectively.

Initially, we start with a position of σω such that Sa contains only s1, the topmost point of S. If the corresponding set Sb is empty, we stop the algorithm and report YES. Otherwise, we initialize the data structures for conv(Sa) and conv(Sb), respectively. Then we find 1 and 2, together with {ai,bi,θii=1,2}. Note that the two antipodal pairs of Sa with respect to θ1 and θ2 are both (s1,s1).

In the main loop of our decision algorithm, we do the following as σω moves downward. If Sb dominates Sa, we just update the above data structures. Once Sa begins to dominate Sb, we include, for every next event, an additional step that tests whether 0pt[θ1,θ2](Sa)ω, using the maintained data structures. If this condition holds, we stop the algorithm and report YES; otherwise, we proceed the algorithm.

If Sb becomes empty, we set θ1=0 and θ2=π. We then test whether 0pt[θ1,θ2](Sa)=0pt(Sa)ω. If this condition holds, we report YES; otherwise, we report NO.

The correctness of this algorithm, assuming that all data structures are maintained properly and the test 0pt[θ1,θ2](Sa)ω is evaluated correctly, is guaranteed by the following lemma.

 Lemma 9

For any placement of σω where Sa dominates Sb, we have 0pt(SaSb)ω if and only if 0pt[θ1,θ2](Sa)ω.

4.2.2 Maintaining Data Structures and Testing the Width Condition

In this section, we describe how to maintain the data structures and test the condition 0pt[θ1,θ2](Sa)ω for each event that occurs as σω moves downward.

We begin by proving Lemma 4.2.2, which motivates the part of the algorithm that tests whether 0pt[θ1,θ2](Sa)ω. Let σω be a horizontal slab of width ω where Sa dominates Sb. Recall that θ1 and θ2 are the orientations of the right and left outer tangent lines, respectively. By Observation 4.2, we have θ1θ2. Now, let σω be another horizontal slab of width ω, positioned below σω (the two slabs may partially overlap). We use the notations Sa, θ1, and θ2 analogously for σω. Then, it always holds that [θ1,θ2][θ1,θ2].

 Lemma 9

With the above notation, assume that 0pt[θ1,θ2](Sa)>ω. Then,
0pt[θ1,θ2](Sa)ω if and only if 0pt[θ1,θ1](Sa)ω or 0pt[θ2,θ2](Sa)ω.

We first note that the data structures (from Lemma 9) for conv(Sa) and conv(Sb) can be maintained in O(n) total time, since each event corresponds to a window-sliding update.

We now describe how to handle each event depending on its type: either an insertion into Sa or a deletion from Sb.

We first observe that if the point being inserted or deleted lies strictly between 1 and 2, then nothing changes except the convex hulls (see Figure 8). Therefore, we assume that the point corresponding to an event does not lie strictly between 1 and 2.

Figure 8: (a) p is inserted into Sa. (b) q is deleted from Sb. The red polygons show the convex hulls immediately after the events. Observe that the tangent lines 1 and 2 remain unchanged.
Insertion into 𝑺𝒂

Let p be the point inserted into Sa, and assume that p lies to the right of 1 (see Figure 9). The case where p lies to the left of 2 can be handled symmetrically.

Tangent searching.

By our assumption, 2 remains unchanged, while 1 changes. Let 1 denote the new tangent line, and let θ1 denote its orientation. Let Sa=Sa{p}. Analogously, let a1Sa and b1Sb be the points lying on 1. Note that a1=p. We find b1 by traversing conv(Sb) clockwise from b1; we refer to this as the insertion-type tangent searching procedure. This procedure takes O(1+k) time, where k is the number of vertices on conv(Sb) strictly between b1 and b1. We say that these vertices are involved in the procedure.

Antipodal pair searching.

Now we find the antipodal pairs of Sa with respect to θ1 and θ2 (since 2 does not change). Let q be the point such that (a1,q) is the antipodal pair of Sa with respect to θ1.

For the orientation θ1, observe that a1(=p) is one point of the antipodal pair of Sa. We can find the other point by traversing conv(Sa) clockwise from q. Let q denote the point such that (a1,q) is the antipodal pair of Sa with respect to θ1. We refer to this as the insertion-type antipodal-pair searching procedure, which takes O(1+k) time, where k is the number of vertices on conv(Sa) (equivalently, on conv(Sa)) strictly between q and q. We say that these vertices are involved in the procedure.

For the orientation θ2, observe that a2 is always one point of the antipodal pairs for both Sa and Sa. Let r be the point such that (a2,r) forms an antipodal pair of Sa with respect to θ2 (see Figure 9(b)). Let r be the point such that (a2,r) forms an antipodal pair of Sa with respect to θ2. Then r=r if p lies to the left of the line of orientation θ2 passing through r, and r=p otherwise.

Testing the width condition.

If Sa does not dominate Sb, there is nothing left to do. This can be easily detected by Observation 4.2. Otherwise, we need to test whether 0pt[θ1,θ2](Sa)ω. By Lemma 4.2.2, it suffices to determine whether 0pt[θ1,θ1](Sa)ω. We do this by following the antipodal pairs of Sa from the one corresponding to θ1 to that of θ1. Note that p is always one point of the antipodal pairs of Sa for all orientations between θ1 and θ1, since p lies to the right of 1. Hence, (p,q) is the antipodal pair of Sa with respect to θ1, and (p,q) is the one with respect to θ1 as explained above. By traversing conv(Sa) counterclockwise starting from q, we can visit all antipodal pairs corresponding to the range of orientations [θ1,θ1] in order. Following them sequentially allows us to find an orientation θ[θ1,θ1] that minimizes 0ptθ(Sa). This procedure takes O(1+k) time, where, as before, k is the number of vertices on conv(Sa) (equivalently, on conv(Sa)) that lie strictly between q and q. Note that this is bounded by the time required for the insertion-type antipodal-pair searching procedure.

The total time for handling point insertions as σω moves downward depends on the two procedures: the insertion-type tangent searching procedure and the insertion-type antipodal-pair searching procedure. We conclude that it takes O(n) time in total by showing that each input point can be involved at most once in each of the procedures.

 Lemma 9

Each point of S can be involved in the insertion-type tangent searching procedure and the insertion-type antipodal-pair searching procedure at most once, respectively, in the entire algorithm.

Figure 9: Two cases of insertions. In each figure, the changes after the insertion are shown in red: conv(Sa), a1, b1, and 1. In (a), observe that p becomes a point of the antipodal pair of Sa with respect to θ2. In contrast, in (b), the antipodal pair of Sa with respect to θ2 remains (a2,r) even after inserting p. In (a), two points are involved in the tangent searching procedure, and one point is involved in the antipodal-pair searching procedure.

In a symmetric way, we handle the deletion of a point from Sb. We provide a brief summary below, and the full details are given in the full version.

Deletion from 𝑺𝒃 (Summary)

Let p be the point deleted from Sb. We assume that p lies on 1, that is p=b1 (see Figure 10).

Tangent searching.

By our assumption, 2 remains unchanged, while 1 changes. Let 1 denote the new tangent line, and let θ1 denote its orientation. Define Sb=Sb{p}. Analogously, let a1Sa and b1Sb be the points lying on 1.

Let t be the counterclockwise neighbor of p on conv(Sb). We find a1 and b1 by traversing conv(Sa) clockwise from a1 and conv(Sb) clockwise from t, simultaneously. We refer to this as the deletion-type tangent searching procedure, which takes O(1+k1+k2) time, where k1 is the number of points on conv(Sa) strictly between a1 and a1, and k2 is the number of points on conv(Sb) strictly between t and b1. We say that these k1+k2 points are involved in the procedure.

Antipodal pair searching.

We find the antipodal pairs of Sa with respect to θ1. (Observe that a1 is one point of the antipodal pair.) Let q be the point such that (a1,q) is the antipodal pair of Sa with respect to θ1 and let q be the point such that (a1,q) is the antipodal pair of Sa with respect to θ1. (see Figure 10). We find q by traversing conv(Sa) clockwise from q. We refer to this as the deletion-type antipodal-pair searching procedure, which takes O(1+k) time, where k is the number of vertices on conv(Sa) strictly between q and q. We say that these vertices are involved in the procedure.

Testing the width condition.

By Lemma 4.2.2, it suffices to determine whether 0pt[θ1,θ1](Sa)ω. Recall that (a1,q) and (a1,q) are the antipodal pairs of Sa with respect to θ1 and θ1, respectively. We do this by traversing conv(Sa) clockwise, from a1 to a1 and from q to q simultaneously. This takes O(1+k1+k) time, where, as before, k1 is the number of points on conv(Sa) strictly between a1 and a1, and k is the number of vertices on conv(Sa) strictly between q and q. This is bounded by the total time required by the deletion-type tangent searching procedure and the deletion-type antipodal-pair searching procedure.

The total time for handling point deletions as σω moves downward depends on the two procedures: the deletion-type tangent searching procedure and the deletion-type antipodal-pair searching procedure. We conclude that it takes O(n) time in total by showing that each input point can be involved at most twice in each of the procedures.

Figure 10: Changes after the deletion of p are shown in red: conv(Sb), a1, b1, and 1. Observe that (a1,q) becomes the antipodal pair of Sa with respect to θ1 after the deletion. Observe that three points (k1=2,k2=1) are involved in the deletion-type tangent searching procedure and one point is involved in the deletion-type antipodal-pair searching procedure.
 Lemma 9

Each point of S can be involved in the deletion-type tangent searching procedure and the deletion-type antipodal-pair searching procedure at most twice, respectively, in the entire algorithm.

Observe that the initialization of all data structures can be done in O(n) time by Lemma 9. By Lemma 4.2.2 and 4.2.2, the total time to process all events and to evaluate the condition 0pt[θ1,θ1](Sa)ω as σω moves downward is O(n). Now we conclude the following theorem.

Theorem 10.

Given a set S of n points in the plane, sorted by their y-coordinates, and a real value ω>0, we can decide in O(n) time whether there exists a pair of slabs of width ω whose union covers S and one of which is horizontal.

4.3 Optimization Algorithm

We give a brief summary of our approach to obtain Theorem 11. Full details of the algorithm and the proof of its optimality are provided in the full version. We first sort the points of S so that s1,,sn are ordered in decreasing order of their y-coordinates. Let W denote the set of all pairwise differences between the y-coordinates of points in S. Since W can be represented as a sorted matrix [14], we can identify two consecutive values w0,w1W such that w0<ww1 in O(nlogn) time, by combining our decision algorithm described in Section 4.2 with an efficient selection algorithm for sorted matrices [15].

Observe that the sequence of changes in the sets Sa and Sb that occur as σw moves downward is the same for any w0<w<w1. Using this observation, we show that w can be computed by tracking width(SaSb) as σw moves downward, for any w0<w<w1. We track width(SaSb) by following essentially the same procedure as in the decision algorithm. The authors of [6] also use this idea, but their algorithm requires an additional data structure, which results in an extra logarithmic factor.

 Theorem 11

Given a set S of n points in the plane and an orientation θ, we can find a pair of slabs such that one of them has orientation θ and their union covers S while minimizing the maximum of their widths in O(nlogn) time.

4.4 Approximation Algorithm

Recall that in Section 3.3, we showed that an ε-certificate QS of size O(1/ε2) can be computed in O(n) time. After obtaining Q, we find a pair of slabs (σ1,σ2) such that their union covers Q, σ1 has orientation θ, and the maximum of their widths is minimized. Without loss of generality, we assume that σ1 and σ2 have the same width (otherwise, we expand the smaller one). Since QS, it follows that w(σ1)=w(σ2)w. Such a pair can be found in O(|Q|log|Q|) time by Theorem 11.

Let (σ1,σ2) be the pair of slabs obtained by taking the ε-expansions of σ1 and σ2, respectively. By the definition of an ε-expansion, σ1 has orientation θ and w(σ1)=w(σ2)(1+ε)w. Furthermore, by the definition of an ε-certificate, σ1σ2 covers S. Therefore, (σ1,σ2) forms a (1+ε)-approximate solution.

It takes O(n+|Q|log|Q|) time to obtain (σ1,σ2). Let μ=min{n,1/ε2}, then we have |Q|=O(μ). Therefore, the total running time is O(n+μlogμ), which can be expressed as both O(nlog(1/ε)) and O(n+(1/ε2)log(1/ε)). We now conclude the following theorem.

Theorem 12.

Given a set S of n points in the plane and an orientation θ, we can find a pair of slabs such that their union covers S, one of them has orientation θ, and the maximum of their widths is at most (1+ε)w in O(n+μlogμ) time, where μ=min{n,1/ε2}.

5 General Two-Line-Center

Throughout this section, we denote by Σ=(σ1,σ2) an optimal pair of slabs for the general two-line-center problem. Let w=max{w(σ1),w(σ2)}.

We begin by proving Lemma 5, which will be used to compute a candidate set of orientations for one of the slabs in a (1+ε)-approximate solution.

 Lemma 12

Let p and q be two points in 2, let w~>0 be a real number, let c1 be a constant, and let ε>0 be a real number. In O(1/ε) time, we can compute a set Γ of O(1/ε) orientations, such that the following holds:
For every finite set P of points in 2 and for every slab σ, if

(1) Pσ, (2) p,qσ, (3) d(p,q)diam(P)/4, and (4) w(σ)w~cw(σ),
then there exists an orientation γΓ and a slab σ, such that

(1) Pσ, (2) w(σ)(1+ε)w(σ), and (3) σ has the orientation γ.

By Lemma 3.1, we can compute a set F of at most 11 pairs such that one of them is an anchor pair of Σ in O(n) time. For the moment, assume that we have an anchor pair (p,q) of Σ. (We will repeat the following process for every pair in F.) Without loss of generality, assume that p,qσ1 and d(p,q)diam((σ1σ2)S)/4.

By Theorem 3, we can compute w~ such that ww~10w in O(n) time.

Consider a slab σ0 that has the same orientation as σ1, has width w, and contains σ1. In particular, if w(σ1)=w, then σ0 is σ1.

Observe that P=S(σ1σ2) and σ0 satisfy the four conditions in the statement of Lemma 5 for (p,q) and the value w~ computed above, with c=10. Therefore, in O(1/ε) time, we can compute a set Γ of O(1/ε) orientations such that there exists a slab σ with orientation γΓ that covers S(σ1σ2) and satisfies w(σ)(1+ε)w. This implies that there exists a pair of slabs whose union covers S, one of which has an orientation from Γ, and whose maximum width is at most (1+ε)w.

For every γΓ, we find a pair of slabs whose union covers S, one of which has orientation γ, and whose maximum width is minimized. By Theorem 11, this can be done in O((n/ε)logn) time in total. We repeat this procedure for every pair in F, which adds only a constant factor to the running time. Observe that each of the pairs of slabs we obtain has the property that its union covers S. Among these pairs, we output the one with the smallest maximum width. Thus, we conclude the following lemma.

Lemma 13.

We can find a pair of slabs such that their union covers S and the maximum of their widths is at most (1+ε)w in O((n/ε)logn) time.

To further refine the logarithmic term, we compute an ε-certificate Q of S (see Section 3.3). By Theorem 6, this can be done in O(n) time and |Q|=O(1/ε2). We then compute a (1+ε)-approximate pair (σ1,σ2) for the general two-line-center problem on Q, which can be done in O((|Q|/ε)log|Q|) time by Lemma 13. Without loss of generality, we assume that σ1 and σ2 have the same width (otherwise, we expand the smaller one). Let w=w(σ1)=w(σ2). Since QS, it is clear that w(1+ε)w.

Let (σ1,σ2) be the pair of slabs obtained by taking the ε-expansions of σ1 and σ2, respectively. By definition, σ1σ2 covers S, and w(σ1)=w(σ2)(1+ε)2w(1+3ε)w.

The total running time is O(n+(μ/ε)logμ), where μ=min{n, 1/ε2}, which can also be expressed as both O((n/ε)log(1/ε)) and O(n+(1/ε3)log(1/ε)). By replacing ε with ε/3, we obtain the following theorem.

Theorem 14.

Given a set S of n points in the plane, we can find a pair of slabs such that their union covers S and the maximum of their widths is at most (1+ε)w in O(n+(μ/ε)logμ) time, where μ=min{n,1/ε2}.

References

  • [1] Pankaj K. Agarwal and Cecilia Magdalena Procopiuc. Approximation algorithms for projective clustering. J. Algorithms, 46(2):115–139, 2003. doi:10.1016/S0196-6774(02)00295-X.
  • [2] Pankaj K. Agarwal, Cecilia Magdalena Procopiuc, and Kasturi R. Varadarajan. A (1+ε)-approximation algorithm for 2-line-center. Comput. Geom., 26(2):119–128, 2003. doi:10.1016/S0925-7721(03)00017-8.
  • [3] Pankaj K. Agarwal, Cecilia Magdalena Procopiuc, and Kasturi R. Varadarajan. Approximation algorithms for a k-line center. Algorithmica, 42(3-4):221–230, 2005. doi:10.1007/S00453-005-1166-X.
  • [4] Charu C. Aggarwal, Cecilia Magdalena Procopiuc, Joel L. Wolf, Philip S. Yu, and Jong Soo Park. Fast algorithms for projected clustering. In SIGMOD 1999, Proceedings ACM SIGMOD International Conference on Management of Data, June 1-3, 1999, Philadelphia, Pennsylvania, USA, pages 61–72. ACM Press, 1999. doi:10.1145/304182.304188.
  • [5] Charu C. Aggarwal and Philip S. Yu. Finding generalized projected clusters in high dimensional spaces. In Proceedings of the 2000 ACM SIGMOD International Conference on Management of Data, May 16-18, 2000, Dallas, Texas, USA, pages 70–81. ACM, 2000. doi:10.1145/342009.335383.
  • [6] Taehoon Ahn and Sang Won Bae. Constrained two-line center problems. In 35th International Symposium on Algorithms and Computation, ISAAC 2024, Sydney, Australia, December 8-11, 2024, volume 322 of LIPIcs, pages 5:1–5:17. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2024. doi:10.4230/LIPICS.ISAAC.2024.5.
  • [7] Mihai Badoiu, Sariel Har-Peled, and Piotr Indyk. Approximate clustering via core-sets. In Proceedings on 34th Annual ACM Symposium on Theory of Computing, May 19-21, 2002, Montréal, Québec, Canada, pages 250–257. ACM, 2002. doi:10.1145/509907.509947.
  • [8] Sang Won Bae. Minimum-width double-strip and parallelogram annulus. Theor. Comput. Sci., 833:133–146, 2020. doi:10.1016/J.TCS.2020.05.045.
  • [9] Gill Barequet and Sariel Har-Peled. Efficiently approximating the minimum-volume bounding box of a point set in three dimensions. J. Algorithms, 38(1):91–109, 2001. doi:10.1006/JAGM.2000.1127.
  • [10] Kaushik Chakrabarti and Sharad Mehrotra. Local dimensionality reduction: A new approach to indexing high dimensional spaces. In VLDB 2000, Proceedings of 26th International Conference on Very Large Data Bases, September 10-14, 2000, Cairo, Egypt, pages 89–100. Morgan Kaufmann, 2000. URL: http://www.vldb.org/conf/2000/P089.pdf.
  • [11] Timothy M. Chan. Faster core-set constructions and data-stream algorithms in fixed dimensions. Comput. Geom., 35(1-2):20–35, 2006. doi:10.1016/J.COMGEO.2005.10.002.
  • [12] Chaeyoon Chung, Taehoon Ahn, Sang Won Bae, and Hee-Kap Ahn. Parallel line centers with guaranteed separation. Comput. Geom., 129:102185, 2025. doi:10.1016/J.COMGEO.2025.102185.
  • [13] Vasek Chvátal. A greedy heuristic for the set-covering problem. Math. Oper. Res., 4(3):233–235, 1979. doi:10.1287/MOOR.4.3.233.
  • [14] Greg N. Frederickson and Donald B. Johnson. The complexity of selection and ranking in X+Y and matrices with sorted columns. J. Comput. Syst. Sci., 24(2):197–208, 1982. doi:10.1016/0022-0000(82)90048-4.
  • [15] Greg N. Frederickson and Donald B. Johnson. Generalized selection and ranking: Sorted matrices. SIAM J. Comput., 13(1):14–30, 1984. doi:10.1137/0213002.
  • [16] Sariel Har-Peled and Kasturi R. Varadarajan. Projective clustering in high dimensions using core-sets. In Proceedings of the 18th Annual Symposium on Computational Geometry, Barcelona, Spain, June 5-7, 2002, pages 312–318. ACM, 2002. doi:10.1145/513400.513440.
  • [17] Refael Hassin and Nimrod Megiddo. Approximation algorithms for hitting objects with straight lines. Discret. Appl. Math., 30(1):29–42, 1991. doi:10.1016/0166-218X(91)90011-K.
  • [18] Piotr Indyk, Rajeev Motwani, Prabhakar Raghavan, and Santosh S. Vempala. Locality-preserving hashing in multidimensional spaces. In Proceedings of the Twenty-Ninth Annual ACM Symposium on the Theory of Computing, El Paso, Texas, USA, May 4-6, 1997, pages 618–625. ACM, 1997. doi:10.1145/258533.258656.
  • [19] Jerzy W. Jaromczyk and Miroslaw Kowaluk. The two-line center problem from a polar view: A new algorithm and data structure. In Algorithms and Data Structures, 4th International Workshop, WADS ’95, Kingston, Ontario, Canada, August 16-18, 1995, Proceedings, volume 955 of Lecture Notes in Computer Science, pages 13–25. Springer, 1995. doi:10.1007/3-540-60220-8_47.
  • [20] D. T. Lee and Ying-Fung Wu. Geometric complexity of some loction problems. Algorithmica, 1(2):193–211, 1986. doi:10.1007/BF01840442.
  • [21] Nimrod Megiddo and Arie Tamir. On the complexity of locating linear facilities in the plane. Oper. Res. Lett., 1(5):194–197, 1982. doi:10.1016/0167-6377(82)90039-6.
  • [22] Franco P. Preparata and Michael Ian Shamos. Computational Geometry - An Introduction. Texts and Monographs in Computer Science. Springer, New Haven, CT, USA, 1985. UMI Order No. 78-18546. doi:10.1007/978-1-4612-1098-6.
  • [23] Cecilia M. Procopiuc. Projective clustering. In Encyclopedia of Machine Learning and Data Mining, pages 1018–1025. Springer, 2017. doi:10.1007/978-1-4899-7687-1_676.
  • [24] Cecilia Magdalena Procopiuc, Michael Jones, Pankaj K. Agarwal, and T. M. Murali. A monte carlo algorithm for fast projective clustering. In Proceedings of the 2002 ACM SIGMOD International Conference on Management of Data, Madison, Wisconsin, USA, June 3-6, 2002, pages 418–427. ACM, 2002. doi:10.1145/564691.564739.
  • [25] Haitao Wang. Dynamic convex hulls under window-sliding updates. Comput. Geom. Topol., 4(1):3:1–3:14, 2025. doi:10.57717/CGT.V4I1.53.