Integer Models for the Problem of Covering a Polygonal Region by Rectangles

G. Scheithauer, Yu. Stoyan and T. Romanova

Abstract– The aim of the paper is to develop in- require a lot of computational effort to prove that teger linear programming (ILP) models for the circumstance. problem of covering a polygonal region by rectan- gles. We formulate a Beasley-type model in which In [8] one-dimensional bar relaxations for the CPR the number of variables depends on the size pa- problem are proposed to be used as necessary condi- rameters. Another ILP model is proposed which tions for existence of coverings. has O(n2 max{m, n}) variables where m is the num- are of interest in many fields of ber of edges of the target set and n is the number of given rectangles. In particular we consider the application. There are many relations between cov- case where the polygonal region is convex. Exten- ering and packing or cutting problems. For an an- sions are also discussed where we allow the polyg- notated survey on Cutting and Packing we refer to onal region to be a union of a finite number of [5]. Covering problems arise naturally in a variety of convex subsets. applications. For a comprehensive overview we refer to [4]. Index terms – Covering, Integer Linear Program- ming, Mathematical Modelling, Optimization As an example, query optimization in spatial databases is a source of covering problems. In this setting a query may correspond to a geometric re- Introduction and Problem For- gion and be phrased in a generic form using geomet- ric parameters. Given a set of existing geometric, mulation parametrized, query regions and a set of points or re- gions, we might want to ask if there are values of the In this paper the problem of covering a polygonal parameters that allow the query regions to cover the target set Ω by a finite number of given rectangles set of points or even regions. Another field of appli- is considered. The main aim is to formulate integer cation (also mentioned in [4]) is shape recognition for linear programming or optimization models. Rota- robotics, graphics or image processing applications. tion of rectangles is not allowed. In particular, the In these cases it is sometimes useful to represent a target set is assumed to be an arbitrary convex poly- shape as a collection of parts. However, given a col- gon. Since covering with axes-parallel rectangles is lection of parts and a shape, it can be difficult to considered the target set can also be assumed to be determine if the shape can be described by that col- an orthogonally convex rectilinear . lection of parts. If the goal is to obtain an outer ap- proximation of the shape using the parts, then this The decision version of problem CPR (Covering a can be posed as a covering problem. Polygonal set with Rectangles) asks whether there ex- ists a covering or not. It is known to be NP-complete Besides the decision problem whether a covering ex- since the decision version of the Bin Packing Prob- ists or not, related problems can be of interest. For lem ([6]) can be reduced to the CPR problem (cf. [4]). instance, one can ask for a minimum number of (iden- Notice, in difference to e.g. [4] where a finite number tical) rectangles needed to form a cover for the target of points has to be covered, we consider the covering region. Or, if there exist several covers one can look of an infinite point set. Therefore, the verification for a best cover where best means that some objective that a certain configuration of the rectangles forms a function is regarded. cover of the target set cannot be done by inspecting a In computational geometry, decomposition of a poly- finite number of points, another technique is needed. gon is of high interest involving partitioning and cov- A solution approach based on a so-called Γ-function ering problems. For details and further literature we is proposed in [9]. The Γ-function of a certain config- refer to [10, 1, 7]. uration of all given rectangles attains a non-negative value if and only if this configuration forms a feasible In the approach proposed in [9] to solve the problem covering of the target set. Based on an enumera- of covering a compact polygonal region with a finite tion scheme, instances for which no cover exists can family of rectangles, the choice of a suitable start- ing configuration is in particular an essential aspect.

4 R&I, 2009, No2 Therefore, and since the CPR problem is hard to We always assume that problem CPR has a solution. solve, enumeration algorithms like branch-and-bound This can be done by adding some sufficiently large have to be used in general in an exact solution ap- rectangle R0 (i. e. the minimum Ω enclosing rectan- proach. Another possibility to attack the CPR prob- gle) with c0 > i∈In ci. Consequently, if the optimal lem consists in formulating integer linear program- value of the CPR problem is not smaller than c0 then ming models and to solve them. the original problemP has no covering. The aim of this contribution is to develop models and to discuss advantages and disadvantages with respect to the construction of exact solution approaches. A Beasley-type Model: Without loss of generality, we assume that all input- ILP Model 1 data are integers. The paper is organized as follows. In the rest of this Beasley [3, 2] proposed an integer linear program- section we give the input-parameter and state the ming (ILP) model with 0/1-variables for the two- problem considered in the paper. In the next sec- dimensional rectangle packing problem. There, the tion a Beasley-type model of the covering problem is 0/1-variables xipq are used to describe the placement discussed. Then, in section 3, a basic model is devel- of the reference point (lower left corner) of rectangle oped. In section 4, we present a corresponding ILP Ri at position (p, q). model. Some extensions and alternative formulations are discussed in section 5. Finally, some conclusions For an ILP model of the CPR problem we can also follow. use these xipq-variables. Let

X := max Ω X ,X := min Ω X , Within this paper we consider the following optimiza- E i∈I i W i∈I i Y := max Ω Y ,Y := min Ω Y tion problem. We assume that target set Ω is a con- N i∈I i S i∈I i vex polygon. Consequently, we can use the represen- denote the extremal coordinates of Ω. To visualize tation different directions we use N for the north-direction,

Ω = {(x, y): gj(x, y) ≤ 0, j ∈ IΩ} E, S and W for east, south and west direction, re- spectively. Clearly, directions N, E, S and W can be = conv{(Xj,Yj): j ∈ IΩ}, understood as top, right, bottom or left direction, re- IΩ = {1, . . . , m}. spectively. Without loss of generality, we may assume X = 0 and Y = 0. Consequently, target set Ω is All the linear functions g , j ∈ I are assumed to W S j Ω completely contained within a rectangle R of dimen- be necessary for the representation of Ω. Hence, the 0 sions L0 = XE − XW and W0 = YN − YS . Since all number of vertexes (corners) (Xj,Yj) of Ω coincides input-data are assumed to be integral we can restrict with the (minimum) number of functions g . In order j the coordinates of all allocation point to be integral to cover the given target set Ω the following rectan- too. Let L = {0,...,L −ℓ }, W = {0,...,W −w }, gles are available: i 0 i i 0 i i ∈ In. If rectangle Ri is placed with its lower left Ri = {(x, y): −ai ≤ x ≤ ai, −bi ≤ y ≤ bi}, corner at point (p, q) with p ∈ Li and q ∈ Wi then it

i ∈ In = {1, . . . , n} covers the point set where 2a is the length and 2b the width of rectangle Ri(p, q) = {(x, y): p ≤ x < x + ℓi, i i (1) Ri. We assign to each rectangle its (positive) value ci, ≤ y < q + wi} i ∈ In, e. g. ci = aibi, and we denote the placement parameters (translation vectors) by ui = (xi, yi), i ∈ where ℓi = 2ai and wi = 2bi, i ∈ In. Notice, here In. Hence, the upper and right boundary are assumed not to be in Ri(p, q) Let Ω denote the minimal orthogonally Ri(xi, yi) = {(x, y): xi − ai ≤ x ≤ xi + ai, convex with only integral corner yi − bi ≤ y ≤ yi + bi} points enveloping Ω. Since we are looking for a cov- ering of Ω with only rectangles we have, the convex represents the translated rectangle Ri. Then the problem CPR under consideration is: target set is covered if Ω is covered. Notice, using an appropriate scale the approximation of Ω by Ω is ∗ Find a subset I of In of the rectangles and tight enough to obtain an exact solution. We assume corresponding placement parameters ui, i ∈ that Ω is a closed point set. According to definition ∗ I such that ∪i∈I∗ Ri(ui) forms a cover of Ω (1) not all integer lattice points in Ω have to be cov- ered namely those lying on the NE or SE boundary, and its total valuation i∈I∗ ci is minimal. P

R&I, 2009, No2 5 accept the leftmost point lying on the SE boundary. {N,S}, if t ∈ {E,W }, Dt := t ∈ D. Let Ω denote the integer lattice points in Ω which {E,W }, if t ∈ {N,S}.  have to be covered by the rectangles. Since the polygonal region Ω is assumed to be con- e Then the optimization problem can be formulated as vex the following denotations and abbreviations are follows: meaningful. We identify Ω defining functions visible from different directions as follows: Beasley-type model: ILP model 1 δg δg INW := {j ∈ I : j < 0, j > 0}, Ω Ω δx δy

ci xipq → min (2) NW mNW := |I |, i In e Ω X∈ (p,qX)∈Ω δg δg INE := {j ∈ I : j > 0, j > 0}, subject to Ω Ω δx δy

s t NE mNE := |IΩ |, xipq ≥ 1, ∀ (s, t) ∈ Ω, (3) SW δgj δgj i∈In p=s(i) q=t(i) I := {j ∈ I : < 0, < 0}, X X X Ω Ω δx δy e SW xipq ≤ 1, ∀ i ∈ In, (4) mSW := |IΩ |, p∈Li q∈Wi X X SE δgj δgj IΩ := {j ∈ IΩ : > 0, < 0}, xipq ∈ {0, 1}, p ∈ Li, q ∈ Wi, i ∈ In (5) δx δy SE mSE := |IΩ |, where s(i) = max{0, s − ℓi + 1}, t(i) = max{0, t − wi + 1}. Moreover, let This Beasley-type model has some drawbacks. First mrs = msr ∀r ∈ Ds, s ∈ D. of all, the number of 0/1-variables depends on the dimensions of the target set. Moreover, the choice of In order to characterize the relation between two rect- an appropriate scale can further increase this number. angles we define the constants Furthermore, the continuous (or linear programming, LP) relaxation (restrictions xipq ∈ {0, 1} are replaced 1, ai > aj, aij := by xipq ∈ [0, 1]) is weak. It yields feasibility if the 0, ai ≤ aj,  i, j ∈ In, i 6= j. (6) total area of the rectangles is not smaller than the 1, bi > bj, bij := area of Ω. This makes it difficult to solve the (integer) 0, bi ≤ bj,  Beasley-type model. These constants are used to combine different cases, Notice, the number of 0/1-variables can be some- and therefore, to shorten the description. what reduced regarding the shape of Ω instead of the enveloping rectangle L × W . Another opportunity For a given 0/1-vector α = (α1, . . . , αn) and a given 2n results from the principle of normalized patterns or vector u = (u1, . . . , un) ∈ IR of placement parame- 2 raster points. ters ui ∈ IR , i ∈ In let

P (u, α) := Ri(ui), i:αi=1 Basic Model [ H(u, α) := IR2 \ int(P (u, α)). In the following, an attempt is made to model the Polygonal set P (u, α) represents the point set covered CPR problem using a polynomial number of variables by the chosen rectangles whereas H(u, α) denotes the and restrictions. closure of the complement of P (u, α). For technical purposes let

Notations 4, if t ∈ {N,W }, dt := t ∈ D. (7) 2, if t ∈ {S, E}, The following sets of directions will be used: (

D := {N, E, S, W },

6 R&I, 2009, No2 Placement Parameters If more then one rectangle is used to cover Ω not all of these restrictions have to be fulfilled depending on the As already introduced above, we denote the place- relative positions of the rectangles. Here we assume ment parameters (translation vectors) to be found that no coverings are of interest where some cover- by ui = (xi, yi), i ∈ In. Hence, ing rectangle Ri(ui) is completely contained within another covering rectangle Rj(uj). Such a configura- Ri(xi, yi) = {(x, y): tion cannot be optimal because of assumption ci > 0, xi − ai ≤ x ≤ xi + ai, yi − bi ≤ y ≤ yi + bi} i ∈ In. represents the region covered by the translated rect- angle Ri. Relative Position Variables

Selection Variables If rectangles Ri and Rj are both used to cover Ω, i.e. if αi = αj = 1, 0/1-variables

In order to indicate those rectangles Ri, i ∈ In which r r φij and ψij, i, j ∈ In, i 6= j, r ∈ {1,..., 5} are used to cover the polygonal region Ω we define 0/1-variables αi according to are introduced to characterize the relative position of the two rectangles to each other. In doing so we con- 1,Ri(ui) is used for the cover, sider five different situations in horizontal and ialso n αi = ( 0,Ri(ui) is not used for the cover. vertical direction (cf. Fig. ??). Consequently, using both rectangles Ri and Rj that means we have Let Ri be given in the form R (x , y ) = {(x, y): f r(x, y) ≥ 0, r ∈ D}, i i i i r = 1 r = 3 r = 5 i ∈ In, where i

N fi (x, y) := yi + bi − y, r = 2 r = 4 E fi (x, y) := xi + ai − x, S fi (x, y) := y + bi − yi, Figure 1: labelfig-1 Different relative horizontal posi- W tions fi (x, y) := x + ai − xi.

In case that Ω fits within a single rectangle Ri(ui) and in related situations the following conditions on 5 5 u x , y r r the translation vector i = ( i i) are probably non- φ = 1 and ψ = 1. (9) trivial since they form the boundary of H(u, α): ij ij r=1 r=1 X X N fi (xi, yi) := yi + bi − YN ≥ 0, With other words, equations (9) should be fulfilled

E if and only if both rectangles Ri and Rj are used to fei (xi, yi) := xi + ai − XE ≥ 0, cover Ω in order to get a unique description of the f S(x , y ) := Y + b − y ≥ 0, different configurations/interactions of the two rect- ei i i S i i W angles which are as follows. fi (xi, yi) := XW + ai − xi ≥ 0. e 1 We define φij = 1 if and only if Rj(uj) is completely These inequalities should hold only if rectangle Ri left to Ri(ui) which leads to the inequality is used.e Therefore we modify them by adding some α 1 term depending on i: xj + aj ≤ xi − ai + M(1 − φij ) 1 f r(x , y ) + M(1 − α ) ≥ 0, (non-trivial if φij = 1) i i i i (8) r ∈ D, i ∈ In, where M is a sufficient large number, e. g. M = XE + e where M is a sufficient large number, e. g. M = ai + aj. The case when Rj(uj) is completely right to R (u ) is characterized by φ5 = 1. If int(R (u )) ∩ max{L0,W0}. For every i ∈ In these four restric- i i ij i i tions (in a somewhat modified manner) have to be Rj(uj) 6= ∅ then we have three subcases, namely added to an ILP model. r = 2: xj − aj ≤ xi − ai ≤ xj + aj,

R&I, 2009, No2 7 r = 3: either xj − aj ≤ xi − ai < xi + ai ≤ xj + aj Notice, every combination of φ- and ψ-values which 4 or xi − ai ≤ xj − aj < xj + aj ≤ xi + ai, fulfills conditions (9) defines a subset of IR of pos- u x , y u r = 4: xj − aj ≤ xi + ai ≤ xj + aj. sible placement parameters i = ( i i) and j = (x , y ). Obviously, only one of two cases with r = 3 can occur j j according to the definition of aij and bij in formula (6). Altogether, we have the following restrictions Overlap Characterizing Variables (describing the relative horizontal position of Ri and R ) which are non-trivial if some φ-variable has value j If two rectangles R and R are used to cover Ω then one: i j two essential different situations have to be consid- 1 hij(x, φ) := ered: is the intersection of the two rectangles empty 1 xi − ai − xj − aj + M(1 − φij ) ≥ 0, or not. For that reason 0/1-variables βij can be in- 2 hij(x, φ) := troduced which gets value one if and only if the in- 2 tersection of R (u ) and R (u ) is non-empty. xj + aj − xi + ai + M(1 − φij ) ≥ 0, i i j j 3 hij(x, φ) := It is obvious, the β-variables are dependent on the φ- 2 xi − ai − xj + aj + M(1 − φij ) ≥ 0, and ψ-variables. It holds 4 h (x, φ) := (aij − aji)(xj − aj − xi + ai) ij 4 4 3 +M(1 − φij ) ≥ 0, r r βij = φij · ψij , i, j ∈ In, i 6= j. 5 (10) hij(x, φ) := (aij − aji)(xi + ai − xj − aj) r=2 r=2 3 X X +M(1 − φij ) ≥ 0, Note that although in cases r = 1 or r = 5 some h6 (x, φ) := ij ”touching” is allowed, these situations cannot lead to x + a − x − a + M(1 − φ4 ) ≥ 0, j j i i ij a real overlap. 7 hij(x, φ) := 4 xi + ai − xj + aj + M(1 − φij ) ≥ 0, 8 Inner Corners hij(x, φ) := 5 xj − aj − xi − ai + M(1 − φij − ≥ 0. Every pair Ri and Rj of used rectangles with non- In a similar way the ψ-variables are defined to char- empty intersection (i. e. βij = 1) determines some acterize the relative vertical position of the two rect- points, called inner corners which probably define a angles: cone usable in the representation of H(u, α) 1 hij (y, ψ) := In order to obtain a description of H(u, α) we con- 1 yi − bi − yj − bj + M(1 − ψij) ≥ 0, sider all eight possibilities of inner corners which can e2 arise. By means of 0/1-variables we identify in depen- hij (y, ψ) := 2 dence of the φ- and ψ-variables these inner corners yj + bj − yi + bi + M(1 − ψij) ≥ 0, which are formed with respect to this configuration. eh3 (y, ψ) := ij Using further 0/1-variables we characterize those in- y b y b M ψ2 , i − i − j + j + (1 − ij) ≥ 0 ner corners which form cones for the description of e4 hij (y, ψ) := (bij − bji)(yj − bj − yi + bi) H(u, α). +M(1 − ψ3 ) ≥ 0, ij (11) In total, there are eight different types of inner cor- e5 hij (y, ψ) := (bij − bji)(yi + bi − yj − bj) ners. We define 3 +M(1 − ψij) ≥ 0, st e6 Eij , s ∈ D, t ∈ Ds, i, j ∈ In, i 6= j, hij (y, ψ) := y + b − y − b + M(1 − ψ4 ) ≥ 0, j j i i ij as follows: e7 hij (y, ψ) := 4 NW NE yi + bi − yj + bj + M(1 − ψij) ≥ 0, Eij := (xj −aj, yi+bi),Eij := (xj+aj, yi+bi), e8 hij (y, ψ) := SW SE 5 Eij := (xj −aj, yi−bi),Eij := (xj +aj, yi−bi), yj − bj − yi − bi + M(1 − ψij) ≥ 0. e EEN := (x +a , y +b ),EES := (x +a , y −b ), Because of definition we have ij i i j j ij i i j j r 6−r r 6−r EWN := (x −a , y +b ),EWS := (x −a , y −b ). φij = φji , ψij = ψji , ij i i j j ij i i j j r ∈ {1,..., 5}, i, j ∈ In, i 6= j.

8 R&I, 2009, No2 In order to identify those inner corners which are in- 1. duced by R , R , and the φ- and ψ-variables we define 3. @@ i j @ @@ 2. Ω 0/1-variables εst as follows. Ω@ Ω @@ ij @@ @@ NW The variable εij which corresponds to point NW Figure 3: Interaction between ENW and target region Eij = (xj − aj, yi + bi) has to be one if and only if ij Ω NW αi = αj = 1,Eij ∈ Ri(ui) ∩ Rj(uj). 1. Either Ω ⊂ {(x, y): y ≤ y + b }, or In this case, the set i i 2. Ω ⊂ {(x, y): x ≥ xj − aj}, or {(x, y): x ≤ xj − aj, y ≥ yi + bi} NW NW 3. gl(Eij ) ≥ 0 for at least one l ∈ IΩ . forms a cone in North-West direction. There are sev- NW eral situations where point Eij forms an inner cor- This can be modelled using the ε-variables as follows:: ner, namely: max {yi + bi − YN ,XW − xj + aj, 1. φ4 = 1, ψ4 = 1, NW NW ij ij max{gl(Eij ): l ∈ IΩ } (12) NW 4 3 +M(1 − εij ) ≥ 0. 2. φij = 1, ψij = 1, bji = 1,

3 4 For every pair of rectangles and every kind of poten- 3. φij = 1, aij = 1, ψij = 1, tial inner corner such an inequality has to be consid- 3 3 2 4. φij = 1, aij = 1, ψij = 1, bji = 1. ered, i. e. approximately 4n restrictions. But this NW inequality should be redundant if the point Eij is These four situations are depicted in Ffigure 2. covered by a third rectangle. Similar conditions hold for the other types of inner 1. 2. 3. 4. j j j corners. i j If only two rectangles are needed to cover Ω, i. e. i i i i∈In αi = 2 and βij = 1, then the resulting two or four inner corners determine cones usable in the NW P Figure 2: Situations where inner corner Eij can description of H(u, α). arise If more than two rectangles are needed to cover Ω Linear equations or inequalities are needed which en- then some of the resulting inner corners can be cov- NW sure that εij becomes one in exactly these four ered by another third rectangle, and hence, are not cases. It holds for i 6= j: useful for the description of H(u, α).

NW 4 3 4 3 εij = (φij + aijφij )(ψij + bjiψij ), Active Inner Corners NE 2 3 4 3 εij = (φij + aijφij )(ψij + bjiψij), SW 4 3 2 3 In case of more than two rectangles used to cover Ω εij = (φij + aijφij )(ψij + bjiψij ), NW it may happen that some inner corner, e. g. Eij , is SE 2 3 2 3 NW εij = (φij + aijφij )(ψij + bjiψij). covered by a third rectangle Rk so that Eij does not form a part of the complement of the union of cover- Furthermore, for i 6= j we have ing rectangles as drawn in Fig. 4. In order to charac- rs sr εij = εji , r ∈ D, s ∈ Dr. j NW NW If we suppose that εij = 1 and that Eij ∈ H(u, α) k then at least one of the following inequalities, illus- trated in Fig. 3, i must be fulfilled for the convex region Ω to ensure non-overlapping: NW Figure 4: Inner corner Eij is not active

R&I, 2009, No2 9 NW terize such situation we introduce a 0/1-variable ρij restriction (14) can be formulated as NW which has to be one if and only if Eij is not cov- rs r mst rs rs rs NW λij0 fi (xi, yi) + t=1 λijt gt (Eij ) ered by another rectangle. More precisely, ρij = 1 rs s (16) should hold true if and only if there does not exist +λij,mrs fj (xj , yj) ≥ 0, e +1 P any k ∈ In \{i, j} with r ∈ D, s ∈ Dr, i, j ∈ In, i 6= j, e rs rs 4 3 where gt are the functions corresponding to IΩ . 1. φkj + akj φkj = 1, and ψ4 b ψ3 2. ik + ki ik = 1. Summation

Hence, we define If for all relations between the α-, φ-, ψ-, ρ-, mad λ- variables linear inequalities or equalities can be ρNW = 1 ⇐⇒ ij found then an ILP model for the problem of covering φ4 a φ3 ψ4 b ψ3 . k6=i,j ( kj + kj kj )( ik + ki ik) = 0 a convex polygon by rectangles can be obtained. As an intermediate result we have the following formu- PρNW In case of ij = 1 the bounding constraints in lation of the CPR problem: North-direction for Ri and in West-direction for Rj (according to (1)) must be removed. This can be Compute placement parameters xi, yi, i ∈ In and p p rs achieved as follows: 0/1-variables αi, i ∈ In, φij , ψij p ∈ {1,..., 5}, ρij , rs and λijt, r ∈ D, s ∈ Dr, t ∈ {0, . . . , mrs + 1}, i, j ∈ N fi (xi, yi) + M(1 − αi) In, i 6= j such that NW +M j:j6=i ρij ≥ 0, e (13) ciαi → min, (17) W f (x , y P) + M(1 − α ) i∈In j j j j X NW +M j:j6=i ρij ≥ 0. subject to e Instead of the twoP removed restrictions, another con- 5 5 r r dition has to become relevant which guaranties that φij = αiαj, ψij = αiαj, ∀i, j, (18) r=1 r=1 Ω is either in one of the two half-planes determined X X by f N or f W or that ENW 6∈ int(Ω): t i j ij hij(x, φ) ≥ 0, t ∈ {1,..., 8}, ∀i 6= j, (19) t N W hij(y, ψ) ≥ 0, t ∈ {1,..., 8}, ∀i 6= j, (20) max{fi (xi, yi), fj (xj, yj), max{g (ENW ): l ∈ INW }} εrs = (φds + a φ3 )(ψdr + b ψ3 ), l ij Ω e ij ij ij ij ij ji ij e NW e (21) +M(1 − ρij ) ≥ 0. r ∈ D, s ∈ Dr, i 6= j. εrs = εsr, r ∈ D, s ∈ D . (22) Similar restrictions have to be introduced for the ij ji r rs rs other types of active inner corners: ρij ≤ εij , ∀r ∈ D, s ∈ Dr, i 6= j, (23)

rs rs ds r s ρij = εij ⇔ k6=i,j (φkj max{fi (xi, yi), fj (xj , yj), 3 dr 3 (24) max{g (Ers): l ∈ Irs}} +akj φkj )(ψikP+ bkiψik) = 0, l ij Ω (14) e rs e ∀r ∈ D, s ∈ Dr, i 6= j, +M(1 − ρij ) ≥ 0, r r ∈ D, s ∈ Dr, i, j ∈ In, i 6= j. fi (xi, yi) + M(1 − αi) rs +M j6=i s∈Dr ρij ≥ 0, (25) e r D, i j, Constraint Selection Variables ∈P P6= mrs|+1 λrs rs rs t=0 ijt (26) In case of an active inner corner Eij , i. e. with ρij = rs rs = ρij , ∀r, s, i, j. 1, 0/1-variables λijt, t = 0, . . . , mrs + 1, are needed P rs r mst rs rs rs to identify a single constraint which ensures the non- λij0fi (xi, yi) + t=1 λijtgt (Eij ) overlapping similar to (12). Because of rs s (27) +λij,mrs fj (xj , yj) ≥ 0, e +1 P mrs+1 r ∈ D, s ∈ Dr, i, j ∈ In, i 6= j. rs rs e λijt = ρij , ∀r, s, i, j. (15) In the following we are going to develop a correspond- t=0 X ing ILP model.

10 R&I, 2009, No2 4 4 ILP Model 2 r r βij ≤ φij , βij ≤ ψij , r=2 r=2 In order to get an ILP formulation with polynomial X X 4 4 number of variables and constraints, all conditions β ≥ φr + ψr − 1. in basic model (17) – (27) have to be formulated as ij ij ij r=2 r=2 linear restrictions. X X Relations Between ε-, φ- and ψ- Restricting the Placement Parameters Variables

In order to ensure that Ri does not overlap Ω if Ri Naturally, we have is not used, i. e. if αi = 0, we define the following st inequalities: 0 ≤ εij , ∀s ∈ D, t ∈ Ds, i, j ∈ In, i 6= j, (33)

−ai ≤ xi ≤ (XE + 2ai)αi − ai, Realization of the logical AND: (28) −bi ≤ yi ≤ (YN + 2bi)αi − bi, i ∈ In. rs ds 3 rs dr 3 ε ≤ φ + aijφ , ε ≤ ψ + bjiψ , ij ij ij ij ij ij (34) r ∈ D, s ∈ D , i 6= j, Relations Between α-, φ- and ψ- r rs ds 3 dr 3 Variables ε ≥ φ + aijφ + ψ + bjiψ − 1, ij ij ij ij ij (35) r ∈ D, s ∈ Dr, i 6= j, Lower bounds for φ- and ψ-variables: Because of definition: 0 ≤ φr , 0 ≤ ψr , ij ij rs sr (29) εij = εji ∀i, j, r, s. (36) ∀i, j ∈ In, i 6= j, r = 1,..., 5.

Symmetry conditions (source of reducing the number of variables): Relations Between ε- and ρ-Variables

φr = φ6−r, ψr = ψ6−r, By definition we have ij ji ij ji (30) r ∈ {1,..., 5}, i, j ∈ In, i 6= j. rs rs 0 ≤ ρij ≤ εij , ∀r ∈ D, s ∈ Dr, i 6= j, (37) Realization of the logical AND: In order to get an ILP formulation for (24), i.e. for 5 r 5 r φ ≤ αi, φ ≤ αj, r=1 ij r=1 ij (31) ρrs = εrs ⇔ 5 r ij ij P r=1 φij ≥ αi +Pαj − 1, i, j ∈ In, i 6= j. ds 3 dr 3 k6=i,j (φkj + akjφkj )(ψik + bkiψik) = 0, 5 5 P r r ∀r ∈ D, s ∈ Dr, i 6= j, r ψij ≤ αi, r ψij ≤ αj, P =1 =1 (32) 5 r ψ ≥ αi + αj − 1, i, j ∈ In, i 6= j. rs P r=1 ij P we introduce 0/1-variables ρijk by Moreover, inequalities (19) and (20) have to be ful- P rs ds 3 dr 3 filled. ρijk = 1 ⇔ (φkj + akj φkj )(ψik + bkiψik) = 1,

∀r ∈ D, s ∈ Dr, i 6= j, k ∈ In \{i, j}.

Relations Between β-, φ- and ψ- This can be modelled as follows: Variables rs ds 3 0 ≤ ρijk ≤ φkj + akj φkj , rs dr 3 According to basic model (17) – (27) where no β- ρijk ≤ ψik + bkiψik, (38) variables are used the following inequalities are not s r ρrs ≥ φd + a φ3 + ψd + b ψ3 − 1, needed. On the other hand, if it is intended to exploit ijk kj kj kj ik ki ik β-variables then these inequalities yield the relations ∀r ∈ D, s ∈ Dr, i 6= j, k ∈ In \{i, j}. between β-, φ- and ψ-variables. Now we have the condition Realization of the logical AND: rs rs ρij = 1 ⇔ ρijk = 0 0 ≤ βij, ∀i, j ∈ In, i 6= j, k i,j X6=

R&I, 2009, No2 11 rs which is modelled as ρij , i 6= j ∈ In, r ∈ D, s ∈ Dr, 2 rs rs rs rs O(n m) constraint selection variables λitj , i 6= j ∈ εij − ρij ≤ k6=i,j ρijk, In, r ∈ D, s ∈ Dr, t ∈ IΩ, and (n − 2)(εrs − ρrs) ≥ ρrs , (39) 3 rs ij P ij k6=i,j ijk O(n ) variables ρijk, i 6= j 6= k ∈ In, r ∈ D, s ∈ Dr. r D, s D , i j. ∀ ∈ ∈ r P 6= Hence, the total number of variables is proportional to n2 · max{n, m}. In the last condition it is assumed that at least two rectangles are available to build a cover, i. e. n ≥ 2. The number of constraints has the same order of mag- nitude. Moreover, we have

rs sr ρij = ρji , ∀r, s, i, j. (40) Extensions and, last but not least, Here we propose directions of further research. r fi (xi, yi) + M(1 − αi) rs (41) +M j6=i s∈Dr ρij ≥ 0, r ∈ D, i 6= j, e ILP Model 3: Non-convex Region Ω mrs|P+1 P rs rs λijt = ρij , ∀r, s, i, j. (42) If Ω is the union of a finite number of convex poly- t=0 X gons, i. e. rs r mst rs rs rs λij0fi (xi, yi) + t=1 λijtgt (Eij ) Ω = Ωq where Ωq is convex for all q, (44) rs s (43) +λij,mrs fj (xj , yj) ≥ 0, q e +1 P [ r ∈ D, s ∈ Dr, i, j ∈ In, i 6= j. e then, in analogy to [9], for every subset Ωq a com- plete set of λ-variables has to be introduced. The Feasibility placement parameters xi and yi and the α-, φ- and ψ-variables are maintained. In this model, objective function (17) and restric- tions (28) – (43), it is possible that no covering exists. For computational purposes it may be better to have An Alternative ILP Model the existence of feasible solutions in the optimization problem. Another way of modelling is as follows. Given the φ- and ψ-values we can obtain the ε-values. For a There are several possibilities to guarantee feasible certain subset Ωq we derive the ρ-values regarding solutions, e. g. by adding artificial rectangles with only these rectangles which are used to cover Ωq. For sufficient high costs, or by weakening some of the every Ωq a set of α-, ρ- and λ-variables is needed. restrictions similar to [9].

Restricting the Placement Parameters The Linear Model

For every q ∈ Q 0/1-variables αiq are defined. Then, Besides the linear objective function (17) and the lin- a rectangle Ri, i ∈ In, is used to cover Ω if for at least ear restrictions (19), (20), (22), (23), (25) – (27) of one q ∈ Q αiq = 1 holds true. In order to ensure that the basic model now we have to add all linear con- Ri does not overlap Ω = q∈Q Ωq if Ri is not used straints (28) – (43) to get a linear formulation of the for any subset of Ω, i.e. if q∈Q αiq = 0, we define CPR problem with continuous and binary variables. the following inequalities: S In this formulation we have P

2n continuous variables xi, yi, i ∈ In, −ai ≤ xi ≤ (XE + 2ai) q∈Q αiq − ai, n rectangle selection variables αi, i ∈ In, −bi ≤ yi ≤ (YN + 2bi) q∈Q αiq − bi, (45) 10n(n − 1) relative position variables φr and ψr , P ij ij i ∈ In. i 6= j ∈ In, r ∈ {1,..., 5}, P rs 8n(n − 1) inner corner identification variables ǫij , i 6= j ∈ In, r ∈ D, s ∈ Dr, 8n(n − 1) active inner corner identification variables

12 R&I, 2009, No2 Conclusions Stock Cutting. In Bortfeldt et al (eds), Intelligent Deci- sion Support, Gabler Edition Wiss. 2008, pp. 1-14 (with G. Belov, ,C. Alves, J.M.V. de Carvalho) 3. LP-based Two ILP models have been developed for problem bounds for the Container and Multi-Container Loading CPR. In the first one, the number of variables and Problem. Int. Trans. Opl. Res., 6 (1999) 199–213. constraints is dependent on the size of the target re- Address: Institute for Numerical Mathematics, Depart- ment of Mathematics, Technische Universit”at Dresden, gion; in the second model it is polynomially bounded 01062 Dresden, Germany, but even large. Investigations to reduce this number Field of specialisation: Operational Research, Mathemat- as well as numerical experiments are needed. More- ical modeling, Optimization, Cutting, Packing, Covering Member of ESICUP over, alternative formulations can possibly help. Yu. Stoyan 1966 Ph. D./Candidat in Physical- Mathematical Sciences, Institute of Cybernetics of Na- References tional Academy of Sciences of Ukraine, Kiev, 1970 Doc- tor of Technical Science, Aviation Engineering Institute in Moscow, 1972 Professor for Computational Mathemat- [1] V. S. Anil Kumar and H. Ramesh. Covering rectlinear poly- ics, the Kharkov National University of Radioelectron- ics, 1985 Corresponding-member of National Academy of gons with axis-parallel rectangles. SIAM J. Comput. vol. 32, Sciences of Ukraine, since 1972 Head of Department of no. 6, 2003, pp. 1509–1541. Mathematical Modeling at the Institute for Mechanical [2] J. E. Beasley. Bounds for two-dimensional cutting. J. Oper. Engineering Problems of the National Academy of Sci- ences of Ukraine. Res. Soc., vol. 36, no. 1, pp. 71–74, 1985. Selected papers: 1. Packing of convex polytopes into [3] J. E. Beasley. An exact two-dimensional non-guillotine cut- a parallelepiped, Optimization, vol. 54, 2005, pp. 215- ting tree search procedure. Oper. Res., vol. 33, no. 1, pp. 235.(with N. Gil, G. Scheithauer, A. Pankratov, I. Mag- dalina) 2. Packing of Various Radii Solid Spheres into a 49–64, 1985. Parallelepiped. Central Europen Journal of Operational [4] K. Daniels and R. Inkulu. An incremental algorithm for Research, 2003, Vol. 11, Issue 4, pp.389-407. (with G. translational polygon covering. Technical Report 2001-001, Yaskov, G. Scheithauer) 3. Packing cylinders and rectan- University of Massachusetts at Lowell Computer Science, 2001. gular parallelepipeds with distances between them, Eu- rop. J. Oper. Research 197, 2008, 446-455.(with A. [5] H. Dyckhoff, G. Scheithauer, and J. Terno. Cutting and Chugay). packing. In M. Dell?Amico, F. Maffioli, and S. Martello, ed- Address: Institute for Problems in Machinery, National itors, Annotated Bibliographies in Combinatorial Optimiza- Ukrainian Academy of Sciences, 2/10 Pozharsky St., tion, chapter 22, pp. 393–412. John Wiley & Sons, Chichester, Kharkov, 61046, Ukraine Field of specialisation: Computational Geometry, Oper- 1997. ational Research, Mathematical modeling, Optimization, [6] M. R. Garey and D. S. Johnson. Computers and Intractabil- Cutting, Packing, Covering ity – A Guide to the Theory of NP- Completeness. Freeman, Member of ESICUP San Francisco, 1979. T. Romanova 1990 Ph. D./Candidat in Physical- [7] A. Lingas, A. Wasylewicz, and P. Zylinski. Note on cover- Mathematical Sciences, Institute of Cybernetics of Na- ing monotone orthogonal with star-shaped polygons. tional Academy of Sciences of Ukraine, Kiev, 2003 Doctor of Technical Science, Institute of Cybernetics of National Information Processing Letters vol. 104, no. 6, pp. 220–227, Academy of Sciences of Ukraine, Kiev, 2005 Professor for 2007. Computational Mathematics, the Kharkov National Uni- [8] G. Scheithauer. One-dimensional relaxations for the prob- versity of Radioelectronics, since 2003 Senior staff sci- entist of Department of Mathematical Modeling at the lem of covering a polygonal region by rectangles. Preprint Institute for Mechanical Engineering Problems of the Na- MATH-NM-04-2009, Technische Universit”at Dresden, 2009. tional Academy of Sciences of Ukraine. [9] G. Scheithauer, Yu. Stoyan, T. Romanova, and A. Selected papers: 1. Phi-functions for complex 2D- Krivulya. Covering a polygonal region by rectangles. Com- objects//4OR Quarterly Journal of the Belgian, French and Italian Operations Research Societies. vol. 2, no putational Optimization and Applications, Springer, online: 1, 2004 pp. 69 - 84. (with G. Scheithauer, N. Gil, Yu. http://www.citeulike.org/user/ima/article/4575123 Stoyan) 2. Construction of a Phi-function for two con- [10] San-Yuan Wu and Sartaj Sahni. Covering rectlinear poly- vex polytopes, Applicationes Mathematicae, 2002, Vol.29, No 2, pp. 199 - 218. (with Yu. Stoyan, J. Terno, M. gons by rectangles. Computer-Aided Design of Integrated Gil, G. Scheithauer) 3. Phi-function for 2D primary ob- Circuits and Systems, IEEE Transactions on. 01/05/1990; jects//Studia Informatica Universalis, 2002, Vol. 2, No 1, 9(4):377-388. pp. 1-32. (with Yu. Stoyan, J. Terno, G. Scheithauer, N. Gil) G. Scheithauer 1983 Doctor rer. nat. at Technische Address: Institute for Problems in Machinery, National Universit”at Dresden, Germany, since 1983 member of Ukrainian Academy of Sciences, 2/10 Pozharsky St., the scientific staff at the Institute for Numerical Mathe- Kharkov, 61046, Ukraine matics, Department of Mathematics, TU Dresden. Field of specialisation: Computational Geometry, Oper- Selected papers: 1. Zuschnitt- und Packungsoptimierung, ational Research, Mathematical modeling, Optimization, Vieweg + Teubner, 2008 (in German, 338 pages) 2. Go- Cutting, Packing, Covering mory Cuts from a Position-Indexed Formulation of 1D Member of ESICUP

R&I, 2009, No2 13