Three-dimensional blanking optimization method and system based on genetic algorithm
Patent Information
- Application Number
- CN202611166997.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-03
- Publication Date
- 2026-10-27
AI Technical Summary
[0013]1. 本发明结合遗传算法对三维下料方案进行优化,一方面,本发明选择零件排序序列和各零件的切割位姿编码为染色体个体,作为算法的待优化的解,针对每个染色体,在其所表征的零件排序序列和各零件的切割位姿的前提下对零件在原材料中的切割空间位置进行规划,得到对应的下料方案并计算其原材料的利用率和交货拖期以作为后续进行种群筛选和生成下一代种群的参考依据,在种群初始化之后循环迭代直至满足预设终止条件,最终输出一组兼顾材料利用率与交货期要求的下料排样方案,有效提升了三维下料问题的求解质量与工程实用性。另一方面,本发明还在初始化种群阶段提出随机从多种零件排序规则中进行选择以生成初始的零件排序序列,可以使初始种群的个体尽可能均匀地分布在整个解空间中,提升搜索的全局探索能力、避免寻优算法过早陷入局部最优而无法找到全局最优解,继而更加有利于探索到全局最佳的一组兼顾材料利用率与交货期要求的下料方案。
Smart Images

Figure CN122990035A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the technical field of material cutting and layout optimization, and more specifically, relates to a three-dimensional material cutting optimization method and system based on genetic algorithm. Background Technology
[0002] Material layout is the primary process in manufacturing, referring to the planning of a reasonable cutting layout on given raw materials (such as steel plates, marble, foam boards, or graphite blocks) according to the required dimensions and quantities of parts in an order, in order to divide the raw materials into several qualified parts. Material layout is widely used in machinery manufacturing, furniture production, building decoration, and electronic component processing, and the quality of the layout plan directly affects the consumption level of raw materials and the efficiency of subsequent processing. With the increasing demands for refined management and resource conservation in industrial production, efficient and automated material layout methods have become one of the key technologies for cost reduction and efficiency improvement.
[0003] During the material layout and prototyping process, two conflicting objectives are crucial. The first is material utilization, which aims to minimize raw material waste and reduce procurement costs and waste disposal burdens while meeting component requirements. The second is order delivery time, ensuring production schedules meet customer order requirements on time and avoiding penalties and reputational damage due to delayed delivery. However, solely pursuing material utilization often leads to prototyping sequences deviating from order urgency, resulting in some parts being completed ahead of schedule but unable to be shipped on time, increasing inventory costs. Conversely, blindly adhering to delivery deadlines may sacrifice material utilization, leading to increased raw material consumption. Therefore, achieving an effective balance between material utilization and delivery time is a pressing technical challenge in this field.
[0004] However, existing material layout methods often struggle to achieve a dynamic balance between material utilization and delivery time when faced with complex order scenarios involving multiple varieties, small batches, and multiple delivery dates. Traditional methods often rely on manual experience-based layout or optimization algorithms based on a single objective. They either prioritize material utilization at the expense of order urgency, leading to work-in-process inventory buildup and delivery delays, or they organize production entirely according to order sequence, resulting in low raw material utilization and increased waste.
[0005] Therefore, there is an urgent need for an intelligent three-dimensional material cutting and layout method that can simultaneously optimize material utilization and delivery time performance. Summary of the Invention
[0006] In view of the above-mentioned defects or improvement needs of the existing technology, the present invention provides a three-dimensional material cutting optimization method and system based on genetic algorithm, the purpose of which is to automatically generate an intelligent three-dimensional material cutting and layout scheme that can simultaneously optimize material utilization and delivery time performance.
[0007] To achieve the above objectives, this invention is proposed.
[0008] According to a first aspect of the present invention, a three-dimensional blanking optimization method based on a genetic algorithm is provided, comprising: Step S1: Input the basic parameters for 3D blanking, including the 3D dimensions of the raw material, the 3D dimensions of various parts and their required quantities, the set of allowable cutting poses for various parts, and the delivery date for each part. Step S2: Encode the part sorting sequence and the cutting pose of each part into chromosome individuals. The chromosome individual represents the solution to be optimized. Generate N initial chromosome individuals through an initialization operation to form an initial population, where N is the preset size of the initial population. The initialization operation includes: making N random selections from a set of part sorting rules, and generating an initial part sorting sequence according to the selected part sorting rule each time, resulting in N initial part sorting sequences. The part sorting rule set includes sorting rules by volume in descending order, sorting rules by area in descending order, sorting rules by delivery date in ascending order, sorting rules combining volume and delivery date, and random sorting rules. Initialize the cutting pose of each part to an unrotated cutting pose. Step S3: Based on the part sorting sequence carried in the chromosome individual and the cutting pose of each part, execute the three-dimensional blanking and nesting algorithm to obtain the blanking scheme corresponding to the chromosome individual and calculate its fitness. The blanking scheme includes: part sorting sequence, raw material number corresponding to the part and its cutting position and cutting pose in the raw material. The fitness function comprehensively considers the utilization rate of raw materials and delivery delay. Step S4: Determine whether the iteration termination condition has been met. If not, select a high-quality parent from the current population based on the fitness of each chromosome individual in the current population and perform crossover and mutation operations to generate the next offspring. Then jump to step S3. If yes, jump to step S5. Step S5: End the iteration and output the feeding scheme corresponding to the chromosome individuals obtained in the final iteration.
[0009] According to a second aspect of the present invention, a three-dimensional material cutting optimization system based on a genetic algorithm is provided, comprising a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the three-dimensional material cutting optimization method based on a genetic algorithm as described in any of the preceding claims.
[0010] According to a third aspect of the present invention, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps of the three-dimensional blanking optimization method based on a genetic algorithm as described in any of the preceding claims.
[0011] According to a fourth aspect of the present invention, a computer program product is provided, comprising a computer program or instructions that, when executed by a processor, implement the steps of the three-dimensional blanking optimization method based on a genetic algorithm as described in any of the preceding claims.
[0012] Overall, compared with the prior art, the technical solutions conceived in this invention have the following beneficial effects.
[0013] 1. This invention combines a genetic algorithm to optimize 3D material cutting schemes. On one hand, this invention selects the part sorting sequence and the cutting pose of each part as chromosome individuals, which serve as the solutions to be optimized by the algorithm. For each chromosome, under the premise of the part sorting sequence and the cutting pose of each part it represents, the cutting space position of the part in the raw material is planned to obtain the corresponding material cutting scheme. The utilization rate of the raw material and the delivery delay are calculated as references for subsequent population screening and generation of the next generation population. After population initialization, the process is iterated until the preset termination condition is met, and finally a set of material cutting and layout schemes that take into account both material utilization and delivery time requirements are output, which effectively improves the solution quality and engineering practicality of the 3D material cutting problem. On the other hand, this invention also proposes to randomly select from multiple part sorting rules to generate the initial part sorting sequence during the population initialization stage. This allows the individuals of the initial population to be distributed as evenly as possible in the entire solution space, improving the global exploration capability of the search and avoiding the optimization algorithm from getting trapped in local optima too early and failing to find the global optimal solution. This makes it more conducive to exploring a globally optimal set of material cutting schemes that take into account both material utilization and delivery time requirements.
[0014] 2. In some embodiments, a specific material cutting algorithm is further proposed to plan the spatial position of each part in the chromosome individual during material cutting. Based on this algorithm, the optimal solution and global optimization can be taken into account, and the convergence speed and global search capability can be balanced. It supports merging spatial nesting and fine cutting and regeneration of the remaining space, which greatly improves the space utilization of the sheet metal.
[0015] 3. In some embodiments, it is further proposed to introduce an intelligent mutation mode in the later stage of the iteration. By introducing an intelligent mutation mode in the later stage of the iteration to replace some random mutations, the pose of the corresponding parts can be directly adjusted in a targeted manner, which can improve the effectiveness of the mutation operation and thus accelerate the convergence of the algorithm in the local region.
[0016] 4. In some embodiments, a local enhancement operation is further proposed to be performed on the population. By performing the local enhancement operation, the region with the fewest solutions using the same amount of material is explored multiple times, which can improve the uniformity of solution distribution and make the solutions more evenly distributed in the solution space.
[0017] 5. In some embodiments, it is further proposed to remove duplicate solutions from the population. This can prevent solutions with the same fitness from interfering with the generation of new solutions during iteration, thus maintaining the diversity of the solution set in evolution while ensuring the size of the solution set.
[0018] 6. In some embodiments, it is further proposed to use a non-dominated sorting method to screen the population, which can simultaneously ensure the convergence and uniformity of the solution based on Pareto dominance and crowding, avoiding the bias and clustering of the solution space caused by artificial weighting. Attached Figure Description
[0019] Figure 1 This is a flowchart illustrating the steps of a three-dimensional material cutting optimization method based on a genetic algorithm in one embodiment of the present invention.
[0020] Figure 2 This is a schematic diagram of the encoding of one of the chromosome individuals in the initial population in one embodiment of the present invention.
[0021] Figure 3 This is a schematic diagram of a complete cut constraint. (a) shows the case that meets the complete cut constraint, and (b) shows the case that does not meet the complete cut constraint.
[0022] Figure 4 This is a schematic diagram of spatial cutting in one embodiment.
[0023] Figure 5 This is a schematic diagram of bidirectional detection and deep fusion of spatial segments in the figure that satisfy the adjacent constraints in one embodiment of the present invention. (a) shows the merging of the upper space and the lower space, (b) shows the merging of the left space and the right space, and (c) shows the merging of the front space and the back space.
[0024] Figure 6 This is a scatter plot output by the genetic algorithm after iterative execution in one embodiment of the present invention.
[0025] Figure 7 This is a three-dimensional layout diagram drawn based on data in one embodiment of the present invention. Detailed Implementation
[0026] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention. Furthermore, the technical features involved in the various embodiments of this invention described below can be combined with each other as long as they do not conflict with each other.
[0027] Example 1 like Figure 1The diagram shows a flowchart of a three-dimensional material cutting optimization method based on a genetic algorithm according to an embodiment of the present invention, which mainly includes steps S1 to S5. The following is a detailed explanation of the steps. Figure 1 Each step is explained in detail.
[0028] Step S1: Input the basic parameters for 3D cutting, including the 3D dimensions of the raw material, the 3D dimensions of various parts and their required quantities, the set of allowable cutting poses for various parts, and the delivery date for each part.
[0029] For example, if three types of parts need to be generated, their dimensions, quantities, and delivery dates are as follows: Type 1 parts: 6×8×10, 10 pieces in total, delivery time is 2 days; Type 2 parts: 5×5×5, 8 pieces in total, delivery time is 5 days; The third type of part: 3×7×5, a total of 13 pieces, with a delivery time of 3 days; The above three types of parts can be rotated arbitrarily. It should be noted that if a certain part is not allowed to rotate, then it only has one cutting posture.
[0030] The dimensions of the raw materials used are 20×20×20.
[0031] Step S2: Encode the part sorting sequence and the cutting pose of each part into chromosome individuals. Generate N initial chromosome individuals through initialization operations to form an initial population, where N is the preset size of the initial population. The initialization operation includes: making N random selections from the set of part sorting rules, and generating an initial part sorting sequence according to the selected part sorting rule each time, resulting in N initial part sorting sequences. The part sorting rule set includes sorting rules by volume in descending order, sorting rules by area in descending order, sorting rules by delivery date in ascending order, sorting rules combining volume and delivery date, and random sorting rules. Initialize the cutting pose of each part to an unrotated cutting pose.
[0032] Specifically, the chromosome individual coding is a two-part coding. The first part is the sorting sequence of the parts to be processed, that is, the priority order of the parts when nesting. The second part is the pose of each part when the material is inserted. For parts that can be rotated arbitrarily, there are 6 candidate poses, each corresponding to 6 different size specifications. Figure 2 The diagram shows the encoding of one chromosome individual in the initial population in an embodiment of the present invention. In the actual algorithm implementation, different numbers can be used to represent different poses. For example, the pose without rotation can be recorded as 1. The chromosome encoding of 5 parts is arranged according to certain rules as 3, 1, 5, 2, 4. The corresponding sequence number is the part number. Initially, the pose is 1, that is, the pose without rotation.
[0033] During the generation of the initial population, the present invention performs N random selections from the set of part sorting rules, and generates an initial part sorting sequence according to the selected part sorting rule each time, resulting in N initial part sorting sequences; the cutting pose of each part is initialized to an unrotated cutting pose.
[0034] Regarding the part sorting sequence in each initial chromosome individual, multiple part sorting rules can be set, such as sorting by volume in descending order, sorting by area in descending order, sorting by delivery date in ascending order, sorting by weighted sum of volume and delivery date in descending order, and random sorting. Each time, a part sorting rule is randomly selected from the above rule set to generate an initial part sorting sequence in the initial solution. In this way, the individuals in the initial population can be distributed as evenly as possible throughout the solution space, improving the global exploration capability of the search and avoiding the optimization algorithm from getting trapped in local optima too early and failing to find the global optimum. In one embodiment, a normalized sampling probability can be set for each different part sorting rule. For example, the probabilities of sorting by volume in descending order, sorting by area in descending order, sorting by delivery date in ascending order, sorting by weighted sum of volume and delivery date in descending order, and random sorting are 0.15, 0.15, 0.2, 0.2, and 0.3, respectively, and are randomly selected according to this probability.
[0035] Step S3: Based on the part sorting sequence carried in the chromosome individual and the cutting pose of each part, execute the three-dimensional blanking and nesting algorithm to obtain the blanking scheme corresponding to the chromosome individual and calculate its fitness. The blanking scheme includes: part sorting sequence, the raw material number corresponding to the part and its cutting position and cutting pose in the raw material. The fitness function comprehensively considers the utilization rate of raw materials and delivery delay.
[0036] Specifically, for each chromosome individual, after determining its part sorting sequence and the cutting pose of each part, the corresponding cutting scheme is obtained through a three-dimensional cutting and layout algorithm to calculate the fitness of the chromosome individual. The cutting scheme needs to determine at least the part sorting sequence, the raw material number corresponding to the part (i.e., which raw material to use for cutting), and its cutting position and pose in the raw material.
[0037] Existing methods for handling 3D cutting problems generally lack effective modeling of the complete cutting constraint (Guillotine constraint). The resulting nesting schemes cannot be executed using slitting equipment in actual production, reducing the engineering feasibility of the schemes. In this embodiment, for each chromosome individual, a spatial reconstruction-based heuristic cutting algorithm can be used to obtain its corresponding cutting scheme. The specific process is as follows.
[0038] Step S31: Using the newly activated raw material as the initial candidate subspace in the material space, select the part that is currently at the front of the list according to the part sorting sequence; Step S32: For the currently selected part, match a candidate subspace that can accommodate the current part in the current material space according to the preset matching rules, and then proceed to step S33. The preset matching rules are: select the candidate subspace with the best fit according to probability p, and select the candidate subspace located in the lower left position according to probability 1-p, where 0.5 < p < 1. If none of the candidate subspaces can accommodate the current part, match a candidate merged space with the best fit that can accommodate the current part based on the spatial adjacency graph of the current material space, and then proceed to step S33. The candidate merged space is formed by merging adjacent candidate subspaces. If none of the candidate merged spaces can accommodate the current part, skip the current part, select the next part to be arranged, and execute step S32 again. If no candidate subspace or candidate merged space is matched until the last part to be arranged, seal the current raw material, obtain the next raw material, and proceed to step S31.
[0039] Specifically, the above steps achieve spatial optimization based on an adaptive fit evaluation model. First, a new material space is created and initialized. Then, parts are taken out sequentially from the part sequence to find a suitable space for placement. Whether a candidate subspace can accommodate the current part, i.e., whether the current part can be placed into the candidate subspace according to the current set posture, is determined in a unified three-dimensional coordinate system. Placement is successful only when the length, width, and height of the part are all less than or equal to the length, width, and height of the space. If the current part can be placed into multiple candidate subspaces, i.e., multiple feasible candidate subspaces exist, the fit of each feasible candidate subspace can be calculated, and the candidate subspace with the best fit is selected. In the selection strategy of candidate subspaces, this invention adopts a probabilistic selection mechanism. The space with the highest fit is selected with a higher probability (e.g., p=0.8) to ensure maximum material utilization. A candidate space in the lower left-rear-lower position in the space is selected with a lower probability (e.g., p=0.2) to enhance the diversity of layout schemes, avoid prematurely falling into local optima, and facilitate the exploration of better spatial layout schemes in subsequent iterations.
[0040] If none of the remaining candidate subspaces meet the requirements, a residual space adjacency graph is constructed based on the remaining candidate subspaces. Bidirectional probing and deep fusion are then performed on the spatial segments within the graph that satisfy the adjacency constraints. This specifically includes merging the preceding and following spaces, and identifying the candidate merged space with the best fit as the matching space for the current part. The process of bidirectional probing and deep fusion of the spatial segments within the graph that satisfy the adjacency constraints is detailed later.
[0041] If none of the remaining candidate subspaces and their candidate merge spaces meet the requirements, skip the part and try to fit the next part in the sequence. If none of the parts to be allocated can be placed in the space, close the material space and reinitialize the next new material until all the remaining parts are placed into the material.
[0042] In one embodiment, an evaluation index of "spatial fragmentation and local compactness" can be introduced to calculate the fit of each feasible space after the current part is placed. The formula for calculating the fit is: ; In the formula, The fit of candidate subspace i after the current part is placed in it. a i , b i , c i Let be the length, width, and height of candidate subspace i, respectively. l j , w j , h j These are the length, width, and height dimensions of the current part, respectively.
[0043] Step S33: After placing the current part into its corresponding matching space, delete the space occupied by the current part in the corresponding matching space and record the corresponding raw material number and its cutting position in the raw material. Cut the remaining space of the corresponding matching space into a new candidate subspace according to the cutting rules and add it to the material space; the current part is marked as a sorted part.
[0044] Among them, the cutting rules for material preparation must meet the complete cutting constraint, such as... Figure 3 The diagram shows a complete cut constraint. (a) shows the case where the complete cut constraint is met, and four different colored parts can be obtained by cutting in the order of the numbers in the diagram. (b) shows the case where the complete cut constraint is not met, and the four parts cannot be processed by complete cutting.
[0045] like Figure 4The diagram illustrates a spatial cutting method in one embodiment. Specifically, the candidate space is a cuboid, with the Y-axis pointing to its right, the X-axis pointing to its front, and the Z-axis pointing upwards in a three-dimensional Cartesian coordinate system. Following conventional cutting methods, the part is placed in the lower left rear position of the candidate space, ensuring that the left, rear, and bottom surfaces of the part are fully aligned with the left, rear, and bottom surfaces of the candidate space, respectively. Then, the remaining space in the candidate space not occupied by the part is divided into three sub-spaces, extending along the positive Z-axis, positive X-axis, and positive Y-axis to the boundary of the candidate space, thus forming three new cuboid sub-spaces: the first sub-space is located directly above the part (upper space), the second sub-space is located to the right of the part (right space), and the third sub-space is located in front of the part (front space). These three sub-spaces are adjacent to each other and do not overlap, collectively filling all the remaining space in the original candidate space except for the area occupied by the part. Therefore, the number of fragments in the candidate sub-spaces of the material space increases, but the fragment size decreases.
[0046] Furthermore, the segmentation of the front and right spaces employs an asymmetric spatial segmentation method based on a forward-looking dynamic criterion. This criterion introduces a forward-looking dynamic segmentation principle: when evaluating the use of a "longitudinal segmentation plane" parallel to the right surface of the part and a "transverse segmentation plane" parallel to the front surface of the part, it dynamically links the characteristic size distribution of the un-stacked parts. If a segmentation scheme that generates a larger subspace better matches the size characteristics of large-volume or high aspect ratio parts among the remaining un-stacked parts, this scheme is prioritized, thereby maximizing the retention of effective continuous usable space. For example, a variable can be dynamically maintained to store the maximum value of the "length" dimension of the un-stacked parts. If the longest side of both spaces segmented by the first method is greater than or equal to the maximum value of the part's "length," and only one space segmented by the second method has a longest side greater than or equal to the maximum value of the part's "length," then the first method is selected; if only one segmentation method satisfies this condition, then that method is selected; if neither satisfies this condition, then a method is randomly selected.
[0047] Multiple adjacent candidate subspaces can be merged, such as... Figure 5 The diagram illustrates a bidirectional detection and depth fusion of spatial segments satisfying adjacency constraints within an image, according to an embodiment of the present invention. (a) shows the merging of the upper and lower spaces, (b) shows the merging of the left and right spaces, and (c) shows the merging of the front and rear spaces. The merged spaces must satisfy the requirement that there are completely overlapping projection planes in the merging direction, and the maximum inscribed cuboid volume of the merged new space must be strictly larger than any single space before merging. It is understandable that merging should yield at least one candidate merged space capable of accommodating the smallest unordered part in the current sequence; otherwise, merging is meaningless.
[0048] Step S34: Determine if the current part is the last part to be arranged. If not, select the next part to be arranged and jump to step S32. If yes, jump to step S35.
[0049] Step S35: End the material feeding and sorting process to obtain the material feeding plan corresponding to the individual chromosomes.
[0050] For each individual chromosome, steps S31 to S36 above can be used to obtain its corresponding material preparation plan.
[0051] After determining the cutting plan for a specific chromosome individual, its fitness can be calculated. The fitness function takes into account the utilization rate of raw materials and the delivery delay. The higher the fitness, the better the cutting plan for that individual, and the higher the utilization rate of raw materials and the shorter the delivery delay.
[0052] The utilization rate of a single piece of raw material is defined as the ratio of the total volume of the inserted parts to the volume of the raw material. i Utilization rate of raw materials u i The calculation formula is: ; In the formula, Indicates the first i The length, width, and height of the raw material. These are the first batches of raw materials discharged into this batch. j The length, width, and height of each part.
[0053] The global average utilization rate is obtained by averaging the utilization rates of all activated raw materials. ; In the formula, The quantity of raw materials used.
[0054] The delay is calculated by taking the actual completion time of the raw material containing the last processed part in a batch as the completion time of that batch, comparing this completion time with the scheduled delivery date, and taking the difference. For scenarios with coupled multi-batch orders, the delay of the k-th batch of parts is calculated. d k The calculation is based on the actual completion time of the material of the last part processed in that batch. boxtime k To perform the calculation, take 0 and the material completion time. boxtime k Delivery period t k The larger of the differences is used to calculate the cost of delay: d k = max(0, boxtimek - t k ); For example, if the delivery date for a batch is 2 days and the actual completion time is 3 days, then the delay for that batch is 3-2=1 day. Conversely, if the delivery date for a batch is 3 days and the actual completion time is 2 days, then the delay for that batch is 0 days.
[0055] The total delay cost of a single layout is obtained by summing the delays of each batch of parts: d = .
[0056] In one embodiment, the fitness function takes into account the global average utilization rate. Total cost of delay d fitness and global average utilization Positively correlated with total delay cost d The correlation is negative; the higher the fitness, the better the corresponding chromosome individual.
[0057] Step S4: Determine whether the iteration termination condition has been met. If not, select a high-quality parent from the current population based on the fitness of each chromosome individual in the current population and perform crossover and mutation operations to generate the next offspring, then jump to step S3. If yes, jump to step S5.
[0058] Crossover and mutation are crucial processes in genetic algorithms. Crossover involves the exchange of partial chromosome segments between parent chromosomes to produce offspring. Crossover can significantly alter the solution in the early stages of iteration, allowing for a more comprehensive search across the entire solution space. Mutation, on the other hand, ensures that the algorithm can escape local optima in the later stages of iteration, enabling the discovery of even better solutions and preventing it from rapidly converging to a local optimum.
[0059] When crossing over, the crossing over of chromosomes involves randomly generating two crossing points on the chromosomes involved in the crossing over, and exchanging the genes between the crossing points. Various methods can be used, such as partial matching crossing over, sequential crossing over, and position-based crossing over.
[0060] In the mutation stage, random mutation can be performed. More specifically, pose mutation or part order sequence mutation can be selected with a certain probability. There are two modes of random mutation: one is to randomly generate two points on the chromosome and swap the parts at those points, i.e., change the processing order of the two parts; the other is to randomly generate a point on the chromosome and change the pose of the part at that point, i.e., randomly rotate the part within allowed rotations and update its length, width, and height dimensions. Pose mutation involves randomly selecting the pose of one part from the chromosome individuals for mutation; part order sequence mutation involves randomly selecting two parts from the chromosome individuals and swapping their cutting order. For example, the probability of both random mutation methods can be set to 0.5.
[0061] In one embodiment, after the number of iterations exceeds half of the preset total number of iterations, when performing mutation operations in subsequent iterations, a visual feedback-based intelligent mutation mode is selected with a preset probability q, and a random mutation mode is selected with a probability of 1-q when 0 < q < 0.5. That is, when the algorithm iteration enters the middle and late stages (e.g., the number of iterations exceeds 50% of the total number of iterations), intelligent mutation based on the visual analysis results of S25 is triggered with a certain probability (e.g., q = 0.2). This means that based on the visually identified areas of insufficient space utilization and posture optimization suggestions, the pose of the corresponding parts is directly adjusted in a targeted manner, rather than through random mutation, thereby accelerating the convergence of the algorithm in local areas.
[0062] The process of implementing a visual feedback-based intelligent mutation model on individual chromosomes is as follows.
[0063] Step S41: Obtain the cutting scheme corresponding to the selected chromosome individual. Use the raw materials that have been used in the cutting scheme, except for the last piece of raw material, as the visual analysis raw materials. Perform three-dimensional visual modeling on the spatial layout of each visual analysis raw material to construct a digital representation of the internal space occupied by parts and the remaining available space of the corresponding visual analysis raw material.
[0064] Step S42: Identify the underutilized space above and around the topmost part of each visual analysis raw material, and record the geometric dimensions and spatial coordinates of these spaces.
[0065] Specifically, visual analysis can be used to identify the distribution pattern of the topmost arranged parts in each piece of visual analysis raw material, thereby enabling the labeling of underutilized spaces.
[0066] Step S43: For the identified underutilized space, select all parts that can be fully accommodated in the underutilized space from the set of parts that can be rotated as recommended rearranged parts, and record the number of the selected recommended rearranged parts and the recommended cutting posture after rotation.
[0067] Specifically, for identified underutilized space areas, and considering the adjustable parts among the currently arranged parts, an AI visual analysis model is used to determine whether there is a possibility that the space can accommodate one or more additional parts by rotating the parts' orientation (i.e., switching between six allowed rotation states). If the analysis result indicates feasibility, the specific part number and recommended orientation are output.
[0068] Step S44: Take out the recommended rearranged parts from the original spatial layout of the cutting scheme and rearrange them into the underutilized space with the recommended cutting posture. The space freed up after taking out the recommended rearranged parts is the candidate backfill space. Select the parts that can be accommodated in the candidate backfill space from the arranged parts of the last piece of raw material that is used as backfill parts and backfill them into the candidate backfill space. Update the part posture and part sorting sequence in the chromosome individual to realize the mutation of the chromosome individual. The cutting scheme that completes the rearrangement and backfilling is the cutting scheme of the mutated chromosome individual.
[0069] Specifically, based on the optimization suggestions output by visual analysis, a local rearrangement operation is performed on the corresponding material space. This involves removing parts whose orientation is recommended for adjustment, rearranging them according to the recommended orientation, locating the last piece of raw material that has completed its arrangement, disassembling all its internal parts, selecting the smallest set of small parts with relaxed delivery constraints as backfill candidate parts, and attempting to fill the vacated space with them. Rearrangement changes the orientation but not the order; backfilling changes the order, placing the backfilled parts before or after the rearranged parts, and re-arranging the remaining parts in the last piece of material. After the local rearrangement is completed, the utilization rate of the material space and the global average utilization rate are recalculated.
[0070] It should be noted that when jumping back to step S3 after generating offspring in step S4 to analyze the cutting scheme and fitness of each chromosome individual, the three-dimensional cutting and nesting algorithm does not need to be re-executed for the offspring obtained by using the above intelligent mutation mode. The cutting scheme after rearrangement and backfilling can be directly used as the cutting scheme of the mutated chromosome individual and its fitness can be calculated based on the cutting scheme. For other randomly mutated chromosome individuals, the three-dimensional cutting and nesting algorithm needs to be executed to obtain its cutting scheme.
[0071] In summary, by introducing an intelligent mutation mode in the later stages of iteration to replace some random mutations, the pose of the corresponding parts can be adjusted directly, which can improve the effectiveness of the mutation operation and thus accelerate the convergence of the algorithm in the local area.
[0072] In one embodiment, before selecting superior parents from the current population based on the fitness of each chromosome individual and performing crossover and mutation operations, a local enhancement operation is further included. Specifically, this includes: calculating the amount of raw materials required for the material preparation scheme corresponding to each chromosome individual in the current population; clustering chromosome individuals according to the required amount of raw materials; grouping chromosome individuals using the same amount of raw materials into one cluster; selecting the chromosome individual set with the smallest cluster size as the population to be enhanced; selecting chromosome individuals from this cluster and performing mutation; and adding chromosome individuals with better fitness after mutation to the current population. Each chromosome individual is considered a different solution. For example, different solutions use 5, 6, and 7 pieces of material, respectively, and the solution using 6 pieces of material is the least common. Therefore, the solution using 6 pieces of material is selected, and one solution is randomly selected from this set for mutation. This process is repeated multiple times. When the mutated solution is better than the current solution, the mutated solution is added to the solution set.
[0073] In summary, by performing local enhancement operations and exploring the region with the fewest solutions using the same amount of material multiple times, the uniformity of solution distribution can be improved, making the solutions more evenly distributed in the solution space.
[0074] In one embodiment, the current population contains both parent and offspring chromosome individuals. Before performing crossover and mutation operations on the current population, a duplicate solution removal operation is performed. This specifically includes: comparing the fitness of each chromosome individual; when multiple chromosome individuals have the same fitness, only the initially generated chromosome individual is retained, and the remaining chromosome individuals with the same fitness are deleted from the population. In other words, the fitness of the new solution generated through crossover and mutation is compared with that of the old solution; if multiple solutions have the same fitness, only the initially generated solution is retained.
[0075] In summary, considering that solutions with the same fitness can interfere with the generation of new solutions during iteration, because in order to maintain the size of the solution set, solutions with the same fitness may occupy positions in the solution set, which is not conducive to maintaining the diversity of the solution set in the evolution.
[0076] In one embodiment, before performing crossover and mutation operations on the current population, a non-dominated sorting method is used to divide all individuals in the population into several non-dominated Pareto front levels according to multi-dimensional objectives, including material utilization and order delivery delay penalties. Individuals in the first front level are not dominated by other individuals in any objective and have the highest priority. Based on this, crowding distance is further calculated for individuals within the same front level to measure the density of their distribution in the objective space. Subsequently, combining the front level index and crowding distance, individuals with higher overall fitness evaluations are selected from the current population to form the updated population.
[0077] Specifically, the dominance relationship between solutions is defined as follows: if one solution performs no worse than another in all objectives and is superior to the other in at least one objective, then that solution dominates the other; otherwise, no dominance relationship exists. If solution a dominates solution b, then for both material utilization and delay objectives, the results obtained by solution a are no worse than those obtained by solution b, and solution a is superior to solution b in at least one objective. For material utilization, a higher value is better, while for delay, a lower value is better. For example, if solution a has a material utilization of 0.85 and a delay of 1, and solution b has a material utilization of 0.82 and a delay of 1.5, then solution a dominates solution b. If any objective value in solution b is better than that in solution a, then solution a and b do not have a dominance relationship. To unify the two objective values towards the same optimization direction, in practice, the objective of utilization is replaced with "1 - utilization," changing the search for the maximum value to the search for the minimum value. This has no impact on the actual required material utilization. The sorting of congestion distances for solutions at the same level is only performed on solutions at the last selected level. Crowding distance is the distance between a solution and its neighboring solutions. It is a value that evaluates the concentration of solutions. The purpose of sorting by crowding distance is to make the selected solutions more widely distributed in the search space rather than more concentrated. Selecting solutions with high crowding distance helps to maintain the diversity of solutions during the iteration process, so as to explore more diverse solutions.
[0078] The above method of using non-dominated ranking to screen individuals can simultaneously ensure the convergence and uniformity of solution distribution based on Pareto dominance and crowding, avoiding the bias and clustering of solution space caused by manual weighting.
[0079] Step S5: End the iteration and output the feeding scheme corresponding to the chromosome individuals obtained in the final iteration.
[0080] Specifically, by repeatedly executing steps S2 to S4, the algorithm will gradually find solutions located on the Pareto front. When the number of iterations meets the preset threshold or the running time limit, the algorithm will automatically terminate.
[0081] like Figure 6 The image shows a scatter plot of the output after the genetic algorithm's iterative run, where the horizontal axis represents 1 - utilization rate and the vertical axis represents delay. Figure 7 The image shows a 3D layout diagram drawn based on the data.
[0082] Example 2 This invention also relates to a three-dimensional material cutting optimization system based on a genetic algorithm, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps of the method described above.
[0083] This genetic algorithm-based 3D blanking optimization system can be installed on computing devices such as desktop computers, laptops, handheld computers, and cloud servers. The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The memory can be used to store computer programs and / or modules. The processor implements various functions of the electronic device by running or executing the computer programs and / or modules stored in the memory, and by accessing data stored in the memory.
[0084] Example 3 The present invention also relates to a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described above.
[0085] Specifically, the memory may include high-speed random access memory, as well as non-volatile memory, such as hard disks, RAM, plug-in hard disks, smart media cards (SMC), secure digital (SD) cards, flash cards, at least one disk storage device, flash memory device, or other volatile solid-state storage devices.
[0086] Example 4 This invention provides a computer program product or computer program that includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the steps of the method described in the above embodiments of this invention.
[0087] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as the combination of these technical features does not contradict each other, it should be considered within the scope of this specification. It should be noted that the terms "in one embodiment," "for example," and "again" are intended to illustrate the present invention and are not intended to limit the present invention.
[0088] The above embodiments merely illustrate several implementation methods of the present invention, and their descriptions are relatively specific and detailed, but they should not be construed as limiting the scope of the patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these all fall within the protection scope of the present invention.
Claims
1. A three-dimensional material cutting optimization method based on genetic algorithm, characterized in that, include: Step S1: Input the basic parameters for 3D blanking, including the 3D dimensions of the raw material, the 3D dimensions of various parts and their required quantities, the set of allowable cutting poses for various parts, and the delivery date for each part. Step S2: Encode the part sorting sequence and the cutting pose of each part into chromosome individuals. The chromosome individuals are the solutions to be optimized. Generate N initial chromosome individuals through initialization operations to form an initial population. N is the preset size of the initial population. The initialization operation includes: randomly selecting N parts from a set of part sorting rules, and generating an initial part sorting sequence according to the selected part sorting rule each time, resulting in N initial part sorting sequences; the set of part sorting rules includes sorting rules by volume in descending order, sorting rules by area in descending order, sorting rules by delivery date in ascending order, sorting rules combining volume and delivery date, and random sorting rules; and initializing the cutting pose of each part to an unrotated cutting pose; Step S3: Based on the part sorting sequence carried in the chromosome individual and the cutting pose of each part, execute the three-dimensional blanking and nesting algorithm to obtain the blanking scheme corresponding to the chromosome individual and calculate its fitness. The blanking scheme includes: part sorting sequence, raw material number corresponding to the part and its cutting position and cutting pose in the raw material. The fitness function comprehensively considers the utilization rate of raw materials and delivery delay. Step S4: Determine whether the iteration termination condition has been met. If not, select a high-quality parent from the current population based on the fitness of each chromosome individual in the current population and perform crossover and mutation operations to generate the next offspring. Then jump to step S3. If yes, jump to step S5. Step S5: End the iteration and output the feeding scheme corresponding to the chromosome individuals obtained in the final iteration.
2. The three-dimensional blanking optimization method based on genetic algorithm as described in claim 1, characterized in that, Based on the part sorting sequence carried by each chromosome individual and the cutting pose of each part, a three-dimensional blanking and layout algorithm is executed to obtain the blanking scheme corresponding to the chromosome individual, specifically including: Step S31: Using the newly activated raw material as the initial candidate subspace in the material space, select the part that is currently at the front of the list according to the part sorting sequence; Step S32: For the currently selected part, match a candidate subspace that can accommodate the current part in the current material space according to the preset matching rules, and then proceed to step S33. The preset matching rules are: select the candidate subspace with the best fit according to probability p, select the candidate subspace located in the lower left position according to probability 1-p, and 0.5 < p < 1. If none of the candidate subspaces can accommodate the current part, match a candidate merged space with the best fit that can accommodate the current part according to the spatial adjacency graph of the current material space, and then proceed to step S33. The candidate merged space is formed by merging adjacent candidate subspaces. If none of the candidate merged spaces can accommodate the current part, skip the current part, select the next part to be arranged, and execute step S32 again. If no candidate subspace or candidate merged space is matched until the last part to be arranged, seal the current raw material, obtain the next raw material, and proceed to step S31. Step S33: After placing the current part into its corresponding matching space, delete the space occupied by the current part in the corresponding matching space and record the corresponding raw material number and its cutting position in the raw material. Cut the remaining space of the corresponding matching space into new candidate subspaces according to the cutting rules and add them to the material space; the current part is marked as a sorted part. Step S34: Determine whether the current part is the last part to be arranged. If not, select the next part to be arranged and jump to step S32. If yes, jump to step S35. Step S35: End the material feeding and sorting process to obtain the material feeding plan corresponding to the individual chromosomes.
3. The three-dimensional blanking optimization method based on genetic algorithm as described in claim 1, characterized in that, When the number of iterations exceeds half of the preset total number of iterations, in subsequent iterations, when performing mutation operations, a smart mutation mode based on visual feedback is selected with a preset probability q, and a random mutation mode is selected with a probability of 1-q when 0 < q < 0.
5. The process of implementing a visual feedback-based intelligent mutation model on individual chromosomes includes: Step S41: Obtain the cutting scheme corresponding to the selected chromosome individual. Use the raw materials that have been used in the cutting scheme, except for the last piece of raw material, as the visual analysis raw materials. Perform three-dimensional visual modeling on the spatial layout of each visual analysis raw material to construct a digital representation of the internal space occupied by parts and the remaining available space of the corresponding visual analysis raw material. Step S42: Identify the underutilized space above and around the topmost part of each visual analysis raw material, and record the geometric dimensions and spatial coordinates of these spaces; Step S43: For the identified underutilized space, select all parts that can be fully accommodated in the underutilized space from the set of parts that can be rotated as recommended rearranged parts, and record the number of the selected recommended rearranged parts and the recommended cutting posture after rotation. Step S44: Take out the recommended rearranged parts from the original spatial layout of the cutting scheme and rearrange them into the underutilized space with the recommended cutting posture. The space freed up after taking out the recommended rearranged parts is the candidate backfill space. Select the parts that can be accommodated in the candidate backfill space from the arranged parts of the last piece of raw material that is used as backfill parts and backfill them into the candidate backfill space. Update the part posture and part sorting sequence in the chromosome individual to realize the mutation of the chromosome individual. The cutting scheme that completes the rearrangement and backfilling is the cutting scheme of the mutated chromosome individual.
4. The three-dimensional blanking optimization method based on genetic algorithm as described in claim 1, characterized in that, Random mutation modes are further divided into pose mutation mode and part sorting sequence mutation mode. Random mutation mode randomly selects one of the two modes for mutation.
5. The three-dimensional blanking optimization method based on genetic algorithm as described in claim 1, characterized in that, Before performing crossover and mutation operations on the current population, a local enhancement operation is also performed, which includes: counting the amount of raw materials required for the feeding scheme corresponding to each chromosome individual in the current population, clustering chromosome individuals according to the amount of raw materials required, clustering chromosome individuals with the same amount of raw materials into one group, taking the set of chromosome individuals with the smallest cluster size as the population to be enhanced, selecting chromosome individuals from it and performing mutation, and adding chromosome individuals with better fitness after mutation to the current population.
6. The three-dimensional blanking optimization method based on genetic algorithm as described in claim 1, characterized in that, The current population contains both parent and offspring chromosome individuals. Before performing crossover and mutation operations on the current population, a duplicate solution removal operation is performed first. Specifically, this includes comparing the fitness of each chromosome individual. When multiple chromosome individuals have the same fitness, only the initially generated chromosome individual is retained, and the remaining chromosome individuals with the same fitness are deleted from the population.
7. The three-dimensional blanking optimization method based on genetic algorithm as described in claim 6, characterized in that, After removing duplicate solutions and before performing crossover and mutation operations, a non-dominated sorting method is used to sort the individual chromosomes in the current population, and a preset number of chromosomes are selected as the updated population based on the sorting.
8. A three-dimensional material cutting optimization system based on a genetic algorithm, comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the three-dimensional blanking optimization method based on genetic algorithm as described in any one of claims 1 to 7.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the three-dimensional blanking optimization method based on genetic algorithm as described in any one of claims 1 to 7.
10. A computer program product, comprising a computer program or instructions, characterized in that, When the computer program or instructions are executed by the processor, they implement the steps of the three-dimensional blanking optimization method based on genetic algorithms as described in any one of claims 1 to 7.