A Hybrid Algorithm for Strip Packing Problem with Rotation Constraint

Strip packing is a well-known NP-hard problem and it was widely applied in engineering fields. This paper considers a two-dimensional orthogonal strip packing problem. Until now some exact algorithm and mainly heuristics were proposed for two-dimensional orthogonal strip packing problem. While this paper proposes a two-stage hybrid algorithm for it. In the first stage, a heuristic algorithm based on layering idea is developed to construct a solution. In the second stage, a great deluge algorithm is used to further search a better solution. Computational results on several classes of benchmark problems have revealed that the hybrid algorithm improves the results of layer-heuristic, and can compete with other heuristics from the literature.


Introduction
Strip packing is a well-known NP-hard problem and has many practical applications in the engineering fields.For example, strip packing can be applied for tasks such as placing goods on shelves in the warehouses, arranging articles and advertisements during the type-setting of the newspapers, cutting rectangular pieces from large sheets of material in the wood or glass industries, and laying very-large-scale integration (VLSI) in VLSI floor planning industry.These applications can be formalized as a strip packing problem according to different constraints and objectives [1].The interested reader is referred to the literature [1]- [3] for more information on packing problems.
This paper considers a two-dimensional orthogonal strip packing problem: Given a rectangular sheet of given width and unlimited height, and a set of rectangles with arbitrary length and width, the orthogonal strip packing problem is to place each rectangle on the sheet such that no two rectangles overlap and the used height h of sheet is minimized.Let W be the width of the rectangular sheet, and n is the number of rectangles, let hi and wi be the length and width of rectangle i (i=1, 2,..., n) respectively.Where, we assume that the edges of each rectangle are parallel to the edges of the sheet.In addition, all rectangles except for the rectangular sheet are permitted to be rotated when they are placed.A formal definition for this problem can be found in [4].
The two-dimensional orthogonal strip packing problem mentioned above belongs to a subset of classical cutting and packing problems and has been shown to be NP-hard [5].Some exact algorithms for orthogonal twodimension cutting and packing problem were proposed in [6] and [7].However, they might be impractical for large problems because large amount of computational time is needed to obtain an optimal solution.Therefore, heuristic algorithms, which can produce a good approximation solution within an acceptable time, are preferred to solving this class of problems.Examples of heuristic algorithms include the well-known bottom-left (BL), bottom-left-fill (BLF) and other heuristic methods [8].In addition, some new heuristic algorithms such as constructive approach [9], new placement heuristics [10], and heuristic recursion algorithm [4] were developed to solve this class of packing problems.These heuristic algorithms can obtain a good solution in a short time.In order to obtain a better solution, heuristic algorithms are often combined with meta-heuristic algorithms such as genetic algorithms [11]- [13], neural network and GA [14], simulated annealing algorithms [15]- [17] and other metaheuristics [18]- [23].An empirical investigation of metaheuristic and heuristic algorithms for the orthogonal packing problem of rectangles is given by Hopper and Turton [24].Recently, some excellent hybrid algorithms were developed [25]- [27].In particular, a class of deterministic heuristics is developed by a number of researchers and they are successful in obtaining the better results [20], [28], [29].Leung and Zhang [30] proposed a fast layer-heuristic algorithm, which have many applications in routing problem with loading constraints [31], [32].Several efficient heuristic algorithms for the variants of packing problem were also developed [33]- [35]

Imprroved layer-based heuristic
Layer-based heuristic was proposed by Leung and Zhang [30].It is a fast heuristic algorithm for strip packing problem.The idea of layer-based heuristic is as follows: (1) Select a reference item r from unpacked items.
(2) Stack some unpacked items above the item r to determine a reference line.
(3) Pack the available space under the reference line as follows: (3.1) Determine the lowest available space (3.2) Select an unpacked item i with maximal fitness value from unpacked items.
(3.3) Pack the item i and update the available space s; (3.4) If there is an unpacked item can be packed into the available space s, go to (3.1); (4) if there exists an unpacked item, go to (1).
The detailed process of layer-based heuristic based on the idea of fitness value is given in Leung and Zhang [30].There are four cases when the fitness value is computed in the process of layer-based heuristic [30].In fact, there are two special cases that should be given a bigger fitness value when h1 h2 and h1<h2, respectively.The case for h1 h2 is shown in Figure 1(a).And for the case given in Figure 1(b), the item R should be given higher fitness value than the item R from Figure 1(a).Also, the item R in Figure 1(d) should be given higher fitness value than the item R from Figure 1(c).Meanwhile, there also are two special cases as h1<h2, and they are shown in Fig. 2.

Hybrid algorithm
The great deluge algorithm (GDA) is a general algorithm which is applied to solving optimization problems.It is similar to the hill-climbing and simulated annealing algorithms in many ways.GDA comes from the analogy that in a great deluge a person climbing a hill will try to move in any direction that does not get his/her feet wet in the hope of finding a way up as the water level rises.In a typical implementation of the GDA, the algorithm starts with an initial solution which is a poor approximation S of the optimum solution.A numerical value called "badness" is computed based on S and it measures how undesirable the initial approximation is.The higher the value of badness, the more undesirable the approximate solution is.Another numerical value called "tolerance" is calculated based on a number of factors, often including the initial badness.
For a given solution x, we can construct a neighborhood N(x).A new approximate solution x' which is called a neighbor of x, is selected from N(x).The badness b' of x' is computed and compared with the tolerance.If b' is better than tolerance, then the algorithm is restarted by setting x:=x', and tolerance:=decay(tolerance), where decay is a function that lowers the tolerance (representing a rise in water levels).If b' is worse than tolerance, a different neighbor x* of x is chosen and the process is repeated.If all the neighbors of x produce approximate solutions beyond the tolerance value, then the algorithm is terminated and x is returned as the best approximate solution obtained.
The detailed GDA for strip packing problem is as follows: where x is an array and records the orderings of rectangular pieces.Function Sort1(x) sorts a sequence of rectangle pieces according to the non-increasing ordering of area size.Sort2(x) sorts a sequence of rectangle pieces according to the non-increasing ordering of length size.Sort3(x) sorts a sequence of rectangle pieces according to the non-increasing ordering of perimeter size.The parameter "besth" denotes the current minimal height.Function Heuristicplacing(x) is the same heuristic algorithm used in Leung and Zhang [30].Therefore, the proposed algorithm based on GDA (FH+GDA) is as follows: where Fastheuristic() is the function proposed in Leung and Zhang [30].Note that the performance of heuristic algorithm significantly depends on the packing ordering X of the rectangles.Some results have shown that the packing orderings affect the performance of the presented algorithm [31].In this paper, we consider three orderings to avoid the search process from being trapped in a local minimum

Computational results
In order to test the performance of the proposed algorithm (FH+GDA), a large amount of benchmark are selected and the results of the proposed algorithm are compared with results of some published heuristics.The benchmark instances (C11~C73) in [24] include 21 problem instances ranging from 16 to 197 items.And the instances 50cx~15000cx are taken from [36], whose sized ranges from 25 to 5000.Considering more constraints in strip packing problem, instances zdf1~zdf16 with fixorientation and instances beng1~beng10 with small-scale are also selected.All problem classes can be downloaded from http://algorithm.xmu.edu.cn:10000/Download.aspx#p4.
In the section, FH+GDA is with compared BF+TS, BF+SA, BF+GA, HRP, FH and DHA.BF+TS, BF + SA, BF + GA were tested on a Pentium IV machine with 2.0 GHz.The algorithms are executed for 10 times with a time limit of 60s per run.HRP is implemented in C#.net programming language and it was tested on a 2 GHz Pentium 4 notebook computer with 2048 MB of RAM.FH is a deterministic algorithm and it was tested on a 2 GHz Pentium 4 notebook computer with 2048 MB of RAM with the time limit of 60s per run.DHA was implemented in C programming language and executed as a single process/thread, and all tests were performed on a personal computer with 3.0 GHz CPU and 2.0 GB memory with a time limit of 1000s.FH+GDA was coded in C++ and executed on a TECRA M2V computer with a 1.6GHz CPU and 256 MB of RAM.The proposed algorithm is executed five times and each execution last for maximum of 60 seconds.The comparison of the performance of different algorithms is based on h and time, where, h and time denote the height and running time (in second) respectively.

The computational results on the test problems permitting rotation
In the part, the computational results are from the instances permitting rotation.Meanwhile, BF+GA, BF+SA and BF+TS in [16], HRP [20], FH [30] and DHA [29] are introduced for comparison.The results of BF+GA, BF+SA and BF+TS are from [16], the results of HRP and FH are from [30], and the results of DHA are from [29].In tables, "op" represents the optimal height, OPTMA# denotes the number of the optimal height obtained by different algorithms.BEST# denotes the number of the best height obtained by different algorithms.
Since the previous paper did not supply the time of experiment.The comparison among BF+TS, BF+SA, BF+GA and FH+GDA is only concentrated on the h, and the results is shown in Table1.Obviously, FH+GDA achieves the best result in every instances among four strategies.The comparison among FH+GDA and other three algorithms on time and h is presented in Table 2. Also, FH+GDA shows efficiency on all instances, FH+GDA gets best results in all instances and do not cost much time.Table 1 and Table 2 clearly indicate that FH+GDA performs better than other algorithms on instances permitting rotation.In order to extensively test the performance of FH+GDA, A large-scale problem is considered.Table 3 presents the comparison of computational results of four algorithms with instances 50cx~15000cx.According to the table, FH+GDA outperforms other three algorithms.FH+GDA find smaller h than FH in 50xc and 100cx, and solutions of other instances obtained by FH+GDA are the same as FH.It reveals that FH+GDA can improve the solutions obtained by FH.We can observe that BEST# and OPTIMA# of FH+GDA is highest, which means FH+GDA shows efficiency with large-scale problems as well.Meanwhile, the time of FH+GDA is smaller than the time of HRP and DHA for most instances.

The computational results on test problems with fixed orientation
In this paper, similar to [30], we test the performance of FH+GDA with several large-scale instances with fixed orientation.The well-known GRASP, SVC, and FH algorithms are selected for comparison in the Table 4.
The computation results of other three algorithms can be accessed from [30] directly.Likewise, FH+GDA gets best results among four algorithm in most instances.Due to the large scale of problems, FH+GDA only achieve better solution in two instances and improve FH slightly, since FH+GDA is executed in limited 60 seconds.

The computational results on problems with non-zero waste
Similar to [29], we apply the benchmark Beng [37] which includes ten small-scale instances (20 n 200) with fixed orientation constraint.The lower bounds of these problems are known but the optimal solutions are still not yet known.staircase algorithms were executed on a 3.0 GHz Pentium 4 computer with 1.0 GB memory with the time limit of 3600s.W denotes the width of the rectangular board in the table.From Table 5, we could clearly observe that three algorithms obtain the same height as the lower bounds, namely the optimal height for all the instances.However, FH+GDA is much faster than DHA, for all instances, the time of FH+GDA do not beyond 0.01s.

Conclusions
A hybrid algorithm based on a layer-based heuristic and a great deluge algorithm for the strip packing problem is presented.The proposed algorithm is able to solve the strip packing problem efficiently and further improve the packing results of FH.Extensive computational results show that FH+GDA can compete with meta-heuristics in terms of both solution quality and execution time.
FH+GDA is superior especially for large test problems.Therefore, FH+GDA may be of great practical value to the rational layout of the rectangular objects from the engineering fields, such as the wood-, glass-and paper industry, and the textile and leather industry.Future work is to further improve the performance of this algorithm and extend it to solve other packing problems.

Table 1 .
The results of BF+TS, BF+SA, BF+GA and FH+GDA on instances permitting rotation.

Table 2 .
The results of HRP, FH, DHA and FH+GDA on instances permitting rotation.

Table 3 .
The results of large-scale instances.

Table 4 .
The results of large-scale instances with fixed orientation.
[38]e 5reports the results achieved by the exact staircase algorithms[38], DHA and FH+GDA.The

Table 5 .
The results on problems with non-zero waste.