An adaptive bidirectional decoding method for mixed flow shop scheduling problem

By using an adaptive bidirectional decoding method, the decoding direction in the hybrid flow shop scheduling problem is dynamically adjusted. By utilizing elite solution feedback and time-varying learning factors, the problem of limited search space caused by fixed or random selection of decoding direction in existing technologies is solved, and a more efficient scheduling scheme search is achieved.

CN122491626APending Publication Date: 2026-07-31CHINA ELECTRONICS STANDARDIZATION INST
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610546897.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-04-23
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

Existing genetic algorithms, when used in mixed flow shop scheduling problems, either fix the decoding direction or randomly select the decoding direction, resulting in a limited search space, a tendency to get trapped in local optima, and a lack of adaptive adjustment mechanisms, which affects search efficiency.

Method used

An adaptive bidirectional decoding method is adopted. By obtaining the number of elite solutions and the number of times the historical decoding direction has been selected, and combining the learning factor that decays with the running time, the sampling probability of the decoding direction is dynamically updated, and a reasonable decoding direction is selected for decoding.

Benefits of technology

It improves the adaptability and search efficiency of decoding direction selection, expands the solution space, avoids local optima, and enhances the quality and evaluation efficiency of scheduling schemes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122491626A_ABST
    Figure CN122491626A_ABST
Patent Text Reader

Abstract

This invention discloses an adaptive bidirectional decoding method for the hybrid flow shop scheduling problem. The method includes the following steps: obtaining an encoding vector that represents only the processing sequence of workpieces in the first stage; configuring a set of decoding directions including forward and reverse decoding, and initializing the same sampling probability for each decoding direction; in the current iteration, obtaining the number of elite solutions and the historical selection count of each decoding direction, and updating the sampling probability of each decoding direction with a learning factor that decays over time; selecting a decoding direction based on the updated sampling probability to decode the encoding vector and obtain a scheduling scheme; calculating the maximum completion time of the scheduling scheme and updating the elite solutions. This invention improves the decoding adaptability and search efficiency by dynamically adjusting the decoding direction selection probability through elite solution feedback and a time-varying learning factor, and solves the problem that fixed decoding directions or random selection can easily lead to a limited search space and getting trapped in local optima.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intelligent manufacturing and production scheduling optimization technology, and in particular to an adaptive bidirectional decoding method for scheduling problems in hybrid flow workshops. Background Technology

[0002] The Hybrid Flow Shop Scheduling Problem (HFSP) is a typical combinatorial optimization problem widely found in process industries such as steel smelting, semiconductor manufacturing, and chemical production. HFSPs typically involve multiple processing stages, each with several parallel machines. Workpieces are processed sequentially through each stage following the same process route, and multiple parallel machines within the same stage can process different workpieces in parallel. Compared to the classic flow shop scheduling problem, HFSP increases the freedom of machine selection, significantly increasing the problem's complexity and difficulty, classifying it as an NP-hard problem.

[0003] Currently, common methods for solving High-Speed ​​Scheduling Problems (HFSP) include exact algorithms, heuristic rules, and metaheuristic algorithms. Among them, metaheuristic algorithms have received widespread attention due to their ability to obtain near-optimal solutions within a reasonable timeframe, with genetic algorithms being one of the most representative methods. When using genetic algorithms to solve HFSP, the problem must first be encoded, mapping the scheduling scheme into an algorithm-operable encoding vector. Existing research shows that single-layer encoding based on the first-stage job sequence is the most efficient encoding method for HFSP. This encoding vector only provides the processing order of the first-stage jobs; the processing order and machine allocation information for the remaining stages need to be supplemented by heuristic rules during the decoding process. Therefore, the decoding stage directly determines whether the encoding vector can be effectively transformed into a high-quality scheduling scheme.

[0004] In terms of decoding methods, existing technologies are mainly divided into two categories: forward decoding and reverse decoding. Forward decoding arranges the processing machines and start times of each process sequentially from front to back according to the natural process route of the workpiece; reverse decoding first reverses the process route, then performs forward decoding, and finally reverses it again to obtain the scheduling scheme. Studies have shown that forward decoding and reverse decoding may produce different maximum completion times for the same encoded vector, and reverse decoding can often obtain solution spaces that forward decoding cannot search. However, when solving HFSP, existing genetic algorithms usually use a single decoding direction (mostly forward decoding) or randomly select the decoding direction with equal probability, failing to fully utilize the complementary advantages of the two decoding directions. Since there is not a one-to-one correspondence between the encoded vector and the feasible solution, the fixed-direction decoding method is prone to causing the algorithm to get trapped in local optima, limiting the full exploration of the search space.

[0005] Furthermore, existing intelligent optimization algorithms for HFSP primarily rely on single-population evolution, resulting in slow convergence and a tendency for premature convergence. During decoding, the processing order of non-first-stage steps is typically determined by a first-come, first-served rule, while machine selection follows the rule of the earliest available machine. These rules struggle to guarantee solution quality in scenarios with unrelated parallel machines. More importantly, existing technologies lack an adaptive adjustment mechanism for the decoding direction selection strategy, failing to dynamically adjust the probability of using forward and reverse decoding based on historical decoding results. This leads to an unreasonable allocation of computational resources across different decoding directions, impacting the overall search efficiency of the algorithm.

[0006] Therefore, how to design a method that can adaptively select the decoding direction, dynamically adjust the decoding probability, and make full use of elite solution information to guide the decoding direction decision has become a technical problem that urgently needs to be solved in the field of hybrid flow shop scheduling. Summary of the Invention

[0007] The purpose of this invention is to provide an adaptive bidirectional decoding method for the mixed flow shop scheduling problem. By dynamically updating the sampling probability of each decoding direction based on the number of elite solutions and the number of times the historical decoding direction has been selected, combined with a learning factor that decays over time, the method improves the adaptability and search efficiency of decoding direction selection. This solves the technical problem of limited search space and easy getting trapped in local optima caused by fixed or random decoding direction selection in the prior art.

[0008] To address the aforementioned technical problems, a first aspect of this invention provides an adaptive bidirectional decoding method for a hybrid flow shop scheduling problem, comprising the following steps: Obtain the encoding vector for the hybrid flow shop scheduling problem, wherein the encoding vector is used only to represent the processing sequence of the workpieces in the first stage; Configure a set of decoding directions for the encoded vector, the set of decoding directions including forward decoding and backward decoding, and initialize a sampling probability for each decoding direction, the sampling probabilities of all decoding directions are set to the same value during initialization; In the current iteration, the number of stored elite solutions and the number of times each decoding direction was selected in the historical iterations are obtained. Combined with the learning factor that decays with running time, the sampling probability of each decoding direction is updated respectively. The elite solution is the encoding vector and its decoding direction information corresponding to the optimal scheduling scheme obtained in the historical decoding. The learning factor is used to control the update magnitude of the sampling probability. Based on the updated sampling probability, a decoding direction is selected from the set of decoding directions as the current decoding direction, and the encoded vector is decoded according to the current decoding direction to obtain the corresponding scheduling scheme. Calculate the maximum completion time of the scheduling scheme, and update the elite solution based on the maximum completion time. The elite solution is used to update the sampling probability in subsequent iterations.

[0009] Further, the step of obtaining the number of stored elite solutions and the number of times each decoding direction has been selected in historical iterations, combined with a learning factor that decays over time, and updating the sampling probability of each decoding direction, includes: For each decoding direction, the elite contribution ratio of the decoding direction is calculated based on the number of elite solutions and the number of times the decoding direction has been selected in historical iterations. The sampling probability update difference for the decoding direction is obtained by subtracting the sampling probability of the decoding direction before the current iteration from the elite contribution ratio. Based on the learning efficiency adjustment factor, the current running time, and the maximum running time, calculate the learning factor that decays with running time; By combining the sampling probability of the decoding direction before the current iteration, the difference between the learning factor and the updated sampling probability, the updated sampling probability of the decoding direction in the current iteration is obtained.

[0010] Furthermore, the formula for calculating the sampling probability is: ; in, Let be the sampling probability of the decoding direction in the current iteration. Let be the sampling probability of the decoding direction described in the previous iteration. The learning factor, This represents the number of times the current decoding direction has been selected. Let be the number of elite solutions.

[0011] Furthermore, the formula for calculating the learning factor is as follows: ; in, Current CPU runtime Maximum CPU runtime As a factor regulating learning efficiency; The smaller the value, the closer the sampling probabilities of two adjacent iterations will be.

[0012] Further, calculating the maximum completion time of the scheduling scheme includes: The corresponding disjunction graph model is constructed according to the scheduling scheme. The disjunction graph model includes workpiece arcs and machine arcs, wherein workpiece arcs connect adjacent processes of the same workpiece, and machine arcs connect adjacent processes on the same machine. Identify all critical processes from the disjunctive graph model, where each critical process is located on the longest path from the start node to the end node; For each critical process affected by the current decoding direction, calculate the head length and tail length of each affected process. The head length is the longest path length from the start node to the process, and the tail length is the longest path length from the process to the end node. The maximum value among all affected processes is the sum of the head length, the processing time of the process, and the tail length. The maximum completion time of the scheduling scheme is then taken as the sum of these three values.

[0013] Furthermore, the calculation of the head length for each affected process includes: Obtain the machine preceding process and the workpiece preceding process of the affected process, wherein the machine preceding process is the process immediately preceding the process on the same machine, and the workpiece preceding process is the process immediately preceding the process in the same workpiece. The head length of the preceding process of the machine and the head length of the preceding process of the workpiece are obtained respectively. The head length of the affected process is obtained by taking the maximum value between the head length of the machine's immediate preceding process and the head length of the workpiece's immediate preceding process, and adding the processing time of the affected process.

[0014] Further, the calculation of the tail length of each affected process includes: Obtain the machine successor process and the workpiece successor process of the affected process, wherein the machine successor process is the process immediately following the process on the same machine, and the workpiece successor process is the process immediately following the process in the same workpiece. The tail length of the machine's immediate successor process and the tail length of the workpiece's immediate successor process are obtained respectively. The tail length of the affected process is obtained by taking the maximum value between the tail length of the machine's immediate successor process and the tail length of the workpiece's immediate successor process, and adding the processing time of the affected process.

[0015] Further, updating the elite solution based on the maximum completion time includes: The scheduling scheme obtained in the current iteration and its corresponding encoding vector are merged with the stored elite solutions to form a temporary elite set; Perform a deduplication operation on the temporary elite set to remove duplicate encoding vectors; The deduplicated temporary elite set is sorted in ascending order according to the maximum completion time of each scheduling scheme from smallest to largest. Select the top N scheduling schemes from the temporary elite set after ascending order as the updated elite solutions; Where N is the preset upper limit of the elite solution capacity.

[0016] Further, decoding the encoded vector according to the current decoding direction includes: When the current decoding direction is forward decoding, the processing sequence of non-first-stage workpieces is determined directly according to the first-come-first-served rule, and the processing machine is selected for each process according to the earliest completion time rule to obtain the scheduling scheme. When the current decoding direction is reverse decoding, the workpiece processing order corresponding to the encoding vector is reversed to obtain the reverse scheduling problem. Then, the forward decoding is performed on the reverse scheduling problem to obtain the reverse scheduling scheme. Finally, the workpiece processing order corresponding to the encoding vector is reversed again to obtain the scheduling scheme.

[0017] Furthermore, the step of selecting a processing machine for each process according to the earliest completion time rule includes: For the current process to be processed, calculate the estimated completion time of the process on each available machine; Select the machine with the shortest estimated completion time as the processing machine for the aforementioned process; If multiple machines have the same minimum estimated completion time, select the machine with the shortest processing time. If multiple machines have the same minimum estimated completion time and the same processing time, then one of the multiple machines is randomly selected as the processing machine for the process.

[0018] Accordingly, a second aspect of the present invention provides an electronic device, including: at least one processor; and a memory connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to cause the at least one processor to perform the above-described adaptive bidirectional decoding method for hybrid flow shop scheduling problems.

[0019] Accordingly, a third aspect of the present invention provides a computer-readable storage medium having computer instructions stored thereon, which, when executed by a processor, implement the above-described adaptive bidirectional decoding method for the mixed flow shop scheduling problem.

[0020] The above-described technical solutions of the embodiments of the present invention have the following beneficial technical effects: 1. By introducing an adaptive bidirectional decoding direction selection mechanism based on elite solution feedback and time-varying learning factors, the sampling probability of each decoding direction is dynamically updated according to the number of elite solutions, the historical number of times each decoding direction has been selected, and the learning factor that decays with running time. This enables the algorithm to intelligently favor better decoding directions based on historical decoding results, maintain high exploration diversity in early iterations to discover potential high-quality decoding directions, and gradually converge to an efficient decoding strategy in later iterations. This significantly improves the adaptive capability and search efficiency of decoding direction selection, effectively solving the technical problems of limited search space and easy getting trapped in local optima caused by the fixed use of a single decoding direction or random selection of decoding directions with equal probability in existing technologies. 2. By constructing a disjunctive graph model and calculating the head and tail lengths only for critical processes affected by the decoding direction, the maximum completion time of the scheduling scheme can be quickly obtained based on the maximum values ​​of the head length, processing time, and tail length. This evaluation method avoids the complete traversal of all processes in traditional decoding methods, reducing the time complexity from the order of magnitude related to the product of the number of workpieces and the number of machines to the order of magnitude related to the number of workpieces. At the same time, it ensures the accuracy of the evaluation results, thereby significantly improving the evaluation efficiency of the scheduling scheme and providing technical support for the rapid iteration of adaptive decoding methods under limited computing resources. 3. By clearly distinguishing the specific execution processes of forward decoding and reverse decoding, forward decoding uses a first-come, first-served rule to determine the processing order and selects machines based on a combination of the earliest completion time and the shortest processing time. Reverse decoding is achieved through a three-step operation of reversing the process route, executing forward decoding, and reversing the process route again. This allows the same encoded vector to map two scheduling schemes with different characteristics, fully exploring the solution space implied by the non-one-to-one correspondence between the encoded vector and feasible solutions, further expanding the search breadth of the algorithm, and thus enhancing its ability to find the global optimal solution in the hybrid flow shop scheduling problem. Attached Figure Description

[0021] Figure 1 This is a flowchart of an adaptive bidirectional decoding method for a mixed flow shop scheduling problem provided in an embodiment of the present invention; Figure 2 This is a Gantt chart for forward decoding of the encoded vector provided in the embodiments of the present invention; Figure 3 This is a Gantt chart for reverse decoding of the encoded vector provided in this embodiment of the invention. Detailed Implementation

[0022] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to specific embodiments and the accompanying drawings. It should be understood that these descriptions are merely exemplary and not intended to limit the scope of the invention. Furthermore, descriptions of well-known structures and techniques are omitted in the following description to avoid unnecessarily obscuring the concept of the invention.

[0023] Please refer to Figure 1 The first aspect of this invention provides an adaptive bidirectional decoding method for a hybrid flow shop scheduling problem, comprising the following steps: Step S100: Obtain the encoding vector for the mixed flow shop scheduling problem. The encoding vector is only used to represent the processing sequence of the workpieces in the first stage.

[0024] The hybrid flow shop scheduling problem involves multiple processing stages, each with several independent parallel machines. All workpieces pass through each stage sequentially according to the same process route. Due to the complexity of the problem, when using metaheuristic methods such as genetic algorithms to solve it, the scheduling scheme needs to be transformed into an algorithmically operable encoding form. The encoding vector used in this step only represents the processing order of workpieces in the first stage. For example, in an instance with seven workpieces, the encoding vector {1,3,2,6,7,4,5} represents that workpieces J1, J3, J2, J6, J7, J4, and J5 are processed sequentially in the first stage. This single-layer encoding method does not directly express the processing order and machine allocation of subsequent stages, thereby reducing the encoding length and the dimensionality of the search space, while retaining the flexibility to supplement missing information through decoding rules. In practical applications, this encoding vector can be used as the chromosome representation of an individual in a genetic algorithm, generated randomly or constructed heuristically during the population initialization stage.

[0025] Step S200: Configure a set of decoding directions for the encoding vector. The set of decoding directions includes forward decoding and backward decoding. Initialize a sampling probability for each decoding direction. The sampling probabilities of all decoding directions are set to the same value during initialization.

[0026] Step S200 configures a set of decoding directions for the aforementioned encoded vector. This set contains two elements: forward decoding and reverse decoding, and initializes a sampling probability for each decoding direction. Forward decoding refers to arranging the processing machines and start times of each process sequentially from front to back according to the natural process route of the workpiece; reverse decoding refers to first reversing the entire process route, then performing forward decoding, and finally reversing again to obtain the scheduling scheme. Since forward decoding and reverse decoding may produce different maximum completion times for the same encoded vector, and reverse decoding can often explore the solution space that forward decoding cannot reach, retaining both decoding directions simultaneously helps improve the comprehensiveness of the search. During the initialization phase, the sampling probabilities of the two decoding directions are set to the same value, for example, 50% each, indicating that in the absence of any historical information, the probability of selecting either decoding direction is equal. This initial setting ensures fair exploration of the solution space during the algorithm's startup phase.

[0027] Step S300: In the current iteration, obtain the number of stored elite solutions and the number of times each decoding direction has been selected in the historical iterations. Combined with the learning factor that decays with running time, update the sampling probability of each decoding direction respectively. The elite solution is the encoding vector and its decoding direction information corresponding to the optimal scheduling scheme obtained in the historical decoding. The learning factor is used to control the update magnitude of the sampling probability.

[0028] Step S300 is the core of the adaptive decoding direction selection. In each iteration of the algorithm, the number of stored elite solutions and the number of times each decoding direction has been selected in historical iterations are first obtained. Elite solutions refer to the encoding vector and decoding direction information corresponding to the optimal scheduling scheme obtained so far, representing the highest quality solutions in the current search process. For each decoding direction, the number of times it has been selected reflects its historical usage frequency. A learning factor that decays over time is used to update the sampling probability of each decoding direction. The learning factor controls the magnitude of the sampling probability update: in the early stages of the algorithm, the learning factor is larger, making the adjustment of the sampling probability more aggressive, which is beneficial for quickly exploring the effects of different decoding directions; as the running time increases, the learning factor gradually decays to near zero, making the adjustment of the sampling probability more gradual, thus stabilizing it around the decoding directions that have historically performed well. Specifically, when a decoding direction has been selected more times in history and the number of elite solutions is large, the sampling probability of that decoding direction will increase accordingly, and vice versa. This adaptive mechanism makes the selection of decoding directions no longer fixed or random, but dynamically optimized based on historical feedback.

[0029] Step S400: Based on the updated sampling probability, select a decoding direction from the set of decoding directions as the current decoding direction, and decode the encoding vector according to the current decoding direction to obtain the corresponding scheduling scheme.

[0030] Based on the updated sampling probability calculated in step S300, a decoding direction is selected from the set of decoding directions as the current decoding direction. The encoded vector is then decoded according to the selected decoding direction to obtain the corresponding scheduling scheme. For example, if the sampling probability of forward decoding is 70% and that of reverse decoding is 30%, the system selects forward decoding with a 70% probability and reverse decoding with a 30% probability. After selection, the decoding operation is executed according to the rules of the selected decoding direction: if it is forward decoding, the processing order of non-first-stage workpieces is determined according to the first-come, first-served rule, and the processing machine is selected for each process according to the earliest completion time rule; if it is reverse decoding, the process route is reversed first, then forward decoding is executed, and then reversed again. After decoding, the first-stage processing order implicit in the encoded vector is expanded into a complete scheduling scheme, which includes the processing machine and start and end time of each workpiece in each stage. This scheduling scheme can be directly used for subsequent fitness evaluation.

[0031] Step S500: Calculate the maximum completion time of the scheduling scheme and update the elite solution based on the maximum completion time. The elite solution is used to update the sampling probability in subsequent iterations.

[0032] Maximum completion time (MCT) refers to the total time taken from the start of processing the first workpiece to the completion of processing the last workpiece. It is the most commonly used optimization objective in the hybrid flow shop scheduling problem. Calculating MCT requires simulating the entire production process's timing based on the processing machines and sequential constraints of each operation. After calculation, this step updates the elite solutions based on the MCT. Specifically, the MCT of the current scheduling scheme is compared with existing elite solutions. If the current scheme is better than the worst solution among the elite solutions, it is added to the elite solution set, and the worst-quality solution is discarded, maintaining a constant number of elite solutions. The updated elite solutions will be used in step S300 of the next iteration, forming a closed-loop feedback: the quality of the elite solutions affects the sampling probability of the decoding direction, the sampling probability determines the choice of decoding direction, the decoding direction affects the quality of the new scheduling scheme, and the quality of the new scheme, in turn, affects the updating of elite solutions. Through this iterative mechanism, the algorithm can gradually converge to high-quality solutions.

[0033] This invention introduces an adaptive bidirectional decoding direction selection mechanism based on elite solution feedback and time-varying learning factors. This mechanism ensures that the decoding direction selection is no longer fixed or random, but dynamically adjusted according to historical decoding results. In the early stages of the algorithm's operation, it maintains sufficient exploration of both forward and reverse decoding, and gradually converges to the decoding direction with better historical performance in the later stages of operation. This improves search efficiency and solution quality, and solves the problem of limited search space and easy getting trapped in local optima caused by fixed decoding directions or equal probability random selection in existing technologies.

[0034] Specifically, in step S300, the number of stored elite solutions and the number of times each decoding direction has been selected in historical iterations are obtained. Combined with a learning factor that decays over time, the sampling probability of each decoding direction is updated, including: Step S310: For each decoding direction, calculate the elite contribution ratio of the decoding direction based on the number of elite solutions and the number of times the decoding direction has been selected in the historical iterations.

[0035] The number of elite solutions represents the total number of scheduling schemes with optimal maximum completion time that the algorithm has selected and retained before the current iteration. These elite solutions represent the set of high-quality solutions obtained during the search process. The number of times each decoding direction has been selected in historical iterations reflects the frequency with which that direction has been actually used in past decoding operations. The elite contribution ratio is calculated by dividing the number of elite solutions by the number of times that decoding direction has been selected. For example, if the current number of elite solutions is 10 and a certain decoding direction has been selected 20 times in the past, then the elite contribution ratio of that decoding direction is 0.5. If a decoding direction has been selected 0 times, then to avoid division by zero errors, the elite contribution ratio can be directly set to 0. This ratio is used to measure the contribution of elite solutions to the decoding direction per unit of usage: a higher ratio means that although the decoding direction is used relatively less, it contributes more elite solutions, indicating that the direction has high search efficiency; conversely, if the ratio is low, it means that although the decoding direction is used frequently, the number of elite solutions generated is limited, and the search efficiency is relatively low.

[0036] Step S320: Based on the difference between the elite contribution ratio and the sampling probability of the decoding direction before the current iteration, the sampling probability update difference of the decoding direction is obtained.

[0037] The sampling probability prior to the current iteration refers to the sampling probability value held by this decoding direction at the end of the previous iteration. This value reflects the degree of preference for this decoding direction in historical iterations. Subtracting the elite contribution ratio from the historical sampling probability yields a positive or negative difference. If the elite contribution ratio is greater than the historical sampling probability, the difference is positive, indicating that the actual contribution of this decoding direction exceeds the currently assigned selection probability, and its sampling probability needs to be increased in the next iteration. If the elite contribution ratio is less than the historical sampling probability, the difference is negative, indicating that this decoding direction is overused and its contribution is insufficient, and its sampling probability needs to be reduced. This difference directly quantifies the deviation between the current sampling probability and the ideal contribution level, providing a clear direction for subsequent probability adjustments.

[0038] Step S330: Calculate the learning factor that decays with running time based on the learning efficiency adjustment factor, the current running time, and the maximum running time.

[0039] The learning efficiency control factor is a preset constant, between 0 and 1, used to control the rate at which the learning factor decays with runtime. The current runtime refers to the CPU time consumed by the algorithm from startup to the current moment, while the maximum runtime is the preset allowed total runtime. The calculation process for the learning factor is as follows: First, calculate the ratio of the current runtime to the maximum runtime; this ratio reflects the proportion of time the algorithm has already run. Then, multiply the learning efficiency control factor by this proportion to obtain a decay amount. Finally, subtract this decay amount from the value 1 to obtain the learning factor for the current iteration. At algorithm startup, the current runtime is 0, and the learning factor equals 1. As runtime increases, the proportion of time gradually increases, and the learning factor gradually decreases from 1 and approaches 0. The size of the learning factor determines the sampling probability update magnitude: the larger the learning factor, the greater the adjustment magnitude of the sampling probability in step S340, allowing the algorithm to quickly respond to differences in the contribution of the decoding direction in the early stages; the smaller the learning factor, the smoother the adjustment magnitude, allowing the algorithm to converge stably in the later stages.

[0040] Step S340: Combine the sampling probability of the decoding direction before the current iteration, the learning factor, and the difference between the updated sampling probability to obtain the updated sampling probability of the decoding direction in the current iteration.

[0041] Specifically, the sampling probability before the current iteration is used as the base value, and the product of the learning factor and the difference between the updated sampling probability and the base value is used as the adjustment. The sum of these two values ​​gives the updated sampling probability. Mathematically, this can be expressed as: the updated sampling probability equals the original sampling probability plus the learning factor multiplied by the difference between the updated sampling probability and the base value. When the difference between the updated sampling probability and the base value is positive, the adjustment is positive, and the updated sampling probability increases; when the difference between the updated sampling probability and the base value is negative, the adjustment is negative, and the updated sampling probability decreases.

[0042] The learning factor plays a crucial role in adjusting the step size: in the early stages of the algorithm, a larger learning factor allows for significant probability changes even with small update differences, enabling the algorithm to quickly explore the potential of different decoding directions; in the later stages, the learning factor approaches zero, resulting in minimal probability changes even with larger update differences, thus avoiding oscillations caused by over-adjustment. The updated sampling probability is then used for decoding direction selection in the next iteration, achieving adaptive probability adjustment based on historical contribution feedback.

[0043] Furthermore, the formula for calculating the sampling probability is: .

[0044] in, Let be the sampling probability of the decoding direction in the current iteration. The sampling probability of the decoding direction in the previous iteration. As a learning factor, This represents the number of times the current decoding direction has been selected. Solve for the number of elites.

[0045] The core idea of ​​this formula is to use the ratio of the number of elite solutions to the historical number of times a decoding direction has been selected as the target, combined with the deviation of the current sampling probability, and then smoothly adjust it through a learning factor. Specifically, the formula first calculates the quotient of the number of elite solutions divided by the number of times the current decoding direction has been selected. This quotient reflects the ability of the decoding direction to contribute elite solutions per unit of usage. Then, it calculates the difference between this quotient and the current sampling probability. This difference represents the degree of deviation between the current selection preference and the actual contribution efficiency. Finally, the learning factor is multiplied by this difference and added to the current sampling probability to obtain the updated sampling probability. This design allows the sampling probability of the decoding direction to evolve gradually along the direction of reducing deviation, rather than abruptly changing, ensuring the stability and convergence of the probability update.

[0046] The above formula introduces elite solutions as feedback signals, making the selection of decoding directions less arbitrary. Unlike fixed-probability or random selection, this formula dynamically adjusts the probability of selection based on the actual contribution efficiency of each decoding direction. When a decoding direction has been selected less frequently in history but has contributed more elite solutions, its elite contribution ratio is higher, resulting in a positive update difference and increasing the sampling probability of that decoding direction. Conversely, if a decoding direction is frequently used but rarely produces elite solutions, its sampling probability will decrease. This adaptive mechanism based on historical performance effectively improves the utilization efficiency of computing resources, enabling the algorithm to automatically identify and favor better decoding directions.

[0047] Furthermore, the formula for calculating the learning factor is: .

[0048] in, Current CPU runtime Maximum CPU runtime As a factor regulating learning efficiency; The smaller the value, the closer the sampling probabilities of two adjacent iterations will be.

[0049] The learning factor decays over time, further optimizing the algorithm's search behavior. In the early stages of the algorithm, the learning factor is relatively large, allowing the sampling probability to quickly respond to performance changes in the decoding direction, which is beneficial for fully exploring the potential of both decoding directions. As the running time increases, the learning factor gradually approaches zero, and the adjustment range of the sampling probability decreases accordingly. The algorithm smoothly transitions from the exploration phase to the utilization phase, consistently selecting the decoding direction with better historical performance. This time-varying characteristic avoids drastic oscillations in probability values, improving the algorithm's robustness and convergence accuracy. This effectively solves the problems of low search efficiency and susceptibility to local optima caused by fixed decoding directions or equally probable random selection in existing technologies.

[0050] Specifically, the calculation of the maximum completion time of the scheduling scheme in step S500 includes: Step S510: Construct the corresponding disjunction graph model according to the scheduling scheme. The disjunction graph model includes workpiece arcs and machine arcs, where workpiece arcs connect adjacent processes of the same workpiece, and machine arcs connect adjacent processes on the same machine.

[0051] A disjunctive graph is a directed graph structure used to describe the sequential constraints between operations in a job shop scheduling problem. It contains two types of arcs: job arcs and machine arcs. A job arc connects adjacent operations of the same job at different processing stages. Its direction aligns with the job's process route, indicating that the next operation can only begin after the previous operation is completed. A machine arc connects different operations processed on the same machine. Its direction is determined by the order in which these operations are processed on that machine, indicating that the next operation can only begin after the previous operation is completed. In the mixed flow shop scheduling problem, because multiple parallel machines exist at each stage, different jobs at the same stage may be assigned to different machines. Therefore, machine arcs only exist between operations assigned to the same machine.

[0052] The process of constructing a disjunctive graph model is essentially to explicitly represent all the temporal constraints implicit in the scheduling scheme as edges in a directed graph, thereby providing a structured data foundation for subsequent critical path analysis.

[0053] Step S520: Identify all critical processes from the disjunctive graph model. Critical processes are those located on the longest path from the start node to the end node.

[0054] In a directed acyclic graph (DAG), there are multiple paths from a virtual start node to a virtual end node, with the longest path being called the critical path. Each action on the critical path is called a critical action. The length of the critical path is directly equal to the maximum completion time of the current scheduling scheme, because the sequence of actions on this path constitutes the bottleneck in the entire production process with no idle waiting. Since there may be multiple parallel critical paths in the disjunctive graph, the set of critical actions may contain multiple actions.

[0055] Common methods for identifying critical processes include calculating the earliest start time and latest start time of each node, or calculating the head length by forward traversal and the tail length by backward traversal, and then selecting processes whose head length plus processing time plus tail length equals the maximum completion time. These critical processes represent the most sensitive links affecting the overall completion time of the scheduling plan. Any adjustment to critical processes may change the maximum completion time, while non-critical processes have a certain amount of slack time.

[0056] Step S530: For critical processes that are affected by the current decoding direction, calculate the head length and tail length of each affected process. The head length is the longest path length from the start node to the process, and the tail length is the longest path length from the process to the end node.

[0057] The head length refers to the length of the longest path from the start node of the disjunctive graph to the current process, reflecting the earliest possible start time of the process under all preconditions. The tail length refers to the length of the longest path from the current process to the end node, reflecting the minimum remaining processing time required after the process is completed. In actual decoding, different decoding directions (forward decoding or reverse decoding) can lead to different scheduling schemes mapped to the same encoded vector, thus affecting the head and tail length values ​​of some processes in the disjunctive graph. For example, reverse decoding changes the relative order and machine allocation between processes by reversing the process route, making non-critical processes potentially become critical processes, or changing the head and tail length values ​​of critical processes. In its implementation, this invention only calculates those processes whose head or tail length changes due to different decoding directions, rather than repeatedly calculating all critical processes, thereby significantly reducing the computational load.

[0058] Step S540: Sum the head length, processing time and tail length of each affected process, and take the maximum value among all affected processes as the maximum completion time of the scheduling scheme.

[0059] For a given process, the longest path length from the start node to the end node through that process is exactly equal to the start length of the process plus the processing time plus the end length. Therefore, the maximum sum of this value among all processes is the longest path length from start to finish in the entire disjunctive graph, i.e., the maximum completion time. Since this step has limited the calculation scope to the critical processes affected by the decoding direction, and these processes are precisely the links most likely to become the bottleneck of the longest path, the maximum completion time of the entire scheduling scheme can be accurately obtained by taking the maximum sum of these processes, without traversing all processes. The above implementation method effectively utilizes the locality of reference characteristic of scheduling scheme changes while ensuring calculation accuracy.

[0060] By utilizing a disjunctive graph model, the scheduling scheme is transformed into a directed graph structure. The head and tail lengths are calculated only for critical processes affected by the decoding direction. The maximum completion time is obtained by summing the head length, processing time, and tail length and taking the maximum value. This method avoids the global traversal of performing complete time-series simulations of all processes in traditional decoding, reducing the computational complexity from the order of magnitude related to the product of the number of workpieces and machines to the order of magnitude related to the number of workpieces, while maintaining the accuracy of the calculation results. This significantly improves the evaluation efficiency of the scheduling scheme and provides strong support for the rapid iteration of adaptive decoding methods under limited computing resources.

[0061] Further, the calculation of the head length for each affected process in step S530 includes: Step S5311: Obtain the machine preceding process and the workpiece preceding process of the affected process. The machine preceding process is the process preceding the process that is adjacent to the process on the same machine, and the workpiece preceding process is the process preceding the process that is adjacent to the process in the same workpiece.

[0062] In disjunctive graph models, each operation typically has two sources of preceding constraints: one is the operation preceding the previous processing stage of the same workpiece, called the workpiece preceding operation; the other is the operation preceding the previous operation on the same machine according to the processing sequence, called the machine preceding operation. For any operation in the mixed flow shop scheduling problem, its commencement of processing must simultaneously satisfy two conditions: the previous stage of the workpiece has been completed, and the previous operation assigned to this machine has been completed. Therefore, the workpiece preceding operation reflects the sequential constraints of the process route, while the machine preceding operation reflects the sequential constraints of resource occupancy. In practical scheduling schemes, the first stage of the operation has no workpiece preceding operation, and the first operation processed on each machine has no machine preceding operation. These boundary cases require special handling; typically, the head length of a non-existent preceding operation is considered to be 0.

[0063] Step S5312: Obtain the head length of the machine's preceding process and the head length of the workpiece's preceding process, respectively.

[0064] Head length refers to the length of the longest path from the start node of the disjunctive graph to the operation, representing the earliest possible start time of the operation under all preceding constraints. Since the machine preceding operation and the workpiece preceding operation may have different head length values, these two values ​​need to be obtained separately for subsequent comparison. For example, if the machine preceding operation head length is 10 and the workpiece preceding operation head length is 8, the operation must wait for the machine preceding operation to complete before it can begin because the machine constraint is more stringent. By obtaining these two head lengths, it is possible to accurately determine which preceding constraint is the critical bottleneck determining the start time of the operation.

[0065] Step S5313: Take the maximum value between the head length of the machine's immediate preceding process and the head length of the workpiece's immediate preceding process, and add it to the processing time of the affected process to obtain the head length of the affected process.

[0066] The calculation logic is based on the fundamental recursive relationship of the critical path method: the earliest start time of a process is equal to the maximum of the earliest finish times of all its preceding processes, and the earliest finish time is equal to the earliest start time plus the processing time of the current process. Since the head length is defined as the longest path length from the start node to the process, this length must be equal to the maximum of the head lengths of all preceding processes plus the weights of the corresponding arcs (i.e., processing times). In the disjunctive graph model, the arc weight from the preceding process to the current process is the processing time of the preceding process; therefore, the head length of the current process is equal to the maximum of the head lengths of the preceding processes plus the processing times of the preceding processes. Furthermore, since the processing time of the current process has not yet been added, step S5313 first takes the maximum of the head lengths of the machine's preceding processes and the workpiece's preceding processes (this maximum already implicitly includes the processing time of the preceding processes), and then adds it to the processing time of the current process to obtain the head length of the current process. For example, if the head length of the machine's preceding process is 10, the head length of the workpiece's preceding process is 8, and the current process's processing time is 3, then the head length is 13. This recursive relationship allows the head length to be calculated by gradually propagating backward from the starting node, avoiding global path search.

[0067] Through the above steps, this technical solution recursively calculates the head length of the currently affected process by using the head lengths of the machine's immediate predecessor process and the workpiece's immediate predecessor process. It only needs to obtain the maximum value of the two immediate predecessor head lengths and add the processing time of the current process to accurately obtain the head length value. This recursive method makes full use of the local dependencies of the disjunctive graph model, without having to retrace the entire graph structure. The computational complexity is linearly related to the number of processes, thus significantly improving the efficiency of head length updates and providing efficient support for quickly evaluating the maximum completion time of neighborhood solutions.

[0068] Further, the calculation of the tail length of each affected process in step S530 includes: Step S5321: Obtain the machine successor process and the workpiece successor process of the affected process. The machine successor process is the process following the process that is immediately adjacent to the process on the same machine, and the workpiece successor process is the process following the process that is immediately adjacent to the process in the same workpiece.

[0069] In the disjunctive graph model, each operation has both preceding and succeeding constraints. A workpiece succeeding operation is the next operation immediately following the current operation on the same workpiece according to the process route; it means the workpiece can only proceed to the next stage of processing after this operation is completed. A machine succeeding operation is the next operation immediately following the current operation on the same machine according to the processing sequence; it means the machine can only begin processing the next operation assigned to it after this operation is completed. Symmetric to the calculation of the head length, the recursion of the tail length depends on information from these two succeeding operations. For the final stage operation, there are no workpiece succeeding operations; for the last operation processed on each machine, there are no machine succeeding operations. In these boundary cases, the tail length of a non-existent succeeding operation is usually considered to be 0.

[0070] Step S5322: Obtain the tail length of the machine's immediate successor process and the tail length of the workpiece's immediate successor process, respectively.

[0071] Tail length refers to the longest path length from the current process to the end node of the disjunctive graph. It reflects the minimum remaining processing time required after the process is completed. Since the machine successor process and the workpiece successor process represent subsequent processing paths under resource constraints and process constraints, respectively, their tail lengths may differ. For example, if the machine successor process tail length for a certain process is 12 and the workpiece successor process tail length is 10, it means that after this process, the tail length will be mainly affected by the machine successor process. Obtaining these two tail length values ​​separately is for subsequent comparison to determine the longer path as the basis for calculating the tail length of this process.

[0072] Step S5323: Take the maximum value between the tail length of the machine's immediate successor process and the tail length of the workpiece's immediate successor process, and add it to the processing time of the affected process to obtain the tail length of the affected process.

[0073] The calculation logic is symmetrical to, but in the opposite direction to, the recursion for the head length. The recursive relationship for the tail length is: the longest path length from a process to the tail node is equal to the processing time of that process plus the maximum value of the tail lengths of all its immediate successor processes. Since the current process must go through the processing of the current process itself before continuing to the end from the immediate successor process, the tail length of the current process is equal to the processing time of the current process plus the maximum value of the tail lengths of all its immediate successor processes. In step S5323, the maximum value of the tail length of the machine's immediate successor process and the tail length of the workpiece's immediate successor process is first taken. This maximum value reflects the longest subsequent path length after the current process. Then, the processing time of the current process is added to obtain the tail length of the current process. For example, if the tail length of the machine's immediate successor process is 12, the tail length of the workpiece's immediate successor process is 10, and the processing time of the current process is 4, then the tail length is 16. This recursive relationship can be calculated by progressively backpropagating from the end node, making the update of the tail length also have linear time complexity.

[0074] The tail length of the currently affected process is calculated recursively using the tail lengths of the machine's immediate successor process and the workpiece's immediate successor process. By simply obtaining the maximum value of the two immediate successor tail lengths and adding the processing time of the current process, the tail length value can be accurately obtained. This recursive method is symmetrical to the head length calculation and also has linear computational complexity, avoiding global reverse path search. This further improves the efficiency of critical process evaluation in the scheduling scheme and provides complete technical support for the rapid calculation of maximum completion time based on the disjunctive graph model.

[0075] Furthermore, updating the elite solution based on the maximum completion time in step S500 includes: Step S551: The scheduling scheme obtained in the current iteration and its corresponding encoding vector are merged with the stored elite solutions to form a temporary elite set.

[0076] Step S551 merges the scheduling scheme and its corresponding encoding vector obtained after decoding and maximum completion time calculation in the current iteration with all scheduling schemes and encoding vectors already stored in the elite solution set, forming a temporary elite set. The elite solution set is empty at algorithm initialization and accumulates gradually with iterations. It stores several historically optimal scheduling schemes, each recording its encoding vector and maximum completion time. In the current iteration, a new scheduling scheme and its maximum completion time are obtained through steps S400 and S500. This scheme may be superior to some schemes in the elite solution set. Merging the new scheme with existing elite solutions allows for comprehensive comparison within a unified set, ensuring all candidate schemes have a chance to participate in the elite solution update. This merging operation does not directly replace or discard any schemes; instead, it constructs a temporary set containing all schemes to be evaluated.

[0077] Step S552: Perform a deduplication operation on the temporary elite set to remove duplicate encoding vectors.

[0078] During the iterative process of a genetic algorithm, different decoding directions or different crossover and mutation operations may produce the same encoding vector. Although the scheduling schemes corresponding to these encoding vectors may have the same maximum completion time, duplicate storage wastes storage space and affects the accuracy of subsequent sorting and selection. Deduplication is achieved by comparing the sequence content of the encoding vectors: when the encoding vectors of two scheduling schemes are exactly the same, only one is retained. After deduplication, each encoding vector in the temporary elite set is unique, ensuring the diversity of the elite solution set and storage efficiency.

[0079] Step S553: ​​Sort the deduplicated temporary elite set in ascending order according to the maximum completion time of each scheduling scheme from smallest to largest.

[0080] Maximum completion time is a core metric for evaluating the quality of a scheduling scheme; a smaller value indicates a better scheme. After sorting in ascending order, the scheduling scheme with the smallest maximum completion time is placed at the front of the set, and the scheme with the largest maximum completion time is placed at the back. This sorting operation allows subsequent selection of elite solutions to be based directly on their order of priority, without requiring comparisons each time. The choice of sorting algorithm can be flexibly determined based on the size of the temporary set; simple sorting can be used when the set is small, while efficient algorithms such as quicksort can be used when the set is large.

[0081] Step S554: Select the top N scheduling schemes from the temporarily elite set after ascending order as the updated elite solutions. Where N is the preset upper limit of elite solution capacity.

[0082] The capacity limit N is a pre-defined constant used to control the maximum size of the elite solution set. Selecting the top N schemes means retaining the N scheduling schemes with the smallest maximum completion time in the temporary set; these schemes represent the currently known optimal solutions. If the number of schemes in the temporary set is less than or equal to N, all are retained; if it is greater than N, only the top N are retained, and the remaining inferior schemes are discarded. Through this capacity constraint, the size of the elite solution set remains constant, facilitating the algorithm to efficiently obtain statistical information such as the number of elite solutions in subsequent iterations. The updated elite solutions will serve as the input to step S300 in the next iteration, used to calculate the sampling probability of each decoding direction, forming a complete feedback loop.

[0083] Through the above steps, this invention achieves a standardized update of the elite solution set: first, new solutions are merged with existing elite solutions; then, duplicate encoding vectors are removed; next, the solutions are sorted in ascending order by maximum completion time; and finally, a set of optimal solutions are selected according to a preset capacity. This update mechanism ensures that the elite solution set always contains the optimal and non-repeating scheduling scheme obtained during the current search process, effectively maintaining the quality and diversity of elite solutions, providing reliable historical feedback information for adaptive decoding direction selection, and avoiding wasted storage space and redundant computation.

[0084] Specifically, such as Figure 2 and Figure 3 As shown, step S400, which involves decoding the encoded vector according to the current decoding direction, includes: Step S410: When the current decoding direction is forward decoding, the processing sequence of non-first-stage workpieces is determined directly according to the first-come-first-served rule, and the processing machine is selected for each process according to the earliest completion time rule to obtain the scheduling scheme.

[0085] Forward decoding arranges each process step sequentially from front to back according to the normal technological route of the workpiece. First, for the workpiece in the first stage, its processing order is directly given by the encoding vector and requires no further determination. For stages other than the first stage, the processing order of the workpieces is determined by the first-come, first-served rule, meaning that workpieces are processed sequentially according to the order in which they arrive at the current stage, with the first arriving workpiece being processed first. Regarding machine selection, for each process to be processed, the system iterates through all available parallel machines within that stage, calculates the estimated completion time of the process on each machine, and then selects the machine with the shortest estimated completion time as the actual processing machine. If multiple machines have the same minimum estimated completion time, the machine with the shortest processing time is further selected; if the processing times are also the same, a machine is randomly selected. Through these rules, forward decoding expands the implicit first-stage order in the encoding vector into a complete scheduling scheme, which includes the processing machine and start and end times for each workpiece in each stage. This decoding process fully utilizes the computational efficiency of heuristic rules, generating a feasible scheduling scheme in a relatively short time.

[0086] Step S420: When the current decoding direction is reverse decoding, reverse the workpiece processing order corresponding to the encoding vector to obtain the reverse scheduling problem. Then, perform forward decoding on the reverse scheduling problem to obtain the reverse scheduling scheme. Finally, reverse the workpiece processing order corresponding to the encoding vector again to obtain the scheduling scheme.

[0087] The core idea of ​​reverse decoding is to reverse the process route of the problem, so that processes that were originally in later stages are given priority in earlier stages, thus obtaining a scheduling scheme with different characteristics from forward decoding. The specific execution process consists of three sub-operations: First, the workpiece processing order corresponding to the encoded vector is reversed, i.e., a new encoded vector is generated with the reverse order of the original encoded vector. For example, if the original encoded vector is {1,3,2}, it becomes {2,3,1} after reversal. Simultaneously, the entire process route of the mixed flow shop scheduling problem needs to be reversed, i.e., the original stage order is changed from stage 1, 2, 3 to stage 3, 2, 1, and the parallel machine configuration and processing time within each stage are also adjusted accordingly. Then, the forward decoding process, identical to step S410, is performed on the obtained reverse scheduling problem, i.e., the reverse scheduling scheme is generated using the first-come-first-served rule and the earliest completion time rule according to the reversed first-stage order. Finally, the process route and workpiece order of this reverse scheduling scheme are reversed again, mapping it back to the original problem's scheduling scheme. The maximum completion time of the scheduling scheme obtained after these three steps may be significantly different from the forward decoding result. Reverse decoding can explore solution space regions that are difficult to cover by forward decoding, thereby increasing the likelihood that the algorithm will find the global optimal solution.

[0088] Forward decoding uses a heuristic rule combining first-come-first-served and earliest completion time to quickly generate feasible scheduling schemes. Reverse decoding obtains scheduling results that differ from forward decoding through a three-step operation of reversing the process route, performing forward decoding, and reversing again. The two decoding directions complement each other, enabling the same encoding vector to map two solutions with different characteristics, effectively expanding the search breadth of the algorithm and providing diverse candidate scheduling schemes for subsequent adaptive probability selection and elite solution updates.

[0089] To more intuitively demonstrate the difference between forward decoding and reverse decoding, this invention provides an HFSP example (containing 4 workpieces and 3 stages) in Table 1, and performs forward decoding and reverse decoding on the same encoding vector {4, 1, 2, 3} respectively. Figure 2 and Figure 3 The Gantt charts obtained from different decoding methods are shown.

[0090] Table 1. Processing Information for HFSP Examples from Figure 2 and Figure 3 As can be seen from this, the forward decoding yields... It is 22, and the result obtained by reverse decoding is 22. The answer is 21. Reverse decoding can yield many solutions that cannot be obtained through forward decoding, and the optimal solution may lie among them; this also applies to forward decoding. Therefore, it is necessary to combine forward and reverse decoding to prevent the algorithm from missing the optimal solution during the search process.

[0091] Furthermore, step S410, which involves selecting a processing machine for each operation according to the earliest completion time rule, includes: Step S411: For the current process to be processed, calculate the estimated completion time of the process on each available machine.

[0092] In the hybrid flow shop scheduling problem, each processing stage is typically equipped with multiple unrelated parallel machines. These machines have different processing speeds and performance parameters, and the processing time for the same operation may differ on different machines. The estimated completion time refers to the total time elapsed from the start of scheduling to the completion of the operation on the designated machine. It is calculated as: the earliest available time for the machine to complete its currently assigned tasks plus the processing time of the operation on that machine. Since different machines have different currently assigned task quantities and processing times, the estimated completion time for the same operation will also differ on different machines. For example, if the estimated completion time for a certain operation is 10 on machine A and 12 on machine B, then machine A can complete the operation earlier. By traversing all available machines within the current stage and calculating their respective estimated completion times, a quantitative comparison basis is provided for subsequent machine selection.

[0093] Step S412: Select the machine with the shortest estimated completion time as the processing machine for the process.

[0094] The selection rule, known as the earliest completion time rule, aims to complete the current process as early as possible, thereby shortening the maximum completion time of the entire scheduling scheme. Among the calculated estimated completion times, the machine corresponding to the smallest value is the optimal choice. For example, if machine A's estimated completion time is 10, machine B's is 12, and machine C's is 15, then machine A is selected. This rule, under a greedy strategy, effectively reduces the completion time of the current process, thus reducing the waiting time of subsequent processes. It is a widely used machine allocation heuristic rule in hybrid flow shop scheduling.

[0095] Step S413: If multiple machines have the same minimum estimated completion time, select the machine with the shortest processing time.

[0096] In actual scheduling, the combination of machine availability and processing time may coincide, and different machines may calculate the same estimated completion time. When multiple machines have the same minimum estimated completion time, the estimated completion time alone cannot distinguish the quality of these machines. In this case, step S413 further selects the machine with the shortest processing time as the processing machine, which is called the shortest processing time rule. Selecting a machine with a shorter processing time can release machine resources for that process more quickly, creating conditions for other processes that may be assigned to the same machine, and also helps to balance the load of each machine. For example, if the estimated completion time of machine A and machine B is both 10, but machine A's processing time is 3 and machine B's processing time is 5, then machine A with the shorter processing time is selected.

[0097] Step S414: If multiple machines have the same minimum estimated completion time and the same processing time, then randomly select one of the multiple machines as the processing machine for the process.

[0098] After the screening in steps S412 and S413, theoretically, there may still be two or more machines that are indistinguishable in all comparison metrics, such as two parallel machines of the same model having the same available time and the same processing time. In this case, it is impossible to further distinguish the merits of these machines based on deterministic rules. Step S414 randomly selects one of these equally optimal machines as the processing machine for the current process. Random selection ensures the exploratory nature of the algorithm and avoids search bias caused by a fixed selection pattern. In practical implementation, a uniform random number generator can be used to select machines with equal probability from the candidate machine set.

[0099] Accordingly, a second aspect of the present invention provides an electronic device, including: at least one processor and a memory connected to the at least one processor. The memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, cause the at least one processor to perform the aforementioned adaptive bidirectional decoding method for hybrid flow shop scheduling problems.

[0100] Accordingly, a third aspect of the present invention provides a computer-readable storage medium having computer instructions stored thereon, which, when executed by a processor, implement the above-described adaptive bidirectional decoding method for the mixed flow shop scheduling problem.

[0101] This invention aims to protect an adaptive bidirectional decoding method for hybrid flow shop scheduling problems, which has the following advantages: 1. By introducing an adaptive bidirectional decoding direction selection mechanism based on elite solution feedback and time-varying learning factors, the sampling probability of each decoding direction is dynamically updated according to the number of elite solutions, the historical number of times each decoding direction has been selected, and the learning factor that decays with running time. This enables the algorithm to intelligently favor better decoding directions based on historical decoding results, maintain high exploration diversity in early iterations to discover potential high-quality decoding directions, and gradually converge to an efficient decoding strategy in later iterations. This significantly improves the adaptive capability and search efficiency of decoding direction selection, effectively solving the technical problems of limited search space and easy getting trapped in local optima caused by the fixed use of a single decoding direction or random selection of decoding directions with equal probability in existing technologies. 2. By constructing a disjunctive graph model and calculating the head and tail lengths only for critical processes affected by the decoding direction, the maximum completion time of the scheduling scheme can be quickly obtained based on the maximum values ​​of the head length, processing time, and tail length. This evaluation method avoids the complete traversal of all processes in traditional decoding methods, reducing the time complexity from the square order of magnitude related to the product of the number of workpieces and the number of machines to the linear order of magnitude related to the number of workpieces. At the same time, it ensures the accuracy of the evaluation results, thereby significantly improving the evaluation efficiency of the scheduling scheme and providing technical support for the rapid iteration of adaptive decoding methods under limited computing resources. 3. By clearly distinguishing the specific execution processes of forward decoding and reverse decoding, forward decoding uses a first-come, first-served rule to determine the processing order and selects machines based on a combination of the earliest completion time and the shortest processing time. Reverse decoding is achieved through a three-step operation of reversing the process route, executing forward decoding, and reversing the process route again. This allows the same encoded vector to map two scheduling schemes with different characteristics, fully exploring the solution space implied by the non-one-to-one correspondence between the encoded vector and feasible solutions, further expanding the search breadth of the algorithm, and thus enhancing its ability to find the global optimal solution in the hybrid flow shop scheduling problem.

[0102] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0103] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0104] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0105] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0106] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the specific implementation of the present invention. Any modifications or equivalent substitutions that do not depart from the spirit and scope of the present invention should be covered within the protection scope of the claims of the present invention.

Claims

1. An adaptive bidirectional decoding method for the mixed flow shop scheduling problem, characterized in that, Includes the following steps: Obtain the encoding vector for the hybrid flow shop scheduling problem, wherein the encoding vector is used only to represent the processing sequence of the workpieces in the first stage; Configure a set of decoding directions for the encoded vector, the set of decoding directions including forward decoding and backward decoding, and initialize a sampling probability for each decoding direction, the sampling probabilities of all decoding directions are set to the same value during initialization; In the current iteration, the number of stored elite solutions and the number of times each decoding direction was selected in the historical iterations are obtained. Combined with the learning factor that decays with running time, the sampling probability of each decoding direction is updated respectively. The elite solution is the encoding vector and its decoding direction information corresponding to the optimal scheduling scheme obtained in the historical decoding. The learning factor is used to control the update magnitude of the sampling probability. Based on the updated sampling probability, a decoding direction is selected from the set of decoding directions as the current decoding direction, and the encoded vector is decoded according to the current decoding direction to obtain the corresponding scheduling scheme. Calculate the maximum completion time of the scheduling scheme, and update the elite solution based on the maximum completion time. The elite solution is used to update the sampling probability in subsequent iterations.

2. The adaptive bidirectional decoding method for the mixed flow shop scheduling problem according to claim 1, characterized in that, The step of obtaining the number of stored elite solutions and the number of times each decoding direction has been selected in historical iterations, and updating the sampling probability of each decoding direction by combining the learning factor that decays over time, includes: For each decoding direction, the elite contribution ratio of the decoding direction is calculated based on the number of elite solutions and the number of times the decoding direction has been selected in historical iterations. The sampling probability update difference for the decoding direction is obtained by subtracting the sampling probability of the decoding direction before the current iteration from the elite contribution ratio. Based on the learning efficiency adjustment factor, the current running time, and the maximum running time, calculate the learning factor that decays with running time; By combining the sampling probability of the decoding direction before the current iteration, the difference between the learning factor and the updated sampling probability, the updated sampling probability of the decoding direction in the current iteration is obtained.

3. The adaptive bidirectional decoding method for the mixed flow shop scheduling problem according to claim 2, characterized in that, The formula for calculating the sampling probability is: ; in, Let be the sampling probability of the decoding direction in the current iteration. Let be the sampling probability of the decoding direction described in the previous iteration. The learning factor, This represents the number of times the current decoding direction has been selected. Let be the number of elite solutions.

4. The adaptive bidirectional decoding method for the mixed flow shop scheduling problem according to claim 3, characterized in that, The formula for calculating the learning factor is: ; in, Current CPU runtime Maximum CPU runtime As a factor regulating learning efficiency; The smaller the value, the closer the sampling probabilities of two adjacent iterations will be.

5. The adaptive bidirectional decoding method for the mixed flow shop scheduling problem according to claim 1, characterized in that, The calculation of the maximum completion time of the scheduling scheme includes: The corresponding disjunction graph model is constructed according to the scheduling scheme. The disjunction graph model includes workpiece arcs and machine arcs, wherein workpiece arcs connect adjacent processes of the same workpiece, and machine arcs connect adjacent processes on the same machine. Identify all critical processes from the disjunctive graph model, where each critical process is located on the longest path from the start node to the end node; For each critical process affected by the current decoding direction, calculate the head length and tail length of each affected process. The head length is the longest path length from the start node to the process, and the tail length is the longest path length from the process to the end node. The maximum value among all affected processes is the sum of the head length, the processing time of the process, and the tail length. The maximum completion time of the scheduling scheme is then taken as the sum of these three values.

6. The adaptive bidirectional decoding method for the mixed flow shop scheduling problem according to claim 5, characterized in that, The calculation of the head length for each affected process includes: Obtain the machine preceding process and the workpiece preceding process of the affected process, wherein the machine preceding process is the process immediately preceding the process on the same machine, and the workpiece preceding process is the process immediately preceding the process in the same workpiece. The head length of the preceding process of the machine and the head length of the preceding process of the workpiece are obtained respectively. The head length of the affected process is obtained by taking the maximum value between the head length of the machine's immediate preceding process and the head length of the workpiece's immediate preceding process, and adding the processing time of the affected process.

7. The adaptive bidirectional decoding method for the mixed flow shop scheduling problem according to claim 5, characterized in that, The calculation of the tail length for each affected process includes: Obtain the machine successor process and the workpiece successor process of the affected process, wherein the machine successor process is the process immediately following the process on the same machine, and the workpiece successor process is the process immediately following the process in the same workpiece. The tail length of the machine's immediate successor process and the tail length of the workpiece's immediate successor process are obtained respectively. The tail length of the affected process is obtained by taking the maximum value between the tail length of the machine's immediate successor process and the tail length of the workpiece's immediate successor process, and adding the processing time of the affected process.

8. The adaptive bidirectional decoding method for the mixed flow shop scheduling problem according to claim 1, characterized in that, The step of updating the elite solution based on the maximum completion time includes: The scheduling scheme obtained in the current iteration and its corresponding encoding vector are merged with the stored elite solutions to form a temporary elite set; Perform a deduplication operation on the temporary elite set to remove duplicate encoding vectors; The deduplicated temporary elite set is sorted in ascending order according to the maximum completion time of each scheduling scheme from smallest to largest. Select the top N scheduling schemes from the temporary elite set after ascending order as the updated elite solutions; Where N is the preset upper limit of the elite solution capacity.

9. The adaptive bidirectional decoding method for the mixed flow shop scheduling problem according to any one of claims 1-8, characterized in that, Decoding the encoded vector according to the current decoding direction includes: When the current decoding direction is forward decoding, the processing sequence of non-first-stage workpieces is determined directly according to the first-come-first-served rule, and the processing machine is selected for each process according to the earliest completion time rule to obtain the scheduling scheme. When the current decoding direction is reverse decoding, the workpiece processing order corresponding to the encoding vector is reversed to obtain the reverse scheduling problem. Then, the forward decoding is performed on the reverse scheduling problem to obtain the reverse scheduling scheme. Finally, the workpiece processing order corresponding to the encoding vector is reversed again to obtain the scheduling scheme.

10. The adaptive bidirectional decoding method for the mixed flow shop scheduling problem according to claim 9, characterized in that, The selection of processing machines for each process according to the earliest completion time rule includes: For the current process to be processed, calculate the estimated completion time of the process on each available machine; Select the machine with the shortest estimated completion time as the processing machine for the aforementioned process; If multiple machines have the same minimum estimated completion time, select the machine with the shortest processing time. If multiple machines have the same minimum estimated completion time and the same processing time, then one of the multiple machines is randomly selected as the processing machine for the process.