A two-dimensional irregular bin packing optimization method based on multi-neighborhood large neighborhood search
By adopting the multi-neighborhood large neighborhood search optimization method in two-dimensional irregular packing, the algorithm parameters are adaptively adjusted, and the solutions are damaged and repaired, and the problems of narrow solution space search and low computational efficiency in the existing technology are solved, achieving efficient and stable high-quality solution output.
Patent Information
- Application Number
- CN202510168437.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-17
- Publication Date
- 2025-05-13
- Estimated Expiration
- 2045-02-17
AI Technical Summary
The existing two-dimensional irregular packing technology is difficult to output high-quality solutions in a short time when the solution space search range is narrow and the computational efficiency is low.
The optimization method based on multi-neighborhood large neighborhood search is adopted, and parameters that affect significant effects through adaptive calculation algorithm efficiency are explored, polygon allocation is destroyed and repaired, the current solution is obtained, and the current solution is decided through the fitness comparison.
It significantly improves the search range and calculation efficiency, steadily optimizes and improves the allocation of local polygons, obtains local optimal allocation, and improves the quality and stability of the scheme.
Smart Images

Figure CN119670981B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of two-dimensional box packing, and in particular relates to a two-dimensional irregular box packing optimization method based on multi-neighborhood large neighborhood search. Background Art
[0002] Two-dimensional irregular packing is an important optimization problem, which is widely used in metal processing, furniture manufacturing, textile and shipbuilding industries. The purpose is to maximize material utilization, reduce waste and reduce production costs by optimizing the arrangement of irregular parts on the material board. Traditional packing methods mostly rely on manual experience, which makes it difficult to use materials efficiently, and have limited adjustment and optimization capabilities when facing complex problems. In contrast, two-dimensional irregular packing technology can not only significantly improve material utilization through systematic optimization methods, but also adapt to more complex arrangement requirements and improve overall production efficiency. However, the current two-dimensional irregular packing technology cannot output high-quality solutions in a short time due to its narrow search range of the solution space and low computational efficiency. Summary of the invention
[0003] To solve the above technical problems, the present invention provides a two-dimensional irregular packing optimization method based on multi-neighborhood large neighborhood search, which can efficiently and quickly provide a high-utilization, non-overlapping two-dimensional irregular packing solution.
[0004] To achieve the above object, the present invention adopts the following technical solutions:
[0005] A two-dimensional irregular packing optimization method based on multi-neighborhood large neighborhood search, comprising:
[0006] Construct an initial feasible solution based on polygon and container information and use it as the current solution;
[0007] Adaptively calculate the parameters that have a significant impact on the efficiency of the multi-neighborhood large neighborhood search algorithm based on the information of the initial feasible solution, including the selection probability of the neighborhood operator and reorganization neighborhood operator The size of the neighborhood;
[0008] The polygon allocation is explored through the parameters that have a significant impact on the algorithm efficiency as described in the multi-neighborhood large neighborhood search algorithm, the current solution is destroyed and repaired, the search solution is obtained, and the fitness of the current solution and the search solution are compared to decide whether to use the search solution to update the current solution; wherein, in the process of destroying and repairing the current solution, the single container packing problem optimization algorithm is used to determine whether the polygon can be placed in the container without overlapping, to ensure that the search solution is feasible.
[0009] The beneficial effects of the present invention are:
[0010] By performing multi-neighborhood large neighborhood search based on adaptive parameters on the search neighborhood formed by selecting several containers, the search range is greatly improved under the synergistic effect of multiple neighborhoods, the allocation of local polygons can be stably optimized and improved, and the local optimal allocation can be obtained. Compared with manual design methods or other algorithms, the quality and stability of the solution are significantly improved, and it is suitable for two-dimensional irregular packing problems of various scales. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] Figure 1 A flowchart of a two-dimensional irregular bin packing optimization method based on multi-neighborhood large neighborhood search according to the present invention;
[0012] Figure 2 A schematic diagram of the principle of constructing an initial feasible solution for the present invention;
[0013] Figure 3 It is a schematic diagram of the principle of multi-neighborhood large neighborhood search of the present invention;
[0014] Figure 4 This is a schematic diagram of the principle of the search process of the reorganization operator of the present invention;
[0015] Figure 5 It is a schematic diagram of the principle of the overlapping removal method of the present invention. DETAILED DESCRIPTION
[0016] The following is a clear and complete description of the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the protection scope of the present invention.
[0017] The present invention provides a two-dimensional irregular packing optimization method based on multi-neighborhood large neighborhood search, such as Figure 1 As shown, it mainly includes the following steps:
[0018] Step 1: Construct an initial feasible solution as the current solution based on the polygon and container information.
[0019] In the embodiment of the present invention, the information of the polygon includes its shape and a set of rotatable angles, and each polygon shape is represented by a set of vertices; The vertex set of a polygon is denoted by , the set of rotatable angles is recorded as Any current solution to the two-dimensional irregular packing problem can be represented as a two-layer set ;in is the total number of containers used; , , , They are all containers, where each container can be represented as a collection of polygon information placed in the container.
[0020] In the embodiment of the present invention, some polygons are defined as special polygons, and an initial feasible solution is constructed using a strategy of evenly distributing the special polygons.
[0021] Exemplarily, large-area polygons may be defined as special polygons, and uniform distribution of large-area polygons may be achieved based on the best fit algorithm and the round-robin method to prevent multiple large-area polygons from being distributed to the same container, resulting in poor results. Figure 2 An example of constructing an initial feasible solution using a method based on the best fit algorithm and the polling algorithm is provided. The diamonds numbered sequentially from 1 to 7 are the large-area polygons, and the first container gives a complete initial result. The heuristic algorithm includes two steps: using a polling process and a best fit algorithm. The best fit method and the polling method are used to achieve uniform distribution of special polygons. The polling method distributes special polygons to several containers in turn and uses the single container packing problem optimization algorithm to determine the feasibility. After an infeasible distribution occurs or all special polygons are distributed, for each undistributed polygon, a container is gradually selected from high to low according to the container utilization rate until the single container packing problem optimization algorithm obtains a feasible distribution.
[0022] Specifically, the polling process distributes large-area polygons to several containers in turn. The formula for the number of containers is:
[0023]
[0024] In the formula, Indicates The area of the polygon, L and W represent the length and width of the container. Indicates the total number of polygons. is the lower bound of the number of containers, that is, the number of containers contained in any feasible solution will not be less than For any , No. polygons are assigned to containers, and use the single container packing problem optimization algorithm to calculate the position and rotation angle information of each polygon when there is no overlap between polygons. When the single container packing problem optimization algorithm for a certain allocation fails to make the polygons overlap, the polling process is terminated. All other unallocated polygons are allocated to containers using the best fit algorithm. In an embodiment of the invention, for each polygon, containers are gradually selected from high to low according to the container utilization rate, and the polygons are tried to be allocated to the selected containers until the single container packing problem optimization algorithm calculates a feasible allocation. If all containers fail to obtain a feasible allocation, an additional empty container is created and the polygon is placed in it. After all polygons are feasibly allocated, an initial feasible solution is obtained, and the initial feasible solution is used as the current solution at the beginning of the multi-neighborhood large neighborhood search.
[0025] Step 2: Adaptively calculate the parameters that have a significant impact on the efficiency of the multi-neighborhood large neighborhood search algorithm based on the information of the initial feasible solution.
[0026] In the embodiment of the present invention, the adaptive parameter determines the probability of selecting the neighborhood operator that has a great impact on the algorithm efficiency. and reorganization neighborhood operator The neighborhood size.
[0027] In the embodiment of the present invention, the neighborhood operator is composed of a small amplitude disturbance operator , a reorganization neighborhood operator that significantly changes the solution structure , the completion neighborhood operator that completes the solution space Composition, where the reorganization neighborhood operator and the completion neighborhood operator It is suitable for the case where the container contains a few polygons, and the small amplitude perturbation operator On the contrary, selecting more appropriate neighborhood operators can improve the search success rate and thus improve the efficiency of the algorithm. Therefore, according to the characteristics of the problem, the probability of selecting the neighborhood operator is adaptively calculated. , the formula is:
[0028]
[0029]
[0030]
[0031] Among them, the number of containers in the current solution is , the number of polygons is .
[0032] In the embodiment of the present invention, the reorganization neighborhood operator A new solution is generated by destroying several containers in the current solution and repairing them. The neighborhood size of the neighborhood operator is determined by the total area interval of the polygons allocated to each container during the repair process. By setting a suitable area interval, a large number of infeasible allocations can be effectively eliminated while retaining high-quality allocations, thereby significantly improving the efficiency of the algorithm. The total area interval of the polygons allocated to each container depends on the sum of the areas of the polygons contained in the container in the current solution and the average area of all polygons contained in the current solution.
[0033] Step 3: Explore polygon allocation through the multi-neighborhood large neighborhood search algorithm, and decide whether to update the current solution based on the fitness relationship.
[0034] In the embodiment of the present invention, Figure 3 The principle diagram of multi-neighborhood large neighborhood search is shown in the following figure. In each round of iteration, a neighborhood operator is randomly selected to destroy and repair the current solution to obtain the search solution. The fitness of the current solution and the search solution is compared to decide whether to use the search solution to update the current solution. During the iteration process, the current solution is always a feasible solution, and the neighborhood operator does not directly modify the current solution, but generates a search solution based on the current solution for comparison.
[0035] Exemplarily, the fitness function formula may be:
[0036]
[0037] Indicates The area of the polygon, L and W represent the length and width of the container. represents the total number of polygons, Indicates the number of containers in the current solution.
[0038] In the embodiment of the present invention, the neighborhood operator is composed of a small amplitude disturbance operator , Reorganization Neighborhood Operator , Completion Neighborhood Operator composition.
[0039] Exemplary, small amplitude perturbation operator The container with the lowest utilization rate can be destroyed. The container with the lowest utilization rate is recorded as , the specific formula is:
[0040] ,
[0041] in, represents the current solution, Representative The total area of the polygons in the container, L, W represents the length and width of the container. Randomly select another container, and select a polygon from each of the two containers. The area of the middle polygon is smaller, so the two polygons are swapped, and the single container packing algorithm is used to determine whether the two containers can each obtain a feasible arrangement without overlap. If feasible, the swap is retained. Repeat the above steps until all polygon pairs have tried to swap once.
[0042] In the embodiment of the present invention, the reorganization neighborhood operator Random destruction containers, and the container set is recorded as , the containers in the set are sorted from high to low according to the container utilization in the current solution. The specific formula for the number of containers is:
[0043]
[0044] in, Indicates the number of containers in the current solution. The containers are repaired one by one according to their utilization rate in the current solution, from high to low. During the repair process, the set of all polygons in the damaged container is regarded as the full set, which represents all polygon resources to be repaired. An m-layer tree is established, where each node represents a set of polygons allocated in a container, which is a subset of the full set. The number of layers of the node corresponds to the number of layers of the container in the reorganization neighborhood operator. Destroy the order in the container, that is, the first-layer nodes represent the reorganization neighborhood operator Destroy the first containers..., forming a solution space with a tree.
[0045] Exemplarily, the selection of child nodes of each node can follow the following rules: 1. The polygons contained in the child nodes do not overlap with the polygons in the ancestor nodes; 2. The number of child nodes does not exceed 25 (not necessarily 25, 25 is selected in the experiment here, and the specific number can be determined according to actual needs); 3. The child nodes are sorted by the total area of the polygons; 4. The last node of each layer is the polygon set of the container of this layer in the current solution. The child nodes are marked into two categories according to the properties of the ancestor nodes: first-class nodes and second-class nodes, where each ancestor node of the second-class node is the polygon set in the current solution container corresponding to the layer, and the remaining nodes are marked as first-class nodes. The adaptive selection and reorganization neighborhood operator described in step 2 The neighborhood size of the two types of nodes is given additional rules: the rules given to nodes in each layer are the same, with the first For example, let is the reorganization neighborhood operator The destruction of container, then The total area of the first type of node polygons in the layer is:
[0046]
[0047] in, The first The sum of the areas of the polygons contained in the current solution of the container, that is, the sum of the areas of the polygons contained in the container before it is destroyed, represents the sum of the areas of the polygons, L and W represent the length and width of the container, Represents the total number of polygons. The total area of the second type of node polygons in the layer is:
[0048]
[0049] in, The first The sum of the polygonal areas contained in the current solution for each container, represents the sum of the areas of the polygons, L and W represent the length and width of the container, Indicates the total number of polygons. Child nodes are selected according to the above rules. Figure 4 An example of the above tree is given, and the labels represent the order in which the nodes are visited in this example.
[0050] For example, selecting the node with the largest area that meets the requirements is equivalent to solving the knapsack problem. The input is the complement of the set of all polygons whose ancestor nodes contain the volume and value of the object equal to the area of the polygon, and the capacity The specific formula is:
[0051]
[0052] in, The first The sum of the polygonal areas of the containers in the current solution, represents the sum of the areas of the polygons, L and W represent the length and width of the container, Represents the total number of polygons. Use dynamic programming to find the optimal solution To limit the number of child nodes to less than 25, set the minimum area interval between two adjacent nodes. , for the first type of nodes, , for the second type of nodes, , update capacity , solve the new knapsack problem, capacity The specific formula is:
[0053]
[0054] Repeat the above process until Smaller than the lower bound of the area range.
[0055] In the embodiment of the present invention, the above construction tree is searched, and whenever an infeasible node is found, the infeasible node and its branches are subtracted.
[0056] For example, the above tree can be searched in depth first, and each node uses a single container packing algorithm to determine whether the polygon can be placed in the container without overlap. If a node is not feasible, the infeasible node and all its child nodes are cut off. When there is a feasible path for the node and the union of the nodes in the path is the full set, stop searching and return the search solution.
[0057] In the embodiment of the present invention, the neighborhood completion operator Randomly destroy several containers to complete the operators with higher fitness but reorganized neighborhood and small amplitude perturbation operator Unexplored search space.
[0058] Exemplarily, the number of containers may be , destroy the container , the containers in the collection are sorted from large to small according to the sum of the areas of the contained polygons. The collection of all polygons in the damaged container is regarded as the complete collection, which represents all polygon resources to be repaired. When repairing, the same order is used. The polygon collection in the first container is a subset of the complete collection, and its area The search range is:
[0059]
[0060] in, For the equation The right root of . Among them, Indicates the destruction of the completion neighborhood operator The sum of the areas of the polygons contained in the current solution. Indicates the destruction of the completion neighborhood operator The square of the sum of the areas of the polygons in the current solution in the containers. Randomly select up to 25 sets in the range (not necessarily 25, 25 is selected in the experiment here, and the specific number can be determined according to actual needs), use the single container packing algorithm to determine whether the polygons can be placed without overlap, and for feasible sets , from the collection Continue searching the polygons assigned to the second container in the complement of the first container. For example, the container The total area of the polygons in the container The search scope is:
[0061]
[0062] in, For the equation If the equation has no real roots, then The value is 0. Indicates the destruction of the completion neighborhood operator The square of the sum of the areas of the polygons contained in the current solution. Before The sum of the polygon areas allocated to the containers, Before The sum of the squares of the sum of the areas of the polygons in each container. After the container has finished searching, all unassigned polygons are assigned to the A single container packing algorithm is used to determine whether the polygons can be placed without overlapping. If feasible, the search solution is output.
[0063] In the process of destroying and repairing the current solution, the single container packing problem optimization algorithm is used to determine whether the polygons can be placed in the container without overlapping.
[0064] In the embodiment of the present invention, the small amplitude disturbance operator Perturb the current solution to change the polygons in the container and reorganize the neighborhood operator and the completion neighborhood operator Some polygons are reallocated to a container. After each change or allocation, the single-container packing problem algorithm is used to determine whether the adjusted or allocated polygons can be placed in a single container without overlap, ensuring that the search solution is feasible.
[0065] For example, the single container packing problem algorithm can use the overlap removal method. Let the polygon set Place in a container, is the polygon's translation vector and rotation angle, is the degree of overlap, the specific formula is:
[0066]
[0067]
[0068]
[0069]
[0070] in, Indicates the degree of overlap between the i-th polygon and the j-th polygon, represents the overlap between the ith polygon and the outside of the container, PD represents the embedding depth function, A vector variable representing the embedding depth function, is the position of the i-th polygon after rotation and translation, is the position of the jth polygon after rotation and translation, Rect represents the rectangular window function, and the superscript represents the complement operation, Represents the jth polygon by vector The position after translation, Indicates that the conditions are met Vector First, place polygons one by one, and use the vertices of the critical polygons of the placed polygons as the candidate positions. The highest point is taken as the final placement position. Taking the rth polygon as an example, the specific formula is:
[0071]
[0072] in, represents the horizontal coordinate of the leftmost vertex of the rth polygon, represents the ordinate of the bottom vertex of the rth polygon. and Exchange the positions of the polygons and Move the polygon to infinity and record other polygons near its original position. Select the position with the lowest overlap among the vertices and midpoints of the polygons and the critical polygons of these polygons, and The same operation is used for the two polygons, and the two polygons are swapped. After that, the unconstrained optimization method is used to locally minimize the overlap. The above operation is repeated until the overlap is 0 or a certain number of rounds is reached. Figure 5 An example of the overlap removal process in one round is given. In the first picture, the PD value between the polygon and the container is 4, and the total G value of the arrangement is 16. Two non-diamond polygons are selected and exchanged to obtain the second picture. The PD value between the polygon and the container is still 4, and the total G value is still 16. At this time, the unconstrained optimization method is used to move the upper right polygon in the gradient direction to achieve Figure 3 As a result, the PD values between all polygons and between polygons and containers are 0, the total G value is reduced to 0, and a feasible arrangement is obtained.
[0073] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above embodiments can be implemented by software, or by means of software plus necessary general hardware platforms. Based on such understanding, the technical solutions of the above embodiments can be embodied in the form of software products, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.), including several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0074] The specific embodiments described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A two-dimensional irregular packing optimization method based on multi-neighborhood large neighborhood search, used to arrange irregular parts in a limited space, characterized in that: include: Construct an initial feasible solution based on polygon and container information and use it as the current solution; Adaptively calculate the parameters that have a significant impact on the efficiency of the multi-neighborhood large neighborhood search algorithm based on the information of the initial feasible solution, including the selection probability of the neighborhood operator and reorganization neighborhood operator The neighborhood size is , wherein the neighborhood operator includes a small amplitude perturbation operator , a reorganization neighborhood operator that significantly changes the solution structure , the completion neighborhood operator that completes the solution space , the small amplitude perturbation operator To destroy the container with the lowest utilization, the reorganization neighborhood operator A new solution is generated by destroying several containers in the current solution and repairing them. Used to complete operators with higher fitness but reorganized neighborhoods and small amplitude perturbation operator Unexplored search space; The polygon allocation is explored through the parameters that have a significant impact on the algorithm efficiency as described in the multi-neighborhood large neighborhood search algorithm, the current solution is destroyed and repaired, the search solution is obtained, and the fitness of the current solution and the search solution are compared to decide whether to use the search solution to update the current solution; wherein, in the process of destroying and repairing the current solution, the single container packing problem optimization algorithm is used to determine whether the polygon can be placed in the container without overlapping, to ensure that the search solution is feasible.
2. A two-dimensional irregular bin packing optimization method based on multi-neighborhood large neighborhood search according to claim 1, characterized in that: The method of constructing an initial feasible solution based on polygon and container information includes: the polygon information includes a shape and a set of rotatable angles, and the container information is represented as a set of polygon information placed in the container; defining several polygons as special polygons, and constructing an initial feasible solution using a strategy of evenly distributing special polygons.
3. A two-dimensional irregular bin packing optimization method based on multi-neighborhood large neighborhood search according to claim 2, characterized in that: The method of defining several polygons as special polygons and constructing an initial feasible solution using a strategy of evenly distributing special polygons includes achieving even distribution of special polygons based on the best fit method and the round-robin method, distributing the special polygons to several containers in turn using the round-robin method and judging the feasibility using a single container packing problem optimization algorithm, and after an infeasible distribution occurs or all special polygons are distributed, for each undistributed polygon, containers are gradually selected from high to low according to the container utilization rate until a feasible distribution is obtained using the single container packing problem optimization algorithm, and if all containers fail to obtain a feasible distribution, an additional empty container is created and the polygons are placed therein, and an initial feasible solution is obtained after all polygons are distributed in a feasible manner.
4. A two-dimensional irregular bin packing optimization method based on multi-neighborhood large neighborhood search according to claim 3, characterized in that: The probability of selecting the neighborhood operator is adaptively calculated based on the average number of polygons contained in each container in the initial feasible solution.
5. A two-dimensional irregular bin packing optimization method based on multi-neighborhood large neighborhood search according to claim 4, characterized in that: The neighborhood size of the neighborhood operator depends on the total area interval of the polygons assigned to each container during the repair process. The specific value depends on the sum of the areas of the polygons contained in the container in the current solution and the average area of all polygons in the current solution.
6. A two-dimensional irregular bin packing optimization method based on multi-neighborhood large neighborhood search according to claim 5, characterized in that: The small amplitude perturbation operator Randomly select another container, select a polygon from the container with the lowest utilization rate and the other container respectively, and require that the polygon area in the container with the lowest utilization rate is smaller. Exchange the two polygons, and use the single container packing algorithm to determine whether the container with the lowest utilization rate and the other container can each obtain a feasible arrangement without overlapping. If feasible, retain the result of this exchange; repeat the exchange operation until all polygon pairs have attempted an exchange.
7. A two-dimensional irregular bin packing optimization method based on multi-neighborhood large neighborhood search according to claim 6, characterized in that: The reorganization neighborhood operator For random destruction A container is used to construct a tree of the corresponding number of layers. Each path in the tree corresponds to a solution, and the entire tree represents the solution space to be searched.
8. A two-dimensional irregular bin packing optimization method based on multi-neighborhood large neighborhood search according to claim 7, characterized in that: When searching the tree, subtract the infeasible node and all its children.
9. A two-dimensional irregular packing optimization method based on multi-neighborhood large neighborhood search according to any one of claims 1 to 8, characterized in that: In the process of destroying and repairing the current solution, the optimization algorithm for the single container packing problem is used to determine whether the polygons can be placed in the container without overlap, ensuring that the search solution is feasible, including small amplitude perturbation operators Perturb the current solution to change the polygons in the container and reorganize the neighborhood operator and the completion neighborhood operator The polygons are reallocated to the corresponding containers. After each change or allocation, the single container packing problem algorithm is used to determine whether the adjusted or allocated polygons can be placed without overlap in a single container.
Citation Information
Patent Citations
Iterative method for solving three-dimensional encasement constrained finite capacity path planning problem
CN112488428A
Vehicle path planning method considering three-dimensional boxing problem
CN116136990A