算术优化算法(AOA)

1) 算法简介

  • 算术优化算法(Arithmetic Optimization Algorithm, AOA)是一种根据算术操作符的分布特性实现全局寻优的元启发式优化算法。

    • 乘除运算提高位置更新的全局分散性

    • 加减运算提高位置更新在局部区域的精确性

  • 于2021年由Abualigah等人提出

  • 具有收敛速度快,精度高等特点

2) 理论基础

  • 算法分三步

    • 通过数学优化器加速函数选择优化策略

    • 探索阶段:利用乘法策略与除法策略进行全局搜索,提高解的分散性,增强算法的全局寻优与克服早熟收敛能力,实现全局探索寻优。

    • 开发阶段:利用加法策略与减法策略降低解的分散性,有利于种群在局部范围内充分开发,加强算法的局部寻优能力。

  • 数学优化加速函数MOA(用于搜索阶段选择策略)r1为0-1随机数

    • r1>MOA时,执行探索阶段

    • r1<MOA时,执行开发阶段

    $$
    MOA(t)=Min+t\times (\frac{Max-Min}{T})
    $$

    其中Max和Min为加速函数的最大和最小值,取1和0.2.

2-a) 探索阶段

  • 通过乘除法全局搜索,产生r2也为0-1随机数

    • r2>0.5执行乘法

    • r2<=0.5执行除法

  • 位置更新公式:

  • 其中$\mu$是调整搜索过程的控制参数,取0.499,$\epsilon$为很小的数,防止分母为0,MOP是数学优化器概率。

2-b) 开发阶段

  • 通过加减法进行局部开发,位置更新公式:

3) Matlab代码

  • 算法函数AOA.m

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
function [Best_FF,Best_P,Conv_curve]=AOA(N,M_Iter,LB,UB,Dim,F_obj)
display('AOA Working');
%Two variables to keep the positions and the fitness value of the best-obtained solution

Best_P=zeros(1,Dim);
Best_FF=inf;
Conv_curve=zeros(1,M_Iter);

%Initialize the positions of solution
X=initialization(N,Dim,UB,LB);
Xnew=X;
Ffun=zeros(1,size(X,1));% (fitness values)
Ffun_new=zeros(1,size(Xnew,1));% (fitness values)

MOP_Max=1;
MOP_Min=0.2;
C_Iter=1;
Alpha=5;
Mu=0.499;

for i=1:size(X,1)
Ffun(1,i)=F_obj(X(i,:)); %Calculate the fitness values of solutions
if Ffun(1,i)<Best_FF
Best_FF=Ffun(1,i);
Best_P=X(i,:);
end
end

while C_Iter<M_Iter+1 %Main loop
MOP=1-((C_Iter)^(1/Alpha)/(M_Iter)^(1/Alpha)); % Probability Ratio
MOA=MOP_Min+C_Iter*((MOP_Max-MOP_Min)/M_Iter); %Accelerated function

%Update the Position of solutions
for i=1:size(X,1) % if each of the UB and LB has a just value
for j=1:size(X,2)
r1=rand();
if (size(LB,2)==1)
if r1<MOA
r2=rand();
if r2>0.5
Xnew(i,j)=Best_P(1,j)/(MOP+eps)*((UB-LB)*Mu+LB);
else
Xnew(i,j)=Best_P(1,j)*MOP*((UB-LB)*Mu+LB);
end
else
r3=rand();
if r3>0.5
Xnew(i,j)=Best_P(1,j)-MOP*((UB-LB)*Mu+LB);
else
Xnew(i,j)=Best_P(1,j)+MOP*((UB-LB)*Mu+LB);
end
end
end


if (size(LB,2)~=1) % if each of the UB and LB has more than one value
r1=rand();
if r1<MOA
r2=rand();
if r2>0.5
Xnew(i,j)=Best_P(1,j)/(MOP+eps)*((UB(j)-LB(j))*Mu+LB(j));
else
Xnew(i,j)=Best_P(1,j)*MOP*((UB(j)-LB(j))*Mu+LB(j));
end
else
r3=rand();
if r3>0.5
Xnew(i,j)=Best_P(1,j)-MOP*((UB(j)-LB(j))*Mu+LB(j));
else
Xnew(i,j)=Best_P(1,j)+MOP*((UB(j)-LB(j))*Mu+LB(j));
end
end
end

end

Flag_UB=Xnew(i,:)>UB; % check if they exceed (up) the boundaries
Flag_LB=Xnew(i,:)<LB; % check if they exceed (down) the boundaries
Xnew(i,:)=(Xnew(i,:).*(~(Flag_UB+Flag_LB)))+UB.*Flag_UB+LB.*Flag_LB;

Ffun_new(1,i)=F_obj(Xnew(i,:)); % calculate Fitness function
if Ffun_new(1,i)<Ffun(1,i)
X(i,:)=Xnew(i,:);
Ffun(1,i)=Ffun_new(1,i);
end
if Ffun(1,i)<Best_FF
Best_FF=Ffun(1,i);
Best_P=X(i,:);
end

end


%Update the convergence curve
Conv_curve(C_Iter)=Best_FF;

%Print the best solution details after every 50 iterations
if mod(C_Iter,50)==0
display(['At iteration ', num2str(C_Iter), ' the best solution fitness is ', num2str(Best_FF)]);
end

C_Iter=C_Iter+1; % incremental iteration

end
  • 初始化函数initialization.m

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
function X=initialization(N,Dim,UB,LB)

B_no= size(UB,2); % numnber of boundaries

if B_no==1 % If each variable has the same lb and ub
X=rand(N,Dim).*(UB-LB)+LB;
end

% If each variable has a different lb and ub
if B_no>1
for i=1:Dim
Ub_i=UB(i);
Lb_i=LB(i);
X(:,i)=rand(N,1).*(Ub_i-Lb_i)+Lb_i;
end
end

4) 改进与应用

目前已经有很多改进AOA算法的相关研究,以及提供了测试函数的数据和实际的应用场景,这里可以详见[4].


参考资料:

[1] 智能优化算法之算术优化算法

[2] Abualigah L , Diabat A , Mirjalili S , et al. The Arithmetic Optimization Algorithm[J]. Computer Methods in Applied Mechanics and Engineering, 2021, 376:113609.

[3] 算术优化算法AOA

[4] 兰周新,何庆.多策略融合算术优化算法及其工程优化[J].计算机应用研究,2022,39(03):758-763.DOI:10.19734/j.issn.1001-3695.2021.09.0358.