Let me make a statement first: The article is copied and pasted directly from the push in my personal official account. Therefore, friends who are interested in intelligent optimization algorithms can follow my personal official account: Heuristic Algorithm Discussion . I will share different intelligent optimization algorithms in the public account from time to time, classic ones, or new intelligent optimization algorithms proposed in recent years, with MATLAB codes attached.
Main reference materials for this issue:
[1] Pan Quanke, Gao Liang, Li Xinyu. Flow shop scheduling and its optimization algorithm[M]. Wuhan: Huazhong University of Science and Technology Press, 2013.
Machines are not allowed to stall, which is known as the zero-idle scheduling problem. Figure 1(a) shows a Gantt chart of a 3×3 zero-idle flow shop scheduling problem. Due to the continuous operation requirements of the machine, when the first workpiece arrives at machine 2, the machine cannot start immediately. Compared with the replacement flow shop scheduling shown in Figure 1(b), the start-up time of machine 2 lags behind. Therefore, the zero-idle flow shop scheduling problem is different from the general replacement flow shop scheduling problem.
figure 1
01Problem
description
Here we mainly consider the zero-idle flow-shop scheduling problem (NIFSP) with the maximum completion time as the optimization goal, which is recorded as F m | perm, no - idle | C max. When m≥3, this type of scheduling problem is an NP -Hard problem.
F m | perm, no - idle | C max The problem can be described as: There are n workpieces processed on m machines according to the same process route . It is agreed that the processing order of the workpieces on all machines is the same, and it is required to process them on the same machine. There is no idle time between two adjacent workpieces. Assuming there is an infinite buffer zone between machines, one workpiece cannot be processed by multiple machines at the same time, nor can one machine process multiple workpieces at the same time. The processing time of the workpiece on each machine is known. The problem is how to arrange the production sequence of each workpiece to minimize the maximum completion time.
02Mathematical
model
(The following content is excerpted from the reference book mentioned at the beginning of the tweet, Teacher Pan’s book.)
03
Calculation of processing performance indicators
Maximum completion time ( C max) is the most commonly used processing performance index to study zero-idle flow shop scheduling problems. There are five calculation methods for the maximum completion time of NIFSP, and their time complexity is all O ( nm ).
Method 1: Calculate the start-up time difference between machines
Method 2: Kalezynski and Kamburowski method (converted to F 2 | perm | C max)
Method 3: Forward calculation method
Method 4: Reverse calculation method
Method 5: Two-way calculation method
Here we mainly introduce the forward calculation method. (The following content is taken from the reference book mentioned at the beginning of the tweet, the book by Teacher Pan.) Other calculation methods can also be consulted in this book. The forward calculation method is chosen to facilitate the drawing of Gantt charts.
04Intelligent
algorithm (GA, DBO, etc.) coding method
For genetic algorithms (GA), because the algorithm itself is discrete, the next generation is generated through selection, crossover, and mutation. Therefore, a chromosome represents a scheduling scheme. That is, the ordering of artifacts is its individual coding. For example, for a sorting scheme of 10 artifacts, using MATLAB to initialize one individual (one chromosome) of GA is:
x=randperm(10);
The effect is as follows:
However, for particle swarm optimization (PSO), sparrow search algorithm (SSA), dung beetle optimization (DBO), etc., they themselves are proposed for continuous optimization problems, so they require further processing during coding. Like GA, a scheduling plan (workpiece sequencing) represents an individual, and the SPV rule can be used to convert the real number encoding into an integer encoding. For example, for a sorting scheme of 10 artifacts, using MATLAB to initialize an individual (one chromosome) of DBO is:
jobNum=10; % 工件数
x=unifrnd(0,1,[1 jobNum]); % 产生10个[0,1]之间随机数
os = 1:1:jobNum; % 产生从1到10的数列
[~, up_index] = sort(x); % 对x进行降序排序, 得到位置序列
x = os(up_index); % 按照位置序列排序工件, 得到一个调度方案
The effect is as follows:
In addition, contrary to the SPV rule, Li et al. proposed the largest rank value (LRV) method, which is also one of the commonly used methods to map continuous values into discrete arrangements. As shown in Figure 2, LRV generates a set of artifact rankings by arranging a set of continuous values representing population individuals in descending order. (Reference: [2] LI X, YIN M. An opposition-based differential evolution algorithm for permutation flow shop scheduling based on diversity measure [J]. Advances in Engineering Software, 2013, 55(8): 10-31.)
Figure 2 Representation method of maximum ranking value method
05Numerical
experiment
Here, a simple test is conducted on the effect of DBO in solving NIFSP, and Rec (21) is selected as a scheduling problem example. The maximum number of iterations T is set to 2000, and the population size NP is set to 60. The results shown below are the results obtained by running the algorithm randomly once.
First, take Rec05 (20 workpieces × 5 machines) as an example to show the solution results of DBO running once randomly. Figure 3 plots the optimal fitness convergence curve and average fitness convergence curve of the population for each generation:
Figure 3 Convergence curve of DBO-NIFSP for Rec05
Figure 4 plots the Gantt chart of the scheduling results:
Figure 4 DBO-NIFSP Gantt chart for Rec05
Secondly, taking Rec11 (20 workpieces × 10 machines) as an example, the solution results of DBO running once randomly are shown, as shown in Figures 5 and 6.
Figure 5 Convergence curve of DBO-NIFSP for Rec11
Figure 6 Gantt chart of DBO-NIFSP for Rec11
Finally, taking Rec41 (75 workpieces × 20 machines) as an example, the solution results of DBO running once randomly are shown, as shown in Figures 7 and 8.
Figure 7 Convergence curve of DBO-NIFSP for Rec41
Figure 8 Gantt chart of DBO-NIFSP for Rec41
06
MATLAB code
The MATLAB code of intelligent algorithms (GA, PSO, DE, GWO, SSA, DBO, etc.) to solve the no-idle flow-shop scheduling problem (NIFSP), where: main.m is the main function, run directly That’s it; the .m algorithm code named after the algorithm abbreviation; gantt_chart.m is used to draw the Gantt chart; objective.m is the objective function, which is to calculate Makespan; method.pdf is used to explain the calculation method of Makespan, and the code uses the previous Directional calculation method; Car.xlsx and Rec.xlsx are two classic test sets for flow shop scheduling.
The output results include Makespan, workpiece sorting, calculation time, optimal fitness convergence curve, average fitness convergence curve, and Gantt chart.
The blogger selected ten algorithms to solve NIFSP. Mainly several classic algorithms and several highly cited algorithms in recent years. The corresponding MATLAB code link is as follows:
Genetic algorithm (GA) solves NIFSP | |
Differential evolution (DE) solves NIFSP | Follow the public account, there are links |
Particle Swarm Optimization (PSO) solves NIFSP | Follow the public account, there are links |
Gray Wolf Optimization (GWO) solves NIFSP | Follow the public account, there are links |
Whale Optimization Algorithm (WOA) solves NIFSP | Follow the public account, there are links |
Harris Hawk Optimization (HHO) solves NIFSP | Follow the public account, there are links |
Sparrow Search Algorithm (SSA) solves NIFSP | Follow the public account, there are links |
African Vulture Optimization Algorithm (AVOA) solves NIFSP | Follow the public account, there are links |
Dung beetle optimization (DBO) solves NIFSP | Follow the public account, there are links |
Star Crow Optimization Algorithm (NOA) solves NIFSP | Follow the public account, there are links |
The above ten intelligent optimization algorithms (GA, DE, PSO, GWO, WOA, HHO, SSA, AVOA, DBO, NOA) solve the NIFSP family bucket | Follow the public account, there are links |
You can download the code list through the link below, find the required algorithm code in it, and then go to the corresponding link to obtain it. The list will be updated simultaneously, and once new code is available, it can be found in the list. Some of the codes in the list are obtained from open source. Available for free download at any time.
Link: https://pan.baidu.com/s/1SFDMplrL7tiqGZlrpOSGYg
Extraction code: 8023
In addition, you are welcome to join the algorithm communication group for communication: 912369858