On the union complexity of families of axis-parallel rectangles with a low packing number

Let R be a family of n axis-parallel rectangles with packing number p-1, meaning that among any p of the rectangles, there are two with a non-empty intersection. We show that the union complexity of R is at most O(n+p^2), and that the (<=k)-level complexity of R is at most O(kn+k^2p^2). Both upper bounds are tight.


Introduction
For a finite family C = {C 1 , C 2 , . . . , C n } of geometric objects in the plane, the union complexity of U (C) = ∪ n i=1 C i (or, in short, the union complexity of C) is the number of vertices on the boundary ∂(U (C)), where a vertex is an intersection point of the boundaries of two objects C i , C j ∈ C. 1 More generally, for any k ≥ 0, the (≤ k)-level complexity of C is the number of vertices that are contained in the interior of at most k elements of C.
Bounding the union complexity of families of geometric objects is useful for analyzing the running time of various algorithms, and has applications to linear programming, robotics, molecular modeling, and many other fields. In particular, Clarkson and Varadarajan [5] showed that if the union complexity of a family R of r ranges with V C dimension δ is sufficiently close to O(r), then R has an ǫ-net of size smaller than O( δ ǫ log δ ǫ ). Smorodinsky [10] showed that bounds on the union complexity and on the level-1 complexity of families of geometric objects in the plane can be used in computing the proper chromatic number and the conflict-free chromatic number of the corresponding hypergraph. For more on union complexity, see the survey [1].
For several families of geometric objects, it was shown that the union complexity is asymptotically lower than the trivial O(n 2 ) bound. In particular, Kedem et al. [9] showed that the union complexity of any family of n pseudo-discs in the plane is at most 6n − 12, and Alt et al. [2] and Efrat et al. [6] proved a similar bound for any family of fat wedges. An almost linear bound for families of γ-fat triangles was obtained by Ezra et al. [7].
For a general family of axis-parallel rectangles in the plane, the union complexity can be quadratic -e.g., if the family is an n 2 -by-n 2 grid of long and thin rectangles. However, one may note that such a family contains as many as n/2 pairwise disjoint sets. Hence, it is natural to ask whether any family of axis-parallel rectangles with a quadratic union complexity must contain a linear-sized sub-family whose elements are pairwise disjoint. In this note we answer this question on the affirmative. We show that the union complexity of any family R of axis-parallel rectangles is sub-quadratic if the packing number of the family is sub-linear. Recall that the packing number of R, denoted ν(R), is p − 1 if among any p elements of R, two have a non-empty intersection. Our main result is the following: Theorem 1.1. Let R be a family of axis-parallel rectangles with packing number ν(R). Then for any k ≥ 0, the (≤ k)-level complexity of R is O(kn + k 2 ν(R) 2 ). In particular, the union complexity of R is O(n + ν(R) 2 ).
Both results are tight, as we show by an explicit example. The proof of Theorem 1.1 consists of several steps, and for convenience we divide them into separate subsections. We start with a few definitions and notations.

Definitions and Notations
Throughout this note, R denotes a family of axis-parallel rectangles in the plane, and we assume that R is in general position, meaning that no two rectangles have more than 4 common points (i.e., no two rectangles share a segment of the boundary; this implies that no three boundaries intersect at the same point). Put ν(R) = p − 1, so any p rectangles in R contain two with a non-empty intersection.
For any x ∈ R 2 , the depth of x, denoted depth(x), is the number of rectangles in R that contain x as an interior point. Let Y 0 be the set of vertices (i.e., intersections of pairs of boundaries) of depth 0, and for k ≥ 0, let Y ≤k be the set of vertices of depth at most k. Of course, |Y 0 | is the union complexity of R and |Y ≤k | is the (≤ k)-level complexity of R.
Intersection points of boundaries of two axis-parallel rectangles can be partitioned into four types, depicted in Figure 1. The type described in Figure 1(a) (in which the intersection point is the rightmost-upmost point of the intersection of the rectangles) will be called type L intersection. We denote by X 0 the set of all points of type L in Y 0 , and by X ≤k the set of all points of type L in Y ≤k .
For any intersection point x of type L, we denote by A x the rectangle to whose upper boundary x belongs, and by B x the rectangle to whose right boundary x belongs.

Partition of R into floors
Let R 1 ∈ R be the rectangle whose upper boundary is the lowest (i.e., has the smallest y coordinate) among the rectangles in R. If there are several such rectangles, we choose one of them arbitrarily. Denote by ℓ 1 the horizontal line that contains the upper boundary of R 1 .
Define inductively a sequence {ℓ i } 2≤i≤p−1 as follows. Let R i be the rectangle whose upper boundary is the lowest between all elements of R whose lower boundary is above ℓ i−1 . (Again, if there are several such rectangles, we pick one of them arbitrarily.) Denote by ℓ i the horizontal line that contains the upper boundary of R i . Note that by the construction, the rectangles {R i } 1≤i≤p−1 are pairwise disjoint. As ν(R) = p − 1, this implies that R does not contain any rectangle whose lower boundary is above ℓ p−1 . Let ℓ p be a horizontal line that lies above the upper boundaries of all the rectangles in R (such a line clearly exists as R is finite and all its rectangles are compact).
We now define the partition of R into floors: we say that R ∈ R belongs to floor i, 1 ≤ i ≤ p − 1, if the upper boundary of R is above or contained in ℓ i and lower than ℓ i+1 . We denote the set of all rectangles in floor In addition, we need the following observation: Proof. Let R ∈ F i . If the lower boundary of R is above ℓ i then by the definition of ℓ i+1 , the upper boundary of R cannot lie strictly below ℓ i+1 , a contradiction. Hence, the lower boundary of R is either below ℓ i or on ℓ i . As the upper boundary of R is either on ℓ i or above ℓ i and also lower than ℓ i+1 , the assertion follows.
Observation 2.1 implies that R is pierced by the set of lines L = {ℓ 1 , . . . , ℓ p−1 }, meaning that each R ∈ R has a non-empty intersection with (at least) one of the lines. A similar argument shows that there exists a set H = {h 1 , h 2 , . . . , h p−1 } of vertical lines (arranged in increasing order of the x coordinate) that pierces R. This set will be used, along with L, in the sequel.

Classification of the intersection points of type L
In what follows, we obtain an upper bound on |X ≤k |, i.e., the number of intersection points of type L and depth ≤ k. (By symmetry, this will imply an upper bound on the (≤ k)-level complexity of R.) As a preparation, we classify the intersection points of type L. Definition 2.2. Let x ∈ X ≤k . Denote by h x the rightmost amongst the vertical lines in the set {h ∈ H : h ∩ B x = ∅}. We say that x is (A x , h x )-contributed.
For A ∈ R, we say that x is A-contributed if there exists h ∈ H such that x is (A, h)contributed. Conversely, for h ∈ H, we say that x is h-contributed if there exists A ∈ R such that x is (A, h)-contributed (see Figure 2(a)).

Observation 2.3.
1. For any given A, h, and for any 0 ≤ s ≤ k, there exists at most one point x with depth(x) = s that is (A, h)-contributed. Figure 2(b)). This induces a natural ordering between them.)

It may be that
If there are no such points, x is called an extremal contribution of A (see Figure 2(c)).
The following observation is crucial in the sequel. Proof. Denote the vertical lines that contain the left and right boundaries of A by l A and r A , respectively. Note that if for some m there exists an (A, h m )-contributed pointx, then the line h m+1 must lie to the right of l A (as otherwise, Bx must intersect h m+s for some s ≥ 1, contradicting the assumption thatx is contributed by h m ). On the other hand, h m must lie to the left of r A , since it intersects Bx and the right boundary of Bx is to the left of r A (as the intersection pointx is of type L, see Figure 1(a)). In our case, as x is an inner contribution of A, there exist some s 1 , s 2 ≥ 1 and points y, z such that y is (A, h i−s 1 )-contributed and z is (A, h i+s 2 )-contributed. By the previous paragraph, the former implies that h i−s 1 +1 lies to the right of l A while h i+s 2 lies to the left of r A . As s 1 , s 2 ≥ 1, this implies that both h i and h i+1 lie to the right of l A and to the left of r A , and thus, both intersect A, as asserted.

Upper bound on 'inner contributions' to the (≤ k)-level complexity of R
In this subsection we obtain an upper bound on the number of elements of X ≤k that are inner contributions, by considering pairs of the form (Floor F i , vertical line h j ) separately, and for each such pair, upper bounding the number of (A, h j )-contributed points for A ∈ F i that are inner contributions. Proposition 2.6. For k ≥ 0 and 1 ≤ i, j ≤ p − 1, let S i,j k = {x ∈ X ≤k : ∃A ∈ F i , x is (A, h j )-contributed and x is an inner contribution of A}.
(Informally, S i,j k is the set of all contributions to the level ≤ k complexity, that are contributed by h j on the i'th floor in an 'inner' way). Then for all i, j, (1) x ∈ X ≤k that is an inner contribution of A}.
(Informally, A i is the set of all rectangles on the i'th floor, whose upper edge contains an inner contribution to the level ≤ k complexity, contributed by h j .) Denote |A i | = m i , and let the elements of A i = {A 1 , A 2 , . . . , A m i } be ordered in descending order of the height of the upper boundary, as demonstrated in Figure 3. (So, A 1 is the rectangle whose upper boundary is the highest, A 2 's upper boundary is the second highest, etc.. Note that equality cannot occur here as by Observation 2.5, any A ∈ A i intersects both h j and h j+1 , and so, if two of these rectangles had upper boundaries of the same height, they would share part of the boundary, contradicting the assumption that the elements of R are in general position.) Note that we have Let x ∈ Q l . We claim that for each 1 ≤ r ≤ l − 1, x is an interior point of A r . To see this, we need several simple observations.
1. Any (A l , h j )-contributed x lies between the lines h j (inclusive) and h j+1 (non-inclusive). Indeed, as x lies on the right boundary of B x and h j intersects B x , x must lie either on h j or to the right of h j . On the other hand, if x lies on h j+1 or on the right of h j+1 , then B x must intersect h j+s for some s ≥ 1, a contradiction.
2. Any such x lies above or on the line ℓ i , since it belongs to the upper boundary of A l ∈ F i .
3. Each of the rectangles A 1 , . . . , A m i intersects ℓ i by Observation 2.1, and intersects both h j and h j+1 by Observation 2.5.
By the simple observations, for each 1 ≤ r ≤ l − 1, the rectangle A r intersects ℓ i , h j and h j+1 , and its upper boundary lies above x (since x lies on the upper boundary of A l ). As x lies between the lines h j and h j+1 and above ℓ i , it follows that x is an interior point of A r . Now, arrange the elements of Q l = {x 1 , x 2 , . . .} in descending order of the x coordinate (i.e., x 1 is the rightmost one, x 2 is the second-to-right, etc. Such an ordering is possible, since all elements of Q l belong to the upper boundary of A l ). For each x ∈ Q l , B x intersects h j (since x is (A l , h j )-contributed). Thus, x m is included in the interior of B x m ′ for any m > m ′ . In addition, for any 1 ≤ t ≤ l − 1, all elements of Q l are interior points of A t . Therefore, for any m ≥ 1, we have depth(x m ) ≥ (m − 1) + (l − 1) = l + m − 2. As all points in Q l are of depth ≤ k, this implies |Q l | ≤ k − l + 2 for any 1 ≤ l ≤ m i . Summing over all values of l and using (2), we obtain as asserted.

Finalizing the proof of Theorem 1.1
Now we are ready to prove Theorem 1.1. Actually, we prove the following exact version of the theorem: Theorem 2.7. Let R be a family of n axis-parallel rectangles with ν(R) = p − 1. For any k ≥ 0, the (≤ k)-level complexity of R is at most 8(k + 1)n + 2(p − 1)(p − 3)(k + 1)(k + 2). In particular, the union complexity of R is at most 8n + 4(p − 1)(p − 3).
Proof. By symmetry considerations, the (≤ k)-level complexity of R is at most 4|X ≤k |, so it is sufficient to prove We prove (4) by upper bounding the inner contributions and the extremal contributions separately.
Inner contributions. By Proposition 2.6, for each i, j, the number of inner contributions that correspond to F i and h j is at most (k + 1)(k + 2)/2. For j ∈ {1, p − 1}, any h j -contributed x is an extremal contribution. Hence, the number of inner contributions that correspond to F i is at most (p − 3)(k + 1)(k + 2)/2, and so, the total number of inner contributions is at most (p − 1)(p − 3)(k + 1)(k + 2)/2.
Extremal contributions. Let A ∈ R. By the definition of inner and extremal contributions, all A-contributed points that are extremal contributions belong to one of two vertical lines. By Observation 2.3, for any single pair (A, h), X ≤k contains at most k + 1 (A, h)-contributed points. Therefore, the number of A-contributed points that are extremal contributions is at most 2(k + 1). It follows that the total number of extremal contributions is at most 2(k + 1)n. This completes the proof.
Remark 2.8. If one is interested in the k-level complexity of R (instead of the (≤ k)-level complexity we treat), the same proof method can be used to show that it is at most O(n + kp 2 ), and that this is tight for the example presented in Figure 4 below.
Remark 2.9. We note that an alternative way to prove Theorem 1.1 is to first obtain an upper bound on the union complexity of R and then deduce an upper bound on the (≤ k)-level complexity by the classical technique of Clarkson and Shor [4]. We preferred to treat the (≤ k)level complexity directly, as this allows obtaining the slightly better exact result of Theorem 2.7 with almost the same effort.
3 Tightness of Theorem 1.1 In this section we present a family R of n axis-parallel rectangles with ν(R) = p − 1 whose (≤ k)-level complexity is Θ(nk +k 2 p 2 ), thus showing that Theorem 1.1 is tight (up to a constant factor). The family R, presented in Figure 4, is a disjoint union of two subfamilies of n/2 rectangles each.
The subfamily drawn in the left of the figure consists of a sequence of pairwise-intersecting rectangles in which each rectangle is taller and thinner than its successor. This subfamily contributes O(kn) points to the (≤ k)-level complexity of R.
The subfamily drawn in the right of the figure is based on an (p − 2)-by-(p − 2) grid of long thin rectangles. We replace each rectangle in the basic grid with n 4(p−2) nested copies to obtain a family of n/2 rectangles (for simplicity, we assume 4(p − 2)|n; note that only the basic grid is depicted in the figure). This subfamily contributes Θ(k 2 p 2 ) points to the (≤ k)-level complexity of R.