A hybrid adaptive genetic algorithm for 3D multi-box flexible packing

Through the hybrid adaptive genetic algorithm of three-dimensional multi-box flexible packing, the cargo packing sequence and box usage strategy are optimized, and the packing problem of diversified goods and boxes in e-commerce logistics is solved, achieving the minimum number of boxes and the largest packing rate, and improving logistics efficiency.

CN116644807BActive Publication Date: 2025-08-29CHINA UNIV OF PETROLEUM (EAST CHINA)
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310545031.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-16
Publication Date
2025-08-29
Estimated Expiration
2043-05-16

AI Technical Summary

Technical Problem

In e-commerce logistics, the types of goods are diverse and flexible, and the types of express boxes are diverse. It is difficult for the existing technology to achieve the optimal loading solution, resulting in low loading rates and large quantities of boxes, which affects logistics costs and transportation efficiency.

Method used

A hybrid adaptive genetic algorithm for three-dimensional multi-box flexible packing is adopted. By setting the fitness function, initialization, encoding, decoding, selection, crossover and mutating operations, combined with adaptive Metropolis rules, the cargo packing sequence and box usage strategy are optimized to achieve the minimum number of boxes and the largest packing rate.

Benefits of technology

It effectively improves the packing efficiency, reduces the number of unused space and containers, improves the loading rate, meets the needs of e-commerce logistics, and achieves the goal of minimum number of boxes and maximum packing rate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116644807B_ABST
    Figure CN116644807B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of box packing problems, and more specifically, to a hybrid adaptive genetic algorithm for three-dimensional multi-box flexible box packing. The algorithm comprises the following steps: 1: problem analysis: setting a fitness function consisting of two variables, namely, the minimum object loading number and the maximum box space utilization, based on the size of the objects and the space of the box containing the objects; 2: initialization and encoding, using a constructive heuristic algorithm to generate an initial population; 3: box packing and fitness calculation, decoding the individuals in the initial population in step 2, and calculating the individual fitness values ​​of the objects; 4: performing selection, crossover, and mutation operations; 5: improving the adaptive rules to obtain a new generation of populations; 6: performing termination judgment; and 7: obtaining the optimal box packing solution. The algorithm considers the two objectives of minimizing the loading rate and minimizing the number of boxes used. A linear weighting method is used to combine multiple objectives into a single objective, achieving the highest cargo loading and the most efficient space utilization.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of bin packing problems in combinatorial optimization problems, and in particular to a hybrid adaptive genetic algorithm for three-dimensional multi-box flexible bin packing. Background Art

[0002] As one of the four elements of e-commerce, logistics plays a crucial role. Logistics costs directly impact e-commerce profits. Logistics time and service quality directly impact an e-commerce company's reputation and customer satisfaction. Packaging is a crucial step in the logistics process. Choosing an economically appropriate box type for loading items can improve loading rates, maximize space utilization, and enhance transportation efficiency, while also reducing the cost of individual package consumables, ultimately generating significant economic benefits. Appropriate box types can also reduce the use of materials like fillers and tape, reducing the resulting waste generated by express delivery and maximizing social benefits. Currently, most companies rely heavily on employee experience when packing packages, making it difficult to achieve optimal loading plans. These factors can lead to problems such as low box loading rates and excessive box usage, impacting overall logistics costs and transportation efficiency.

[0003] During the packaging process, we need to pack a limited number of rectangular items with varying lengths, widths, and heights into a set of containers with varying lengths, widths, and heights. The goal is to minimize the number of containers while maximizing the loading efficiency. This problem has been studied by many researchers and is known as the three-dimensional multiple bin-size bin packing problem (3D-MBSBPP). However, in e-commerce logistics, goods are diverse and highly heterogeneous, and some are flexible, meaning their dimensions are not fixed. Express delivery boxes also vary, sometimes using specialized containers like bags, which also offer flexibility. E-commerce companies often prioritize minimizing the total number of containers while maximizing the loading efficiency. Taking all of this into account, the multi-bin, multi-objective three-dimensional flexible bin packing problem in e-commerce logistics studied in this application is a variant of the 3D-MBSBPP, referred to as the three-dimensional multiple bin-size flexible bin packing problem that considers item elasticity. Summary of the Invention

[0004] In response to the packing problems existing in the prior art, the purpose of this application is to provide a combinatorial optimization algorithm that can pack a group of elastic rectangular items into containers of different shapes with flexible parts, while minimizing unused space and the number of containers used, and obtaining a better packing strategy based on the characteristics of the items themselves.

[0005] To achieve the above objectives, the technical solution adopted by this application is: a hybrid adaptive genetic algorithm for three-dimensional multi-box flexible packing, comprising the following steps:

[0006] Step 1: Problem analysis: Based on the size of the object and the space of the box that carries the object, set a fitness function consisting of two variables: the minimum number of objects loaded and the maximum box space utilization. , where W is the space utilization, W max is the loading rate, Z is the number of boxes used, Z max is the gene length r of the box, It is the linear weighted sum of the functions of the two variables of minimum object loading number and maximum box space utilization;

[0007] Step 2: Perform initialization settings and encoding, read object information, sort objects according to their loading order, use chromosomes to represent the loading order of objects and the unpacking order of boxes, and use a constructive heuristic algorithm to generate the initial population;

[0008] Step 3: Pack and calculate fitness. Decode the individuals in the initial population in step 2, add elastic constraints based on whether the object is elastic, create a list of feasible loading solutions, and calculate the individual fitness of the object.

[0009] Step 4: Perform selection, crossover, and mutation operations, randomly select a mutant population, use the individual fitness value in step 3 as the judgment criterion, randomly select points on the chromosomes of the object loading order and the total number of objects to be loaded, and use the crossover operator on each chromosome to exchange genes between these points. The genes at the remaining positions in each chromosome are filled in according to the relative order in the original chromosome;

[0010] Step 5: Improve the adaptive Metropolis rule, correct all individuals in the population after crossover and mutation, and obtain a new generation of population;

[0011] Step 6: Perform a termination judgment to determine whether the maximum number of iterations has been reached;

[0012] Step 7: Output the best individual in the population, decode the best individual, and obtain the best packing solution.

[0013] The hybrid adaptive genetic algorithm for three-dimensional multi-box flexible packing described above, step 2 includes the following steps:

[0014] Step 2.1: Set the parameters of the genetic algorithm, including population size, selection ratio, mutation ratio, number of iterations, and parameters of the simulated annealing algorithm;

[0015] Step 2.2: Sort the items by volume, length, height, and width using the loading order;

[0016] Step 2.3: Each solution to the packing problem is represented by two chromosomes, P and Q. Chromosome P is the order in which the items are loaded. The total number of items to be loaded is the length of chromosome P, which is set to n and takes values ​​of {1, 2, ..., n}. Chromosome Q represents the order in which the boxes are unpacked. The gene length of the unpacking order is set to r. Gene 0 is used to make up for the lack of boxes. That is, the gene randomly takes values ​​in the range {0, 1, 2, ..., s}, where s is the number of object types. The average volume of the optional boxes is used to estimate the number of boxes used. The length is then quadrupled and rounded up to the nearest integer, i.e.: , where l i , w i , h i are the length, width and height of cargo i, S is the number of object types, L i , W i , H i are the length, width and height of the box containing cargo i.

[0017] In the hybrid adaptive genetic algorithm for three-dimensional multi-box flexible packing, step 3 includes the following steps:

[0018] Step 3.1: Decode the individuals in the population and create two box lists L1 and L2, where L1 contains all the boxes and L2 is empty;

[0019] Step 3.2: Determine whether L1 is empty. If so, select the next box and add elastic constraints based on whether the box itself is elastic. Create a list of feasible loading solutions. If L1 is empty, go to 3.8.

[0020] Step 3.3: Create a list of feasible loading solutions. Specifically, when the lower left corner vertex of item i is placed at an extreme point in a certain direction, determine whether the item meets the following three conditions: item i does not overlap with other previously packaged items, item i does not exceed the range of the box containing item i, and item i and the previously packaged items meet the stability constraint. If these three conditions are met, add the loading solution represented by the placement orientation and the point EP (xEP, yEP, zEP) at the lower left rear of the target space to the list of feasible loading solutions.

[0021] Step 3.4: If the list of feasible loading solutions is not empty, go to step 3.5 to select the best loading solution; if the list of feasible loading solutions is empty, go to step 3.6;

[0022] Step 3.5: Select the best loading solution. For the item i to be packed, the evaluation function MF is to minimize the difference between its size and the box size. The evaluation function of each loading solution is calculated separately, and the loading solution with the smallest evaluation function is selected as the best loading solution. The loading solution evaluation function is as follows: , the remaining space RS is the available space around the EP point at the lower left rear of the target space, RS x , RS y , RS z are the available spaces in the x-axis, y-axis, and z-axis directions, respectively; θ1, θ2, and θ3 are the compression ratios of the elastic box;

[0023] Step 3.6: Determine whether the box is elastic. If so, place the item in L2 and go to 3.2. If not, open a new box, place the item in the first spatial location, and go to 3.7.

[0024] Step 3.7: If the box type is a bag, it needs to be constructed into a box. The length between the cargo and the box edge in the X and Y axes is calculated, and the space on the X and Y axes is sacrificed to the greatest extent possible, thereby increasing the height and forming a new loading space. The lower left vertex of the cargo is placed on the optimal loading solution to generate a new EP. Then, the final list of new EPs is merged into the global EP list, and go to 3.2.

[0025] Step 3.8: Determine whether L2 is completely traversed. If it is, end the constructive heuristic algorithm and obtain the initial solution. Otherwise, go to 3.9.

[0026] Step 3.9: Create a list of feasible loading options. If the list is empty, open a new box and place the goods at the first EP point. If the list is not empty, select the best loading option, place the goods, and go to 3.8.

[0027] Step 3.10: Calculate the fitness value of each individual based on the fitness function in step 1. The fitness function is consistent with the objective function. The fitness function is the fitness function of the linear combination of the two variables in step 1: the minimum loading number and the maximum box space utilization.

[0028] In the hybrid adaptive genetic algorithm for three-dimensional multi-box flexible packing, step 4 includes the following steps:

[0029] Step 4.1: Use the elite retention strategy as the selection operator, define elite individuals based on fitness, select elite individuals and skip the crossover operation to copy them directly to the next generation. In each generation, select the 15% elite individuals with the highest fitness to copy to the next generation.

[0030] Step 4.2: Randomly select two points in chromosome P as crossover operators and exchange genes between these points. Then the genes at the remaining positions in the chromosome are filled in according to their relative order in the original chromosome. The crossover operator of chromosome Q randomly selects two points in the chromosome and directly exchanges genes between these points. For a few individuals, chromosomes P and Q mutate by reversing the sequences of random blocks therein.

[0031] The above-mentioned hybrid adaptive genetic algorithm for three-dimensional multi-box flexible packaging, step 5 includes the following steps: if the fitness of the j-th individual in the population after crossover mutation is greater than the fitness of the j-th individual in the previous population, then the individual is saved as the j-th individual in the new generation population.

[0032] The hybrid adaptive genetic algorithm for three-dimensional multi-box flexible packing mentioned above, said step 5 includes the following steps: if the fitness of the j-th individual in the population after crossover mutation is less than or equal to the fitness of the function value before crossover mutation, then Accept this individual as the jth individual in the new generation population: ,in: is the function value of the jth individual in the population after crossover mutation selection, is the function value of selecting the jth individual in the population before crossover mutation, For probability The attenuation coefficient, , T is the current temperature of the annealing algorithm; if the function value of the jth individual in the population after crossover mutation is selected Greater than the function value before crossover mutation , then traverse all genes of the individual chromosome and use the probability Each gene is swapped with a random gene on the chromosome with a probability of 0.01 and then saved. Otherwise, the individual is restored to the jth individual in the population before crossover mutation, and so on. The jump probability P2 is defined as: ,in For probability The attenuation coefficient, ; If the function value of the jth individual in the population after crossover mutation is selected equal According to the probability After crossover mutation is selected, two groups of continuous sub-chromosomes of the same length are randomly selected from the chromosome of the individual with a probability of 0.1, and are swapped with each other and saved. Otherwise, it is restored to the jth individual in the population before crossover mutation, and so on.

[0033] In any of the above hybrid adaptive genetic algorithms for three-dimensional multi-box flexible packing, step 6 comprises the following steps:

[0034] Step 6.1: Determine whether the maximum number of iterations has been reached. If so, go to step 7; otherwise, adaptively update the mutation operator probability and crossover operator probability.

[0035] Step 6.2: The convergence speed of the algorithm and the search results are greatly affected by the crossover probability P c and mutation probability P m The influence of crossover probability P c and mutation probability P m The settings are as follows: , where: , and are the average fitness value and the maximum fitness value in the population, respectively. and They are the larger fitness value of the crossover individual and the fitness value of the mutation individual respectively. After the update is completed, go to step 2.

[0036] In the hybrid adaptive genetic algorithm for three-dimensional multi-box flexible packing, the weights of the two variables, minimum number of object loading and box space utilization, are set to 0.7 and 0.3, the population size is 30, the maximum number of iterations is 100, k1, k2, k3, and k4 are 0.9, 0.9, 0.5, and 0.5 respectively, the initial annealing temperature is 100, and the annealing decrease rate is 0.98.

[0037] The beneficial effect of the hybrid adaptive genetic algorithm for three-dimensional multi-box flexible packing of the present invention is that the present invention fills the gap in the research of three-dimensional packing problems that are objective, reasonable, and consistent with e-commerce logistics. The adaptive hybrid genetic algorithm proposed in the present invention has relatively good algorithm performance in solving the corresponding problem. The technical solution described in the present invention provides a hybrid adaptive genetic algorithm that can better achieve the minimum number of boxes and the maximum packing rate. Taking into account the two goals of minimum loading rate and minimum number of boxes used, a linear weighted method is used to merge multiple goals into one goal for multiple goals, resulting in the highest cargo loading and the most reasonable space utilization. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 This is a flow chart of the constructive heuristic algorithm of the present invention;

[0039] Figure 2 This is a flow chart of the adaptive hybrid genetic algorithm of the present invention;

[0040] Figure 3 This is an example of genetic algorithm coding according to the present invention;

[0041] Figure 4 Schematic diagram of the chromosome P crossover operator of the present invention;

[0042] Figure 5 Schematic diagram of the chromosome Q crossover operator of the present invention;

[0043] Figure 6 Schematic diagram of the chromosome P and Q mutation operators of the present invention;

[0044] Figure 7 is the evolution curve of the hybrid adaptive genetic algorithm. Implementation Method

[0045] In order to enable those skilled in the art to better understand the technical solution of the present invention, the technical solution of this application is described below in conjunction with specific implementation methods and drawings.

[0046] This application is based on existing open-source data from a company, containing a total of 1,000 packing examples. There are 20 container types: 7 bag containers and 13 box containers. Bag containers are variable. The data includes 29 types of boxes, some of which are flexible and can be modified based on the actual packing situation. The examples are divided into four groups based on the number of boxes: 50, 100, 150, and 200, to test the algorithm's efficiency in different packing scenarios.

[0047] This invention addresses the problem of three-dimensional, multi-box flexible packing that takes into account item elasticity. To overcome the aforementioned issues with existing technologies, a hybrid adaptive genetic algorithm is proposed that effectively minimizes the number of boxes and maximizes the packing rate. This algorithm considers the dual objectives of minimizing the packing rate and minimizing the number of boxes used. A linear weighting method is employed to combine these multiple objectives into a single one.

[0048] like Figure 1-7 As shown, a hybrid adaptive genetic algorithm for three-dimensional multi-box flexible packing includes the following steps: Step 1: Problem analysis.

[0049] Considering the practice of some flexible items being boxed or bagged in the express delivery industry, the cargo information is first preprocessed based on the remaining space in the container, and the box size is specifically compressed. The cargo information is then read, including the size of the container, the type of cargo and box, and the corresponding size and quantity. Based on the company's needs, a function with the lowest number of boxes and the highest space utilization is set as the fitness function used by the genetic algorithm following this technical solution. The fitness function of this technical solution, which is a linear combination of the functions with the lowest number of boxes and the highest space utilization, is as follows: , where W is the space utilization rate and the loading rate W max is 1, Z is the number of boxes used, Z max is the gene length r of the box, The sum of the linear weights of the functions of the two variables of the minimum number of objects loaded and the maximum box space utilization is 1.

[0050] Step 2: Initialize the algorithm and set up the code.

[0051] Step 2.1: Set the parameters of the genetic algorithm, including population size, selection ratio, mutation ratio, number of iterations, and parameters of the simulated annealing algorithm.

[0052] Step 2.2: Sort the items in the order of volume, length, height, and width.

[0053] Step 2.3: Each solution to the packing problem is represented by two chromosomes, P and Q. Chromosome P is the order in which the items are loaded. The total number of items to be loaded is the length of chromosome P, which is set to n and takes values ​​of {1, 2, ..., n}. Chromosome Q represents the order in which the boxes are unpacked. The gene length of the unpacking order is set to r. Gene 0 is used to make up for the lack of boxes. That is, the gene randomly takes values ​​in the range {0, 1, 2, ..., s}, where s is the number of object types. The average volume of the optional boxes is used to estimate the number of boxes used. The length is then quadrupled and rounded up to the nearest integer, i.e.: , where l i , w i , h i are the length, width and height of cargo i, S is the number of object types, L i , W i , H i are the length, width and height of the box containing cargo i.

[0054] Step 3: Binning and calculating fitness.

[0055] 3.1 Decode the individuals in the population and create two lists of items L1 and L2, where L1 contains all the items and L2 is empty.

[0056] 3.2 Check if L1 is empty. If so, go to 3.8. If not, select the next item and add elastic constraints based on whether the item itself is elastic, creating a list of feasible loading solutions.

[0057] 3.3 Create a list of feasible loading plans. Specifically, when the lower left corner vertex of item i is placed at an extreme point in a certain direction, determine whether the item meets the following three conditions: item i does not overlap with other previously packed items; item i does not exceed the bounds of the box containing item i; and item i and the previously packed items meet stability constraints. If these three conditions are met, the loading plan represented by the placement position and the lower left rear point EP (xEP, yEP, zEP) in the target space is added to the list of feasible loading plans.

[0058] 3.4 If the list of feasible loading solutions is not empty, go to 3.5 to select the best loading solution. If the list of feasible loading solutions is empty, go to 3.6.

[0059] 3.5 Select the best loading solution. For the item i to be packed, the evaluation function (MF) is to minimize the difference between its size and the size of the item. Calculate the evaluation function for each loading solution and select the one with the smallest evaluation function as the best loading solution. The loading solution evaluation function is as follows: , the remaining space (RS) is the available space around the lower left point (EP point) of the target space, RS x , RS y , RS z are the available spaces in the x-axis, y-axis, and z-axis directions, respectively; θ1, θ2, and θ3 are the compression ratios of elastic items, respectively.

[0060] 3.6 Determine whether the cargo is elastic. If so, place the cargo in L2 and proceed to 3.2. If not, open a new box and place the cargo in the first spatial location and proceed to 3.7.

[0061] 3.7 If the box type is a bag, it needs to be constructed into a box and the length between the cargo and the box edge in the X and Y axis directions is calculated. The space of the X and Y axes is sacrificed to the greatest extent, thereby increasing the height and forming a new loadable space. The lower left vertex of the cargo is placed on the optimal loading solution, a new EP is generated, the extreme point list of the box where the cargo is located is updated, and the extreme point list is tested to test whether the elastic cargo in L2 can be loaded into these newly generated extreme points. If there are one or more feasible extreme points, the elastic cargo will be placed in the optimal extreme point and the cargo will be deleted from the L2 list. Then, the final list of new EPs is merged into the global EP list, and go to 3.2.

[0062] 3.8 Determine whether L2 is completely traversed. If so, terminate the constructive heuristic algorithm and obtain the initial solution. Otherwise, go to 3.9.

[0063] 3.9 Create a list of possible loading options. If the list is empty, open a new box and place the cargo at the first EP. If the list is not empty, select the best loading option and place the cargo. Go to 3.8.

[0064] 3.10 Based on the fitness function in step 1, calculate the fitness value of each individual. The fitness function is consistent with the objective function. The fitness function is the fitness function of the linear combination of the two functions in step 1.

[0065] Step 4: Perform selection, crossover, and mutation operations.

[0066] 4.1 We use an elite retention strategy as the selection operator. We define elite individuals based on fitness. Individuals with the highest fitness in the population, and those with the most high-value genes, are considered elite individuals. Elite individuals are selected and directly replicated to the offspring, skipping the crossover operation. In each generation, the top 15% of elite individuals with the highest fitness are selected and replicated to the next generation.

[0067] 4.2 The crossover operator randomly selects two points on chromosome P and swaps genes between them. The remaining genes on the chromosome are then populated according to their relative order in the original chromosome. The crossover operator on chromosome Q randomly selects two points on the chromosome and swaps genes directly between them. For a small number of individuals, chromosomes P and Q are mutated by reversing the sequence of random blocks within them. Here, for example, chromosomes P1, P2, and P3 are used. After the first crossover point, the remaining genes on the chromosomes are populated according to their relative order in the original chromosome. The crossover operator on chromosome Q randomly selects two points on the chromosome and swaps genes directly between them. Here, for example, chromosomes Q1, Q2, Q3, and Q4 are used. After the gene swap, chromosomes Q1 and Q2 become Q3 and Q4. Chromosomes P and Q are mutated by reversing the sequence of random blocks within them. This is performed on individuals not selected for the crossover operation. To significantly alter the process of solution mutation and prevent a localized search in the solution space, the percentage of the population to be mutated is randomly selected.

[0068] Step 5: Improve the adaptive Metropolis rule to set the annealing operator.

[0069] To achieve more efficient sampling, we use an improved adaptive Metropolis rule to adaptively adjust the annealing operator step size based on the current acceptance rate. We then select all individuals in the cross-compiled population to generate a new generation of populations.

[0070] Transition probability is one of the important factors affecting sampling efficiency. Transition probability can be used to measure the difficulty of transitioning from one state to another. If the transition probability is too small, it may lead to low sampling efficiency; if the transition probability is too large, it may cause algorithm instability, slow convergence or deviation. Define transition probability : ,in: is the function value of the jth individual in the population after crossover mutation selection, is the function value of selecting the jth individual in the population before crossover mutation, For probability The attenuation coefficient, , T is the current temperature of the annealing algorithm.

[0071] If the function value of the jth individual in the population after crossover mutation is selected Greater than the function value before crossover mutation , then traverse all genes of the individual chromosome and use the probability Each gene is swapped with a random gene on the chromosome with a probability of 0.01 and then saved. Otherwise, the individual is restored to the jth individual in the population before crossover mutation, and so on.

[0072] Attenuation coefficient A larger value needs to be set to make the jump probability This makes the algorithm have stronger hill climbing ability, and The decay rate is faster as the temperature decreases.

[0073] Define the transition probability P2: ,in For probability The attenuation coefficient, , T is the current temperature of the annealing algorithm.

[0074] If the function value of the jth individual in the population after crossover mutation is selected equal According to the probability (It decreases slowly as the temperature drops.) After selecting crossover mutation, two groups of continuous sub-chromosomes of the same length are randomly selected from the chromosomes of the individual with a probability of 0.1, and they are swapped with each other and saved (if the two groups of chromosomes have an intersection, the intersection remains unchanged, and the areas outside the intersection are swapped with each other). Otherwise, it is restored to the jth individual in the population before selecting crossover mutation, and so on.

[0075] when = When selecting the same individual before and after the crossover mutation, although the order of the chromosome genes is the same, the chromosome first gene may be different (the chromosome gene has shifted), and the crossover mutation in the subsequent iteration process will also be different. Attenuation coefficient A small value needs to be set to reduce the probability of a jump to a slower decay rate. It can enable the algorithm to have higher local search capabilities in the later stages of optimization.

[0076] Step 6: Make a termination decision.

[0077] 6.1 Determine whether the maximum number of iterations has been reached. If so, go to step 7; otherwise, adaptively update the mutation operator probability and crossover operator probability.

[0078] 6.2 The convergence speed of the algorithm and the search results are greatly affected by the crossover probability P c and mutation probability P m The influence of crossover probability P c and mutation probability P m The settings are as follows: , where: , and are the average fitness value and the maximum fitness value in the population, respectively. and are the larger fitness value of the crossover individual and the fitness value of the mutation individual respectively. After the update is completed, go to step 2.

[0079] Step 7: Output the best individual in the population.

[0080] The best packing solution is obtained by decoding the optimal individual, and the loading process ends.

[0081] Next, the above implementation scheme is simulated. Figure 7 is the hybrid adaptive genetic algorithm evolution curve of the present invention, Figure 7 (a) states that the number of items is 50, Figure 7 (b) express the number of items as 100, Figure 7 (c) stating that the number of items is 150, Figure 7 (d) The number of items is 200. In the adaptive hybrid genetic algorithm, the population size is 30, the maximum number of iterations is 100, k1, k2, k3, and k4 are 0.9, 0.9, 0.5, and 0.5 respectively. The initial annealing temperature is 100, and the annealing decrease rate is 0.98. The greater the fluctuation of the average value curve, the greater the difference in the population, and the greater the possibility that the algorithm will jump out of the local optimal solution. The faster the optimal solution converges, the higher the execution efficiency of the algorithm. The adaptive hybrid genetic algorithm uses the Metrolpis acceptance criterion to accept new solutions after crossover and mutation, so the number of different individuals in the population is relatively large, and it is easy to jump out of the local optimal solution. Figure 7 As shown in the figure, even if the optimal solution initially generated is not very good, the algorithm can quickly find the optimal solution due to the large diversity of the population.

[0082] The above embodiments are intended only to illustrate the inventive concepts and features of the present invention. Their purpose is to enable those skilled in the art to understand the present invention and implement it accordingly. They are not intended to limit the scope of protection of the present invention. Any equivalent variations or modifications based on the essence of the present invention are intended to be encompassed within the scope of protection of the present invention.

Claims

1. A hybrid adaptive genetic algorithm for three-dimensional multi-box flexible packing, characterized by: The following steps are involved: Step 1: Problem analysis: Based on the size of the object and the space of the box that carries the object, set a fitness function consisting of two variables: the minimum number of objects loaded and the maximum box space utilization. , where W is the space utilization, W max is the loading rate, Z is the number of boxes used, Z max is the gene length r of the box, It is the linear weighted sum of the functions of the two variables of minimum object loading number and maximum box space utilization; Step 2: Perform initialization and encoding, read object information, sort objects according to their loading order, use chromosomes to represent the loading order of objects and the unpacking order of boxes, and use a constructive heuristic algorithm to generate the initial population, including: Step 2.1: Set the parameters of the genetic algorithm, including population size, selection ratio, mutation ratio, number of iterations, and parameters of the simulated annealing algorithm; Step 2.2: Sort the items by volume, length, height, and width using the loading order; Step 2.3: Each solution to the packing problem is represented by two chromosomes, P and Q. Chromosome P is the order in which the items are loaded. The total number of items to be loaded is the length of chromosome P, which is set to n and takes values ​​of {1, 2, ..., n}. Chromosome Q represents the order in which the boxes are unpacked. The gene length of the unpacking order is set to r. Gene 0 is used to make up for the lack of boxes. That is, the gene randomly takes values ​​in the range {0, 1, 2, ..., s}, where s is the number of object types. The average volume of the optional boxes is used to estimate the number of boxes used. The length is then quadrupled and rounded up to the nearest integer, i.e.: , where l i , w i , h i are the length, width and height of cargo i, L i , W i , H i are the length, width and height of the box containing cargo i; Step 3: Pack and calculate fitness. Decode the individuals in the initial population in step 2, add elastic constraints based on whether the object is elastic, create a list of feasible loading solutions, and calculate the individual fitness of the object. Step 4: Perform selection, crossover, and mutation operations, randomly select a mutant population, use the individual fitness value in step 3 as the judgment criterion, randomly select points on the chromosomes of the object loading order and the total number of objects to be loaded, and use the crossover operator on each chromosome to exchange genes between these points. The genes at the remaining positions in each chromosome are filled in according to the relative order in the original chromosome; Step 5: Improve the adaptive Metropolis rule, correct all individuals in the population after crossover and mutation, and obtain a new generation of population; Step 6: Perform a termination judgment to determine whether the maximum number of iterations has been reached; Step 7: Output the best individual in the population, decode the best individual, and obtain the best packing solution.

2. The hybrid adaptive genetic algorithm for three-dimensional multi-box flexible packaging according to claim 1, characterized in that: The step 3 comprises the following steps: Step 3.1: Decode the individuals in the population and create two box lists L1 and L2, where L1 contains all the boxes and L2 is empty; Step 3.2: Determine whether L1 is empty. If so, select the next box and add elastic constraints based on whether the box itself is elastic. Create a list of feasible loading solutions. If L1 is empty, go to 3.

8. Step 3.3: Create a list of feasible loading solutions. Specifically, when the lower left corner vertex of item i is placed at an extreme point in a certain direction, determine whether the item meets the following three conditions: item i does not overlap with other previously packaged items, item i does not exceed the range of the box containing item i, and item i and the previously packaged items meet the stability constraint. If these three conditions are met, add the loading solution represented by the placement orientation and the point EP (xEP, yEP, zEP) at the lower left rear of the target space to the list of feasible loading solutions. Step 3.4: If the list of feasible loading solutions is not empty, go to step 3.5 to select the best loading solution; if the list of feasible loading solutions is empty, go to step 3.6; Step 3.5: Select the best loading solution. For the item i to be packed, the evaluation function MF is to minimize the difference between its size and the box size. The evaluation function of each loading solution is calculated separately, and the loading solution with the smallest evaluation function is selected as the best loading solution. The loading solution evaluation function is as follows: , the remaining space RS is the available space around the EP point at the lower left rear of the target space, RS x , RS y , RS z are the available spaces in the x-axis, y-axis, and z-axis directions, respectively; θ1, θ2, and θ3 are the compression ratios of the elastic box; Step 3.6: Determine whether the box is elastic. If so, place the item in L2 and go to 3.

2. If not, open a new box, place the item in the first spatial location, and go to 3.

7. Step 3.7: If the box type is a bag, it needs to be constructed into a box. The length between the cargo and the box edge in the X and Y axes is calculated, and the space on the X and Y axes is sacrificed to the greatest extent possible, thereby increasing the height and forming a new loading space. The lower left vertex of the cargo is placed on the optimal loading solution to generate a new EP. Then, the final list of new EPs is merged into the global EP list, and go to 3.

2. Step 3.8: Determine whether L2 is completely traversed. If it is, end the constructive heuristic algorithm and obtain the initial solution. Otherwise, go to 3.

9. Step 3.9: Create a list of feasible loading options. If the list is empty, open a new box and place the goods at the first EP point. If the list is not empty, select the best loading option, place the goods, and go to 3.

8. Step 3.10: Calculate the fitness value of each individual based on the fitness function in step 1. The fitness function is consistent with the objective function. The fitness function is the fitness function of the linear combination of the two variables in step 1: the minimum loading number and the maximum box space utilization.

3. The hybrid adaptive genetic algorithm for three-dimensional multi-box flexible packaging according to claim 2, characterized in that: The step 4 comprises the following steps: Step 4.1: Use the elite retention strategy as the selection operator, define elite individuals based on fitness, select elite individuals and skip the crossover operation to copy them directly to the next generation. In each generation, select the 15% elite individuals with the highest fitness and copy them to the next generation. Step 4.2 Randomly select two points in chromosome P as crossover operators and exchange genes between these points. Then the genes at the remaining positions in the chromosome are filled in according to their relative order in the original chromosome. The crossover operator of chromosome Q randomly selects two points in the chromosome and directly exchanges genes between these points. For a few individuals, chromosomes P and Q mutate by reversing the sequences of random blocks therein.

4. The hybrid adaptive genetic algorithm for three-dimensional multi-box flexible packaging according to claim 3, characterized in that: The step 5 comprises the following steps: If the fitness of the jth individual in the population after crossover mutation is greater than the fitness of the jth individual in the previous population, the individual is saved as the jth individual in the new generation population.

5. The hybrid adaptive genetic algorithm for three-dimensional multi-box flexible packaging according to claim 3, characterized in that: The step 5 comprises the following steps: If the fitness of the jth individual in the population after crossover mutation is less than or equal to the fitness of the function value before crossover mutation, then the probability Accept this individual as the jth individual in the new generation population, ,in: is the function value of the jth individual in the population after crossover mutation selection, is the function value of selecting the jth individual in the population before crossover mutation, For probability The attenuation coefficient, , T is the current temperature of the annealing algorithm; If the function value of the jth individual in the population after crossover mutation is selected Greater than the function value before crossover mutation , then traverse all genes of the individual chromosome and use the probability For each gene, the position is swapped with a random gene on the chromosome with a probability of 0.01 and then saved. Otherwise, the individual is restored to the jth individual in the population before crossover mutation, and so on. Define the transition probability P2: ,in For probability The attenuation coefficient, ; If the function value of the jth individual in the population after crossover mutation is selected equal According to the probability After crossover mutation is selected, two groups of continuous sub-chromosomes of the same length are randomly selected from the chromosome of the individual with a probability of 0.1, and are swapped with each other and saved. Otherwise, it is restored to the jth individual in the population before crossover mutation, and so on.

6. The hybrid adaptive genetic algorithm for three-dimensional multi-box flexible packaging according to any one of claims 4 or 5, characterized in that: The step 6 comprises the following steps: Step 6.1: Determine whether the maximum number of iterations has been reached. If so, go to step 7; otherwise, adaptively update the mutation operator probability and crossover operator probability. Step 6.2: The convergence speed of the algorithm and the search results are greatly affected by the crossover probability P c and mutation probability P m The influence of crossover probability P c and mutation probability P m The settings are as follows: , where: , and are the average fitness value and the maximum fitness value in the population, respectively. and They are the fitness values ​​of the crossover individual and the fitness values ​​of the mutation individual respectively. After the update is completed, go to step 2.

7. The hybrid adaptive genetic algorithm for three-dimensional multi-box flexible packaging according to claim 6, characterized in that: The weights of the two variables, minimum object loading number and box space utilization, are set to 0.7 and 0.3, the population size is 30, the maximum number of iterations is 100, k1, k2, k3, and k4 are 0.9, 0.9, 0.5, and 0.5 respectively, the initial annealing temperature is 100, and the annealing decrease rate is 0.98.

Citation Information

Patent Citations

  • Modular container boxing method under PI scene based on adaptive hybrid genetic algorithm

    CN115455816A