Rectangle Tiling Binary Arrays
RRectangle Tiling Binary Arrays
Pratik Ghosal , Syed Mohammad Meesum , and Katarzyna Paluch University of Wrocław, Wrocław, Poland KREA University, Sricity, India
Abstract.
The problem of rectangle tiling binary arrays is defined as follows.Given an n × n array A of zeros and ones and a natural number p , our task is topartition A into at most p rectangular tiles, so that the maximal weight of a tileis minimized. A tile is any rectangular subarray of A . The weight of a tile is thesum of elements that fall within it. We present a linear ( O ( n )) time ( + p w ( A ) ) -approximation algorithm for this problem, where w ( A ) denotes the weight of thewhole array A .The algorithm employs the lower bound of L = (cid:100) w ( A ) p (cid:101) , which is the same lowerbound on the optimum that was used in all algorithms for rectangle tiling. Weprove that a better approximation factor for the binary RT ILE cannot be achievedusing the same lower bound L , because there exist arrays, whose every partitioncontains a tile of weight at least ( + p w ( A ) ) L . The previously known approx-imation algorithm for rectangle tiling binary arrays achieved the ratio of . Wealso consider the dual problem of rectangle tiling for binary arrays, where we aregiven an upper bound on the weight of the tiles, and we have to cover the array A with the minimum number of non-overlapping tiles. Both problems have naturalextensions to d -dimensional versions, for which we provide analogous results. Keywords:
Rectangle tiling, RT
ILE , DRT
ILE
In this paper, we study several variants of the rectangle tiling problem. These problemsbelong to a very wide class of discrete optimization tiling problems. As an input, we aregiven a two-dimensional array A [1 ...n, ...n ] , where each cell A [ i, j ] has a non-negativeweight.RT ILE : Given a two-dimensional array A of size n × n and a natural number p ,we partition A into at most p rectangular subarrays, called tiles , so that the maximumweight of any tile is minimized. In other words, we have to cover A with tiles such thatno two tiles overlap, while minimizing the weight of any tile. The weight of a tile is thesum of the elements that fall within it.DRT ILE : A natural variant of RT
ILE is called the DRT
ILE problem. The DRT
ILE problem is a dual of the RT
ILE problem, where we are given an upper bound W onthe weight of the tiles, and we have to cover the array A with the minimum number ofnon-overlapping tiles. a r X i v : . [ c s . C G ] J u l hese two problems have a natural extension to d dimensions. Here the input is a d -dimensional array A of size n in each dimension and we have to partition A into non-overlapping d -dimensional tiles so that the optimality criterion of the RT ILE /DRT
ILE problem is satisfied.In this paper we consider a special case of the RT
ILE /DRT
ILE problem, whereeach cell has a binary weight, i.e., the weight of any cell is either or . We extend ourapproach to solve the d -dimensional binary RT ILE /DRT
ILE problem.
Motivation:
The RT
ILE / DRT
ILE problem is a general problem in combinatorialoptimization that has a wide variety of applications in real life. These include loadbalancing in parallel computing environments, video compression, data partitioning,database mining, and building equisum histogram on two or more attributes. A detaileddescription of the practical applications of RT
ILE / DRT
ILE problem can be found in[1, 7, 11].
Related Work:
Both the RT
ILE and DRT
ILE problems can be solved in polyno-mial time when the array is one-dimensional. The RT
ILE problem can be solved usingdynamic programming in time O ( np ) and the best known algorithm has the runningtime O (min { n + p (cid:15) , n log n } ) , for any fixed (cid:15) < [8]. An extensive survey on theRT ILE problem in one-dimension can be found in [8]. On the other hand, the DRT
ILE problem in one dimension can be solved using a greedy algorithm in linear time.Both the RT
ILE and DRT
ILE problems have been proven to be NP-hard [7]. Grigniand Manne [6] proved that optimal p × p tiling (which is a restricted variant of the RT ILE problem) is NP-hard even when the cell weight is binary. Charikar et al. [3] showed therestricted variant to be APX-hard and NP-hard to approximate within a factor of .Khanna et al. [7] proved that it is NP-hard to achieve a -approximation for the RT ILE problem. Recently Głuch and Lory´s [5] have improved the lower bound of the RT
ILE problem to . It is not known whether the binary RT ILE is solvable in polynomial timeor NP-hard. Khanna et al. [7] gave the first approximation algorithm for the RT
ILE problem with the ratio . The approximation ratio was improved to independently bySharp [15] and Lory´s and Paluch [9]. Lory´s and Paluch [10] gave a -approximationalgorithm for this problem. Berman et al. [1] improved the approximation ratio to .Finally, Paluch [13] gave a -approximation for this problem and also proved thatthe approximation ratio is tight with respect to the used lower bound. As far as theDRT ILE problem is concerned, Khanna et al. [7] gave an O ( n ) -time -approximationalgorithm using the Hierarchical Binary Tiling (HBT) technique. They improved theapproximation ratio to using a modified version of the HBT technique, but the runningtime of this algorithm is very high making the algorithm less practical. Lory´s and Paluch[9] also gave a -approximation for the DRT ILE problem while improving the runningtime to linear.The d -dimensional version of this problem was introduced by Smith and Suri [16].They gave a d +32 -approximation algorithm that runs in time O ( n d + p log n d ) . Sharp[15] improved the approximation ratio to d +2 d − d − that runs in time O ( n d +2 d p log n d ) .Paluch [14] gave a d +22 -approximation algorithm while matching the previous runningtime. She also proved that the ratio is tight with respect to the known lower bound ofthe problem.P ACK is an extensively studied variant of rectangle tiling, in which we are givena set of axis-parallel weighted rectangles in a n × n grid, and the goal is to find atmost k disjoint rectangles of largest weight. Khanna et al. [7] proved that this problemis NP-hard even when each rectangle intersects at most three other rectangles. Theygave an O (log n ) -approximation algorithm for RP ACK that runs in O ( n p log n ) time.In [1] Berman et al. considered the multi-dimensional version of this problem. Thedual of RP ACK is known to be NP-hard even when we are interested in finding a sub-set of disjoint rectangles with total weight equal to at least some given w . Du et al.[4] considered a min-max version of RT ILE , where the weight of each tile cannot besmaller than the given lower bound and the aim is to minimize the maximum weightof a tile. They gave a -approximation algorithm for this problem and Berman andRaskhodnikova [2] improved the approximation factor to and the approximation ratioof the binary variant to . Previous Work:
The binary version of the RT
ILE problem has also been studied.Khanna et al. [7] gave a -approximation for the binary RT ILE problem. Lory´s andPaluch [9] and Berman et al. [1] independently improved the approximation ratio forbinary RT
ILE to . Our Results:
We improve the approximation ratio of the binary RT
ILE problem to + p w ( A ) , where w ( A ) denotes the number of ones in A . For the arrays A satisfying p w ( A ) ≈ , it implies that the approximation ratio of the algorithm amounts to . Therunning time of our algorithm is linear ( O ( n ) ). The algorithm employs the lower boundof L = (cid:100) w ( A ) p (cid:101) , which is the same lower bound on the optimum that was used inall algorithms for rectangle tiling. We prove that a better approximation factor for thebinary RT ILE cannot be achieved using the same lower bound L , because there existarrays, whose every partition contains a tile of weight at least ( + p w ( A ) ) L .The general approach to solving this problem is similar to the approach of [13].The found tiling is also hierarchical and we use the notions of boundaries and types ofcolumns/subarrays . However, in the present paper the types of subarrays are organizedin a somewhat different manner. In particular, the idea of shadows is new. To computethe desired partition of A into tiles, we only check a small number of tilings of simplydefined subarrays. The subarrays are identified with the help of so called boundaries and their shadows , which, roughly speaking, designate parts of A tileable in a certainmanner and having weight greater than L . To prove the tileability of subarrays com-posed of multiple simpler subarrays we employ linear programming. Its applicationhere differs from the one in [13] in that each dimension is treated completely symmet-rically and thus more ”globally” and in the method of showing the feasibility of dualprograms. We show that the binary DRT ILE problem can be approximated by reducingit to the binary RT
ILE problem. As for the d -dimensional binary RT ILE problem, thealgorithm for the -dimensional binary RT ILE problem can be extended to obtain anapproximation for the d -dimensional binary RT ILE problem. The same approximationratio for the d-dimensional binary DRT
ILE problem can also be found analogously.
Organization:
In Section 2 we recall the necessary definitions. We introduce thenotion of the boundaries and their shadows in Section 3. In Section 4, we assume that w ( A ) (cid:29) p , and present a -approximation algorithm for the RT ILE problem. Theoal of this section is also to introduce the methods needed for the approximation of thebinary RT
ILE more gradually, without obscuring the presentation with many technicalaspects. In Section 5 we present a ( + p w ( A ) ) -approximation algorithm for the generalcase (which, in particular, applies also when p w ( A ) is not negligible). This approximationis achieved by applying only small modifications to the approach described in Section4. In Section 6 we prove that the approximation factor we obtain for the RT ILE prob-lem, is tight with respect to the known lower bound. Section 7 contains our result onthe DRT
ILE problem. We conclude by presenting an approximation algorithm for themulti-dimentional RT
ILE problem in Section 8.
Let A be a two-dimensional array of size n × n , where each of its elements belongs tothe set { , } . Given A and a natural number p , we want to partition A into p rectangularsubarrays, called tiles so that the maximal weight of a tile is minimized. The weight ofa tile T , denoted w ( T ) , is the sum of elements within T . w ( A ) denotes the weight ofthe whole array A . Since any array element is either equal to or , w ( A ) amounts tothe number of s in A .First, notice that the problem is trivial when p ≥ w ( A ) . Hence throughout the paperwe assume that p < w ( A ) . Clearly, the maximal weight of a tile cannot be smaller than w ( A ) p . Consequently, L = (cid:100) w ( A ) p (cid:101) is a lower bound on the value of the optimal solutionto the RT ILE problem.Thus to design an α -approximation algorithm for the RT ILE problem, it suffices todemonstrate the method of partitioning A into p tiles such that the weight of each tiledoes not surpass αL .The number p of allowed tiles is linked to the weight of the array A in the followingmanner. Fact 1
Let w ( A ) and L be as defined above. Then, p ≥ (cid:100) w ( A ) L (cid:101) . The proof directly follows from the assumption that L = (cid:100) w ( A ) p (cid:101) Definition 1.
An array A is said to be f -partitioned if it is partitioned into rectangulartiles such that the weight of any tile does not exceed f . We denote by A [ i ] the i -th column of A , by A [ i..j ] a subarray of A consisting ofcolumns i, i + 1 , . . . , j . Thus A T [ i ] denotes the i -th row of A and A T [ i..j ] a subarrayof A consisting of rows i, i + 1 , . . . , j . In this section we define a sequence of (vertical) boundaries and their shadows . Let usassume that we want to design an α -approximation algorithm for the RT ILE problem.Hence the weight of any tile must not exceed αL . In other words, we want to obtainn αL -partitioning for A . Each boundary is a distinct column of A . If boundary B i corresponds to column A [ k ] , then we denote it as b i = k . Thus B i = A [ b i ] . Theshadow B (cid:48) i = A [ b (cid:48) i ] of boundary B i is equal to either B i or the column succeeding B i .We say that boundary B i is of type j , denoted as t ( B i ) = j , if its weight satisfies (cid:98) w ( B i ) αL (cid:99) = j − .The vertical boundaries and their shadows are defined iteratively below. The ideasbehind them are as follows. The first vertical boundary B indicates simply which partof the array consisting of successive columns starting from the leftmost, exceeds αL .This means that such subarray cannot be covered with one tile. However, the subarray A [1 ..b − ending on column b − can form one tile, because its weight is not greaterthan αL . For i > the i -th boundary B i denotes a column A [ b i ] such that the subarray A [ b (cid:48) i − ..b i − can be αL -partitioned into, respectively, t ( B i − ) tiles if B i − = B (cid:48) i − and tile, if B i − (cid:54) = B (cid:48) i − , and the subarray A [ b (cid:48) i − ..b i ] cannot. The reason for placingthe following boundaries in such a way is that any boundary of type j can be αL -partitioned (horizontally) into j tiles and we want to extend such a partition as for tothe right as possible. As for the i -th shadow B (cid:48) i we put it in the same column as theboundary B i if the subarray A [ b (cid:48) i − ..b i ] cannot be αL -partitioned into t ( B i ) tiles andotherwise, we put it just behind B i in column b i + 1 . Notice that in the case of a shadowwe check the tileability into t ( B i ) tiles and not t ( B i − ) . Also, we observe that B i (cid:54) = B (cid:48) i can happen only when t ( B i ) > t ( B i − ) or B i − (cid:54) = B (cid:48) i − . If B i (cid:54) = B (cid:48) i , then it means,as we later prove, that the subarray A [1 ..b i ] is rather easy to partition and we could infact tile it with a proper number of tiles and start the process of tiling anew with thesubarray A [ b (cid:48) i ..n ] . Definition 2. First boundary( B = A [ b ] ): w ( A [1 ..b − ≤ αL and w ( A [1 ..b ]) > αL .2. First Shadow:
Let t ( B ) = j .(a) B (cid:48) = B iff A [1 ..b ] cannot be partitioned horizontally into j tiles of weightat most αL .(b) B (cid:48) (cid:54) = B iff A [1 ..b ] can be partitioned horizontally into j tiles of weight atmost αL .3. ( i + 1) -th boundary( B i +1 = A [ b i +1 ] ): Let t ( B i ) = j .(a) If B i = B (cid:48) i , then A [ b i ..b i +1 − can be partitioned horizontally into j tiles but A [ b i ..b i +1 ] cannotbe partitioned horizontally with j tiles.(b) If B i (cid:54) = B (cid:48) i , then w ( A [ b i + 1 ..b i +1 − ≤ αL and w ( A [ b i + 1 ..b i +1 ]) > αL .4. ( i + 1) -th Shadow: Let t ( B i +1 ) = j .(a) B (cid:48) i +1 = B i +1 iff A [ b (cid:48) i ..b i +1 ] cannot be partitioned horizontally into j tiles.(b) B (cid:48) i +1 (cid:54) = B i +1 , iff A [ b (cid:48) i ..b i +1 ] can be partitioned horizontally into j tiles. The horizontal boundaries can be defined analogously. To illustrate the notion ofboundaries and shadows let us consider a few examples. . . . . . ≤ L> LA [1] A [2] A [3] A [4] A [5] A [ n ] Fig. 1.
An array with column A [4] as the only boundary Example 1.
Array A has only one vertical boundary B = A [4] of type .This means that the total weight of the first columns does not exceed αL , i.e., w ( A [1 .. ≤ αL , and the weight of the subarray consisting of columns . . . does - w ( A [1 .. > αL . Since t ( B ) = 1 , by the definition, the weight of B = A [4] is notgreater than αL and the shadow B (cid:48) of B coincides with B . Since A has only oneboundary, it means that the weight of the subarray consisting of all columns except forthe first is not greater than αL , i.e., w ( A [4 ..n ]) ≤ αL . Example 2.
Array A has only one vertical boundary B = A [4] of type and B (cid:48) = A [4] .Exactly as in the example above, we have w ( A [1 .. ≤ αL and w ( A [1 .. > αL .The weight of B satisfies: L ≥ w ( A [4]) > αL , because t ( B ) = 2 . By the fact that B (cid:48) = B , we know that the horizontal partition of A [1 .. into tiles of weight notsurpassing αL is impossible. Since A has only one boundary, we obtain that A [4 ..n ] can be partitioned into t ( B ) = 2 tiles. Example 3.
Array A has only one vertical boundary B = A [4] of type and B (cid:48) = A [5] .Again, we have w ( A [1 .. ≤ αL and w ( A [1 .. > αL . This time, however, B (cid:48) (cid:54) = B ,therefore A [1 .. can be partitioned into horizontal tiles with weight αL at most. Since A has only one boundary and B (cid:48) (cid:54) = B , we have that w ( A [5 ..n ]) ≤ αL . Lemma 1.
Let k denote the number of vertical boundaries of A and T v = (cid:80) ki =1 t ( B i ) .Then array A can be tiled with T v + 1 tiles. Proof.
Suppose first that for each ≤ i ≤ k it holds that B i = B (cid:48) i . Then by Definition 2,each subarray A [ b i ..b i +1 − can be tiled horizontally with t ( B i ) tiles and the subarray A [1 ..b − can be covered by tile. Therefore we indeed use T v + 1 tiles.For the general case, let i = min { k : B k (cid:54) = B (cid:48) k } . It means that the subarray A [ b i − ..b i ] can be tiled horizontally with t ( B i ) tiles. By Definition for each j ≤ i − he subarray A [ b j ..b j +1 − can be tiled horizontally with t ( B j ) tiles and the subarray A [1 ..b − can be covered by a single tile. This way the number of used tiles amountsto (cid:80) i − j =1 t ( B j ) + t ( B i ) + 1 ≤ (cid:80) ij =1 t ( B j ) . We continue in the same manner with thesubarray A [ b (cid:48) i ..n ] . (cid:50) Analogously, we define a horizontal sequence of boundaries of A , i.e., a verticalsequence of boundaries of A T .Throughout the paper, B , B , . . . , B k and C , . . . , C l denote, respectively, thevertical and horizontal sequence of boundaries of A . Let T v = (cid:80) ki =1 t ( B i ) and T h = (cid:80) li =1 t ( C i ) . Fact 2
Let T = min { T v , T h } . Then A can be αL -tiled with T + 1 tiles. Lemma 2.
Let A (cid:48) = A [ i . . . i ] be a subarray of A and k a natural number greater orequal .Suppose that w ( A [ i ])+ w ( A [ i ]) k + w ( A [ i + 1 . . . i − ≤ αL . Then A (cid:48) can bepartitioned into k horizontal tiles of weight at most: (i) αL + 1 if k = 2 , (ii) αL + 2 if k > . Proof.
We divide the number equal to the sum of the weights of two columns A [ i ] and A [ i ] (the columns may be unconnected) by k . We check where the divisionlines fall with respect to the subarray. Often they may occur in the middle of a row(consisting of two array elements) and we have to move the division so that thewhole row is included or the whole row is excluded. If k = 2 , then we chooseone of the two options - moving the division upwards or downwards, hence, inthe worst case we may have to increase the weight of one tile by . For k > ,we may have to shift the division by almost the whole row and thus increase theweight of some tiles by . Next we extend this partition to include the subarray A (cid:48)(cid:48) = A [ i + 1 . . . i − - we do not change the partition of the two-column subarray,but simply follow the partition lines. In the worst case the whole weight of A (cid:48)(cid:48) will fallinto only one tile - yielding a tile of weight w ( A [ i ])+ w ( A [ i ]) k + w ( A [ i +1 . . . i − . (cid:50) -approximation when w ( A ) (cid:29) p In this section we deal with arrays such that p w ( A ) is close to , which means that thetotal weight of any p elements of A is negligible. As mentioned in the introduction, theaim of this section is to introduce the methods used in the approximation of the binaryRT ILE problem gradually. For the general case, an approximation algorithm presentedin the next section will be only a slight modification of the one shown here.
Convention 1
Throughout this section whenever we speak about tiling and partition-ing , we respectively mean “ L -partitioning” and “tiling using tiles of weight at most L ”. emark: The total number of cells in the intersection of the horizontal and thevertical boundaries is O( T ). We show in Section 3 that we can always partition A into T + 1 tiles. In this section we find the smallest α such that the weight of such an array w ( A ) > T L . Since w ( A ) ≤ pL , we prove that T L < pL . Since both T and p areintegers, T + 1 ≤ p .In this section, we assume that the total weight of the cells in the intersection of twoboundaries is negligible with respect to the total weight of the array. Hence we have w ( A ) (cid:29) p .Given an array A we build a linear program, with the help of which we will be ableto relate the total weight of the array to the sums of types of boundaries T v , T h . Lemma 3.
Let T = min { T v , T h } . Then w ( A ) > T L . Using Observation of [12], we can assume that the whole weight of the array A is contained in the boundaries, i.e., each element of A that does not belong to anyboundary has value . Each vertical boundary B i is crossed by l horizontal boundariesand thus cut into l + 1 parts. We assign a variable x j,i to each part, i.e., the j th partof B i consists of elements A [ c j − + 1 , b i ] , A [ c j − + 2 , b i ] , . . . , A [ c j − , b i ] and x j,i denotes the sum of the weights of these elements. Similarly, each horizontal boundary C i is crossed by k vertical boundaries and thus cut into k + 1 parts. We assign a variable z i,j to each such part. The value of each variable x j,i or z i,j denotes the weight of thecorresponding part of the boundary.For technical reasons we introduce a non-existent th column of A and set B = A [0] and B (cid:48) = A [1] .In the linear program, we minimize the sum of non-negative variables x j,i and z i,j subject to a set of constraints associated with the boundaries. For each vertical boundary B i we will have either one or two constraints of the following form:1. If t ( B i ) > , then we add the constraint t ( B i ) − (cid:80) l +1 j =1 x j,i ≥ L , which simplydescribes the total weight of B i .2. (a) B (cid:48) i − (cid:54) = B i − .i. t ( B i ) = 1 . The added constraint is (cid:80) lj =1 z j,i + (cid:80) l +1 j =1 x j,i > L. ii. t ( B i ) > and B (cid:48) i = B i (which means that A [ b (cid:48) i − ..b i ] cannot be tiledhorizontally with t ( B i ) tiles). By Lemma 2 we are justified to add theconstraint (cid:80) lj =1 z j,i + t ( B i ) (cid:80) l +1 j =1 x j,i > L. iii. t ( B i ) > and B (cid:48) i (cid:54) = B i . In this case we do not add any constraint.(b) B (cid:48) i − = B i − .i. B (cid:48) i (cid:54) = B i . The added constraint is (cid:80) lj =1 z j,i + t ( B i − ) ( (cid:80) l +1 j =1 x j,i + (cid:80) l +1 j =1 x j,i − ) > L .ii. B (cid:48) i = B i . Let T i = max { t ( B i − ) , t ( B i ) } . The constraint we add is (cid:80) lj =1 z j,i + T i ( (cid:80) l +1 j =1 x j,i + (cid:80) l +1 j =1 x j,i − ) > L . The constraint is aconsequence of Lemma 2.Thus, each B i defines either one or two constraints. Analogously, each horizontalvariable C j also defines one or two constraints. The linear program dual to the one weave just described has dual variables y (cid:48) i , y i . For each B i with t ( B i ) > let y (cid:48) i denotethe dual variable corresponding to constraint t ( B i ) − (cid:80) l +1 j =1 x j,i > L . The othertype of constraint (if it exists) defined by B i is represented by y i . The dual variablescorresponding to horizontal boundaries are w i , w (cid:48) i . Example 4.
Array A has one vertical boundary B of type and one horizontal bound-ary C of type (see Figure 2). z , z , x , x , B C Fig. 2.
An array with one vertical and one horizontal boundary.
The linear program for A looks as follows. In brackets we give the dual variablescorresponding to respective inequalities.minimize x , + x , + z , + z , subject to x , + x , + z , > L ( y ) x , + z , + z , > L ( w ) Example 5.
Array A has two vertical boundaries and two horizontal ones, each of thefour boundaries is of type . The array is depicted in Figure 3.minimize (cid:80) i =1 (cid:80) j =1 x j,i + (cid:80) i =1 (cid:80) j =1 z i,j subject to (cid:80) j =1 x j, + (cid:80) i =1 z i, > L ( y ) (cid:80) i =1 (cid:80) j =1 x j,i + (cid:80) i =1 z i, > L ( y ) (cid:80) j =1 z ,j + (cid:80) i =1 x ,i > L ( w ) (cid:80) i =1 (cid:80) j =1 z i,j + (cid:80) i =1 x ,i > L ( w ) Example 6.
Array A has two vertical boundaries B , B and two horizontal ones C , C . Their types are the following: t ( B ) = t ( C ) = 2 and t ( B ) = t ( C ) = 1 .Also B (cid:48) (cid:54) = B and C (cid:48) = C . B C C x , x , x , x , x , x , z , z , z , z , z , z , Fig. 3.
An array with two vertical and two horizontal boundaries. minimize (cid:80) i =1 (cid:80) j =1 x j,i + (cid:80) i =1 (cid:80) j =1 z i,j subject to (cid:80) j =1 x j, + (cid:80) i =1 z i, > L ( y ) (cid:80) j =1 x j, > L ( y (cid:48) ) (cid:80) i =1 z i, + (cid:80) j =1 x j, > L ( y ) (cid:80) j =1 z ,j + (cid:80) i =1 x ,i > L ( w ) (cid:80) i =1 (cid:80) j =1 z i,j + (cid:80) i =1 x ,i > L ( w ) (cid:80) j =1 z ,j > L ( w (cid:48) ) Let us now build dual linear programs for some of these examples.For the array from Example 5, the dual linear program has the following form:maximize L ( y + y + w + w ) subject to y + y + w ≤ x , ) y + y + w ≤ x , ) y + w + w ≤ z , ) y + w + w ≤ z , ) We have omitted inequalities y + w ≤ and y + w ≤ corresponding tovariables x , and x , as they will have to be satisfied because of inequalities corre-sponding to variable z , .For the array from Example 6, the dual linear program has the form:aximize L ( y + y + w + w ) subject to y (cid:48) + y + w ≤ x , ) y + w ≤ x , ) y (cid:48) + y + w ≤ x , ) y + w ≤ x , ) y + w + w ≤ z , ) y + w + w ≤ z , ) y + w (cid:48) + w ≤ z , ) y + w (cid:48) + w ≤ z , ) To figure out the form of constraints constituting the dual program in general, letus consider a variable x j,i . Notice that it occurs in at most one constraint defined bya horizontal boundary. It can possibly be contained only in the constraint defined by C j represented by w j , where its coefficient is . If t ( B i ) = 1 , then we do not have y (cid:48) i and x j,i occurs in constraint represented by y i and possibly in constraint representedby y i +1 . Thus the inequality in the dual program corresponding to x j,i has the form α j,i y i + α j,i +1 y i +1 + β j,i w j ≤ , where each of the coefficients belongs to [0 , .If t ( B i ) > , then we do have y (cid:48) i and x j,i occurs in this constraint with the coef-ficient t ( B i ) − . If B i (cid:54) = B (cid:48) i , then x j,i does not occur in any other constraints and theinequality in the dual program has the form t ( B i ) − y (cid:48) i + β j,i w j ≤ , where β j,i ∈ [0 , .Otherwise, x j,i may also belong to constraints represented by y i and y i +1 . In each oneof them it occurs with the coefficient equal to at most t ( B i ) . Therefore the inequality hasthe form t ( B i ) − y (cid:48) i + α j,i y i + α j,i +1 y i +1 + β j,i w j ≤ , where each of the coefficients α j,i +1 , α j,i belongs to [0 , t ( B i ) ] .We are ready to prove the lower bound of the weight of array A with the aid of itsboundaries and their shadows. (proof of Lemma 3) Proof.
Since the value of any cost function of the dual linear program described aboveis a lower bound on the minimal value of the cost function of the primal linear program,it suffices to find a feasible assignment of the dual variables such that the cost functionwill be have value greater than
T L . Claim.
We can satisfy all constraints of the dual program by assigning the followingvalues to the dual variables. Each y i and each w j is assigned . If B i defines only oneconstraint y (cid:48) i , then we assign t ( B i )3 to y (cid:48) i . Otherwise y (cid:48) i is assigned t ( B i ) − .The claim follows from the fact that inequality T − · T + ≤ is satisfied by each T ≥ and that inequality T − T − + T + ≤ is also satisfied by each T ≥ .This means that the total value contributed by the dual variables y i , y (cid:48) i (correspond-ing to constraints defined by boundary B i ) is at least t ( B i )3 .Thus w ( A ) > L ( T v + T h ) ≥ T L . (cid:50) We show a method to find tiling of A with at most T +1 tiles. By Facts 1, 2, Lemmas1 and 3, we proved that T + 1 ≤ p , when the approximation factor is . In other words,we obtain a -approximation algorithm for binary RT ILE . lgorithm 1 A ← [1 . . . n, . . . n ] a two-dimensional array2: Construct the horizontal and vertical boundaries and their shadows using Definition 2.3: B ← { B , B , . . . B k } (the vertical boundaries, where each B i = A [ b i ] )4: B (cid:48) ← { B (cid:48) , B (cid:48) , . . . B (cid:48) k } (the shadows of B i s, where each B (cid:48) i = A [ b (cid:48) i ] )5: t ( B ) ← { t ( B ) , t ( B ) , . . . t ( B k ) } (the types of the vertical boundaries)6: C ← { C , C , . . . C l } (the horizontal boundaries, where each C i = A [ c i ] )7: C (cid:48) ← { C (cid:48) , C (cid:48) , . . . C (cid:48) l } (the horizontal boundaries, where each C (cid:48) i = A [ c (cid:48) i ] )8: t ( C ) ← { t ( C ) , t ( C ) , . . . t ( C l ) } (the types of the horizontal boundaries)9: T v ← (cid:80) ki =1 t ( B i ) T h ← (cid:80) li =1 t ( C i ) if T v ≤ T h then
12: use the vertical boundaries B as described below13: else
14: use the horizontal boundaries C instead of the vertical ones15: if B k = B (cid:48) k then
16: partition A [ b k . . . n ] horizontally into t ( B k ) tiles17: else
18: cover A [ b k + 1 . . . n ] with one tile19: for i = k − . . . , do if B i = B (cid:48) i then if B i +1 = B (cid:48) i +1 then
22: tile A [ b i . . . b i +1 − horiz. into t ( B i ) tiles (by 3a)23: else
24: partition A [ b i . . . b i +1 ] horiz. into t ( B i +1 ) tiles (by 4b)25: else ( B i (cid:54) = B (cid:48) i ) if B i +1 = B (cid:48) i +1 then
27: cover A [ b i + 1 . . . b i +1 − horiz. with one tile (by 3b)28: else
29: partition A [ b i + 1 . . . b i +1 ] horiz. into t ( B i +1 ) tiles (by 4b)30: if B = B (cid:48) then
31: cover A [1 . . . b − with one tile (by 2a)32: else
33: partition A [1 . . . b ] horiz. into t ( B ) tiles (by 2b) heorem 1. For arrays A satisfying p w ( A ) ≈ , there exists a linear time -approximation algorithm for binary RT ILE . ( + β ) -approximation In this section we examine the general case, arrays such that p w ( A ) is not negligible.We will aim at a ( + β ) -approximation. When β < , the approximation ratio ofour algorithm is better than . Throughout the section, whenever we refer to tiling andpartitioning, we mean ( + β ) L -partitioning and tiling using tiles of weight at most ( + β ) L .We define a sequence of boundaries and shadows analogously as in the previoussection, but with respect to ( + β ) L , i.e., we replace each occurrence of “ L ” with“ ( + β ) L ” and modify the meaning of tiling and partitioning accordingly, i.e., to ( + β ) L -partitioning.Observe that Lemma 1 still holds.We want to prove an analogue of Lemma 3. To this end we will consider an analo-gous linear program, in which we have all the variables occurring in the previous sectionand additionally we have a variable s i,j for each pair ( B i , C j ) , which denotes the ele-ment of A at the intersection of the vertical boundary B i and the horizontal boundary C j . The function we minimize is (cid:80) ki =1 x j,i + (cid:80) lj =1 z i,j + (cid:80) ki =1 (cid:80) lj =1 s i,j . For eachvariable s i,j we have an additional constraint: − s i,j ≥ − . The variable s i,j is alsoincluded in all those constraints which refer to the part of A covering the intersectionof B i with C j .For instance, the linear program for the array from Example 4 is modified as follows:minimize x , + x , + z , + z , + s , subject to x , + x , + z , + s , > ( + β ) L ( y ) x , + z , + z , + s , > ( + β ) L ( w ) − s , ≥ − t , ) . The linear program for the array from Example 5 in the new scenario looks asfollows: min (cid:80) i =1 (cid:80) j =1 x j,i + (cid:80) i =1 (cid:80) j =1 z i,j + (cid:80) i =1 (cid:80) j =1 s i,j s.t. (cid:80) j =1 x j, + (cid:80) i =1 z i, + (cid:80) j =1 s ,j > ( + β ) L ( y ) (cid:80) i =1 (cid:80) j =1 x j,i + (cid:80) i =1 z i, + (cid:80) i =1 (cid:80) j =1 s i,j > ( + β ) L ( y ) (cid:80) j =1 z ,j + (cid:80) i =1 x ,i + (cid:80) i =1 s i, > ( + β ) L ( w ) (cid:80) i =1 (cid:80) j =1 z i,j + (cid:80) i =1 x ,i + (cid:80) i =1 (cid:80) j =1 s i,j > ( + β ) L ( w ) − s i,j ≥ − t i,j ) , for each ≤ i, j ≤ . Correspondingly, in the dual program we maximize ( + β ) L ( (cid:80) y i + (cid:80) w j ) − (cid:80) t i,j and we have an additional constraint for each primal variable s i,j .The dual linear program for the array from Example 5 contains the followingadditional inequalities. + y + w + w − t , ≤ s , ) y + y + w − t , ≤ s , ) y + w + w − t , ≤ s , ) y + w − t , ≤ s , ) . We can see that if we want to assign to each variable y i , w j , then we sometimesalso have to assign to variables t i,j to ensure the feasibility - compare the first in-equality in the set of additional inequalities above. We can notice that we have to assign to t i,j only if both i < k and j < l , i.e. when s i,j does not belong to B k or C l . Lemma 4.
Let T = min { T v , T h } . Then for β = p w ( A ) , it holds that w ( A ) > T L . Proof.
We can satisfy all constraints of the dual program by assigning the followingvalues to the dual variables. Each y i and each w j is assigned . If B i defines only oneconstraint y (cid:48) i , then we assign t ( B i )3 to y (cid:48) i . Otherwise y (cid:48) i is assigned t ( B i ) − . Also, each t i,j such that i < k and j < l is assigned .Some of the constraints in the primal program have value ( + β ) L − on the righthand side. Such constraints correspond to some borders of type greater than , whenwe use Lemma 2. Let us analyze such cases in more detail. Assume that for a boundary B i of type k > we indeed use Lemma 2. Then the primal linear program contains aconstraint with value ( + β ) L − on the right hand side. This constraint correspondsto the dual variable y i . We notice that B i also defines a constraint of type , which has ( + β ) L on the right hand side and corresponds to the dual variable y (cid:48) i . Hence each suchboundary contributes at least t ( B i ) − ( + β ) L + ( + β ) L − ≥ ( ( + β ) L − t ( B i )3 ) to the cost function of the dual linear program.Similarly, some of the constraints in the primal program have value ( + β ) L − on the right hand side. Such constraints correspond to some borders of type equal to ,when we use Lemma 2. Each such boundary contributes at least ( ( + β ) L − t ( B i )3 ) tothe cost function of the dual linear program.Thus the value of the cost function of the dual linear program is lower bounded by (( + β ) L − )( T v + T h ) − ( T h − T v − ≥ T L + p T v + T h − ( T v + T h ) − ( T h − T v − .Since L ≥ w ( A ) p , we get that w ( A ) ≥ T L + p ( T v + T h )3 + T v + T h − T v T h − . Because p ≥ T , we obtain that p ( T v + T h )3 + T v + T h − T v T h − ≥ T + T v + T h − > . Therefore, w ( A ) > T L . (cid:50) Theorem 2.
There exists a ( + p w ( A ) ) -approximation algorithm for binary RT ILE thathas a linear ( O ( n ) ) running time. In this section, we prove that the approximation ratio for the RT
ILE problem is tightwith respect to the only known lower bound. Percisely, we prove the following theorem. heorem 3.
Let p = 2 k , for some k ∈ N . Then, there exists a binary array A k suchthat the maximum weight of a tile in any tiling of A k into p tiles has weight at least · w ( A k ) p + 1 . ( a )( b ) Fig. 4.
The empty squares denote a value of , while the ones are colored black. ( a ) On tiling thisarray with tiles, one tile will always contain ones, giving an approximation factor of . ( b )4 -crosses placed in an array for proving an approximation lower bound of . We define an L - cross to consist of L + 1 ones, it is obtained by taking a ( L + 1) × ( L + 1) array, and filling the ( L + 1) th row as well as the ( L + 1) th column with ones,finally the rest of the entries are filled with zeros. The coordinate ( L + 1 , L + 1) isreferred to as the center of the L -cross defined above. An L -cross centered at ( x, y ) isobtained by translating the center of an L -cross to the coordinate ( x, y ) . Note that an L -cross consists of four contiguous segments of ones, referred to as arms , each containing L ones. (proof of Theorem 3) Proof.
Suppose that p is even, therefore p = 2 k , for some k ∈ N ; our input binary array A k is obtained as follows. We place k many L -crosses centered at ( j · ( L + 1) − L , j · ( L + 1) − L ) , for each ≤ j ≤ k , the rest of the entries of A k are zero. Note thathe L -crosses are placed diagonally in a non-overlapping manner, and w ( A ) p = L . Thearray for L = 4 is illustrated in Figure 4 ( a ) .If p = 2 , then it is obvious that one tile will have to contain arms of the cross andthus have weight L + 1 . We will prove that for every k ∈ N , one of the tiles will haveweight at least L + 1 .Suppose that for k crosses and k tiles the thesis holds by induction. We will nowprove it for k + 1 crosses and k + 2 tiles. Let T be the tile that contains the cell A k +1 [1 , . If this tile has weight smaller than L , then we have the following twocases:1. If T does not contain the center of the lower left cross A k +1 [ L + 1 , L + 1] , then T is formed either by the first L columns or the first L rows. Due to symmetry, itis enough to consider the case when T is formed by the first L columns. Let T be the tile that contains A k +1 [ L + 1 , . If T has weight smaller than L , then itsupper right corner A k +1 [ x, y ] is such that either x < L + 1 or y < L + 1 . Dueto symmetry, it is enough to consider the case when x < L + 1 . In this case, if y < n , then we can extend T so that y = n without increasing the weight of T asit would not intersect any new L -cross.Thus, we are left with k tiles, and an array which has A k as a subarray, thereforeby the induction hypothesis we get that the weight of maximum weight tile is atleast L + 1 .2. If T contains the center of the cross A k +1 [ L + 1 , L + 1] , then its right uppercorner A k +1 [ x, y ] is such that x < L + 1 or y < L + 1 . Notice that we may assumethat either one tile will be formed by subarray A k +1 [ x + 1 , , n, y ] or by subarray A k +1 [1 , y + 1 , x, n ] . This is because the tile that contains A k +1 [ x + 1 , y + 1] cannotcontain both A k +1 [1 , y + 1] and A k +1 [ x + 1 , . Suppose w.l.o.g. that the tile T that contains A k +1 [ x + 1 , does not cover any cell of row y + 1 . We may thenextend the upper right corner of T till A k +1 [ n, y ] , without increasing the weight ofany tile. We are left with k tiles, and the induction hypothesis gives us the result.In the case when p is odd, the input binary array A (cid:48) p is obtained from A k +1 by deletingany rows and columns in it with index at least k ( L + 1) + L + 2 . This, in effect addsan extra half L -cross near the upper right corner of A k . Clearly, for p = 3 it is notpossible to tile A (cid:48) with tiles such that the weight of maximum weight tile is less than L . The rest of the proof follows from arguments similar to the case when p is even. (cid:50) In this section, we present an approximation algorithm for the DRT
ILE problem. Wehave presented a + β -approximation algorithm for the RT ILE problem in Section .Now we show how to reduce an instance of the DRT ILE problem to an instance of theRT
ILE problem to achieve an approximation ratio for the DRT
ILE problem. Before weproceed, let us recall the definition of the DRT
ILE problem.– the
DRT
ILE problem
Input:
A two-dimensional array A and a weight upper bound W . • Goal:
Partition A into a minimum number of non-overlapping tiles, where theweight of each tile must not be larger than W .Let us consider an array A with w ( A ) = n . Suppose W , provided as input, is themaximum allowed weight of any tile. Clearly, the minimal number of tiles we need touse to cover A is (cid:100) nW (cid:101) . Consequently, (cid:100) nW (cid:101) is a lower bound to the optimal solutionof the DRT ILE problem. Our goal is to obtain a γ -approximation algorithm, where γ depends on W . Therefore, the number of tiles we are allowed to use to cover A withthis approximation is γ × (cid:100) nW (cid:101) .We construct an instance of the the RT ILE problem as follows: as an input we havethe same array A , and we are allowed to use at most p = γ × (cid:100) nW (cid:101) tiles. Hence fromSection 2, the lower bound on the maximum weight of a tile is (cid:100) nγ ×(cid:100) nW (cid:101) (cid:101) . Hence themaximum weight of a tile with approximation factor of + β is, (cid:108) nγ × (cid:100) nW (cid:101) (cid:109) × ( 32 + β ) ≤ (cid:108) nγ × nW (cid:109) × ( 32 + β ) = (cid:108) Wγ (cid:109) × ( 32 + β ) . For the solution returned by RT
ILE to be a valid solution of DRT
ILE , the value of (cid:100) Wγ (cid:101) × ( + β ) must not exceed W . This allows us to derive a bound on the value ofthe approximation factor γ , we have, (cid:100) Wγ (cid:101) × ( 32 + β ) ≤ W ⇒(cid:100) Wγ (cid:101) ≤ W ( + β ) ⇒ Wγ ≤ W ( + β ) + 1 ⇒ γ ≥ ( 32 + β ) · WW + ( + β ) . This gives us the following theorem.
Theorem 4.
There exists a ( + β ) · WW +( + β ) -approximation algorithm for the DR-T
ILE problem where ( + β ) is the approximation factor for the RT ILE problem. Theapproximation factor of the
DRT
ILE problem tends to as the value of W is increased. RT ILE problem
In section , the algorithm presented for the RT ILE problem was restricted to two di-mensions. In this section, we generalize that algorithm for the d -dimensional RT ILE problem, where d ≥ . In the d -dimensional RT ILE problem, we are given a d -dimensional array of size n in each dimension, containing / as entries, and we haveo partition the array into p non-overlapping d -dimensional tiles such that the maximumweight of a tile in a tiling is minimized. Similarly to Section , we assume that p d w ( A ) is close to and give a d − d -approximation algorithm for the d -dimensional RT ILE problem. Notice that the approximation ratio converges to as we increase the value of d . Boundaries and Shadows
The definition of the boundaries and their shadows area generalization of the definitions in Section . The type of the boundaries in a d -dimensional array can be defined analogously. By [ i ] , we define the set of boundaries ofdimension n × n × . . . × × . . . × n , where i th dimension has size .Let B , B , ..B k ∈ [ i ] , we define T i = (cid:80) ki =1 t ( B i ) . Finally T is defined as min { T , T , ..., T d } . The following lemma is analogous to Fact . Lemma 5.
Let T = { T , T , ..., T d } , then the array can be d − d -tiled with T + 1 tiles. We can estimate the minimal weight of the array using the linear program. Theconstraints of the linear program have a similar form as mentioned in Section . In twodimensional problem, each constraint is greater than . L . In the d-dimensional RT ILE problem, each constraint is greater than d − d L , instead of . L . Lemma 6.
Let T = { T , T , ..., T d } , then w ( A ) > T L . The proof of this lemma is analogous to Lemma 4.
Theorem 5.
There exists a d − d -approximation algorithm for the multi-dimensional RT ILE problem assuming p d w ( A ) is negligible. ibliography [1] Piotr Berman, Bhaskar DasGupta, S. Muthukrishnan, and Suneeta Ramaswami.Improved approximation algorithms for rectangle tiling and packing. In Proceed-ings of the 12th Annual Symposium on Discrete Algorithms , pages 427–436, 2001.[2] Piotr Berman and Sofya Raskhodnikova. Approximation algorithms for min-maxgeneralization problems.
ACM Trans. Algorithms , 11(1):5:1–5:23, 2014.[3] Moses Charikar, Chandra Chekuri, and Rajeev Motwani. Unpublished.[4] Wenliang Du, David Eppstein, Michael T. Goodrich, and George S. Lueker. Onthe approximability of geometric and geographic generalization and the min-maxbin covering problem. In
Algorithms and Data Structures, 11th International Sym-posium, WADS , pages 242–253, 2009.[5] Grzegorz Gluch and Krzysztof Lorys. 4/3 rectangle tiling lower bound.
CoRR ,abs/1703.01475, 2017.[6] Michelangelo Grigni and Fredrik Manne. On the complexity of the generalizedblock distribution. In
Parallel Algorithms for Irregularly Structured Problems,Third International Workshop, IRREGULAR ’96 , pages 319–326, 1996.[7] Sanjeev Khanna, S. Muthukrishnan, and Mike Paterson. On approximating rectan-gle tiling and packing. In
Proceedings of the Ninth Annual ACM-SIAM Symposiumon Discrete Algorithms , pages 384–393, 1998.[8] Sanjeev Khanna, S. Muthukrishnan, and Steven Skiena. Efficient array partition-ing. In
Automata, Languages and Programming, 24th International Colloquium,ICALP’97, Bologna, Italy, 7-11 July 1997, Proceedings , pages 616–626, 1997.[9] Krzysztof Lorys and Katarzyna E. Paluch. Rectangle tiling. In
ApproximationAlgorithms for Combinatorial Optimization, Third International Workshop, AP-PROX2000 , pages 206–213, 2000.[10] Krzysztof Lorys and Katarzyna E. Paluch. New approximation algorithm forRTILE problem.
Theor. Comput. Sci. , 303(2-3):517–537, 2003.[11] S. Muthukrishnan, Viswanath Poosala, and Torsten Suel. On rectangular partition-ings in two dimensions: Algorithms, complexity, and applications. In
DatabaseTheory - ICDT ’99 , pages 236–256, 1999.[12] Katarzyna Paluch.
Approximation Algorithms for Rectangle Tiling . PhD thesis,2004.[13] Katarzyna E. Paluch. A 2(1/8)-approximation algorithm for rectangle tiling. In
Automata, Languages and Programming: 31st International Colloquium, ICALP2004 , pages 1054–1065, 2004.[14] Katarzyna E. Paluch. A new approximation algorithm for multidimensional rect-angle tiling. In
Algorithms and Computation, 17th International Symposium,ISAAC 2006 , pages 712–721, 2006.[15] Jonathan P Sharp. Tiling multi-dimensional arrays. In
International Symposiumon Fundamentals of Computation Theory , pages 500–511. Springer, 1999.[16] Adam Smith and Subhash Suri. Rectangular tiling in multidimensional arrays.