一、算法介绍
(1)蜣螂优化算法DBO
参考文献:Xue Jiankai, Shen Bo. Dung beetle optimizer: a new meta-heuristic algorithm for global optimization[J]. Journal of Supercomputing, 2023,79(7):7305-7336.
(2)龙格-库塔优化算法 RUN
参考文献: Iman Ahmadianfar, Ali Asghar Heidari, Amir H. Gandomi, Xuefeng Chu, Huiling Chen. RUN beyond the metaphor: An efficient optimization algorithm based on Runge Kutta method[J]. Expert Systems with Applications, 2021, 181(115079): 0957-4174.
(3)蛇优化算法SO
参考文献:Hashim, F. A., & Hussien, A. G. (2022). Snake Optimizer: A novel meta-heuristic optimization algorithm.Knowledge-based Systems, 108320.
(4)海马优化算法HO
参考文献:Zhao, S., Zhang, T., Ma, S. et al. Sea-horse optimizer: a novel nature-inspired meta-heuristic for global optimization problems. Appl Intell (2022). https://doi.org/10.1007/s10489-022-03994-3
(5)帝企鹅优化算法EPO
参考文献:Gaurav Dhiman, Vijay Kumar. Emperor Penguin Optimizer: A Bio-inspired Algorithm for Engineering Problems[J]. Knowledge-based Systems, 2018, 159: 20-50.
二、部分代码
close all clear clc rng('default');%% 载入数据 data.E=[50,950,12]; %起点位置 横坐标与纵坐标需为50的倍数 data.S=[950,50,1]; %终点点位置 横坐标与纵坐标需为50的倍数 data.Obstacle=xlsread('data1.xls'); data.numObstacles=length(data.Obstacle(:,1)); data.mapSize=[1000,1000,20]; %10m 地图尺寸 data.unit=[50,50,1]; %地图精度 data.S0=ceil(data.Shttps://www.bilibili.com/read/cv34394337/data.unit); data.E0=ceil(data.Ehttps://www.bilibili.com/read/cv34394337/data.unit); data.mapSize0=data.mapSizehttps://www.bilibili.com/read/cv34394337/data.unit; data.map=zeros(data.mapSize0);%% 算法设置 SearchAgents_no=30; % 种群大小 Max_iteration=30;% 最大迭代次数 ColorStr={'r-','b--','c-.','g-.','m-'};%颜色%% 画图 PlotFigure; %% 显示路径信息for i=1:length(AlgorithName) fprintf(AlgorithName{i}); fprintf("路径坐标: "); display(Result(i).path) fprintf(AlgorithName{i}); fprintf("路径长度:%f ",Result(i).fit);end
三、部分结果
DBO路径坐标:
950 50 1
900 100 2
850 150 2
800 200 3
750 250 4
700 300 5
650 300 5
600 300 5
550 300 5
500 350 6
450 400 7
450 450 7
450 500 7
450 550 7
450 600 7
450 650 7
400 700 8
350 700 8
300 750 9
250 800 10
200 800 11
150 850 12
100 900 12
50 950 12
DBO路径长度:1419.319522
RUN路径坐标:
950 50 1
900 50 1
900 100 1
850 100 2
800 100 3
750 150 3
700 200 4
700 200 5
700 250 6
650 300 6
600 300 6
550 300 6
500 350 7
500 400 7
450 450 8
450 500 8
450 550 9
450 600 9
450 650 10
400 700 10
350 700 11
300 750 12
250 800 12
200 850 12
150 850 12
100 900 12
50 950 12
RUN路径长度:1478.905736
SO路径坐标:
950 50 1
900 100 2
850 150 3
800 150 3
750 200 3
700 250 4
650 300 4
600 300 5
550 300 5
500 350 5
450 400 6
450 450 7
450 500 7
450 550 8
450 600 8
450 650 8
400 700 9
350 700 9
300 750 10
250 800 11
200 850 12
150 900 12
100 900 12
50 950 12
SO路径长度:1419.325378
HO路径坐标:
950 50 1
900 100 2
850 150 3
800 200 4
750 250 4
700 300 5
650 300 5
600 300 5
550 300 5
500 350 6
450 400 7
450 450 7
450 500 7
450 550 7
450 600 8
450 650 8
400 700 9
350 700 9
300 750 10
250 800 11
200 850 12
150 900 12
100 950 12
50 950 12
HO路径长度:1419.319522
EPO路径坐标:
950 50 1
1000 100 2
950 100 3
950 100 4
950 100 5
900 100 6
850 100 6
800 150 7
800 150 8
800 200 9
750 250 10
700 300 10
650 300 10
600 300 11
600 350 12
600 400 13
550 450 13
500 500 12
450 550 11
450 550 10
450 600 9
450 650 9
400 700 9
350 700 9
300 750 9
250 800 9
200 800 10
150 800 11
150 850 12
100 900 12
50 950 12
EPO路径长度:1552.663481
四、完整MATLAB代码
一键三连,获取代码链接