Efficient implementations of construction heuristics for the rectilinear block packing problem

Efficient implementations of construction heuristics for the rectilinear block packing problem

Computers & Operations Research 53 (2015) 206–222 Contents lists available at ScienceDirect Computers & Operations Research journal homepage: www.el...

1MB Sizes 0 Downloads 23 Views

Computers & Operations Research 53 (2015) 206–222

Contents lists available at ScienceDirect

Computers & Operations Research journal homepage: www.elsevier.com/locate/caor

Efficient implementations of construction heuristics for the rectilinear block packing problem Y. Hu a,n, H. Hashimoto a, S. Imahori b, M. Yagiura a a Department of Computer Science and Mathematical Informatics, Graduate School of Information Science, Nagoya University, Furocho, Chikusa, Nagoya 464-8601, Japan b Department of Computational Science and Engineering, Graduate School of Engineering, Nagoya University, Furocho, Chikusa, Nagoya 464-8603, Japan

art ic l e i nf o

a b s t r a c t

Available online 18 July 2014

The rectilinear block packing problem is a problem of packing a set of rectilinear blocks into a larger rectangular container, where a rectilinear block is a polygonal block whose interior angle is either 901 or 2701. There exist many applications of this problem, such as VLSI design, timber/glass cutting, and newspaper layout. In this paper, we design efficient implementations of two construction heuristics for rectilinear block packing. The proposed algorithms are tested on a series of instances, which are generated from nine benchmark instances. The computational results show that the proposed algorithms are especially efficient for large instances with repeated shapes. & 2014 Elsevier Ltd. All rights reserved.

Keywords: Strip packing Rectilinear blocks Construction heuristics Efficient implementation

1. Introduction The rectilinear block packing problem involves packing a set of arbitrarily shaped rectilinear blocks into a larger rectangular container without overlap so as to minimize or maximize a given objective function. A rectilinear block is a polygonal block whose interior angle is either 901 or 2701. This problem is important for many industrial applications, such as VLSI design, timber/glass cutting, and newspaper layout. It is among the classical packing problems and is known to be NP-hard [3]. The rectilinear block packing problem is a special case of the problem of packing general polygons, called the irregular packing problem or nesting problem, for which a series of approaches have been developed [1,4–6,11,14,19,26]. A special case of the rectilinear block packing problem is the rectangle packing problem. Many efficient algorithms have been proposed to solve the rectangle packing problem, including simulated annealing [10], hybrid algorithm [15], and quasi-human heuristic algorithm [29]. The bottom-left algorithm [3] and the best-fit algorithm [7] are known as the most remarkable works among existing construction heuristics. Compared with the rectangle packing problem, the rectilinear block packing problem is more complicated, and it is difficult to design efficient data structures to represent the relationships among the rectilinear blocks. Several heuristic methods have been proposed for the rectilinear block packing problem n

Corresponding author. E-mail addresses: [email protected] (Y. Hu), [email protected] (H. Hashimoto), [email protected] (S. Imahori), [email protected] (M. Yagiura). http://dx.doi.org/10.1016/j.cor.2014.06.021 0305-0548/& 2014 Elsevier Ltd. All rights reserved.

based on different data structures to represent the relationships among the blocks, e.g., BSG (bounded sliceline grid) [20,24], sequence-pairs [12,13,21,30], O-tree [25], Bn-tree [28], TCG (transitive closure graph) [22], CBL (corner block list) [23], etc. This paper proposes construction heuristics for the rectilinear block packing problem by generalizing representative construction heuristics for rectangle packing. It then shows how to reduce the time complexity of these algorithms. One of the basic ideas of our algorithms is that we regard each rectilinear block as a set of rectangles whose relative positions are fixed. This leads to efficient implementations of the construction heuristics, and it also allows us to deal with the problem having noncontinuous items, each of which consists of a set of (separate) rectilinear blocks whose relative positions are fixed. The main strategy of our algorithms is the bottom-left strategy, which derives from the bottom-left algorithm for rectangle packing [3]. In this strategy, starting from an empty layout, items are packed into the container one by one, and whenever a new item is packed into the container, it is placed at the BL position relative to the current layout. The BL position of a new item relative to the current layout is defined as the leftmost location among the lowest bottom-left stable feasible positions, where a bottom-left stable feasible position is a location where the new item can be placed without overlap and cannot be moved leftward or downward. Various algorithms are possible under the bottom-left strategy, and if we consider two standard rules for choosing the new item from the remaining items, the resulting algorithms become the bottom-left algorithm and the best-fit algorithm. We explain how we generalize these representative construction heuristics for

Y. Hu et al. / Computers & Operations Research 53 (2015) 206–222

rectangle packing to solve the rectilinear block packing problem in Section 4. Observe that, it is necessary to find a method to calculate BL positions for implementing these algorithms. We generalize the Find2D-BL algorithm [17], which was proposed to calculate the BL position of a new rectangle relative to a rectangular container and rectangles placed in the container, to the case of rectilinear blocks. We also analyze the time complexity of the bottom-left and best-fit algorithms when they are implemented based on the generalized Find2D-BL algorithm. We then design more efficient implementations of the bottomleft and best-fit algorithms for the rectilinear block packing problem in Section 5. The basic idea is to design sophisticated data structures that keep the information dynamically so that the BL position of each item can be found in sub-linear amortized time. We then analyze the time complexity of the resulting implementations of the two construction heuristics. In this paper, the methods of processing the rectilinear block packing problem with rotation is also proposed as the extension of our algorithms in Section 6. We perform a series of experiments on a set of instances that are generated from nine benchmark instances. The computational results are shown in Section 7. The computational results show that the proposed algorithms are effective for large-scale instances of the rectilinear block packing problem and are especially efficient for those instances having many repeated shapes. Even for instances with 10,000 distinct shapes, our algorithms run in about one and a half hours on a PC with a 2.3 GHz Intel Core i5 processor. For instances with more than 10,000 rectilinear blocks with up to 60 distinct shapes, the algorithms run in less than 12 s, often obtaining layouts with occupation rate higher than 90%.

2. Problem description A set of n items R ¼ fR1 ; R2 ; …; Rn g of rectilinear blocks are given, where each rectilinear block takes a deterministic shape and size from a set of t shapes T ¼ fT 1 ; T 2 ; …; T t g. Also given is a rectangular container C with fixed width W and unrestricted height H. The task is to pack all the items orthogonally without overlap into the container. We assume that the bottom left corner of the container is located at the origin O ¼ ð0; 0Þ with its four sides parallel to the x- or y-axis. The objective is to minimize height H of the container that is necessary to pack all the given items. Note that the minimization of height H is equivalent to the maximization of the occupation rate defined by ∑ni¼ 1 AðRi Þ=WH, where AðRi Þ denotes the area of a rectilinear shape Ri. This type of problem is often called the strip packing problem (e.g., the rectangular strip packing problem for the rectangular case and the irregular strip packing problem for the case of general polygons), and according to the improved typology of Wäscher et al. [27], strip packing problems are categorized into the two-dimensional open dimension problem (2D ODP) with a single variable dimension. Fig. 1 shows an example of the rectilinear block packing problem. The layout on the right is an example packing layout after packing all the rectilinear blocks into the container given on the left of the figure. The number of rectilinear blocks n is 7, and that of shapes t is 5. The task is to pack these seven items into the rectangular container so as to minimize the height of the container. We define the bounding box of an item Ri as the smallest rectangle that encloses Ri, and its width and height are denoted as wi and hi. We call the area of the bounding box, wi hi , the bounding area of Ri. The location of an item Ri is described by the coordinate ðxi ; yi Þ of its reference point, where the reference point is the bottom-left corner of its bounding box. For convenience, each rectilinear block and the container C are regarded as the set of points (including both interior and boundary points) whose

207

coordinates are determined from the origin O ¼ ð0; 0Þ. Then, a rectilinear block Ri placed at vi ¼ ðxi ; yi Þ is represented as the Minkowski sum Ri  vi ¼ fp þ vi ∣ p A Ri g. For a rectilinear block Ri, let intðRi Þ be the interior of Ri. Then the rectilinear block packing problem is formally described as follows: minimize

H

subject to

0 r xi r W  wi ; 0 r yi r H  hi ;

1 r i rn

ð1Þ

1 r i rn

intðRi  vi Þ \ ðRj  vj Þ ¼ ∅;

ð2Þ ia j:

ð3Þ

The constraints (1) and (2) require that all rectilinear blocks be packed inside the container. The constraint (3) ensures that there exists no item overlapping with others. Two cases of this problem are often considered in the literature: (1) all the items are not allowed to be rotated and (2) all the items can be rotated 901, 1801 or 2701. However, the case without rotations is assumed in this paper unless otherwise stated, because it is easy to apply the results in this paper to the case with rotations as discussed in Section 6.

3. Basic knowledge In this section, we explain some important techniques and definitions used in our algorithms. As a crucial technique for the packing problem, the concept of no-fit polygon is explained in Section 3.1. The definition of BL positions in general and the Find2D-BL algorithm [17] to calculate the BL positions for rectangles are introduced in Sections 3.2 and 3.3. Two construction heuristics for the rectangle packing problem are then introduced in Sections 3.4 and 3.5. We first explain the bottom-left algorithm, which is one of the simplest forms among the algorithms based on the bottom-left strategy. Then we explain the best-fit algorithm, which is slightly more complicated than the bottom-left algorithm but it is known to be more effective. 3.1. No-fit polygon The no-fit polygon (NFP) is a geometric technique to check overlaps of two polygons in a two-dimensional space. This concept was introduced by Art [2] in 1960s, who used the term “shape envelope” to describe the positions where two polygons can be placed without intersection. It is defined for an ordered pair of two polygons Pi and Pj, where the position of polygon Pi is fixed and polygon Pj can be moved. The NFP of Pj relative to Pi, NFPðP i ; P j Þ denotes the set of positions of polygon Pj having an intersection with polygon Pi, which is formally defined as follows: NFPðP i ; P j Þ ¼ intðP i Þ  ð  intðP j ÞÞ ¼ fu  w ∣ u A intðP i Þ; w A intðP j Þg:

ð4Þ

NFPðP i ; P j Þ is illustrated through the example in Fig. 2. When the two polygons are clear from the context, we may simply use NFP instead of NFPðP i ; P j Þ. Assume that ∂NFPðP i ; P j Þ denotes the boundary of NFPðP i ; P j Þ, and clðNFPðP i ; P j ÞÞ denotes the closure of NFPðP i ; P j Þ. The no-fit polygon has the following important properties, where vi and vj are the positions of Pi and Pj:

 P j  vj overlaps with P i  vi if and only if vj A NFPðP i ; P j Þ  vi .  P j  vj touches P i  vi if and only if vj A ∂NFPðP i ; P j Þ  vi .  P i  vi and P j  vj are separated if and only if vj 2 = clðNFPðP i ; P j ÞÞ  vi .

208

Y. Hu et al. / Computers & Operations Research 53 (2015) 206–222

Fig. 1. An instance of the rectilinear block packing problem and a solution.

Fig. 2. An example of NFPðP i ; P j Þ.

Hence, the problem of checking whether two polygons overlap or not becomes an easier problem of checking whether a point is in a polygon or not. When Pi and Pj are both convex, ∂NFPðP i ; P j Þ can be computed by the following simple procedure: slide Pj around Pi having it keep touching with Pi. Then the trace of the reference point of Pj is ∂NFPðP i ; P j Þ. 3.2. Bottom-left stable feasible positions Bottom-left stable feasible positions are defined for a given area, a set of rectilinear blocks placed in the area, and one new item to be placed there. In this paper, we assume that the shape of the given area is rectangular. A bottom-left stable feasible position (BL stable feasible positions) is a location in the area where the new item can be placed without overlap with already placed rectilinear blocks and the new item cannot be moved leftward or downward. “Bottom-left stable” means that the new item cannot move to the bottom or to the left, and “feasible” means that the new item will not overlap with other blocks when it is placed. Note that there are many bottom-left stable feasible positions in general. The bottom-left position (BL position) is defined as the leftmost location among the lowest bottom-left stable feasible positions. The bottom-left stable feasible positions and the BL position are illustrated through an example in Fig. 3.

Fig. 3. Bottom-left stable feasible positions and the BL position.

rectangle to be placed relative to a rectangular container and to rectangles already placed in the container. The main idea of the Find2D-BL algorithm is to find bottom-left stable feasible positions by using the technique of NFP and a sweep-line method. The sweep line is a line parallel to the x-axis, which moves upward from the bottom of the container. The Find2D-BL algorithm first calculates the NFPs of the new rectangle relative to the rectangles in the container, and it places the NFPs at the positions where the corresponding rectangles are placed. Then, the BL position is the leftmost point in the container among the lowest positions whose overlap number is zero, where the overlap number of a point v ¼ ðx; yÞ, denoted by π ðx; yÞ, is the number of NFPs that contain v. Their algorithm keeps the overlap number of arbitrary points on the sweep line in a binary tree data structure. With the sweep line moving upward from the bottom, the bottom-left position appears as the leftmost point among the initially emerging points on the sweep line whose overlap number is 0. Assuming that the number of NFPs is δ, the computation time of the Find2D-BL algorithm to find the BL position is Oðδ log δÞ. Note that in the case of rectangle packing, the shape of every NFP is rectangle, and the number of NFPs is the same as the number of rectangles in the container.

3.3. Find2D-BL algorithm 3.4. Bottom-left algorithm for the rectangle packing problem Our algorithms are based on an algorithm called the Find2D-BL, which was proposed by Imahori et al. [17]. The Find2D-BL algorithm was proposed to calculate the BL position for a new

The bottom-left algorithm for the rectangle packing problem was proposed by Baker et al. [3]. They used a bottom-left rule that

Y. Hu et al. / Computers & Operations Research 53 (2015) 206–222

places each item at the BL position. The basic idea of the bottomleft algorithm can be generally explained as follows: given a set of rectangles and a sequence of these rectangles, the algorithm packs all the rectangles one by one in the order of the given sequence at their BL positions relative to the current layout. 3 There are natural algorithms that require Oðδ Þ time in the worst case for this strategy, where δ is the number of given rectangles. Hopper and Turton implemented one of them in their article [16]. Chazelle [8] devised an efficient algorithm that 2 requires Oðδ Þ time and OðδÞ space in the worst case. 3.5. Best-fit algorithm for the rectangle packing problem The best-fit heuristic algorithm for the rectangle packing problem was proposed by Burke et al. [7], and it has been widely known with its simplicity and good performance. Imahori and Yagiura [18] proposed an efficient implementation of the best-fit algorithm that requires linear space and Oðδ log δÞ time, where δ is the number of rectangles. The best-fit heuristic algorithm is a greedy algorithm that attempts to produce a good-quality placement by examining an available space as low as possible in the strip and then placing the rectangle that best fits the space. Unlike most heuristic algorithms that have a sequence of rectangles to place, the best-fit heuristic dynamically selects the next rectangle to place. This enables the algorithm to make informed decisions about which rectangle should be placed next. The details of the best-fit algorithm are exhibited in Appendix A.

4. Heuristic algorithms for the rectilinear block packing problem In this section, we explain the bottom-left and best-fit algorithms for the rectilinear block packing problem, which are generalized from the algorithms for rectangle packing. A crucial problem in generalizing these algorithms is how to find the bottom-left position of a new rectilinear block. We first introduce a method to calculate NFPs for rectilinear blocks in Section 4.1. Then in Section 4.2, we explain an algorithm that we call Find2D-BL-R, which is generalized from the Find2D-BL algorithm to find the BL position of a rectilinear block. Finally, we explain how to generalize the bottom-left and best-fit algorithms to solve the rectilinear block packing problem in Sections 4.3 and 4.4, respectively, and we also analyze their time complexities (see also Appendix B for their time complexities when naively implemented). 4.1. Method of calculating NFPs for rectilinear blocks In our algorithms, we assume that each rectilinear block is represented with a set of rectangles whose relative positions are fixed, and let mi be the number of rectangles that represents a rectilinear block Ri. We also assume that each such rectangle has a positive area, i.e., special cases of rectangles such as line segments ~i and points are not considered. Note that a rectilinear block with m concave vertices (i.e., vertices whose angle outside of the block is ~ i þ 1 rectangular pieces by horizontal 901) can be cut into at most m lines that go through its concave vertices. Hence, a rectilinear ~ i concave vertices can be represented by at most block with m ~ i þ 1 rectangles, i.e., mi r m ~ i þ 1. It is also noted that there is no m restriction on the way the relative positions are fixed, e.g., an item Ri can be a set of two separate rectangles as long as their relative positions are fixed. Hence, our algorithms can also deal with the packing problem in which each item can be a set of (separate) rectilinear blocks whose relative positions are fixed.

209

When we are given two rectangles B and B0 , where rectangle B 0 (resp., B0 ) has width w (resp., w0 ) and height h (resp., h ), NFPðB; B0 Þ can be computed by the following expression: 0

NFPðB; B0 Þ ¼ fðx; yÞ ∣ w0 o x o w;  h o y ohg:

ð5Þ

Note that NFPðB; B0 Þ is a rectangle, and it can be computed in Oð1Þ time. We then consider the case when two rectilinear blocks Ri and Rj are given. Let Bi ¼ fBi1 ; Bi2 ; …; Bi;mi g be the set of rectangles that represents Ri, and vik be the position of Bik relative to the reference point of Ri for k ¼ 1; 2; …; mi , i.e., mi

Ri ¼ ⋃ ðBik  vik Þ:

ð6Þ

k¼1

The set Bj is defined similarly. The NFPðRi ; Rj Þ is the union of NFPðBik ; Bjl Þ for all pairs of Bik and Bjl. That is, NFPðRi ; Rj Þ can be formally calculated as follows: mi

mj

NFPðRi ; Rj Þ ¼ ⋃ ⋃ ðNFPðBik ; Bjl Þ  vik  ð  vjl ÞÞ:

ð7Þ

k¼1l¼1

For each rectangle Bjl, we can easily calculate its NFP with respect to Bik by using (5). Hence NFPðRi ; Rj Þ consists of mi mj rectangles, and it can be computed in Oðmi mj Þ time. For convenience, we call such rectangles NFP rectangles. For the case of rectilinear block packing, we define the overlap number π ðx; yÞ of a point ðx; yÞ to be the number of NFP rectangles ~ D R of placed items and a rectilinear containing it, i.e., for a set R ~ is placed at vi, the block Rj to be placed, where each item Ri A R overlap number π ðx; yÞ is formally described as follows:

π ðx; yÞ ¼ jfði; k; lÞ ∣ ðx; yÞ A ðNFPðBik ; Bjl Þ  vi  vik  ð  vjl ÞÞ; ~ Bik A Bi ; Bjl A Bj gj: Ri A R;

ð8Þ

Then from (7), Rj can be placed at a point ðx; yÞ without overlap ~ if and only if π ðx; yÞ ¼ 0. with any item in R 4.2. Method to calculate BL position for rectilinear block In this section, we explain the Find2D-BL-R algorithm, which is generalized from the Find2D-BL algorithm, to find the BL position for a rectilinear block. First we calculate NFPs of the new rectilinear block relative to all the items in the container and then place each of them at the position where the corresponding item is placed. Next, all we have to do to compute the BL position is to find the leftmost point in the container among the lowest positions whose overlap number is zero. For this purpose, we can use the core part of the Find2D-BL algorithm, because the NFPs of the new rectilinear block to be placed relative to items in the container consist of rectangles. Thus we can generalize the Find2D-BL algorithm to the case of rectilinear blocks. As explained in Section 3.3, the Find2D-BL algorithm finds the BL position in Oðδ log δÞ time, where δ is the number of placed NFPs, each consisting of one rectangle. The Find2D-BL-R algorithm computes the BL position of a rectilinear block Rj in Oðmj M log ðmj MÞÞ ¼ Oðmj M log MÞ time, where M ¼ ∑ni¼ 1 mi , because the number of rectangles that constitute the placed NFPs is the sum of mi mj for all items Ri in the container, which is not more than mj M. 4.3. Bottom-left algorithm for the rectilinear block packing problem In this section, we explain the bottom-left algorithm for the rectilinear block packing problem. The bottom-left algorithm can be generally explained as follows: given a set of n rectilinear blocks R ¼ fR1 ; R2 ; …; Rn g and an order of items (e.g., decreasing order of area), the algorithm

210

Y. Hu et al. / Computers & Operations Research 53 (2015) 206–222

packs all the items one by one according to the given order, where each item is placed at its BL position relative to the current layout (i.e., the layout at the time just before it is placed). Assume for simplicity that fR1 ; R2 ; …; Rn g are packed according to the increasing order of their indices. The bottom-left algorithm, in which Find2D-BL-R is utilized to find BL positions, is formally described in Algorithm 1. Algorithm 1. Bottom-Left_Find2D-BL-R. 1: Set j≔0. 2: Set j≔j þ 1. If j 4 n, stop. 3: By using the Find2D-BL-R algorithm, find the BL position ðx; yÞ of Rj. 4: Pack Rj at ðx; yÞ, and then return to Step 2.

Recall that the number of rectangles that represents a rectilinear block Ri is denoted by mi, and M denotes the sum of mi over all the n rectilinear blocks. As explained in Section 4.2, by using the Find2D-BL-R algorithm, calculating the bottom-left position of a new rectilinear block Rj in Step 3 can be done in Oðmj M log MÞ time. The computation of other steps is less expensive than this. The bottom-left algorithm therefore runs in ∑nj¼ 1 Oðmj M log MÞ ¼ OðM 2 log MÞ time. 4.4. Best-fit algorithm for the rectilinear block packing problem In this section, we explain the best-fit algorithm for the rectilinear block packing problem. Because it seems not possible to directly generalize the original idea of the best-fit algorithm for rectangle packing to the case of rectilinear blocks, we give in Appendix A an interpretation of the best-fit algorithm. We generalize this form of the best-fit algorithm to the case of the rectilinear block packing problem. The best-fit algorithm for the rectilinear block packing problem is explained as follows: Given a set of n rectilinear blocks R ¼ fR1 ; R2 ; …; Rn g and a priority among them (e.g., an item with a wider bounding box has higher priority), the algorithm packs all the items one by one into the container, where each item is placed at its BL position relative to the current layout. At the beginning of the packing process, no item is placed in the container. Whenever an item is to be packed into the container, the algorithm calculates the BL positions of all the remaining items relative to the current layout. In this iteration, the rectilinear block whose BL position takes the smallest x-coordinate among those with the lowest ycoordinate is packed. If there exist ties, the block with the highest priority is chosen. In the above algorithm, “priority” generalizes the idea of choosing wider rectangles in the best-fit algorithm for rectangles. That is, when the given items are all rectangles and the priority is defined such that wider items have higher priority (resolving equal widths by the largest height), the above algorithm becomes the same as the best-fit algorithm for rectangles. For rectangle packing, choosing the widest rectangle corresponds to utilizing the lowest available segment most. For rectilinear blocks, however, such an interpretation seems impossible, and various rules for the priority can be considered. In the computational experiments in Section 7, we test some basic rules for deciding the priority. The best-fit algorithm for the rectilinear block packing problem can be implemented by using the Find2D-BL-R algorithm as follows. In each iteration, after a rectilinear block is packed into the container, the y-coordinate of its reference point is recorded as currentBottom. Note that there are no rectilinear blocks that can be placed below the line whose y-coordinate is currentBottom. We can therefore discard the space below the line y¼ currentBottom

from the candidates for the BL position. For this reason, the Find2D-BL-R algorithm can set the initial position of the sweep line to y¼currentBottom, instead of y ¼  1 (“y ¼  1” signifies a sufficiently low position where the sweep line overlaps with no NFP). This significantly reduces the computation time in practice, although the worst-case time complexity stays the same as in the case where the sweep line always starts from y ¼  1. The best-fit algorithm is formally described in Algorithm 2. Algorithm 2. Best-Fit_Find2D-BL-R. Set R0 ≔R and currentBottom≔  1. If R0 ¼ ∅, output the current layout and stop. Set R″≔R0 , xn ≔ þ 1 and yn ≔ þ1. If R″ ¼ ∅, go to Step 8. Choose an item Rj in R″, and then let R″≔R″\fRj g. Find the BL position ðx; yÞ of Rj by using the Find2D-BL-R algorithm, in which the initial position of the sweep line is set to currentBottom. 7: If one of the following three conditions holds, then let xn ≔x, yn ≔y and jn ≔j. (i) y oyn . (ii) y ¼ yn and x o xn . (iii) y ¼ yn , x ¼ xn and Rj has higher priority than Rjn . Return to Step 4. 8: Pack the item Rjn so that its reference point is placed at 1: 2: 3: 4: 5: 6:

ðxn ; yn Þ. 9: Set R0 ≔R0 \fRjn g and currentBottom≔yn . Return to Step 2.

Recall that each rectilinear block takes a deterministic shape from the set of t shapes T ¼ fT 1 ; T 2 ; …; T t g, and when t o n, some items have an identical shape. In Step 6, if the bottom-left position of an item with the same shape as Rj has already been computed after Step 3 was executed most recently, it is not necessary to compute the bottom-left position of Rj, because it is the same as that of the item with the same shape as Rj. Hence, we can reduce the number of calls to Find2D-BL-R by not invoking it when the bottom-left position of an item with the same shape has already been computed. Accordingly, whenever the algorithm packs a new rectilinear block into the container, the Find2D-BL-R algorithm is called at most once for each shape. As explained in Section 4.2, by using the Find2D-BL-R algorithm, calculating the bottom-left position of a rectilinear block Rj in Step 6 can be done in Oðmj M log MÞ time, and in repeating the loop from Steps 4 to 7 until it exits to Step 8, the computation of BL positions is executed at most once for every shape in T . The computation time of this loop is therefore OðmM log MÞ, where m ¼ ∑ti ¼ 1 mTi for mTi defined to be the number of rectangles that represent Ti, i.e., mTi ¼ mj for an item Rj whose size and shape is Ti. This loop is executed whenever an item is to be placed, and the number of times an item is placed is n; hence the above implementation of the best-fit algorithm runs in OðnmM log MÞ time.

5. Efficient implementations of algorithms for the rectilinear block packing problem In this section, we explain more efficient implementations of the bottom-left and best-fit algorithms than those explained in Section 4. The basic idea of the efficient implementations is introduced in Section 5.1, and the details for calculating BL positions using sophisticated data structures are explained in Section 5.2. In Section 5.3, we explain how the data structures in Section 5.2

Y. Hu et al. / Computers & Operations Research 53 (2015) 206–222

are utilized to make the bottom-left and best-fit algorithms faster and then analyze the time complexity of these algorithms. Instead of considering the constraint that requires a new rectilinear block to be placed in the container, we use a set of four sufficiently large virtual rectangles C ¼ fC 1 ; C 2 ; C 3 ; C 4 g called container rectangles that satisfy the following condition: recti~ [ C if and linear block Ri does not have overlap with any item in R only if Ri is placed in the container without overlap with any item ~ where R ~ is the set of items in the container. See Fig. 4 for an in R, example of container rectangles, where the value of H 0 is þ 1. We ^ ¼R ~ [ C; then jRj ^ ¼ jRj ~ þ 4 holds. denote R 5.1. Basic idea and outline of efficient implementations In this section, we explain the basic idea to compute BL positions efficiently for construction heuristics that are based on the bottom-left strategy. Recall that when the Find2D-BL-R algorithm computes the BL position of an item Rj, it uses the NFPs of Rj relative to the items in the container, and such NFPs are placed at the positions where the corresponding items are placed. We call such a layout of NFPs an NFP layout for Rj. If the shapes of two items Ri and Rj are the same, their NFP layouts are the same; thus it suffices to have t ¼ jT j NFP layouts, each for a distinct shape in T , to compute the BL positions of all remaining items. The basic idea is to dynamically keep the NFP layouts with respect to the current packing layout for all shapes in T during the packing process. In other words, we do not compute NFP layouts from scratch in each iteration of the construction heuristics. Because the algorithm needs to keep t NFP layouts (and related data structures for each NFP layout), OðtÞ times more memory space is necessary compared to the implementations in Sections 4.3 and 4.4 in which the Find2D-BL-R algorithm is invoked whenever needed. A common feature of construction heuristics is that once an item is packed into the container, its position is fixed and will not change. This means that for each shape Tj, after packing an item Ri into the container, the NFPs in the container do not change, and we can obtain the new NFP layout for Tj simply by inserting NFPðRi ; T j Þ. Thus, for each shape, we dynamically modify the NFP layout with respect to the current packing layout during the packing process. Whenever an item Ri is placed into the container, the algorithm computes the BL position of every shape Tj by using the NFP layout for Tj and a sweep line parallel to the x-axis, which moves upward and keeps the overlap number π ðx; yÞ of every point ðx; yÞ on the sweep line. As discussed in Section 3.3, the BL position is found when a point ðx; yÞ with π ðx; yÞ ¼ 0 is found on the sweep line for the first time. Note that the y-coordinate of the BL position of shape Tj does not decrease when item Ri is placed. Hence the BL

Fig. 4. (a) The given area (container) and (b) container rectangles to represent the area.

211

position of Tj does not appear below the sweep line at the position where it stopped when the last BL position was found before the item Ri was placed. In other words, the sweep line can start the search for the BL position from the last height ylast when the last BL position was found before Ri was packed into the container. This means that for each shape Tj, the sweep line moves from bottom to top only once (except for the computation necessary to update the overlap numbers π ðx; ylast Þ on the sweep line at the last height after NFPðRi ; T j Þ is placed) during the entire process of a construction heuristic. We design sophisticated data structures to dynamically keep the information we need to maintain the overlap numbers of all points on the sweep line. When the sweep line moves from bottom to top, the overlap numbers on the sweep line change only at the positions where the sweep line meets the bottom or top edge of an NFP rectangle. Such a position (or the occasion when the sweep line meets such a position) is called an event. For each shape Tj, we maintain a heap HEAP j for events of the sweep line and a balanced search tree TREEj to keep the information of overlap numbers on the sweep line. For the balanced search tree, we use a 2–3 tree data structure to implement our algorithm. For every iteration, after an item Ri is placed, the NFP of shape Tj relative to Ri, which consists of mi mTj NFP rectangles, is added to the NFP layout of Tj for each j ¼ 1; …; t. In the following sections, we show that TREEj and HEAP j can be updated in Oðlog MÞ time for each j whenever an NFP rectangle is added to the NFP layout of Tj. This implies that after an item Ri is placed, the computation time to update the balanced search trees and heaps for all shapes is ∑tj ¼ 1 Oðmi mTj log MÞ ¼ Oðmi m log MÞ, where m is the sum of mTj for all the shapes in T and M is the sum of mi for all rectilinear blocks in R. We also show that by using TREEj , it is possible in Oðlog MÞ time to judge whether the BL position exists on the current sweep line, and to output such a position if it does exist, whenever the sweep line moves from one event point to another. The number of such events taken from HEAP j is shown to be Oð∑ni¼ 1 mi mTj Þ ¼ OðmTj MÞ for each shape Tj during the entire computation of a construction heuristic, where mTj M is the total number of NFP rectangles in the NFP layout of Tj when the construction algorithm terminates. This implies that the total computation time to search for BL positions is OðmTj M log MÞ for each shape Tj during the entire execution of the construction heuristic. Because for construction heuristics considered in this paper, it suffices to update these data structures for all items Ri in R and to compute BL positions for all shapes Tj in T , the total computation time to maintain these data structures is Oð∑ni¼ 1 mi m log M þ ∑tj ¼ 1 mTj M log MÞ ¼ OðmM log MÞ during the entire computation of the construction heuristics. 5.2. Method of calculating BL positions In this section, we explain the details of the efficient method to calculate the BL position of a rectilinear block. In Section 5.2.1, we first give a technique to compute the overlap number for each point on the sweep line by using a 2–3 tree. The algorithm of calculating a BL position is explained in Section 5.2.2. 5.2.1. Compute overlap numbers by a 2–3 tree We use a 2–3 tree to keep the overlap number on the sweep line. Given a rectilinear shape Tj, to compute the overlap numbers of no-fit polygons of Tj relative to the current layout, the algorithm first computes no-fit polygons NFPðR; T j Þ of Tj relative to the placed ^ including container rectangles and then places each of items R A R them at the position where the corresponding item is placed. ^ is the set of placed items in the container and (Recall that R container rectangles.) Note that the algorithm actually places the NFP rectangles rather than the NFPs of rectilinear shapes. Let N t (resp., N b ) be the set of all the top (resp., bottom) edges of NFP

212

Y. Hu et al. / Computers & Operations Research 53 (2015) 206–222

Fig. 5. An example of CrossPoints of the new rectilinear block.

^ rectangles that constitute the NFPs of Tj relative to the items in R, and let N tb ¼ N t [ Nb . The overlap numbers on the sweep line will change only when the sweep line encounters a member in N tb , and changes occur only in the interval between the left edge and the right edge of the no-fit polygon encountered by the sweep line. Let N l (resp., N r ) be the set of all the left (resp., right) edges of NFP rectangles that constitute the NFPs of Tj relative to the items ^ and let N lr ¼ Nl [ Nr . Note that the no-fit polygon of Tj in R, relative to the container C can be simply calculated by treating item Tj as a rectangle whose height and width are the same as its bounding box. Hence, for each i ¼ 1; …; 4, we use the NFP of the bounding box of Tj relative to container rectangle Ci instead of NFPðC i ; T j Þ. However, we may not clearly mention this point and assume for simplicity that the four no-fit polygons of Tj relative to the container rectangles consist of four rectangles throughout the ~ is the set of items placed in remainder of this paper. Recall that R T ~ ~ ¼∑ the container, and let M ~ mi . Then there are mj M NFP Ri A R rectangles that constitute the NFPs of Tj relative to the items ~ þ 4 and jN tb j ¼ jNlr j ¼ ~ Hence, jNt j ¼ jN b j ¼ jNl j ¼ jN r j ¼ mT M in R. j T ~ 2mj M þ8 hold. The elements in N lr are sorted in nondecreasing order of their x-coordinates, where ties are broken by treating the elements in N r as having higher priority. This tie-breaking rule is important, because if two no-fit polygons have their left and right boundaries at the same x-coordinate, the intersection point of the boundaries of the two no-fit polygons might be a feasible point where the shape Tj can be placed without overlap. Let xðkÞ be the lr x-coordinate of the kth element in the sorted list of Nlr , and define intervals þ 1Þ ~ þ7 Sk ¼ ½xðkÞ ; xðk ; k ¼ 1; 2; …; 2mTj M lr lr

on the sweep line. The left boundary of S1 (resp., the right boundary of S2mT M~ þ 7 ) corresponds to the left (resp., right) edge j of the container rectangle whose right (resp., left) edge represents the left (resp., right) boundary of the container. The algorithm maintains the overlap number for each interval Sk during the process, where the overlap number π ðx; yÞ of a point ðx; yÞ is the number of NFP rectangles containing ðx; yÞ that constitute the NFPs ^ Initially, the sweep line is at a of Tj relative to the items in R. sufficiently low position, and it overlaps with no NFP. At this moment, the overlap number of every interval Sk is zero. We now consider the moment when the sweep line encounters a member in N tb . Let B be the NFP rectangle whose top or bottom edge is encountered by the sweep line, and assume that the left (resp., right) edge of B is the lth (resp., ðr þ1Þst) element in the sorted list of N lr . In this situation, the overlap numbers for intervals Sl ; Sl þ 1 ; …; Sr are changed. To be more precise, we should increase (resp., decrease) their overlap numbers by one if the

encountered edge is a member in N b (resp., N t ). We use a 2–3 tree whose leaves represent intervals S1 ; S2 ; …; S2mT M~ þ 7 , where the kth j leaf (called leaf k for simplicity) from the left corresponds to the interval Sk. Note that the height of the 2–3 tree is ~ ¼ Oðlog MÞ. Every node of this tree stores values Oðlog ðmTj MÞÞ pvalue , pmin , and pcross , whose role will be explained later. For two nodes u and v of the tree, let PATHðu; vÞ be the set of nodes in the path from u to v including u and v themselves. Let gðkÞ be the overlap number for interval Sk of the sweep line. To be more precise, gðkÞ is the overlap number of all points in Sk except the left (resp., right) boundary of Sk if it corresponds to the left (resp., right) edge of an NFP rectangle. This means that the overlap number of the left (resp., right) edge of an NFP rectangle is stored in an interval Sk whose right (resp., left) boundary is that edge. Thus we need to treat the boundaries carefully considering that each NFP is an open set. When the value of y is fixed to the height of the current sweep line, the function π ðx; yÞ is a lower semicontinuous piecewise linear function consisting of horizontal line ~ þ 7Þ aligned in this segments with heights gð1Þ; gð2Þ; …; gð2mTj M order from left to right. The algorithm maintains the values of pvalue for all nodes of the tree so that ∑

pvalue ðuÞ ¼ gðkÞ

ð9Þ

u A PATHðk;rootÞ

is satisfied for each leaf k, where root is the root node of the 2–3 tree. Then it is possible to compute the overlap number of an interval in Oðlog MÞ time by using the values of pvalue in the path from the corresponding leaf to the root node. We define a CrossPoint as follows: if an NFP rectangle's right edge crosses another's top edge, we call the crossing point a CrossPoint. Fig. 5 shows an example of the CrossPoints. Observe that a bottom-left stable feasible position will only appear at non-overlapping CrossPoints, and the BL position is also among them. To find such a CrossPoint efficiently, we prepare for each leaf k, a Boolean value pcross ðkÞ that takes value 1 if the left boundary of interval Sk is the right edge of an NFP rectangle whose interior intersects with the sweep line and 0 otherwise, and then we define the value of pmin for each node v of the 2–3 tree as follows: pmin ðvÞ ¼ min



pvalue ðuÞ;

k A Q ðvÞu A PATHðk;vÞ

ð10Þ

where Q ðvÞ is the set of all leaf nodes k such that pcross ðkÞ ¼ 1 in the subtree rooted at the node v. For convenience, we assume pmin ðvÞ ¼ þ 1 if Q ðvÞ ¼ ∅. Note that pmin ðvÞ ¼ þ 1 indicates that there exists no leaf node whose left boundary corresponds to the right edge of an NFP rectangle with its interior intersecting with the sweep line among all leaf nodes in the subtree rooted at the node v. The value of pmin ðvÞ is used to compute the minimum overlap number of intervals Sk corresponding to leaves k in Q ðvÞ, which can be computed by pmin ðvÞ  pvalue ðvÞ þ



pvalue ðuÞ:

ð11Þ

u A PATHðv;rootÞ

Because the BL position will only appear at a CrossPoint, we can ignore the leaves not in Q ðvÞ. By using the value of pmin ðvÞ and the values of pvalue ðuÞ for nodes u in the path from the parent node of v to the root node as shown in (11), it is possible to check whether there exists a leaf node in Q ðvÞ whose overlap number is equal to zero. Let a, b and c be the children of a node v. (Note that for a 2–3 tree, there are either two or three children for every node except the leaves. For simplicity, we assume that if the node v has just two children, the value of pmin ðcÞ ¼ þ1, which makes the node c having no effect on the final result.) Assume that the values of pmin ðaÞ, pmin ðbÞ and pmin ðcÞ are known. Then the value of pmin ðvÞ

Y. Hu et al. / Computers & Operations Research 53 (2015) 206–222

can be computed in constant time by pmin ðvÞ ¼ pvalue ðvÞ þminfpmin ðaÞ; pmin ðbÞ; pmin ðcÞg:

ð12Þ

We now explain the algorithm to keep the values of pvalue , pmin and pcross appropriately, assuming that their values were correct before the sweep line encountered an edge. Consider the moment when the sweep line encounters a member in Ntb . Let B be the NFP rectangle whose top or bottom edge is encountered by the sweep line, and assume that the left (resp., right) edge of B is the lth (resp., ðr þ 1Þst) element in the sorted list of Nlr . The algorithm first finds the leaf r þ 1 that corresponds to the ðr þ 1Þst interval. It then updates the value of pcross ðr þ1Þ to one (resp., zero) and the value of pmin ðr þ 1Þ to pvalue ðr þ 1Þ (resp., þ 1) if the bottom (resp,. top) edge of B is encountered, and it further modifies the values of pmin of all nodes on the path from r þ 1 to the root by (12). The details of this procedure are formally described as algorithm UpdateCrossðB; r 0 ; λÞ in Algorithm 3, where this procedure is invoked be setting r 0 ≔r þ 1 and λ≔1 (resp.,  1) if the edge encountered by the sweep line is the bottom (resp., top) edge of B. Algorithm 3. UpdateCrossðB; r 0 ; λÞ. 1: Set pcross ðr 0 Þ≔1 and pmin ðr 0 Þ≔pvalue ðr 0 Þ if λ ¼ 1; otherwise (i.e., λ ¼  1), set pcross ðr 0 Þ≔0 and pmin ðr 0 Þ≔ þ 1. 2: Modify the values of pmin of all nodes on the path from r 0 to the root by (12).

Then, the algorithm finds the leaves l and r that correspond to the lth and rth intervals. Here we assume for simplicity that the edge encountered by the sweep line is the bottom edge of the B. The case when the top edge is encountered is similar; instead of increasing the values by one, the algorithm decreases the values by one. The algorithm increases the values of pvalue and pmin of the leaf nodes l and r by one. It then traverses nodes in the paths from the leaf nodes l and r to their least common ancestor v. During this traversal, whenever a node in the path from l (resp., r) to v is reached from its left (resp., right) or middle child, the algorithm increases the values of pvalue and pmin of all its right (resp., left) siblings by one. It also updates pmin for nodes in the paths from l and r to v so that the condition (10) is satisfied (by using (12)). Finally, the algorithm updates the values of pmin for all nodes in the path from v to the root node of the tree. The details of this procedure are summarized as algorithm UpdateValueðB; l; r; λÞ in Algorithm 4, where this procedure is called by setting λ≔1 (resp., 1) if the edge encountered by the sweep line is the bottom (resp., top) edge of B. (Note that the depths of all leaves of a 2–3 tree are the same, and hence the least common ancestor of the leaves l and r can be found by going up the tree from l and r simultaneously. This feature is utilized in the description of Algorithm 4.) Algorithm 4. UpdateValueðB; l; r; λÞ. 1: Invoke UpdateCrossðB; r þ 1; λÞ. Add the value λ to pvalue ðlÞ, pmin ðlÞ, pvalue ðrÞ and pmin ðrÞ. 2: Let lprev ≔l and r prev ≔r, and then let l be the parent of l, and r be the parent of r. If l ¼r, go to Step 4. 3: If the rightmost (resp., leftmost) child of l (resp., r) is different from lprev (resp., r prev ), add the value λ to pvalue , pmin of all right (resp., left) siblings of lprev (resp., r prev ). Update the values of pmin ðlÞ and pmin ðrÞ by (12). Return to Step 2. 4: If the node l ( ¼ r) has a child u between lprev and r prev , then add λ to pvalue ðuÞ and pmin ðuÞ. Then for each node v on the path from l ( ¼ r) to the root, update the value of pmin ðvÞ by (12). Stop.

213

Algorithm UpdateValueðB; l; r; λÞ runs in Oðlog MÞ time since the ~ ¼ Oðlog MÞ. height of the 2–3 tree is Oðlog MÞ 5.2.2. Calculate BL positions by a 2–3 tree In this section, we propose an algorithm called FindBL to find the BL position of a shape Tj with respect to the layout of items in R^ by using the 2–3 tree. As explained before, the BL position only appears at non-overlapping CrossPoints, where one NFP rectangle's right edge crosses another's top edge. Hence, when the sweep line encounters the top edge of an NFP rectangle, the UpdateValue algorithm modifies the overlap number, and the BL position may appear at this moment. To manage these events, the elements in N tb are stored in HEAP j according to the non-decreasing order of their ycoordinates, where an element with smaller y-coordinate comes to the top of the heap, and ties are broken by putting more priority to elements in Nt . If the top edges of some NFP rectangles have the same y-coordinate, we put more priority to those elements that correspond to NFP rectangles whose left edge has a smaller x-coordinate. A CrossPoint ðx; yÞ whose overlap number π ðx; yÞ equals zero is a bottom-left stable feasible position of shape Tj relative to the ^ With the sweep line moving from bottom to current layout of R. top, the algorithm checks whether there exists such a point among all the CrossPoints on the sweep line whenever the sweep line encounters the top edge of an NFP rectangle. If there are more than one such point on the sweep line, the algorithm finds the leftmost one. The BL position is the first such point that the algorithm finds. Our algorithm to calculate the BL position can deal with the situation where the sweep line does not start from the bottom of the container. This feature is very important because the running time will be significantly reduced if we know a height yinit such that the BL position will not appear below the line y ¼ yinit which is higher than the bottom of the container. Assume that we are given a 2–3 tree TREEj and a heap HEAP j that satisfy the following conditions. C1. For the edge e in N t with the highest priority (with respect to the ordering rule of elements in N tb ) among those in HEAP j , HEAP j contains all the elements in N tb whose priority is lower than the edge e. (Note that e is not necessarily at the top of HEAP j . If we keep deleting the element at the top of the heap, e is encountered first among the elements in N t .) C2. The data structures HEAP j and TREEj are initialized so that when the FindBL algorithm is executed until the edge e in condition C1 is deleted from HEAP j , the values on the nodes of the 2–3 tree TREEj keep the information of overlap numbers of the sweep line at the height of the edge e. To be more precise, at the time e is deleted from HEAP j , TREEj keeps the information of overlap numbers at the moment when the sweep line has passed all the edges in N tb whose priorities are higher than the edge at the top of HEAP j after the edge e is deleted. Here we define the BL order ‘⪯BL ’ between points in the plane by ðx; yÞ⪯BL ðx0 ; y0 Þ ⟺ (1) y oy0 or (2) y ¼ y0 and x r x0 . Let ðxinit ; yinit Þ be the left endpoint of the edge e in condition C1. If the conditions C1 and C2 are satisfied, the FindBL algorithm outputs the smallest point with respect to ⪯BL among the bottom-left stable feasible positions ðx; yÞ that satisfies ðxinit ; yinit Þ⪯BL ðx; yÞ and ðx; yÞ a ðxinit ; yinit Þ. Hence, if the following condition C3 is also satisfied, the FindBL algorithm outputs the BL position. C3. The BL position does not exist below the line y ¼ yinit or on the half line y ¼ yinit with x r xinit , i.e., π ðx; yÞ 4 0 holds for every point ðx; yÞ⪯BL ðxinit ; yinit Þ.

214

Y. Hu et al. / Computers & Operations Research 53 (2015) 206–222

The FindBL algorithm first takes an element e at the top of ^ be the NFP HEAP j and removes it from the heap. Let B A R rectangle having the element e as its top or bottom edge, and assume that its left (resp., right) edge is the left boundary of the lth (resp., the right boundary of rth) leaf of TREEj . Then the algorithm updates the overlap numbers of intervals Sl ; Sl þ 1 ; …; Sr by invoking the UpdateValue procedure. If e is a bottom edge, the algorithm proceeds to the next element at the top of the heap. Otherwise, it goes up the tree from the leaf l until it finds a right sibling u that satisfies pmin ðuÞ  pvalue ðuÞ þ



pvalue ðvÞ ¼ 0;

ð13Þ

v A PATHðu; rootÞ

i.e., the subtree rooted at u has a leaf k with pcross ðkÞ ¼ 1 and the overlap number gðkÞ ¼ 0. If the root is reached without finding such a sibling u, which implies that the current top edge e does not include a CrossPoint whose overlap number is zero, the algorithm proceeds to the next element at the top of HEAP j . Otherwise, the algorithm chooses the leftmost sibling u that satisfies (13) among those to the right of the current node and then goes down the tree from u by choosing at each node the leftmost child that satisfies (13). If k 4 r holds for the leaf k reached by the above procedure, which implies that the left boundary of interval Sk does not cross the edge e, the algorithm proceeds to the next element at the top of HEAP j . Otherwise, the algorithm outputs the bottom-left stable feasible point ðx; yÞ, where x is the left boundary of Sk and y is the height of the current sweep line (i.e., the height of e). After the FindBL algorithm outputs the point ðx; yÞ, it inserts the top and bottom edges of the NFP rectangle B into HEAP j before it stops. This is necessary for the next call to FindBL; the BL point may remain the same even after some NFP rectangles are added into the current NFP layout, and if this is the case, the same ðx; yÞ must be output in the next call. Care should be taken when the edge e overlaps with the element e0 at the top of HEAP j after e is removed from the heap, and e0 is also a top edge. If this happens, such top edges are merged into one longer edge with their leftmost (resp., rightmost) endpoint as its left (resp., right) endpoint, and the above procedure of traversing the tree is applied to this longer edge instead of the edge e. This is to avoid finding a wrong point in such a case that is depicted in Fig. 6, where the top edges of rectangles A and B have the same y-coordinate and A leaves the sweep line earlier. The wrong point of this case is the left point at the top right corner of B. The details of our algorithm to calculate the BL stable feasible position next to ðxinit ; yinit Þ are summarized in Algorithm 5 as the algorithm FindBL. In Algorithm 5, lmin (resp., r max ) is the leaf corresponding to the left (resp., right) end of the merged edge, and pathVal keeps the sum of pvalue for all nodes in the path from the current node to the root. The input of the FindBL algorithm ~ þ 7 leaves and a heap HEAP j consists of a 2–3 tree TREEj with 2mTj M that satisfy the two conditions C1 and C2. The algorithm outputs the BL stable feasible position next to ðxinit ; yinit Þ.

Fig. 6. No-fit polygons whose top edges have the same y-coordinate.

Algorithm 5. FindBLðTREEj ; HEAP j Þ. 1: Let λprev ≔1. 2: If HEAP j is empty, output “no BL stable feasible position is found” and stop. Otherwise, let e be the element at the top ^ be the NFP rectangle having the of HEAP j . Then let B A R element e as its top or bottom edge, and assume that its left (resp., right) edge is the left boundary of the lth (resp., the right boundary of the rth) leaf of the 2–3 tree TREEj . If e is the bottom (resp., top) edge of B, set λ≔1 (resp.,  1). If (1) λprev ¼  1 and λ ¼ 1 or (2) λprev ¼  1, λ ¼  1 and r max þ 1 rl, then let α≔lmin , pathVal≔∑u A PATHðα;rootÞ pvalue ðuÞ and proceed to Step 3. If λprev ¼ 1 and λ ¼ 1, let lmin ≔l and r max ≔r. If λprev ¼  1 and λ ¼  1, let r max ≔maxfr max ; rg. Invoke UpdateValueðB; l; r; λÞ. Remove the element e from HEAP j , let λprev ≔λ, and then return to Step 2.

3: If α is the root, return to Step 1; otherwise, let αparent be the parent node of α, and let pathVal≔pathVal  pvalue ðαÞ. 4: If α is the rightmost child of αparent , set α≔αparent and then return to Step 3; otherwise, set α≔αnext where αnext is the sibling next to α on the right. If the value of pathVal þ pmin ðαÞ ¼ 0, then set γ ≔α and proceed to Step 5; otherwise return to Step 4.

5: If γ is a leaf, go to Step 6; otherwise, let γ child be the leftmost

child of γ among all children whose pmin equals 0. Let γ ≔γ child and then return to Step 5. 6: If γ Z r max þ 1, then return to Step 1. Otherwise, output ðx; yÞ, where x is the x-coordinate of the left boundary of the interval Sγ corresponding to the leaf γ and y is the y-coordinate of e. Add into HEAP j the top and bottom edges of a rectangle whose left (resp., right) edge corresponds to the left boundary of lmin (resp., the right boundary of r max ), top edge is at the height y, and bottom edge is at an arbitrary height strictly smaller than y. Then stop.

Note that while Step 5 is repeated, the value of ∑u A PATHðγ ;rootÞ pvalue ðuÞ is always zero, and it suffices to check if the value of pmin equals zero to check whether (13) is satisfied; hence it is not necessary to update pathVal once Step 5 is entered. We now consider the time complexity of the FindBL algorithm. Let K be the number of elements deleted from HEAP j during the entire execution of a call to FindBL. Each call to Step 1 takes Oð1Þ time and Step 1 is called OðKÞ times; hence the total execution ~ ¼ Oðlog MÞ time time of Step 1 is OðKÞ. In Step 2, it takes Oðlog MÞ to delete an element from the heap, to find the leaves l and r, and to execute the UpdateValue procedure. Because Step 2 is called OðKÞ times, the total execution time of this step is OðK log MÞ. In Steps 3 and 4, the algorithm first climbs the 2–3 tree from the leaf lmin , and whenever the current node α is not the rightmost child of its parent, it checks whether the subtree rooted at its right sibling αnext next to it has a leaf that contains a CrossPoint with overlap number zero. When the first node u having such a leaf is found, the algorithm sets γ ≔u. In Step 5, the algorithm goes down the tree from γ, choosing the leftmost child including such a leaf that contains a CrossPoint with overlap number zero. Thus, once Step 3 is entered, the algorithm climbs up the tree from lmin in the loop of Steps 3 and 4, and if it does not stop this traversal at the root, it goes down the tree to a leaf in Step 5. The time complexity of the loop of Steps 3 and 4, once Step 3 is entered until the loop exits to ~ ¼ Oðlog MÞ, because Oðlog MÞ ~ nodes are Step 1 or 5, is Oðlog MÞ visited during the traversal from lmin to the γ when it exits to Step 5, and it is possible for each node u to check in constant time

Y. Hu et al. / Computers & Operations Research 53 (2015) 206–222

whether the subtree rooted at the node u has a leaf node that has a CrossPoint with overlap number zero. The time complexity of a loop of Step 5 from the time it is entered until it exits to Step 6 is also Oðlog MÞ for a similar reason. The loop of Steps 3 and 4 and that of Step 5 are entered at most K times, and hence the total time complexity of Steps 3–5 is OðK log MÞ. The algorithm returns from Step 6 to 1 at most K times, and the latter part of Step 6 (i.e., after the “Otherwise”) is executed only once, which takes Oðlog MÞ time. In summary, the total running time of algorithm FindBL is OðK log MÞ. In later sections, we show that the number of edges to be added to HEAP j is OðmTj MÞ during the entire execution of the bottom-left or best-fit algorithm. During the process of these heuristics, the FindBL algorithm is called many times, but the total number of edges deleted from HEAP j (i.e., the sum of the values of K for all calls to FindBL) is bounded by the number of added edges and hence is OðmTj MÞ. This implies that the total execution time of FindBL for a shape Tj during the entire process of the bottom-left or best-fit algorithm is OðmTj M log MÞ. Note that we can easily modify the FindBL algorithm to enumerate all the bottom-left stable feasible positions for a layout of rectilinear blocks. In Step 6 of Algorithm 5, instead of inserting the top and bottom edges of the rectangle whose left (resp., right) edge corresponds to the left boundary of lmin (resp., the right boundary of r max ), we insert the top and bottom edges of a rectangle whose left (resp., right) edge corresponds to the left boundary of γ (resp., the right boundary of r max ), where γ is the leaf that contains the bottom-left stable feasible position most recently found. With this modification, the algorithm outputs the bottom-left stable feasible position next to the one most recently found, instead of reporting the same bottomleft stable feasible position again. Accordingly, all we have to do to enumerate all bottom-left stable feasible positions is to call the modified FindBL algorithm iteratively until HEAP j becomes empty. Assume that κ is the number of bottom-left stable feasible positions. Then the modified FindBL algorithm is called Oðκ Þ times, and the time complexity of enumerating all such positions of a rectilinear shape that consists of mTj rectangles for a given layout of rectilinear blocks consisting of M rectangles is OððmTj M þ κ Þ log MÞ, because HEAP j initially contains OðmTj MÞ elements and Oðκ Þ elements are added into it during the entire process of calling the modified FindBL iteratively. Since the sweep line moves from bottom to top only once for each shape Tj, the entire process will not be affected even if we delete the NFPs whose top edges are strictly lower than the current sweep line. This idea can be implemented as follows. For each Tj, we maintain a queue that stores all the top edges removed from HEAP j in Step 2 of Algorithm 5. Then, whenever Algorithm 5 terminates, for every top edge e in the queue that is strictly lower than the current sweep line, we delete from TREEj the two leaves l and r þ 1 corresponding to the intervals whose left boundaries are the left and right edges, respectively, of the NFP corresponding to e, modifying the right boundaries of l  1 and r, the leaves immediately to the left of l and r þ 1, to the right boundaries of l and r þ 1, respectively (of course information in the inner nodes above the modified leaves should be modified appropriately). Because the number of edges to be deleted from HEAP j cannot be more than those inserted to it, and it takes Oðlog MÞ time to delete or modify a leaf, the above process for a shape Tj takes OðmTj M log MÞ time during the entire packing process. This implies that this deleting process has no negative effect on the time complexity of algorithm FindBL, while it may significantly reduce the memory space in practice.

215

As explained in Section 5.1, for each shape, our algorithms need to dynamically keep NFPs relative to the current packing layout during the process. We give a function to modify the 2–3 tree and the heap when an NFP rectangle B is added into the NFP layout. The function first inserts the top and bottom edges of B into HEAP j (according to the priority among the elements in N tb explained at the beginning of Section 5.2.2). It then finds the leaf k such that the corresponding interval Sk contains the left edge l of B (according to the ordering of the elements in N lr explained in Section 5.2.1), and it divides the leaf k into two leaves k1 and k2 corresponding to intervals Sk1 and Sk2 , respectively, where the left (resp., right) boundary of Sk1 (resp., Sk2 ) is that of Sk, and the right (resp., left) boundary of Sk1 (resp., Sk2 ) is the edge l. Then, the values of pvalue , pcross and pmin of the leaf k are copied to the new leaves k1 and k2. The rebalance operator of the 2–3 tree is then invoked so that the resulting tree satisfies the conditions that must be satisfied by a 2–3 tree (see the Remark at the end of this subsection). The right edge of B is processed similarly. The procedure is summarized as function ModifyTH in Algorithm 6. Algorithm 6. ModifyTHðB; TREEj ; HEAP j Þ. 1: Let l, r, b and t be the left, right, bottom and top edge of the NFP rectangle B. 2: Insert b and t into HEAP j . Let e≔l. 3: Find the leaf k that corresponds to the interval Sk where the edge e should be inserted according to the ordering rule of elements in N lr explained in Section 5.2.1. 4: Divide the leaf k into two leaf nodes k1 and k2 corresponding to two intervals Sk1 and Sk2 . Set the left (resp., right) boundary of Sk1 (resp., Sk2 ) to that of Sk, and set the right (resp., left) boundary of Sk1 (resp., Sk2 ) to the edge e. For each i ¼1 and 2, let pvalue ðki Þ≔pvalue ðkÞ, pcross ðki Þ≔pcross ðkÞ and pmin ðki Þ≔pmin ðkÞ. 5: Rebalance the 2–3 tree. 6: If e¼r, then stop. Otherwise, let e≔r and return to Step 3.

The computation time of the function ModifyTH is ~ ¼ Oðlog MÞ, where mT M ~ is the number of NFP rectanOðlog mTj MÞ j gles in the NFP layout when the procedure ModifyTH is invoked. At the beginning of the bottom-left or best-fit algorithm, no items are placed in the container (except for the four container rectangles). Corresponding to this empty layout, for each shape Tj, we prepare a 2–3 tree TREEj with seven leaves corresponding to the intervals defined by the left and right edges of the NFPs of the bounding box of Tj relative to the container rectangles and a heap HEAP j with eight elements consisting of the bottom and the top edges of the NFPs (note that each of these NFPs is a rectangle). See Fig. 7 for an example of intervals corresponding to the empty layout. In this figure, NFP i ði ¼ 1; …; 4Þ signifies the NFP of the bounding box of Tj relative to container rectangle Ci in C. The elements in the heap are arranged according to the priority rule among the top and bottom edges explained at the beginning of Section 5.2.2, and the leaves of the tree are ordered from left to right according to the ordering rule of the left and right edges explained in Section 5.2.1. Note that at this moment, the sweep line is at a sufficiently low position whose y-coordinate is lower than the bottom edges of all container rectangles. As a result, the values of pvalue , pmin and pcross of all nodes are 0. The initialization phase is summarized as the procedure InitializeTH in Algorithm 7. Algorithm 7. InitializeTH.

5.2.3. Initialization and modification of trees and heaps In this section, we explain how we modify the data structure dynamically and then give the function to initialize the trees and heaps.

For every shape Tj (j ¼ 1; 2; …; t), do the following Steps 1 and 2. 1: Compute the NFPs of Tj relative to the four container rectangles in C.

216

Y. Hu et al. / Computers & Operations Research 53 (2015) 206–222

there is no node having four children. Note that when the root is divided into two nodes, a new root having them as its children is created. Thus, the rebalance operation is processed by moving up the tree and hence can be done in time proportional to the height ~ ¼ Oðlog MÞ. of the tree, i.e., Oðlog ðmTj MÞÞ 5.3. Efficient implementation of construction heuristics for the rectilinear block packing problem In this section, we explain efficient implementations of construction heuristics for the rectilinear block packing problem. We first explain the efficient implementations of the bottom-left and best-fit algorithms in Sections 5.3.1 and 5.3.2. We then explain their time complexity in Section 5.3.3.

Fig. 7. Intervals corresponding to the empty layout.

2: Create a heap HEAP j that consists of the top and bottom edges of the four NFPs computed in Step 1. Then create a 2–3 tree TREEj that has seven leaves corresponding to the seven intervals defined by the left and right boundaries of the four NFPs. Set the values of pvalue and pmin to zero for all nodes in the tree, and set the values of pcross to zero for all leaves of the tree. As explained before, the number of rectangles that represents a rectilinear shape Tj is denoted by mTj , and the sum of mTj over t distinct shapes is denoted by m. Because it takes OðmTj Þ time to compute the NFP of Tj relative to a container rectangle (even though such an NFP is a rectangle), Step 1 takes OðmTj Þ time for each j. The sizes of HEAP j and TREEj are Oð1Þ, and hence Step 2 takes Oð1Þ time for each j. This initialization phase therefore runs in ∑tj ¼ 1 OðmTj Þ ¼ OðmÞ time. At the beginning of the bottom-left or best-fit algorithm, the InitializeTH procedure is called, and whenever an NFP rectangle is placed, the ModifyTH procedure is executed. The FindBL algorithm is invoked whenever needed. The data structures TREEj and HEAP j are modified only by these three procedures. It is not hard to see that the conditions C1–C3 in Section 5.2.2 are satisfied after procedure InitializeTH has finished and they are satisfied whenever the ModifyTH or FindBL algorithm terminates if they are satisfied before the algorithm is invoked. These three conditions are therefore satisfied whenever FindBL begins its computation. Consequently, the FindBL algorithm correctly computes the BL position whenever it is called. Remark. A 2–3 tree must satisfy the following two conditions:

 All leaves are at the same depth.  Every inner node has two or three children. When a leaf k is divided into two leaf nodes k1 and k2, the number of children of the parent α of k is increased by one, and α may have four children. If this is the case, α is divided into two nodes α1 and α2, where α1 has the first two children of α, α2 has the latter two, and both have the same parent as α. The value of pvalue ðαÞ is copied to α1 and α2, and the values of pmin ðα1 Þ and pmin ðα2 Þ are computed by (12). If the parent of α has four children, the same operation is applied to it, and this process is repeated by going up the tree until

5.3.1. Bottom-left algorithm based on FindBL In this section, we explain an efficient implementation of the bottom-left algorithm for the rectilinear block packing problem, in which the FindBL algorithm and relevant data structures and procedures are utilized. The bottom-left algorithm can be generally explained as follows: Given a set of n rectilinear blocks R ¼ fR1 ; R2 ; …; Rn g and an order of items (e.g., decreasing order of area), the algorithm packs all the items one by one according to the given order, where each item is placed at its BL position relative to the current layout (i.e., the layout at the time just before it is placed). Assume for simplicity that fR1 ; R2 ; …; Rn g are packed according to the increasing order of their indices. The bottom-left algorithm, in which FindBL algorithm is utilized to find BL positions, is formally described as Algorithm 8. Algorithm 8. Bottom-Left_FindBL. 1: Call procedure InitializeTH. Let i≔0. 2: Set i≔i þ 1. If i 4n, output the packing layout and stop. Let TREEj and HEAP j be the 2–3 tree and heap corresponding to the shape Tj of item Ri. 3: Call algorithm FindBLðTREEj , HEAP j Þ to find the BL position ðx; yÞ of Ri. 4: Pack Ri at ðx; yÞ. For each shape Tj (j ¼ 1; 2; …; t), call procedure ModifyTHðB; TREEj , HEAP j Þ for every NFP rectangle B that constitutes NFPðRi ; T j Þ to add the NFP of Tj relative to Ri into the corresponding NFP layout. Then return to Step 2.

The time complexity of this implementation of the bottom-left algorithm is analyzed in Section 5.3.3. 5.3.2. Best-fit algorithm based on FindBL Assume that the rectilinear blocks are divided into groups according to the shape and we are given a sequence of items of each shape that represents the decreasing order of their priority. In each iteration, we compute the BL positions for all the remaining shapes by using FindBL, and then we choose the rectilinear shape whose BL position takes the smallest x-coordinate among those with the lowest y-coordinate, breaking ties by choosing the shape having a remaining item with the highest priority. Then we take the item at the top of the ordered list of the chosen shape and pack it into the container. We then insert the NFPs of this item into the NFP layout for each shape and update the trees and heaps. The best-fit algorithm is formally described as Algorithm 9. Algorithm 9. Best-Fit_FindBL. 1: Set R0 ≔R. 2: If R0 ¼ ∅, output the packing layout and stop.

Y. Hu et al. / Computers & Operations Research 53 (2015) 206–222

3: Set T 0 ≔T , xn ≔þ 1 and yn ≔ þ 1. 4: If T 0 ¼ ∅, go to Step 7. 5: Choose a shape Tj in T 0 , and then let T 0 ≔T 0 \fT j g. If there is no item in R0 whose shape is Tj, return to Step 4. 6: Find the BL position ðx; yÞ of Tj by using FindBLðTREEj , HEAP j Þ. Let Ri A R0 be the item that takes the highest priority among those items whose shape is Tj. If one of the following three conditions holds, then let xn ≔x, yn ≔y and in ≔i. (i) y o yn . (ii) y ¼ yn and x oxn . (iii) y ¼ yn , x ¼ xn and Ri has higher priority than Rin . Return to Step 4. 7: Pack the item Rin at ðxn ; yn Þ. For each shape Tj (j ¼ 1; 2; …; t), call procedure ModifyTHðB; TREEj , HEAP j ) for every NFP rectangle B that constitutes NFPðRin ; T j Þ to add the NFP of Tj relative to Rin into the corresponding NFP layout. Set R0 ≔R0 \fRin g, and return to Step 2.

The time complexity of this implementation of the best-fit algorithm is analyzed in Section 5.3.3. 5.3.3. Time complexity of the two construction heuristics In this section, we explain the time complexities of the new implementation of the heuristic algorithms for the rectilinear block packing problem. For every iteration, our algorithms pack a rectilinear block into the container. When a block Ri is placed, mi mTj NFP rectangles are placed into the NFP layout of shape Tj, where mi and mTj are the numbers of rectangles that represent Ri and Tj, respectively. Time for modifying the balanced search trees and heaps by calling procedure ModifyTH for all shapes is ∑tj ¼ 1 Oðmi mTj log MÞ ¼ Oðmi m log MÞ, where m ¼ ∑tj ¼ 1 mTj , because procedure ModifyTH takes Oðlog MÞ time for each NFP rectangle. Because we need to insert such NFP rectangles into the NFP layout of every shape Tj for all items Ri in R, the time spent for procedure ModifyTH during the entire execution of the bottom-left or best-fit algorithm is ∑ni¼ 1 Oðmi m log MÞ ¼ OðmM log MÞ. As explained in Section 5.2.2, the execution time of a call to the FindBL algorithm is OðK log MÞ for K the number of elements deleted from HEAP j during the call to FindBL. For convenience, let Kjl be the number of elements deleted from HEAP j by the call to FindBL in the lth iteration of the bottomleft or best-fit algorithm. The number of deleted elements never exceeds the number of elements added to it. The number of elements added to HEAP j in the initialization phase is Oð1Þ, and that of the iteration when an item Ri is added is 2mi mTj þ 2 (the top and bottom edges of mi mTj NFP rectangles, and the top and bottom edges added into the heap in Step 6 of FindBL). Hence the total number of elements added into HEAP j is ∑ni¼ 1 ð2mi mTj þ 2Þ þ Oð1Þ ¼ OðmTj MÞ, which implies that ∑nl¼ 1 K jl ¼ OðmTj MÞ. As a result, the total running time for computing BL positions of shape Tj by FindBL is ∑nl¼ 1 OðK jl log MÞ ¼ OðmTj M log MÞ. Hence the total time of FindBL for all shapes is ∑tj ¼ 1 OðmTj M log MÞ ¼ OðmM log MÞ during the entire execution of the bottom-left or best-fit algorithm. The time complexity of other parts of the algorithms is dominated by the execution time of these two procedures. Therefore, both the bottom-left and best-fit algorithms run in OðmM log MÞ time. Note that it is not necessary to add in an NFP layout an NFP rectangle whose top edge is strictly lower than the current sweep line, because the sweep line never moves downward and hence such an NFP rectangle will not affect the overlap number during the remaining execution of the bottom-left or best-fit algorithm. According to the definitions of reference points and NFP, the highest edge of NFPðRi ; T j Þ of two rectilinear blocks Ri and Tj is

217

not higher than the top edge of the bounding box of Ri. Based on this, in Steps 4 and 7 of Algorithms 8 and 9, respectively, after packing the item Ri or Rin into container, we first check the top edge of its bounding box. For each shape, if it is lower than the corresponding sweep line, there is no need to insert its NFP rectangles into the NFP layout. Otherwise, for every NFP rectangle of the item Ri or Rin that has just been packed, we check its top edge and insert it into the NFP layout only when it is not lower than the sweep line. Even with this modification, the worst-case time complexities of the two algorithms are the same, but this usually reduces the running time and memory space in practice.

6. Extension for packing with rotation In this section, we explain how we can apply the efficient data structure in Section 5 to the rectilinear block packing problem with rotation. Natural ways to generalize the bottom-left algorithm would be the following:

 The order of items and their orientations (i.e., the rotation 

angle) are given, and then the bottom-left algorithm for the case without rotation is applied. The order of items is given, and in each iteration, for the next item to be placed, the BL positions of this item with respect to all orientations are computed. Then one of the orientations is chosen based on some rules (e.g., the one with the lowest BL position is chosen), and the item is placed with the selected orientation at its BL position.

A natural way to generalize the best-fit algorithm is as follows: we are given a priority among all combinations of orientations and items. (Because there are four possible orientations, 01, 901, 1801 and 2701, there are 4n possible combinations.) Whenever an item is to be packed, the BL positions of all remaining items with respect to all orientations are computed, and then the combination that attains the left-most BL position among the lowest ones is chosen, resolving ties by choosing the one with the highest priority. There might be other ways to generalize these algorithms, but the most expensive computation of such algorithms would be the computation of the BL positions of the remaining items with respect to all orientations. The data structures in Section 5 can be easily generalized to deal with this case just by preparing 4t copies of NFP layouts (and relevant data structures for each of them), each corresponding to a combination of an orientation and a shape in T . Because this increases the computation time only by a constant factor, the time complexity of the case with rotation is the same as the case without rotation. The case where the reflection of items is allowed can be treated similarly. Note that the same argument can also be applied to the case in which candidate orientations are different among items (e.g., item 1 cannot be rotated, item 2 can be rotated by 901, 1801 and 2701, item 3 can be rotated by 1801 and so forth), and also to a more general case in which each item can take different shapes from a constant number of candidates.

7. Computational results The bottom-left and best-fit algorithms proposed in this paper were implemented in the C programming language and run on a Mac PC with a 2.3 GHz Intel Core i5 processor and 4 GB memory. Performance of these algorithms have been tested on a series of instances, which are generated from nine benchmark instances.

218

Y. Hu et al. / Computers & Operations Research 53 (2015) 206–222

Table 1 Computational results for ami49L21 (28 distinct shapes). Instance

W

ami49L21_001 ami49L21_002 ami49L21_004 ami49L21_008 ami49L21_016 ami49L21_032 ami49L21_064 ami49L21_128 ami49L21_256 ami49L21_512

n

5936 8396 11,873 16,792 23,747 33,584 47,495 67,168 94,991 134,337

m

28 56 112 224 448 896 1792 3584 7168 14,336

M

49 49 49 49 49 49 49 49 49 49

Bottom-left

Best-fit

Occup.

FBLR

FindBL

n

0.0000 0.0084 0.0294 0.1412 0.5864 2.5567 10.9921 47.3732 218.3621 1026.5724

0.0039 0.0078 0.0173 0.0374 0.1054 0.2384 0.5121 1.1610 2.3410 5.0132

85.00 83.41 86.91 n 87.68 n 88.40 85.31 n 89.49 n 89.93 n 90.19 n 90.59

49 98 196 392 784 1568 3136 6272 12,544 25,088

n

Occup.

FBLR

FindBL

84.66 86.42 86.55 86.98 87.17 n 87.78 87.82 88.28 88.84 88.66

0.0068 0.0185 0.0536 0.1538 0.4213 1.2249 3.4498 10.1575 29.1903 84.3987

0.0039 0.0090 0.0215 0.0504 0.1243 0.2770 0.5632 1.2505 3.1304 7.6326

n

Table 2 Computational results for ami49LT21 (27 distinct shapes). Instance

W

n

m

M

Bottom-left Occup.

ami49LT21_001 ami49LT21_002 ami49LT21_004 ami49LT21_008 ami49LT21_016 ami49LT21_032 ami49LT21_064 ami49LT21_128 ami49LT21_256 ami49LT21_512

5953 8419 11,907 16,839 23,814 33,678 47,628 67,357 95,257 134,714

27 54 108 216 432 864 1728 3456 6912 13,824

49 49 49 49 49 49 49 49 49 49

49 98 196 392 784 1568 3136 6272 12,544 25,088

Best-fit FBLR

82.58 84.71 87.14 n 88.57 n 87.96 n 88.44 n 89.27 n 89.96 n 89.65 n 90.00

0.0002 0.0120 0.0312 0.1245 0.5812 2.4679 10.5217 43.1320 216.9078 1012.3210

n

FindBL

Occup.

FBLR

FindBL

0.0055 0.0085 0.0188 0.0472 0.0948 0.2165 0.5110 1.2052 2.6589 5.9850

n

0.0063 0.0185 0.0541 0.1492 0.4444 1.2210 3.7520 9.8772 27.5558 80.0347

0.0061 0.1190 0.2697 0.5101 0.1184 0.2553 0.6144 1.3976 3.1103 6.9339

86.80 87.42 86.09 85.31 86.61 87.54 87.41 87.70 87.73 88.38

n

Table 3 Computational results for TMCNCGSRC (51 distinct shapes). Instance

W

TMCNCGSRC_001 TMCNCGSRC_002 TMCNCGSRC_004 TMCNCGSRC_008 TMCNCGSRC_016 TMCNCGSRC_032 TMCNCGSRC_064 TMCNCGSRC_128 TMCNCGSRC_256

n

2376 3360 4752 6720 9504 13,441 19,009 26,882 38,018

m

51 102 204 408 816 1632 3264 6528 13,056

76 76 76 76 76 76 76 76 76

M

Bottom-left Occup.

FBLR

FindBL

Occup.

FBLR

FindBL

76 152 304 608 1216 2432 4864 9728 19,456

n

0.0015 0.0194 0.0623 0.3134 1.3324 5.7123 24.5076 106.6426 484.3105

0.0109 0.0224 0.0485 0.1176 0.2757 0.5914 1.3641 3.1013 6.7650

73.68 78.47 79.70 81.71 83.03 83.97 84.72 84.75 85.38

0.0264 0.0813 0.2348 0.6242 1.9218 5.3972 15.6673 45.0612 131.3252

0.0127 0.0268 0.0627 0.1492 0.3489 0.7934 1.9113 4.1709 9.4778

83.85 84.87 n 85.60 n 88.37 n 86.94 n 88.05 n 88.44 n 88.06 n 88.12 n

Best-fit

Table 4 Computational results for B10 (9 distinct shapes). Instance

B10_0001 B10_0002 B10_0004 B10_0008 B10_0016 B10_0032 B10_0064 B10_0128 B10_0256 B10_0512 B10_1024 B10_2048

W

9 13 19 27 38 54 77 109 155 219 310 438

n

9 18 36 72 144 288 576 1152 2304 4608 9216 18,432

m

14 14 14 14 14 14 14 14 14 14 14 14

M

14 28 56 112 224 448 896 1792 3584 7168 14,336 28,672

Bottom-left

Best-fit

Occup.

FBLR

FindBL

Occup.

FBLR

FindBL

n

0.0004 0.0018 0.0097 0.0194 0.0456 0.1645 0.7894 2.9940 12.6032 55.2214 244.6453 834.0140

0.0006 0.0013 0.0015 0.0048 0.0073 0.0188 0.0311 0.0710 0.1326 0.3142 0.7025 1.6130

n

0.0005 0.0017 0.0049 0.0129 0.0372 0.0100 0.2929 0.7383 2.2887 6.9335 19.1195 57.6938

0.0004 0.0010 0.0026 0.0054 0.0080 0.0153 0.0338 0.0682 0.1580 0.3511 0.8663 1.8165

87.04 80.34 n 82.46 84.40 87.95 87.04 88.78 89.74 90.79 90.44 91.32 91.57 n

87.04 80.34 79.16 n 89.84 n 89.95 n 92.84 n 93.01 n 94.35 n 93.53 n 93.52 n 93.81 n 96.39 n

Y. Hu et al. / Computers & Operations Research 53 (2015) 206–222

219

Table 5 Computational results for B30 (29 distinct shapes). Instance

B30_001 B30_002 B30_004 B30_008 B30_016 B30_032 B30_064 B30_128 B30_256 B30_512

W

29 42 59 84 119 169 239 338 478 676

n

m

29 58 116 232 464 928 1856 3712 7424 14,848

59 59 59 59 59 59 59 59 59 59

M

Bottom-left

59 118 236 472 944 1888 3776 7552 15,104 30,208

Best-fit

Occup.

FBLR

FindBL

Occup.

FBLR

FindBL

79.05 81.87 84.18 84.30 84.65 85.06 85.19 86.15 86.27 87.03

0.0001 0.0091 0.0406 0.2105 0.9015 3.8053 16.4675 71.1954 323.4450 1470.6230

0.0077 0.0142 0.0343 0.0708 0.1507 0.3360 0.7607 1.7002 3.8178 8.6587

n

0.0108 0.0266 0.0949 0.2971 0.8364 2.3240 6.9546 20.3806 56.1533 161.9050

0.0069 0.0157 0.0388 0.0867 0.2009 0.4642 1.0543 2.3403 5.2021 11.5104

83.32 85.41 86.59 n 88.69 n 89.70 n 89.57 n 90.34 n 90.28 n 90.17 n 90.64 n n

Table 6 Computational results for T19 (19 distinct shapes). Instance

T19_0001 T19_0002 T19_0004 T19_0008 T19_0016 T19_0032 T19_0064 T19_0128 T19_0256 T19_0512 T19_1024

W

18 26 37 53 75 106 150 212 300 425 601

n

19 38 76 152 304 608 1216 2432 4864 9728 19,456

m

42 42 42 42 42 42 42 42 42 42 42

M

42 84 168 336 672 1344 2688 5376 10,752 21,504 43,008

Bottom-left

Best-fit

Occup.

FBLR

FindBL

Occup.

FBLR

FindBL

n

0.0003 0.0018 0.0168 0.0923 0.4012 1.6874 7.2680 30.8377 138.2885 610.6031 2817.6456

0.0042 0.0081 0.0162 0.0284 0.0623 0.1464 0.3188 0.7202 1.5685 3.4406 8.4418

65.37 69.63 74.83 n 75.05 n 76.84 n 78.94 n 79.27 n 78.94 n 79.48 n 80.39 n 79.87

0.0049 0.0159 0.0466 0.1389 0.3776 1.1887 3.2077 9.7410 27.4225 79.1770 239.7320

0.0049 0.0078 0.0161 0.0330 0.0756 0.1880 0.3873 0.9248 1.9829 4.0719 9.0745

67.62 73.39 72.00 72.99 74.56 75.05 75.69 75.05 75.69 74.87 74.81

n

n

Table 7 Computational results for T40 (32 distinct shapes). Instance

T40_001 T40_002 T40_004 T40_008 T40_016 T40_032 T40_064 T40_128 T40_256 T40_512

W

301 426 602 852 1205 1704 2410 3409 4821 6818

n

32 64 128 256 512 1024 2048 4096 8192 16,384

m

42 42 42 42 42 42 42 42 42 42

M

Bottom-left Occup.

FBLR

FindBL

Occup.

FBLR

FindBL

n

0.0004 0.0018 0.0214 0.0841 0.3924 1.6252 6.8731 29.0134 128.0145 576.5932

0.0041 0.0069 0.1237 0.0324 0.0687 0.1529 0.3383 0.7906 1.7350 3.9335

81.53 87.00 91.41 n 93.69 92.74 93.18 92.74 93.15 93.44 93.53

0.0080 0.0237 0.0667 0.1817 0.5261 1.5402 4.2180 11.9671 33.2296 99.5149

0.0052 0.0095 0.0171 0.0338 0.0802 0.2013 0.4619 1.0504 2.3315 5.1017

88.72 90.70 n 92.82 92.67 n 94.19 n 95.26 n 96.07 n 96.58 n 97.01 n 96.86

42 84 168 336 672 1344 2688 5376 10,752 21,504

Best-fit

n

Table 8 Computational results for T64 (15 distinct shapes). Instance

W

n

m

M

Bottom-left Occup.

T64_0001 T64_0002 T64_0004 T64_0008 T64_0016 T64_0032 T64_0064 T64_0128 T64_0256 T64_0512 T64_1024

7 11 15 22 31 44 62 88 124 176 249

15 30 60 120 240 480 960 1920 3840 7680 15,360

33 33 33 33 33 33 33 33 33 33 33

33 66 132 264 528 1056 2112 4224 8448 16,896 33,792

79.22 85.31 85.61 85.31 87.46 90.54 91.26 92.42 93.29 93.40 93.26

n

Best-fit FBLR

FindBL

Occup.

FBLR

FindBL

0.0001 0.0006 0.0143 0.0678 0.2453 1.0780 4.5690 19.3126 86.1563 382.6577 1692.5672

0.0017 0.0055 0.0092 0.0180 0.0380 0.0839 0.1867 0.4416 0.9837 2.1363 4.7761

n

0.0028 0.0088 0.0280 0.0866 0.2469 0.7050 2.0836 6.0466 17.6114 51.6020 153.8780

0.0028 0.0053 0.0109 0.0184 0.0400 0.1128 0.2161 0.4700 1.0678 2.3696 5.0661

87.14 85.31 90.37 n 92.42 n 92.60 n 94.39 n 93.98 n 95.41 n 96.87 n 96.44 n 97.23 n n

220

Y. Hu et al. / Computers & Operations Research 53 (2015) 206–222

Table 9 Computational results for T144 (20 distinct shapes). Instance

T144_001 T144_002 T144_004 T144_008 T144_016 T144_032 T144_064 T144_128 T144_256 T144_512

W

11 15 22 31 44 62 88 124 176 249

n

20 40 80 160 320 640 1280 2560 5120 10,240

m

31 31 31 31 31 31 31 31 31 31

M

31 62 124 248 496 992 1984 3968 7936 15,872

Bottom-left

Best-fit

Occup.

FBLR

FindBL

Occup.

FBLR

FindBL

85.31 85.61 88.73 92.60 92.42 95.41 96.44 96.87 98.01 98.38

0.0000 0.0010 0.0091 0.0490 0.2110 0.9061 3.8920 16.8501 73.0135 328.4476

0.0028 0.0048 0.0071 0.0202 0.0300 0.0814 0.1909 0.3864 0.8748 2.0470

n

0.0029 0.0091 0.0278 0.0873 0.2399 0.7115 2.1135 5.9863 17.3983 49.4838

0.0025 0.0037 0.0083 0.0198 0.0375 0.1008 0.2169 0.4793 1.0518 2.3441

92.42 90.37 92.42 n 95.41 n 94.39 n 96.87 n 97.50 n 97.50 n 98.59 n 98.76 n n

Fig. 8. Layouts obtained for T144_004 by the two algorithms (left: bottom-left algorithm and right: best-fit algorithm).

For more details of these instances, readers could refer to ffi[9]. The pffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi width W of the container is decided by W ¼ ⌈ ∑ni¼ 1 AðRi Þ⌉. We analyze the computational results from both sides of the running time and the occupation rate. As to the order of the items for the bottom-left algorithm and the priority among the items for the best-fit algorithm, we tested the decreasing order of width, height, area and the area of the bounding box. The occupation rate of the decreasing order of area is slightly better than the results obtained by other orders. Hence, we report those results of the decreasing order of area. The computational results obtained by the bottom-left and the best-fit algorithm are shown in Tables 1–9. In the tables, the columns of “Occup.” of “Bottom-Left” and “Best-Fit” show the occupation rate in % obtained by the bottom-left and the best-fit algorithms. For each instance, the best results among the two algorithms are marked by ‘n’. The column “FBLR” is the running time of the algorithms explained in Section 4, which utilize the Find2D-BL-R to find the BL positions. The column “FindBL” is the running time of the algorithms with efficient implementations in Section 5. All the running times are shown in seconds. The computational results in column “FBLR,” which are obtained by the bottom-left and best-fit algorithms explained in Section 4, show that the running time of the best-fit algorithm is much smaller than that of the bottom-left algorithm. The computational results in columns “FBLR” and “FindBL” show that our efficient implementations significantly reduce the computation time of the bottom-left and best-fit algorithms. By incorporating FindBL, the bottom-left algorithm becomes more than 500 times faster for the instance B10_2048, and the best-fit algorithm becomes more than 30 times faster for B10_2048 and T64_1024. Observe in columns “FBLR” that the running time of the best-fit algorithm that utilizes the Find2D-BL-R algorithm to compute BL positions is much

Table 10 Information of HHIY. n

10 100 1000 10,000

10 shapes

100 shapes

1000 shapes

10,000 shapes

m

M

m

M

m

M

m

M

34 34 34 34

34 340 3400 34,000

– 345 345 345



– – 3546 3546

– –

– – – 35,014

– – – 35,014

345 3450 34,500

3546 35,460

smaller for large-scale instances than that of the bottom-left algorithm. As explained in Section 4.4, in every iteration, the best-fit algorithm can discard the space below the sweep line where the latest item is placed. This significantly reduces the computation time for large-scale instances. As to the occupation rate, the data in column “Occup.” show that our algorithms tend to perform better when the instance becomes larger. Which of the bottom-left and best-fit algorithms is better depends on instances, and if we take the best result of these two, the occupation rate often reaches higher than 95%. Fig. 8 shows two example layouts obtained by the bottom-left and the best-fit algorithms. These are the layouts obtained for the instance named T144_004. The height obtained by the bottom-left algorithm is 25 and that obtained by the best-fit algorithm is 24. The occupation rates of these layouts are 88.73% and 92.42%, respectively, as reported in Table 9. For analyzing how performance changes for the cases when m is small relative to M and m is large relative to M, we tested our best-fit algorithm with the efficient implementations in Section 5 on instances named “HHIY” that were generated randomly. These

Y. Hu et al. / Computers & Operations Research 53 (2015) 206–222

221

Table 11 Computational results for HHIY. n

10 100 1000 10,000

10 shapes

100 shapes

1000 shapes

10,000 shapes

Occup.

Time

Occup.

Time

Occup.

Time

Occup.

Time

69.23 82.65 84.11 85.14

0.0031 0.0330 0.3998 4.6979

– 81.29 86.90 88.08

– 0.4125 4.6103 52.4316

– – 94.20 95.42

– –

– – – 95.21

– – – 5798.3214

instances are publicly available and can be downloaded from http://www.co.cm.is.nagoya-u.ac.jp/  yagiura/rectilinear/. Each rectilinear block was generated by combing up to six rectangles, and we generated four instances with 10, 100, 1000 and 10,000 distinct shapes. We then generated other instances by copying the shapes in these instances, e.g., the instance with 1000 blocks (i.e., n ¼1000) with 100 distinct shapes was generated by making 10 copies of each shape in the instance with 100 distinct shapes. Table 10 shows the information of m and M for each instance of HHIY. The computational results of these instances are shown in Table 11. Each cell in these tables contains the result obtained for the instance that has n rectilinear blocks and t distinct shapes for the values of n and t in the corresponding row and column (e.g., the data in the cell in the row of “n¼ 1000” and column of “100 Shapes” is the result of the instance generated by making 10 copies of each shape in the instance with 100 distinct shapes). The column of “Occup.” shows the occupation rate in %. All running times are shown in seconds. We can observe from the tables that, for every value of n, the running time increases almost linearly with the number of distinct shapes of these instances. Even for the instance with 10,000 distinct shapes, our algorithm runs in about 5798 s. According to the results, when the values of M are similar, the computation time is almost proportional to m.

8. Conclusions In this paper, we proposed a bottom-left and a best-fit algorithm for the rectilinear block packing problem. If naively implemented, the bottom-left algorithm requires OðminfM 6 ; nm3 M 3 gÞ time while the best-fit algorithm requires Oðnm3 M 3 Þ time. We first gave implementations of these two construction heuristics by generalizing the algorithm proposed in [17], and we reduced the complexity of the bottom-left algorithm to OðM 2 log MÞ and that of the best-fit algorithm to OðnmM log MÞ. We then designed more efficient implementations of these algorithms by using sophisticated data structures to dynamically keep the information. We then analyzed the time complexities of these algorithms with efficient data structures and showed that both algorithms run in OðmM log MÞ time. We also performed a series of experiments based on benchmark instances. The occupation rate of the packing layouts obtained by our algorithms often reached higher than 95%. Even for instances with more than 10,000 rectilinear blocks with up to 60 distinct shapes, the proposed algorithms run in less than 12 s.

Appendix A. Best-fit algorithm for the rectangle packing problem The best-fit algorithm for the rectangle packing problem [7] is as follows: during the computation, the algorithm keeps a skyline, which consists of a sequence of line segments satisfying the following properties:

53.8471 562.6420

 Each line segment is parallel to the x-axis.  Two adjacent line segments have different y-coordinates and

 

have exactly one common x-coordinate (i.e., the x-coordinate of the right end point of a line segment is the same as that of the left end point of its right neighbor). Viewed from an infinitely high position, no point in the line segments is hidden by already placed rectangles. Each line segment touches the top edge of an already placed rectangle or the bottom edge of the strip.

Among all the line segments in a skyline, the lowest available segment is the one that has the smallest y-coordinate. The best-fit heuristic repeats the following two operations until all the rectangles are placed:

 Find the lowest available segment of the current skyline.  Place a rectangle on the segment. At the beginning of the packing process, no rectangles are placed in the strip and the skyline consists of the bottom edge of the strip only. Whenever a rectangle is placed, a part of the lowest available segment moves upward in such a way that the part of the segment hidden by the bottom edge of the placed rectangle is replaced by the top edge of the rectangle. If there are several segments on the lowest level (i.e., they have the same y-coordinate), the algorithm selects the leftmost one as the lowest available segment. For the lowest available segment, the best fit rectangle, which is to be placed on the segment, is defined to be the widest rectangle (resolving equal widths by the largest height) that has not been placed yet and can be placed on the segment without overlap (i.e., its width is no larger than that of the segment). If the width of the lowest available segment is larger than that of the best fit rectangle, the algorithm places the rectangle at the leftmost position on the segment (called the left strategy). If there are no rectangles that can be placed on the lowest available segment, the segment is raised to the level of the lower segment adjacent to it, and the two segments are merged. In this case, the space below the raised segment becomes waste. When all the rectangles are placed in the strip, the main part of the best-fit heuristic algorithm ends. It seems hard to directly generalize this idea to the case of rectilinear blocks, but the following interpretation will make it easy. The following is a different explanation of the best-fit algorithm. To be more precise, for any instance of the rectangle packing problem, the solution obtained by the following procedure is exactly the same as the one obtained by the above algorithm. At the beginning of the packing process, no rectangles are placed in the container. The algorithm packs rectangles one by one at their BL position, and in each iteration, it dynamically chooses a rectangle to pack among the remaining items by the following rule: Calculate the BL positions of all of the remaining items. Then, in this iteration, the rectangle whose BL position takes the smallest x-coordinate among those with the lowest y-coordinate is packed. When there is more than one such rectangle, the widest one (resolving equal widths by the largest height) is chosen.

222

Y. Hu et al. / Computers & Operations Research 53 (2015) 206–222

Appendix B. Time complexities of heuristic algorithms with naive implementations For comparison purposes, we explain the time complexities of the bottom-left and the best-fit algorithms when they are naively implemented. In the naive implementation, we also utilize the technique of NFP to calculate overlap numbers of rectilinear blocks. Assuming that the number of NFP rectangles is δ, the computation time to 3 2 find the BL position is Oðδ Þ, because there are Oðδ Þ CrossPoints (which are defined in Section 5.2.1), and it takes OðδÞ time to calculate the overlap number for each CrossPoint. The number of rectangles that represent a rectilinear block Ri is denoted by mi and let M ¼ ∑ni¼ 1 mi . We also define mTj as the number of rectangles that represent shape Tj, and m is the sum of mTj for all the shapes in T . The bottom-left and the best-fit algorithms compute the BL position of a rectilinear block Ri in Oððmi MÞ3 Þ time, because the number of NFP rectangles is the sum of mi mj for all items Rj in the container, which is Oðmi MÞ. For every iteration, when the bottom-left algorithm packs a rectilinear block Ri into the container, it calculates the NFPs in Oðmi MÞ time and computes the BL position of Ri in Oððmi MÞ3 Þ time. The bottom-left algorithm therefore runs in ∑ni¼ 1 Oððmi MÞ3 Þ time. Noting that ∑ni¼ 1 ðmi MÞ3 r ∑ni¼ 1 ðmMÞ3 ¼ nm3 M 3 and ∑ni¼ 1 ðmi MÞ3 r ð∑ni¼ 1 mi MÞ3 ¼ M 6 , the time complexity of the bottom-left algorithm is OðminfM 6 ; nm3 M 3 gÞ. For every iteration, when the best-fit algorithm packs a rectilinear block into the container, it computes the BL positions for all the shapes, and the running time for calculating NFPs is ∑tj ¼ 1 OðmTj MÞ ¼ OðmMÞ and for computing the BL position is ∑tj ¼ 1 OððmTj MÞ3 Þ ¼ Oðm3 M 3 Þ. The best-fit algorithm therefore runs in ∑ni¼ 1 Oðm3 M 3 Þ ¼ Oðnm3 M 3 Þ time. References [1] Albano A, Sapuppo G. Optimal allocation of two-dimensional irregular shapes using heuristic search methods. IEEE Trans Syst Man Cybern 1980;10:242–8. [2] Art RC. An approach to the two dimensional irregular cutting stock problem. IBM Cambridge Science Center, Cambridge, Massachusetts, 36.Y08; 1966. [3] Baker BS, Coffman Jr EG, Rivest RL. Orthogonal packings in two dimensions. SIAM J Comput 1980;9:846–55. [4] Bennell JA, Dowsland KA. Hybridising tabu search with optimisation techniques for irregular stock cutting. Manag Sci 2001;47:1160–72. [5] Bennell JA, Dowsland KA, Dowsland WB. The irregular cutting-stock problem— a new procedure for deriving the no-fit polygon. Comput Oper Res 2001;28:271–87. [6] Burke E, Hellier R, Kendall G, Whitwell G. A new bottom-left-fill heuristic algorithm for the two dimensional irregular packing problem. Oper Res 2006;54:587–601. [7] Burke E, Kendall G, Whitwell G. A new placement heuristic for the orthogonal stock-cutting problem. Oper Res 2004;52:655–71.

[8] Chazelle B. The bottom-left bin-packing heuristic: an efficient implementation. IEEE Trans Comput 1983;32:697–707. [9] Chen D, Liu J, Fu Y, Shang M. An efficient heuristic algorithm for arbitrary shaped rectilinear block packing problem. Comput Oper Res 2010;37:1068–74. [10] Dowsland KA. Some experiments with simulated annealing techniques for packing problems. Eur J Oper Res 1993;68:389–99. [11] Egeblad J, Nielsen BK, Odgaard A. Fast neighborhood search for two- and three-dimensional nesting problems. Eur J Oper Res 2007;183:1249–66. [12] Fujiyoshi K, Kodama C, Ikeda A. A fast algorithm for rectilinear block packing based on selected sequence-pair. VLSI J Integr 2007;40:274–84. [13] Fujiyoshi K, Murata H. Arbitrary convex and concave rectilinear block packing using sequence-pair. IEEE Trans Comput-Aided Des Integr Circuits Syst 2000;19:224–33. [14] Gomes AM, Oliveira JF. Solving irregular strip packing problems by hybridising simulated annealing and linear programming. Eur J Oper Res 2006;171:811–29. [15] Gonçalves JF. A hybrid genetic algorithm-heuristic for a two-dimensional orthogonal packing problem. Eur J Oper Res 2007;183:1212–29. [16] Hopper E, Turton BCH. An empirical investigation of meta-heuristic and heuristic algorithms for a 2D packing problem. Eur J Oper Res 2001;128:34–57. [17] Imahori S, Chien Y, Tanaka Y, Yagiura M. Enumerating bottom-left stable positions for rectangle placements with overlap. J Oper Res Soc Jpn 2014;57:45–61. [18] Imahori S, Yagiura M. The best-fit heuristic for the rectangular strip packing problem: an efficient implementation and the worst-case approximation ratio. Comput Oper Res 2010;37:325–33. [19] Imamichi T, Yagiura M, Nagamochi H. An iterated local search algorithm based on nonlinear programming for the irregular strip packing problem. Discret Optim 2009;6:345–61. [20] Kang M, Dai WW-M. General floorplanning with L-shaped, T-shaped and soft blocks based on bounded slicing grid structure. In: Proceedings of the Asia and South Pacific design automation conference (ASP-DAC); 1997. p. 265–70. [21] Kang MZ, Dai WW-M. Arbitrary rectilinear block packing based on sequence pair. In: Proceedings of the 1998 IEEE/ACM international conference on computer-aided design (ICCAD); 1998. p. 259–66. [22] Lin JM, Chen HL, Cheng YW. Arbitrarily shaped rectilinear module placement using the transitive closure graph representation. IEEE Trans VLSI Syst 2002;10:886–901. [23] Ma Y, Hong X, Dong S, Cai Y, Chen S, Cheng CK, Gu J. Arbitrary convex and concave rectilinear block packing based on corner block list. In: Proceedings of the 2003 international symposium on circuits and systems (ISCAS), vol. 5; 2003. p. 493–6. [24] Nakatake S, Fujiyoshi K, Murata H, Kajitani Y. Module packing based on the BSG-structure and IC layout applications. IEEE Trans CAD Integr Circuits Syst 1998;17:519–30. [25] Pang Y, Cheng CK, Lampaert K, Xie W. Rectilinear block packing using O-tree representation. In: Proceedings of the 2001 international symposium on physical design (ISPD); 2001. p. 156–61. [26] Umetani S, Yagiura M, Imahori S, Imamichi T, Nonobe K, Ibaraki T. Solving the irregular strip packing problem via guided local search for overlap minimization. Int Trans Oper Res 2009;16:661–83. [27] Wäscher G, Haußner H, Schumann H. An improved typology of cutting and packing problems. Eur J Oper Res 2007;183:1109–30. [28] Wu GM, Chang YC, Chang YW. Rectilinear block placement using Bn-trees. ACM Trans Des Autom Electron Syst (TODAES) 2003;8:188–202. [29] Wu YL, Huang W, Lau S, Wong CK, Young GH. An effective quasi-human based heuristic for solving the rectangle packing problem. Eur J Oper Res 2002;141:341–58. [30] Xu J, Guo PN, Cheng CK. Rectilinear block placement using sequence-pair. In: Proceedings of the 1998 international symposium on physical design (ISPD); 1998. p. 173–8.