Skip to main content
. 2022 May 12;13(5):871. doi: 10.3390/genes13050871
Algorithm 1: SFMOABC
Input: the number of the food sources N; the dimension of problems D; a count parameter representing the number of times the current solution has not been improved trail; the maximum number of not be improved limit; the number of hub nodes in the scale-free network m0; the number of edges when the node joins the network m.
Output: the optimal solution x.
01. Initialize N food sources to form a population X=x1,x2,,xN;
02. Calculate the fitness value of each solution F(x)=fx1,fx2,,fxN;
03. Build a scale-free network with N node, and number each node in the network.
04. While the stopping criteria is not satisfied do
05.  for i=1N do
06.   if i<=m0 then
07.    vi=xi;
08.    Find the neighbor nei with the largest degree of xi;
09.    vi,d=xi,d+rand1,1xi,dxk,d+rand0,1xnei,dxi,d
10.    k1,2,,N, ki; d1,2,,D;
11.    Calculate the fitness value of the vi.
12.    vi,d=ub+lbvi,d;
13.    Calculate the fitness value of vi;
14.    if fvi>fvi then
15.     uivi; fuifvi;
16.    else
17.     uivi; fuifvi;
18.    end
19.    if fui>fxi then
20.     xiui; fxifui; traili0
21.    else
22.     trailitraili+1;
23.    end
24.   else
25.    vi=xi;
26.    Find the neighbor nei with the largest degree of xi;
27.    vi,d=xi,d+rand0,1xnei,dxi,d;
28.    Repeat (Steps 10–23)
29.   end
30.  end
31.  Calculate the probability Pi of xi;
32.  i=1; t=0;
33.  while t<N do
34.   if rand>Pi then
35.    repeat (Steps 06–30)
36.   end
37.   ii+1;
38.   if iN+1 then
39.    i1;
40.   end
41.  end
42.  Find the individual h with the maximum trail value;
43.  if trialh>limit then
44.   Randomly generated a new food source to replace the h-th food source;
45.  end
end
Return the optimal solution x with the largest fitness value.