Covering Rectilinear
Polygons with Axis-Parallel
Rectangles
VS. Anil Kumar H.Ramesh Dept. of Computer Science and Automation Indian Institute of Science Bangalore 560012 INDIA {vsa,ramesh}~csa.iisc.ernet.in
Abstract
We give an a(-
There seem to be only a few examples of non-trivial algorithms breaking this barrier for specific instances of the set covering problem. BrGnnimann and Goodrich [2] showed that the covering problem for any set system with VapnikChervonenkis dimension d can be approximated within an O(dlog(dc)) factor, where c is the cost of the optimal covering. For the rectangle covering problem, while d is a constant, c can be shown to be Q(~/;E); therefore, the BrBnnimannGoodrich algorithm gives only an O(logn) approximation factor. BrGnnimann and Goodrich [2] also showed that O(c) sized set covers can be computed for 2-d Disc Covering and a problem related to 3-d Polytope Separation as these set systems admits c-nets of small size. It is not clear whether the the rectangle covering problem admits c-nets of small size.
factor approximation algorithm for
covering a rectilinear polygon with holes using axis-parallel rectangles. This is the first polynomial time approximation algorithm for this problem with a o(logn) approximation factor. 1
Introduction
We consider the problem of covering rectilinear polygons with axis-parallel rectangles. Given a rectilinear polygon P with vertical complexity n, this problem requires determining the minimum number of axis-parallel rectangles whose union covers P. The polygon P may have holes in it.
Special Situations. There are special situations when the above barrier can indeed be broken. When P is holefree, Franzblau [S] showed a factor 2 approximation guarartee. When P has holes, Franzblau also gave an O(nlogn) time heuristic which gives an O(log rz) approximation factor. When P is both vertically and horizontally convex (i.e., the intersection of any vertical or horizontal line and P is just a single line se,ment), Chaiken, Kleitman, Saks and Shearer [3] gave a polynomial time algorithm which computed the minimum number of rectangles required, exactly. This was improvedupon by Franzblau and Kleitman [7], who achieved the same result under the weaker restriction that P is just vertically convex. Note that both restrictions predude the presence of holes. Other papers which have dealt with this problem are [S, 10, 12, 13, 41.
Hardness. putational
Much effort has gone into determining the corncomplexity of this problem. In spite of this, the exact complexity of this problem has remained open for many years and continues to do so. Masek [I91 showed that this problem is NP-Complete. Later, Culberson and Reckhow [5] used a clever reduction from 3.SAT to show that this is the c&x even when P has no holes. The next natural question is whether the number of rectangles needed to cover P can be computed appmzimately. Berman and Dasgupta [I] showed that the problem is MaxSNP-Hard for polygons with holes, ruling out the possibility of a polynomial time approximation scheme. Approximation Factor. Note that the rectangle covering problem is a special case of the general Set Covering problem. Therefore, it admits an approximation algorithm with a performance guarantee of O(logn) using the greedy scheme due to Johnson and Lovasz [9, 161. This was the best approximation factor known for the rectangle covering problem until now. Further, it is known that the general set covering problem cannot be approximated any better, module constant terms, unless NP = P 1171. However, this proof of hardness assumes certain properties about the set system which do not hold for the rectangle covering problem. In this paper, we address the issue of whether the Q(logn) approximation factor barrier can be broken in polynomial time.
Our Result. We give the first algorithm to break the R(log n) barrier even when P has holes. Our algorithm gives an approximation guarantee of O(m. Our algorithm is in fact trivial and our contribution lies entirely in showing a lower bound. For simplicity, assume that all holes in P are point holes’. Then our algorithm simply puts 1 rectangle for each strip, i.e., astretch of points between two vertically aligned holes ( e.g. strip s and its associated rectangle R in Fig.3 ). This rectangle covers the strip entirely and is made as thick as possible. It is easy to see that the rectangles for all strips together cover P (the boundary of P must be treated as being lined by point holes for this). Also note that the rectangles for two distinct strips could be identical, as shown in Fig.1. Weshow that the total
445
G could be very variable in size, and therefore, do not admit a uniform upper bound. However, we show that if none of the strips are Wmpers (we will define this term shortly) then indeed there is an induced subgraph with 8(#N) points for which the maximum clique size is O(m, and therefore, jOPT[ = n(x), as required. Our proof of this fact is &G based on a somewhat detailed exploration of the structure of cliques in G. In order to define jumpers and to define the above subset of O(#N) points, we need to organize all strips into families. A collection of strips which have the same right blocking hole (the hole which blocks the associated rectangles from being extended further to the right, see Fig.1) is called a right family. A strip A is a jumper if the next longer member in its right or left family is longer than A by a factor of 2+. Th e number of jumpers #.I is easily seen to be O(#Fm, where #F is the total number of right and left families. In addition, we show that there exist Q(#F) points which are all independent; thus OPT1 = Q(#F). It follows that the #J is O(IOPT] 2-l ogn We then ignore jumpers and demonstrate an induced subgraph with F)(#N -#J) points for which the maximum clique size is 0(&G). The vertices of the induced subgraph mentioned above points. For each strip will be derived from the set of witness which gives rise to a distinct rectangle (see Fig.2), we attempt to define two witness points, one to the right of that strip and one to the left. As we shall show later, we may not be able to define witness points for all strips; however, we will be able to define witness points for at least a constant fraction of the strips for which distinct rectangles have been put. And a constant fraction of these witness points will have the property that each clique in OPT has only O(m of these points. A significant point to note is that while we show a lower bound on the clique covering number of graph G in the abpence of jumpers, we are unable to show any lower bound on the size of the largest independent set.
Figure 1: A Family: Strips A, B, C are in one right family. D is unnecessary and has the same associated rectangle as B. B r-spans A.
right witness for
Figure 2: Right witnesses for strips A, B, C. C is the longest strip in its right family.
number of distinct process is O(G* cover.
rectangles #N obtained in the above [OPTI)), where OPT is the minimum
Examples. Note that if the average family size was O(1) for all polygons, then our claim above that there always exist #F independent points will give a constant factor ap proximation algorithm. Unfortunately, this is not the case. In Section 5 we give an example of a polygon in which the average family size is S(e). The above example can also be slightly modified in a way such that all right witness points can be covered by O(*N:z;2”) cliques and theaveragediquesizeisQ(~) However, in this example, covering the left witness points requires Q(#N) cliques and the maximum clique size is O(1) for these points. This example was the key to our lower bound. We do not know whether there are examples where the average clique size is super-constant for both the left witness points and the right witness points, In this sense, our bound of G does not seem like an unnatural meeting point.
The Lower Bound. The main hurdle in breaking the n(logn) barrier is to obtain a good lower bound for the optimum. One such lower bound is the cardinality of the i.e., a set of points largest independent set or antirectangle, in P, no two of which can be covered by the same rectangle. Chvatal (a reported in [3]) originally conjectured that the size of the minimum covering equals the size of the largest independent set. While this is indeed true for vertically and horizontally convex P, as shown by Chaiken &al. [3], it is not true for general P, with or without holes. Szemeredi found a counterexample with holes and Chung found one without holes (both reported in (31). Erdos (as reported in [3]) asked whether the ratio of the sizes of the minimum covering and the largest independent sets is bounded. It is easy to show that this ratio is O(logn). However, to the best of our knowledge, the best lower bound known to date is just 21117 -e, due to [3]. Instead of using the above independent set bound, we use the clique coveting lower bound. Consider the finite set of all points in P after suitable discretization. Consider the graph G with these points as vertices and an edge between two points if and only if they are both covered by some rectangle. Note that IOPT is exactly the size of smallest clique covering of this graph (i.e., covering vertices with cliques). We attempt to upper bound the sizes of cliques in OPT. One problem we face in the process is that the cliques of
Applications. Cheng, lyengar and Kashyap [4] showed that problem has applications to image compression. They claim that representing an image using a rectangle covering of its white pixels gives compression superior to that achieved by quad-trees. It also has applications to printing integrated circuits [S]. Roadmap. In Section 2, we show how to discretize the polygon and then describe our algorithm for laying rectangles. In Section 3, we give an overview of our lower bound
446
Lemma 2.1 Each point in the polygon is contained in the associated rectangle of mme strip. Proof. Each non-hole grid cell, c, belongs to a unique strip. This is because if the cell c is swept vertically up and down, it would hit a hole in both directions. So all the non-hole grid cells, b, which lie vertically above or below c, with no hole appearing between b and c, form a strip. The rectangle associated with this strip contains c. 0
Figure 3: The Grid: Dark Cells and external Cl, C2 form a length 2 strip.
Definitions. A rectangle associated with strip A is said to pass through strip B if some of the cells in strip B are contained in this rectangle (see Fig.1). In this situation, B is said to l-span A if it is to the left of A and r-span A if it is to the right of A. Note that two strips could have identical associated rectangles (see Fig.1). Consider equivalence classes of strips, where strips with the same associated rectangle are in one class. All but the rightmost of the strips in an equivalence class are called unnecessary strips. Clearly, an unnecessary strip can be ignored. It suffices to account for the rectangles associated with necessary strips.
cells are holes.
3
The Lower Bound Argument
argument. For simplicity and clarity, we make several assumptions while sketching our lower bound argument in this section. A sketch of the general case appears in Section 4 and the complete analysis will appear in the full version of the paper. Section 6 mentions the loose threads which remain in this problem and also describes some related problems.
We will make a number of simplifying assumptions and prove the lower bound based on these assumptions. The arguments for the general case are a little different and are sketched in Section 4. The complete proofs for the general case will appear in the full version. Assumption
1. All strips are necessary.
2
Assumption
2. The length of each strip is a power of 2.
Preliminaries
W;will
Consider the grid formed by drawing infinitely long lines through each vertical and horizontal edge of the polygon (i.e., both the polygon boundary and the hole boundaries) (see Fig.3). Note that this need not be a uniform grid; the spacing between adjacent grid lines is not necessarily the same. Let n denote the vertical complezify of P, i.e., the number of horizontal grid lines. Without loss of generality, we assume that the vertical complexity is at most the horizontal complexity. Next, call a grid cell a hole if it lies outside the polygon. Note that each grid cell lies completely inside or completely outside the polygon (see Fig.3). Further, any two holes are either perfectly aligned or completely misaligned with respect to the grid lines. Also note that two holes could lie side by side, touching each other. If we treat each cell as a point, we get the case of point holes. However, the rest of the description will be in terms of cells. 2.1
show that any optimal cover OPT will have ) rectangles, where #N is the number ofstrips (and
“‘$E therefore, the number of rectangles put by our algorithm).
Defining Families and Witness Cells. All strips with the same right blocking hole constitute a tight family (see Fig.1). From assumptions I and 2, it is easy to see that the length of the strips in a right family must at least double from left to right. The right successor of a strip is defined to be the next longer strip in its right family (e.g., in Fig.1, B is the right successor of A). The longest, i.e., rightmost, strips in their respective families are called right terminal strips (e.g., strip C in Fig.1). The right witness cell for a right non-terminal strip A is defined as the non-hole cell in its right successor which is horizontally aligned with the upper hole of A (see Fig.2). For a right terminal strip, there is no right successor; the right witness cell is then defined to be the non-hole cell in that strip which is horizontally aligned with the right blocking hole of that strip. Left familiesand left witness cells are defined analogously. Note that the right successor of a strip r-spans that strip and its left successor l-spans it.
Defining Strips and Laying Rectangles
A sequence of consecutive vertically aligned non-hole cells bounded by a hole on the top and the bottom constitutes a strip (see Fig.3). The Iength of a strip A is the number of cells in it and is denoted by l(A). The upper hole for a strip is the hole which lies immediately above the topmost cell for that strip. Lower holes are defined similarly. For each strip, we put the unique associated rectangle whose height just covers the strip and whose width is as large as possible (see Fig.3). Lemma 2.1 shows that these rectangles indeed cover the given polygon. The hole which blocks this rectangle on the right is called the right blocking hole, with ties broken in favor of the topmost hole. Left Blocking X&J are defined similarly.
Assumption 3. The upper hole of a strip is not horizontally aligned with that of its left or right successor strip. Therefore, left and right witnesses are always well-defined. This means that the situation of Fig.4 in which the right witness cell of strip A is not defined is ruled out. Definitions. Note that all witnas cells must be covered by some rectangle in any rectangle covering. A set of witness cells is said to form a clique if each pair of cells in that set can be covered by a rectangle. Two witness cells are said to be independent, if no rectangle can cover both of them. Next,
447
Figure 4: Strip A has no well defined right witness cell.
Figure 6:
Proof. We show that if A and B are two strips in the same left family, their left witness cells are independent. The lemma then follows. The proof for right cliques is analogous. Without loss of generality, assume that l(A) < l(B). From the definition of left family, B is to the left of A and l-spans A. So A defines its left witness cell either on B (if B is the left successor of A) or to the right of B. Since B defines its left witness cell on the horizontal line conttining the upper hole of B and to the left of the upper hole of B, it is easy to see that any rectangle containing the left witnes.v cells of A and B has to contain the upper hole of B. This implies that these two witness cells are independent and cannot be in a clique. 0
Figure 5: The rectangle R formed by a, b, c, d and the 6 possible rectangles formed by each pair of witness cells, which together cover R
consider any optimal cover OPT having JOPTJ rectangles. For each witness cell, assign it to some rectangle covering it in OPT, breaking ties arbitrarily. We get a partition of the witness cells into [OPT1 cliques. We partition each clique further into two parts, one containing left witness cells and another containing right witness cells; these parts are called the left clique and the right clique, respectively. We say that a strip is in a particular left (right, respectively) clique if its left (right,respectively) witnw cell is in that clique. Thus, each strip must be present both in home left clique and some right clique in OPT. We will now need to explore the structure left and right cliques.
Lemma 3.3 All left witness cells toor left terminal strips an mutually independent as are tight witness cells for right terminal strips. Proof. We consider the case of right witness cells for right terminal strips and show that they are independent. The proof for left witness cells is identical. Suppose for a contradiction that there are two right terminal strips P, Q whose right witnesses are not independent. Since both P and Q must be in distinct right families, their right blocking holes are distinct. Recall that the right witness cells of P and Q are in P and Q, rapectively, and are horizontally aligned with their respective right blocking holes. Consider a rectangle containing the two witness cells; that such a rectangle exists follows from the definition of independence of witness cells (see Fig.6). Clearly, both P and Q must have their upper holes above and lower holes below this rectangle. Without loss of generality, assume P is to the left of Q. Note that the right blocking holes for both P and Q must be in the shaded region (i.e., the extension of the above rectangle to the right, the rectangle itself must be hole-free). Therefore, both blocking holes must be to the right of Q. Then it follows that whichever one of these holes occurs further to the right of the other cannot be the right blocking hole for either P or Q. In addition, if the two blocking holes are vertically aligned, the lower one cannot be the right blocking hole for either P or Q. This gives a contradiction. 0
of the various
Lemma 3.1 All witness cells contained in any rectangle form a clique. Conversely, any clique comprises witness cells which urn be covered by just one rectangle. Proof. The first statement of the lemma follows from the definition of a clique. We now show that my dique C can be covered by one rectangle. Let a, b, c, d be the leftmost, topmost, rightmost and bottommost witness cells in C, respectively. Note that a, b, c, d need not be all distinct. We claim that the rectangle R having a, b, c, d on its left, top, right and bottom edges, respectively, is hole-free (see Fig.5). The claim then follows since a, b, c, d an extreme points. To show that R is hole-free consider the rectangles that cover each pair of vertices from a, b, c, d. If a, b, c, d are all distinct there will be 6 such rectangles, and fewer otherwise (see Fig.5). Clearly, R is contained in the union of these rectangles. 0
Since each right and left family has exactly one terminal strip, IOPT/ = CL(#F), where #F is the number of right and left families. However, this lower bound is not good enough in general, an there are examples in which #F = Q(J”“~~,“~‘“““) (seeSection 5). We will not consider terminal strips any further.
Lemma 3.2 All non terminal strips in D left (right, respectivelyJ clique belong to distinct left families (tight families, respectively).
448
Figure 7: A Left Clique.
B l-spans A and C l-spans B
Figure 9: D l-spans A but not B
(01 Figure 8: Two situations
B l-span any other strips in C. By the above fact, D must be disjoint from B. Further,‘either D is disjoint from A or is to the left of A and l-spans A (see Fig.9, 10). Consider the rectangle R associated with clique C (by Lemma 3.1, there exists such a rectangle). The left witness cells for A, B, D are all in R and A, B, D are themselves to the right of R. Therefore, R must have its upper edge above the upper holes of A, B, D and its lower edge below all these holes. In addition, the left successors of A, B, D must all have their upper holes above R and bottom holes below this rectangle (see Fig.9); these successors strips must stab vertically through R. By Lemma 3.2, A, B, D must all be in distinct left families and therefore, have distinct left blocking holes. It follows from Figures 9 and 10 that the left blocking holes of the upper two strips among A, B, D must be in the hatched region, i.e., the left extension of R. Since a strip and its left successor must have the same left blocking hole, it follows from Figures 9 and 10 that the left blocking holes of the two upper strips among A, B, D must be identical, a contradiction. 0
(6, for A, B in Lemma 3.4
Lemma 3.4 With the ezception of at most one strip, nonterminal strips in o left clique are left nested, i.e., each strip Cspons all smaller strips in this left clique (see Fig.7). An analogous property holds for right cliques. Proof. US&ll.
Let C be any left clique. The following fact will be
Fact. Suppose A and B are two strips in C and A is to the right of B. Then either A and B are disjoint i.e., one is completely above the other, or B l-spans A. This must be true, otherwise, one of the two situations shown in Fig.8 holds and then A’s left witness cell will be independent from the left witness cell of B. Further, if B l-spans A then B must be longer than A, since B has to be at least as long a A and both A and B are necessary strips by the preceeding assumptions.
Thus, each clique and each family has size O(logn). Let A be a parameter which we will eventually set to G. Henceforth, we will ignore the following strips. Their total number is easily seen to be O(IOPTI a?).
Suppose C is not left nested. By the above fact, if each strip in C l-spans the smallest strip in C, then there are no disjoint strips in C and C must be left nested. So there must exist a strip in C which is disjoint from the smallest strip A in 6; consider the smallest such strip B. Clearly, neither A nor B cm l-span any strip in C. We will show below that all other strips D in C must l-span the lower of A, B. Let C’ be the clique obtained by removing the upper of A, B. From the above fact, it follows that the strips in C’ at least double in length from right to left and each strip in C’ l-spans alI smaller strips in C’. Thus C has the property required in the lemma. Assume without loss of generality that B is below A. Consider a strip D in C \ {A, B} and suppose for a contradiction that D does not l-span B. Recall that neither A nor
1. Strips which are left or right terminal. There O(#F) = O([OPTI) of these by Lemma 3.3.
are
2. A single exception strip specified in Lemma 3.4. in each left and right clique. There are O(IOPTI) of thwe. 3. Strips A whose left or right successor B is much longer than A, i.e., I(B) > f(A)2a. Such strips A are called jumpers. There are O(#F+) = O(lOPTIy) of these. Definitions. The left follower of a strip A is the next longer strip B, if any, which is in the same left clique of OPT as A.
449
possible positions for P’~uccessor
Blocking boles of A and -
p /5
D lie here
Figure 11: One of the configurations ruled out by Lemma 3.5: Qi r-spans P. The hatched region is hole-free.
Figure 10: A, 5, D axe disjoint. a, b, d are the witness cells of A, B, D respectively and R is the minimal rectangle containing them.
right follower of at most one strip. Thus it suffices to bound the number of strips Q which are right followers of strips P satisfying condition 2 or 5. Using the same argument as for condition 1, the number of strips Q satisfying condition 2 is O(IOPTI * A). Using an argument similar to that for condition 4, the number of strips Q satisfying condition 5 is O(lOPTl**); in this case, condition 5 implies the absence of n(A) categories between two alternate strips in the left clique containing Q. Thus, it follows that the total number of stripsN#h’ = O(lOml(A+ %)), and therefore [OPTI = n($$, for
Note that the left follower of a strip, if its exists, is unique, by Lemma 3.4. Right followers are defined analogously. 5 Conditions. Next, consider any strip P which is not listed above and is still in consideration. Examining the structure of cliques in detail, we will show that one of the following must be true.
A=,,%@.
1. P is among the smallest or longest 3A strips in its right clique.
3.1
2. P’s right follower Q is among the smallest or longest 5A strips in its left clique.
The following two lemmas will be used in showing that one of the above 5 conditions must hold.
3. 29(P)
Qk and neither Lemma 3.5 P cannot I-span any of QI can any of Q, Qk r-span P (see Fig. 11 and 12). firther, Qx-, is completely above the left blocking hole of Q*.
5 l(Q).
4. Let P’ be the strip whose left follower is P. Either P’ does not exist (i.e., P is the smallest strip in its left clique) or ZAf(p) 2 l(P).
Showing One of the 5 Conditions
Holds
Proof. This lemma can be seen as follows. By Lemma 3.4, Q r-spans P and l-spans each of Q1 Q*. The hatched region must therefore be hole-free (see Fig.11). Suppose Q; r-spans P. This means that P has its right blocking hole to the right of Q;. Next, P’s right successor is either to the left of Q, to the right of Q;, or between Q and Q;. We show that each case results in a contradiction. In the lint ( Fig.lZ(a)) or second situation, the right witness cell of Q is easily seen to be independent from that of P, a contradiction since P and Q are in the same right clique. Consider the third situation. Since Q l-spans Q;, the hatched region between Q and Qi in Fig.lZ(b) is hole-free. Then, since P’s right successor r-spans P, it must I-span Q; as well, and therefore, cannot have its right blocking hole to the right of Qi. But this contradicts the fact that P and its right successor must have the same right blocking hole. Therefore Q; cannot r-span P. A similar proof shows that P cannot l-span Qi. Finally, note that if QL--I is not completely above the left blocking hole of QI, then one of the two situations shown in Fig.13 holds. In the first situation (Fig.l3(a)), Q* and Qx-1 must have the same left blocking hole and are in the same left family, which contradicts Lemma 3.4. In the latter situation
5. Let Q1 QI. be the strips (in increasing order of length) which are smaller than Q and in the same left clique ss Q. Then 2’9(Qk-i) 5 l(Q). Consequences. From the above 5 conditions, we show below that the total number of strim P in consideration is ti(IOPTI I (A + %)). 1 The number of strim P which satisfv the first condition is clearly O(IOP!?‘I * A) because each’clique in OPT has O(A) such strips. The number of strips P which satisfy the third condition is O(IOPT( * F) because strips in any right clique must at least double in length from left to right and the third condition implies the absence of n(A) lengths between P and its right follower Q. Similarly, the number of strips P which satisfy the fourth condition is O(IOPTI) if P’ does not exist, or O(IOPTI * 9), if P’ does exist, because strips in any left clique must at least double in length from right to left and the fourth condition implies the absence of n(A) lengths between P’ and P. Next, consider strips P which satisfy either condition 2 or 5. Such a strip P has a unique right follower Q. Note that any strip is the
450
Right witness of 4 P
Right witness of
“\P
Figure 12: Configurations with Qi r-spanning P: (a) P’s SUCC~SSOT is to left of Q (Situation 1). (b) P’s succes.sor is between Q and Qi (Situation 3). Figure 15: Lemma 3.6: (a) D’ is to the right of B and its upper hole of D’ is below that of B. (b) D’ to the left of B.
Left Witness of Qh
Left Blocki
ofQk
(Fig.l3(b)), note that the left successor of Qk-, cannot be to the right of the left blocking hole of Qk, for otherwise, the left blocking holes of Qr and Qk-I will be the same. Therefore, the left witness cell of Qk-, is vertically below, or below and to the left, of the left blocking hole of Qx. Then the left witness cells of QI and Qx-, are independent, a contradiction as Qi and &r-l are in the fame left clique.0 Lemma 3.6 If A and B are two strips in the same feft or tight clique with l(A) < l(B) and there ore ot leostyA steps in this clique which are smaller than A, 7 2 1, then the vertical separation between the upper holes of A and B is at most 2,,I(:k+, (see Fig.141
(4
(a)
Proof. This lemma can be seen as follows for right cliques. Recall that terminals, exceptions and jumpers have been ignored. Let D be the smallest strip in the right clique containing A and B. Let D’ be the right SUEC~SSOT of D. We will show in the next paragraph that the vertical separation between the upper holes of B and A is at most f(D’) (see Fig.14). l(D’) < I(D)Za, because D is not a right jumper. Further, since there are at least yA strips smaller than A in this right clique and since strip lengths in a right clique at least double from left to right by Lemma 3.4, I(D’) 2 I(D)Za < s2” = *, as required. It remains to show that the vertical separation between the upper holes of B and A is at most l(D’). By Lemma 3.4, A and B both r-span D. It is easy to show that D’ is to the right of B and that its upper hole is above that of B (see Fig.lS(a), (b), if this is not true then the right witnffs cells for D and B, respectively, are independent). Since D’ is the right SUCC~SSOT of D, D’ must r-span 0; therefore, the lower hole of D’ is below the upper hole of A. It follows that the vertical separation between the upper holes of B and A is at most l(D’), as required. 0
Figure 13: Two situations for QI-I.
The Final Step. We are now ready to show the final step in our lower bound argument. We suppose that none of the above 5 conditions hold to get a contradiction. Since condition 2 is not satisfied, k > 5A + 1. We consider two casesnow, depending upon whether the upper hole of Qh is above or below that of P.
Figure 14: Vertical Separation in a right clique.
451
4
/-,
Figure 16: Two situations
The General
Case:
Removing
Ill-Behaved
Strips
Section 3 shows that the number of rectangles laid out by our algorithm is O(&@) factor of the optimal, given assumptions 1, 2, and 3. We now need to handle the general case. Assumption 1 is easy to handle, aa unnecessary strips do not add to the set of rectangles we use to cover the given polygon. Assumptions 2 and 3 are non-trivial to handle, however. We classify strips into categories and exploit the structure of cliques for each category in order to handle the case when these assumptions are not valid. The way assumption 2 is relaxed is by defining the notion of a succwsor in a different way. The right successor of a strip A is the first strip B to the right of A which either rspans A and has length at most 21(A)--1, or is at least double the length of A and has the same right blocking hole. Strip A is said to be a right non-doubling strip in the former case and a right doubling strip in the latter case. Left successors are defined similarly. Observe that the strips considered in Section 3 are both left and right doubling. A witness cell is again defined on the successor. It is now possible that a strip and its successor have their upper holes aligned. In this case, witness cells cannot be defined, since we do not require assumption 3 to hold. But we show that a constant fraction of strips define at least one (left or right) witness cell and this is sufficient for our argument. The strategy again is to upper bound clique sizes. We first partition the cliques of OPT into a constant number of classes. These classes are the following:
ib,
for the upper hole of Qk
First, suppose the upper hole of Qk is aligned with or The lower hole of Qk must be above that of P, otherwise QX r-spans P, which contradicts Lemma 3.5. Therefore, the left blocking hole of Q* will be horizontally aligned with OT above the upper hole of P (see Fig.lG(a), the hatched region is hole-free). By Lemma 3.5, Qi-1 is completely above this blocking hole, and therefore completely above P. Further, the upper hole of QI-I is aligned with or below that of Q as Q l-spans Qx-I, by Lemma 3.4. Therefore, the vertical separation between P and Q is at least !(QI-I). Since the 5th condition is not satisfied, 2’hI(Q1.-~) > I(Q). It follows that the vertical separation between P and Q is at least I(Q*-2) > 9. But this is a contradiction, since the 1st condition is not satisfied and Lemma 3.6 implies that the the vertical separation between P and Q is most &&. Second, suppose the upper hole of Qx is below that of P. (see Fig.l6(b)). The bottom hole of Qx must be below that of P, otherwise, P will l-span Qk, a contradiction to Lemma 3.5. Since Qr I-spans each of QI Qx-1, these must also have their upper holes below that of P. Since P cannot l-span any QI Qx, their lower holes must also be below that of P (see Fig.lG(b)). By Lemma 3.4, P I-spans P’, and therefore P’ must be to the right of Q (see Fig.lG(b)). Since P l-spans P’ and Q I-spans each of Q, Qr (by Lemma 3.5), it must be the case that each of QI . ..Qx either Ispans P’ or is completely below it (e.g. Q* spans P’ while Qi is below P’ in Fig.lG(b)). We claim that at most ZA of &I Qk can l-span P’. This is shown in the next paragraph. Then the vertical separation between the upper holes of Qx-~a (which is completely below P’) and Q is at least I(P) > y > @ (because conditions 3 and 4 are not satisfied). Since k-2A 2 3A, Lemma 3.6 applied to Qxmla and Q implies that the vertical separation between the upper holes of these two strips is at most s, a contradiction. It remains to show that at most 211 of &I Qi can I-span P’. We show that QI--z,, cannot l-span P’. Suppose this is not true. Then Q~-M.. QI all l-span P’ and I(Qiim-2~) 2 l(P’). By Lemma 3.4, Qr-~a _. Qt, Q at least double in length from left to right and therefore 1(Q) 2 > 2 a+ll(P). The last in2’a+‘f(Qx-x& > 2ga+‘I(P’) equality follows from the violation of condition 4. Then condition 3 is satisfied, a contradiction. above that of P (see Fig.lG(a)).
1. Terminal
strips of families.
2. Strips A which are left or right doubling
and whose
successors have length at least l(A)2&. 3. Strips which are left and right both witnesses.
doubling
and define
4. Strips that are doubling on one side and non-doubling on the other side, and define both witnesses. 5. Strips that define only one witness. This definition of sucessor ensures that in any clique, strip lengths increase by at least a factor of two. Strips in classes 1 and 2 are easy to upper bound. For strips in the remaining classes, we use a lemma analogous to Lemma 3.6 to get an upper bound on the clique sizes. A fair amount of detail is involved in these arguments and is left for the complete version of the paper. 5
Counterexamples
We now describe an example where the average family size is O(s). There are B(n$&) point holes arranged in n + 1 rows and Q(n) columns. The property we seek to achieve in arranging holes in this way is that there be only B(n) blocking holes for all the e(n&) strips put together. The leftmost and rightmost columns have 7~+ 1 holes each, one hole per row. The remaining columns can be partitioned into two classes. The first class consists of & groups, with theith group having I’-‘(1+1) columns Cij,j = l,...,l’-‘(1 + 1) in it; here 1 = logn. Each column in the ith group contains ; + 1 evenly spaced holes on rows 0,1’, 2.1’, , n, and is said to be of spar&y i. Between two columns of sparsity i, there are 1 + 1 columns of sparsity
452
i + 1, as shown in Fig.17. Fig. 18 shows columns of sparsity 0 and 1. The Ais are columns of sparsity 1, placed between the two columns of sparsity 0. Columns BI B, in the second class have just one hole each and axe called blocking column. i3i has its hole between rows i and i + 1 (we said earlier that there are n + 1 TOWSof holes; these rows are only for non-blocking columns. Holes in blocking columns are not in these rows.). The holes on blocking columns will be the only blocking holes for au s fraction of the strips lying on columns in the first class. The number of columns in the first class is E:i=I,,,+ (I’+ I’-‘) +2 which is o(n) and the number of holes on all these col”m”s is O($$g. The arrangement has a recursive structure. Level i of the example consists of basic blocks of level i ( defined below). Consider the rows formed by holes of successivecolumns C;,j and C;,j+l which do not have any column of lower sparsity between them. Each successive set of I rows constitutes a basic block of level i. The holes contained within I vertically consecutive basic blocks of level i we horizontally partitioned into 1 basic blocks of level i + 1. Fig. 18 shows basic blocks of two successive levels. The holes not on the columns at level 0 and I are the holes on scuue blocking columns, BXS. Each basic block in Fig. 18 has 3 blocking holes (but in general, there will be I blocking holes) and these holes are placed diagonally. All strips are blocked by these blocking holes at least on one side. The strips on columns A2 and Aa are blocked on both directions by holes on some Bxs. In general, it will be true that (I - I)/(1 + 1) fraction of all strips are blocked by holes on some BI.S in both directions. Since there is only one hole on each blocking column fik, and since there are only n such columns, the average family size would be Q(e). Observe that all cliques have size 1 in the above example. It is possible to modify the above example to ensure that family sizes are still S(*) but right cliques are also of this size on the average. This is achieved in the following manner. First observe that in Fig. 18 the blocking holes in each basic block are placed diagonally. It is easy to see that any arrangement of blocking holes that places exactly one hole per row and column will keep family sizes large. We describe the arrangement of blocking holes in any basic block at level 0; the arrangement in basic blocks at other levels is identical. The blocking holes of the ith set of fi successiverows are placed in columns i, i + Ji, , i + (dI)& of the basic block respectively. A column of a basic block at level i is the region between two successive columns ofsparsity i+l that cut this basic block. Now each column of sparsity 1 running across this basic block is shifted down in the following manner. For each column A, there is exactly one blocking hole h in the region between the preceeding column and A. Column A is shifted vertically down by an amount slightly less than the vertical distance of h from the upper boundary of the basic block at level 0 containing it. Colunms of sparsity i + 1 are shifted relative to basic blocks at level i in exactly the same manner. It now turns out that both the blocking holes remain the same for all except a 5 fraction of the strips, but most right cliques have size The size of left cliques is at most 2. Q( $&).
Figure 17: Arrangement of columns of sparsity i and i + 1
Columns of spa&y
1 Basic block
Basic bl at leve
Columns of sparsity 1 Figure 18: An example with large family sizes: Recursive structure of basic blocks is shown here. Holes in columns other those of spwsity 0 and 1 am in blocking columns.
6
Conclusions
A number of loose ends remain for this problem. The main question, of course, is whether the approximation factor GUI
453
be brought down to O(1). Another question is whether there exists a polygon whose clique cover and independent set numbers are small-o of the number of necessary strips.
[S] A. Hegediis. Algorithms for Covering Polygons with Rectangles. Computer Aided Gem,. Design, 14, 1982, pp. 257-260.
Related Problems. We briefly mention some related problems and the current state of knowledge on these problems.
[Q] D.S. Johnson. Approximation Algorithms for Combinatorial Problems. Journal of Computing and Systems Sciences, 9, 1974, pp. 256-278.
Non-Axis Parallel Rectangles. One variant of the above rectangle covering problem is when the covering rectangles need not be axis-parallel. Our techniques do not seems to extend to this case. However, they do extend even when all the covering rectangles mnst be inclined at the same angle, or at one of a constant number of angles. But there are examples where rectangles inclined at an arbitrary number of angles are involved in the optimal cover. And in this case, the issue seems to be different and related to the problem of covering a given set of points using a minimum number of straight lines. We do not .know the exact nature of this relationship though. No o(logn) approximation factor is known for this problem either.
[lo] J.M. Keil. Minimally Covering a Horizontally Convex Orthogonal Polygon. Proceedings of 2nd
ACM Symposium on Computntionol Geometry, 1986, pp. 43-51. [ll]
ternational Workshop on Par. Camp. and VLSI, 1984. [12] C. Levcopoulos. A Fast Heuristic for Covering Polygons by Rectangles. Proceedings of Fundn-
mentals of Computer Theory, 1985. [13] C. Levcopoulos. Improved Bounds for Covering General Polygons by Rectangles. Proceedings of
Non-Rectilinear Polygons. When the polygon itself is not rectilinear but has only obtuse angles, suitably discretizing the problem so as to apply the greedy set covering algorithm [9] is itself non-trivial. Levcopoulos and Gudmundsson [14] showed that this can indeed be done. So this problem too has an O(logn) factor approximation algorithm and no better bound is known.
6th Foundation
of Sojtwore Tech. and Them&
cd Camp. SC., LNCS 287, 1987. [14] C. Levcopoulos and .I. Gudmundsson. Close Approximations of Minimum Rectangular Covering. Proceedings of 16th Foundations of Sojtwore Tech. and Theoretical Camp. SC., LNCS 1180, 1996, pp. 135-146.
Rectilinear Polygons and Fat Rectangles. When the covering objects are squares of rectangles with bounded aspect ratio, then Levcopoulos and Gudrnundsson [15] give a constant factor approximation algorithm.
(151 C. Levcopoulos and J. Cudrnundsson. Approdmation Algorithms for Covering Polygons with Squares and Similar Problems. Technical Report, Lund University.
References [l] P. Berman and B. Dasgupta. Approximating Rectilinear Polygon Cover Problems. Proceedings of 4th Canadian Conference on Computational Geometry, 1992, pp. 229-235. [2] H. BrBnnimann, M. Goodrich. Almost Set Covers in Finite VGDimension. Cornput. Geom., 14, 1995, pp. 263-279.
C. Levcopoulos. On Covering Regions with Minimum Number of Rectangles. Proceedings of In-
[16] L. Lovasz. On the Ratio of Optimal.Integral and Fractional Covers. Journal of Discrete Mathematics, 13, 1975, pp. 383-390. 1171 R.Raz and S.Safra. A Sub-Constant ErrorProbability Low-Degree test and a Sub-Constant Error-Probability PCP Characterization of NP. Proceedings of the ACM Symposium on Theory
Optimal
Discrete
of Computing, 1997.
[3] S. Chaiken, D.J. Kleitman, M. Saks and .I. Shearer. Covering Regions by Rectangles. SIAM J. Algebraic and Discrete Methods, Vol. 2,4, 1981, pp. 394-410.
[18] C. Lund and M. Yannakakis. On the Haxires of Approximating Minimization Problems. Proceedings of 25th ACM Symposium on Theory of Computing, 1993, pp. 28&293.
14) Y. Cheng, S.S. lyengar and R.L. Kashyap. A New Method for Image compression using Irreducible Covers of Maximal Rectangles. IEEE l%ansactions on Software Enginewing, Vol. 14, 5, 1988, pp. 651-658.
[19] W.J. Masek. Some NP-Complete Set Covering Problems, Manuscript, MIT, 1979.
[5] J.C. Culberson and R.A.Reckhow. Covering Polygons is Hard. Journal oj Algorithms, 17, 1994, pp.
2-44. [6] D.S. Franzblau. Performance Guarantees on a Sweep Line Heuristic for Covering Rectilinear Polygons with Rectangles. SIAM J. Discrete Math., Vol. 2, 3, 1989, pp. 307.321. [7] D.S. Franzblau and D.J. Kleitman. An Algorithm for Constructing Regions with Rectangles. Injormation and Control, 63, 1984, pp. 164-189.
454