Exact solutions for the 2d-strip packing problem using the positions-and-covering methodology

We use the Positions and Covering methodology to obtain exact solutions for the two-dimensional, non-guillotine restricted, strip packing problem. In this classical NP-hard problem, a given set of rectangular items has to be packed into a strip of fixed weight and infinite height. The objective consists in determining the minimum height of the strip. The Positions and Covering methodology is based on a two-stage procedure. First, it is generated, in a pseudo-polynomial way, a set of valid positions in which an item can be packed into the strip. Then, by using a set-covering formulation, the best configuration of items into the strip is selected. Based on the literature benchmark, experimental results validate the quality of the solutions and method’s effectiveness for small and medium-size instances. To the best of our knowledge, this is the first approach that generates optimal solutions for some literature instances for which the optimal solution was unknown before this study.


Introduction
The Two-Dimensional Strip Packing Problem (2SP) is composed of a given set of n rectangular items, each one with specific width w i and height h i , for i = 1, . . ., n, and a strip of width W and infinite height. The aim is to place all the items into the strip orthogonally; without overlapping, minimizing the overall strip's height [1,2]. We assume that all input data w i , h i , and W are positive integers and that w i � W for all items i = 1, . . ., n. We consider the case when the items have a fixed orientation, and the guillotine cut constraint is unnecessary.
The 2SP is NP-hard in the strong sense since it can be reduced to the one-dimensional binpacking problem [2][3][4], and according to the typology proposed by [5], the 2SP belongs to the class of cutting and packing problems: two-dimensional, open dimension problem (2D-ODP). Fig 1 shows the optimal configuration for an instance proposed by [6] with 50 items and a strip of width W = 40. The optimal height is H = 15. In this case, there is no wasting in the strip; that is, we have a perfect packing.
Many real-world applications of this problem can be found in the paper, textile, glass, steel, and wood industries, where rectangular items are cut from larger rectangular sheets of material a1111111111 a1111111111 a1111111111 a1111111111 a1111111111 that can be considered with infinite height [7,8]. The 2SP also appears in scheduling problems where the tasks require a contiguous subset of identical resources [9].
In this study, we propose an adaptation of the Positions and Covering (P&C) methodology, used by [10] to obtain optimal solutions for the two-dimensional bin packing problem. Considering the similarity of the 2SP with other packing problems, some potential applications for the P&C methodology can be found in agricultural fields to delineate rectangular and homogeneous management zones [11][12][13], in scheduling problems applied to environmental, automotive, ferry, and manufacturing industries to ensure maximum use of materials [14][15][16], in healthcare applied to operating rooms schedules [17][18][19], in cloud computing where a set of jobs must be processed on virtual machines of physical servers with the aim of improves the energy efficiency [20][21][22], and in optimal deliveries in e-commerce where the objective is optimizing the total number of containers to integrate into several delivery trips [23].
The P&C methodology adapted to the 2SP is as follows. Given an instance of the 2SP, the first step of the P&C is to compute the strip's height with the assumption that a perfect packing exists. Then we generated a set of valid positions to determine all possible places to locate it on the strip for each item. This pre-processing is the key-point of the P&C methodology. Finally, using the H computed, the P&C solves a set-covering model for the decision version of the 2SP (D-2SP(H)): is there a non-overlapping packing of the n items into the strip with H height? If there is a feasible solution, then H is the optimal value for the 2SP. Otherwise, P&C iterates again, increasing the height H of the strip by one. The P&C is an exact methodology that obtains optimal solutions for the 2SP, that is, every time our methodology is executed, the same solution and time are going to be obtained.
The main differences of our methodology with respect to the mentioned exact approaches is that the P&C groups the items with identical size and computes their demand. Indeed, all the other approaches consider similar items as individual. This grouping makes a better covering model that can be solved faster. Moreover, this new set-covering formulation is strengthened with two families of valid inequalities. This manner, the P&C methodology is power enough to obtain optimal solutions for the 2SP problem without any more complex methodology as column generation.
Because of the combinatorial complexity of the 2SP, the attempts to solve it are roughly divided into exact and approximation methods. Some reviews of the 2SP are presented in [8,24,25], and some surveys for packing and cutting problems are showed in [26][27][28][29].
In terms of other exact methods, there have been recent combinatorial branch-and-bound (B&B) algorithms that build solutions by packing items one at a time in the strip like the ones of [1,2,[30][31][32][33]. In [1], the authors propose a B&B algorithm to solve the 2D rectangular packing problems, a particular case of the 2SP. This B&B algorithm is enhanced with a dynamic programming mechanism for determining if gaps can be filled.
A new relaxation to produce good lower bounds and obtain practical heuristic algorithms is introduced in [2]. These bounds were also used in a B&B algorithm. The authors of [33] propose two algorithms for the 2SP with and without 90-degrees rotations. They are based on a branching operation that uses the staircase placement. Two exact algorithms and an approximate algorithm have been proposed by [34] to solve a variant of the strip cutting problem. These algorithms are based on B&B and dynamic programming procedures.
In [44], the authors propose two metaheuristics that involve the application of the simulated annealing with a heuristic construction algorithm. In many of these studies, the authors use a version of the BL heuristic to arrange the items. In [45] the authors show some models strengthen with well-known valid inequalities and based on the work of [43]. Some improvements for the best-fist heuristic, where it is presented a simple local random local search, are showed in the work of [46]. The use of data mining techniques also has been implemented to assess the quality of heuristics solutions [47]. Other approaches that consider hierarchical or multi-stage methodologies can be found in the works of [48][49][50]. A survey of heuristics for the two-dimensional rectangular strip packing problem is presented in [51], and upper bounds for heuristic approaches in [52].
The main strength of the P&C methodology for the 2SP is that it obtains optimal solutions for many instances of the classical benchmarks that none of the previous (and more elaborated) methods could find. For example, the P&C solved to optimality several instances proposed by [53] for which the optimal solutions were not known before of this study. To the best of our knowledge, the P&C methodology is one of the best methods to find optimal solutions for the 2SP for small and medium-size instances.
The rest of this article is organized as follows. In Section Materials and methods, we describe the P&C methodology for the 2SP. In Section Results, we present the experimental results for the P&C methodology by using a set of small and medium-size instances that have been broadly used in the literature to test other algorithms. Finally, in Section Conclusions, we make some concluding remarks.

Materials and methods
In this section, we present the materials and methods used to solve the 2SP. First, we show the adaptation of the P&C proposed by [10] to solve the 2d-bin packing problem. Then, we describe each part of the methodology for the 2SP.
height could be updated, and some iterations of the P&C may be avoided.
Considering this H-value, the P&C generates the set of valid positions that locate the items inside of the strip. This step is the key-point of our methodology, and it will be later explained in detail. Then, an integer linear programming set-covering formulation (ILP) for the decision version of the 2SP, named as D-2SP(H), is solved to optimality. If the covering model is feasible, then H is the optimal height of the strip. Else, the H-value is increased by one or in a dichotomous way, the new set of valid positions for the items is generated, and the covering model is solved again. These last three steps represent the main difference with the P&C for the 2D-BPP (see [10]). The procedure ends when P&C finds a feasible solution of the D-2SP (H), and the current height becomes the optimal one.

Positions stage for the 2SP
The objective of the Positions stage is to generate the set of valid positions where an item can be placed into the strip, that is, from the infinite set of positions that an item can take in the bin, the P&C determines only a finite set that guarantees the optimality of the solution. The inputs of the Positions stage are i) the number n of items with their specifics width w i , height h i , and demand d i , ii) the width W of the strip, and iii) the current height H of the strip (first computed with Eq 1 or a known lower bound, or an updated value).
With the current height H of the strip, the first step in the Positions stage is to delineate a Cartesian grid inside the strip, that is, a regular tessellation of the 2-dimensional Euclidean space by congruent unit squares, where each square has a particular identification. We arbitrarily choose the enumeration that starts at the top left corner square and ends at the bottom right square (see Fig 3a). Thus, for each item, a valid position is created if its top left corner coincides with a tiling, and its width and height dimensions do not exceed the size of the strip. Each valid position is labeled to differentiate one from each other.  populating its valid positions width-wise and then length-wise for each item. The size of J H is pseudo-polynomial, but this pre-processing allows the P&C method to decompose the problem and to reach optimal solutions.  Table 1. Each row in the correspondence matrix represents the respective valid position presented in Fig 4. For example, row 1 has ones in tiles 1, 2, 3, 5, 6, and 7, which correspond with position 1 of the figure.
Notice that the set of valid positions determined by the unitary grid is sufficient to reach the optimal solution of the 2SP since all input data are integer.

Covering stage
In this stage, the P&C executes a set-covering formulation based on an integer linear programming model. This formulation solves the decision problem for the strip packing problem D-2SP(H), that is, is there a solution for the 2SP when the height is set to H? If the answer is positive, then the procedure ends (since we are minimizing the height), else the height of the strip is increased by one. A new iteration begins by populating the new set of valid positions for each item, and the decision model is solved again.
Formalizing, let I be the set of items, recall that J H is the set of valid positions for a fixed height of the strip, V(i) be the subset of valid positions for each item i 2 I where V(i)2J, and P be the tiles set inside of the strip. Furthermore, we know other parameters such as the demand d i of item i 2 I and the maximum of times that this item can be packed inside the strip: UB i .  Valid positions (j) 1 1 The decision variables for the ILP model are: This manner, the set-covering formulation to solve the decision problem D-2SP(H) is as follows.
where (2) establishes that any feasible solution for the 2SP is desirable. Constraints (3) avoid the overlapping assigning at most one item at each tile of the strip. Constraints (4) guarantee that all the items will be packed into the strip. Constraints (5) act as valid inequalities (valid by definition) since we bound the number of occurrences of each item in the strip. Constraint (6) determines that the capacity of the strip must not be exceeded; that is, it is impossible to pack more items than allowed. This constraint is also a valid inequality that strengthens the constraint space. Finally, in (7), the nature of the variables is declared. Besides valid inequalities (5) and (6), other valid inequalities could enhance the ILP, but these proved in preliminary results to be the more efficient for the 2SP (and also for the 2BPP, see [10]).

Results
To test the P&C methodology, we use two sets of instances: the original benchmark for the strip packing and the benchmark for other two-dimensional cutting problems. The description for each group of instances is given in the following sections. Then, we present the experimental results on these sets.

Original instances for the strip packing
This instance set refers to the instances generated for the two-dimensional strip packing problem. This set contains: • 2 perfect packing instances proposed by [6], known as jack01-jack02.
The optimum for instances dagli01, dagli03 and, dagli04 was not known until now, according to the Working Group on Cutting and Packing within the Association of the European Operational Research Societies (ESICUP) (https://www.euro-online.org/websites/ esicup/data-sets/#1535972088188-55fb7640-4228).
For some instances like the hopper ones, we are no testing all of the instances of the benchmark since they are too large for the P&C methodology. Indeed, other instances benchmark exist in the literature but they are also too large for the P&C so they are not mentioned in this section.

Instances for other two-dimensional cutting problems
This set of instances was originally introduced for other two-dimensional cutting problems and was transformed into strip packing instances considering the item size and the bin width. We found the following instances: • 100 of 300 instances proposed by [57]. These instances are divided into 10 classes (6 and 4, respectively), where each class is composed of 5 groups of 10 instances. Each group has a different number of items to be packed into the bin with n = {20, 40, 60, 80, 100}. The corresponding best-known solution and lower bound for each instance are available at http:// www.or.deis.unibo.it/research_pages/ORinstances/2BP.html. This set of instances is known as the BW instances.
• 12 instances proposed by [59], known as ngcut. The cgcut and ngcut instances are test problems for 2D cutting problems, which were transformed to 2D bin packing instances according to [60]. These instances are available from the ORLIB library.
As in the original instances for the strip packing problem, there are other set of instances that we do not include in this study since they are too large for the P&C.

Computational results
To solve the set-covering formulation, we use the integer linear programming solver (B&B) of CPLEX 12.7 using its default options, except for the optimality parameter set to 0%. All the instances were executed on a computer equipped with a processor 8-Core Intel Xeon E5-2609 @1.70 GHz, and 64 GB of RAM. The time limit for the B&B execution was fixed to 8 hours (28800 seconds).
For all of the instances, we start the P&C methodology using the height of the strip H given by the best lower bound obtained in the literature. When this bound is not available, we compute the H parameter assuming that a perfect packing exists (Eq (1)). We report the execution time for the last iteration of the P&C.
We compare the P&C with several methodologies that were implemented and tested on computers with different characteristics. Thus, our comparison is informative more than comparative. The main purpose of this study is to obtain optimal solutions for instances of the 2SP. Furthermore, statistical tests are not required to determine the solution quality because P&C is an exact method without statistical components on its procedure.
Original instances for the strip packing. Tables 2-5 show the experimental results for the original instances of the 2SP. The structure of these tables is as follows: the first three columns describe the instance, that is, the name ("Inst"), the width size W of the strip, and the number n of items. The fourth column indicates the optimum ("Opt") or the best lower bound known ("LB") in the literature. Columns 5-7 present the values for the P&C methodology: the generation time in seconds of the correspondence matrix ("GT"), the execution time in seconds required by the B&B solver ("ET"), and the optimum value z � . In the last columns, we present the solutions obtained by other approaches in the literature.
The results for jack and kendall instances from [6] and [56] are showed in Table 2. The last four columns are the solutions obtained by other approaches such as the genetic algorithm combined with a deterministic algorithm proposed by Jakobs in [6], a bottom-left algorithm for the genetic algorithm proposed by Liu and Teng in [39], the genetic algorithm proposed by Mumford-Valenzuela in [63], and the genetic algorithm based on layouts proposed by Bortfeld in [41]. These approaches are heuristics, and no execution times were reported. To the best of our knowledge, there are no other exact algorithms that have solved these instances. The P&C is the only method that guarantees the optimal solution (bold numbers) for the three instances, which were solved in less than 70 seconds, considering the generation time of the correspondence matrix and the execution time of the B&B. Table 3 shows the experimental results for dagli instances. For these instances, we add two columns for the P&C: column "%" represents the packing density which is added to make a comparison with the other approaches, and column "LB" that shows the best lower bound found by the P&C methodology when an instance is not solved to optimality considering the time limit. The last three columns show the results in terms of the average of packing density for other approaches (no execution times were reported for these algorithms) such as an object-based evolutionary algorithm proposed by Ratanapan and Dagli in [54,55], an artificial neural network, mathematical programming and genetic algorithm proposed by Dagli and

PLOS ONE
Exact solutions for the 2d-strip packing problem Number of optimal solutions 9/9 5/9 0/9 2/9 3/9 2/9 8/9 8/9 Poshyanonda in [53] and [64], and a genetic algorithm based on layouts proposed by Bortfeld in [41] (we report the best solution obtained by this author). The P&C improves or certifies the optimality of the lower bound in the literature for the four instances. The optimum for dagli01 and dagli03 was not known before of this study according to the Working Group on Cutting and Packing within EURO of the Association of the European Operational Research Societies (ESICUP). The P&C methodology was able to solve 3 of 4 instances to optimality obtaining the best average packings. Furthermore, the P&C improves the LB of the literature for dagli04 instance from 161 to 208. For this instance, our methodology cannot guarantee the optimality because the B&B reaches the time limit with the value of 208. However, it obtains a feasible packing for the value 209 and infeasible for 207. When the lower bound is not close to the optimum, as for dagli04, we searched for the optimal height of the strip in a dichotomous way. Notice that the times of the last iteration of the P&C methodology are less than 15 minutes. The experimental results for hifi instances proposed by [34] are shown in Table 4. This table is interesting since it compares several dichotomous algorithms based on exact methodologies. The P&C is compared with four approaches of the literature (the last eight columns) such as the dichotomous exact approach based on a B&B and dynamic-programming procedures developed by Hifi in [34], the B&B algorithm of [65] called S bb , based on the B&B of [2], the dichotomous algorithm of [65] named S da , based on the one of [34] with the decision version problem solved with the model of [66], and the branch-and-price algorithm of [65] called S bp . For each approach, we present its solution z and the execution time ET. Hifi's algorithm was coded in C and tested on a Sparc-Server20 (module 712 MP). The S bb , S da and S bp algorithms were coded in C++ and tested on a Pentium M 1.7 GHz with 1G of RAM. The column generation and linear programs were solved with CPLEX and Concert Technology.
For hifi instances, we are not comparing the dichotomous behavior that seems to be a promising characteristic for the 2SP, but, we are analyzing the exact algorithms that solve the one-dimensional problem. Indeed, the best algorithms in terms of solution value are P&C, S da , and S bb , respectively. To the best of our knowledge, the P&C methodology is the only one finding the optimal solution for instances hifi19 and hifi25. Furthermore, the execution times of the last iteration for the P&C are efficient since they are less than 45 minutes in the worst case (instance hifi18). Nevertheless, the execution times of Hifi's algorithm seem more competitive.
The experimental results for small-medium size instances proposed by Hopper and Turton in [36] are presented in Table 5. We add a new column at the beginning of the table to specify the class of the instance. We compare the results of the P&C with the hybrid algorithm proposed in [42] (column 9). Columns 10-13 show the results obtained by the best-fit algorithm from [67] and its enhancements adding Tabu-search (TS), simulated-annealing (SA), and a genetic algorithm (GA) from [68]. In columns 14 and 15 are presented the average and best solutions obtained by the genetic algorithm presented in [41], the authors do not present detailed solutions for each instance. Finally, the last two columns show the average and best results obtained by the GRASP proposed by [40]. Numbers in bold represent the optimal solutions. To make a comparison of our methodology with respect to other approaches, we use the average percentage deviation from optimum proposed by [40]. This average is calculated as (sol-opt)/opt. The results show that the P&C algorithm obtains the best solutions for the first three classes (small-medium instances), getting 9 of 9 optimal solutions, improving the best results of the GRASP proposed by [40]. We do not present the results for large instances since P&C cannot obtain their optimal solutions. Indeed, the size of the correspondence matrix for these instances is too large, and the memory of our computer is not enough to solve them.

Instances for other two-dimensional cutting problems
In this section, we present the experimental results for the other two-dimensional cutting instances which have been adapted to the 2SP (Tables 6-10). The format for each table is similar to the previous ones.
In Table 6, we show the results for the burke instances of [67]. We compare the P&C with the best-fit algorithm from [67] and its enhancements adding Tabu-search (TS), simulatedannealing (SA), and a genetic-algorithm (GA) from [68] (columns [8][9][10][11]. Finally, the last two  columns show the average and best results obtained for the GRASP proposed by [40]. Notice that the P&C is the only approach that obtains the optimal solutions for all the instances. Table 7 shows the experimental results for ngcut, cgcut, and beng instances proposed by [58,59], and [61], respectively. For these instances, the P&C methodology is compared with the algorithms of [42] and the GRASP of [40]. MO means that the computer memory was not enough to generate the correspondence matrix, and TO means the time limit to solve the instances was reached. The best results were obtained for the GRASP algorithm of [40]. However, our contribution here is that we have increased and validated the optimal solutions reported by the GRASP from 19/25 to 23/25. For the cgcut_02 instance, the P&C cannot prove its optimal solution since the model reached the time-limit when the lower bound was used as the maximum height of the strip. However, the P&C obtains the best result for this instance with respect to the other approaches. Tables 8 and 9 present the experimental results for Class 1 and 2 of Berkey and Wang instances proposed in [57]. For each table, we add two new columns for the P&C. ColumnLB represents the initial lower bound computed with Eq (1) and used to start our algorithm. Column LB shows the best lower bound found by the P&C when an instance is not solved to optimality (considering the time limit established for the B&B).
As we mention in the description of the instances, each class has five groups of ten instances that differ one with each other in the number of items. Therefore, both tables are divided into five sections that represent the corresponding group of instances for each class. For each group, we show the average to compare our results with other approaches of the literature. For Class 1, the P&C cannot solve to optimality instances 6, 16, and 18. However, our methodology can find new lower bounds for the first two groups of instances, improving the bounds given in the literature. For the last three groups of Class 1, the P&C can solve all the instances to optimality, improving the lower bounds and the results of other methodologies. Finally, for Class 2, the P&C solved all the instances to optimality, improving the results of the GRASP. Table 10 shows the results for kenmochi instances proposed by [33]. The first three columns describe the instance as usual. Columns 4-7 show the results obtained with the P&C. In this case, we show the width W (the fourth column) and the optimal height z � of the strip because some anomalies exist in the instances, and a perfect packing does not exist with the original width. The anomalies exist in the first two instances where the width of some items is larger than the width of the bin. Therefore, to solve these instances, we set the width of the bin as long as the width of the larger item (numbers in bold in column 4 show the modification of W). Furthermore, the optimal solutions obtained by our methodology in the last four instances do not correspond with the results presented by Kenmochi [33]. Columns 8-10 present the results of [33] that implement two branching strategies: the bottom-left (BL) point and the the staircase (S) strategy. The bounding operations are based on dynamic programming (DP) and linear programming (LP). The P&C shows the optimal results for all the instances. The experimental results show that the P&C is an efficient methodology to solve smallmedium size instances for the 2SP. Larger instances cannot be solved with the P&C methodology since the combinatorial complexity of the problem also relies on the generation of all the possible positions of the items. In this case, we have detected an opportunity area where we propose to apply a decomposition approach, such as a column generation, to obtain optimal solutions for large instances.

Conclusion
In this study, we present a new methodology called "Positions and Covering (P&C)" to obtain exact solutions for the two-dimensional strip packing problem. The methodology is based on a two-stage procedure where first, a set of valid positions is generated in a pseudo-polynomial way representing how each item can be allocated inside of the strip. The height of the strip is computed assuming that a perfect packing exists (or using the best lower bound, if it exists). In the second stage, a set covering formulation (using the set of valid positions) is solved to determine if the height of the strip is optimal. If the mathematical model is feasible, then the procedure ends with the optimal solution. Else, the height of the strip is increased by one, a new set of valid positions is generated, and a new iteration begins. The P&C methodology was tested using the benchmark for the 2SP solving small and medium-size instances. We verify that many of the solutions proposed by other approaches were the optimal solutions. The main contribution of this study is that we have obtained optimal solutions for instances proposed in the literature where the optimum was not known before. Furthermore, we have modified some other instances of the literature, which were infeasible, and we have solved them, obtaining the optimal solutions.
An essential characteristic of the P&C is its simple implementation. Nevertheless, a future research line consists of developing a decomposition approach to enhance the P&C methodology to give optimal solutions for larger instances of the 2SP.