Matlab intelligent algorithm - adaptive ant lion optimization algorithm based on Optimization Strategy

1, Introduction to ant lion algorithm

1. Principle

ALO algorithm simulates the hunting mechanism of ant lion in nature. Their name comes from their unique hunting behavior and their favorite prey. The ant lion moves along a circular path and uses its huge jaw to dig a conical pit in the sand. After digging the trap, hide at the bottom of the cone (as a waiting predator) and wait for the insects (preferably ants) trapped in the pit, as shown in Figure 1. The main steps of random walking of ants, setting traps, trapping ants with traps, capturing prey and reconstructing traps were implemented.

Fig. 1 hunting behavior of ant lion

1. Algorithm steps

11 foraging ants walk randomly

Fig. 2 random walk of ants (3 times)

In order to simulate the hunting ability of ant lion, the method of Roulette is adopted. As shown in Figure 3, suppose that the ant is trapped in only one selected ant lion. In the process of optimization, ant colony algorithm needs to use roulette wheel operator to select ant colony according to the fitness of ant colony. This mechanism provides a higher opportunity for more suitable ant lions to prey on ants.

Fig. 3 random walk of ants in ant lion trap

1.2 setting traps

1.3 trap ants

1.4 capture prey and rebuild caves

2. Pseudo code

Figure 4 pseudo code of alo algorithm

2, Adaptive ant lion optimization algorithm for optimization strategy

2.1 adaptive boundary

2.2 optimizing roulette strategy

2.3 dynamic scale factor

Algorithm steps

3, Simulation experiment and result analysis

% fobj = @YourCostFunction
% dim = number of your variables
% Max_iteration = maximum number of generations
% SearchAgents_no = number of search agents
% lb=[lb1,lb2,...,lbn] where lbn is the lower bound of variable n
% ub=[ub1,ub2,...,ubn] where ubn is the upper bound of variable n
% If all the variables have equal lower bound you can just
% define lb and ub as two single number numbers

% To run ALO: [Best_score,Best_pos,cg_curve]=ALO(SearchAgents_no,Max_iteration,lb,ub,dim,fobj)

function [min_value,Elite_antlion_fitness,Elite_antlion_position,Convergence_curve]=ALO(N,Max_iter,lb,ub,dim,fobj)

% Initialize the positions of antlions and ants

% Initialize variables to save the position of elite, sorted antlions, 
% convergence curve, antlions fitness, and ants fitness

% Calculate the fitness of initial antlions and sort them
for i=1:size(antlion_position,1)

for newindex=1:N

% Main loop start from the second iteration since the first iteration 
% was dedicated to calculating the fitness of antlions
while Current_iter<Max_iter+1
    % This for loop simulate random walks
    for i=1:size(ant_position,1)
        % Select ant lions based on their fitness (the better anlion the higher chance of catching ant)
        if Rolette_index==-1  
        % RA is the random walk around the selected antlion by rolette wheel
        RA=Random_walk_around_antlion(dim,Max_iter,lb,ub, Sorted_antlions(Rolette_index,:),Current_iter);
        % RA is the random walk around the elite (best antlion so far)
        [RE]=Random_walk_around_antlion(dim,Max_iter,lb,ub, Elite_antlion_position(1,:),Current_iter);
        ant_position(i,:)= (RA(Current_iter,:)+RE(Current_iter,:))/2; % Equation (2.13) in the paper          
    for i=1:size(ant_position,1)  
        % Boundar checking (bring back the antlions of ants inside search
        % space if they go beyoud the boundaries
    % Update antlion positions and fitnesses based of the ants (if an ant 
    % becomes fitter than an antlion we assume it was cought by the antlion  
    % and the antlion update goes to its position to build the trap)
    double_fitness=[sorted_antlion_fitness ants_fitness];
    [double_fitness_sorted I]=sort(double_fitness);
    % Update the position of elite if any antlinons becomes fitter than it
    if antlions_fitness(1)<Elite_antlion_fitness 
    % Keep the elite in the population
    % Update the convergence curve

    % Display the iteration and best optimum obtained so far
    if mod(Current_iter,1)==0
        display(['At iteration ', num2str(Current_iter), ' the elite fitness is ', num2str(Elite_antlion_fitness)]);

The improved ant lion algorithm (PSALO) is compared with the original ant lion algorithm (ALO) and the bottle sea squirt swarm algorithm (SSA). The simulation is 30 times, 500 iterations each time, and the population size is 30. Take F1~F3 as an example.
The following figure shows the comparison curve of F1.
The maximum, minimum, average and standard deviation of the three algorithms are shown as follows:

Function: F1
SSA: Maximum: 1.976e-06,minimum value:3.3803e-08,average value:2.093e-07,standard deviation:3.9333e-07
ALO: Maximum: 0.0097103,minimum value:0.00022597,average value:0.0018599,standard deviation:0.0022659
PSALO: Maximum: 1.1972e-09,minimum value:1.7294e-11,average value:3.9346e-10,standard deviation:3.428e-10

The following figure is the comparison curve of F2.

The maximum, minimum, average and standard deviation of the three algorithms are shown as follows:

Function: F2
SSA: Maximum: 5.0543,minimum value:0.12765,average value:1.9419,standard deviation:1.4266
ALO: Maximum: 127.5844,minimum value:5.1073,average value:56.8097,standard deviation:48.045
PSALO: Maximum: 2.1726e-05,minimum value:4.3211e-06,average value:1.0354e-05,standard deviation:5.0614e-06

The following figure shows the comparison curve of F3.
The maximum, minimum, average and standard deviation of the three algorithms are shown as follows:

Function: F3
SSA: Maximum: 3008.01,minimum value:236.0645,average value:1270.2519,standard deviation:616.1047
ALO: Maximum: 13305.4836,minimum value:1777.0977,average value:4707.7349,standard deviation:2533.4001
PSALO: Maximum: 3.2929e-08,minimum value:2.662e-09,average value:1.3591e-08,standard deviation:8.0512e-09

In conclusion, PSALO has good evolutionary optimization performance, and its solution accuracy, convergence speed and stability are excellent.

4, References

[1] Liu jingsen, Huo Yu, Li Yu Adaptive ant lion optimization algorithm for optimization strategy [J]. Pattern recognition and artificial intelligence, 2020,33 (2): 121-132

If you like, you can pay attention to me

Keywords: MATLAB

Added by furious5 on Thu, 06 Jan 2022 01:37:31 +0200