A New Genotype-Phenotype Genetic Algorithm for the Two-Dimensional Strip Packing Problem with Rotation of 90o1

Given a set of rectangular pieces and a fixed width with infinite length, the strip-packing problem (SPP) of two dimensions (2D), with a rotation of pieces in 90° consists of orthogonally placing all the pieces on the strip, without overlapping them, minimizing the height of the strip used. Several algorithms have been proposed to solve this problem, being Genetic Algorithms one of the most popular approach due to it effectiveness solving NP-Hard problems. In this paper, three binary representations, and classic crossover and mutation operators are introduced. A comparison of the three binary representations on a subset of benchmarking instances is performed. The representation R2 outperforms the results obtained by representation R1 and R3. Indeed, some of the best-known results found by previous published approaches are improved.


Introduction
Strip Packing Problem (SPP) is derived from cut and packing problems, and is considered as NP-Hard due to its combinatorial difficulty [1]. This problem can be found in productive industries, where the optimization of raw materials is converted into economic benefits by reducing production costs [2]. The SPP considers two cases: two-dimensional and three-dimensional. Even though threedimensional cases are often more attractive for the research community due to their practicality, two-dimensional cases have achieved significant advances in algorithmic approaches and size of the solved instances, increasing high number of elements [3]. In particular, the two dimensional Strip Packing Problem (2D-SPP) is defined as a rectangular region with a width W and infinite height, where all the rectangular pieces i ∈ I = {1,2,..., n} with defined width W and height h i , must not overlap and could be rotated 90°. The goal of this problem is to minimize the obtained height H of the strip by positioning all the pieces over it [4]. The 2D-SPP has been mathematically formulated in [5]. The 2D-SPP requires that n rectangles must be placed minimizing the height of the strip H. If we consider the Bottom Left corner of the strip as the origin of the region of the plane xy, x should correspond to the width of the direction of the region, and y to the direction of the height. Moreover, the location of every rectangle on the strip would be represented by a coordinate (x i , y i ) from the bottom left corner. The set of coordinates p = {(x i , y i ) ∨ i ∈ I} is denominated a placement of I. The 2D-SPP can be formulated as follows: The set of constraints (2), (3), and (5) ensure that all of the rectangles must be placed within the strip with width W and height H. Finally, constraints (4) prevent that rectangles are overlapped.
Several methods for the solution of the 2D-SPP have been proposed. In [6], a Branch-and-Bound algorithm for getting a lower bound by relaxation for the 2D-SPP is proposed. In [7], canonical forms for the SPP, with and without rotation of pieces, are considered. In addition, geometric constraints have been considered in order to reduce the search space. In [8], another exact algorithm to solve subproblems represented by g-staircase placements, without the consideration piece rotation, is proposed.
In order to improve computational times and to solve large size instances, several heuristics have been developed to find good-quality solutions, closer to the optimal ones. In [9], a quasi-human heuristic for the solution of benchmarking sets of instances for the SPP is proposed. In [8], a two-stage intelligent search algorithm, where the second stage is based on a Simulated Annealing approach, is proposed. In [10], a skyline-based heuristic is developed, which corresponds to an approach proposed for indicating the height of the strip supported by a Tabu search procedure to generate different order sequences that indicate the order of placement into the strip.
Two algorithms based on Tabu Search approach have been proposed in [11] and [12]. In [11], a Tabu search procedure is proposed, which considers intensification and diversification procedures to improve the search on the solution space. In [12], a Tabu procedure is proposed, which considers an evaluation function to quantify the empty spaces and the logic of the problem along with an interesting search strategy on the neighborhoods by using a placement heuristic.
Another work using metaheuristics based on trajectory for the SPP is proposed by [13]. In this work, an approach based on Simulated Annealing is developed, using Bottom Left and Best fit placement algorithms. This algorithm proposes a digital coding of the pieces for the addressed problems.
In [2], a greedy algorithm (Reactive GRASP) uses several strategies on the construction of initial solution and improvement stages with different parameters, where they repair infeasible solution without description of procedure of local search. The hybridization of a heuristic (Fast heuristic) with a Simulated Annealing approach, proposed by [8], is also an interesting work. In it, 683 benchmarking instances have been solved, obtaining several best results in comparison with three published algorithms of the literature (SW [14], GRASP [2] and SVC [15]).
The obtained results of [14] have been improved by a randomization proposed by [16]. Genetic Algorithms (GA) has been used widely for solving Strip Packing Problems. These approaches simulate the theory of evolution being part of the Evolutionary Computation [17].
In [18], a Genetic Algorithm is proposed. For this the representation consists of swapping an integer chain that describes the placement order of the pieces into the strip followed by an approach that locates them on the strip by using a Bottom Left algorithm [19]. The evolutionary process requires of crossover operator PMX [19] and an Order-Based mutation [20], [21]. In [22], a Genetic Algorithm that requires specific operators to perform crossover and mutation stages is proposed. Due to the type of representation used by Genetic Algorithms, the operators are forced to repair infeasible solutions that emerge during evolutionary process, altering Darwinian evolution principles [23]. Finally, different algorithms have been proposed for different SPP variants by several authors [24]- [30].
In this paper, a classic Genetic Algorithm with a genotype-phenotype approach [31] is used to solve the 2D-SPP with rotation of 90°. In particular, a binary string and the phenotype of the placement of the pieces into the strip are used. In order to reduce computing times, our algorithm has been parallelized by using an island hybrid model and a master-slave with shared memory [32]. Three binary representations are presented allowing the diversification of the search space [33]. We note that there is a direct relation between the used bits on every representation with respect to the size problem. The obtained results over two benchmarking sets show that the proposed approach is able to obtain 64% of the Best-Known results. However, given the nature of the former algorithm and how close the obtained results are to the lower bounds, it was not possible to find better solutions.
In the following section of this paper, the binary representation used is described; while in the third section, computational results are introduced and discussed. In the last section, conclusions are presented.

Materials and Methods
In the following section, we introduce evolutionary process, a description of every representation used, and the placement algorithm.

Evolutionary Process
This paper proposes a Genetic Algorithm, which operates in a genotype-phenotype mode. As a genotype, a binary string b is used. The genotype specifies the order of generation of the previous defined phenotype. The phenotype has the responsibility of decoding b. Finally, a placement algorithm allows the location of the pieces on the strip, representing individuals' phenotype for each generation as is shown in Figure 1. Initially, a starting panmictic population, which is composed of a constant amount of individuals, is proposed. In this population, each individual corresponds to a potential feasible candidate of the problem. The population corresponds to the complete search space. A binary coding that corresponds to the genotype representation of each individual of the population is used. Each individual is evaluated by a fitness function (corresponding to the height of the strip).
Once all the individuals have been evaluated by the fitness function, the proposed algorithm selects and matches them. This process is done by a tournament selecting two individuals. The individuals are combined by a point crossing process generating a new individual. Each new individual is modified by a mutation process changing some elements of its chromosome. Finally, individuals that will be part of the new generation are selected. The pseudocode of the proposed algorithm is shown as follows: Additionally, a parallelism hybrid model has been applied. This approach allows splitting the population into several individuals, generally corresponding to the number of available units of the used computer, which execute the evolutionary process independently. In addition, every Ngen iterations migrates γ of the best individuals of their population according to the fitness value, i.e. the height of the strip. This process is performed by a Genetic Algorithm operating as coordinator for combining the obtained solutions of each part of the population. The proposed algorithm keeps the same number of individuals in each evolutionary process. The previously described scheme is shown in Figure 2.

Representation R1
This paper uses a first binary representation, where each individual's genotype is b and Length L. Let be L the number of n pieces of the problem and ϕ = [log 2 n]-1 a dimension of set of bits. L could be calculated as follows:

Representation R2
The second binary representation consists of splitting b into n segments, where each one is numerated as {n, n -1, ...1} and corresponds to the coded piece. Each segment is split in three parts from left to the right. The first part of one bit length indicates that, if the piece has value 1, it is rotated. The second part, of one bit length, corresponds to the reference position indicating the sense of genotype codification. If it has value 1, the piece is positioned at the beginning of J. If it has value 0, the piece is positioned at the end of J. The last part is composed by a set of bits and represents the value of units of displacement in J without the consideration of the θ pieces in the displacement. An example of representation R2 is shown in Figure 4. Note that the size of every segment is given by the number of remaining pieces to be identified. The number of remaining pieces decreases when the reading of the structure continues. The length of each segment i is calculated as

Representation R3
The third binary representation is given by a set of n segments of dimension [log 2 n] + 1 bits, where each one is split, from left to right, into a bit that determines if the piece j is rotated and [log 2 n] bits the position to be occupied by θ ( Figure 5); according to the obtained value of the complete conversion of the segment [log 2 n]. If the value associated to j is 1, the piece must be positioned in θ. If the piece cannot be found, the algorithm uses the following available piece. The length b is calculated as follows L = n • ([log 2 n]) + 1.

Phenotype Generation
We have checked the heuristics Bottom left and Best fit, with and without the consideration of order by area. The algorithm with the best performance and effectiveness was Best-fit, used in [34], where the entrance of the pieces corresponds to ∧. In addition, we have not considered the first placement of every piece in order to preserve the evolutionary process. The pseudocode to evaluate Best-fit is the following:

Computational Results
Experiments have been performed on an AMD Opteron(tm) Processor 4386 with 32 GB RAM and GNU/Linux Ubuntu 14.04.2 LTS. The proposed algorithm has been coded in C language. For the parallel population implementation, openMPI was used. Two groups of instances are used, which were proposed by [13] and [33].
As long as the evolutionary process continues, better individuals are generated until reaching final stages with a convergence to populations that have diverse quality individuals. Most of these individuals have a fitness value (height of the strip) close to the best value population. Figure 6 presents an evolutionary process for a typical case for the N6 problem proposed by [33]. In the axis y, fitness value is presented, while that in the axis x the generation number is shown.
In this case, randomly generated population obtained fitness values between 17 and 100. The fitness value for the best individual becomes close to the Best-Known solutions. From generation 119, the fitness value for the average and the best solution are close to each other ( Figure 6). For instance N12, the best individual, was found on generation 101. Note that the curve for the worse individual during the process shows that, for each generation, few groups of individuals with fitness value between 15 and 45 are considered. This process occurs because of the crossover operator that makes the changes out of the first chromosome segment, making these individuals being different in their genotype in comparison with their ancestors. Therefore, it implies that its phenotype is poor with respect to the solution quality.

Parameters Calibration
Parameters calibration is a relevant phase for the experiment design of the proposed algorithm [34]- [37]. For the calibration process, some tests were conducted with a subgroup of instances [38] by considering several levels of crossover (65%, 75%, 85%, 95%), mutation (10%, 15%, 20%, 25%, 30%), and population size (500, 1000, 1500, 2000, 2500, 3000, 3500). The amount of generations to evaluate is set by using the methodology described in [38]. The calibration tests were performed individually for each solution representation, in which the obtained results were analyzed for each combination of parameters. The best parameters used for executing all the computational experiments are shown in Table 1. The representation R2 has obtained the best results respect to the Best-Known solutions (see section 2.2). In addition, R2 requires less number of generations but needs more bits for representing a solution. A solution could be represented in several ways by R2. Figure 7 shows the ideal value of the difference between number of pieces and bits.

Analysis of Results
In Table 2, the results obtained on the benchmarking set proposed by [13] are shown. The first compound column of Table 2 corresponds to the problem being considered (instance). The second column corresponds to the Best-known solution (optimal solution H*). Columns 4 to 14 correspond to the results obtained by algorithms SPGAL [22], GRASP [1], MGA [36], CTS [12], CJ+EA [37], FH [8], SW [14], and BFBCC [38]. The following columns show the average and the best results with their corresponding computing times of 10 runs for each instance. Note that we report the obtained results for the three used representations (R1, R2, R3). The value of GAPH is calculated as the difference between best solutions found by all the representations of the proposed approach and the best solution found by SPGAL [22], GRASP [1], MGA [36], CTS [12], CJ+EA [37], FH [8], SW [14], and BFBCC [37]. The value of Error corresponds to the percentage obtained by the value of GAPH over the best solution found by the previous published approaches. Note that the proposed approach is able to obtain the best-known solution for instances C1 to C5 (62% of the complete set). For the remaining instances, the value of Error is less than 3% confirming that the calibration process improves the performance of the proposed approach. Regarding the computing time, the former algorithm obtains values lower than 90 seconds for large size instances. The second representation R2 outperforms the obtained values by R1 and R3 for the subsets of the instances.
In Table 3, the results obtained for the second set of instances proposed by [33] are shown. The results are compared with algorithms GRASP [1], HA [39], QHH [9], FH [8], SW [14], and BFBCC [37]. The last columns show the best values and the corresponding computing times f of 10 runs for each instance, and the value of GAPH and Error. Representation R2 again obtains the best numerical results achieving a 67% of the Best-Known solutions. The value of the highest deviation obtained respect to the Best Known solutions is only 8%. The numerical results provide a GAPH of only 2.94%, 2.02%, and 1.57% respect to the Best-Known Solutions.    Table 3. Results obtained for instances proposed in [33]

Concluding Remarks
This paper proposes three binary representations of genotype-phenotype (R1, R2, R3) within an efficient Genetic Algorithm for the two-dimensional Strip Packing problem with rotation of 90 o . A parallel implementation of the former algorithm is proposed. The essence of Darwinian Evolution has been preserved, without altering the evolutionary process. The obtained results show the effectiveness of the proposed approach. The proposed approach is able to obtain, on average, 67% of the Best-Known solutions. As a further work, it is intended to use another phenotype generation in order to improve the quality of the solution.