Distributed mixed flow shop scheduling optimization method based on greedy job insertion
By using a greedy workpiece insertion method, the critical workpiece process is inserted sequentially into the target factory to the position with the shortest longest path length, and the head length of the affected process is updated in real time. This solves the problems of coarse movement, low accuracy, and long time consumption of the neighbor structure movement between factories in the existing technology, and realizes efficient distributed hybrid flow shop scheduling optimization.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-04-23
- Publication Date
- 2026-07-24
AI Technical Summary
Existing technologies, when solving the distributed hybrid flow shop scheduling problem, rely too heavily on the movement of neighborhood structures between factories, resulting in low neighborhood search accuracy and long search time. Furthermore, they lack effective utilization of critical path information in the solution space, making it difficult to guarantee the global optimality of the scheduling scheme.
A greedy job insertion method is adopted, which inserts the critical job process in the target factory one after another until the longest path length is minimized, and updates the head length of the affected process in real time, so as to achieve accurate perturbation of the critical path and rapid evaluation of the neighborhood solution.
It significantly improves the search accuracy and computational efficiency of inter-factory neighborhood moves, reduces the computational overhead of invalid neighborhood moves, and lowers the time complexity, thereby obtaining a better scheduling solution within a limited time.
Smart Images

Figure CN122452894A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of production scheduling and intelligent optimization technology, and in particular to a distributed hybrid flow shop scheduling optimization method based on greedy workpiece insertion. Background Technology
[0002] Distributed hybrid flow shop scheduling is widely used in modern manufacturing fields such as semiconductor manufacturing, steel smelting, and textile processing. In this problem, multiple workpieces need to be assigned to multiple factories for processing. Each factory contains multiple processing stages, and each stage is equipped with multiple parallel machines. Workpieces pass through each stage sequentially according to the same process route, and at each stage, one of the multiple parallel machines can be selected for processing. Compared with traditional single-factory scheduling, distributed hybrid flow shop scheduling not only requires deciding the order of operations on the machines at each stage within each factory, but also needs to decide the allocation of workpieces between different factories. These two sub-problems are highly coupled, which greatly increases the difficulty of solving the problem, making it a typical nondeterministic polynomial-time hard problem.
[0003] For the distributed hybrid flow shop scheduling problem, existing technologies mainly employ exact algorithms, heuristic methods, and intelligent optimization algorithms. Exact algorithms, such as branch and bound and dynamic programming, can theoretically find the optimal solution, but their computational complexity increases exponentially with the problem size, making them difficult to apply to large-scale problems in actual production. Heuristic methods, such as the NEH rule and the earliest completion time rule, while computationally fast, typically only yield feasible solutions of finite quality, failing to guarantee the global optimality of the scheduling scheme. Intelligent optimization algorithms, such as genetic algorithms, particle swarm optimization, tabu search, and iterative greedy algorithms, find better solutions in the solution space through iterative search mechanisms and are currently the main means of solving this type of problem.
[0004] In intelligent optimization algorithms, the design of the neighborhood structure is crucial to the efficiency of local search and the quality of the solution. Existing technologies for the distributed hybrid flow shop scheduling problem mainly categorize neighborhood structures into intra-factory neighborhood structures and inter-factory neighborhood structures. Intra-factory neighborhood structures explore the solution space by adjusting the processing order of operations within a single factory, while inter-factory neighborhood structures improve the solution by changing the distribution of workpieces across different factories. However, most existing inter-factory neighborhood structures remain at the encoding space level. For example, they might move a portion of workpieces from a critical factory to a non-critical factory without specifying the insertion position of each operation within the workpiece in the target factory. This results in a coarse-grained neighborhood movement, requiring re-decoding to obtain complete scheduling information after the movement. This not only reduces the accuracy of the neighborhood search but also increases computational time. Furthermore, existing inter-factory neighborhood structures lack effective utilization of critical path information in the solution space, making it difficult to accurately apply perturbations that shorten the critical path length, thus limiting the performance of local search. Summary of the Invention
[0005] The purpose of this invention is to provide a distributed hybrid flow shop scheduling optimization method based on greedy workpiece insertion. By using the longest path length minimization criterion based on the solution space, the critical workpiece's processes are greedily inserted into the optimal position of the target factory one after another, and the head length of the affected processes is updated in real time. This achieves accurate perturbation of the critical path and rapid evaluation of neighborhood solutions, significantly improving the search accuracy and computational efficiency of neighborhood movement between factories. It solves the technical problems of poor controllability, low accuracy and long time consumption of neighborhood movement caused by coarse movement in the encoding space and global re-decoding in the prior art.
[0006] To address the aforementioned technical problems, a first aspect of this invention provides a distributed hybrid flow shop scheduling optimization method based on greedy workpiece insertion, comprising the following steps: Step S100: Obtain the current scheduling solution, which includes the workpiece allocation scheme of each factory, the processing order of the processes in each processing stage in each factory on the parallel machine, and the processing time of each process. Identify the factory with the longest completion time in the current scheduling solution as the key factory, and identify the workpieces containing key processes in the key factory as key workpieces. Step S200: Select the factory with the shortest completion time from all factories except the key factory as the target factory; Step S300: Starting from the first process of the key workpiece, each process of the key workpiece is sequentially inserted into the optimal insertion position of the processing stage corresponding to that process in the target factory. The optimal insertion position is the position that minimizes the longest path length through that process after insertion. Step S400: After completing the insertion of all processes of the critical workpiece, update the head length of the processes affected by the insertion in the target plant, and update the head length of the processes affected by the removal of the critical workpiece in the critical plant to obtain a new scheduling solution.
[0007] Furthermore, the step of sequentially inserting each process of the critical workpiece into the optimal insertion position of the corresponding processing stage in the target factory, starting from the first process of the critical workpiece, includes: Step S310: Determine the processes that have not yet been inserted in the key workpiece as the current processes to be inserted in order from the first process to the last process, and determine the processing stage corresponding to the current processes to be inserted in the target factory; Step S320: On all parallel machines included in the processing stage, traverse each candidate insertion position on each parallel machine, the candidate insertion position including the gap between the already arranged operations on the parallel machine and the end of the already arranged operation sequence on the parallel machine, and calculate the longest path length through the current operation to be inserted into each candidate insertion position. Step S330: Select the candidate insertion position that minimizes the longest path length as the optimal insertion position, and insert the current process to be inserted into the optimal insertion position; Step S340: Update the head length of all subsequent processes in the target factory that have changed their head length due to the insertion of the current process to be inserted on the machine at the optimal insertion position. For each subsequent process, the head length is the longest path length from the starting process in the factory to the subsequent process. Step S350: Take the next process of the critical workpiece as the new current process to be inserted, and repeat steps S310 to S340 until all processes of the critical workpiece have been inserted into the target factory.
[0008] Further, the step of traversing each candidate insertion position on each of all parallel machines included in the processing stage includes: Step S321a: On the same parallel machine, in the order from the beginning to the end of the process sequence arranged on the parallel machine, select each candidate insertion position in turn and calculate the longest path length through the current process to be inserted after inserting the current process to be inserted into the candidate insertion position. Step S321b: When the longest path length corresponding to a candidate insertion position is calculated for the first time and does not increase the completion time of the target factory, the candidate insertion position is set as the retrieval termination line; Step S321c: Stop traversing the remaining candidate insertion positions located to the right of the retrieval termination line on the same parallel machine, and switch to the next parallel machine; Step S321d: On the next parallel machine, traverse the candidate insertion positions only within the range of positions to the left of the retrieval termination line.
[0009] Further, the step of traversing each candidate insertion position on each of all parallel machines included in the processing stage includes: Step S322a: Determine whether there is a critical block on the currently traversed parallel machine. The critical block consists of processes that are continuously arranged on the parallel machine and are all located on the critical path of the target factory. The critical path is the longest path from the starting process to the ending process in the target factory. Step S322b: When a key block exists on the currently traversed parallel machine, identify the candidate insertion position interval occupied by the key block. The candidate insertion position interval includes the gap between all adjacent processes within the key block and the gap before the first process and after the last process of the key block. Step S322c: When traversing the candidate insertion positions on the currently traversed parallel machine, skip all candidate insertion positions within the candidate insertion position interval and do not calculate the longest path length for the candidate insertion positions within the candidate insertion position interval.
[0010] Furthermore, the formula for calculating the longest path length in step S320 is as follows: ; in, To make the process Insert into the machine k Location The longest path length through this process. For key components j The s One process, Number the parallel machines in the target factory. For machines k The first i Insertion positions, This represents the processing time for the current process to be inserted. This refers to the head length of the preceding process on the machine immediately preceding the candidate insertion position. For the target factory, on a parallel machine, immediately adjacent to the insertion position The processing time of the previous process. For key components j The s -1 process head length, For key components j The s - Processing time for one step This is the tail length of the next process on the machine immediately following the candidate insertion position. For the target factory, on a parallel machine, immediately adjacent to the insertion position The processing time of the next step.
[0011] Furthermore, after updating the head length of the insertion-affected process in the target plant, the method further includes: Step S410: Determine whether the completion time of the target factory increases after inserting the current process to be inserted into the optimal insertion position; Step S420: If the completion time of the target factory increases, then starting from the processing stage where the current process to be inserted is located, the critical blocks in each subsequent processing stage are updated sequentially. The critical blocks are composed of processes that are continuously arranged on the same parallel machine and are all located on the critical path of the target factory. Step S430: If the completion time of the target factory does not increase, the key block information before the update is used and the key blocks in the target factory are not updated.
[0012] Furthermore, before traversing each candidate insertion position on each of all parallel machines included in the processing stage, the process further includes: Step S311: Obtain the key block information on each parallel machine in the processing stage. The key block consists of processes that are continuously arranged on the same parallel machine and are all located on the critical path of the target factory. Step S312: Place parallel machines containing key blocks at the back of the retrieval order and place parallel machines without key blocks at the front of the retrieval order. Step S313: Traverse the candidate insertion positions on each parallel machine in the order of retrieval.
[0013] Furthermore, the calculation of the longest path length through the current insertion process after inserting it into each candidate insertion position also includes: Step S323: Determine whether the calculated longest path length is greater than the completion time of the critical factory before this insertion operation; Step S324: If it is greater than, then immediately terminate the insertion operation of all remaining processes of the key workpiece, restore the key factory and the target factory to the scheduling state before the current insertion operation, end the current workpiece movement operation, and no longer execute the insertion operation of the remaining processes of the key workpiece. Step S325: If it is not greater than, then continue to execute step S330.
[0014] Further, updating the head length of all subsequent processes in the target factory whose head length has changed due to the insertion of the current insertion process on the machine at the optimal insertion position includes: Step S341: Take the current insertion process on the machine where the optimal insertion position is located as the starting process; Step S342: Select each subsequent process as the current process to be updated in the order from the starting process to the end of the process sequence arranged on the machine; Step S343: Obtain the sum of the head length and processing time of the previous process on the machine for the current process to be updated, as the first candidate value; Step S344: Obtain the sum of the head length and processing time of the previous process in the workpiece corresponding to the current process to be updated, as the second candidate value. If the current process to be updated is the first process of the workpiece, then set the second candidate value to zero. Step S345: Take the maximum value between the first candidate value and the second candidate value as the new head length of the current process to be updated; Step S346: Repeat steps S342 to S345 until the head length of all subsequent processes affected by the insertion on the machine is updated.
[0015] Furthermore, after obtaining the new scheduling solution, the process also includes: Step S510: Obtain the head length of all processes in the last processing stage of the target factory, where the head length represents the longest path length from the starting process of the target factory to each process. Step S520: Calculate the completion time of the target factory based on the head length of all processes in the last processing stage of the target factory; Step S530: Obtain the head length of all processes in the last processing stage of the critical plant, and calculate the completion time of the critical plant; Step S540: Take the maximum value between the completion time of the target factory and the completion time of the critical factory as the completion time of the new scheduling solution.
[0016] 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 distributed hybrid flow shop scheduling optimization method based on greedy workpiece insertion.
[0017] 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 distributed hybrid flow shop scheduling optimization method based on greedy workpiece insertion.
[0018] The above-described technical solutions of the embodiments of the present invention have the following beneficial technical effects: 1. By greedily inserting all processes of the critical workpiece into the target factory sequentially from the first process to the optimal position that minimizes the longest path length through the process, and updating the head length of the affected process in real time after each insertion, this method overcomes the limitation of existing technologies that only perform coarse overall movement of the workpiece in the coding space. It achieves fine-grained perturbation of the critical path and local maintenance of scheduling information, significantly improves the search accuracy of neighborhood movement between factories, avoids computational redundancy caused by global re-decoding, and thus obtains a better scheduling solution in the same amount of time. 2. By adopting a search termination line strategy to terminate the traversal of invalid positions on the same machine in advance, skipping insertion positions inside the key block that will inevitably increase the completion time, optimizing the machine search order according to whether it contains a key block, and immediately terminating the entire workpiece movement and rolling back when the insertion process causes the completion time of the target factory to exceed the completion time of the original key factory, the computational overhead of invalid neighborhood movement is systematically reduced, the neighborhood solution generation process is accelerated, and the technical problem of low efficiency of existing inter-factory neighborhood search is effectively solved, enabling the algorithm to explore more potential solution space regions within a limited time. 3. By utilizing the head lengths of all processes within the last processing stage of the factory to quickly calculate the completion time, the entire scheduling solution is re-decoded, reducing the time complexity from a cubic polynomial level to a linear level. Simultaneously, based on whether the target factory's completion time increases after inserting a process, key blocks are selectively updated from the current process forward or existing key block information is reused, further reducing unnecessary computation. These mechanisms collectively achieve rapid quality assessment of neighborhood solutions, significantly improving the overall efficiency of the greedy workpiece insertion neighborhood search between factories, and providing an efficient and accurate optimization method for distributed hybrid flow shop scheduling problems. Attached Figure Description
[0019] Figure 1 This is a flowchart of the distributed hybrid flow shop scheduling optimization method based on greedy workpiece insertion provided in the embodiments of the present invention; Figure 2 This is a schematic diagram of greedy workpiece insertion and inter-factory neighborhood movement provided in an embodiment of the present invention. Detailed Implementation
[0020] 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.
[0021] Please refer to Figure 1 and Figure 2 The first aspect of this invention provides a distributed hybrid flow shop scheduling optimization method based on greedy workpiece insertion, comprising the following steps: Step S100: Obtain the current scheduling solution, which includes the workpiece allocation scheme of each factory, the processing order of the processes in each processing stage in each factory on the parallel machine, and the processing time of each process. Identify the factory with the longest completion time in the current scheduling solution as the critical factory, and identify the workpieces containing critical processes in the critical factory as critical workpieces.
[0022] In the scheduling optimization process of a distributed hybrid production line workshop, a scheduling solution fully describes the allocation scheme of all workpieces among multiple factories, the arrangement order of processes on parallel machines in each processing stage within each factory, and the processing time of each process. Step S100 first obtains the current scheduling solution and calculates the completion time of each factory, which is the maximum value of the completion time of all processes within that factory. The factory with the longest completion time is defined as the critical factory. The completion time of the entire scheduling solution is determined by the maximum value of the completion times of all factories. Only by shortening the critical path length of the critical factory can the global completion time be effectively reduced. Furthermore, in the disjunctive graph model of the critical factory, the critical path refers to the longest path from the virtual start node to the virtual end node, and the processes located on this path are called critical processes. Workpieces containing these critical processes are identified as critical workpieces, thereby locking in the objects that most urgently need adjustment in the current scheduling solution. Unlike the existing technology that randomly selects workpieces or selects workpieces based on simple rules, this invention accurately identifies the workpieces that have the greatest impact on the completion time based on critical path analysis, providing a clear and efficient search direction for subsequent neighborhood movement.
[0023] Step S200: Select the factory with the shortest completion time from all factories except the critical factory as the target factory.
[0024] After identifying the critical workpiece, a receiving factory needs to be selected for it. Step S200 selects the factory with the shortest completion time from all non-critical factories (excluding the critical factory) as the target factory. The factory with the shortest completion time has the most abundant processing capacity and time window under the current scheduling state. Moving the critical workpiece to this factory minimizes the impact of new processing tasks on the factory's completion time, and may even allow insertion to be completed without increasing the factory's completion time, thus avoiding the introduction of new bottlenecks while solving one. Compared with the existing techniques of randomly selecting non-critical factories or selecting factories based on load balancing rules, this invention quantitatively selects the optimal receiver by comparing the completion times of each non-critical factory, creating the most favorable conditions for the insertion of critical workpieces and improving the effectiveness of neighborhood movement.
[0025] Step S300: Starting from the first process of the critical workpiece, insert each process of the critical workpiece into the optimal insertion position of the corresponding processing stage in the target factory. The optimal insertion position is the position that minimizes the longest path length through the process after insertion.
[0026] Existing inter-factory neighborhood moves typically occur in the encoding space, moving the entire critical workpiece from the critical factory to the target factory without specifying the exact insertion positions of each process step on the machines at each processing stage in the target factory. After the move, complete scheduling information must be obtained through re-decoding, resulting in coarse-grained, low-accuracy, and time-consuming neighborhood moves. This invention fundamentally changes this operational mode: starting with the first process step of the critical workpiece, each process step is processed sequentially according to the processing order, and each process step is independently inserted into a candidate position on all parallel machines in the target factory corresponding to the processing stage to which it belongs. Candidate positions include the gaps between existing process sequences on each machine and the end of the sequence. For each candidate insertion position, the longest path length through that process in the disjunctive graph model of the target factory is calculated after insertion. This length calculation depends on four key parameters: the processing time of the process itself, the tail length of the previous process step in the critical workpiece, the head length of the preceding process step immediately preceding the candidate position on the machine, and the tail length of the following process step immediately preceding the candidate position on the machine. Among all candidate positions, the position that minimizes the longest path length is selected as the optimal insertion position, and the process is inserted. Since the insertion of each process is based on the local optimal selection of the current real-time layout of the target factory and is completed sequentially according to the process order, the fine-grained insertion of the entire critical workpiece at the solution space level is finally achieved, making the information on neighborhood movement complete, controllable, and significantly improving accuracy.
[0027] Step S400: After inserting all operations of the critical workpiece, update the head length of the operations affected by the insertion in the target plant, and update the head length of the operations affected by the removal of the critical workpiece in the critical plant to obtain a new scheduling solution.
[0028] After all operations on the critical workpiece are inserted, the operation layout on some machines in the target factory changes, causing the head length of subsequent operations (i.e., the longest path length from the factory's starting operation to this operation) on these machines to need to be recalculated. Step S400 updates the head lengths of these affected subsequent operations sequentially, based on the larger of the sum of the head length and processing time of the previous operation and the sum of the head length and processing time of the previous operation on the same workpiece. Simultaneously, the critical workpiece is removed from the original critical factory, and the head length of subsequent operations on the machine where the workpiece was originally located in the original critical factory also changes accordingly, requiring updates according to the above process. Through this local update mechanism, this solution only maintains information on the portion of the scheduling solution affected by insertion and removal operations, without needing to re-decode the entire scheduling solution. Compared to the prior art's practice of globally re-decoding after each neighborhood move, this invention significantly reduces computational overhead while ensuring the accuracy of scheduling information. After completing all update operations, a new scheduling solution is obtained, in which the load on the critical factory is reduced, the arrangement of the target factory accommodates the critical workpiece while maintaining local optimum, and the overall completion time is expected to be improved.
[0029] By identifying critical factories and key workpieces to pinpoint scheduling bottlenecks, and selecting the non-critical factory with the shortest completion time as the receiver, the system selects the optimal insertion position on the parallel machines of each processing stage in the target factory, starting from the first process of the critical workpiece, to minimize the longest path length through that process. After insertion, the length of the affected process head is locally updated. This achieves precise perturbation of the critical path and incremental maintenance of scheduling information at the solution space level. It fundamentally overcomes the technical defects of existing coding spaces, which require global re-decoding after the overall movement of the workpiece, resulting in coarse neighborhood movement, low accuracy, and long processing time. This significantly improves the precision and computational efficiency of neighborhood search between factories in distributed hybrid flow shop scheduling.
[0030] Furthermore, step S300, starting from the first process of the critical workpiece, sequentially inserts each process of the critical workpiece into the optimal insertion position of the corresponding processing stage in the target factory, including: Step S310: Identify the processes that have not yet been inserted in the key workpieces as the current processes to be inserted in order from the first process to the last process, and determine the corresponding processing stage of the current process to be inserted in the target factory.
[0031] After identifying the critical workpiece, all its processes need to be inserted into the target factory one by one according to their inherent processing sequence. First, the processes in the critical workpiece that have not yet been inserted are identified sequentially from the first process to the last process as the current processes to be inserted. Simultaneously, based on the stage index of each process in the workpiece's processing flow, its corresponding processing stage in the target factory is determined. Since each factory in a distributed hybrid flow shop contains multiple consecutive processing stages, and different processes for the same workpiece correspond to different processing stages, each process to be inserted can only be inserted into the processing stage in the target factory with the same stage number as that process. By processing sequentially from the first process to the last process, the sequential constraints between processes within the workpiece are always satisfied during the insertion process; that is, a later process will not be processed before a previous process.
[0032] Step S320: On all parallel machines included in the processing stage, traverse each candidate insertion position on each parallel machine. The candidate insertion position includes the gap between the already arranged operations on the parallel machine and the end of the already arranged operation sequence on the parallel machine. Calculate the longest path length through the current operation to be inserted into each candidate insertion position.
[0033] After determining the current process to be inserted and its corresponding processing stage, the optimal insertion position for the process is found within that processing stage. First, all available parallel machines within the processing stage are acquired. For each parallel machine, all candidate insertion positions in the existing process arrangement sequence on that machine are traversed. Candidate insertion positions include the gap between adjacent arranged processes on the machine and the end position of the arranged process sequence. For each candidate insertion position, the longest path length through that process in the disjunctive graph model of the target plant is calculated after inserting the current process to be inserted at that position. This calculation process depends on the processing time of the current process to be inserted, the tail length of the previous process in the critical workpiece, the head length of the previous process on the machine where the candidate insertion position is located, and the tail length of the next process. By traversing all candidate insertion positions on all parallel machines, step S320 exhaustively enumerates all possible placement positions of the current process to be inserted in the corresponding processing stage of the target plant, providing a complete comparative basis for subsequent selection of the optimal position.
[0034] Step S330: Select the candidate insertion position that minimizes the longest path length as the optimal insertion position, and insert the current process to be inserted into the optimal insertion position.
[0035] After calculating the longest path length for all candidate insertion positions, step S330 selects the position with the smallest longest path length as the optimal insertion position and inserts the current process to be inserted into that position. Since the longest path length directly reflects the trend of the target factory's completion time after inserting the process, selecting the position with the smallest length means that, under the current local decision, the insertion of this process has the least negative impact on the target factory's completion time, and may even not increase the completion time at all. This greedy selection strategy ensures that the insertion of each process is a locally optimal decision under the current state, creating the best possible preconditions for the insertion of subsequent processes. After the process is actually inserted into the optimal position, the process sequence on the corresponding machine in the target factory changes, and the new process becomes part of the sequence on that machine.
[0036] Step S340: Update the head length of all subsequent processes in the target factory that have changed their head length due to the insertion of the current process to be inserted on the machine at the optimal insertion position. For each subsequent process, the head length is the longest path length from the starting process in the factory to the subsequent process.
[0037] After the current insertion operation is inserted into the machine at the optimal insertion position in the target factory, the head lengths (i.e., the longest path length from the starting operation in the factory to the current subsequent operation) of all subsequent operations on that machine after the insertion position will change due to the addition of the new operation. Step S340 updates the head lengths of these affected subsequent operations sequentially, starting from the first subsequent operation after the insertion position and proceeding in the order of the operation sequence on the machine. For each subsequent operation, its new head length is equal to the maximum of the sum of the head length and processing time of its predecessor operation, and the sum of the head length and processing time of the previous operation of the workpiece to which the subsequent operation belongs. Through this local propagation update method, step S340 only adjusts the head lengths of the operations directly affected by the insertion operation on the machine, without recalculating the head lengths of all operations in the entire factory, thus ensuring computational efficiency.
[0038] Step S350: Take the next process of the critical workpiece as the new current process to be inserted, and repeat steps S310 to S340 until all processes of the critical workpiece have been inserted into the target plant.
[0039] After completing the insertion of the current process to be inserted and the resulting head length update, step S350 takes the next process of the critical workpiece as the new current process to be inserted and returns to step S310, repeating steps S310 to S340. This loop continues until all processes of the critical workpiece have been sequentially inserted into the corresponding processing stages in the target factory. Since the insertion position of each process is recalculated based on the optimal position of the target factory after the real-time state of the previous process, the entire insertion process of the critical workpiece is a sequentially dependent greedy decision sequence. The insertion of each process provides an updated scheduling environment for subsequent processes, resulting in a high-quality overall insertion scheme at the solution space level.
[0040] Through the above steps, the insertion operation of critical workpieces is decomposed into an independent processing flow for each process. Each process traverses all candidate insertion positions on all parallel machines in its corresponding processing stage, selects the position that minimizes the longest path length through the process, and locally updates the head length of the affected process after insertion. Thus, under the premise of ensuring the sequential constraints of the internal processes of the workpiece, the fine-grained and traceable complete insertion of critical workpieces in the target factory is achieved, providing a specific and executable operation flow for greedy workpiece insertion and inter-factory neighborhood movement.
[0041] Further, step S320, which involves iterating through each candidate insertion position on each of all parallel machines included in the processing phase, includes: Step S321a: On the same parallel machine, in the order from the beginning to the end of the process sequence arranged on the parallel machine, select each candidate insertion position in turn and calculate the longest path length through the current process after inserting the current process into the candidate insertion position.
[0042] When traversing candidate insertion positions on a parallel machine, step S321a specifies the traversal order: starting from the beginning of the sequence of operations already arranged on the machine (i.e., the position before the first operation), move sequentially to the gaps between adjacent operations in the sequence until the end of the sequence. Following this order, at each candidate insertion position, the longest path length through that operation after inserting the current operation into that position is calculated. This left-to-right traversal ensures the systematic and predictable nature of the retrieval, laying the foundation for subsequently stopping the traversal early using the retrieval termination line.
[0043] Step S321b: When the longest path length corresponding to a candidate insertion position is calculated for the first time and does not increase the completion time of the target factory, the candidate insertion position is set as the search termination line.
[0044] In the process of calculating the longest path length corresponding to each candidate insertion position in order from left to right, step S321b introduces a key judgment condition: when a candidate insertion position is encountered for the first time such that the longest path length calculated after inserting the operation does not increase the completion time of the target factory, that candidate insertion position is set as the search termination line. According to the nature of the distributed hybrid flow shop scheduling problem, inserting an operation into a position on a machine will not decrease the completion time of the target factory; it will only increase or remain unchanged. Therefore, once the first position that does not increase the completion time is found, it means that this position and all positions to its left will not increase the completion time, while positions to its right may increase the completion time. The purpose of setting the search termination line is to mark the confirmed safe area boundary on the current machine.
[0045] Step S321c: Stop traversing the remaining candidate insertion positions located to the right of the search termination line on the same parallel machine, and switch to the next parallel machine.
[0046] After determining the search termination line, step S321c stops traversing the remaining candidate insertion positions to the right of the search termination line on the same parallel machine. Since the positions to the right of the search termination line inevitably increase the completion time of the target factory after insertion (derived from the property that the first occurrence of a position does not increase the completion time), these positions cannot produce neighborhood solutions better than the already found positions, and therefore do not need to continue calculation. After stopping the invalid traversal, the algorithm switches to the next parallel machine and continues to search for candidate insertion positions on that machine. This pruning operation significantly reduces unnecessary computation and improves traversal efficiency.
[0047] Step S321d: On the next parallel machine, traverse the candidate insertion positions only within the range of positions to the left of the retrieval termination line.
[0048] When switching to the next parallel machine, step S321d traverses the candidate insertion positions only within the range of positions to the left of the search termination line on that machine. The search termination line is a position index value; on different machines, the range of positions to the left of this index corresponds to the corresponding number of insertion positions starting from the beginning on each machine. Since the search termination line is a threshold based on the completion time of the target factory, it is essentially a machine-independent position counting boundary and can therefore be used across machines. On the next machine, only the previous search termination line's candidate insertion positions are traversed, instead of traversing all positions on the entire machine. This strategy further compresses the search space, ensuring that the algorithm's traversal process across multiple parallel machines is constrained by the same search termination line, thereby significantly reducing the overall computational complexity of inter-factory neighborhood movement.
[0049] By using the above steps, the search termination line strategy stops traversing invalid positions on the right side after finding an insertion position on the same machine that does not increase the completion time of the target factory. The index of this position is then passed to subsequent machines to search only the left position range. This systematically eliminates a large number of invalid candidate insertion positions that cannot improve the current solution. While ensuring that better solutions are not lost, the number of calculations for the longest path length is significantly reduced, and the traversal efficiency of neighborhood movement between factories is improved.
[0050] Further, step S320, which involves iterating through each candidate insertion position on each of all parallel machines included in the processing phase, includes: Step S322a: Determine whether there is a critical block on the currently traversed parallel machine. The critical block consists of processes that are continuously arranged on the parallel machine and are all located on the critical path of the target factory. The critical path is the longest path from the start process to the end process in the target factory.
[0051] Before traversing candidate insertion positions on a parallel machine, it is first determined whether a critical block exists on that machine. A critical block is a group of operations arranged consecutively on the machine, all of which are located on the critical path of the target factory. The critical path is the longest path from the start to the end of the target factory, and the operations on this path determine the factory's completion time. Because the operations within a critical block have tight processing sequence dependencies, inserting a new operation into the critical block will disrupt the original critical path structure, inevitably increasing the target factory's completion time. Therefore, identifying the existence of critical blocks is a prerequisite for subsequently skipping invalid insertion positions.
[0052] Step S322b: When a key block exists on the currently traversed parallel machine, identify the candidate insertion position interval occupied by the key block. The candidate insertion position interval includes the gap between all adjacent operations within the key block and the gap between the first operation and the last operation of the key block.
[0053] When a critical block is determined to exist on the currently traversed parallel machine, the candidate insertion position range occupied by the critical block is further identified. Candidate insertion positions include all gaps between already arranged operations on the machine. Specifically, the candidate insertion position range occupied by the critical block includes: the gaps between all adjacent operations within the critical block (i.e., the insertion positions between operations within the block), and the gaps before the first operation and after the last operation of the critical block. The gap before the first operation refers to the insertion position before the first operation of the critical block, and the gap after the last operation refers to the insertion position after the last operation of the critical block. By clearly defining this range, the range of invalid insertion positions that need to be skipped can be precisely determined.
[0054] Step S322c: When traversing the candidate insertion positions on the currently traversed parallel machine, skip all candidate insertion positions within the candidate insertion position interval and do not calculate the longest path length for the candidate insertion positions within the candidate insertion position interval.
[0055] After identifying the candidate insertion position range occupied by the critical block, when traversing the candidate insertion positions on the current parallel machine, all candidate insertion positions within that range are skipped directly, and the longest path length after inserting the current operation is not calculated for these positions. This is because inserting any operation inside the critical block or into the specified gap immediately following the beginning or end of the critical block will inevitably increase the completion time of the target factory; therefore, these positions cannot be the optimal insertion positions that minimize the longest path length. By skipping these invalid positions, the number of positions requiring the longest path length calculation is further reduced without affecting the quality of the optimal solution search, thus improving traversal efficiency.
[0056] By utilizing a key block identification and skipping mechanism, when traversing candidate insertion positions on a parallel machine, the candidate insertion position interval occupied by key blocks is automatically identified and excluded. This avoids unnecessary calculations at invalid positions that would inevitably increase the completion time of the target factory, thereby further reducing the computational overhead of neighborhood search without sacrificing solution quality and improving the overall efficiency of neighborhood movement between factories.
[0057] Furthermore, the formula for calculating the longest path length in step S320 is as follows: .
[0058] in, To make the process Insert into the machine k Location The longest path length through this process. For key components j The s One process, Number the parallel machines in the target factory. For machines k The first i Insertion positions, This represents the processing time for the current process to be inserted. This refers to the head length of the preceding process on the machine immediately preceding the candidate insertion position. For the target factory, on a parallel machine, immediately adjacent to the insertion position The processing time of the previous process. For key components j The s -1 process head length, For key componentsj The s - Processing time for one step This is the tail length of the next process on the machine immediately following the candidate insertion position. For the target factory, on a parallel machine, immediately adjacent to the insertion position The processing time of the next step.
[0059] In DHFSP, it has the largest The factory containing the critical process is called the critical factory, and the workpiece containing the critical process is called the critical workpiece. Only by shortening the critical path length of the critical factory can the current solution be reduced. Therefore, applying perturbations to the critical path of critical plants is an essential element of efficient inter-plant neighborhood structures; inter-plant neighborhood structures designed for coding spaces are relatively inefficient. k Based on the insertion mechanism, and combining the characteristics of distributed manufacturing with a greedy strategy, a greedy job insertion inter-factory neighborhood structure was designed. The greedy job insertion inter-factory neighborhood movement is as follows: randomly starting from the critical factory... f - Select a critical workpiece, and then, starting from the first operation, sequentially insert all operations of that workpiece into a non-critical plant. f + (owns the smallest) ) Best location Key components j Each process O j,s The optimal insertion position can be found using the formula above.
[0060] Indicates to Insert into the machine k Location Afterwards, through v The longest path length. At this point... f + of ,in It is a constant value, indicating the addition. Before the relevant workpiece arc and machine arc, f + The longest path length. Therefore, the current optimal insertion position is to make The minimum position. Based on the characteristics of the HFSP problem, insertion... back, , and Nothing has changed.
[0061] When inserting a current process into a candidate position on a parallel machine in the target factory, it is necessary to evaluate the impact of this insertion operation on the target factory's completion time. The formula above calculates the longest path length of the inserted process, which directly determines the target factory's completion time after insertion. The specific calculation process is as follows: First, obtain the processing time of the current process to be inserted. Second, determine two candidate preceding completion times: the first candidate is the sum of the head length of the preceding process on the machine where the insertion position is located and the processing time of that preceding process, representing the path length from the factory's starting process through the preceding process on the machine to the start time of the insertion position; the second candidate is the sum of the head length of the preceding process in the critical workpiece and the processing time of that preceding process, representing the path length from the factory's starting process through the preceding process of the same workpiece to the start time of the current process to be inserted. Take the maximum of these two candidate values as the path length corresponding to the earliest possible start time of the process to be inserted. Then, obtain the tail length of the following process on the machine where the insertion position is located, which represents the longest path length from the beginning of the following process to the end process of the factory. Finally, the processing time of the process to be inserted, the maximum of the two candidate values, and the tail length of the subsequent process are added together to obtain the longest path length through the inserted process. This calculation process fully utilizes the head and tail length information in the disjunctive graph model, enabling rapid evaluation of the impact of a single insertion operation on the target factory's completion time without reconstructing the entire scheduling scheme's Gantt chart. Simultaneously, it can complete the quality evaluation of a single candidate insertion position in constant time without re-decoding the entire scheduling scheme of the target factory or recalculating the head and tail lengths of all processes. This minimizes the computational overhead of each evaluation when traversing a large number of candidate insertion positions, thus supporting exhaustive traversal of all candidate positions on parallel machines. The above calculation method uses the longest path length through the inserted process as the evaluation index, directly reflecting the degree of impact of the insertion operation on the target factory's completion time, providing a precise and efficient quantitative basis for selecting the optimal insertion position, and ensuring the accuracy and computational efficiency of greedy workpiece insertion into the neighboring factory.
[0062] Furthermore, after updating the head length of the insertion-affected process in the target plant in step S400, the process further includes: Step S410: Determine whether the completion time of the target factory increases after inserting the current process to be inserted into the optimal insertion position.
[0063] After completing the insertion operation for the current process to be inserted and updating the head length of the affected process in the target plant, assess the impact of this insertion operation on the overall completion time of the target plant, and determine whether the completion time of the target plant increases after inserting the current process to be inserted into the optimal insertion position. Since the completion time of the target plant does not decrease after inserting the process, but only increases or remains unchanged, there are only two possibilities for this determination: the completion time increases, or the completion time remains unchanged.
[0064] Step S420: If the completion time of the target factory increases, then starting from the processing stage where the current process to be inserted is located, the critical blocks in each subsequent processing stage are updated sequentially. The critical blocks consist of processes that are continuously arranged on the same parallel machine and are all located on the critical path of the target factory.
[0065] If the assessment indicates an increase in the target plant's completion time, it means the currently inserted process is located on a newly formed critical path. The addition of this process alters the critical path's direction, potentially leading to changes in the distribution of critical blocks in subsequent processing stages. Starting from the processing stage where the currently inserted process resides, the critical blocks in each subsequent processing stage are updated sequentially. The definition of a critical block remains unchanged: a set of processes consecutively arranged on the same parallel machine and all located on the target plant's critical path. Since changes in the critical path typically begin with the newly inserted process and propagate to subsequent stages, it's unnecessary to update the critical blocks of all stages from scratch. Accurate critical block information can be obtained by updating only from the current stage. This selective update strategy avoids the overhead of globally recalculating critical blocks.
[0066] Step S430: If the completion time of the target factory does not increase, continue to use the critical block information before the update, and do not update the critical blocks in the target factory.
[0067] If the judgment result indicates that the completion time of the target factory has not increased, it means that the current process to be inserted is not located on the newly formed critical path, the original critical path of the target factory remains valid, and the sequence of processes on the critical path and the distribution of critical blocks on different machines have not changed substantially. In this case, the critical block information before the update is explicitly continued, and no update operation is performed on the critical blocks in the target factory. Since the critical block information is used to skip invalid positions when traversing candidate insertion positions later, keeping the existing information unchanged ensures the correctness of the pruning strategy and saves the computation time required to re-identify critical blocks.
[0068] Based on whether the completion time of the target factory increases after the insertion operation, the system adaptively decides whether to update the critical block information: only when the completion time increases, the critical blocks are updated from the current stage of the operation backwards; otherwise, the existing information is used. This selective update mechanism avoids globally recalculating the critical blocks after each insertion operation, significantly reducing computational redundancy while ensuring the accuracy of the critical block information, and further improving the overall efficiency of inter-factory neighborhood search.
[0069] Furthermore, before step S310 iterates through each candidate insertion position on each of all parallel machines involved in the processing phase, step S310 also includes: Step S311: Obtain the critical block information on each parallel machine during the processing stage. The critical blocks consist of processes that are continuously arranged on the same parallel machine and are all located on the critical path of the target factory.
[0070] Before traversing all candidate insertion positions on parallel machines within a processing stage, it is necessary to first obtain the critical block information for each parallel machine in that stage. A critical block is a group of processes that are consecutively arranged on the same parallel machine and all of which are located on the critical path of the target factory. Critical block information can be obtained by analyzing the current critical path of the target factory, specifically including whether a critical block exists on each machine, the range of processes occupied by the critical block, and the distribution of gaps between processes within the critical block, providing a basis for subsequently determining the machine retrieval order.
[0071] Step S312: Place parallel machines containing key blocks at the back of the retrieval order and place parallel machines without key blocks at the front of the retrieval order.
[0072] After obtaining the key block information for each parallel machine, the search order of the machines is rearranged, placing parallel machines containing key blocks at the end of the search order and those without key blocks at the beginning. Based on the properties of the disjunctive graph model, inserting the current process into a machine containing a key block will inevitably increase the completion time of the target factory if the insertion position is inside or adjacent to the beginning or end of the key block. However, inserting the process into a machine without a key block has a greater probability of finding an insertion position that does not increase the completion time, thus triggering the search termination line earlier. Therefore, prioritizing the search of machines without key blocks helps to find a satisfactory insertion position as quickly as possible during the traversal, thereby using the search termination line strategy to prune subsequent invalid traversals and improve overall search efficiency.
[0073] Step S313: Traverse the candidate insertion positions on each parallel machine in the order of retrieval.
[0074] After determining the search order of the machines, the candidate insertion positions on each parallel machine are traversed sequentially according to this order. Specifically, all parallel machines that do not contain the key block are traversed first, and each candidate insertion position is checked sequentially from left to right on these machines. After completing the traversal of all machines that do not contain the key block, the parallel machines that do contain the key block are then traversed. During the traversal, once an insertion position is found on a machine that does not increase the completion time of the target factory, the traversal of subsequent machines can be stopped or the traversal range can be limited according to the search termination line strategy. Through this search order arrangement, the probability and timeliness of the search termination line being triggered are significantly improved without sacrificing the quality of the optimal solution.
[0075] Before traversing candidate insertion positions, the retrieval order of machines is optimized based on whether each parallel machine contains a key block. Machines that do not contain key blocks are traversed first, enabling the algorithm to discover insertion positions that do not increase the completion time of the target factory earlier. This allows the pruning effect of the retrieval termination line strategy to be utilized more effectively, reduces the computational cost of invalid traversals on machines that contain key blocks, and further improves the search efficiency of inter-factory neighborhood movement.
[0076] Furthermore, after calculating the longest path length through the current insertion process after inserting it into each candidate insertion position in step S320, the process also includes: Step S323: Determine whether the calculated longest path length is greater than the completion time of the critical factory before this insertion operation.
[0077] After calculating the longest path length through which the current process to be inserted would be inserted to a candidate insertion position, it is determined whether this longest path length is greater than the original completion time of the critical plant before the current job move operation. This comparison essentially assesses whether the insertion of the current process will cause the target plant's completion time to exceed the original critical plant's completion time. If it does, it means that even if all processes for the entire critical job are inserted, the completion time of the new scheduling solution will not be better than the original scheduling solution, and may even be worse.
[0078] Step S324: If the value is greater than the value, immediately terminate the insertion operation of all remaining processes for the critical workpiece, restore the critical plant and the target plant to the scheduling state before the current insertion operation, end the current workpiece movement operation, and no longer execute the insertion operation of the remaining processes for the critical workpiece.
[0079] If the result indicates that the longest path length is greater than the critical factory's completion time before the current insertion operation, it means that the insertion of the current process has already caused the target factory's completion time to exceed the original critical factory's completion time. Continuing to insert the remaining processes of the critical workpiece will only further increase or maintain the target factory's completion time, offering no possibility of improving the current scheduling solution. Therefore, the insertion operation for all remaining processes of the critical workpiece should be terminated immediately, and the critical factory and target factory should be restored to their state before the current insertion operation. Simultaneously, the current workpiece movement operation should be ended, and the insertion operation for the remaining processes of the critical workpiece should not be executed. This early termination mechanism avoids continuing meaningless calculations when the solution quality is destined to be unimprovable, significantly saving computational resources.
[0080] Step S325: If it is not greater than, then continue to step S330.
[0081] If the determination result is that the longest path length is not greater than the completion time of the critical plant before the current insertion operation, it means that the current insertion operation has not caused the completion time of the target plant to exceed the completion time of the original critical plant. Continuing to insert subsequent operations still has the potential to obtain a scheduling scheme that is no worse than the original solution. In this case, the control flow continues to execute step S330 (i.e., selecting the candidate insertion position that minimizes the longest path length as the optimal insertion position and inserting the current insertion operation into that position), and then continues processing the next operation of the critical workpiece.
[0082] During the process of inserting each process step by step, the relationship between the longest path length after the current process insertion and the original completion time of the critical factory is monitored in real time. Once the threshold is exceeded, the entire workpiece movement is immediately terminated and the state is rolled back. This avoids consuming computation time on invalid neighborhood movements that cannot improve the solution quality, significantly improving the overall efficiency of the greedy workpiece insertion neighborhood search between factories, while ensuring that the algorithm always explores in directions that can improve the solution quality.
[0083] Furthermore, in step S340, updating the head length of all subsequent processes in the target factory whose head length has changed due to the insertion of the current insertion process on the machine at the optimal insertion position includes: Step S341: Take the current process to be inserted on the machine where the optimal insertion position is located as the starting process.
[0084] After the current operation to be inserted is placed at the optimal insertion position, the head length of all subsequent operations on the machine starting from that insertion position may change. Taking the current operation to be inserted on the machine with the optimal insertion position as the starting point, that is, considering it as the starting point for head length updates, is appropriate. Since the current operation to be inserted is newly inserted, its head length has already been determined during the insertion process, while the head lengths of its subsequent operations need to be recalculated based on the head length of the current operation to be inserted. Therefore, using the current operation to be inserted as the starting point aligns with the backward propagation update logic of head length.
[0085] Step S342: Select each subsequent process as the current process to be updated in the order from the starting process to the end of the process sequence already arranged on the machine.
[0086] After determining the starting process, each subsequent process is selected as the current process to be updated, following the order from the starting process to the end of the process sequence already arranged on the machine. This order refers to the sequential processing order of the processes on the machine, starting from the first process after the current process to be inserted and proceeding sequentially until the last process in the sequence. This order ensures that the head length update process can be passed from front to back, with the new head length of each process depending on the new head length of its preceding process, thus ensuring the correctness of the update result.
[0087] Step S343: Obtain the sum of the head length and processing time of the previous process on the machine for the current process to be updated, and use it as the first candidate value.
[0088] For each current process to be updated, two candidate values need to be calculated to determine its new head length. First, the first candidate value is obtained: the sum of the head length of the preceding process on the machine and the processing time of that preceding process. The head length of the preceding process represents the longest path length from the factory's starting process to that preceding process. Adding its processing time gives the path length from the end of the preceding process to the start of the current process to be updated. This candidate value reflects the influence of the preceding process on the head length of the current process to be updated.
[0089] Step S344: Obtain the sum of the head length and processing time of the previous process in the workpiece corresponding to the current process to be updated, and use it as the second candidate value. If the current process to be updated is the first process of the workpiece, then set the second candidate value to zero.
[0090] The second candidate value is obtained, which is the sum of the head length of the previous process in the workpiece corresponding to the current process to be updated and the processing time of that previous process. The previous process refers to the process processed before the current process in the same workpiece. Its head length plus processing time represents the path length from the starting process in the factory, through the previous process of the same workpiece, to the start time of the current process. In the boundary case where the current process to be updated is the first process of its workpiece, since there is no previous process in the workpiece, the second candidate value is set to zero.
[0091] Step S345: Take the maximum value between the first candidate value and the second candidate value as the new head length of the current process to be updated.
[0092] After obtaining the first and second candidate values, the maximum value between them is taken as the new head length of the current process to be updated. This operation of taking the maximum value reflects the definition of head length in the disjunctive graph model: the longest path length from the starting process in the factory to this process is equal to the maximum value among all possible paths. The path passed by the previous process on the machine and the path passed by the previous process on the same workpiece are two main candidate paths. Taking the larger value between the two yields the accurate head length of the current process to be updated.
[0093] Step S346: Repeat steps S342 to S345 until the head length of all subsequent processes affected by the insertion on the machine is updated.
[0094] Starting with the first subsequent operation after the initial operation, steps S342 to S345 are executed sequentially for each subsequent operation until the head length of all subsequent operations affected by the insertion on the machine has been updated. Since the change in head length only occurs after the insertion position, and the update process only needs to propagate backward along the operation sequence on the machine once, this loop can be completed in a finite number of steps without repeated iterations.
[0095] The aforementioned incremental calculation method for accurately updating the head length within a local range calculates the maximum value of two candidate paths as the new head length only for the affected subsequent processes on the machine where the insertion position is located, and correctly handles the boundary conditions of the first process. Thus, without recalculating the head length of all processes in the entire plant, it efficiently and accurately maintains the key information of the scheduling solution, providing a reliable data foundation for calculating the optimal insertion position and evaluating the completion time of subsequent processes.
[0096] Furthermore, after obtaining the new scheduling solution in step S500, the process also includes: Step S510: Obtain the head length of all processes in the last processing stage of the target factory. The head length represents the longest path length from the starting process of the target factory to each process.
[0097] After completing a greedy job insertion into the inter-factory neighborhood and obtaining a new scheduling solution, the head length of all operations within the last processing stage of the target factory is first obtained. The head length is defined as the longest path length from the starting operation in the factory to each subsequent operation, reflecting the earliest possible start time of that operation within the factory (cumulative path length). In a distributed hybrid flow shop, the last processing stage of each factory is the final stage where job processing is completed, and the completion time of each operation within this stage directly determines the overall completion time of the factory. Therefore, only the head length information of the last stage is needed to calculate the factory's completion time, without traversing all operations across all stages.
[0098] Step S520: Calculate the completion time of the target factory based on the head length of all processes in the last processing stage of the target factory.
[0099] After obtaining the head lengths of all processes within the final processing stage of the target factory, the completion time of the target factory is calculated based on these head lengths. Since the completion time of each process in the final processing stage is the sum of its head length and its processing time, and the completion time of the target factory is equal to the maximum value of the completion times of all processes in the final processing stage, the completion time of the target factory can be obtained by iterating through the sum of the head lengths and corresponding processing times of all processes in the final processing stage and taking the maximum value. This utilizes the property of head length as the longest path length, avoiding the need to re-decode the entire factory's scheduling scheme or recalculate the start times of all processes from scratch.
[0100] Step S530: Obtain the head length of all processes in the last processing stage of the critical plant and calculate the completion time of the critical plant.
[0101] Obtain the head lengths of all operations within the last processing stage of the critical plant, and calculate the completion time of the critical plant in the same manner as in step S520. Since the critical workpiece has been removed from the critical plant, the scheduling structure of the critical plant has changed, and the head length information of its last processing stage has been updated in the aforementioned step S400. Therefore, the new completion time of the critical plant can be accurately calculated directly using the updated head lengths. By calculating the completion times of the target plant and the critical plant separately, the performance indicators of the two critical plants in the new scheduling solution are obtained.
[0102] Step S540: Take the maximum value between the completion time of the target plant and the completion time of the critical plant as the completion time of the new scheduling solution.
[0103] After obtaining the completion times of the target factory and the critical factory, the maximum of the two is taken as the completion time of the new scheduling solution. Since the overall completion time of the distributed hybrid flow shop is defined as the maximum of all factory completion times, and the critical factory is the factory with the highest completion time in the original scheduling solution, while the target factory is the factory with the lowest completion time, after the critical workpiece is moved, the global completion time of the new scheduling solution must be equal to the larger of the target factory's completion time and the critical factory's completion time. By taking the maximum of the two, there is no need to calculate the completion times of other non-critical factories (because the completion times of these factories did not change during this neighborhood move, and their values will not exceed the maximum of the two mentioned above), thus obtaining the global completion time of the new scheduling solution with minimal computational overhead.
[0104] By utilizing the head lengths of all operations within the last processing stage of the target and critical plants, the completion time of the new scheduling solution can be quickly calculated without re-decoding or recalculating all stages across all plants. Compared to the time complexity of global re-decoding (which is a polynomial relationship with the number of jobs, processing stages, and plants), this method reduces the computational complexity to a linear relationship with the number of operations in the last stage, significantly improving the efficiency of neighborhood solution quality evaluation. This allows the greedy job insertion neighborhood search between plants to evaluate more candidate solutions within the same timeframe, thereby improving overall optimization performance.
[0105] 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 distributed hybrid flow shop scheduling optimization method based on greedy workpiece insertion.
[0106] 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 distributed hybrid flow shop scheduling optimization method based on greedy workpiece insertion.
[0107] The embodiments of this invention aim to protect a distributed hybrid flow shop scheduling optimization method based on greedy workpiece insertion, which has the following effects: 1. By traversing the candidate insertion positions on all parallel machines in each processing stage of the target factory step by step, starting from the first process of the critical workpiece, and selecting the position that minimizes the length of the longest path through the process, and only locally updating the length of the subsequent process head on the affected machine after insertion, this invention achieves precise perturbation of the critical path and incremental maintenance of scheduling information at the solution space level. This fundamentally overcomes the technical defects of existing coding spaces, which require global re-decoding after the overall movement of the workpiece, resulting in coarse neighborhood movement and low accuracy. It significantly improves the precision of neighborhood search between factories.
[0108] 2. By stopping the invalid traversal on the right side and passing the index of that position to subsequent machines to only search the left position range after finding the first insertion position on the same machine that does not increase the completion time of the target factory, and combining the identification and skipping of candidate insertion position intervals occupied by key blocks, optimizing the machine search order according to whether key blocks are included, and immediately terminating the entire workpiece movement and rolling back when the longest path length after the insertion process exceeds the original completion time of the key factory, this invention systematically reduces a large amount of invalid calculations and greatly improves the computational efficiency of inter-factory neighborhood search.
[0109] 3. By rapidly calculating the completion time using only the head length of all processes in the last processing stage of the target plant and the critical plant, the global re-decoding is avoided, reducing the time complexity of neighborhood solution evaluation from a cubic polynomial to a linear level. Combined with two-level variable neighborhood search, which alternates between and within plants for refined search, this invention significantly shortens the optimization time while ensuring the quality of the scheduling solution, providing an efficient and accurate solution method for the distributed hybrid flow shop scheduling problem.
[0110] 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.
[0111] 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.
[0112] 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.
[0113] 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.
[0114] 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 scope of protection of the claims of the present invention.
Claims
1. A distributed hybrid flow shop scheduling optimization method based on greedy workpiece insertion, characterized in that, Includes the following steps: Step S100: Obtain the current scheduling solution, which includes the workpiece allocation scheme of each factory, the processing order of the processes in each processing stage in each factory on the parallel machine, and the processing time of each process. Identify the factory with the longest completion time in the current scheduling solution as the key factory, and identify the workpieces containing key processes in the key factory as key workpieces. Step S200: Select the factory with the shortest completion time from all factories except the key factory as the target factory; Step S300: Starting from the first process of the key workpiece, each process of the key workpiece is sequentially inserted into the optimal insertion position of the processing stage corresponding to that process in the target factory. The optimal insertion position is the position that minimizes the longest path length through that process after insertion. Step S400: After completing the insertion of all processes of the critical workpiece, update the head length of the processes affected by the insertion in the target plant, and update the head length of the processes affected by the removal of the critical workpiece in the critical plant to obtain a new scheduling solution.
2. The distributed hybrid flow shop scheduling optimization method based on greedy workpiece insertion according to claim 1, characterized in that, The step of sequentially inserting each process of the critical workpiece into the optimal insertion position of the corresponding processing stage in the target factory, starting from the first process of the critical workpiece, includes: Step S310: Determine the processes that have not yet been inserted in the key workpiece as the current processes to be inserted in order from the first process to the last process, and determine the processing stage corresponding to the current processes to be inserted in the target factory; Step S320: On all parallel machines included in the processing stage, traverse each candidate insertion position on each parallel machine, the candidate insertion position including the gap between the already arranged operations on the parallel machine and the end of the already arranged operation sequence on the parallel machine, and calculate the longest path length through the current operation to be inserted into each candidate insertion position. Step S330: Select the candidate insertion position that minimizes the longest path length as the optimal insertion position, and insert the current process to be inserted into the optimal insertion position; Step S340: Update the head length of all subsequent processes in the target factory that have changed their head length due to the insertion of the current process to be inserted on the machine at the optimal insertion position. For each subsequent process, the head length is the longest path length from the starting process in the factory to the subsequent process. Step S350: Take the next process of the critical workpiece as the new current process to be inserted, and repeat steps S310 to S340 until all processes of the critical workpiece have been inserted into the target factory.
3. The distributed hybrid flow shop scheduling optimization method based on greedy workpiece insertion according to claim 2, characterized in that, The step of traversing each candidate insertion position on each of all parallel machines included in the processing stage includes: Step S321a: On the same parallel machine, in the order from the beginning to the end of the process sequence arranged on the parallel machine, select each candidate insertion position in turn and calculate the longest path length through the current process to be inserted after inserting the current process to be inserted into the candidate insertion position. Step S321b: When the longest path length corresponding to a candidate insertion position is calculated for the first time and does not increase the completion time of the target factory, the candidate insertion position is set as the retrieval termination line; Step S321c: Stop traversing the remaining candidate insertion positions located to the right of the retrieval termination line on the same parallel machine, and switch to the next parallel machine; Step S321d: On the next parallel machine, traverse the candidate insertion positions only within the range of positions to the left of the retrieval termination line.
4. The distributed hybrid flow shop scheduling optimization method based on greedy workpiece insertion according to claim 2, characterized in that, The step of traversing each candidate insertion position on each of all parallel machines included in the processing stage includes: Step S322a: Determine whether there is a critical block on the currently traversed parallel machine. The critical block consists of processes that are continuously arranged on the parallel machine and are all located on the critical path of the target factory. The critical path is the longest path from the starting process to the ending process in the target factory. Step S322b: When a key block exists on the currently traversed parallel machine, identify the candidate insertion position interval occupied by the key block. The candidate insertion position interval includes the gap between all adjacent processes within the key block and the gap before the first process and after the last process of the key block. Step S322c: When traversing the candidate insertion positions on the currently traversed parallel machine, skip all candidate insertion positions within the candidate insertion position interval and do not calculate the longest path length for the candidate insertion positions within the candidate insertion position interval.
5. The distributed hybrid flow shop scheduling optimization method based on greedy workpiece insertion according to claim 2, characterized in that, The formula for calculating the longest path length in step S320 is as follows: ; in, To make the process Insert into the machine k Location The longest path length through this process. For key components j The s One process, Number the parallel machines in the target factory. For machines k The first i Insertion positions, This represents the processing time for the current process to be inserted. This refers to the head length of the preceding process on the machine immediately preceding the candidate insertion position. For the target factory, on a parallel machine, immediately adjacent to the insertion position The processing time of the previous process. For key components j The s -1 process head length, For key components j The s - Processing time for one step This is the tail length of the next process on the machine immediately following the candidate insertion position. For the target factory, on a parallel machine, immediately adjacent to the insertion position The processing time of the next step.
6. The distributed hybrid flow shop scheduling optimization method based on greedy workpiece insertion according to claim 2, characterized in that, After updating the head length of the insertion-affected process in the target plant, the method further includes: Step S410: Determine whether the completion time of the target factory increases after inserting the current process to be inserted into the optimal insertion position; Step S420: If the completion time of the target factory increases, then starting from the processing stage where the current process to be inserted is located, the critical blocks in each subsequent processing stage are updated sequentially. The critical blocks are composed of processes that are continuously arranged on the same parallel machine and are all located on the critical path of the target factory. Step S430: If the completion time of the target factory does not increase, the key block information before the update is used and the key blocks in the target factory are not updated.
7. The distributed hybrid flow shop scheduling optimization method based on greedy workpiece insertion according to claim 2, characterized in that, Before traversing each candidate insertion position on each of the parallel machines included in the processing stage, the process further includes: Step S311: Obtain the key block information on each parallel machine in the processing stage. The key block consists of processes that are continuously arranged on the same parallel machine and are all located on the critical path of the target factory. Step S312: Place parallel machines containing key blocks at the back of the retrieval order and place parallel machines without key blocks at the front of the retrieval order. Step S313: Traverse the candidate insertion positions on each parallel machine in the order of retrieval.
8. The distributed hybrid flow shop scheduling optimization method based on greedy workpiece insertion according to claim 2, characterized in that, The calculation of the longest path length through the current insertion procedure after inserting it into each candidate insertion position also includes: Step S323: Determine whether the calculated longest path length is greater than the completion time of the critical factory before this insertion operation; Step S324: If it is greater than, then immediately terminate the insertion operation of all remaining processes of the key workpiece, restore the key factory and the target factory to the scheduling state before the current insertion operation, end the current workpiece movement operation, and no longer execute the insertion operation of the remaining processes of the key workpiece. Step S325: If it is not greater than, then continue to execute step S330.
9. The distributed hybrid flow shop scheduling optimization method based on greedy workpiece insertion according to claim 2, characterized in that, The updating of the head length of all subsequent processes in the target factory whose head length has changed due to the insertion of the current insertion process on the machine at the optimal insertion position includes: Step S341: Take the current insertion process on the machine where the optimal insertion position is located as the starting process; Step S342: Select each subsequent process as the current process to be updated in the order from the starting process to the end of the process sequence arranged on the machine; Step S343: Obtain the sum of the head length and processing time of the previous process on the machine for the current process to be updated, as the first candidate value; Step S344: Obtain the sum of the head length and processing time of the previous process in the workpiece corresponding to the current process to be updated, as the second candidate value. If the current process to be updated is the first process of the workpiece, then set the second candidate value to zero. Step S345: Take the maximum value between the first candidate value and the second candidate value as the new head length of the current process to be updated; Step S346: Repeat steps S342 to S345 until the head length of all subsequent processes affected by the insertion on the machine is updated.
10. The distributed hybrid flow shop scheduling optimization method based on greedy workpiece insertion according to any one of claims 1-9, characterized in that, After obtaining the new scheduling solution, the process also includes: Step S510: Obtain the head length of all processes in the last processing stage of the target factory, where the head length represents the longest path length from the starting process of the target factory to each process. Step S520: Calculate the completion time of the target factory based on the head length of all processes in the last processing stage of the target factory; Step S530: Obtain the head length of all processes in the last processing stage of the critical plant, and calculate the completion time of the critical plant; Step S540: Take the maximum value between the completion time of the target factory and the completion time of the critical factory as the completion time of the new scheduling solution.