Abstract

This paper develops a hybrid demon algorithm for a two-dimensional orthogonal strip packing problem. This algorithm combines a placement procedure based on an improved heuristic, local search, and demon algorithm involved in setting one parameter. The hybrid algorithm is tested on a wide set of benchmark instances taken from the literature and compared with other well-known algorithms. The computation results validate the quality of the solutions and the effectiveness of the proposed algorithm.

1. Introduction

Cutting and packing are a very active field of research within operational research, computer science, mathematics, and management science. The two-dimensional cutting and packing problem is widely applied in optimally cutting raw materials such as glass, textile, steel, and paper and transportation and logistics fields. For example, in textile or glass industries, rectangular components have to be cut from large sheets of material. In warehousing, goods have to be placed on shelves. In newspapers paging, articles and advertisements have to be arranged in pages [1]. In order to raise the profitability of the manufacturing or logistics company, the consumption of the raw materials or the cost of transportation should be minimized. Obviously, if an enterprise designs a production scheme using the least waste raw material, it can reduce the manufacturing costs and increase the product’s competitiveness in the market.

The two-dimensional orthogonal strip packing problems (2SP) addressed in this paper consist of packing rectangular pieces into a large rectangular sheet of fixed width and unlimited height in order to minimize the used height, where the rectangular pieces are placed orthogonally without overlap and no rotations are allowed. This problem is of significance both from a theoretical and a practical point of view because it arises in various production processes and has many applications in the glass, steel, paper, and textile industries, and they also have indirect applications in other fields [2] such as layout designing, transportation, and logistics. More extensive survey and classification on cutting and packing problems may refer to Lodi et al. [1] and Wäscher et al. [3].

2SP is known to be NP-hard, some exact algorithms are proposed by Martello et al. [4] and Kenmochi et al. [5], but the size of instances that exact algorithms can handle tends to be small. Therefore, many heuristic algorithms have been suggested in the literature. Baker et al. [6] proposed a bottom-left-fill (BLF) algorithm for 2SP and variants of BLF [7]. Different types of construction heuristics have also been proposed recently, for example, the best-fit heuristic [8], a recursive heuristic [9], a bricklaying heuristic [10], a least waste heuristic [11], and a scoring heuristic [12].

In comparison to the literature on construction heuristic algorithms to packing problems, metaheuristic algorithms are paid more and more attention recently. Bortfeldt [13] proposed a genetic algorithm. The above two algorithms explore placements directly and allow infeasible solutions. However, most metaheuristic algorithms have been developed by incorporating a construction heuristic to improve the quality of solutions. Hopper and Turton [14] implemented a simulated annealing, tabu search, and genetic algorithm by incorporating BLF, respectively. Lesh et al. [15] proposed new heuristic and interactive approaches based on BLF for 2SP. Alvarez-Valdes et al. [16] presented a greedy randomized adaptive search procedure (GRASP) that involves learning some instances to determine the desirable parameter settings for 2SP. Wei et al. [11] presented a least waste algorithm by combining a simulated annealing algorithm for rectangle packing problem. Burke et al. [17] implemented a simulated annealing, tabu search, and genetic algorithm by incorporating BF. Leung et al. [18] proposed a simulated annealing algorithm based on a scoring rule heuristic. Some other algorithms based on different types of strategies have also been proposed, for example, SVC [19] and SWL [20]. Zhang et al. [21] developed a binary search heuristic algorithm based on randomized local search for the rectangular strip packing problem. In particular, an efficient algorithm for strip packing problem can be extended to solve other problems such as bin packing problem [22, 23]. In this paper, we present a hybrid demon algorithm for 2SP which combines a demon algorithm with local search and an improved heuristic. This paper mainly has three contributions: firstly, a new scoring rule is presented; secondly, a least waste strategy is proposed; at last, a demon algorithm with fewer parameters than simulated annealing algorithm is applied to solve 2SP.

The remainder of the paper is organized as follows. Section 2 describes the hybrid algorithm: an improved scoring rule and demon algorithm. Section 3 investigates the effect of the parameter of demon algorithm and the least waste strategy. Section 4 reports the experimental results. Section 5 summarizes the conclusions and proposes future work.

2. Hybrid Algorithm

2.1. Improved Construction Heuristic Algorithm

It has been reported that construction heuristic algorithm is one of the best heuristics while combining with a simulated annealing algorithm [18]. Construction heuristic algorithm is stated as follows: give a rectangle piece sequence, the algorithm finds an unplaced piece with the maximum score for the lowest and the most left space, and then place it. Repeat the above process until all the pieces are placed. Leung et al. [18] proposed the scoring rules as Table 1 which is very important to select one unplaced piece, where is the width of the available space and and are the height of the left and right, respectively, wall of the available space. and denote width and length, respectively, of rectangular piece , denotes the change number of spaces, and is fitness value as Leung et al. [18]. However, they do not explain why case (3) in Table 1 has higher score than case (4). In fact, the two cases have the same ; namely, the number of available spaces does not increase. Due to the fact that the objective of the problem is to minimize the height of the sheet, the result obtained by the scoring rule in Table 1 may be bad, while case (3) has higher score than case (4). For example, given a piece sequence: red, blue, yellow, and green, the packing result is shown in Figure 1, the yellow piece will be first placed according to the original scoring rule after the red piece and blue piece are placed, and then the green piece is placed as Figure 1(a), so the height obtained is 11. However, the height obtained is 9 if the new scoring rule is used that the green piece should be placed earlier than the yellow piece. The above example shows that the new scoring rule may lead to a better result than the original scoring rule. So the new scoring rule for as shown in Table 1 is used in this paper; for , the new scoring rule can be calculated similarly.

In addition, one piece is selected by case (4) in Table 1, and we can try to place it into the current available space ; if it leads to the waste of the remainder space, then find another piece with the maximal width from all the unplaced pieces that meets and can be packed into . For example, given a piece sequence: red, yellow, blue, green, black, and grey, the packing result is shown in Figure 2(a), the width of the current available space is 4 after the red, yellow, blue, and green pieces are placed, the black piece ( and ) is selected by the scoring rule, and after it is placed, the width of the remainder space is 2. If the width of all the unpacked piece is larger than 2, the remainder space will be wasted. The grey piece is placed after the black piece is placed. The height obtained is 13. However, the obtained height is 11 if we use the least waste strategy. Namely, we can find another piece ( and ) from all the unplaced pieces. Obviously, placing the piece makes waste least and obtains the smaller height. Similarly, if one piece is selected by case (5) in Table 1, and placing it leads to the waste of the remainder space, then find another unplaced piece with the maximal width from all the unplaced pieces that meets and can be packed into , where and denote the perimeter of the pieces and , respectively.

2.2. Hybrid Demon Algorithm

The simulated annealing algorithm (SA) was invented to allow computer simulation of equilibria in statistical physics. It is a powerful randomized search algorithm, and the computational results have shown that ISA [18] based on SA is the best algorithm for 2SP. However, SA has to set the initial temperature, the annealing rate, and the Markov chain length. These parameters have significant effect on the performance of SA, but they have no general setting rule. Therefore, some variants with fewer parameters are paid attention by some researchers.

Demon algorithm is a simulated annealing based algorithm that uses computationally simpler acceptance function. This paper applies demon algorithm for 2SP. In order to solve it, the hybrid demon algorithm can be stated as in Algorithm 1, where is similar to that in Leung et al. [18] and is stated as in Algorithm 2, where is the number of pieces, besth saves the best solution during the search process, and currenth is the height returned by . The process of is the same as that of Leung et al. [18] except that a new scoring rule and a least waste strategy are used. Line 14 means keeping the old sequence . is a key parameter that controls the acceptance function.

HDA()
(1) LS();
(2) give an initial value and ;
(3) while  the stop criterion is not yet satisfied  do
(4) for    to    do
(5)    randomly select two pieces and in ;
(6)    swap the order of pieces and ;
(7)     HeuristicPacking();
(8)    ;
(9)    if    then
(10)   ;
(11)   if    then
(12)    ;
(13)    ;
(14)   else
(15)     swap the order of pieces and ;
(16)randomly flip a coin;
(17)if  coin comes up heads  then
(18) sort all the pieces by non-increasing ordering of perimeter size to obtain ;
(19)else
(20) sort all the pieces by non-increasing ordering of width size and obtain ;
(21)return  ;

LS()
(1) sort all unpacked pieces by non-increasing ordering of length size to obtain X;
(2)  HeuristicPacking(X);
(3) for    to    do
(4)  for    to    do
(5)    swap the order of pieces and in and obtain a new ordering ;
(6)     HeuristicPacking();
(7)    if  then
(8)      ;
(9)      ;

HDA first searches a better solution according to a local search algorithm and then makes use of demon algorithm to improve the solution. Multistart ingredient (lines 16–20) is employed to help HDA to escape from possible local minima.

3. Effect of Parameter

HDA only involves in setting one parameter , so it is simpler than simulated annealing algorithm. This section gives some experiments to further select the value of . In order to add the effect of demon algorithm, we only use some small and medium instances to save more time for demon algorithm to improve the solution. Several difficult data sets NT, gcut, Nice1~6, and Path1~6 are selected because they contain zero-waste instances and nonzero-waste instances. Figures 3~5 give the results of demon algorithm on the above instances, where -axis denotes the different value of and -axis denotes the average gap over 10 runs. Although there exists some slight difference for different data sets, we note that Gap will increase as increases. Therefore, is selected for the experiments in next section.

Figures 6, 7, and 8 report the results of hybrid demon algorithm with and without the least waste strategy, where -axis denotes the problem instance and -axis denotes the average gap over 10 runs. From these figures, we can note that the results obtained by the algorithm without the least waste strategy are slightly better than that obtained by the algorithm with the least waste strategy for zero-waste data sets C. The algorithm with the least waste strategy can obtain the better results than that without the least waste strategy for nonzero-waste data sets. Because nonzero-waste data sets contain more instances, so we use the least waste strategy in the experiments in next section.

4. Experimental Results

In this section, we present the results obtained in a set of experiments we conducted in order to evaluate the performance of the hybrid demon algorithm (HDA) proposed in this paper. This paper uses the same data sets C, N, NT and CX, 2sp, BWMV, Nice, and Path as Leung et al. [18]. All the data sets are publicly available at http://algorithm.xmu.edu.cn:10000/Download.aspx#p4. These data sets include zero-waste instances and nonzero-waste instances from the literature. Zero-waste instances were created from known optimal solutions, and nonzero-waste instances do not necessarily have an optimal solution and their optimal solutions involve some waste regions.

The algorithm was implemented in Visual C++6.0 and the experimental tests were run on a computer with an Intel core 2 CPU 2.13 GHz and 0.99 GB RAM. GRASP [16], SVC [19], and ISA [18] are among the supposedly excellent algorithms in the current literature, so they are selected to compare with HDA. Computational results of GRASP, SVC, and ISA were taken from Leung et al. [18]. They were run on a computer with Intel Xeon CPU E5405 2.00 GHz 1.99 GB RAM and were run 10 times with a time limit of 60 seconds per run for each instance. HDA was allowed 60-second duration too. The computational results are reported in Tables 2~9, where Instance denotes problem instance, is the number of rectangular pieces, is the width of the rectangular sheet, LB is the optimal height for zero-waste instances and is the lower bound for nonzero-waste instances, and denotes the average height obtained by each algorithm, running 10 times for each instance, respectively. Gap is defined as follows: . The detailed results on the best and worst cases are available from the authors after this paper is published.

4.1. Zero-Waste Instances

Tables 2~9 report the results of four algorithms on zero-waste problem instances. In each table, the best results obtained by four algorithms are marked by boldface. The first four columns describe the characteristics of each instance. Columns 5~8 correspond to the average height obtained by GRASP, SVC, ISA, and HDA, respectively. Columns 9~12 correspond to the Gap obtained by GRASP, SVC, ISA, and HDA, respectively.

Table 2 shows the results of four algorithms for the data set C [14], which have been used by many authors. From Table 2, GRASP, SVC, and ISA return an average gap of 0.95, 1.03, and 0.76, respectively. HDA with an average gap of 0.71 performs better than GRASP, SVC, and ISA. In addition, we can observe that HDA performs well for large instances.

Table 3 shows the results of four algorithms for the data set N generated by Burke et al. [8]. From Table 3, GRASP, SVC, and ISA return an average gap of 0.95, 0.63, and 0.41, respectively. HDA with an average gap of 0.32 performs better than GRASP, SVC, and ISA. What is more, the optimal solution of N13 is obtained by ISA and HDA.

Table 4 shows the results of four algorithms for the data set NT, which is generated by Hopper and Turton [14]. From Table 4, GRASP, SVC, and ISA return an average gap of 2.32, 2.27, and 2.24, respectively. HDA with an average gap of 1.91 performs better than GRASP, SVC, and ISA. In addition, we can observe that HDA performs the same or better for large instances n7a~e and t7a~e.

Table 5 shows the results of four algorithms for the extra-large data set CX, which is generated by Pinto and Oliveira [24]. From Table 5, GRASP, SVC, and ISA return an average gap of 0.88, 0.57, and 0.88, respectively. HDA with an average gap of 0.61 performs better than GRASP and ISA and slightly worse than SVC.

4.2. Nonzero-Waste Instances

Section 4.1 has discussed the results on the zero-waste instances with known optimal solutions. In some practical applications, the optimal solutions often include some wasted regions. So nonzero-waste instances are more general and are widely used in the literature. We can compute the lower bound of these instances, and the optimal solutions of some instances are known because they are confirmed by other algorithms. In this section, we investigate if HDA can still be successfully employed to solve such instances. Tables 6~9 summarize the computational results on nonzero-waste instances.

Table 6 shows the results of nonzero-waste data sets 2sp which include ngcut [25], gcut [26], cgcut [27], and Beng [28]. The problem size of 2sp is very small; namely, is less than 200, so it is used by many authors to test the performance of the algorithms. From Table 6, GRASP, SVC, and ISA return an average gap of 2.68, 2.8, and 3.02, respectively. HDA with an average gap of 3.04 performs slightly worse than GRASP, SVC, and ISA. However, HDA can obtain smaller average meanh 1538.16 than GRASP, SVC, and ISA, so HDA is still efficient for 2sp.

Table 7 shows the results of nonzero-waste data sets BWMV which include C01~C06 [29], C07~C10 [30]. The problem size of BWMV is very small (), so it is used by many authors to test the performance of the algorithms. From Table 7, GRASP, SVC, and ISA return an average gap of 1.77, 1.80, and 1.66, respectively. HDA with an average gap of 1.63 performs better than GRASP, SVC, and ISA. So HDA is superior to GRASP, SVC, and ISA.

Table 8 shows the results of data sets Nice and Path which are floating-point data sets and are generated by Valenzuela and Wang [31], where Nice1~Nice5t are the sets of similarly dimensioned pieces and Path1~Path5t are of vastly differing dimensions. Nice and Path are regarded as nonzero-waste instances because the integer data are obtained by multiplying the original data by 10 and rounding to the nearest integer [16]. Nice and Path are more difficult because the optimal solutions of many instances are not known. From Table 8, GRASP, SVC, and ISA return an average gap of 1.65, 0.96, and 0.72, respectively. HDA with an average gap of 0.63 performs better than GRASP, SVC, and ISA. HDA performs the same or better for 65 out of 72 instances, so its advantage is very obvious.

Table 9 reports results of large data set ZDF which is generated by combining zero-waste and nonzero-waste data [12]. ZDF includes several extra-large instances ZDF14~16 (). Generally, it is very difficult to obtain the optimal solutions of ZDF14~16 within a reasonable time. The symbol “—” denotes that the GRASP executable program cannot return the results, so its average gap is not given. From Table 9, we can observe that SVC and ISA return an average gap of 5.34 and 2.67, respectively. HDA with an average gap of 2.62 performs better than SVC and ISA. ISA and HDA perform well for large instances.

5. Conclusions

A hybrid demon algorithm for 2SP is presented in this paper. This algorithm improves the scoring rule presented by Leung et al. [18] and a demon algorithm with one parameter is used to improve the quality of the solutions. Computational results have shown that HDA outperforms well-known GRASP, SVC, and ISA. The experiments in Section 3 show that HDA is more stable and efficient for different value. HDA performs well for large instances; future work is to further improve the quality of the solutions by combining exact algorithms or other metaheuristic algorithms.

Conflict of Interests

The authors declare that there is no conflict of interests regarding the publication of this paper.

Acknowledgments

This work was supported by the National Nature Science Foundation of China (Grant no. 71272085).