# Artificial Flora (AF) Optimization Algorithm
## 2 Artificial Flora Algorithm
### The Proposed Algorithm Flow and Complexity Analysis
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Operation** & **Time** & **Time Complexity** \\ \hline
**Initialize** & \(N\times t_{1}\) & O(\(N\)) \\
**Calculate propagation distance** & \(2N\times t_{2}\) & O(\(N\)) \\
**Update the position** & \(N\times t_{3}\) & O(\(N\)) \\
**Calculate fitness** & \(N\times M\times t_{4}\) & O(\(N\)\(\cdot M\)) \\
**Calculate survival probability** & \(N\times M\times t_{5}\) & O(\(N\)\(\cdot M\)) \\
**Decide alive plant using roulette** & \(N\times M\times t_{6}\) & O(\(N\)\(\cdot M\)) \\ \hline \hline \end{tabular}
\end{table} 
Table 2: The time complexity of artificial flora algorithm. Figure 4: Three-dimensional image of Rosenbrock function (\(f_{2}\)). Figure 5: Three-dimensional image of Rastrigin function (\(f_{3}\)). Figure 6: Three-dimensional image of Schwefel function (\(f_{4}\)). The AF, PSO, and ABC are all bio-inspired swarm intelligence optimization algorithms. The PSO and ABC methods are widely used intelligent optimization algorithms. So, we compare the AF algorithm with the PSO [50] and ABC [36] algorithms to prove the advantages of this algorithm. The maximum number of iterations, cycle index, and the running environment are the same. The three algorithms will be iterated 1000 times respectively and run 50 times independently. All the experiments using MATLAB (2012a, MathWorks Company, Natick, MA, USA, 2012) are performed on a computer with Intel(R) Core(TM) i7-7700 CPU @ 3.60 GHz and 8.00 GB RAM running the Windows 10 operating system. The default parameters are shown in Table 4.  
Tables 5-7 show the statistical results in 20-dimensional space, 50-dimensional space, and 100-dimensional space, respectively. According to the statistical results shown in Tables 5-7, AF can \begin{table}
\begin{tabular}{c c} \hline \hline
**Algorithm** & **Parameter Values** \\ \hline PSO & \(N=100\), \(c_{1}=c_{2}=1.4962\), \(w=0.7298\) \\ ABC & \(N=200\), limit = 1000 \\ AF & \(N=1\), \(M=100\), \(c_{1}=0.75\), \(c_{2}=1.25\) \\ \hline \hline \end{tabular}
\end{table} 
Table 4: The default parameters in particle swarm optimization (PSO), artificial bee colony (ABC), and artificial flora (AF) algorithms. Figure 8: Three-dimensional image of Ackley function (\(f_{6}\)). Figure 7: Three-dimensional image of Griewank function (\(f_{5}\)). find a more satisfactory solution with higher accuracy compare with PSO and ABC. For the unimodal function Sphere, AF can find the globally optimal solution. The accuracy of the solution obtained by AF is improved compare to those obtained by PSO and ABC. For Rosenbrock function, the accuracy of the solution is almost the same between AF and ABC in high dimensions (100-dimensional), and they are all better than PSO. However, the algorithm stability of AF is higher than that of ABC. For multimodal function (Rastrigin and Griewank), AF can steadily converge to the global optimal solution in 20-dimensional and 50-dimensional space, and in 100-dimensional space, AF can find the global optimal solution at best. For Schwefel function, the AF algorithm has better search precision in higher dimensions. In low dimensions, the search precision of the AF algorithm is superior to PSO but slightly worse than ABC. For Ackley function, AF is better than PSO and ABC for finding the global optimal solution. On the whole, the solution accuracy obtained by the AF algorithm is improved obviously for the unimodal functions and the multimodal functions. It shows that the AF algorithm has strong exploration ability. Also, the stability of AF in these benchmark functions is better than that of PSO and ABC besides the Schwefel function.