Dung beetle optimization (DBO) solves the permutation flow shop scheduling problem (PFSP)

Let me make a statement first: The article is directly copied and pasted from the push in my personal official account, so friends who are interested in intelligent optimization algorithms can follow my personal official account: < a i=1>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.

The workshop scheduling problem comes from the actual workshop production process. According to the different processing processes, it can be roughly divided into: single machine scheduling problem (Single machine scheduling problem, SMSP), parallel machine scheduling problem (Parallel machines scheduling problem, PMSP), flow workshop scheduling problem ( Flow-shop scheduling problem (FSP), Job-shop scheduling problem (JSP) and Open-shop scheduling problem (OSP). Among them, the flow-shop scheduling problem (FSP) is the most common scheduling model in the actual production process and is widely used in transportation, logistics, workshop production and other fields. Methods for solving FSP are mainly divided into three categories: exact algorithms, heuristic algorithms and intelligent optimization algorithms. Different algorithms are often used when dealing with problems of different sizes. For example, exact algorithms are only used to solve smaller problems due to their high time complexity. The advantage of heuristic algorithms is that they can solve problems quickly, but the solutions they obtain are often poor. Therefore, most current intelligent optimization algorithms are used to solve flow shop scheduling problems.

Research shows that nearly a quarter of manufacturing, assembly, service or information processing facilities can be considered flow shops. It has been proved that when the number of machinesm>2, the flow shop scheduling problem is a strongNPijm< /span>j, the FSP scheduling task is to determine the processing sequence of each workpiece, and its goal is to minimize the maximum completion time. m =h) represents its processing time. The FSP problem with fixed allocation of machine tools is a general flow shop scheduling problem. Each process is uniquely assigned to be processed on one machine tool, and the machine tool cannot be selected, that is, m =1,...,k,h=1,.,,n=1,..,i(ijkp), =1,...,k(kM is designated on the machine tool ijO. h=1,…,j,ui), whereujO)=Machine(O have the same processing path, that is, Machine(h workpiece the n workpiece, j process of the j The i means the ijO processes, and each process is assigned to a different machine tool for processing. h machine tools , each workpiece containsm workpieces are processed on n-hard problem. Due to its importance in academic and engineering applications, it has received extensive attention and research. FSP is generally described as:

The FSP assumptions are as follows:

(1) All workpieces are ready at zero time, and the processing time of the workpieces on the machine is determined;

(2) The processing path of each workpiece is the same and no change is allowed;

(3) At each moment, each machine tool can only process one process, and the process is not allowed to be interrupted;

(4) A workpiece cannot be processed on different machine tools at the same time;

(5) The preparation time of the process is ignored or included in the processing time, and the buffer zone between machines is large enough

01
Questions and Answers

Permutation flow-shop scheduling problem (PFSP) is a simplified model of flow shop scheduling problem (FSP), usually described as n< a i=2>workpiecesJ={1,...,n} is processed on m machines M={1,...,m). The processing sequence of each workpiece on each machine is the same. Given artifacti(iJ) in the machinej(j< a i=18>∈M) processing timepij< /span>max is the minimum or the total flow time is the minimum. C, the goal is to find a workpiece processing sequence to optimize a certain scheduling goal. The commonly used scheduling goal is the maximum completion time

The assumptions of PFSP are as follows:

(1) All workpieces are ready at zero time, and the processing time of the workpieces on the machine is determined;

(2) The processing path of each workpiece is the same and no change is allowed;

(3) At each moment, each machine tool can only process one process, and the process is not allowed to be interrupted;

(4) A workpiece cannot be processed on different machine tools at the same time;

(5) The preparation time of the process is ignored or included in the processing time;

(6) Job preemption is not allowed, that is, once the workpiece is processed on each machine, it cannot be interrupted, and the workpiece processing sequence is consistent on all machines.

It can be found that the essential difference between PFSP and FSP is that PFSP requires each workpiece to be processed in the same order on each machine, as shown in Figure 1. In this way, it can be seen that for nworkpieces, m machines , the solution space scale of the general flow shop scheduling problem (FSP) is (n!)^m, while the solution space scale of the permutation flow shop scheduling problem (PFSP) is n!. Although the size of the solution space of PFSP is much smaller than that of FSP, it has been proven that PFSP with m≥3 is an NP-hard problem.

picture

Figure 1 Example of PFSP Gantt chart for 11 workpieces × 5 machines, all workpiecesJi The processing sequence is consistent on every machine

02
Problem model

As with previous push releases, it is not convenient to edit mathematical formulas in the official account. Therefore, this part of the content is imported as an image. The picture is taken from a doctoral thesis:

[1] Liu Yanfeng. Several intelligent algorithms for permutation flow shop scheduling problems [D]. Xi'an University of Electronic Science and Technology, 2013.

picture

03
编码解码

PFSP is to solve the processing sequencing problem of a set of workpieces, that is, it is a combinatorial optimization problem and belongs to discrete optimization. The dung beetle optimization (DBO) algorithm itself is proposed for continuous optimization problems, so it is necessary to design the encoding and decoding methods of candidate solutions.

The largest rank value (LRV) method proposed by Li et al. is one of the commonly used methods to map continuous values ​​into discrete arrangements. Therefore, this paper uses LRV rules to map a set of continuous priority values ​​representing candidate solution individuals in the DBO population into discrete artifact sorting. As shown in Figure 2, LRV arranges a set of continuous values ​​representing population individuals in descending order to generate a set of Artifact sorting. (References: [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.)

picture

Figure 2 Representation method of maximum ranking value method

04
DBO solution PFSP process

For an introduction to the DBO algorithm, you can read the previous push and will not go into details here.

Dung beetle optimization (DBO) algorithm (including MATLAB code)

5 latest variants of the dung beetle optimization (DBO) algorithm (including MATLAB code)

Figure 3 shows the calculation process of DBO solving PFSP:

picture

Figure 3 DBO solution PFSP flow chart

In Figure 3, iter represents the current number of iterations, and T represents the maximum number of iterations.


05
Numerical Experiment

 

Conduct a simple test on the effect of DBO in solving PFSP. Car (8) and Rec (21) are selected as scheduling problem examples. The maximum number of iterationsT is set to 2000, and the population sizeNP is set to 60 . The results shown below are the results obtained by running the algorithm randomly once.

First, taking Car2 (13 workpieces × 4 machines) as an example, Figure 4 plots the optimal fitness convergence curve and the average fitness convergence curve of each generation of the population:

picture

Figure 4 DBO convergence curve for Car2

Figure 5 plots the Gantt chart of the scheduling results:

picture

Figure 5 DBO’s Gantt chart for Car2

Secondly, taking Rec11 (20 workpieces × 10 machines) as an example, the solution results of DBO running once randomly are shown, as shown in Figures 6 and 7.

picture

Figure 6 DBO convergence curve for Rec11

picture

Figure 7 DBO’s Gantt chart 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 8 and 9.

picture

Figure 8 DBO convergence curve for Rec41

picture

Figure 9 DBO’s Gantt chart for Rec41

06
MATLAB Daigo

The MATLAB code of dung beetle optimization (DBO) algorithm to solve the permutation flow-shop scheduling problem (PFSP),where: main.m is the main function, Just run it directly; DBO.m is the code of the algorithm; color_selection is used to obtain the color configuration of the Gantt chart; gantt_chart.m draws the Gantt chart; objective.m is the objective function, which is to calculate Makespan; sorting.m is calculated according to the scheduling plan The processing information (start time, end time, workpiece number, machine number) of each machine at any time is used to draw a Gantt chart; scheduling examples include Car (8) and Rec (21).

The output results includeMakespan, workpiece sorting, calculation time, optimal fitness convergence curve, average fitness convergence curve, and Gantt chart.

main.m main function is as follows:

%%% 蜣螂优化(DBO)算法求解置换流水车间调度问题(PFSP) %%%
%%% 算法参考文献:Xue J, Shen B. Dung beetle optimizer: a new meta-heuristic algorithm %%%
%%% for global optimization[J]. The Journal of Supercomputing, 2022: 1-32. %%%
%% By 后会无期 %%
%% 2023.10.16 %%
%% 微信公众号:启发式算法讨论
%% 严格按照DBO的原始参考文献编,PFSP测试集采用Car与Rec算例(自行替换)

clear
clc

%% 数据加载
% 采用Car或Rec测试集, 自行选择测试集和实例
% Car测试集实例: Car1, Car2, Car3, Car4, Car5, Car6, Car7, Car8
% Rec测试集实例: Rec01, Rec03, Rec05, Rec07, Rec09, Rec11, ... ,Rec41
jobInfo=readmatrix('Rec.xlsx','Sheet','Rec41');  % jobInfo: 加工时间信息
jobNum=size(jobInfo,1);                          % jobNum: 工件数量
machineNum=size(jobInfo,2);                      % machineNum: 机器数量

%% 算法参数:种群数量,迭代次数
NP=60;      % 种群规模, 注意: DBO的种群规模需要设置为30的倍数
MaxIt=2000; % 最大迭代次数

tic % 计时开始
[Best_score,Best_pos,curve]=DBO(machineNum,jobNum,jobInfo,NP,MaxIt);
toc % 计时结束

disp(['Number of jobs: ',num2str(jobNum)]);              % 显示工件数
disp(['Number of machines: ',num2str(machineNum)]);      % 显示机器数
disp(['The optimal solution is: ',num2str(Best_pos)]);   % 显示最优解, 即全局最优的工件排序
disp(['The best fitness is: ',num2str(Best_score)]);     % 显示最优值, 即最小化最大完工时间

%% 绘制迭代曲线
f1=figure(1);
% 设置图片在屏幕上的位置: 显示器左下角的右侧280像素和上方400像素处
f1.Position(1:2)=[280 400];
T=1:1:MaxIt;
plot(T,curve.min,'r-','LineWidth', 2);
hold on
plot(T,curve.avg,'b-','LineWidth', 2);
grid on;
legend('Best fitness','Average fitness');
title('Convergence curves of Makespan');
xlabel('Iterations');
ylabel('Makespan');

%% 绘制甘特图
% machine_table包含每台机器任意时刻的加工信息(开始时间,结束时间,工件号,机器号)
machine_table=sorting(Best_pos,machineNum,jobNum,jobInfo); % 调用"sorting"子函数, 获得machine_table, 用于画甘特图

f2=figure(2);
% 设置图片在屏幕上的位置: 显示器左下角的右侧850像素和上方400像素处
f2.Position(1:2)=[850 400];
gantt_chart(machine_table); % 调用"gantt_chart"子函数获得配色方案, 绘制出甘特图
title('DBO for PFSP');
xlabel('Time');
ylabel('Machine number');

In addition, nine classic algorithms for solving PFSP and several highly cited algorithms in recent years were selected. The corresponding MATLAB code link is as follows:

Genetic algorithm (GA) solves PFSP

Follow the public account, there are links

Differential evolution (DE) solves PFSP Follow the public account, there are links
Particle Swarm Optimization (PSO) solves PFSP Follow the public account, there are links
Gray Wolf Optimization (GWO) solves PFSP Follow the public account, there are links
Whale Optimization Algorithm (WOA) solves PFSP Follow the public account, there are links
Harris Hawk Optimization (HHO) solves PFSP Follow the public account, there are links
Sparrow Search Algorithm (SSA) solves PFSP Follow the public account, there are links
African Vulture Optimization Algorithm (AVOA) solves PFSP Follow the public account, there are links
Dung beetle optimization (DBO) solves PFSP Follow the public account, there are links
Star Crow Optimization Algorithm (NOA) solves PFSP 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 family bucket of PFSP Follow the public account, there are links

Public account: Heuristic algorithm discussion

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

(Some codes have been updated recently, but I don’t have time to push them one by one. You can find them in the code list yourself. Some of the codes are open source and can be downloaded directly.)

Guess you like

Origin blog.csdn.net/jieyanping/article/details/134022879