Two-dimensional layout method and device based on improved local search, equipment and medium

By improving the local search method, combining BL strategy and greedy algorithm, the initial sampling scheme is optimized, and the problem of low sampling efficiency caused by rough initial solution quality in the prior art is solved, and higher material utilization and sampling efficiency are achieved.

CN120069140APending Publication Date: 2025-05-30SHENZHEN HOSONSOFT CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202311613682.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-28
Publication Date
2025-05-30

AI Technical Summary

Technical Problem

The initial solution mass of existing arrangement methods is rough, resulting in insufficiency of arrangement, especially when dealing with large-scale or complex arrangement problems.

Method used

The two-dimensional sorting method based on improved local search is adopted, and the initial sorting scheme is obtained through BL strategy and greedy algorithm, combined with the preset length, the material space is shortened, the part position is adjusted to improve neatness and utilization, and iterative optimization is achieved until the preset number of iterations is reached.

Benefits of technology

The generated arrangement scheme can significantly improve the utilization rate of materials and the arrangement efficiency, reduce overlap between parts and material waste, thereby reducing production costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120069140A_ABST
    Figure CN120069140A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of computer-aided layout, solves the problem of low layout efficiency caused by too rough initial solution of a layout method in the prior art, and provides a two-dimensional layout method and device based on improved local search, equipment and a medium. The method comprises the steps that an initial layout scheme is obtained according to a BL strategy and a greedy algorithm, and the initial layout scheme comprises the initial positions of a plurality of parts to be subjected to layout in a material space; shortening the length of the current material space according to a preset length; according to the squareness between the parts to be subjected to stock layout and a preset separation method, the initial positions of the parts to be subjected to stock layout are adjusted, and an intermediate stock layout scheme is obtained; returning to the step of shortening the length of the current material space according to the preset length until the current number of iterations is greater than the preset number of iterations to obtain a plurality of intermediate layout schemes; and obtaining a target layout scheme according to the material space utilization rate of each intermediate layout scheme. According to the method, the generation mode of the initial solution is improved, and the layout efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer-aided layout, and particularly to a two-dimensional layout method, device, equipment and medium based on improved local search. Background Art

[0002] The layout problem is a key optimization problem in the manufacturing industry. It involves effectively placing given parts within a given material space according to specific requirements to ensure that the parts do not overlap. This problem has wide applications in various manufacturing fields, including clothing manufacturing, wood processing, and metal manufacturing, etc. Its goal is to improve the material utilization rate and reduce waste through optimizing the layout algorithm, thereby reducing the production cost of enterprises.

[0003] Currently, the mainstream method for solving the irregular layout problem is mainly the layout strategy based on overlap removal. This strategy first generates an initial feasible layout solution, usually using the BL (bottom-left) strategy to locate the initial positions of the parts. However, this initial solution based on the BL strategy is usually rather rough and may not be optimized enough. Based on the initial solution, this strategy attempts to generate a new layout solution by reducing the length of the material and by methods such as swapping and translating the parts. During this process, some overlaps between the parts are allowed, but then separation techniques are used to eliminate these overlaps to obtain a new improved solution.

[0004] However, the running time of the layout method based on overlap removal largely depends on the quality of the initial solution. If the initial solution is too rough, it may require more time and computing resources to find an optimized layout solution. This dependence is a major technical problem of the existing layout techniques, which may limit the efficiency and effectiveness of the algorithm, especially when dealing with large-scale or complex layout problems. Summary of the Invention

[0005] In view of this, embodiments of the present invention provide a two-dimensional layout method, device, equipment and medium based on improved local search to solve the problem that the initial solution of the existing layout method is too rough, resulting in low layout efficiency.

[0006] In a first aspect, embodiments of the present invention provide a two-dimensional layout method based on improved local search, the method comprising:

[0007] Obtaining an initial layout plan according to the BL strategy and the greedy algorithm, wherein the initial layout plan includes the initial positions of a plurality of parts to be laid out in the material space;

[0008] Shortening the length of the current material space according to a preset length;

[0009] Adjust the initial positions of the parts to be nested according to the squareness between the parts to be nested and a preset separation method, to obtain an intermediate nesting scheme, where the squareness is used to characterize the neatness degree among a plurality of parts to be nested;

[0010] Return to the step of shortening the length of the current material space according to a preset length until the current iteration number is greater than a preset iteration number to obtain a plurality of intermediate nesting schemes;

[0011] Obtain a target nesting scheme according to the material space utilization rate of each intermediate nesting scheme.

[0012] Preferably, the step of obtaining an initial nesting scheme according to the BL strategy and the greedy algorithm includes:

[0013] Number all the parts to be nested, and place the first part to be nested at the lower left corner position of the material space;

[0014] Calculate the critical polygon and the inner abutting critical polygon of each part to be nested other than the first part to be nested;

[0015] Obtain the placement position of the corresponding part to be nested according to the intersection point of the critical polygon and the inner abutting critical polygon;

[0016] Evaluate each part to be nested according to the part area of the part to be nested and the waste area formed during nesting, to obtain an evaluation value;

[0017] Place all the parts to be nested according to the placement position and the evaluation value of each part to be nested, to obtain an initial nesting scheme.

[0018] Preferably, the step of evaluating each part to be nested according to the part area of the part to be nested and the waste area formed during nesting, to obtain an evaluation value includes:

[0019] Obtain the part area of each part to be nested;

[0020] Calculate the evaluation value of each part to be nested according to the evaluation value calculation formula and the part area, where the evaluation value calculation formula is as follows:

[0021]

[0022] In the formula, F i is the evaluation value of the i-th part to be nested, S i is the part area of the i-th part to be nested, S wi is the waste area formed during the nesting of the i-th part to be nested, S min is the minimum part area among all the parts to be nested, S maxis the maximum part area among all parts to be nested, and i is a positive integer greater than 1.

[0023] Preferably, the step of adjusting the initial positions of the parts to be nested according to the squareness between the parts to be nested and a preset separation method to obtain an intermediate nesting scheme includes:

[0024] Obtain the nesting position of the i-th part to be nested in the current nesting scheme, denoted as the i-th nesting position;

[0025] Traverse the parts to be nested other than the i-th part to be nested, denoted as the remaining parts to be nested;

[0026] According to the critical polygon and the inner abutting critical polygon of each of the remaining parts to be nested, obtain the nesting position of each of the remaining parts to be nested;

[0027] According to the i-th nesting position and the nesting positions of each of the remaining parts to be nested, obtain the fitness between the i-th part to be nested and each of the remaining parts to be nested, where the fitness is used to quantify the density degree of the i-th part to be nested and the corresponding remaining part to be nested in the material space;

[0028] Obtain the remaining part to be nested with the minimum fitness with the i-th part to be nested, denoted as the j-th nesting part, and move the j-th nesting part to the corresponding nesting position;

[0029] Randomly obtain the k-th part to be nested from the remaining parts to be nested, and move the k-th part to be nested to the corresponding nesting position;

[0030] Eliminate the overlap between the parts to be nested according to the preset separation method to obtain an intermediate nesting scheme;

[0031] wherein, i, j, and k are all positive integers and are not equal to each other.

[0032] Preferably, the step of obtaining the fitness between the i-th part to be nested and each of the remaining parts to be nested according to the i-th nesting position and the nesting positions of each of the remaining parts to be nested includes:

[0033] According to the i-th nesting position and the nesting positions of each of the remaining parts to be nested, obtain the minimum envelope matrix of the i-th part to be nested and each of the remaining parts to be nested;

[0034] According to the minimum envelope matrix and the fitness calculation formula, calculate the fitness between the i-th part to be nested and each of the remaining parts to be nested, where the fitness calculation formula is as follows:

[0035] M iq =(S i +S q ) / SM

[0036] Wherein, M iq is the fitness between the i-th part to be arranged and the q-th part to be arranged, S i is the area of the i-th part to be arranged, S q is the area of the remaining parts to be arranged, S M is the area of the minimum envelope matrix of the i-th part to be arranged and the q-th part to be arranged, where q is a positive integer and not equal to i.

[0037] Preferably, the step of obtaining the target nesting scheme according to the material space utilization rate of each of the intermediate nesting schemes includes:

[0038] According to each of the intermediate nesting schemes and the area of the material space, obtain the material space utilization rate of each of the intermediate nesting schemes;

[0039] Take the intermediate nesting scheme with the largest material space utilization rate as the target nesting scheme.

[0040] Preferably, the step of obtaining the material space utilization rate of each of the intermediate nesting schemes according to each of the intermediate nesting schemes and the area of the material space includes:

[0041] According to the utilization rate calculation formula, calculate the material space utilization rate of each intermediate nesting scheme, where the utilization rate calculation formula is as follows:

[0042]

[0043] Wherein, R is the material space utilization rate, W is the width of the material space, L is the material length required for the intermediate nesting scheme, and Si is the area of the i-th part in the intermediate nesting scheme.

[0044] In a second aspect, an embodiment of the present invention provides a two-dimensional nesting device based on improved local search, and the device includes:

[0045] An initial nesting scheme acquisition module, configured to obtain an initial nesting scheme according to the BL strategy and the greedy algorithm, where the initial nesting scheme includes the initial positions of a plurality of parts to be nested on the material space;

[0046] A material length acquisition module, configured to shorten the length of the current material space according to a preset length;

[0047] An intermediate nesting scheme acquisition module, configured to adjust the initial positions of the parts to be nested according to the squareness between the parts to be nested and a preset separation method to obtain an intermediate nesting scheme, where the squareness is used to characterize the neatness between a plurality of parts to be nested;

[0048] An iteration module, configured to control the material length acquisition module and the intermediate nesting scheme acquisition module to execute cyclically until the current iteration count is greater than a preset iteration count to obtain a plurality of intermediate nesting schemes;

[0049] A target nesting scheme acquisition module, configured to obtain a target nesting scheme according to the material space utilization rate of each of the intermediate nesting schemes.

[0050] In a third aspect, an embodiment of the present invention provides an electronic device, including: at least one processor, at least one memory, and computer program instructions stored in the memory, where when the computer program instructions are executed by the processor, the method in the first aspect of the above implementation manner is implemented.

[0051] In a fourth aspect, an embodiment of the present invention provides a storage medium, on which computer program instructions are stored, where when the computer program instructions are executed by the processor, the method in the first aspect of the above implementation manner is implemented.

[0052] In summary, the beneficial effects of the present invention are as follows:

[0053] The two-dimensional nesting method, device, equipment and medium based on improved local search provided by the embodiments of the present invention obtain an initial nesting scheme according to the BL strategy and the greedy algorithm. By combining the BL strategy and the greedy algorithm, this step can generate a relatively optimized initial nesting scheme. Different from only relying on the area in descending order, the greedy algorithm can select the optimal part for placement according to the evaluation value, so as to possibly obtain a more reasonable initial layout, laying a foundation for subsequent optimization steps; shortening the length of the current material space according to a preset length, and shortening the material length required by the current nesting scheme according to the preset length can reduce the waste of materials, thereby improving the material utilization rate and the nesting efficiency; adjusting the initial positions of the parts to be nested according to the squareness between the parts to be nested and a preset separation method to obtain an intermediate nesting scheme, where the squareness is used to characterize the neatness between several parts to be nested. Using the squareness and the preset separation method to adjust the initial positions of the parts can reduce the overlap between the parts while keeping them neat, thereby obtaining an intermediate nesting scheme. The squareness index can quantify the neatness between the parts, providing clear guidance for the adjustment of the part positions; returning to the step of shortening the length of the current material space according to the preset length until the current iteration number is greater than the preset iteration number to obtain several intermediate nesting schemes. Through multiple iterations, continuously shortening the material length and adjusting the part positions can generate multiple intermediate nesting schemes. This iterative process can gradually optimize the nesting scheme, thereby improving the quality of the final nesting scheme; obtaining a target nesting scheme according to the material space utilization rate of each intermediate nesting scheme, and selecting the nesting scheme with the highest utilization rate as the target nesting scheme according to the material space utilization rate of each intermediate nesting scheme. This selection method ensures that the final nesting scheme can achieve a high material utilization rate, thereby reducing the production cost. By adopting a greedy strategy instead of a simple area in descending order, this method can more effectively determine the arrangement order of the parts, thereby generating a better initial nesting scheme. Different from the random exchange of the existing method, this method can move the parts more reliably by considering the squareness, and can find a nesting scheme with a higher utilization rate faster, thereby improving the nesting efficiency and quality. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required to be used in the embodiments of the present invention will be briefly introduced below. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained according to these drawings, and all of them are within the protection scope of the present invention.

[0055] Figure 1 It is a flowchart of the two-dimensional nesting method based on improved local search according to the embodiments of the present invention.

[0056] Figure 2This is a schematic flowchart of the process for obtaining an initial nesting plan according to the BL strategy and the greedy algorithm in an embodiment of the present invention.

[0057] Figure 3 This is a schematic structural diagram of a two-dimensional nesting device based on improved local search in an embodiment of the present invention.

[0058] Figure 4 This is a schematic structural diagram of an electronic device in an embodiment of the present invention. Detailed implementation manners

[0059] The features and exemplary embodiments of various aspects of the present invention will be described in detail below. To make the objectives, technical solutions, and advantages of the present invention clearer and more understandable, the present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only configured to explain the present invention and are not configured to limit the present invention. For those skilled in the art, the present invention can be implemented without some of these specific details. The following description of the embodiments is only intended to provide a better understanding of the present invention by showing examples of the present invention.

[0060] It should be noted that in this document, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, such that a process, method, article or device including a series of elements not only includes those elements but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. Without further limitation, elements defined by the statement "including..." do not exclude the presence of additional identical elements in the process, method, article or device including the said elements.

[0061] Embodiment 1

[0062] Please refer to Figure 1 , an embodiment of the present invention provides a two-dimensional nesting method based on improved local search, and the method includes:

[0063] S1. Obtain an initial nesting plan according to the BL strategy and the greedy algorithm, where the initial nesting plan includes the initial positions of several parts to be nested in the material space;

[0064] Specifically, in the two-dimensional nesting problem, the parts to be nested usually have irregular shapes and sizes. These parts need to be effectively placed within the given material space. The parts include, but are not limited to, metal parts, wood parts, glass parts, etc. In metal manufacturing, the parts that may need to be nested include automotive parts (such as inner door panels, fenders), mechanical parts (such as gears, couplings), etc. In plastic product manufacturing, the parts to be nested may include containers (such as bottle caps, boxes), household plastic products (such as plastic chairs, plastic tables), etc. These parts may have complex contours and irregular shapes.

[0065] In this step, the initial position of each part is determined by combining the BL (Bottom-Left) strategy and the greedy algorithm. Generally, the BL strategy places each part at the leftmost and bottommost available position in the current material space, while the greedy algorithm selects the part with the largest evaluation value for placement at each step in order to obtain a better initial layout. In one embodiment, the evaluation value can be based on the geometric complexity of the part, such as the curvature of the edges, the number of corners, or the nesting ability. More complex parts may be more difficult to place and thus may need to be prioritized. In addition to the area, the evaluation value can also be based on the length, width, or other dimensional parameters of the part. For example, larger or longer parts may need to be placed first.

[0066] Preferably, referring to Figure 2 , the step of obtaining the initial nesting plan according to the BL strategy and the greedy algorithm includes:

[0067] S11. Number all the parts to be nested and place the first part to be nested at the lower left corner position of the material space;

[0068] First, number all the parts to be nested for easy tracking and management. Then, place the first part to be nested numbered 1 at the lower left corner position of the material space. This is the basic principle of the BL strategy, which starts placing parts from the lower left corner of the material space;

[0069] S12. Calculate the critical polygon and the inner abutting critical polygon of each part to be nested other than the first part to be nested;

[0070] For each part other than the first part to be nested, calculate the critical polygon (NFP, No-Fit Polygon) with other nested parts and the inner-fit critical polygon (IFP, Inner-Fit Polygon) with the boundary of the material space. The NFP and IFP are geometric tools for determining whether a part can be placed and its placement position. The critical polygon is a polygon representing the area where two shapes may touch but not overlap, obtained by sliding one shape along the edge of the other shape, while the inner-fit critical polygon is a polygon representing the contact area between the part and the material boundary, obtained by sliding the part along the boundary of the material space.

[0071] S13. Obtain the placement position of the corresponding part to be nested according to the intersection point of the critical polygon and the inner-fit critical polygon;

[0072] By finding the intersection points of the critical polygon and the inner-fit critical polygon, determine the possible placement positions of each part to be nested. The intersection points represent the positions where the part can be placed without overlapping with other parts or the material boundary.

[0073] S14. Evaluate each part to be nested according to the part area of the part to be nested and the wasted area formed during nesting, and obtain an evaluation value;

[0074] Calculate the evaluation value according to the area of each part to be nested and the wasted area that may be generated during nesting. This evaluation value can be used to compare the placement effects of different parts and determine the placement order;

[0075] In one embodiment, the step of evaluating each part to be nested according to the part area of the part to be nested and the wasted area formed during nesting, and obtaining an evaluation value includes:

[0076] S141. Obtain the part area of each part to be nested;

[0077] S142. Calculate the evaluation value of each part to be nested according to the evaluation value calculation formula and the part area, where the evaluation value calculation formula is as follows:

[0078] F = 0.8×f 1 + 0.2×f 2

[0079] where, f 1 = S i / (S i + S wi ), f 2 =(S i - S min ) / (S max - S min )

[0080] Wherein, F i is the evaluation value of the i-th part to be nested, S i is the part area of the i-th part to be nested, S wi is the waste area formed during the nesting of the i-th part to be nested, S min is the minimum part area among all parts to be nested, S max is the maximum part area among all parts to be nested, and i is a positive integer greater than 1.

[0081] Specifically, the evaluation value f 1 is designed to minimize the waste area S wi , so it can help optimize the material utilization rate. By preferentially selecting the placement of parts that can reduce the waste area, more parts can be placed in the limited material space. The evaluation value f 2 is calculated based on the ratio of the part area to the maximum and minimum areas of all parts, which can help balance the arrangement of parts of different sizes to avoid low arrangement efficiency caused by excessive differences in part sizes.

[0082] By combining f 1 and f 2 two different evaluation factors, this evaluation value can provide a multi-faceted evaluation. It not only considers the waste area but also the differences in part sizes, enabling the nesting scheme to consider multiple factors more comprehensively, thus obtaining a better arrangement. The weights of the evaluation value, 0.8 and 0.2, can be adjusted according to specific requirements. If you want to further reduce the waste area, you can increase the weight of f 1 ; if you want to better balance the differences in part sizes, you can increase the weight of f 2 .

[0083] S15. Place all parts to be nested according to the placement position and evaluation value of each part to be nested to obtain an initial nesting scheme.

[0084] According to the previously calculated placement positions and evaluation values, place all parts to be nested one by one. The greedy algorithm will select the part with the largest or smallest evaluation value to be placed first, and so on, until all parts are placed in the material space, thus completing the generation of the initial nesting scheme;

[0085] In a specific embodiment, the evaluation value includes f 1 and f 2Two different evaluation factors not only consider the wasted area but also the differences in part sizes. The larger the evaluation value, the higher the placement efficiency of the currently to-be-arranged part. In other words, the part occupies a more reasonable material space in the current nesting scheme, and the wasted material area is relatively small. At the same time, a larger evaluation value may also indicate that the size of the part is in a more appropriate position within the overall part size range, contributing to the reasonable distribution of part sizes and the efficient use of materials.

[0086] This process ensures that the generation of the initial nesting scheme is based on some clear criteria and evaluation indicators rather than randomly. This helps reduce material waste and provides a relatively reasonable starting point for subsequent optimization steps. At the same time, by calculating the critical polygon and evaluation value, this process also provides important information and basis for subsequent optimization steps.

[0087] S2. Shorten the length of the current material space according to a preset length;

[0088] In this step, the length of the current material space is shortened according to a preset length, which is set according to the actual situation and is not specifically limited here. By shortening the material length, the space waste during the nesting process can be minimized. When the material length is reduced, the arrangement between parts may be more compact, thus improving the utilization efficiency of the material.

[0089] S3. Adjust the initial positions of the to-be-nested parts according to the squareness between the to-be-nested parts and a preset separation method to obtain an intermediate nesting scheme, where the squareness is used to characterize the neatness degree between several to-be-nested parts;

[0090] In step S3, adjusting the initial positions of the to-be-nested parts according to the squareness between the to-be-nested parts and a preset separation method is to further optimize the layout of the parts and improve the utilization rate of the material. Squareness is an index used to quantify the neatness degree of the layout between parts. Usually, squareness is calculated based on the relative positions, angles, or gaps between parts to ensure that the layout between parts is as neat as possible and reduce space waste. The preset separation method is used to adjust the part positions to avoid overlapping between parts and optimize the layout of the parts. This may include moving, rotating, or flipping parts to reduce the space waste between parts and ensure a neat layout between them.

[0091] Preferably, the step of adjusting the initial positions of the to-be-nested parts according to the squareness between the to-be-nested parts and a preset separation method to obtain an intermediate nesting scheme includes:

[0092] S31. Obtain the nesting position of the i-th to-be-nested part in the current nesting scheme, denoted as the i-th nesting position;

[0093] In this step, a part is randomly selected from the current nesting scheme, denoted as the i-th part to be nested, and its position in the material space is determined, denoted as the i-th nesting position.

[0094] S32. Traverse the parts to be nested other than the i-th part to be nested, denoted as the remaining parts to be nested;

[0095] Traverse all other parts to be nested except the i-th part to facilitate calculating their fit with the i-th part to be nested and determining the optimal layout;

[0096] S33. Obtain the nesting position of each remaining part to be nested according to the critical polygon and the inner abutting critical polygon of each remaining part to be nested;

[0097] For each remaining part to be nested, calculate its critical polygon and inner abutting critical polygon to determine its possible nesting position.

[0098] S34. Obtain the fit between the i-th part to be nested and each remaining part to be nested according to the i-th nesting position and the nesting position of each remaining part to be nested, where the fit is used to quantify the density of the i-th part to be nested and the corresponding remaining part to be nested in the material space;

[0099] Specifically, for each remaining part to be nested, calculate the fit with the i-th part to be nested. The fit is an index measuring the space waste between two parts, which can help determine how to optimize the layout of parts to reduce material waste and improve material utilization rate;

[0100] Preferably, the step of obtaining the fit between the i-th part to be nested and each remaining part to be nested according to the i-th nesting position and the nesting position of each remaining part to be nested includes:

[0101] S341. Obtain the minimum bounding matrix of the i-th part to be nested and each remaining part to be nested according to the i-th nesting position and the nesting position of each remaining part to be nested;

[0102] Specifically, the minimum bounding rectangle is a rectangle that completely encloses the i-th part to be nested and the remaining part to be nested and has the smallest possible area. This rectangle may be rotated in different directions to find the smallest area.

[0103] S342. Calculate the fit between the i-th part to be nested and each remaining part to be nested according to the minimum bounding matrix and the fit calculation formula, where the fit calculation formula is as follows:

[0104] M iq =(S i +Sq ) / S M

[0105] In the formula, M iq is the fitness between the i-th part to be nested and the q-th part to be nested, S i is the area of the i-th part to be nested, S q is the area of the remaining parts to be nested, S M is the area of the minimum bounding matrix of the i-th part to be nested and the q-th part to be nested, where q is a positive integer and not equal to i.

[0106] Specifically, M iq is the fitness between the i-th part to be nested and the q-th part to be nested, which is calculated by dividing the sum of the areas of the i-th part to be nested and the q-th part to be nested by the area of their minimum bounding rectangle in the given expression. In this case, the lower the fitness, the closer the layout of the two parts, that is, the less space waste between them, and the higher the fitness indicates that there is more space waste between the two parts.

[0107] S35. Obtain the remaining part to be nested with the lowest fitness with respect to the i-th part to be nested, denoted as the j-th nested part, and move the j-th nested part to the corresponding nesting position;

[0108] By finding the part with the minimum fitness M iq denoted as the j-th nested part, and moving the j-th nested part to this position, the space waste between and around the two parts is reduced, thereby improving the material utilization rate and nesting efficiency. This method helps to find a more compact and efficient nesting scheme, thereby reducing material loss and production costs.

[0109] S36. Randomly obtain the k-th part to be nested from the remaining parts to be nested, and move the k-th part to the corresponding nesting position;

[0110] Randomly select a remaining part to be nested, that is, the k-th part to be nested, and move it to the corresponding nesting position so that all parts do not overlap as much as possible to further optimize the layout. i, j, and k are all positive integers and are not equal to each other.

[0111] S37. Eliminate the overlap between the parts to be nested according to the preset separation method to obtain an intermediate nesting scheme;

[0112] The goal of this step is to adjust the positions of the parts through an optimization algorithm to ensure that they do not overlap, while maintaining a compact layout as much as possible to maximize the material utilization rate. Specifically, this step includes:

[0113] Move all the parts to be nested. The purpose of the movement is to eliminate any possible overlaps and, at the same time, try to maintain a compact layout among the parts to be nested.

[0114] Calculate the total sum of the nesting depths between parts each time a part to be nested is moved. The nesting depth between parts to be nested refers to the degree of overlap between one part and another. Calculating the total sum of the nesting depths between all parts can provide a clear objective for the optimization algorithm: reducing the total nesting depth to eliminate overlaps.

[0115] By transforming the objective of eliminating overlaps into a continuous optimization problem, mathematical optimization techniques can be used to find the optimal layout of parts. A continuous optimization problem means that the variables are continuous rather than discrete, which allows the use of optimization techniques such as gradient descent or Newton's method.

[0116] In one embodiment, the mathematical optimization technique is the quasi - Newton iteration method. The quasi - Newton iteration method is an effective algorithm for solving continuous optimization problems. It is based on Newton's method but reduces the computational burden by approximating the Hessian matrix (second - order derivative). The quasi - Newton method adjusts the positions of parts in each iteration to reduce the total nesting depth and thus eliminate the overlaps between parts.

[0117] Through this step, a new nesting plan can be obtained where there are no overlapping parts and the part layout is relatively compact. This method makes full use of mathematical optimization techniques and can, while ensuring that parts do not overlap, improve the material utilization rate as much as possible.

[0118] S4. Return to the step of shortening the length of the current material space according to the preset length until the current iteration number is greater than the preset iteration number to obtain several intermediate nesting plans.

[0119] In this step, repeat steps S2 and S3, continuously shorten the length of the material space and adjust the positions of parts until the preset iteration number is reached, generating multiple intermediate nesting plans. Each iteration may produce a more optimized nesting plan.

[0120] S5. Obtain the target nesting plan according to the material space utilization rate of each intermediate nesting plan.

[0121] Among all the generated intermediate nesting plans, compare the material space utilization rates of each plan and select the plan with the highest utilization rate as the target nesting plan. The material space utilization rate is usually calculated by comparing the used material area with the total material area. For example, utilization rate = (used material area / total material area).

[0122] Preferably, the step of obtaining the target nesting plan according to the material space utilization rate of each intermediate nesting plan includes:

[0123] S51. Obtain the material space utilization rate of each of the intermediate nesting schemes according to each of the intermediate nesting schemes and the area of the material space;

[0124] For each generated intermediate nesting scheme, calculate its material space utilization rate. This utilization rate is obtained by comparing the total area of the material space and the area occupied by all the parts arranged therein;

[0125] Preferably, the step of obtaining the material space utilization rate of each of the intermediate nesting schemes according to each of the intermediate nesting schemes and the area of the material space includes:

[0126] S511. Calculate the material space utilization rate of each intermediate nesting scheme according to the utilization rate calculation formula, where the utilization rate calculation formula is as follows:

[0127]

[0128] In the formula, R is the material space utilization rate, W is the width of the material space, L is the material length required for the intermediate nesting scheme, and Si is the area of the i-th part in the intermediate nesting scheme.

[0129] This utilization rate value will provide an efficiency index for each scheme, indicating the efficiency of the scheme in utilizing the material space. The higher the utilization rate, the greater the proportion of the material area that is effectively used (i.e., occupied by the parts) in the given material space.

[0130] S52. Use the intermediate nesting scheme with the maximum material space utilization rate as the target nesting scheme.

[0131] The higher the utilization rate, the greater the proportion of the material area that is effectively used (i.e., occupied by the parts) in the given material space. In this way, after generating a series of intermediate nesting schemes, the scheme can select the optimal scheme by comparing their material space utilization rates, so as to achieve the maximum utilization of materials and the improvement of production efficiency.

[0132] Embodiment 2

[0133] Please refer to Figure 3 , the embodiment of the present invention provides a two-dimensional nesting device based on improved local search, and the device includes:

[0134] An initial nesting scheme acquisition module, configured to obtain an initial nesting scheme according to the BL strategy and the greedy algorithm, where the initial nesting scheme includes the initial positions of several parts to be nested on the material space;

[0135] A material length acquisition module, configured to shorten the length of the current material space according to a preset length;

[0136] An intermediate layout plan acquisition module, configured to adjust the initial positions of the parts to be laid out according to the squareness between the parts to be laid out and a preset separation method, so as to obtain an intermediate layout plan, where the squareness is used to characterize the neatness degree between a plurality of parts to be laid out;

[0137] An iteration module, configured to control the material length acquisition module and the intermediate layout plan acquisition module to execute cyclically until the current iteration number is greater than a preset iteration number to obtain a plurality of intermediate layout plans;

[0138] A target layout plan acquisition module, configured to obtain a target layout plan according to the material space utilization rate of each intermediate layout plan.

[0139] It should be noted that in this embodiment, each module and each unit in the two-dimensional layout device based on improved local search correspond one by one to each step in the two-dimensional layout method based on improved local search in the foregoing embodiment. Therefore, the specific implementation manner of this embodiment may refer to the implementation manner of the foregoing two-dimensional layout method based on improved local search, and will not be elaborated here.

[0140] Embodiment 3

[0141] In addition, combined with Figure 1 The two-dimensional layout method based on improved local search described in the embodiments of the present invention can be implemented by an electronic device. Figure 4 The hardware structure diagram of the electronic device provided by the embodiments of the present invention is shown. The electronic device may include a processor and a memory storing computer program instructions.

[0142] Specifically, the foregoing processor may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be an integrated circuit configured to implement one or more embodiments of the present invention.

[0143] The memory may include a mass storage for data or instructions. By way of example and not limitation, the memory may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive, or a combination of two or more of these. Where appropriate, the memory may include removable or non-removable (or fixed) media. Where appropriate, the memory may be internal or external to the data processing device. In a particular embodiment, the memory is a non-volatile solid-state memory. In a particular embodiment, the memory includes a read-only memory (ROM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically rewritable ROM (EAROM), or a flash memory, or a combination of two or more of these.

[0144] The processor reads and executes the computer program instructions stored in the memory to implement any one of the two-dimensional nesting methods based on improved local search in the above embodiments.

[0145] In one example, the electronic device may further include a communication interface and a bus. Among them, as Figure 4 shown, the processor 401, the memory 402, and the communication interface 403 are connected through the bus 410 to complete the communication with each other.

[0146] The communication interface is mainly used to implement the communication between the modules, devices, units, and / or devices in the embodiments of the present invention.

[0147] The bus includes hardware, software, or both, and couples the components of the electronic device to each other. By way of example and not limitation, the bus may include an accelerated graphics port (AGP) or other graphics bus, an enhanced industry standard architecture (EISA) bus, a front-side bus (FSB), a hypertransport (HT) interconnect, an industry standard architecture (ISA) bus, an infinite bandwidth interconnect, a low pin count (LPC) bus, a memory bus, a microchannel architecture (MCA) bus, a peripheral component interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a serial advanced technology attachment (SATA) bus, a video electronics standards association local (VLB) bus, or other suitable buses, or a combination of two or more of these. Where appropriate, the bus may include one or more buses. Although the embodiments of the present invention describe and illustrate specific buses, the present invention contemplates any suitable bus or interconnect.

[0148] Embodiment 4

[0149] In addition, in combination with the two-dimensional layout method based on improved local search in the above embodiments, an embodiment of the present invention can provide a computer-readable storage medium to implement. Computer program instructions are stored on the computer-readable storage medium; when the computer program instructions are executed by a processor, any one of the two-dimensional layout methods based on improved local search in the above embodiments is implemented.

[0150] In summary, the two-dimensional layout method, device, equipment and storage medium provided by the embodiments of the present invention, by using the BL strategy and the greedy algorithm, obtain an initial layout plan, where the initial layout plan includes the initial positions of several parts to be laid out in the material space. By combining the BL strategy and the greedy algorithm, this step can generate a relatively optimized initial layout plan. Different from relying only on the area in descending order, the greedy algorithm can select the optimal part for placement according to the evaluation value, so as to possibly obtain a more reasonable initial layout, laying a foundation for subsequent optimization steps; shortening the length of the current material space according to a preset length, and shortening the material length required by the current layout plan according to the preset length can reduce the waste of materials, thereby improving the material utilization rate and the layout efficiency; adjusting the initial positions of the parts to be laid out according to the squareness between the parts to be laid out and a preset separation method to obtain an intermediate layout plan, where the squareness is used to characterize the neatness between several parts to be laid out. Using the squareness and the preset separation method to adjust the initial positions of the parts can reduce the overlap between the parts while keeping the parts neat, thereby obtaining an intermediate layout plan. The squareness index can quantify the neatness between the parts and provide clear guidance for the adjustment of the part positions; returning to the step of shortening the length of the current material space according to the preset length until the current iteration number is greater than the preset iteration number to obtain several intermediate layout plans. By iterating multiple times and continuously shortening the material length and adjusting the part positions, multiple intermediate layout plans can be generated. This iterative process can gradually optimize the layout plan, thereby improving the quality of the final layout plan; obtaining a target layout plan according to the material space utilization rate of each intermediate layout plan, and selecting the layout plan with the highest utilization rate as the target layout plan according to the material space utilization rate of each intermediate layout plan. This selection method ensures that the final layout plan can achieve a high material utilization rate, thereby reducing production costs.

[0151] By adopting a greedy strategy instead of a simple area in descending order, this method can more effectively determine the arrangement order of the parts, thereby generating a better initial layout plan. Different from the random exchange of the existing method, this method can move the parts more reliably by considering the squareness, and can find a layout plan with higher utilization rate faster, thereby improving the layout efficiency and quality.

[0152] It should be clear that the present invention is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present invention is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order between steps after understanding the spirit of the present invention.

[0153] The functional blocks shown in the above-described structural block diagrams can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application-specific integrated circuit (ASIC), appropriate firmware, a plug-in, a functional card, and so on. When implemented in software, the elements of the present invention are programs or code segments used to perform the required tasks. The program or code segment can be stored in a machine-readable medium or transmitted via a data signal carried in a carrier wave on a transmission medium or a communication link. A "machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROMs, flash memories, erasable ROMs (EROMs), floppy disks, CD-ROMs, optical discs, hard disks, fiber optic media, radio frequency (RF) links, and so on. The code segment can be downloaded via a computer network such as the Internet, an intranet, and so on.

[0154] It should also be noted that the exemplary embodiments mentioned in the present invention describe some methods or systems based on a series of steps or devices. However, the present invention is not limited to the order of the above steps, that is, the steps can be executed in the order mentioned in the embodiments, or different from the order in the embodiments, or several steps can be executed simultaneously.

[0155] As described above, the above is only the specific implementation manner of the present invention. Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the above-described systems, modules, and units can refer to the corresponding processes in the foregoing method embodiments and will not be repeated here. It should be understood that the protection scope of the present invention is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present invention can easily think of various equivalent modifications or substitutions, and these modifications or substitutions should all be covered within the protection scope of the present invention.

Claims

1. A two-dimensional nesting method based on improved local search, characterized in that, the method includes: According to the BL strategy and the greedy algorithm, obtain an initial nesting scheme, wherein the initial nesting scheme includes the initial positions of several parts to be nested in the material space; Shorten the length of the current material space according to a preset length; Adjust the initial positions of the parts to be nested according to the squareness between the parts to be nested and a preset separation method to obtain an intermediate nesting scheme, wherein the squareness is used to characterize the neatness degree among several parts to be nested; Return to the step of shortening the length of the current material space according to the preset length until the current iteration number is greater than the preset iteration number to obtain several intermediate nesting schemes; Obtain a target nesting scheme according to the material space utilization rate of each intermediate nesting scheme.

2. The two-dimensional nesting method based on improved local search according to claim 1, characterized in that, the step of obtaining an initial nesting scheme according to the BL strategy and the greedy algorithm includes: Number all the parts to be nested, and place the first part to be nested at the lower left corner position of the material space; Calculate the critical polygon and the inner abutting critical polygon of each part to be nested other than the first part to be nested; Obtain the placement position of the corresponding part to be nested according to the intersection points of the critical polygon and the inner abutting critical polygon; Evaluate each part to be nested according to the part area of the part to be nested and the wasted area formed during nesting to obtain an evaluation value; Place all the parts to be nested according to the placement position and the evaluation value of each part to be nested to obtain an initial nesting scheme.

3. The two-dimensional nesting method based on improved local search according to claim 2, characterized in that, the step of evaluating each part to be nested according to the part area of the part to be nested and the wasted area formed during nesting to obtain an evaluation value includes: Obtain the part area of each part to be nested; Calculate the evaluation value of each part to be nested according to the evaluation value calculation formula and the part area, wherein the evaluation value calculation formula is as follows: where F i is the evaluation value of the i-th part to be nested, S i is the part area of the i-th part to be nested, S wi is the waste area formed during the nesting of the i-th part to be nested, S min is the smallest part area among all parts to be nested, S max is the largest part area among all parts to be nested, and i is a positive integer greater than 1.

4. The two-dimensional nesting method based on improved local search according to claim 2, characterized in that, the step of adjusting the initial positions of the parts to be nested according to the squareness between the parts to be nested and a preset separation method to obtain an intermediate nesting scheme includes: Obtain the nesting position of the i-th part to be nested in the current nesting scheme, denoted as the i-th nesting position; Traverse the parts to be nested other than the i-th part to be nested, denoted as the remaining parts to be nested; Obtain the nesting position of each remaining part to be nested according to the critical polygon and the inner abutting critical polygon of each remaining part to be nested; Obtain the fitting degree between the i-th part to be nested and each remaining part to be nested according to the i-th nesting position and the nesting position of each remaining part to be nested, and the fitting degree is used to quantify the density degree between the i-th part to be nested and the corresponding remaining part to be nested in the material space; Obtain the remaining parts to be nested with the smallest fit degree with the \(i\)-th part to be nested, denoted as the \(j\)-th nested part, and move the \(j\)-th nested part to the corresponding nesting position; Randomly obtain the \(k\)-th part to be nested from the remaining parts to be nested, and move the \(k\)-th part to be nested to the corresponding nesting position; Eliminate the overlap between the parts to be nested according to a preset separation method to obtain an intermediate nesting plan; where \(i\), \(j\), and \(k\) are all positive integers and are not equal to each other.

5. The two-dimensional nesting method based on improved local search according to claim 4, characterized in that The step of obtaining the fit degree between the \(i\)-th nesting position and each of the remaining parts to be nested according to the \(i\)-th nesting position and the nesting positions of each of the remaining parts to be nested includes: According to the \(i\)-th nesting position and the nesting positions of each of the remaining parts to be nested, obtain the minimum envelope matrix of the \(i\)-th part to be nested and each of the remaining parts to be nested; According to the minimum envelope matrix and the fit degree calculation formula, calculate the fit degree between the \(i\)-th part to be nested and each of the remaining parts to be nested, where the fit degree calculation formula is as follows: M iq = (S i + S q ) / S M Where, M iq is the fitness between the i-th part to be nested and the q-th part to be nested, S i is the area of the i-th part to be nested, S q is the area of the remaining parts to be nested, S M is the area of the minimum bounding matrix between the i-th part to be nested and the q-th part to be nested, where q is a positive integer and not equal to i.

6. The two-dimensional nesting method based on improved local search according to any one of claims 1-5, characterized in that The step of obtaining the target nesting plan according to the material space utilization rate of each of the intermediate nesting plans includes: According to each of the intermediate nesting plans and the area of the material space, obtain the material space utilization rate of each of the intermediate nesting plans; Take the intermediate nesting plan with the largest material space utilization rate as the target nesting plan.

7. The two-dimensional nesting method based on improved local search according to claim 6, characterized in that The step of obtaining the material space utilization rate of each of the intermediate nesting plans according to each of the intermediate nesting plans and the area of the material space includes: According to the utilization rate calculation formula, calculate the material space utilization rate of each intermediate nesting plan, where the utilization rate calculation formula is as follows: In the formula, \(R\) is the material space utilization rate, \(W\) is the width of the material space, \(L\) is the material length required for the intermediate nesting plan, and \(S_i\) is the area of the \(i\)-th part in the intermediate nesting plan.

8. A two-dimensional nesting device based on improved local search, characterized in that The device includes: An initial nesting plan acquisition module for obtaining an initial nesting plan according to the BL strategy and the greedy algorithm, where the initial nesting plan includes the initial positions of several parts to be nested on the material space; A material length acquisition module for shortening the length of the current material space according to a preset length; An intermediate nesting plan acquisition module for adjusting the initial positions of the parts to be nested according to the squareness between the parts to be nested and a preset separation method to obtain an intermediate nesting plan, where the squareness is used to characterize the neatness degree between several parts to be nested; An iteration module for controlling the material length acquisition module and the intermediate nesting plan acquisition module to execute cyclically until the current iteration times are greater than the preset iteration times to obtain several intermediate nesting plans; A target layout plan acquisition module, configured to obtain a target layout plan according to the material space utilization rate of each of the intermediate layout plans.

9. An electronic device, characterized in that it includes: At least one processor, at least one memory, and computer program instructions stored in the memory, which implement the method according to any one of claims 1-7 when the computer program instructions are executed by the processor.

10. A storage medium, on which computer program instructions are stored, characterized in that when the computer program instructions are executed by a processor, the method according to any one of claims 1-7 is implemented.

Citation Information

Cited By

  • Two-dimensional layout algorithm selection method and system based on machine learning

    CN120952220A