A Parallel Biased Random-Key Genetic Algorithm with Multiple Populations Applied to Irregular Strip Packing Problems

The irregular strip packing problem (ISPP) is a class of cutting and packing problem (C&P) in which a set of items with arbitrary formatsmust be placed in a containerwith a variable length.The aimof thiswork is tominimize the area needed to accommodate the given demand. ISPP is present in various types of industries frommanufacturers to exporters (e.g., shipbuilding, clothes, and glass). In this paper, we propose a parallel Biased Random-Key Genetic Algorithm (μ-BRKGA) with multiple populations for the ISPP by applying a collision-free region (CFR) concept as the positioning method, in order to obtain an efficient and fast layout solution. The layout problem for the proposed algorithm is represented by the placement order into the container and the corresponding orientation. In order to evaluate the proposed (μ-BRKGA) algorithm, computational tests using benchmark problems were applied, analyzed, and compared with different approaches.


Introduction
The large market dispute between manufacturing and exporters, coupled with the scarcity of some items that make up the raw material for a product manufacturing, has motivated research around the world to find answers that reproduce efficient solutions at a low cost.
Cutting and packing (C&P) problems belong to NP-hard [1].A dataset of items must be packed in a two-dimensional stage and an objective function can be analyzed through the minimum area needed to place pieces or the maximum number of items allowed in a current layout.Our research focus is on a particular C&P problem commonly referred to as the irregular strip packing problem (ISPP).
Furthermore, according to the typology of [1], the ISPP has an open arbitrary dimension classification.A variation of C&P can be described as a container () with a constant width () and a variable length () and a dataset of irregular polygons, where the objective is to minimize  and place (with no overlaps) the entire demand into .In some cases all angles to rotate polygons are accepted; in other cases only some angles are allowed to rotate the polygons.Figure 1 illustrates a classical instance of this problem known as Trousers [2].
Various studies have been devoted to obtain solutions (layouts) that minimize surface area and computational time.However, despite the many proposals that have been presented, the analysis of further strategies to obtain improved layouts is still pertinent.Some examples of strategies are as follows: (i) A positioning rule must be applied to the list of parts (ii) A precise layout is accepted as the initial solution, and overlapping of items is valid, but a penalty is applied to the objective function (iii) A set of clusters between parts is performed in the preprocessing phase to reduce the complexity of the fit among the parts (iv) Other mathematical programming models.
The approach proposed here was a parallel computing implementation of the Biased Random-Key Genetic Algorithm (BRKGA) [3] using multiple populations applied to an ISPP.Each solution develops a sequence in which the pieces are positioned in the container.The current angle and the method of placement applied was based on a collisionfree region [4].Computational tests carried out on dataset examples of the target problem are discussed, and the method presented here is shown to be compatible with or better than some other important studies.This paper is structured as follows.Section 2 presents some studies about ISPPs and their different approaches to solve them.Section 3 introduces important concepts associated with the suggested methodology, which is presented in Section 4. Documentation concerning computational tests on well-known literature datasets is given in Section 5. Finally, in Section 6 the conclusions concerning the proposed methodology are presented along with some suggestions to develop this work further.

Approaches to Tackle Irregular Strip Packing Problems
ISPPs are a challenge since they present obstacles for the construction of feasible and optimized solutions.Among these are the geometric aspects of the polygons and the combinatorial characteristics for quality layouts.These two obstacles must be managed concomitantly.In addition, an estimate of the computational complexity of each approach must be measured to serve as a criterion to select the methods for the planning phase in algorithmic projects.Various mathematical programming models have been developed to provide feasible solutions for ISPPs [5,6].Although there are still constraints for industrial scale applications, due to combinatorial characteristic optimization, among other factors, the entire computational concept arising from this type of strategy introduces a theoretical foundation of great importance to research in this area.
For instance, in [7], the authors presented a model based on constraint logic programming (CLP) adapted to ISPPs.Also, this strategy was applied to convex and nonconvex polygons.The concepts of NFP and IFP were used to satisfy the geometric constraint of overlap and to show the domain of the positioning of the first item.The composition of the layouts, using the fit patterns, adopts a CLP model with variables within a finite domain.The width, the upper boundary of the stage place, and the geometry of the pieces from the dataset compose the initial variables of the proposed model.Once the initial settings are defined, the approach has a layer that manages the constant changes in the variable domains.Moreover, it handles the consistency of the process.
On the other hand, the authors in [8] presented a mixed integer linear programming (MILP) approach to ISPPs based on the work of [9].The aim was to maximize efficiency while minimizing the length needed for the layout.Another aim of the objective function was that all the pieces must still be as near as possible to their origin position, as if compacted.This process is carried out by minimizing the coordinates of the reference points of each polygon.The objective function calculation does not consider the wastage and holes between the items.All tests were made for cases in the garment industry, and the model runtime was just a few seconds.
Likewise, in [10], the authors also proposed an MILP; however, the decision variables, in this case, are binary and are associated with each discrete point present on board, a nomenclature for the container.An outstanding advantage of this model is its flexibility to tackle the geometry of the items and the container and therefore allowing an extension to more complex problems.For instance, this approach can be applied to nonconvex boards and items with holes.On the other hand, there is a limitation on the number of parts to run in a feasible time.
Another model based on CLP was presented by [11].The researchers reported constraints aiming to ensure all feasibility requirements to achieve a solution.By changing the definition of the variables, which have a binary domain, this approach diverges from the models referred to by [7,12] which can be applied to the problem with fixed containers.
Nevertheless, methods from various fields of computational science, such as the concepts of metaheuristics and dynamic programming, have been applied to produce feasible solutions for ISPPs and to reduce their computational times.Several approaches in the literature have considered these concepts in order to obtain estimates for their use in real cases [13][14][15].However, this type of strategy leads us to a thorough investigation of the calibration parameters.
In the field of metaheuristics, Jakobs [16] exposed an approach that combines a genetic algorithm and a Bottom-Left (BL) strategy as a constructive heuristic for the positioning of items.The chromosome coding was mapped as an ordered sequence of parts, also applied by [17,18].On the other hand, in [19], the authors used the same idea, but a raster representation for the pieces.
Incidentally, in [20], the authors proposed a probabilistic heuristic known as 2-exchange as a parameter Δ to control the change between neighbors items.This feature coordinates the size of the search between the neighborhoods by assigning the maximum amount of permutations between items in a complete sequence.Also, the authors used an NFP-based mechanism to position pieces in spaces left empty by the solutions.Furthermore, in [21] these authors presented a new constructive heuristic based on the BL with the characteristic to fill empty spaces in the layouts, innovating one of the biggest limitations of the traditional method.The translation of the items begins on the Bottom-Left side, and the horizontal sliding is done discretely, from a point inside a grid, while vertical movement is performed in continuous space.So, it determines the valid positions; the NFP algorithm was applied.This technique is combined with hill climbing and a tabu search.
Another strategy was developed by [4].In this paper, the approach was divided into two steps, aiming to obtain efficient solutions for ISPPs.The initial stage consists of the Simulated Annealing algorithm, considering the dimensions of a container as being fixed.The initial solution is randomly generated, the sequence of positioning items is represented by integer values as well as the permissible rotations for each case, and the location point is an ordered pair of real numbers within the interval [0, 1].
At the last level, the control over two attributes of the approach is performed: the value of the size of the container dimensions and the initial temperature applied Simulated Annealing (SA).As soon as a layout is found, at the end of the first stage, this level reduces the area and restarts the SA process.If no solution is found, the container length is increased and the initial stage restarted.Also, two parameters are used to manage compaction and expansion, respectively, of the container.The authors of [22][23][24] applied the same idea as this approach but used a method of relaxed positioning method with the aim of minimizing the amount of overlap between the pieces.
Techniques that combine models in mathematical programming and artificial intelligence strategies are also possible.These approaches are known as hybrids and, similarly, several studies have investigated their results and limitations.
For instance, in [7], the authors proposed an approach that differs from others by not requiring a positioning rule.A discrete container and a CLP model was adopted, and the objective function was to find the best point of placing, besides the current fixed solution.
In [25], a Simulated Annealing (SA) was combined with a linear programming model.First an initial layout is obtained by applying the Bottom-Left method, and each piece is selected according to a length-based criteria.The SA guides the search over the solution space where each neighborhood structure handles linear programming models, which is composed of a compaction and a separation algorithm.
Another combination between local and guided search applied to two-and three-dimensional items was proposed in [24].The Bottom-Left method finds an initial layout length.By reducing this value, there are overlapping situations, which are removed by a local search through one of the following changes: horizontal and vertical translations, rotation, or flipping.The guided local search is adopted to try escape of solutions in local minima.Another outstanding aspect is the computational complexity.Given a simple polygon with  vertices and a set of  edges, the algorithm can find the translation with the minimum number of overlays in ( log()).
Also, an extended local search algorithm based on nonlinear programming is designed in [23].The procedure starts from a feasible layout, and its length is set as best.Then a new layout is obtained by random exchanges between two polygons at the current solution.Through a time limit, the length is reduced, and a local search manages the overlap subproblem.
The approaches presented in this section were divided into three distinct categories as [26] mathematical programming, metaheuristics, and mixed strategies.For our research, we adopted a Biased Random-Key Genetic Algorithm (BRKGA) applied with multiple parallel populations to tackle ISPP.

Supporting Concepts
Before discussing the proposed algorithm, we need to describe some supporting concepts.These concepts are geometric representations; no-fit polygon (NFP), and Inner-Fit Polygon (IFP); collision-free region (CFR); and Biased Random-Key Genetic Algorithm (BRKGA).

Geometric Representations.
The geometric representation of nesting problems is an important choice to obtain feasible solutions and will impact directly on the availability of geometric tools that can be used to perform the overlap detection in the layout.The problem aspect depends on the adopted representation.The impact of choice depends on the accuracy of the overlap detection, on the memory requirements needed, and on the computational performance to execute the approach.There are two basic types of representation for polygons: raster or geometric (Figure 2).
Raster representation uses a matrix to describe the geometry of an item.This matrix is obtained from the definition of a default size grid.A grid position that has some internal region of the item is marked with a different value.The rasterized representation has the advantage of being able to represent generic geometry items, and there are simple geometric tools to deal with overlaps.However, if the grid resolution is low, the shape of the object may be different and change a solution.But if the resolution of the grid is high, the computational cost to find overlaps is expensive.
Moreover, polygonal representation uses polygons to represent the items.A list of bidimensional vectors containing the coordinates of vertices is applied to compose the shape of the item.Sometimes, the items cannot be represented in their exact form; in these cases, an approximation of vertices is applied.The geometric calculations to overlap detection are complex.Due to their precision, several approaches in literature use polygonal representation.
There are other representations.However, there has been little research with them.To typify the pieces that need better points precision, linear or nonlinear functions can be applied (phi-functions).This representation strategy is the mathematical expression obtained from the distance equation between two objects.They were first presented and applied by [27].The combinations of primary objects serve to compose complex ones.
The ISPP demands a suitable geometrical representation when continuous rotations are necessary for a set of pieces.In these cases, pieces can be represented by circles (Circle Covering) [28].Due to the irregular pattern of pieces, the circle representation, of the problem in case, needs to agree with an approximation of polygons.[29] as a shape envelop and changed to NFP by [30].The idea behind this

No-Fit Polygon (NFP) and Inner-Fit Polygon (IFP). This trigonometric technique was presented in
y (iii) If   stays outside NFP (,) then   does not intersect or touch   .
In our implementation, all possible NFPs are computed in a preprocessing level applying the Minkowski sum [31] method and polygon decomposition is based on [32].Given two arbitrary point sets,  and , the Minkowski sum of  and  is represented as  ⊕  = { + :  ∈ ,  ∈  }.A simple vector algebra can be applied to show that  ⊕ (−), known as the Minkowski difference of  and , is equivalent to NFP (,) since a stipulation that polygons stay in counter-clockwise orientation, −, is simply  in a clockwise direction.
The concept of NFP as described is applied only for convex polygons.However, the application of decomposition in nonconvex polygons normally constructs several subpolygons, and consequently many no-fit polygons must be created.In computational times, a unique no-fit polygon intersection is fast, but an additional calculation must be considered to recombine all decomposed parts.Therefore, if a large number of parts are needed or the polygon contains holes, the time to complete this operation is expensive.
In [33], the authors analyzed different decomposition and applied recombination operations to construct the Minkowski sums of nonconvex polygons.The first inference Reference points NFP (P i , P j ) is that the computation times to find optimal decomposition does not compensate the possible benefits that may occur in the recombination process.
In [34] the author presented an approximation algorithm which takes ( log ) time and () space, where  is the vertices number of the input polygon and outputs a decomposition whose size is guaranteed to be no more than four times the size of the optimal decomposition.
As observed in [32], the authors proposed an efficient heuristic for decomposing a polygon into convex subpolygons.The algorithm works this way.Initially, it tries to subdivide the polygon by connecting two reflex vertices with an edge.When this is not possible anymore, it eliminates all reflex vertices by connecting them to other convex vertices, such that the new edge best approximates the angle bisector of the reflex vertex.The algorithm operates in ( 2 ) time and takes () space in the worst case, where  is the number of vertices of the input polygon.
The Inner-Fit Polygon (IFP) [20] is similar to the NFP except that the orbiting polygon, in this case, slides around inside the stationary polygon.The IFP represents a set of points that allow the placement of a polygon inside a hole of another polygon, usually the container.Approaches to tackle NFP can be adjusted to handle IFP.If the outline of the IFP is a rectangle, the IFP is called Inner-Fit-Rectangle (IFR).This happens when generating the IFP from the container, since it is, most of the time, a rectangle.An IFR can be seen in Figure 4.

Collision-Free Region (CFR).
The collision-free region (CFR) is a geometric procedure that allows the feasible position points of a piece inside the strip to be found, efficiently.This technique was developed to plan robot motion in order to present the shortest path without hitting any obstacle.In [4], the CFR was adapted to tackle the irregular strip packing problem using a polygonal Boolean operation.Consider a stage  and a next piece in sequence .The CRF (,) is composed of the polygon difference (Figure 5) between ( 1) and (2) described next: In ( 1), the Inner-Fit Polygon between  and piece  is computed to find a polygon that represents all available points inside .In the other equation ( 2), the resultant polygon is composed of a union between the NFPs of  and each piece already placed   .The basic case occurs when the stage is empty; then CFR (,) = IFP (,) .

Biased Random-Key Genetic Algorithm (BRKGA).
The Biased Random-Key Genetic Algorithm (BRKGA) is an evolutionary metaheuristic for discrete and global optimization problems based on [35].Each solution is considered as a list of float numbers in the interval [0, 1], called random keys.
The initial population is generated with  vectors of random keys.This procedure is the starting point of the BRKGA method [3].In all iterations, two subvectors are created, the set containing high-valued solutions (elite) and the residual individuals (nonelite).The best elements (elite) are transcribed, similarly, to the next population.A small number of random-key vectors (the mutants) are added to the population of the next iteration.The remaining elements of the population of the next iteration are generated by combining with the parameterized uniform crossover of [36], pairs of solutions, where one is elite and the other not.
The main difference between BRKGA and RKGA is the way that the operator of choice and crossover are implemented.In the RKGA procedure both parents are chosen from the entire population and in BRKGA one parent is always selected from the elite set, while the other is chosen from the nonelite (or, in some cases, the rest of the population).Both algorithms combine parents with uniform crossover based on [36], but in BRKGA, one parent belongs to the elite while the other is in the nonelite group.Figure 6 illustrates the evolutionary process for each new population with TOP, REST, and BOT parts of found individuals.
Furthermore, a BRKGA to ISPP was developed by [39], but in this work, the researches applied a BL heuristic to the positioning items and presented an NFP-raster at a grid model introduced by [10].Each individual is mapped by a chromosome with  alleles, containing keys with real values in the interval [0, 1).The rotation of the pieces is verified by its corresponding key in the initial vector.Considering that each polygon has  allowable angles, the domain gap of the variables is divided into the same  subintervals.

Proposed Methodology
In the -BRKGA heuristic, a chromosome is mapped as a list  = { 1 ,  2 , . . .,  2 }, where  is the total number of pieces to be placed representing an initial solution.A dataset piece number and orientation stand for each gene.Any chromosome contains  genes, which are the total number of items to be packed.The variables  1 ,  2 , . . .,   determine the Item Packing Sequence (IPS) and  +1 ,  2 , . . .,  2 correspond to item packing angle (IPA).All alleles are set in ascending order.
The positioning rule applied to -BRKGA is based on the concept of the collision-free region [4] and, therefore, the evaluation considers the minimization of the length for the layout produced for each individual, as well as the maximization of the utilization.For instance, Figure 7 illustrates the procedure applied in a dataset with 5 items.
The positioning rule process receives a decoded vector as input in an ascending order according to the allele key.The CFR polygon is computed for all pieces at IPS rotated by their corresponding IPA.In Figure 7(a) the first piece, stage () is empty, so CFR( 1 ) equals IFP(,  1 ).Also, in Figure 7(b) the remaining items are placed at the leftmost coordinate, choosing smaller  (left) and minor  (bottom), from the CRF polygon.Then for the last step of the process, the layout length can be assigned and the corresponding chromosome is evaluated (Figure 7

(c)).
A BRKGA procedure is applied to a single population.However, this algorithm can be changed to accept more than one population.The method here uses  populations, where  depends on many of processor kernels on a target test computer.All initial populations are assigned some random solutions in an independent way.The information exchange is carried out according to the attribute  change that defines the periodicity of this process.If  change = 1, in every new generation, the population evolution process will be modified using the following rule: (i) The "TOP" solutions   for each population   in Generation () are changed for worst layouts of "REST" solutions space of population  +1 in Generation (+1) , considering  as a circular list, where the last element   sends information to  1 ; see Figure 8.
The main goal of this strategy is to improve the variability of good solutions between all populations, left in charge of the crossover process (REST), mutation solutions (BOT), elitism (TOP), and, at CFR positioning method, the work to construct new solutions to be evaluated and translated to next generations until stop criteria are verified.Figure 9 shows a flowchart of the proposed approach, discussing all levels: preprocessing, algorithm, and final solution.
In the preprocessing stage, all control parameters are defined (see Section 5) and assigned.For each instance selected, the no-fit polygons are computed for every pair of polygons type.At the next level, we considered our modified BRKGA (-BRKGA) with the information exchange rules and  populations.In the last step, the best solution is picked as the one with the shortest length between all the layouts of each population adopted.

Computational Experiments
The algorithm was written in Java Language.Computations tests were carried out on a machine with a 3.For each instance, the -BRKGA algorithm was executed 10 times and the best results are presented in Table 2 with the focus on utilization percentage found in best solution and average of tests.Also, the same table shows a comparative analysis of the best use among the algorithms SAHA [25], BLF [21], 2DNest [21], BS [31], CFREFP [4], and GCSPC [41].All these approaches have a prominent importance in the literature for problems of positioning irregular figures.
By analyzing Table 2, the -BRKGA application presents significant results in several datasets.In [37], a RKGA procedure for ISPP was implemented and the same tests were executed.Table 3 demonstrates that -BRKGA had a faster and better solution than RKGA-NP.The dataset named FU, which presented a prominent result in -BRKGA, was not applied in RKGA-NP.
In the RKGA-NP a different process of coding to represent a chromosome was applied and a group of random keys is responsible for choosing the respective positioning rule: Bottom-Left, Bottom-Left-Fill [21], and the heuristics developed in [38].These characteristics contributed to the longer time required for the results shown in Table 3.However, the positioning method applied in -BRKGA reached better solutions in some cases.Figure 10 illustrates the final best layout for Albano, FU, Jakobs 1, and Trousers.Best fitness picked

Conclusions and Future Work
An irregular strip packing problem with a rectangular stage, a fixed width, and an unlimited length was discussed in this paper.To tackle it, we combined a collision-free region placement procedure with a parallel Biased Random-Key Genetic Algorithm with multiple populations, which were also used to develop the order in which the polygons were placed within the stage and their corresponding orientations in order to find the most effective layouts.
ISPPs are present in many production processes in factories, and the approaches to overcome these problems need to find good solutions in a relative short time.In the method proposed here, we chose an effective metaheuristic combined with a convincing placement algorithm to carry this out.The parallel aspect helps to find the best solutions in the space available.
Computational results on datasets of ISPP show that the approach outperformed and/or matched well-known algorithms.As a future work, we aim to modify and implement

Figure 1 :
Figure 1: An example of a solution to an irregular strip packing problem.

Figure 6 :
Figure 6: Population evolution process to next generations of a BRKGA.

Figure 8 :
Figure 8: Information exchange rule for the next generations of a BRKGA with multiple populations.