Abstract
Given a set of n disks in the plane, we study the problem of finding k lines that together intersect the maximum number of input disks. We consider three variants of this problem with the following constraints on the solution: (1) no constraint on the lines, (2) the k lines should be parallel and (3) the k lines should pass through a common point. For , we give -time algorithms for all three cases. For any fixed , we give an -time algorithm for (1). For variants (2) and (3), the running times of our algorithms vary from to .
1. Introduction
Given a set of n disks in the plane, we study the problem of finding k lines that together intersect the maximum number of input disks. In other words, we want to maximize the number of disks that intersect at least one output line. We study two other variants of this problem, where the k output lines should be parallel, and where the k lines should pass through a common point. The problems that we consider in this paper are the following. (See Figure 1).
Figure 1.
Examples of optimal solutions for Problems 1, 2 and 3 when .
Problem 1
(Maximum Coverage by k Lines). Given a set of n disks in the plane and a positive integer k, find k lines that together intersect the maximum number of input disks.
Problem 2
(Maximum Coverage by k Parallel Lines). Given a set of n disks in the plane and a positive integer k, find k parallel lines that together intersect the maximum number of input disks.
Problem 3
(Maximum Coverage by k Lines through a Point). Given a set of n disks in the plane and a positive integer k, find k lines that together intersect the maximum number of input disks and pass through a common point.
In this paper, we give algorithms for the three above problems. We will assume that k is a constant. A summary of our results is given in Table 1. In particular, for , Problem 1, 2 and 3 coincide, and we give an -time algorithm. Given a set of points in the plane, the problem of finding a line that covers the maximum number of points is 3SUM-hard [1], so an -time algorithm for any is currently out of reach for Problem 1, 2 and 3, even when .
Table 1.
The running times of our algorithms for Problem 1, 2 and 3 for a constant k. Space usage is if not explicitly stated.
Related Work
The one-dimensional version of our problem, where we want to find a set of k points that intersect the maximum number of input intervals, is known as the partial interval hitting set problem [2]. Jansen et al. [3] and Chrobak et al. [4] gave an -time algorithm.
Dumitrescu and Jiang [5] showed that the problem of hitting the maximum number of input points with k lines is APX-hard. In this paper, we consider the more general problem of hitting the maximum number of disks in the plane using k lines. To the best of our knowledge, the problem of finding k lines that together intersect the maximum number of input disks (or other geometric figures) has not been studied yet.
In the most general, combinatorial setting, we are given a collection of subsets of a larger set, and we want to find k such subsets whose union is the largest. This problem is known as the maximum coverage problem, and the simple greedy algorithm provides a approximation of the optimum [6]. Another maximum coverage problem was studied by Jin et al. They considered the problem of covering a maximum number of input points by k copies of the same rectangle or disk [7]. They provide linear-time approximation schemes, and give references to related problems.
The combinatorics of intersections between lines and balls have also been studied. In particular, Ha et al. showed that, for n disjoint spheres, if , then at most three different permutations of the spheres can appear along a line that crosses them all [8].
One motivation for studying maximum coverage by lines is to find line patterns in a two-dimensional dataset. Input disks may represent data points, each given with an imprecision that is equal to their radii. Other computational geometry problems have been studied under this imprecision model, such as the Hausdorff distance [9], the Delaunay triangulation [10] and the discrete Fréchet distance [11].
Our problem of finding line patterns is related to edge detection, which is a fundamental problem in image processing and computer vision, where the goal is to extract edges, lines or junctions from images [12]. Therefore, our algorithms could find applications in 3D reconstruction or image registration, by identifying the main lines or edges in the image. Our algorithms for lines through a point, or parallel lines, could help find symmetries in such an image.
Our algorithms could also be used for a facility location problem wherein one wants to place line facilities that are close to a set of demand regions; for instance, we may want to place k satellites at different orbits, that together cover the largest possible number of population centers. Line facility location has been studied by Cheung and Daescu, in the context of weighted regions [13].
2. Preliminaries and Notations
2.1. Partial Interval Hitting Set
In Section 4 and Section 5, we use a reduction to the partial interval hitting set problem [2]. Given a set of n closed intervals for on the real line, and a positive integer , the partial interval hitting set problem, shortly , is to find a set H of points that together hit the maximum number of intervals. We say that a point q hits an interval I if .
Chrobak et al. ([4] Section 3.1) gave a dynamic-programming algorithm for this problem which runs in time. Their algorithm uses space for pre-computing values. We show in Section 6 that we can reduce the space usage to while keeping the same time bound. In addition, when , we show that we can maintain the solution for intervals with moving endpoints in time per event using space.
2.2. Notations
We denote by a set of n closed disks in the plane. We will consider that a point is a disk of radius 0. We will assume that , as otherwise, a trivial solution to our problem is to take a line that intersects .
The orientation of a line is the angle that it forms with horizontal. More precisely, it is the angle swept from a horizontal line to ℓ in counterclockwise direction. Therefore, we have . Given an orientation , and a disk , the lowest line with orientation that is not below any point of D is called the upper tangent to D with orientation . Similarly, the highest line with orientation that is not above any point of D is called the lower tangent to D with orientation . When , the upper tangent to D is the leftmost vertical line that is not to the left to any point of D, and the lower tangent to D is the rightmost vertical line that is not to the right to any point of D. A line is said to be tangent to D if it is either the lower or the upper tangent to D for some orientation. A line that is tangent to two different disks in is called a common tangent of .
Given a directed line in the plane, the orientation of denotes the angle swept from the x-axis to in the counterclockwise direction. The orientation of a directed line is in . Given a disk D and an angle , the directed line tangent to D with orientation is the directed line with orientation that intersects the boundary of D and that has no point of D to its right.
For a disk D and a line ℓ tangent to it, we refer to the process of rotating ℓ around D while keeping it tangent to D as rotating ℓ tangentially around D.
We say that two disks and cross if , and neither nor . In this case, and have two common tangents. Two disks in have at most four common tangents, which happens when and are disjoint and have a positive radius. Two disks are said to be tangent if their boundaries intersect at exactly one point. We allow disks to be points, and hence have radius 0.
3. Maximum Coverage by k Lines
Given a set of n disks in the plane and a positive integer k, we would like to find k lines that together intersect the maximum number of input disks. In this section, we give efficient algorithms for this problem by reducing it to the problem of computing the depth of a collection of boxes, which is related to Klee’s problem [14].
3.1. A First Algorithm
We begin with the observation below.
Lemma 1.
Let ℓ be a line tangent to a disk . Suppose that there is no common tangent between D and any other disk in . Then, there is a common tangent between two disks in such that any disk intersected by ℓ is intersected by .
Proof.
As there is no common tangent between D and any other disk in , each disk in is either contained in D or contains D. There must be more than one disk contained in D, as otherwise, D or the disk that it contains, if it exists, is a subset of , which we assumed to be empty (see Section 2.2), a contradiction.
There must be a pair of disks and that are both contained in D, and either cross or are disjoint. Otherwise, the j disks contained in D would form a chain of inclusions , and we would have . This is a contradiction, as we assumed that .
We take to be a common tangent to and . Then, intersects all the disks that contain , and since ℓ only intersects these disks, the set of disks intersected by is a superset of those intersected by ℓ. □
It follows that we can choose the k lines of our solution to be common tangents between disks in :
Lemma 2.
There exists an optimal set of k lines, each of which is a common tangent of .
Proof.
Let be a line in an optimal set of k lines. We translate in a direction orthogonal to itself until it first becomes tangent to some disk . Let denote this translated line.
Suppose that there is a common tangent between and some other disk in . We rotate tangentially around until it first becomes a line tangent to some other disk . Then, the set of disks intersected by contains the set of disks intersected by . Therefore, we can replace with in our optimal solution.
On the other hand, if there is no common tangent between and any other disk in , then by Lemma 2, we can replace in our solution with a line that is a common tangent. We repeat this process until all the lines in our solution are common tangents. □
Therefore, the maximum intersection problem can be solved as follows. We first compute all the common tangents of . Among these lines, we choose k of them and count the number of disks that are intersected by the chosen lines. Then, we return the k lines that intersect the largest number of disks. It takes time in total. In the two sections below, we present more efficient algorithms.
3.2. Maximum Coverage by One Line
In this section, we assume that . We give an -time algorithm to solve the maximum coverage problem, which improves on the -time algorithm described above. By Lemma 2, we only need to find a common tangent of that intersects the maximum number of disks in . Using the duality transformation, we can find an optimal line and the set of disks intersected by this line in time as follows:
Theorem 1.
Given a set of n disks in the plane, we can find a line that intersects the maximum number of disks in time.
Proof.
We use a standard point-line duality transformation ([15] Chapter 8). A line in the primal plane corresponds to a point in the dual plane. For a disk D, let be the set of all upper tangents to D. Then, the set of points forms a curve in the dual plane. Analogously, we define to be the set of all lower tangents to D and consider the curve formed by the points . We compute these two dual curves for all disks in and compute the arrangement of them. As these curves are algebraic curves of constant degree, their arrangement has a size, and we can compute in time [16].
Let . We rotate an upper tangent ℓ of D tangentially around D and update the number of disks intersected by ℓ each time it becomes tangent to another disk, or ceases to be tangent to it. In the dual plane, this simply means that we follow the dual curve in , and add or remove the disk corresponding to any dual curve that we cross. Therefore, it can be achieved in time per vertex of that is along , and an additional time to find the number of disks that are intersected when we start rotating ℓ.
We perform the same traversal for each disk in , and we perform it for lower tangents as well. In total, it takes time as has a size . During this traversal, we record the best line that was found so far, and we return it after all the traversals are completed. □
3.3. Maximum Coverage by Lines
By Lemma 2, there is a subset of size k and an optimal solution such that each line is tangent to . We show that, if we know , we are able to find an optimal solution by reducing the problem to the depth problem [17]: Given a set of n boxes in , find a point that maximizes the number of boxes containing p. It is known that the depth problem can be solved in time when [18], and in time when using linear space [17].
Lemma 3.
Given a subset of size k, we can find k lines such that each line is tangent to and the number of intersected disks in is maximized in time when and in time when .
Proof.
We first show that finding k such tangent lines can be reduced to the depth problem. For a disk , let be the directed line tangent to D with orientation . Let be another disk in . While increasing from 0 to , the tangent intersects in at most two intervals of angles in . We say that these intervals are induced by .
For each disk , we compute the intervals induced by for every . Then, there are at most such intervals corresponding to .
Let and let be the intervals induced by , where is possibly empty. We associate to these intervals and the slab consisting of the points such that , and if , the slab consisting of the points that satisfy . These slabs are orthogonal to the -axis. As , the union of these slabs for all disks in has constant complexity. More precisely, the union of these slabs is the union of interior-disjoint boxes. (See Figure 2). We replace the union of the slabs by these boxes.
Figure 2.
(Left) a set of seven disks in the plane, where and , and . (Right) The union of slabs induced by and .
We repeat this for every disk and obtain boxes. Then, for any sequence of angles of the directed tangent lines, the number of boxes containing is the number of disks in intersected by the k tangent lines. Therefore, finding an optimum solution for a fixed reduces to the depth problem for boxes.
One issue here is that we should count only once the boundary between two boxes corresponding to the same disk , but in degenerate cases where the boundaries of two boxes overlap, we need to count twice their common boundary. The maximum depth algorithm by Chan [17] can handle this situation. □
For every subset of k distinct disks of , we find a set of k lines such that each line is tangent to a different disk in this subset, and that together intersect the maximum number of disks in . Among those sets of lines, we choose one with the largest number of intersected disks, which is an optimal solution. It follows that:
Theorem 2.
Given a set of n disks in the plane and a positive integer k, we can find k lines that together intersect the maximum number of disks in in time for and in time for , using space.
4. Maximum Coverage by k Parallel Lines
Given a set of n disks in the plane and an integer , we would like to find k parallel lines that together intersect the maximum number of disks in . We first show that this problem can be solved by reducing it to the partial interval hitting set problem. Then, we show how to improve the running time for small k.
We begin with an observation about optimal sets of k parallel lines. Given an optimal set of k parallel lines, it is always possible to translate a line of this optimal solution so that the line becomes tangent to an input disk, while keeping the same set of intersected disks. Therefore, we may assume that each line is tangent to a disk , for .
For each , we may assume that there exists a common tangent between and some other disk in . Otherwise, for each , we must have or . Therefore, without loss of generality, the disks form a chain of inclusion . In addition, all the other disks are either contained in or contain . No disk in can be contained in , as otherwise we could improve the solution by translating until it crosses this disk. It follows that , contradicting our assumption that .
We then rotate tangentially around simultaneously for all until one of the k lines becomes tangent to another disk or ceases to be tangent to it. Let denote the k lines after the rotation. As the set of disks intersected by contains the set of disks intersected by for all , we can replace our optimal set of parallel lines with . Thus we have the following observation.
Observation 1.
There exists an optimal set of k parallel lines such that every line is tangent to an input disk and at least one of them is a common tangent of .
Once we know the direction of an optimal set of lines, we project the disks in onto a line orthogonal to this direction. We obtain n closed intervals on this line. The problem of finding k lines with this orientation that intersect the maximum number of disks is equivalent to the problem of finding k points that together intersect the maximum number of intervals, which is the problem. In Section 6, Lemma 6, we show that it can be solved in time using space.
By Observation 1, we have possible orientations. So we can solve the maximum intersection problem by k parallel lines in time as k is a constant. When , we give two different algorithms which improve the running time and we provide a space-time trade-off.
Improvements for
Let and be two disks in . Let and be two parallel lines such that is tangent to for . For , we maintain an array of Booleans that records for each disk in whether it is intersected by , and we keep a counter for the number of disks in which are intersected by or . Now we simultaneously rotate the two lines tangentially around and , respectively.
Whenever becomes tangent to a disk other than , an element of the boolean list for needs to be updated and the number of intersected disks may change. The same holds for and . We call this an event. As any two disks have at most 4 common tangents, there are events in total. We precompute them, and sort them according to the orientation of the common tangents that they correspond to in time.
For each event, the number of disks in intersected by or increases or decreases by at most one, and we can update the boolean lists and compute the number of intersected disks in time. There are events in total, so it takes time.
We repeat this for every pair of disks in and find an event where the number of intersected disks is maximized. By Observation 1, the two parallel lines and corresponding to this event is an optimal solution. Thus, we obtain the following result.
Lemma 4.
Given a set of n disks in the plane, we can find two parallel lines that together intersect the maximum number of disks in in time using space.
We can improve the running time to time using space as follows.
- Let . Partition the disks into disjoint groups, each consisting of T disks, except possibly the last group containing less than T disks. Let be the set of groups.
- For every subset of of size at most two,
- (a)
- Let . For each disk , compute the sorted list of the other disks in intersected by the tangent line rotating around D in time. It takes time for all disks in .
- (b)
- For a fixed pair , we can find the maximum number of disks intersected by , in time as the ordering of the events has been precomputed. So over all the pairs , it takes time to find optimal lines , .
We consider subsets of , and we spend time for each subset. Thus we spend time in total, which is time.
Theorem 3.
Given a set of n disks in the plane and a positive integer k, we can find k parallel lines that together intersect the maximum number of disks in in time using space. For , we can find such two parallel lines in time using space and in time using space.
5. Maximum Coverage by k Lines through a Point
Concurrent lines are lines that meet at a common point, called their concurrency point. Given a set of n disks in the plane and a positive integer k, we want to find k concurrent lines that together intersect the maximum number of disks in . We can solve this problem in time by Theorem 1 for .
For , a simple modification of the algorithm from Theorem 2 gives a solution in time. The idea is the following. We use the plane-sweep algorithm by Asano and Imai to compute the depth of our set of rectangles [18]. We need to rule out the solutions consisting of two parallel lines, which correspond to points along the diagonal in our arrangement of rectangles. So at each event of the sweep, we add a negative weight to the point , which guarantees that it will not be returned as an optimal solution.
Therefore, we consider the case where , and we make the assumption that no two intersecting lines together intersect all the disks in , as otherwise we can simply solve the problem using our algorithm for .
Lemma 5.
Suppose that no two intersecting lines together intersect all the disks in . Then there exists an optimal set of k lines for such that every line is tangent to an input disk and at least two of them are common tangents of .
Proof.
Let be an optimal solution to our problem. Let be their concurrency point. When we rotate a line about , as does not intersect all the disks in , it must at some point become tangent to a disk in . So we rotate each line clockwise until it first becomes tangent to some disk in , obtaining a line . Then is still an optimal solution, and each line is tangent to a disk .
We move the intersection point along , while rotating each , tangentially around . By our assumption, no line parallel to intersects all the disks in . So must become tangent to some disk in at some point for every . Let be the point corresponding to the first such event, when p moves in either direction along . Then we obtain a new optimal solution such that is a common tangent of for some j with . If is a common tangent of , we are done. Otherwise, we apply the same argument as above to , obtaining a second common tangent. □
By Lemma 5, there exists an optimal set of k lines whose concurrency point is the intersection of two common tangents of . For every pair of common tangents , we consider the point of intersection as a candidate for being the concurrency point of an optimal solution. Thus we have candidates for being the concurrency point of an optimal solution.
Once we pick a concurrency candidate p, we can reduce our problem to the partial interval hitting set problem. Let ℓ and be the two common tangents that intersect at p. Without loss of generality, we assume that ℓ is parallel to the x-axis. Let be the set of disks in which are intersected by neither ℓ nor . For every disk D in , let be the interval of angles such that the line through p with orientation intersects D. Note that is a closed interval in . Now we solve for these intervals for , and . Let denote an optimal solution for the problem. Let denote the set of lines of orientation passing through p. Since is a set of lines that pass through p and that together intersect the maximum number of disks in , is an optimal set of k lines if ℓ and are contained in an optimal solution. Therefore, we can compute an optimal set of k concurrent lines by repeating this process for every concurrency candidate.
For , we solve for , so we need to find a point that hits the maximum number of intervals, which can be done in time by a simple scan after sorting the endpoints of the intervals. For , Chrobak et al. ([4] Section 3.1) show that can be solved in time, and we show that it can be done using only space in Section 6. Thus we can solve this problem in time and space for , and in time and space for .
We now show how the running time can be reduced to for , using space. Our approach is based on a result presented in Section 6 that shows how to update a solution to for a set of intervals with moving endpoints where an event occurs when two endpoints collide or separate. We show in Lemma 7 that the solution can be updated in time per event.
Let ℓ denote a common tangent of , and assume without loss of generality that ℓ is parallel to the x-axis. We show that we can find two lines and such that their intersection point lies on ℓ, and the number of disks in intersected by is maximized, in time. As the set of disks intersected by ℓ does not change for a fixed line ℓ, we do not take this set of disks into consideration.
Let denote the set of disks in that do not intersect ℓ. For a point p on ℓ, let be the collection of intervals which are defined for around p in the same manner as we explained in the reduction step above. We solve for and , and let be the solution. Let and denote the two lines through p with orientations and , respectively. These two lines together intersect the maximum number of disks in while passing through p.
Now suppose that we move p along ℓ. The endpoints of the intervals in will move along the real line. A solution to changes only if an event occurs, as otherwise the ordering of endpoints of the interval remains the same. The key point is that an event occurs only if p is on a concurrency candidate for ℓ. The reason is that, for a point , there exists two intervals in such that two endpoints from distinct intervals lie on the same point if and only if there exists a line which passes through q and is tangent to two disks in .
There are concurrency candidates along ℓ in total, and they can be precomputed and sorted along ℓ in time. From the pairs of disks which determine each concurrency candidate on ℓ, the corresponding event can also be found directly. We handle all the events in order and store the best two lines, and , which together intersect the maximum number of disks in . In Section 6, Lemma 7, we show how to handle each event in time. Thus, we can find and in time in total.
We repeat this for every common tangent of . By Lemma 5, there always exists an optimal set of k lines such that one of the lines is a common tangent to two disks in . Thus, the best set of k lines found during the repetition is an optimal solution. Hence, we have just proved the following theorem.
Theorem 4.
Given a set of n disks in the plane and a positive integer k, we can find k lines that pass through a common point and that together intersect the maximum number of disks in time using space. When , we can solve this problem in time using space, and time using space.
6. On the Partial Interval Hitting Set Problem
As we mentioned above, given n closed intervals , on the real line, and a positive integer , the partial hitting set problem is to find a set H of points on the real line that together hit the maximum number of intervals. We say that a point q hits an interval I if [2]. It is easy to see that, after shifting the solution points to the right until they each meet a right endpoint, that we may assume that the points in the solution are the right endpoints of input intervals.
Chrobak et al. ([4] Section 3.1) gave a dynamic-programming algorithm for this problem that runs in time. We give a sketch of their algorithm. First, it sorts the intervals using their right endpoints and relabels them so that . Let be the maximum number of input intervals that can be hit by a subset such that and , where and . Let be the number of intervals such that , namely the intervals that are hit by but not by . We first set to the number of intervals that contain . Similarly, we set to the number of intervals that contain . Then, for every and for every , we can compute using the recurrence relation .
The output value is . Chrobak et al. use space as their algorithm precomputes all values in time . We show how the space usage can be reduced to without increasing the time bound.
Lemma 6.
Given n closed intervals on the real line, and a positive integer γ, we can find a set of γ points on the line that together hit the maximum number of intervals in time using space.
Proof.
We first compute the sorted list of the interval endpoints in increasing order. We let be the number of intervals that contain for . These values can be computed in time. For a fixed b with , can be computed for all in time once and are computed for all and all .
We show that for all can be computed in (amortized) time once is computed for all . For any fixed b with , let be the number of intervals such that , and let be the number of intervals such that . Let be the number of intervals such that . For any integers with , . Thus, and for all must be computed in advance when we compute from for all . By scanning the sorted list of interval endpoints, we can compute in time and for all in time. So we can compute for all in time. Additionally, we set .
For every , we compute for all and then compute for all h. It takes time for every . As and , it takes time in total using space. □
We now consider the case where the interval endpoints move along the real line, so each endpoint p is given as a function of the time . For two intervals and , let p and q denote two endpoints such that and . Let . If , that is, if for any that is close enough to we have , and then , we say that p and qcollide. On the other hand, if and , that is, if for any that is close enough to we have , then we say that p and q separate. We say that an event occurs when two endpoints collide or separate. An event at time is one of the following types:
- ()
- Two points p and q, which are both left endpoints of intervals, collide or separate. (See Figure 3a).
Figure 3. Types of events where two interval endpoints p and q collide or separate. (a) Type (b) Type (c) Type (d) Type . - ()
- Two points p and q, where p is the left endpoint of an interval and q is the right endpoint of another interval, satisfy and collide at , or p and q separate at and . (See Figure 3b).
- ()
- Two points p and q, where p is the right endpoint of an interval and q is the left endpoint of another interval, satisfy and collide at , or p and q separate at and . (See Figure 3c).
- ()
- Two points p and q, which are both right endpoints of intervals, collide or separate. (See Figure 3d).
Lemma 7.
At each event, we can update an optimal solution to for in time after -time preprocessing using space.
Proof.
Let denote the table which stores all , and let denote the table which stores all . For , we show that an event where two interval endpoints p and q collide or separate can be handled in time so that all elements of and store correct values reflecting the situation right after the event. We first assume that no three intervals endpoints coincide at any time. At the end of this proof, we explain how to handle these degenerate cases.
For an event of type , the set of intervals which are hit by a right endpoint does not change at all. Thus nothing in and needs to change.
For an event of type , let and be the two intervals involved in the event such that and . Then at this event, the set of intervals that are hit by will change, and the set of intervals hit by any other point does not change. The number of intervals hit by increases by 1 for the case where p and q collide, and this number decreases by 1 for the other case where p and q separate. It follows that among all for , is the only element which changes. The update of can be done in time. Among all for , however, more than one element can change. We show that we can compute the changes in time in total. For both cases where the points collide or separate, changes only if or in the following way. The value increases or decreases by 1 for all . The value increases or decreases by 1 if for . Thus we can update in time in total.
The observation that changes only if or implies that changes only if becomes larger than its original value for . This can be checked in time for every once and were computed. Using additional time, we update using the recurrence relation. Thus we can update in time in total. Then we can report a new solution by computing .
For an event of type , let and be the two intervals involved in the event such that , , and holds right after the event if p and q separate at this event. If , which happens only for the case where p and q separate, we just switch the labels of two intervals so that holds. Then is the only interval such that the set of intervals which are hit by its right endpoint changes by this event. The size of the set increases by 1 for the case where p and q collide, and the size of the set decreases by 1 for the case where p and q separate. It follows that among all for , is the only element which changes. The update of can be done in time. Among all for , however, more than one element can change. We show that we can compute the changes in time in total. For both cases where points collide or separate, changes only if . More precisely, the value increases or decreases by 1 if . Thus we can update in time in total.
The observation that is the only element which changes among all for implies that changes only if becomes larger than its original value for . This can be checked in time for every once and were computed. Using additional time, we update using the recurrence relation. Thus we can update in time in total. Then we can report a new solution by computing .
We now explain how to handle degenerate cases where more than 2 endpoints collide or separate at the same time t. So we have several events of the type LL, LR, RL or RR occurring at time t. In this case, we first separately handle in an arbitrary order each of the events where two points collide, in the way that is described above. Then we obtain the solution at time t with maximum coverage. After this, we handle in an arbitrary order all the events where two points separate at time t. □
7. Discussion and Conclusions
We addressed the problem of finding k lines that together intersect the maximum number of input disks. We considered two other variants, where the k output lines should be parallel, and where the k lines should pass through a common point. We presented the first algorithms for these problems.
For , the three problems coincide, and we give an time algorithm by applying a geometric dualization. As this problem is 3SUM-hard even for covering points, an -time algorithm for any is currently out of reach.
For the problem of finding lines that together intersect the maximum number of input disks, we first show that there exists an optimal set of k lines, each of which is tangent to two input disks. Using this observation, we show that the problem can be reduced to the problem of computing the depth of a set of boxes. The running time of our algorithm is when and is time when .
For the problem of finding k parallel lines that together intersect the maximum number of input disks for , it can be reduced to the Partial Interval Hitting Set problem once the direction of the output lines is fixed. We first give -time algorithm by observing that there exists an optimal set of k parallel lines such that every line is tangent to an input disk and at least one of them is tangent to two input disks in . Then we reduce the time complexity when , at the expense of increasing the space usage by a logarithmic factor.
Our results are the first nontrivial results of these three problems, which are maximum coverage problems in geometric settings. One natural question is to extend our results to other geometric settings, for instance to covering balls by lines in . Another possible direction for further work is to consider approximation algorithms. The maximum coverage problem for arbitrary sets is known to be NP-hard, and the straightforward greedy algorithm gives a -approximation of the optimum. Can we find better approximation algorithms in geometric settings?
Author Contributions
Conceptualization, methodology and writing: C.C., A.V. and H.-K.A. All authors have read and agreed to the published version of the manuscript.
Funding
H.-K.Ahn was supported by the National Research Foundation of Korea (NRF) grant funded by the Korea government(MSIT) (RS-2023-00219980). C.Chung and H.-K.Ahn were supported by the Institute of Information & communications Technology Planning & Evaluation(IITP) grant funded by the Korea government(MSIT) (No. 2017-0-00905, Software Star Lab (Optimal Data Structure and Algorithmic Applications in Dynamic Geometric Environment)) and (No. 2019-0-01906, Artificial Intelligence Graduate School Program(POSTECH)). A. Vigneron was supported by Basic Science Research Program through the National Research Foundation of Korea (NRF) funded by the Ministry of Education (2022R1F1A107586911).
Data Availability Statement
Data are contained within the article.
Conflicts of Interest
The authors declare no conflicts of interest.
References
- Gajentaan, A.; Overmars, M. On a class of O(n2) problems in computational geometry. Comput. Geom. Theory Appl. 2012, 45, 140–152. [Google Scholar] [CrossRef][Green Version]
- Damaschke, P. Refined algorithms for hitting many intervals. Inf. Process. Lett. 2017, 118, 117–122. [Google Scholar] [CrossRef]
- Jansen, K.; Scheffler, P.; Woeginger, G. The disjoint cliques problem. RAIRO Rech. OpÉrationnelle 1997, 31, 45–66. [Google Scholar] [CrossRef]
- Chrobak, M.; Golin, M.; Lam, T.W.; Nogneng, D. Scheduling with gaps: New models and algorithms. J. Sched. 2021, 24, 381–403. [Google Scholar] [CrossRef]
- Dumitrescu, A.; Jiang, M. On the approximability of covering points by lines and related problems. Comput. Geom. 2015, 48, 703–717. [Google Scholar] [CrossRef]
- Hochbaum, D.S.; Pathria, A. Analysis of the greedy approach in problems of maximum k-coverage. Nav. Res. Logist. 1998, 45, 615–627. [Google Scholar] [CrossRef]
- Jin, K.; Li, J.; Wang, H.; Zhang, B.; Zhang, N. Near-linear time approximation schemes for geometric maximum coverage. Theor. Comput. Sci. 2018, 725, 64–78. [Google Scholar] [CrossRef]
- Ha, J.; Cheong, O.; Goaoc, X.; Yang, J. Geometric permutations of non-overlapping unit balls revisited. Comput. Geom. 2016, 53, 36–50. [Google Scholar] [CrossRef]
- Knauer, C.; Löffler, M.; Scherfenberg, M.; Wolle, T. The directed Hausdorff distance between imprecise point sets. Theor. Comput. Sci. 2011, 412, 4173–4186. [Google Scholar] [CrossRef][Green Version]
- Löffler, M.; Snoeyink, J. Delaunay triangulation of imprecise points in linear time after preprocessing. Comput. Geom. Theory Appl. 2010, 43, 234–242. [Google Scholar] [CrossRef]
- Ahn, H.; Knauer, C.; Scherfenberg, M.; Schlipf, L.; Vigneron, A. Computing the Discrete Fréchet distance with imprecise input. Int. J. Comput. Geom. Appl. 2012, 22, 27–44. [Google Scholar] [CrossRef]
- Ziou, D.; Tabbone, S. Edge detection techniques—An overview. Pattern Recognit. Image Anal. C/C Raspoznavaniye Obraz. I Anal. Izobr. 1998, 8, 537–559. [Google Scholar]
- Cheung, Y.K.; Daescu, O. Line segment facility location in weighted subdivisions. In Algorithmic Aspects in Information and Management; Goldberg, A.V., Zhou, Y., Eds.; Springer: Berlin/Heidelberg, Germany, 2009; pp. 100–113. [Google Scholar]
- Klee, V. Can the Measure of ⋃1n[ai,bi] be Computed in Less Than O(nlogn) Steps? Am. Math. Mon. 1977, 84, 284. [Google Scholar]
- Berg, M.d.; Cheong, O.; Kreveld, M.v.; Overmars, M. Computational Geometry: Algorithms and Applications, 3rd ed.; Springer: Berlin/Heidelberg, Germany, 2008. [Google Scholar]
- Amato, N.; Goodrich, M.; Ramos, E. Computing the arrangement of curve segments: Divide-and-conquer algorithms via sampling. In Proceedings of the 11th Annual ACM-SIAM Symposium on Discrete Algorithms, San Francisco, CA, USA, 9–11 January 2000; pp. 705–706. [Google Scholar]
- Chan, T.M. Klee’s Measure Problem Made Easy. In Proceedings of the 54th Annual Symposium on Foundations of Computer Science, Berkeley, CA, USA, 26–29 October 2013; pp. 410–419. [Google Scholar]
- Imai, H.; Asano, T. Finding the connected components and a maximum clique of an intersection graph of rectangles in the plane. J. Algorithms 1983, 4, 310–323. [Google Scholar] [CrossRef]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2024 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).