Production plan optimization method based on variable-length chromosome genetic algorithm
By using a variable-length chromosome genetic algorithm, special chromosome encoding and genetic operators were designed to solve the production planning problem with variable number of stages, improve the efficiency and quality of production planning, and optimize equipment utilization and order delivery.
Patent Information
- Application Number
- CN202511768616.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-28
- Publication Date
- 2026-03-17
AI Technical Summary
Existing technologies struggle to effectively handle production plans with variable number of stages, leading to uneven resource utilization and order delivery risks. Furthermore, the fixed-length chromosome encoding of traditional genetic algorithms limits the space for understanding, resulting in poor optimization performance.
A variable-length chromosome genetic algorithm is adopted, with special chromosome encoding, genetic operators and repair mechanisms designed. An initial population is generated through variable-length chromosome encoding rules, fitness is evaluated by a simulation scheduling system, and a high-quality production plan is generated through roulette wheel selection, crossover and mutation operations to ensure feasibility.
It significantly improved the efficiency and quality of production planning, optimized the utilization rate of key equipment and order delivery rate, and generated plans that are closer to actual production needs.
Smart Images

Figure CN121684276A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of management science and engineering, and involves the application of operations research and intelligent optimization algorithms. Specifically, it is a production planning optimization method based on variable-length chromosome genetic algorithm. Background Technology
[0002] In modern manufacturing, formulating annual or quarterly production plans is a complex decision-making task. Especially in companies producing multiple products with fluctuating market demand, planners need to rationally break down total orders into multiple production stages (e.g., monthly or quarterly), with each stage potentially producing different product mixes and quantities. Traditional planning methods often rely on manual experience or simple average allocation, making it difficult to simultaneously consider multiple optimization objectives such as key equipment utilization and on-time order delivery, frequently leading to uneven resource utilization or delivery risks.
[0003] Genetic algorithms, as a powerful global optimization tool, have been attempted for use in production planning. However, standard genetic algorithms typically use fixed-length chromosome encoding, which cannot effectively represent the common requirement in real-world production where the number of stages can vary. Forcing a variable-length plan to use a fixed-length encoding severely limits the solution space, leading to poor optimization results. Furthermore, the solutions (chromosomes) generated during the evolution process often do not conform to actual production constraints (such as total output equaling order quantity), resulting in low algorithm efficiency.
[0004] Therefore, existing technologies lack an intelligent optimization method that can adaptively express variable-stage production plans and effectively handle complex production constraints. Summary of the Invention
[0005] This invention aims to address the aforementioned shortcomings of existing technologies by providing a production planning optimization method based on a variable-length chromosome genetic algorithm. This method effectively handles production planning problems with a variable number of stages. By designing special chromosome encoding, genetic operators, and repair mechanisms, it rapidly generates high-quality, feasible production plans, thereby significantly improving the efficiency and quality of planning and optimizing the utilization rate of key equipment and order delivery rate.
[0006] The technical solution adopted by the present invention to achieve the above objectives is as follows:
[0007] A production planning optimization method based on a variable-length chromosome genetic algorithm includes the following steps:
[0008] 1) Obtain the pending order data and encode the order data based on the variable-length chromosome encoding rule to generate an initial population;
[0009] 2) Decode the chromosomes in the population to obtain the production plan, and simulate the production plan through a simulation scheduling system. Calculate the fitness of each chromosome based on the simulation results.
[0010] 3) Select chromosomes with fitness higher than the threshold as parents using the roulette wheel selection method. Generate offspring individuals through crossover and mutation operations specifically designed for variable-length chromosomes. Check whether the offspring individuals meet the preset feasibility constraints. Perform legitimacy repair on offspring individuals that do not meet the feasibility constraints and update the population.
[0011] 4) Repeat steps 2) and 3) until the preset convergence condition is met, and output the production plan corresponding to the chromosome with the highest fitness as the optimization result.
[0012] The specific coding rules for the variable-length chromosomes are as follows:
[0013] Each chromosome is sequentially encoded into three segments: [Number of stages N | Split points 1..N-1 | Production matrix M×N], representing the number of production stages, the split points of each stage, and the production output of each type of product within each stage; where:
[0014] The number of stages segment contains an integer gene, representing the total number N of stages in the production plan represented by the chromosome;
[0015] Each segment contains N-1 genes, each gene representing a stage segmentation point. All segmentation points divide the total production time interval into N production stages.
[0016] The production output segment contains M×N genes, where M is the total number of product types and represents the production quantity of each product in each stage.
[0017] The generation of the initial population includes the following steps:
[0018] (1) Randomly generate an integer within the preset range [N_min, N_max] as the number of stages N;
[0019] (2) Within the total production time range, randomly generate N-1 non-repeating and ordered time points as stage division points;
[0020] (3) Randomly allocate the production output of each product to N stages, and make the sum of the production output of each type of product in all stages equal to the total demand of that type of product in the order;
[0021] (4) Repeat steps (1) to (3) until an initial population of the predetermined size is generated.
[0022] The fitness F of each chromosome is:
[0023] F = α × U + β × D;
[0024] Where U and D are the key equipment utilization rate and order delivery rate obtained through simulation, respectively, and α and β are preset weighting coefficients, and α + β = 1.
[0025] The crossover operation specifically for variable-length chromosomes is as follows:
[0026] Select two parent chromosomes and extract their stage segmentation sequence to obtain the segmentation point sets of the two chromosomes. Randomly select a common time interval or segmentation point position from the two segmentation point sets as the crossover point, so that the crossover point is valid within the production time sequence of the two chromosomes.
[0027] Exchange all gene sequences of the two parent chromosomes after the selected crossover point, including the split point gene and the product yield gene.
[0028] The number of stages in the offspring chromosomes is updated based on the original number of stages in the exchanged gene sequences.
[0029] The specific mutation operation used for variable-length chromosomes is as follows:
[0030] Variation in the number of stages: A stage is added or deleted with a preset probability, and a corresponding division point is added or deleted, while adjusting the product input output segment; When a stage is added, a new stage division point is randomly inserted on the timeline, and the input output is allocated to the new stage; When a stage is deleted, a certain division point is deleted, and the input output of the two adjacent stages before and after the division point is merged.
[0031] Split point variation: Randomly select a stage split point and shift it within its neighborhood by a preset step size or time ratio;
[0032] Input-output variation: Randomly select one or more products in one or more stages and randomly perturb or scale their input-output gene values.
[0033] The feasibility constraints include:
[0034] The time series of each stage must be increasing, and there must be no stage overlap or reversal;
[0035] The sum of the production output of all types of products at all stages equals the total order demand.
[0036] The total production cycle must not exceed the prescribed annual or planned cycle limit.
[0037] The legality restoration includes:
[0038] Stage structure repair: When the number of stages in the offspring chromosomes is inconsistent or the stage order is incorrect, the stage segmentation sequence is reordered, deduplicated, or truncated.
[0039] Production volume correction: When the production volume of offspring chromosomes does not meet the total order volume constraint at any stage or globally, the production volume of various products at each stage is adjusted by normalized ratio adjustment or difference compensation.
[0040] Constraint boundary repair: When the stage split point goes out of bounds, the stage length is illegal, or the output of a single stage exceeds the upper limit of the equipment capacity, the relevant gene values will be adjusted to the corresponding feasible interval boundary.
[0041] The present invention has the following beneficial effects and advantages:
[0042] 1. Strong expressive power: The innovative variable-length chromosome encoding method can naturally and flexibly express production plans with variable number of stages, perfectly matching actual production needs and providing a wider solution space.
[0043] 2. Excellent optimization results: The crossover and mutation operators designed for variable-length chromosomes can effectively explore the solution space. Combined with the legality repair mechanism, it ensures that the algorithm converges quickly to a high-quality solution, significantly improving the utilization rate of key equipment and the order delivery rate.
[0044] 3. High practicality: By combining with the simulation scheduling system, the evaluation results are closer to the actual production situation, and the generated production plan has high feasibility, providing an efficient decision support tool for enterprise planning. Attached Figure Description
[0045] Figure 1 Overall flowchart of the production planning optimization method based on variable-length chromosome genetic algorithm.
[0046] Figure 2 Flowchart of the variable-length chromosome genetic algorithm.
[0047] Figure 3 A schematic diagram of the crossover operation in a variable-length chromosome genetic algorithm. Detailed Implementation
[0048] The present invention will now be described in further detail with reference to the accompanying drawings and embodiments.
[0049] A production planning optimization method based on a variable-length chromosome genetic algorithm includes the following steps:
[0050] 1) Order Data Acquisition and Population Initialization: Obtain pending order data from the system's order management module. This pending order data includes at least the product type, total product quantity, and delivery date. The chromosome encoding module reads the order data and, based on a preset variable-length chromosome encoding rule, randomly generates an initial population containing multiple chromosomes.
[0051] 2) Fitness Assessment: The chromosome decoding module decodes each chromosome in the population into a production plan data format recognizable by the simulation scheduling system. Subsequently, the simulation scheduling system is used to simulate the production plan obtained from the decoding, and the fitness value of each chromosome is calculated based on the simulation results.
[0052] 3) Genetic evolution and iteration: such as Figure 2 As shown, the genetic algorithm module selects superior individuals from the current population as parents using a roulette wheel selection method based on the calculated fitness values. Then, crossover and mutation operations, specifically for variable-length chromosomes, are performed on the selected parents to generate offspring individuals. Next, the offspring individuals undergo legitimacy repair to ensure they meet all preset feasibility constraints. The repaired offspring individuals are then used to update the population, thus completing one iteration.
[0053] 4) Repeat steps 2) to 3) until the maximum number of iterations is met, and finally output the production plan corresponding to the chromosome with the highest fitness as the optimal optimization result.
[0054] The variable-length chromosome encoding rule in step 1) is as follows: each chromosome consists of three sequentially encoded segments, namely [Number of stages N | Cut-off points 1..N-1 | Production matrix M×N]. The number of stages segment contains an integer gene representing the total number N stages of the production plan represented by the chromosome; the cut-off segment contains N-1 genes, each representing a stage cut-off point (time point), which divides the total production time interval into S consecutive and non-overlapping production stages; the production volume segment contains M×N genes (M being the total number of product types), arranged in stage order, representing the planned production quantity of each product in each stage.
[0055] The specific process of initializing the population in step 1) includes:
[0056] 1.1) Randomly generate an integer within the preset range [N_min, N_max] as the number of stages N;
[0057] 1.2) Within the total production timeframe, randomly generate N-1 non-repeating and ordered time points as stage division points;
[0058] 1.3) Allocate the production output of each product to N stages respectively, ensuring that the sum of the production output of each type of product in all stages equals the total demand of that type of product in the order;
[0059] 1.4) Repeat steps 1.1) through 1.3) until an initial population of the predetermined size is generated.
[0060] The fitness function F in step 2) is defined as: F = α × U + β × D, where U is the utilization rate of key equipment, D is the order delivery rate, and α and β are preset weight coefficients that need to satisfy α + β = 1.
[0061] The specific crossover and mutation operations for variable-length chromosomes in step 3) are as follows:
[0062] Cross operations: such as Figure 3 As shown, a common and valid time interval or cut point position is randomly selected from the set of cut points of the two parent chromosomes as the crossover point; all gene sequences (including cut points and input genes) after the crossover point are exchanged between the two parents; finally, the number of stage segments of the offspring chromosome is updated based on the information of the exchanged gene sequences.
[0063] The crossover operation specifically includes the following steps:
[0064] 1. For the two parent chromosomes, extract their stage segmentation sequence respectively, and randomly select a common time interval or segmentation position from the segmentation point set of the two parent chromosomes as the crossover point, so that the crossover point is valid within the production time series of both chromosomes.
[0065] 2. Exchange all gene sequences of the two parent chromosomes after the crossover point, including the split point gene and the product yield gene;
[0066] 3. Update the number of stage segments of the offspring chromosomes based on the original stage number information in the exchanged gene sequences.
[0067] Mutation operation: Add or delete a stage with a certain probability, and adjust the split point and input production segment accordingly;
[0068] Randomly shift the position of a certain cutting point; randomly disturb the input and output of a certain product at a certain stage.
[0069] The mutation operation specifically includes the following steps:
[0070] 1. Variation in the number of stages: Add or delete a stage with a preset probability, and add or delete a corresponding split point, while adjusting the product input output segment; when adding a stage, randomly insert a new stage split point on the time axis and allocate input output to the new stage; when deleting a stage, merge the input output of the two stages to maintain the continuity of the time series.
[0071] 2. Split point variation: Randomly select a stage split point and shift it within its neighborhood by a preset step size or time ratio;
[0072] 3. Input-output variation: Randomly select one or more products in one or more stages, and randomly perturb or scale their input-output gene values.
[0073] Step 3) of the legality repair process is used to handle offspring chromosomes that violate constraints. These constraints mainly include: the stage time sequence must be strictly incremental, total output must equal total order quantity, and the production cycle must not exceed limits. Repair methods include:
[0074] Stage structure repair: reordering and deduplicating the split points.
[0075] Production capacity adjustment: Through proportional adjustment or difference compensation, the total production capacity is made to accurately match the order demand.
[0076] Boundary constraint repair: Adjust out-of-bounds gene values to within the feasible range.
[0077] Example
[0078] This embodiment uses the optimization of an annual production plan for a chemical plant as an application scenario. The plant produces three products (product A, product B, and product C, i.e., M=3), and has received annual order requirements of 5,000 tons for product A, 3,000 tons for product B, and 2,000 tons for product C. The planning period is one year (365 days), and a production plan needs to be developed that divides the year into several stages (e.g., 3-6 stages).
[0079] Reference Figure 1 The implementation steps of this method are as follows:
[0080] 1. Data Acquisition and Parameter Settings. Retrieve annual order data (total demand for products A, B, and C) from the system's order management module. Set the genetic algorithm parameters: population size = 50, maximum number of iterations = 50, crossover probability = 0.8, mutation probability = 0.25; set the fitness function weights: order fulfillment rate weight α = 0.6, key resource utilization rate β = 0.4. Set the stage range S_min = 3, S_max = 6.
[0081] 2. Specific implementation of variable-length chromosome encoding.
[0082] Stage Quantity Range: 1 integer gene, with a value range of [3,6], indicating that the whole year is divided into 3-6 production stages.
[0083] Segmentation: Contains N-1 genes, each gene representing a specific date (Julian day representation, range 1-365), and satisfies strict increasing order. For example, when N=4, the segment has 3 genes, possibly encoded as: 90, 180, 270, indicating that the year is divided into: Phase 1 (days 1-90), Phase 2 (days 91-180), Phase 3 (days 181-270), and Phase 4 (days 271-365).
[0084] Production increment segment: Contains N×3 genes, arranged in stage order. The three genes in each stage represent the production quantities of products A, B, and C, respectively. Chromosomes are obtained:
[0085] [4] | [90, 180, 270]| [1200,800,500, 1300,700,400, 1300,800,300,1200,700,300]
[0086] 3. The specific steps for generating the initial population are as follows:
[0087] S1.1 Randomly generate the number of stages N: Randomly generate integers N∈[3,6] using a uniform distribution. For example, the first chromosome is randomly generated with N=4.
[0088] S1.2 Generation Stage Splitting Points: Within the time range [1,365], randomly generate 3 (N-1=3) non-repeating integers, and sort them to obtain the splitting point sequence. For example: generate random numbers [45, 289, 156], and after sorting, obtain [45, 156,289].
[0089] S1.3 Allocating Product Production Capacity: A random allocation method is used: production capacity is randomly allocated for each stage, but adjustments are made to ensure the total equals the order quantity. Taking product A as an example, ensure that:
[0090] 1200+1300+1300+1200=5000 tons.
[0091] S1.4 Repeated generation: Repeat S1.1-S1.3 a total of 50 times to generate an initial population containing 50 chromosomes.
[0092] 4. Chromosome fitness assessment process:
[0093] Decoding process: The chromosome is decoded into the input format of the simulation system. Taking the example chromosome above as an example:
[0094] Phase 1: Timeframe 1-90 days, Production [A: 1200 tons, B: 800 tons, C: 500 tons]
[0095] Phase 2: Duration 91-180 days, Production [A: 1300 tons, B: 700 tons, C: 400 tons]
[0096] Phase 3: Time 181-270 days, Production [A: 1300 tons, B: 900 tons, C: 300 tons]
[0097] Phase 4: Time period 271-365 days, production [A: 1200 tons, B: 600 tons, C: 800 tons]
[0098] Simulation Operation: Input the decoded production plan into the simulation system. The system simulates the entire year's production operation and outputs key performance indicators:
[0099] Key equipment utilization rate: U = Actual equipment used / Total number of equipment
[0100] Order delivery rate: D = On-time delivery volume / Total number of orders
[0101] Fitness calculation: F = 0.6 × D + 0.4 × U
[0102] 5. The genetic algorithm module performs selection, crossover, and mutation operations on the parent generation based on the calculated fitness value to generate offspring individuals.
[0103] 5.1 Selection Operation: A roulette wheel selection method is used to select two parent chromosomes with higher fitness from the population: Parent 1: Chromosome [3|120,240|1500,900,600,1800,1200,800, 1700,900,600] Parent 2: [4|90,180,270|1200,800,500,1300,700,400,1300,800,300,1200,700,300]
[0104] 5.2 Crossover operation. Randomly select a common valid time interval from the two parent generation split point sets {120,240} and {90,180,270}. Select the second split point as the crossover point (240 for parent generation 1, 180 for parent generation 2). All genes after the crossover point are swapped: Parent 1 swaps out: [] + [1700,900,600], Parent 2 swaps out:
[270] + [1300,800,300, 1200,700,300], resulting in offspring: Offspring 1: [3 |120,240,270|1500,900,600,1800,1200,800, 1300,800,300, 1200,700,300], Offspring 2: [4|90,180|1200,800,500,1300,700,400,1700,900,600].
[0105] 5.3 Mutation Operations. Stage Number Mutation: Adding a Stage: Randomly select a chromosome N=3, randomly insert a new split point (e.g., 150) on the time axis, divide the original one stage into two, and redistribute the output.
[0106] Deletion Phase: Randomly select N=4 chromosomes, delete a cutoff point (e.g., 180), and merge the yields of two adjacent phases. Cutoff Point Variation: Randomly select a cutoff point and randomly shift it within its neighborhood by ±(5-15) days. Input Yield Variation: Randomly select the input yield of a product and randomly perturb it within ±10% of its current value.
[0107] 6. Perform legitimacy repair on offspring individuals to ensure they meet all pre-defined feasibility constraints.
[0108] 6.1 Constraint Detection. The following constraints are checked for each newly generated offspring chromosome: Time series constraint: the split point must be strictly increasing; Input quantity constraint: ∑ Input quantity at each stage = total order quantity; Time boundary constraint: all split points ∈ [1, 365].
[0109] 6.2 Legality Repair. The repair scope includes: Stage Structure Repair: When the split point sequence appears as [180, 150, 270], it is reordered to [150, 180, 270], and the order of the production output segments is adjusted accordingly. Production Output Repair: When the total output of product A is 5200 tons (exceeding the order of 5000 tons): Difference Compensation Method: Randomly select a stage and reduce its output by 200 tons. Constraint Boundary Repair: When the split point is 400 (exceeding 365), it is forcibly set to 365; when the output of a certain stage exceeds the daily capacity of the equipment × the number of days in the stage, it is truncated according to the upper limit of the capacity.
[0110] 7. Population Renewal. Replace poorly fit individuals in the current population with repaired, legitimate offspring chromosomes to form a new generation. Repeat fitness assessment, selection, crossover mutation, and repair operations.
[0111] 8. Output the optimal production plan. After reaching the maximum number of iterations, decode the chromosome with the highest fitness to obtain the optimal annual production plan, including the phase division, the time range of each phase, and the detailed production quantity of each product in each phase.
[0112] The above description is merely a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for optimizing a production plan based on a variable-length chromosome genetic algorithm, characterized in that, The method comprises the following steps: 1) obtaining order data to be arranged, and encoding the order data based on a variable-length chromosome coding rule to generate an initial population; 2) decoding the chromosomes in the population to obtain production plans, and simulating the production plans through a simulation scheduling system, and calculating the fitness of each chromosome according to the simulation results; 3) selecting chromosomes with fitness higher than a threshold as parents through a roulette selection method, generating offspring individuals through a crossover operation and a mutation operation dedicated to the variable-length chromosomes, and detecting whether the offspring individuals meet preset feasibility constraint conditions, repairing the offspring individuals that do not meet the feasibility constraint conditions for legality, and updating the population; 4) repeating steps 2) and 3) until a preset convergence condition is met, and outputting a production plan corresponding to a chromosome with the highest fitness as an optimization result.
2. The method according to claim 1, wherein, The variable-length chromosome coding rule is specifically: Each chromosome is sequentially coded into three sections, namely [number of stages N | split points 1..N-1 | yield matrix MxN], which respectively represent the number of production stages, the split points of each stage, and the production quantity of each product in each stage; wherein: The stage number section contains an integer gene representing the total number of stages N of the production plan represented by the chromosome; The split section contains N-1 genes, each representing a stage split point, and all split points divide the total production time interval into N production stages; The production quantity section contains MxN genes, M is the total number of product types, representing the production quantity of each product in each stage.
3. The method according to claim 1, wherein, The initial population is generated by the following steps: (1) randomly generate an integer within a preset range [N_min, N_max] as the number of stages N; (2) randomly generate N-1 non-repeating and ordered time points within the total production time range as stage split points; (3) randomly allocate production quantities of each product to N stages, and make the sum of production quantities of each product in all stages equal to the total demand of the product in the order; (4) repeat steps (1) to (3) until a predetermined size of the initial population is generated.
4. The method according to claim 1, wherein, The fitness F of each chromosome is: F = α × U + β × D; Wherein, U and D are the key equipment utilization rate and order delivery rate obtained through simulation respectively, and α and β are preset weight coefficients, and α + β = 1.
5. The method of claim 1, wherein the method is characterized by: The crossover operation dedicated to the variable-length chromosome is specifically: Select two parent chromosomes, extract their stage split point sequences to obtain two split point sets, and randomly select a common time interval or split point position as a crossover point from the two split point sets, so that the crossover point is valid in the production time range of both chromosomes; Exchange all gene sequences including split point genes and product production quantity genes of the two parent chromosomes after the selected crossover point; According to the original stage number information in the exchanged gene sequence, update the stage number section of the offspring chromosome.
6. The method according to claim 1, wherein, The mutation operation dedicated to the variable-length chromosome is specifically: Stage number mutation: add or delete a stage with a preset probability, and increase or decrease a split point accordingly, while adjusting the product production capacity segment; when adding a stage, randomly insert a new stage split point on the time axis, and assign a production capacity to the new stage; when deleting a stage, delete a split point, and combine the production capacities of the two adjacent stages before and after the split point; Split point mutation: randomly select a stage split point, and offset it within its neighborhood range by a preset step or time ratio; Production capacity mutation: randomly select one or more products in one or more stages, and randomly perturb or scale the production capacity gene value of the selected products.
7. The method of claim 1, wherein the method is characterized by: The feasibility constraints include: The time sequence of each stage must be increasing, and there must be no stage overlap or reverse order; The sum of the production capacities of all products in all stages equals the total order demand; The total production cycle must not exceed the upper limit of the specified annual or planning cycle.
8. The method of claim 1, wherein the method is characterized by: The legality repair includes: Stage structure repair: when the number of stages of the offspring chromosome is inconsistent or the stage order is incorrect, reorder, remove duplicates, or truncate the boundaries of the stage split point sequence; Production capacity repair: when the production capacity of the offspring chromosome in any stage or in the global range does not meet the total order quantity constraint, adjust the production capacity of each product in each stage using normalized scaling or difference compensation; Constraint boundary repair: when the stage split point is out of bounds, the stage length is illegal, or the single-stage production capacity exceeds the upper limit of the device capacity, adjust the relevant gene values to the corresponding feasible interval boundary.