Abstract

This paper addresses the multiorder open-dimension three-dimensional rectangular packing problem (3D-MOSB-ODRPP), which involves packing rectangular items from multiple orders into a single, size-adjustable container. We propose a novel metaheuristic approach combining a genetic algorithm with the Gurobi solver. The algorithm incorporates a lower neighborhood search strategy and is underpinned by a mathematical model representing the multiorder open-dimension packing scenario. Extensive experiments validate the effectiveness of the proposed approach. The LNSGA algorithm outperforms Gurobi and the traditional genetic algorithm in solution quality and computational efficiency. For small-scale instances, LNSGA achieves optimal values in most cases. LNSGA demonstrates significant optimization improvements over Gurobi and the genetic algorithm for large-scale instances. The superior performance is attributed to the effective integration of the lower neighborhood search mechanism and the Gurobi solver. This study offers valuable insights for optimizing the packing process in e-commerce warehousing and logistics operations.

1. Introduction

Amidst the rapid growth of e-commerce, the global express business surpassed 170 billion pieces in 2021, with a year-on-year surge of over 25% [1]. In China, the postal industry achieved 139.1 billion dispatched parcels in 2022, with express business reaching 110.58 billion pieces, showcasing a year-on-year growth of 2.1% [2]. Efficient parcel packaging profoundly impacts user experience and can lead to savings of up to 30% in logistics expenses [3], making it strategically significant for e-commerce enterprises.

The three-dimensional bin packing problem originated in the 1960s, focusing on single-container packing [4]. The problem was proven to be NP-hard and exact algorithms were time-consuming [5, 6]. Research transitioned to metaheuristics, and as the 21st century progressed, the focus shifted to multicontainer [7], dynamic packing [8], and machine learning methodologies [9]. Recent advancements have led to specialized cases such as open-dimension packing [10] and multiorder mixed packing problems [11].

Open-dimension bin packing relaxes container size constraints to better reflect real-world scenarios. Existing literature has employed algorithms such as simulated annealing [12] and particle swarm optimization [13], which rely on random search and can get trapped in local optima. The multiorder mixed packing problem involves factors such as order priority and time limits, increasing complexity. The current research focuses on single objectives, with limited attention to multiobjective decision-making [11, 14].

As packing tasks become more intricate, traditional exact algorithms need help with multiple constraints. Metaheuristics such as genetic algorithms [15], simulated annealing, and particle swarm algorithms [16, 17] have shown promise but face challenges in obtaining satisfactory solutions for complex problems. Researchers have explored integrating metaheuristics with exact solvers, giving rise to metaheuristics [18, 19]. Metaheuristics combines the global exploration capabilities of metaheuristics with the local optimization power of exact solvers, demonstrating superior performance in routing [20, 21], scheduling [22], and packing problems [23, 24].

This paper introduces a novel metaheuristic approach to address the multiorder open-dimension 3D rectangular packing problem. The proposed hybrid algorithm combines a genetic algorithm with the Gurobi solver to manage problem complexity and improve upon traditional metaheuristics. The algorithm is underpinned by a mathematical model representing the packing scenario and incorporates a lower neighborhood search strategy. Comparative experiments validate the approach’s effectiveness in tackling modern packing problems and set a foundation for future research.

The paper is structured as follows. Section 2 reviews the literature on packing problems and solution algorithms. Section 3 presents the problem model and algorithm design. Section 4 focuses on experimental results and analysis. Section 5 concludes the paper and discusses future directions.

2. Literature Review

In this section, we review related research on the packing problem from three perspectives: application scenarios, dimensionality, and solution algorithms, respectively.

2.1. Packing Problems in Different Scenarios

The research on packing problems spans various practical domains, such as pallet loading, nesting problems, warehouse cargo packing, container loading, and cutting stock filling problems, among several others.(1)Pallet loading problem: the pallet loading problem (PLP) involves placing multiple items on a pallet of a certain size to find the loading solution with the lowest stacking height [2527].(2)Nesting problem: nesting problems focus on efficiently cutting materials to obtain final items while adhering to shape-based rules [28, 29]. These problems are relevant across diverse industries, such as textile, clothing, sheet metal cutting, furniture manufacturing, and automobile industry [30, 31].(3)Warehouse cargo packing problem: this problem involves efficiently packing goods based on order information from a warehouse. Scholars have explored irregular parts packing [32], flexible packing with nonfixed box sizes in e-commerce, and loading goods onto vehicles during the outbound warehouse process [33, 34].(4)Container loading problem: the container loading problem (CLP) aims to load items into a container efficiently, maximizing the loading rate or minimizing the number of containers required, while considering support and stability constraints [35]. It encompasses three-dimensional container loading for transportation via ships, trucks, or railroad cars and air cargo packing. Researchers have also focused on multicontainer loading problems [36, 37].(5)Cutting stock filling problem: the cutting stock filling problem involves efficiently arranging multiple items within a designated space in industrial contexts to maximize space utilization or minimize the total volume occupied [38, 39].

This paper focuses on the e-commerce warehousing state’s packing problem, specifically packing warehouse goods. The subsequent section reviews studies on various dimensions of the packing problem.

2.2. Packing Problems in Different Dimensions

Packing problems can be classified based on dimensions, mainly one-dimensional, two-dimensional, and three-dimensional problems.

2.2.1. One-Dimensional and Two-Dimensional Packing Problems

This study focuses on packing problems in the context of e-commerce warehousing. One-dimensional packing problems have been studied but must be more relevant here [40]. Two-dimensional packing problems have received significant attention, including the guillotine knapsack packing problem, strip-packing problem with knifing constraints [41], and case packing for regular and irregular items [42]. The rectangular packing problem (RPP) describes the rectangular strip-packing problem (RSPP) [43]. Researchers have also investigated the undercutting, strip, and open-dimension 2D packing problems for various irregular objects [44].

2.2.2. Three-Dimensional Packing Problem

The three-dimensional packing problem extends classical one- and two-dimensional problems and has gained substantial attention. Researchers often convert 3D problems into 2D variants for easier solution procedures [45]. The three-dimensional packing problems include the following:(1)3D bin packing problems (3D-BPP): packing items of different sizes into the minimum number of boxes [46, 47].(2)3D knapsack loading problems (3D-KLP): maximizing the total value of items loaded into a knapsack [48, 49].(3)3D container packing problems (3D-CPP): loading items into a container to minimize volume or maximize loaded items [48, 50].

Scholars have studied 3D cutting and packing problems with nonoverlapping constraints and container loading problems within logistics platforms [51]. Container loading problems include multicontainer, LTL, and single-container loading with transportation priority [52, 53]. Real-world problems also involve multipoint constraints requiring specific box accessibility at each delivery point.

This paper focuses on the 3D bin packing problem in e-commerce settings. However, the complexity of 3D packing problems challenges traditional exact algorithms. The next section reviews solution algorithms for complex 3D packing problems.

2.3. Algorithmic Research Based on the Three-Dimensional Packing Problem

The 3D bin packing problem is an NP-hard combinatorial optimization problem. Early studies used exact algorithms, but as problem scales grew, computation times became lengthy, and satisfactory solutions took time to obtain. From the 1970s, researchers turned to heuristic algorithms, with genetic algorithms performing prominently. In the 21st century, metaheuristic algorithms were widely adopted. Gezici and Livatyali improved the Harris Hawks algorithm’s random parameter generation strategy to enhance the global search ability [54]. Xiong’s team proposed a deep reinforcement learning-based method for online packing problems [55].

Unlike single-objective studies, El Yaagoubi et al. used NSGA-II with heuristic rules for fast solving at different scales [56]. Liu et al. targeted multibin packing problems with irregular items using 3D point cloud techniques and deep Q-networks [57]. Wang et al. abstracted resource allocation in open RAN networks into a 2D bin packing model and used a self-play reinforcement learning algorithm [58]. Gzara et al. designed an efficient algorithm for pallet loading problems with vertical support and load constraints [27]. Erbayrak et al. incorporated packing stability and same-type product grouping constraints into a multiobjective model [59]. Chen et al. used a biogeography-based optimization and differential evolution hybrid for the bin design problem [15].

As packing problems continue to grow in complexity, researchers are constantly seeking to enhance solution algorithms. To address the three-dimensional multiple bin size bin packing problem with open dimension and reserve parameter (3D-MOSB-ODRPP), this paper proposes an improved genetic algorithm that incorporates a lower neighborhood searchapproach.

2.4. Research Gap

The comprehensive review of packing problems and solution algorithms reveals several research gaps this study aims to address. First, existing research on packing problems has primarily concentrated on fixed-dimension containers, with limited attention given to open-dimension scenarios. However, in e-commerce warehousing, the flexibility to adjust container sizes based on order requirements is crucial for optimizing resource utilization and reducing costs. This study incorporates open-dimension packing into the problem formulation, allowing for the determination of optimal container dimensions.

Second, although metaheuristic algorithms have been widely adopted for solving packing problems, traditional approaches often need help to balance global exploration and local exploitation effectively. This study introduces a novel metaheuristic approach that combines the strengths of a genetic algorithm for global search with the local optimization capabilities of the Gurobi solver. By integrating these two components, the proposed algorithm aims to overcome the limitations of traditional metaheuristics and enhance solution quality.

Lastly, while previous studies have considered various constraints and practical factors, integrating multiple orders and open dimensions in a single packing problem has received limited attention. This study addresses this research gap by formulating the 3D-MOSB-ODRPP, which optimizes the packing of multiple orders with varying item sizes and quantities into a single, size-adjustable container.

To further highlight the unique contributions of this study, Table 1 compares the present research with the existing studies across several key dimensions.

As evident from Table 1, the present study simultaneously addresses multiple key aspects of the 3D packing problem. Hile’s existing studies have individually considered some of these dimensions but still need to integrate them into a comprehensive problem formulation and solution approach. By bridging these research gaps, this study aims to provide a more realistic and effective solution to the complex 3D-MOSB-ODRPP encountered in e-commerce warehousing.

3. Methodology

This section introduces the 3D-MOSB-ODRPP model proposed in this paper and the improved genetic algorithm for solving this model. First, we will elaborate on the mathematical model for the multiorder open-dimension 3D packing problem, considering practical characteristics such as mixed orders and adjustable bin sizes. Then, we will elucidate the solution approach of the lower neighborhood search-based enhanced genetic algorithm, laying the groundwork for the computational experiments in later sections.

3.1. Problem Description

This paper primarily studies the 3D-MOSB-ODRPP. This problem expands on the 3D-ODRPP proposed by Tsai by comprehensively considering the optimization of adjustable container length, width, and height under multiple orders with a single box type. Specifically, as shown in Figure 1 given multiple packing orders where each order contains rectangular items with known length, width, and height, the goal is to determine a unified box size so that all items across orders can be packed into a container of that size, thus maximizing the container space utilization. This problem is more practical than fixed-size packing by tuning the box dimensions to balance order demands, but the complex constraints also increase the difficulty of solving it. This paper formulates a mixed-integer programming model to obtain accurate solutions and designs an improved genetic algorithm for effective solving, obtaining feasible schemes for the 3D-MOSB-ODRPP.

3.2. Model Construction
3.2.1. Variable Assumptions

This paper primarily involves two types of variables: conditional variables and decision variables. Specifically, in the multiorder open-dimension 3D packing problem studied, the length, width, height of items, and number of orders are conditional variables representing predetermined inputs. The container length, width, height, and item positioning are decision variables that need to be determined. In subsequent sections, we will define the conditional and decision variables involved in the studied problem and present their exact representations in the mathematical model.(1)Conditional variables:A detailed description of the condition variables is shown in Table 2.(2)Decision variables:A detailed description of the decision variables is shown in Table 3.

3.2.2. Mixed-Integer Programming Model

We construct a mathematical model in this section to further solve the 3D-MOSB-ODRPP proposed in this paper. First, in order to maximize the space utilization efficiency while determining a unified container size, we define the objective function of the mixed-integer programming model aswhere represents the box’s volume, i.e., the product of three dimensions: length, width, and height.

Then, we introduce the constraint conditions in the mathematical model. First, to ensure that items can be smoothly packed into the container during the packing operation, we need to limit the range of each item inside the container to three dimensions-length, width, and height. The equations are as follows:where equation (2) calculates the range occupied by the item in the x-axis direction inside the container, considering the projection on the x-axis after rotation, which should be less than or equal to the container length to ensure feasibility; equation (3) calculates the range occupied in the y-axis direction inside the container, which should be less than or equal to the container width to ensure fit along the y-axis; and equation (4) calculates the range occupied in the z-axis direction inside the container, which should be less than or equal to the container height to ensure fit along the z-axis.

After constraining items from exceeding container boundaries, we need to constrain that items do not overlap when placed inside the container, as shown in equation (5). Since after limiting items to be within the container as in equations (2)–(4), solely satisfying this condition cannot guarantee that the final packing solution is feasible. Packaging multiple items into one container will likely overlap in placement, leading to infeasibility. Thus, nonoverlap constraints must be added to clearly define the relative placement of items so that they do not overlap inside the container, thereby ensuring solution feasibility. Together, equations (2)–(5) ensure that the packing solution meets two key requirements, filling the container and no overlaps.where indicates whether items and overlap in the -th direction ( ranges from 1 to 6, representing the positive and negative directions of x, y, z axes). When takes the value 0, it means that the two items do not overlap in this dimension; when it takes the value 1, it means overlap is allowed between the two items. In other words, 0 indicates no overlap between the two items, and 1 indicates potential overlap. By defining the 0-1 variable , we can explicitly formulate the relative placement relationship between items in each axis, thus laying the foundation for subsequent nonoverlap constraint calculations. Note that, the variable is unrelated to the specific overlap situation; it merely indicates whether overlap is permitted between two items on a given axis.

In addition, to comprehensively and accurately ensure no overlap between any two items inside the container, we further need to add nonoverlap constraints between items with different IDs, as shown in equation (6). Although the previously defined 0-1 variable D clarified whether overlap is allowed between two items in each axis, it did not specifically define the absolute spatial relationship between two items. To achieve absolute nonoverlap inside the container, we need to calculate the specific coordinate ranges of different items in each axis and restrict these ranges from intersecting. This ensures that the two items do not overlap in a single-dimensional axis and avoids overlap when integrated in a three-dimensional space.where and represent the IDs of two different items in the same order, ranging from 1 to the total number of items in the order. The item IDs and must differ and cannot take the same value. This is because, for the same item, its spatial projection region will not overlap with itself. If the IDs and take the same value, this nonoverlap constraint will degrade to a constraint between an item and itself, failing to achieve nonoverlap between different items. Therefore, the nonoverlap constraint must be expressed between two items with different IDs; only then can it truly define the relative placement relationship between different items inside the container, avoiding overlap.

After ensuring no conflicts between the items to be packed and the container, we need to add constraints between different items in the same container to avoid overlaps and other conflicts between items, as shown in the following equations:

In equation (7), and represent two different items, calculates the range occupied by item in the x-axis direction. calculates the x-axis coordinate of item multiplied by a large non-negative number . is a 0-1 variable, taking the value 1 when the two items do not overlap, making equal to 0 and satisfying the constraint. When the two items overlap, is 0, making a very large value, the right side greater than the left, and the constraint unsatisfied. Similarly, equation (8) ensures that items and do not overlap in the x-axis direction.

Equation (9), similar to equation (7), mainly calculates the range occupied by item in the y-axis direction, comparing it with the y-coordinate of item and a large number . When the two items do not overlap on the y-axis, the 0-1 variable is 1, making equal to 0 and satisfying the constraint. If the two items overlap on the y-axis, is 0, making a large value and violating the constraint. Equation (10) is similar to equation (8), utilizing the 0-1 variable and the large number to ensure that items and do not overlap in the y-axis direction.

Equation (11), similar to equations (7) and (9), calculates the range occupied by item in the z-axis direction and compares it with the z-coordinate of item and a large number . When the two items do not overlap on the z-axis, the 0-1 variable is 1, making equal to 0 and satisfying the constraint. If overlap exists, is 0, making a large value and violating the constraint. Finally, equation (12) utilizes the 0-1 variable and large number to ensure and do not overlap on the z-axis.

In order to further conflict between the items in the box, the following constraints are therefore set:where to are 0-1 variables indicating whether items and overlap in the three dimensions. Since each variable can only take 0 or 1, at least one of these variables must take the value 1, meaning the two items do not overlap in that dimension. Thus, this constraint ensures that any two items and do not overlap in at least one dimension, avoiding three-dimensional conflicts between them.

The abovementioned constraints are mainly used to avoid overlap conflicts between items and between items and container boundaries. To accurately calculate the space occupied by items in the container’s length, width, and height dimensions, all possible placement directions of items need to be considered. For example, a rectangular item can be placed horizontally, vertically, or at various tilts. However, computing and storing all direction combinations for each item will greatly increase model complexity and solving difficulty. Therefore, this model uniquely determines the placement direction of each item. Specifically, we introduce 0-1 variables to indicate the rotation decision of each item in three dimensions and construct rotation matrices to represent the projected length in each direction. As shown in equations (14)–(19), each item only chooses one placement direction, significantly reducing the model difficulty.where equation (14) indicates that item has three potential rotation states in the positive x-axis direction of the container, requiring that only one of these three states can take the value one and the rest 0. This ensures a unique rotation decision for the item in the x-axis direction. Equations (15) and (16) are similar, limiting item to only one rotation state in the positive y-axis and z-axis of the container. Then, equation (17) further requires that for the rotation states of each axis, only one can be uniquely determined from the three options. That is, the rotation combination of an item must take one state per axis and cannot repeat selecting two or more states in one axis. Finally, equations (18) and (19) ensure that the length, width, and height of an item can only have unique effects in the three axes.

The following constraint conditions are set to ensure the uniqueness of item ’s rotation state:where represents the 0-1 variable for the -th rotation state of item in the -th axis direction. Each variable can only take 0 or 1, 0 meaning item does not select the corresponding rotation state in that axis direction, and 1 meaning it selects that rotation state in that axis. These 0-1 variables are introduced to explicitly represent the rotation decision of items, providing a quantitative way to model the rotation states. Since each item can only select one rotation state, by requiring the variables in each axis to sum to 1, the uniqueness of the rotation scheme can be ensured.

In addition, to define the value range of the rotation decision and to ensure accurate computing of the coordinate’s positional relationship between items and the container, the following equation is set as:where takes different integer values to represent the correspondence between item length and width directions and the three coordinate axes: indicates that the item length direction is consistent with the x-axis, indicates that the item length direction is consistent with the y-axis, indicates that the item length direction is consistent with the z-axis, indicates that the item width direction is consistent with the x-axis, indicates that the item width is consistent with the y-axis, and indicates that the item width is consistent with the z-axis. This variable is introduced to establish the connection between item length and width directions and the spatial coordinate axes directions, with indicating possible item placement directions. After determining the value of , items’ spatial occupancy and coordinate positions can be calculated based on their projected dimensions on the corresponding axes.

Finally, to facilitate subsequent calculations of the model, a relaxation constraint is set here as

3.2.3. Algorithm Design

In order to address the challenges posed by the 3D-MOSB-ODRPP, this section proposes a hybrid approach termed the Gurobi-enhanced local neighborhood search genetic algorithm (LNSGA). Traditional genetic algorithms focus on global exploration, whereas the local neighborhood search mechanism targets local exploration. Consequently, the LNSGA algorithm integrates both the global and local exploration organically. Moreover, following the local neighborhood search, invoking the Gurobi solver ensures that the returned solution represents the globally optimal solution for the three-dimensional item packing.

A plain genetic algorithm (GA) is also implemented for the 3D-MOSB-ODRPP problem to compare and analyze the performance of the LNSGA algorithm. The GA follows the basic structure of genetic algorithms, including population initialization, fitness evaluation, selection, crossover, and mutation. However, unlike the LNSGA algorithm, the GA does not incorporate the Gurobi solver or the lower neighborhood search mechanism.

In the GA implementation, the three-space (TS) heuristic algorithm is employed to calculate the packing configuration of items. The TS algorithm is a fundamental heuristic approach in three-dimensional packing problems. It operates by recursively dividing the remaining space into three subspaces and selecting the most suitable subspace for placing the next item. The process continues until all items are packed or no feasible subspace is available.

The pseudocode of the GA algorithm is shown in Algorithm 1, and its key steps are as follows:

Require: population size , crossover probability , mutation probability , and maximum number of generations
Ensure: best solution
(1)Initialize population with randomly generated individuals
(2)Evaluate the fitness of each individual in using the TS heuristic
(3)
(4)whiledo
(5)
(6)whiledo
(7)  Select parents from using the selection operator
(8)   Crossover with probability
(9)   Mutate with probability
(10)   Mutate with probability
(11)  Evaluate the fitness of and using the TS heuristic
(12)  
(13)end while
(14)
(15)
(16)end while
(17)return Best solution from

(1)Initialization: generating an initial population of individuals, each representing a potential packing sequence of items.(2)Fitness evaluation: evaluating each individual’s fitness in the population using the TS algorithm. The volume utilization ratio of the packing configuration determines the fitness value.(3)Selection: applying a selection operator, such as tournament selection or roulette wheel selection, to choose individuals with higher fitness values for reproduction.(4)Crossover: performing a crossover operation, such as one-point crossover or two-point crossover, to create offspring individuals by exchanging genetic information between selected parent individuals.(5)Mutation: applying a mutation operator, such as swap mutation or insertion mutation, to introduce random variations in the offspring individuals.(6)Replacement: replacing a portion of the population with the newly generated offspring individuals based on their fitness values.(7)Termination: repeating steps 2–6 until a predefined termination criterion is met, such as reaching a maximum number of generations or achieving a satisfactory solution quality.

Compared to the LNSGA algorithm, the GA relies solely on the global exploration capabilities of genetic algorithms and the basic TS heuristic for packing calculations. It does not benefit from the targeted lower neighborhood search mechanism or the global optimization capabilities of the Gurobi solver. As a result, the GA may need more performance in terms of solution quality and computational efficiency, especially for complex 3D-MOSB-ODRPP instances.

The pseudocode of the LNSGA algorithm is shown in Algorithm 2, and its key steps are as follows:

Require: population size , crossover probability , mutation probability , maximum number of generations , and neighborhood size
Ensure: best solution
(1)Initialize population with randomly generated individuals
(2)for each individual in do
(3) Evaluate the fitness of using the Gurobi solver
(4) LocalNeighborhoodSearch(, )
(5) Gurobi
(6) Update with in
(7)end for
(8)
(9)whiledo
(10)
(11)whiledo
(12)  Select parents from using the selection operator
(13)   Crossover with probability
(14)   Mutate with probability
(15)   Mutate with probability
(16)  for each offspring in do
(17)   Evaluate the fitness of using the Gurobi solver
(18)    LocalNeighborhoodSearch(, )
(19)    Gurobi
(20)   Update with in
(21)  end for
(22)  
(23)end while
(24)
(25)
(26)end while
(27)return Best solution from

(1)Let denote the set of orders, where each order is considered as a distinct three-dimensional open-dimension rectangular packing problem (3D-ODRPP). The Gurobi solver is utilized to obtain the optimal packing dimensions for each order . Traditional genetic algorithms focus on global exploration by searching the solution space through population evolution and information exchange. However, for complex 3D-MOSB-ODRPP instances, global exploration alone may lead to local optima. A local neighborhood search mechanism is introduced to perform local optimization on the current solution to enhance local search capability.(2)We sort the optimal packing dimensions of each order in a descending order. Then, we determine the maximum length, width, and height values across all orders, denoted as , which serve as the upper bounds for the 3D-MOSB-ODRPP solution. Mathematically, it is represented as(3)The lower neighborhood search scope for open dimensions is defined as follows: given the upper bounds , the 1-step lower neighborhood consists of 7 value options, obtained by adding 0 or −1 to each dimension, excluding the case where all increments are 0. The lower neighborhood search aims to find better solutions within the neighborhood of the current solution . By designing appropriate neighborhood structures and search strategies, the algorithm can escape from local optima and explore the solution space more deeply. The lower neighborhood search adjusts the length, width, and height dimensions to generate neighboring solutions, thereby selecting the best one as the new current solution (numbered 1–7 as shown in Table 4).(4)Based on the open dimensions’ 1-step lower neighborhood search scope values, a step search path is designed as shown in Figure 2. The seven nodes in each search step correspond to the seven cases in the 1-step lower neighborhood search, and the multi-step search accumulates value increments based on the 1-step search. For example, starting from , when the search path is , the lower neighborhood search values experienced sequentially by the open dimension values are shown in Table 5.(5)The sequence of node numbers in a lower neighborhood search path is used as the chromosome encoding of an individual in the genetic algorithm. Let denote the chromosome of the -th individual, where represents the node number at the -th step of the search path.(6)We randomly generated an initial population consisting of chromosomes, each corresponding to a lower neighborhood search path.(7)The fitness function is then designed to evaluate the quality of each individual in the population aswhere , , and represent the maximum length, width, and height of the packing solution obtained by following the search path encoded in chromosome , and the objective is to minimize the fitness value.(8)The roulette wheel selection is applied to select individuals with high fitness values to form a new population . In each iteration, the individuals in the current population are sorted by their fitness values. The individual with the minimum fitness value is selected with a probability of , the second minimum with a probability of , and so on, until a new population with the same size as is formed.(9)Based on the crossover probability , we randomly selected two chromosomes and from the population . A crossover point is randomly chosen and the gene segments are exchanged after the crossover point between and to generate two offspring chromosomes and . and in the population are then replaced with and . The crossover process is shown in Figure 3.(10)Based on the mutation probability , we randomly selected a chromosome from the population . A mutation point is randomly chosen and the gene at position is replaced with a randomly selected value from to generate a new chromosome . is then replaced with in the population. The mutation process is shown in Figure 4.(11)Steps 7 through 10 are repeated until the maximum number of iterations is reached. To further enhance performance, the Gurobi solver is invoked after each local neighborhood search to perform global optimization on the current solution . The Gurobi solver is an exact method that solves the 3D packing problem to obtain the global optimal solution based on . By combining local neighborhood search with the Gurobi solver, the LNSGA algorithm achieves an organic integration of global exploration and local search, enabling it to escape from the local optima and obtain high-quality global optimal solutions.

3.3. Computational Experiment
3.3.1. Dataset Design

The data required for the current experiment includes item size information and order data information.(1)Item Information.The SKU of an item represents the smallest packaging unit of storage items and serves as an essential information for order items. Different items have varying sizes and SKU dimensions. This study sets the upper and lower limits, along with the change step, for each item’ SKU’s length, width, and height, as shown in Table 6. Accordingly, there are ten possible values for each dimension of the item SKU, resulting in 1000 different SKU combinations when considering the variations across all three dimensions. Thus, 1000 unique item sizes form the basis for generating item order information.(2)Multiscale order dataset.From the generated 1000 types of items, 2 to 6 items are randomly selected as the item information for an order. For example, when dealing with an order consisting of 4 items, its schematic diagram is shown in Figure 5. In order to conduct computational experiments with different order quantities, two sets of cases with different scales of order quantities are randomly selected, totaling 24 scenarios for the experiments. Each scenario includes orders of varying quantities, and all orders in each scenario are required to be packed into packaging boxes of the same size and model.

3.3.2. Algorithm’s Hyperparameter Settings

This study conducted computational experiments on six sets of small-scale test cases to determine the final hyperparameter values for the LNSGA algorithm. Two of these test cases exhibited relatively unique order item quantities and sizes, resulting in identical optimal fitness values under different parameter settings. Although such instances were relatively infrequent, the careful analysis revealed that when data scales were small or the problems were relatively simple, any combination of hyperparameters could easily attain the optimal solution. Alternatively, in specific scenarios, all combinations of hyperparameters could readily converge to the same local optimum, resulting in identical optimal solution values across all hyperparameter combinations.

It is worth noting that among the experimental results of the six test cases, the final values of the hyperparameterspopulation size (GROUP) and the number of algorithm iterations (EPOCH) were consistent, 35 and 10, respectively. However, there were multiple possible values for the hyperparameters pc (crossover probability) and pm (mutation probability). The pc values were 0.4, 0.65, and 0.9, while the pm values were 0.1, 0.2, and 0.3. Considering that pc and pm represent the population’s crossover probability and mutation probability, respectively, larger values of pc and pm within the allowed range indicate more active crossover and mutation in the population, thus increasing the likelihood of finding solutions with higher optimization. Therefore, the final values of pc and pm were determined to be 0.9 and 0.3, respectively.

The hyperparameters to be determined include the GROUP, the EPOCH, the pc, and the pm. The upper and lower limits for each hyperparameter search, along with the number of variation steps, are shown in Table 7. The computational process of the three test cases with two orders each in the small-scale example serves as the reference basis for determining the hyperparameters. As shown in Table 7, the optimal parameter combination for the four hyperparameter test cases is GROUP = 35, EPOCH = 10, pc = 0.4, 0.65, or 0.9, and pm = 0.1, 0.2, or 0.3. The optimal results for the three test cases under different parameter combinations and computation times are illustrated in Figure 6. The final chosen values for the hyperparameter combination are GROUP = 35, EPOCH = 10, pc = 0.9, and pm = 0.3 to ensure that the fitness function value converges stably to the optimal state.

4. Calculation Results and Analysis

4.1. Comparative Experiments with Gurobi
(1)Computational experiments for small-scale orders.To substantiate the efficacy of the lower neighborhood search genetic algorithm (LNSGA) for the three-dimensional multiorder single-box open-dimension rectangular packing problem (3D-MOSB-ODRPP), we conducted a series of experiments focusing on small-scale order cases. These cases, comprising 2–8 orders, were selected to provide a controlled environment for assessing the algorithm’s performance. The determined hyperparameters for the LNSGA, as outlined in Figure 6, were utilized to compute these test cases within the generated dataset.Table 8 provides a comprehensive overview of the solutions obtained from both LNSGA and Gurobi, including the container dimensions , the objective values, and the computational time required to reach these solutions. To evaluate the performance of LNSGA, we calculated the percentage gap (GAP) between the objective values achieved by LNSGA and the optimal values determined by Gurobi.Experimental results show that in small-sample instances requiring rapid decision-making, LNSGA demonstrates a good balance between solution quality and computational resources. Specifically, without imposing a time limit, the LNSGA algorithm performs significantly better than the Gurobi solver, achieving optimal values in the first three test cases. Despite some deviation from the optimal values as the number of orders increases (with a maximum GAP value of 17.5% for LNSGA), it still exhibits considerable advantages over Gurobi (with a maximum GAP value of 72.81%).(2)Computational experiments for large-scale orders.Based on the same hyperparameter settings, the LNSGA algorithm is used to compute test cases with large-scale order quantities in the generated dataset (for large-scale order cases, refer to cases with 12 to 18 orders). The results are compared with the cases solved directly using the Gurobi solver, as shown in Table 9.Under the same computation time for each test case, the proposed LNSGA algorithm in this paper achieves significant optimization improvements over the Gurobi solver, with the highest optimization level being 71.59% and the average being 50.16%. In addition, it can be seen from Table 8 that as the order quantity scale increases, the CPU computation time also increases accordingly.
4.2. Comparative Experiments with GA

In the previous section, we compared the performance gap between the commercial solver Gurobi and the proposed LNSGA algorithm. However, despite the significant advantages of the LNSGA algorithm in terms of both runtime and optimization accuracy over Gurobi, more is needed to demonstrate that the LNSGA algorithm is optimal for solving 3D-MOSB-ODRPP. Therefore, to validate the necessity of our modifications to the GA, this section will introduce comparative experiments between GA and LNSGA.

Although LNSGA and GA have the same iteration limit (EPOCH), LNSGA demonstrates faster computational speed than GA. This can be attributed to several factors as follows:(1)The GA algorithm does not invoke the Gurobi solver for obtaining packing solutions. Instead, it employs a heuristic algorithm based on the three-space strategy. The three-space strategy requires maintaining a list of spaces and calculating the splitting and merging of spaces, which is relatively time-consuming.(2)The basic neighborhood search mechanism in GA can lead to the inefficient search of the packing box dimensions. The packing method needs to be recalculated when larger or smaller packing box dimensions are explored. Excessively large or small packing box dimensions require more time to calculate the splitting and merging of spaces, resulting in increased time for updating the space list.(3)In complex scenarios involving space splitting and merging, the computation time for calculating the item packing solution also increases to a certain extent.

On the other hand, LNSGA incorporates a targeted lower neighborhood search mechanism, which efficiently explores the packing box dimensions by adjusting the length, width, and height within a specific range. This targeted search reduces the occurrence of excessively large or small packing box dimensions, thereby avoiding unnecessary calculations of space splitting and merging. Moreover, LNSGA utilizes the Gurobi solver to obtain globally optimal packing solutions for each lower neighborhood search, further enhancing its computational efficiency. Therefore, the GA’s reliance on the three-space strategy and its basic neighborhood search mechanism leads to slower computational speed than LNSGA. The targeted lower neighborhood search and integration of the Gurobi solver in LNSGA contribute to its faster performance.(1)Computational experiments for small-scale orders.In this section, we conducted experiments with small-scale order data to compare the performance of the LNSGA algorithm with the genetic algorithm (GA) and the variable neighborhood search (VNS) algorithm. The experimental results, as shown in Table 10, demonstrate the LNSGA algorithm’s superiority in terms of solution quality and computational efficiency.From the perspective of the objective value, which represents the volume of the packing box , the LNSGA algorithm consistently outperformed the GA and VNS algorithms in all 12 test cases. Compared to the GA, the LNSGA algorithm achieved a significant improvement in the target function, ranging from 34.05% to 71.93%. On average, the LNSGA algorithm obtained an objective value of 6179, which is 7.38% lower than the GA’s average of 6671 and 9.69% lower than the VNS’s average of 6842. This indicates that the LNSGA algorithm can find more compact packing solutions, thereby minimizing the required box volume.Regarding computation time, the LNSGA algorithm exhibited remarkable efficiency compared to the GA and VNS algorithms. Across all test cases, the LNSGA algorithm reduced the runtime by more than 50% compared to the GA. As the number of orders increased from 2 to 8, the computation time of the GA algorithm showed a significant upward trend, ranging from 60 seconds to approximately 450 seconds. In contrast, the computation time of the LNSGA algorithm increased more gradually, reaching a maximum of around 168 seconds for the test case with eight orders. On average, the LNSGA algorithm had a computation time of 85.74 seconds, which is 58.38% faster than the GA’s average of 206.08 seconds.Compared to the VNS algorithm, the LNSGA algorithm demonstrated comparable computation times for smaller test cases with 2–4 orders. However, as the number of orders increased to 6 and 8, the LNSGA algorithm maintained its computational efficiency, while the VNS algorithm’s computation time increased more rapidly. Despite the slightly higher average computation time of the LNSGA algorithm (85.74 seconds) compared to the VNS algorithm (50.72 seconds), the LNSGA algorithm achieved significantly better objective values, justifying the marginal increase in computation time.(2)Computational experiments for large-scale orders.In this section, we mainly compared the performance of GA and LNSGA with more orders. The comparison results are shown in Table 11. From the perspective of the objective value, the LNSGA algorithm achieved better packing solutions than the GA algorithm in all cases. Although the average improvement in the target function value was not as significant as in the small-scale cases, the quality of solutions obtained by LNSGA still exhibited a significant advantage. In terms of computation time, the LNSGA algorithm also outperformed the GA algorithm, reducing the runtime by approximately 50%. As the number of orders in the test cases increased, the computation time of the GA algorithm showed an upward trend, while the growth of computation time for the LNSGA algorithm was more gradual. This once again validated the computational efficiency advantage of the LNSGA algorithm when dealing with large-scale complex orders.Thus, the LNSGA algorithm obtained superior packing solutions by introducing lower neighborhood search while ensuring computational efficiency. Even in complex environments with many orders, integrating genetic algorithm and local search in LNSGA still demonstrated significant effectiveness.

5. Conclusions and Prospects

5.1. Conclusion

In this paper, we introduced a novel metaheuristic approach to address the multiorder open-dimension 3D rectangular packing problem (3D-MOSB-ODRPP), a complex challenge exacerbated by the rapid growth of e-commerce. The proposed algorithm, a hybrid of a genetic algorithm and the Gurobi solver, effectively manages the complexity of the problem by combining global exploration and local optimization. The algorithm is underpinned by a mathematical model that accurately represents the multiorder open-dimension packing scenario and an enhanced genetic algorithm incorporating a lower neighborhood search strategy.

Extensive comparative experiments validate the effectiveness of the proposed approach. The LNSGA algorithm consistently outperforms the commercial solver Gurobi and the traditional genetic algorithm (GA) regarding both solution quality and computational efficiency. For small-scale instances, the LNSGA algorithm achieves optimal values in most test cases, with minimal deviation from the optimal values as the number of orders increases. For large-scale instances, the LNSGA algorithm demonstrates significant optimization improvements over Gurobi, with an average improvement of 50.16%. Compared to the GA, the LNSGA algorithm achieves a significant improvement in the objective function, ranging from 34.05% to 71.93%, while reducing the runtime by more than 50%.

The superior performance of the LNSGA algorithm can be attributed to its effective integration of the lower neighborhood search mechanism and the Gurobi solver. The targeted lower neighborhood search efficiently explores the packing box dimensions, avoiding unnecessary calculations and enhancing computational efficiency. The Gurobi solver, invoked after each local neighborhood search, ensures globally optimal packing solutions. This hybrid approach achieves an organic integration of global exploration and local search, enabling the algorithm to escape from local optima and obtain high-quality global optimal solutions.

Thus, combining a genetic algorithm with the Gurobi solver and incorporating a lower neighborhood search strategy, the proposed metaheuristic approach demonstrates significant effectiveness in tackling the complex 3D-MOSB-ODRPP. The approach addresses the current complex scenarios in e-commerce warehousing and sets a foundation for future research in the field of 3D packing optimization.

5.2. Management Insights

The findings of this study offer valuable insights for managers in e-commerce warehousing and logistics operations. The proposed metaheuristic approach provides an effective tool for optimizing the packing process, enabling managers to make informed decisions that maximize space utilization and minimize logistics costs.

First, the multiorder open-dimension packing model allows managers to simultaneously consider the varying requirements of different orders. By optimizing the packing of multiple orders into a single, size-adjustable container, managers can improve order consolidation and reduce the number of containers required, leading to significant cost savings in transportation and storage.

Second, the lower neighborhood search strategy incorporated in the enhanced genetic algorithm offers a practical approach for managers to explore optimal packing configurations. By adjusting the container’s length, width, and height within a specific range, managers can identify the most suitable container dimensions that balance the demands of different orders while maximizing space utilization.

Third, integrating the Gurobi solver with the mathematical approach ensures that the packing solutions obtained are globally optimal. This gives managers confidence that the recommended packing configurations are the best possible solutions, considering all relevant constraints and objectives.

Furthermore, the comparative experiments demonstrate the superior performance of the LNSGA algorithm over traditional methods, such as the commercial solver Gurobi and the pure genetic algorithm. Managers can leverage these findings to justify adopting the proposed approach in their operations, as it significantly improves both solution quality and computational efficiency.

5.3. Limitations and Future Work

While the proposed metaheuristic approach effectively addresses the 3D-MOSB-ODRPP, several limitations warrant attention in future research.

Primarily, the study focuses on rectangular items and containers, simplifying real-world packing scenarios. Future research could enhance the approach to handle irregular shapes and additional constraints.

In addition, computational experiments use randomly generated datasets, limiting real-world applicability. Future work should validate performance using real-world e-commerce data to assess scalability and robustness.

Furthermore, extending the approach to dynamic and online packing scenarios is essential for real-time operations, necessitating adaptive algorithms.

Integrating sustainability considerations, such as minimizing environmental impact, is a promising avenue for future research, enhancing the social responsibility of packing optimization.

Lastly, exploring applications beyond e-commerce, such as manufacturing and logistics, could leverage the approach’s versatility to solve optimization challenges in diverse industries.

Data Availability

The data used to support the findings of this study are included within the article.

Conflicts of Interest

The authors declare that they have no conflicts of interest regarding the publication of this paper.

Authors’ Contributions

J.Y. acquired the funding and wrote the original draft. H.L. and L.Z. supervised the study. K.L. validated the study. M.S. and L.K wrote, reviewed, and edited the study. All authors have read and agreed to the published version of the manuscript. Jianglong Yang and Huwei Liu contributed equally to this work and are co-first authors.

Acknowledgments

This study was supported by the Beijing Wuzi University Youth Research Fund (Project name: Research on Intelligent e-commerce Unmanned Warehouse Packing and Loading Optimization Strategy and Green Recycling Mode; Project no. 2023XJQN14), in part by the Beijing Municipal Education Commission Social Science General Project (Project name: Research on the Recycling and Sharing Mode of e-commerce Express Packaging Boxes in the Context of Digitalization in China; Project no. SM202410037007).