Online Hitting Set for Axis-Aligned Squares
Abstract
Given a set of points in the plane and a sequence of axis-aligned squares that arrive in an online fashion, the online hitting set problem consists of maintaining, by adding new points from if necessary, a hitting set , which contains at least one point in every input square that has already arrived. We present an -competitive deterministic algorithm for this problem. The competitive ratio is the best possible, apart from constant factors. In fact, this is the first -competitive algorithm for the online hitting set problem that works for geometric objects of arbitrary sizes (i.e., unbounded scaling factors) in the plane. We further generalize this result to positive homothets of a polygon with vertices in the plane and provide an -competitive algorithm.
Keywords and phrases:
axis-aligned squares, hitting set, homothets of a polygon, online algorithmFunding:
Satyam Singh: Research on this paper was supported by the Research Council of Finland, Grant 363444.Copyright and License:
2012 ACM Subject Classification:
Theory of computation Computational geometry ; Theory of computation Online algorithmsAcknowledgements:
We thank an anonymous reviewer for a suggestion that helped improve the competitive ratio in Theorem 1 from to .Editor:
Pierre FraigniaudSeries and Publisher:
Leibniz International Proceedings in Informatics, Schloss Dagstuhl – Leibniz-Zentrum für Informatik
1 Introduction
The minimum hitting set problem is one of Karp’s 21 classic NP-hard problems [24]. Given a set of elements and a collection of subsets of , referred to as ranges, we need to find a set (hitting set) of minimal size such that every set contains at least one element of . Motivated by numerous applications in VLSI design, resource allocation, and wireless networks, researchers have extensively studied the problem for geometric range spaces. In the geometric hitting set problem, we have for some constant dimension , and the sets in are geometric objects of some type, such as balls, unit balls, simplices, hypercubes, or hyper-rectangles. Note that the minimum hitting set problem is dual to the minimum set cover problem in the abstract setting, but this duality in general does not extend to the geometric setting.
In this paper, we study the online hitting set problem for geometric objects. In the online geometric hitting set problem, the point set is known in advance, while the objects in arrive one at a time (without prior knowledge). We need to maintain a hitting set for the first objects for all . Importantly, in the online model, points may be added to the hitting set as new objects arrive, but they cannot be removed (i.e., for ). Upon the arrival of a new object , any number of points can be added to the hitting set. Depending on whether is finite [18, 20, 23, 26] or infinite [2, 14, 17, 19, 21, 22], there are different versions of the online geometric hitting set problem. In this paper, we consider to be a finite set of points in .
The quality measure for online algorithms is the competitive ratio, which quantifies the loss of performance due to irrevocable decisions made based on incomplete information. Let ALG be an algorithm for the online hitting set problem on an instance . The competitive ratio of ALG, denoted by , is the supremum, over all possible input sequences , of the ratio between the size of the hitting set obtained by the online algorithm and the minimum size of a hitting set for the same input:
1.1 Related Previous Work
Alon et al. [3] initiated the study of the online hitting set problem and presented a deterministic algorithm with a competitive ratio of and obtained an almost matching lower bound of . While their work addresses the general setting, Even and Smorodinsky [23] initiated the study of the online geometric hitting set problem for various geometric objects. They established an optimal competitive ratio of when is a finite subset of , and the objects are intervals in . They also established an optimal competitive ratio of when is a finite subset of , and the objects are half-planes or congruent disks in the plane.
Later, Khan et al. [26] examined the problem for the special case of a finite set of integer points and a collection of axis-aligned squares with integer coordinates, for . They developed an -competitive deterministic algorithm for this variant. They also established a randomized lower bound of , where is finite and consists of congruent axis-aligned squares. De et al. [18, 20] further investigated the problem for an arbitrary finite set , where consists of homothetic geometric objects with scaling factors (e.g., diameters) in the interval for some parameter . In [18], they considered homothetic copies of a regular -gon (for ) and developed a randomized algorithm with expected competitive ratio . Although regular -gons can approximate disks as , this result does not imply a competitive algorithm for disks with radii in . In [20], they addressed this gap by presenting an -competitive deterministic algorithm for homothetic disks, and further generalized their result to positive homothets of any convex body in the plane with scaling factors in .
However, it remained an open problem whether the dependence on the parameter is necessary, or whether there is an -competitive online hitting set algorithm for arbitrary homothets of a polygon or for arbitrary disks in the plane. In fact, the full version of Khan et al. [26] posed this as an open problem specifically for axis-aligned squares.
1.2 Our Contribution
We present the first -competitive algorithm for the online hitting set problem for a set of points and geometric objects of arbitrary sizes in the plane; Table 1 summarizes both previous and new results. Our algorithm works for axis-aligned squares of arbitrary sizes, and it generalizes to axis-aligned rectangles of bounded aspect ratio. The aspect ratio of a rectangle is the ratio of the length of the longer to that of the shorter side (e.g., the aspect ratio of a square is 1, and the aspect ratio of a or a rectangle is 2).
| Finite Point Set | Objects | Lower Bound | Upper Bound |
|---|---|---|---|
| Intervals in | [23] | [23] | |
| Half-planes in | [23] | [23] | |
| Congruent disks in | [23] | [23] | |
| Axis-aligned squares with integral vertices | [26] | [26] | |
| Bottomless rectangles (of the form ) | [23] | [20] | |
| Positive homothets of an arbitrary convex body in with scaling factors in | [26] | [20] | |
| Axis-aligned squares | [26] | [Theorem 1] | |
| Axis-aligned rectangles of aspect ratio at most | [26] | [Theorem 1] | |
| Positive homothets of a polygon with vertices | [26] | [Theorem 2] |
Theorem 1.
For every , there is an -competitive deterministic algorithm for the online hitting set problem for any set of points in the plane and a sequence of axis-aligned rectangles of aspect ratio at most .
We further generalize Theorem 1 to positive homothets of a polygon.
Theorem 2.
Let be a polygon with vertices. Then there is an -competitive deterministic algorithm for the online hitting set problem for any set of points in the plane, and a sequence of positive homothets of .
The previous best competitive ratio for these problems was , by Alon et al. [3], which holds more generally for any collection of sets of polynomial size, including any collection of geometric objects of bounded VC-dimension. As noted above, De et al. [18] designed an -competitive randomized algorithm for homothets of regular -gons with scaling factors in the range . Theorem 2 provides a deterministic algorithm for homothets of arbitrary convex -gons of arbitrary sizes. However, it is unclear whether the dependence on is necessary. Even and Smorodinsky [23] asked whether there is an online hitting set algorithm with an -competitive ratio for any set system on points with bounded VC-dimension. Khan et al. [26] asked whether there is an -competitive algorithm for the online hitting set problem with squares, as their algorithm is restricted to integer points in and it is -competitive even if . Our result (Theorem 1) gives an affirmative answer to their question. It is unclear whether -competitive online algorithms are possible for any other families of geometric set systems. In Section 6, we briefly discuss roadblocks to possible generalizations to disks (of arbitrary radii) in or to cubes in , as well as possible extensions to the dual problem of online geometric set cover.
Technical highlights.
We present the key ideas for axis-aligned squares (of arbitrary size), since all technical tools readily generalize to axis-aligned rectangles of bounded aspect ratio. Recall that the point set is given in advance, that axis-aligned squares arrive one-by-one, and that we need to construct a hitting set of size where is an optimal hitting set for . Each square is hit by an unknown point in the offline optimum; we would like to add points to that also hit many other potential squares that contain (the unknown) point . Our general strategy is to preprocess into a hierarchy of depth , and then use this hierarchy to narrow down the possible location of the points in OPT. In one dimension, where and is a sequence of intervals, a simple binary hierarchy is sufficient [23].
In the plane, we preprocess with the classical BBD tree data structure by Arya et al. [5], which has found a wide range of applications in computational geometry, including binary space partitions, range searching, and many other problems [1, 4, 5, 11, 25]; this data structure was previously used for the online geometric set cover problem by Khan et al. [26]. For a set of points, the BBD tree is a hierarchical space partition of depth , where all cells of the partition are “fat” (in the sense defined below). When a square arrives online, we choose hitting points via a top-down traversal of the BBD tree. Specifically, we “activate” the lowest inactive cells of the BBD tree that intersect (see Section 4 for details), and add extremal points in each of these cells to . The extremal points of a rectangular cell are simply the leftmost, rightmost, topmost, and bottommost points in (i.e., extremal with respect to axis-parallel directions). Extremal points have previously been used in computational geometry for many different problems, including guarding set or shortest path problems [8, 10, 16, 30], as well as restricted versions of the online hitting set problem in combination with quadtrees [26].
Unfortunately, the cells in the BBD tree are not necessarily convex – they include rectangles with a rectangular hole – so we need to define extremal points much more carefully. The intersection of a cell of the BBD tree and a square can be reduced to axis-aligned half-spaces, and we show that is either empty or contains at least one extremal point of (see Section 3.2 for details). Note that these techniques work for arbitrary axis-aligned fat rectangles (the fatness of a rectangle is quantified by the aspect ratio ): extremal points in the four axis-parallel directions are sufficient if is an axis-aligned rectangle, and the intersection reduces to halfplanes if both and are fat.
Each (unknown) point is contained in cells of the BBD tree. After steps, in which a square arrives that contains the point but our algorithm adds new points to , the BBD tree is “saturated”, in the sense that all cells containing are activated – at this point, the extremal points in already hit any subsequent square that contains . We prove that our algorithm uses only points for any sequence of squares that can be optimally hit by a single point; see Section 4.2 for further details.
Relation to online set cover for squares.
Consider the online geometric set cover problem: given a set of geometric objects in , and a sequence of points arriving one by one, we need to maintain a set cover for the first points in an online fashion. Note, however, that the hitting set and the set cover problems are not equivalent in the geometric setting: points in the plane form a 2-parameter family (parameterized by - and -coordinates), while axis-aligned squares form a 3-parameter family (parameterized by, e.g., a lower-left corner and a side length). In the online hitting set problem, the 2-parameter family is known in advance, and the 3-parameter family arrives without prior knowledge – the roles are reversed in online set cover. That is, an online hitting set algorithm makes decisions based on less information (i.e., more uncertainty) than an analogous online set cover algorithm. Importantly, these problems are not equivalent, and techniques developed for one problem do not easily carry over to the other. Khan et al. [26] studied a restricted version of the online set cover problem for axis-aligned squares. In their model, both a collection of axis-aligned squares and a set of points are given in advance. Points from arrive online, and we need to maintain a set of squares that cover the first points. Using a BBD tree decomposition over the point set , they obtain a deterministic -competitive algorithm.
We remark that their result yields an -competitive algorithm for the unrestricted version of the online set cover problem for axis-aligned squares (where is not given in advance). An arrangement of squares in the plane determines cells: points in the same cell are contained in the same subset of squares (they are combinatorially indistinguishable). We can define as a set of representative points, one from each cell. When a sequence of arbitrary points arrive online, we can replace each point with the representative of its cell, and invoke the algorithm by Khan et al. [26], with competitive ratio .
Organization.
Section 2 begins by introducing the necessary definitions and then reviews a classical space partition data structure, the Balanced Box Decomposition Tree (BBD tree) [6]. Section 3 presents several key properties of BBD trees. Section 4 describes our online algorithm for hitting axis-aligned rectangles, and analyzes its competitive ratio. Next, Section 5 generalizes the main result from axis-aligned squares to positive homothets of an arbitrary polygon. Finally, Section 6 concludes with a discussion of future research directions.
2 Notation and Preliminaries
Unless stated otherwise, the term object refers to a compact set in with a nonempty interior. Let denote such an object. For a scaling parameter and a translation vector , the set is called a homothet or homothetic copy of ; and it is a positive homothet if .
BBD Trees.
Arya et al. [6] introduced the Balanced Box Decomposition Tree (BBD tree, for short), which is a binary space partition tree for a set of points in . Since its introduction in the 1990s, BBD trees have become a widely used data structure for processing and classifying spatial data in computational geometry and related fields. In contrast to the quadtree (or compressed quadtree), the depth of the BBD tree is , and the nodes correspond to “fat” regions; the precise definition is given below.
For a set of points in an axis-aligned square (the bounding box), the BBD tree is a binary tree , where the nodes correspond to regions, called cells (with the root corresponding to the bounding box). The parent-child relation corresponds to containment between the corresponding cells with the following properties:
-
Each node corresponds to a cell , where and are axis-aligned rectangles such that , and where possibly .
-
the aspect ratio of and (if ) is at most 3;
-
if , then it is sticky, which means that the vertical (respectively, horizontal) distance between and the boundary of is either 0 or at least the side length of . An equivalent condition for stickiness can be obtained by considering the regular grid consisting of translated copies of , centered around . The rectangle is sticky for if and only if every copy of in this grid either lies entirely within or is disjoint from the interior of , see Figure 1;
-
the cells form a laminar set system, that is, if is a descendant of , then , otherwise ;
-
for each leaf node , the region contains at most one point of .
Each internal node has exactly two children, generated by one of two operations: a fair split, which decomposes a cell along an axis-parallel line into two cells, or a shrink, which introduces a new box such that and decomposes into and . Furthermore, the number of nodes in is , the depth of is , and the entire structure can be constructed in time [6].
3 A Rectangle amid Cells of the BBD Tree
In this section, we present some important properties of BBD trees and discuss the relative position of an arbitrary axis-aligned rectangle of bounded aspect ratio with respect to the cells of the BBD tree. These properties play a crucial role in the design and analysis of our algorithms in Sections 4 and 5.
3.1 Crossing Between Rectangles and Cells of the BBD Tree
Let be a BBD tree for a finite point set . We say that an axis-aligned rectangle crosses a cell , , if but does not contain any vertex of and does not contain any vertex of (i.e., vertices of and vertices of if any). See Figure 2 for examples.
Lemma 3.
If is an axis-aligned rectangle of aspect ratio at most , for some , then it crosses interior-disjoint cells of a BBD tree.
Proof.
Let be a BBD tree, and let be a set of nodes that corresponds to a family of interior-disjoint cells crossed by . Let . Recall that a cell of the BBD tree is defined as , where may be empty. Depending on how intersects with , we distinguish between two cases.
Case 1: crosses and intersects two opposite edges of .
Assume w.l.o.g. that intersects two vertical edges of (i.e., crosses horizontally); see Figure 2(a). Since the aspect ratios of and are and at most 3, respectively, then we have
In particular, this implies . Note also that . If horizontally crosses interior-disjoint rectangles , then
hence . That is, horizontally crosses at most interior-disjoint cells. Similarly, may cross at most cells vertically. However, if crosses a cell horizontally and another cell vertically, then . In particular, cannot contain both and . Overall, crosses at most interior-disjoint cells in this case.
Case 2: crosses and intersects a pair of parallel edges in and , respectively.
Assume w.l.o.g. that intersects the left side of both and ; see Figure 2(b). Let denote the distance between the left sides of and . Then we have , and in particular . Due to the stickiness, we also have . Overall, we obtain
By the pigeonhole principle, crosses at most interior-disjoint cells between the left sides of and . Similarly, crosses at most interior-disjoint cells between the right (respectively, top, bottom) sides of and . As a result, crosses interior-disjoint cells in this case.
3.2 Extremal Points and their Properties
For each node of the BBD tree, we define a set consisting of a constant number of extremal points in .
-
For an axis-aligned rectangle , let be a subset of that consists of a point with the minimum -coordinate, maximum -coordinate, minimum -coordinate, and maximum -coordinate (ties are broken arbitrarily).
-
If (that is, ), then let ; see Figure 3(a).
-
If , then we subdivide along the lines spanned by the four sides of into , , rectangular regions and let ; see Figure 3(b).
Properties of extremal points.
We state a few properties of extremal points that will be used in the competitive analysis of our online algorithm in Section 4. Let be a finite set of points in a bounding box (a square), and be a BBD tree for .
Lemma 4.
Let be an axis-aligned rectangle, and be a half-plane bounded by an axis-parallel line . If , then .
Proof.
Assume w.l.o.g. that is the vertical line , for some , and let be the left half-plane; see Figure 4(a). We prove the contrapositive. If , then every point satisfies . In particular, we have for the leftmost point in , hence we have for all points in . This implies that , as required.
Lemma 5.
Let be a cell (where may be empty), and be a half-plane bounded by an axis-parallel line . If , then .
Proof.
Assume w.l.o.g. that is the vertical line for some , and let ; see Figure 4(b) for an illustration. We prove the contrapositive. Suppose that . Then every point of has -coordinate larger than . Recall that . The leftmost point of is the leftmost point of for some . This point is included in , and hence in . Consequently, contains the leftmost point of . Then, all points of have -coordinate larger than . Hence, we have , as required.
Lemma 6.
Let be a cell, and denote the intersection of two half-planes bounded by two horizontal lines or two vertical lines and . If and contains a corner of , then .
Proof.
Assume w.l.o.g. that and are the vertical lines and , respectively, for some ; see Figure 5 for an illustration. Let be the left half-plane. If is also a left half-plane, then is a half-plane and Lemma 5 completes the proof. So we may assume that is the right half-plane, and (since ).
Assume that contains a corner of . Recall that is subdivided along the lines spanned by the sides of . One of the subdivision lines is , where (since ). Consequently, every subrectangle of intersects at most one of and .
Since , there exists a point . Assume that , where is one of the subrectangles of . Since and by Lemma 4, we have , thus we have . Hence, the lemma follows.
Lemma 7.
Let be a cell, and let be the intersection of two half-planes bounded by two perpendicular axis-parallel lines and . If and , then .
Proof.
Assume w.l.o.g. that is the vertical line , and is the horizontal line for some ; see Figure 6 for an illustration. Let be the left half-plane and be the top half-plane; see Figure 6. Since , then intersects the subrectangles of above and below (v); and intersects the subrectangles of to the left and right of . In particular, none of the subrectangles in intersects both and .
Since , there exists a point . Assume that , where is one of the subrectangles of . Since intersects at most one of and , then equals or . In both cases, by Lemma 4, we have . Now implies that , as required.
4 Online Algorithm and Competitive Analysis
In this section, we first prove Theorem 8. In Section 4.1, we present our online hitting set algorithm for axis-aligned rectangles of aspect ratio , for constant . In Section 4.2, we analyze its competitive ratio, and then use this algorithm as a subroutine to prove Theorem 1.
Theorem 8.
For every , there is an -competitive deterministic algorithm for the online hitting set problem for any set of points in the plane and a sequence of axis-aligned rectangles of aspect ratio at most .
4.1 Online Algorithm
We now describe our online algorithm. Given a set of points in the plane, we compute a BBD tree for , and the set of extremal points for all nodes . As the adversary presents a sequence of axis-aligned rectangles of aspect ratio at most , we maintain the following data structures:
A hitting set for the first rectangles , which is initialized to . A set of active nodes of with the following property: If a node is active, then all ancestors of are also active. Initially, all nodes are inactive (i.e., ); inactive nodes can become active, and any active node remains active for the remainder of the algorithm. Furthermore, we maintain the property that , i.e., contains the extremal points of all active nodes (however, may contain additional points as well).
When a rectangle arrives, initialize and . If , then no further changes are needed in our data structures. Suppose that .
-
1.
Consider the four corners of .
-
(a)
For each corner , find the highest inactive node such that : activate and its sibling (set ) and add their extremal points to (set ).
-
(b)
For each corner , if the root of is not already active, then activate the root and add its extremal points to .
-
(a)
-
2.
For every node where crosses ,
-
(a)
If is already active but its children are not, then activate both children of and add their extremal points to .
-
(b)
If is inactive, then find the highest inactive ancestor of (possibly ): activate and its sibling and add their extremal points to .
-
(a)
-
3.
If still holds, then add an arbitrary point in to .
4.2 Competitive Analysis
The algorithm guarantees that is a hitting set for the first objects . It is also clear that for each new object , we add new points to : Since has four corners and crosses cells of the BBD tree by Lemma 3.
Let be an offline optimum, i.e., a minimum hitting set for . For each point , let be the set of objects hit by . It is sufficient to show that for every , the algorithm adds new points to the hitting set in steps to hit objects in (cf. Corollary 10). Since points are added to the hitting set in each such step, then the algorithm adds points in response to the objects in , and hence points in response to all objects in .
Lemma 9.
If and , then in step , the algorithm activates a cell of the BBD tree containing .
Proof.
The algorithm activates the root in step . In the remainder of the proof, we may assume that and the root is already active. Before the arrival of , we have , so the leaf node of the BBD tree that contains is inactive. Let be the lowest active node in the BBD tree such that contains . Let and be the two children of such that (hence ).
We need to show that the algorithm activates in step . Suppose, for the sake of contradiction, that is inactive at the beginning of step . Then its sibling is also inactive at that time (since our algorithm always activates two siblings).
The algorithm activates the highest inactive nodes that contain any of the four corners of (and their siblings), as well as the highest inactive nodes corresponding to every cell crossed by (and their siblings). Therefore, we may assume that neither nor contains any corner of , and neither of them is crossed by . Since , then does not contain any corner of , either. If crosses , then at the beginning of step , node is active but its children and are inactive, and so the algorithm would activate both and in step . For this reason, we may also assume that does not cross .
We examine all possible positions of and relative to . Recall that , where may be empty.
Case 1: ; see Figure 7(a).
In this case, all four corners of are in . If all four corners of are in , then , which contradicts the assumption that . Therefore, a corner of lies in . For this corner of , the highest inactive node is or . Consequently, the algorithm activates both siblings and . In particular, is activated.
Case 2: but contains some corner of ; see Figure 7(b-c).
Since does not contain any corners of , then all corners of in are in . Since , then contains either one or two corners of . We examine each case separately:
Case 2a: contains precisely one corner of .
Assume w.l.o.g. that contains the lower-right corner of (as in Figure 7(b)). Denote by the lower-right corner of . Then also contains precisely one corner of , namely its upper-left corner. Since the remaining three corners of are outside of both and , they are outside of . Consequently, also contains precisely one corner of , namely the upper-left corner of . Since , then Lemma 7 yields . However, was activated in a previous step. This implies that , hence : a contradiction.
Case 2b: contains exactly two corners of .
Recall that an axis-aligned rectangle crosses a cell , for if but does not contain any vertex of and does not contain any vertex of . Consequently, crosses : a contradiction.
Case 3: does not contain any corner of , but it intersects some edges of ; see Figure 7(d-e).
Let be an edge of that intersects , where and are corners of . Since contains neither nor , then both and are outside of , and so the two edges of orthogonal to are also outside of . Consequently, intersects one edge of or two parallel edges of .
Case 3a: intersects precisely one edge of .
Case 3b: intersects two parallel edges of .
Assume w.l.o.g. that intersects the left and right edges of . If does not contain any corners of , then does not contain any vertex of , and so crosses : a contradiction.
So we may assume that contains some corners of . Lemma 6 yields . However, was activated in a previous step. This implies that , hence : a contradiction.
Case 4: lies in the interior of ; see Figure 7(f).
Since , then , and so . Since is active, then , and implies that . Consequently, : a contradiction.
Corollary 10.
For every , the algorithm adds new points to the hitting set in steps in which rectangles in arrive.
Proof.
Let be the set of rectangles for which the algorithm adds new hitting points to (that is, any rectangle contains , but does not require new hitting points as ). By Lemma 9, the algorithm activates a cell containing to hit each rectangle in . In the BBD tree, the cells containing correspond to a descending path from root to leaf. Since the depth of the BBD tree for points is , there are such cells, which implies that , as required. This completes the proof of Theorem 8. Now we have all the tools to prove Theorem 1.
Proof of Theorem 1.
Theorem 8 implies the claim if . Assume that . Partition the incoming rectangles into classes: let be the set of rectangles of aspect ratio in , and for , let be the set of rectangles of aspect ratio in . Within each class, we further separate rectangles whose width is at least their height from those whose height exceeds their width, yielding classes in total. Applying the linear transformation (respectively, ) to both and the rectangles in the -th class maps each rectangle to one with aspect ratio in . Since the scaling is applied to both and the rectangles, any hitting set for the original instance corresponds to a hitting set of the same size in the scaled instance. Furthermore, the size of an offline optimum for each class is at most , the size of the offline hitting set of all rectangles. Running a separate instance of our online algorithm with on each of the classes yields a hitting set of size per class. Taking the union of the resulting hitting sets over all classes is a hitting set of size .
4.3 Runtime Analysis
It is not difficult to implement our online algorithm (Section 4.1) for points in the plane with preprocessing time and update time. It is known that the BBD tree can be computed in time [6]. Recall that the BBD tree has depth , and the cells on each level are interior-disjoint. Consequently, the extremal points on each level can be computed using four sweep-line algorithms (one for each axis-aligned direction) in time; and the extremal points of all cells can be computed in time.
We need several data structures to support our online algorithm. First, we need an orthogonal range searching data structure for that reports a point in for a query rectangle . The classical data structure by Chazelle [15] (see also [7, Chap. 5]) already achieves preprocessing and query time. Second, we need a semi-dynamic orthogonal range emptiness data structure for that supports insertions and emptiness queries . The semi-dynamic data structure by Mehlhorn and Näher [27, Theorem 8] supports insertion and query time. (We note that amortized update and query time is possible in the word RAM model [12, 13, 28], i.e., in the rank space of the point set , which distorts the aspect ratios of orthogonal ranges). Finally, we also augment the BBD tree with binary variables to indicate which cells are active.
When a rectangle arrives, we can test whether in time using the semi-dynamic range emptiness data structure for . If requires new hitting points, we use the BBD tree to find the highest inactive cells containing the four corners of , as well as the highest inactive cells that cross , in time. We can then activate these cells and their siblings, and add extremal points to the hitting set in time. If does not contain any of the new extremal points added , we can find a suitable hitting point in in time using the orthogonal range reporting data structure for . Finally, updating the semi-dynamic range emptiness data structure for takes time.
In the proof of Theorem 1, we run parallel instances of this online algorithm, each acting on distinct classes of rectangles. So the preprocessing time increases to but the update time remains .
5 Generalizations to Positive Homothets of Polygons
In Section 4, we presented an -competitive algorithm for the online hitting set problem with points in the plane and axis-aligned squares (of aspect ratio ). Axis-aligned squares are homothets of a unit square. Since a suitable linear transformation maps any parallelogram to a unit square, our result extends to positive homothets of any parallelogram.
Corollary 11.
For every parallelogram in the plane, there is an -competitive algorithm for the online hitting set problem for any set of points in the plane and a sequence of positive homothets of in the plane.
We further generalize Theorem 1 to positive homothets of polygons with vertices.
Lemma 12.
Every polygon with vertices is the union of at most parallelograms.
Proof.
Every simple polygon with vertices admits a triangulation with triangles. In general, a polygon with vertices and holes admits a triangulation with triangles [29, Lemma 5.2]. We have , as every hole as well as the outer boundary has at least 3 vertices. Therefore, is the union of at most triangles. Every triangle is decomposed by its three medians into four congruent subtriangles: one containing the center of , and three incident to each of the corners of . The union of the central subtriangle and a corner subtriangle is a parallelogram; see Figure 8. Thus, is the union of three parallelograms, and consequently is the union of at most parallelograms.
Lemma 13.
Let be a polygon that can be written as a union of parallelograms. Then there is an -competitive deterministic algorithm for the online hitting set problem for any set of points and a sequence of positive homothets of in the plane.
Proof.
Assume that is the union of parallelograms, i.e., , where each is a parallelogram. By Corollary 11, there is an -competitive deterministic algorithm for the online hitting set problem for the same point set and a sequence of positive homothets of the parallelogram , for every .
Online algorithm.
We now describe a deterministic online algorithm for the point set and a sequence of positive homothets of . For every , we have for some scaling factor and translation vector . Since , then , where is a positive homothet of the parallelogram .
We maintain a hitting set for the first homothets . We initialize the algorithm for , that each maintain a hitting set for some subset of the first parallelograms . We also maintain the set .
When a homothet arrives, we initialize , and for all . If , then no further changes are needed. Otherwise, we compute the parallelograms for . For each , if , then we feed to the algorithm , which in turn adds new points to . Finally, we update by setting . This completes the description of the algorithm.
Competitive analysis.
The algorithm guarantees that is a hitting set for the first objects . It is also clear that for each new object , we add new points to : since each algorithm adds points to .
Let be an offline optimum, i.e., a minimum hitting set for . For each point , let be the set of objects hit by . It is sufficient to show that for every , the algorithm adds points to in response to the arrival of the objects in .
Let be a set of objects such that our algorithm adds new points to the hitting set in step . Since our algorithm adds points to the hitting set in each step, it is enough to show that . We further partition based on which parallelograms are hit by point . For , let ; and . By definition, . Note that is a set of homothets of the parallelogram that contain the point . By assumption, algorithm is -competitive, and therefore adds points to the hitting set in response to parallelograms in . Recall that we feed a parallelogram to only if object has not been hit by , and hence adds at least one new point to the hitting set in step . Consequently, we have . Overall, we obtain , as required. Hence, the theorem follows.
6 Conclusions
Our main result (Theorem 1) is an -competitive algorithm for the online hitting set problem for points in the plane, and a sequence of axis-aligned squares (or axis-aligned rectangles of bounded aspect ratio). This is the first online hitting set algorithm that is -competitive for geometric objects of arbitrary sizes in the plane. Our result further generalizes to positive homothets of any simple -gon for , and achieves an -competitive algorithm. Even though a disk can be approximated by a regular -gon as , our generalized result does not imply any competitive algorithm for disks. Very recently, Bhore, Gupta and Kumar [9] presented a randomized online hitting set algorithm with expected competitive ratio for points and a sequence of pseudo-disks in the plane, including disks of arbitrary radii, or positive homothets of a convex polygon (with arbitrarily many vertices). It remains an open problem whether deterministic -competitive algorithms are possible for these classes of geometric objects.
Does our result generalize to higher dimensions? Is there an -competitive online hitting set algorithm for axis-aligned cubes of arbitrary sizes in for a constant dimension ? Is there one for ? While BBD trees generalize to , for any constant dimension , our online algorithm does not generalize to (hyper-)cubes in -space. The reason is that the extremal points (cf. Section 3.2) do not necessarily capture the intersection of a cell of the BBD tree and an axis-aligned box. In the plane, we have shown that contains a vertex of , or is a crossing intersection, or behaves as an axis-aligned halfplane with respect to the sub-rectangles of (Section 3.2). However, in , , it is possible that contains exactly one edge of the cell and yet does not contain any of the extremal points of . It remains open whether -competitive algorithms are possible for geometric objects of arbitrary sizes in dimensions .
References
- [1] Pankaj K. Agarwal, Kyle Fox, Kamesh Munagala, and Abhinandan Nath. Parallel algorithms for constructing range and nearest-neighbor searching data structures. In Proc. 35th ACM Symposium on Principles of Database Systems, (PODS), pages 429–440. ACM, 2016. doi:10.1145/2902251.2902303.
- [2] Shanli Alefkhani, Nima Khodaveisi, and Mathieu Mari. Online hitting set of -dimensional fat objects. In Proc. 21st International Workshop on Approximation and Online Algorithms, (WAOA), volume 14297 of LNCS, pages 134–144. Springer, 2023. doi:10.1007/978-3-031-49815-2_10.
- [3] Noga Alon, Baruch Awerbuch, Yossi Azar, Niv Buchbinder, and Joseph Naor. The online set cover problem. SIAM J. Comput., 39(2):361–370, 2009. doi:10.1137/060661946.
- [4] Sunil Arya, Theocharis Malamatos, and David M. Mount. Space-time tradeoffs for approximate nearest neighbor searching. J. ACM, 57(1):1:1–1:54, 2009. doi:10.1145/1613676.1613677.
- [5] Sunil Arya and David M. Mount. Approximate range searching. Comput. Geom., 17(3-4):135–152, 2000. doi:10.1016/S0925-7721(00)00022-5.
- [6] Sunil Arya, David M. Mount, Nathan S. Netanyahu, Ruth Silverman, and Angela Y. Wu. An optimal algorithm for approximate nearest neighbor searching fixed dimensions. J. ACM, 45(6):891–923, 1998. doi:10.1145/293347.293348.
- [7] Mark de Berg, Otfried Cheong, Marc J. van Kreveld, and Mark H. Overmars. Computational Geometry: Algorithms and Applications. Springer, 3rd edition, 2008. doi:10.1007/978-3-540-77974-2.
- [8] Mark de Berg, Haggai David, Matthew J. Katz, Mark H. Overmars, A. Frank van der Stappen, and Jules Vleugels. Guarding scenes against invasive hypercubes. Comput. Geom., 26(2):99–117, 2003. doi:10.1016/S0925-7721(03)00016-6.
- [9] Sujoy Bhore, Anupam Gupta, and Amit Kumar. Improved Online Hitting Set Algorithms for Structured and Geometric Set Systems. In 42nd International Symposium on Computational Geometry (SoCG 2026), volume 367 of Leibniz International Proceedings in Informatics (LIPIcs), pages 14:1–14:14. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2026. doi:10.4230/LIPIcs.SoCG.2026.14.
- [10] Srecko Brlek, Hugo Tremblay, Jérôme Tremblay, and Romaine Weber. Efficient computation of the outer hull of a discrete path. In Proc. 18th IAPR International Conference on Discrete Geometry for Computer Imagery (DGCI), volume 8668 of LNCS, pages 122–133. Springer, 2014. doi:10.1007/978-3-319-09955-2_11.
- [11] Timothy M. Chan. Approximate nearest neighbor queries revisited. Discret. Comput. Geom., 20(3):359–373, 1998. doi:10.1007/PL00009390.
- [12] Timothy M. Chan, Kasper Green Larsen, and Mihai Pătraşcu. Orthogonal range searching on the ram, revisited. In Proc. 27th Symposium on Computational Geometry, pages 1–10. ACM Press, 2011. doi:10.1145/1998196.1998198.
- [13] Timothy M. Chan and Konstantinos Tsakalidis. Dynamic orthogonal range searching on the RAM, revisited. J. Comput. Geom., 9(2):45–66, 2018. doi:10.20382/JOCG.V9I2A5.
- [14] Moses Charikar, Chandra Chekuri, Tomás Feder, and Rajeev Motwani. Incremental clustering and dynamic information retrieval. SIAM J. Comput., 33(6):1417–1440, 2004. doi:10.1137/S0097539702418498.
- [15] Bernard Chazelle. A functional approach to data structures and its use in multidimensional searching. SIAM J. Computing, 17(3):427–462, 1988. doi:10.1137/0217026.
- [16] Danny Z. Chen and Haitao Wang. Computing shortest paths among polygonal obstacles in the plane. Algorithmica, 81(6):2430–2483, 2019. doi:10.1007/S00453-018-00540-X.
- [17] Minati De, Saksham Jain, Sarat Varma Kallepalli, and Satyam Singh. Online geometric covering and piercing. Algorithmica, 86(9):2739–2765, 2024. doi:10.1007/S00453-024-01244-1.
- [18] Minati De, Ratnadip Mandal, and Satyam Singh. New lower bound and algorithms for online geometric hitting set problem. arXiv, 2024. doi:10.48550/arXiv.2409.11166.
- [19] Minati De and Satyam Singh. Online hitting of unit balls and hypercubes in using points from . Theor. Comput. Sci., 992:114452, 2024. doi:10.1016/J.TCS.2024.114452.
- [20] Minati De, Satyam Singh, and Csaba D. Tóth. Online hitting sets for disks of bounded radii. In Proc. 33rd European Symposium on Algorithms, (ESA), volume 351 of LIPIcs, pages 50:1–50:16. Schloss Dagstuhl, 2025. doi:10.4230/LIPIcs.ESA.2025.50.
- [21] Adrian Dumitrescu, Anirban Ghosh, and Csaba D. Tóth. Online unit covering in Euclidean space. Theor. Comput. Sci., 809:218–230, 2020. doi:10.1016/J.TCS.2019.12.010.
- [22] Adrian Dumitrescu and Csaba D. Tóth. Online unit clustering and unit covering in higher dimensions. Algorithmica, 84(5):1213–1231, 2022. doi:10.1007/S00453-021-00916-6.
- [23] Guy Even and Shakhar Smorodinsky. Hitting sets online and unique-max coloring. Discret. Appl. Math., 178:71–82, 2014. doi:10.1016/J.DAM.2014.06.019.
- [24] M. R. Garey and David S. Johnson. Computers and Intractability: A Guide to the Theory of NP-Completeness. W. H. Freeman, 1979.
- [25] Ziyue Huang and Ke Yi. Approximate range counting under differential privacy. In Proc. 37th International Symposium on Computational Geometry (SoCG), volume 189 of LIPIcs, pages 45:1–45:14. Schloss Dagstuhl, 2021. doi:10.4230/LIPIcs.SoCG.2021.45.
- [26] Arindam Khan, Aditya Lonkar, Saladi Rahul, Aditya Subramanian, and Andreas Wiese. Online and dynamic algorithms for geometric set cover and hitting set. In Proc. 39th Symposium on Computational Geometry (SoCG), volume 258 of LIPIcs, pages 46:1–46:17. Schloss Dagstuhl, 2023. See also https://arxiv.org/abs/2303.09524. doi:10.4230/LIPIcs.SOCG.2023.46.
- [27] Kurt Mehlhorn and Stefan Näher. Dynamic fractional cascading. Algorithmica, 5(2):215–241, 1990. doi:10.1007/BF01840386.
- [28] Christian Worm Mortensen. Fully dynamic orthogonal range reporting on RAM. SIAM J. Comput., 35(6):1494–1525, 2006. doi:10.1137/S0097539703436722.
- [29] Joseph O’Rourke. Art Gallery Theorems and Algorithms. Oxford University Press, 1987. URL: https://www.science.smith.edu/˜jorourke/books/ArtGalleryTheorems/.
- [30] Haitao Wang. A new algorithm for Euclidean shortest paths in the plane. In Proc. 53rd ACM SIGACT Symposium on Theory of Computing, (STOC), pages 975–988. ACM, 2021. doi:10.1145/3406325.3451037.
