# A Compact Bat Algorithm for Unequal Clustering in Wireless Sensor Networks
## 4 Experiments with Numerical Problems
Figure 1 shows the curves of cBA and oBA with the average obtained minimum for four first test functions. It should be noted that all of these cases of test benchmark functions for cBA (red lines) are equal to or faster than oBA in convergence. To verify the effect of population sizes on the performance of the algorithms, we used variety \(N\) for testing. Figure 2 compares the performance quality of running with different population sizes for test functions between cBA and oBA. Doubtless, most cases for testing functions in the cBA are faster than and uniform in convergence that applied for BA. The convergence of most cases of test functions \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline \multirow{2}{*}{
\begin{tabular}{c} **Test** \\ **Functions** \\ \end{tabular} } & \multicolumn{2}{c}{**Evaluation Results**} & \multicolumn{2}{c}{**Accuracy**} & \multicolumn{2}{c}{**Time Consumption**} & \multicolumn{1}{c}{**Speed**} \\  & & \multicolumn{2}{c}{**\%**} & \multicolumn{2}{c}{**(minutes)**} & \multicolumn{1}{c}{**\%**} \\ \cline{2-7} \cline{6-7}  & **oBA** & **cBA** & **RD** & **oBA** & **cBA** & **Comparison** \\ \hline \(f_{1}(x)\) & \(9.20\times 10^{8}\) & 8.87 \(\times 10^{8}\) & 3\% & 1.5659 & 1.3141 & 19\% \\ \(f_{2}(x)\) & 3.79 \(\times 10^{4}\) & 3.63 \(\times 10^{4}\) & 4\% & 2.1764 & 1.7936 & 21\% \\ \(f_{3}(x)\) & 1.92 \(\times 10^{1}\) & 1.91 \(\times 10^{1}\) & 1\% & 1.498 & 1.1598 & 29\% \\ \(f_{4}(x)\) & 2.09 \(\times 10^{2}\) & 2.05 \(\times 10^{2}\) & 2\% & 1.1847 & 1.0021 & 18\% \\ \(f_{5}(x)\) & 6.23 \(\times 10^{0}\) & 6.12 \(\times 10^{0}\) & 2\% & 1.3823 & 1.0845 & 27\% \\ \(f_{6}(x)\) & 7.64 \(\times 10^{4}\) & 7.40 \(\times 10^{4}\) & 3\% & 1.1616 & 0.8768 & 32\% \\ \(f_{7}(x)\) & 1.12 \(\times 10^{0}\) & 1.10 \(\times 10^{0}\) & 2\% & 1.2823 & 1.0845 & 18\% \\ \(f_{8}(x)\) & 6.25 \(\times 10^{3}\) & 6.00 \(\times 10^{3}\) & 4\% & 1.1147 & 0.8921 & 25\% \\ \(f_{9}(x)\) & 8.75 \(\times 10^{1}\) & 8.77 \(\times 10^{1}\) & 1\% & 1.5659 & 1.3141 & 19\% \\ \(f_{10}(x)\) & 1.50 \(\times 10^{0}\) & 1.70 \(\times 10^{0}\) & 2\% & 2.4764 & 2.3936 & 17\% \\
**Average** & **1.15 \(\times 10^{8}\)** & **1.11 \(\times 10^{8}\)** & **3\%** & **1.4207** & **1.1509** & **24\%** \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Comparison evaluation and speed of the cBA and oBA regarding the quality performance. Figure 1: Convergence comparison of two algorithms of cBA and oBA for four first test functions. **(a)**: Rosenbrock function; **(b)**: Quadric function; **(c)**: Ackley function; **(d)**: Rastrigin function. for employing in cBA is not affected very much by the variety population size. Because it is a virtual population the mean value of results did not fluctuate and was more stable than that of oBA. Table 3 shows the comparison of the proposed cBA with the oBA in terms of the occupied memory variables for implementing computations in running optimization. The number of variables of the two algorithms is counted for through the number of the equations used in operations optimization. Observations from Table 3 would clearly show that the number of variables of cBA use is smaller than the oBA with the same condition of computation, e.g., iterations. There are four number equations for oBA, e.g., (8)-(11) and eight equations for cBA, e.g., (8)-(11), and (15)-(18). However, the real population or population size of oBA is \(N\), whereas, cBA is only one. With the same number of iterations and the running time \(T\), the stored slots of variables for oBA and cBA are 4 \(\times\) T \(\times\) N \(\times\)_iteration_, and 8 \(\times\) T \(\times\)_iteration_, respectively, where \(T\) and \(N\) are the counting run time and the number of population, respectively. It is observed that the number of occupied slots in oBA is higher (\(N\)/2 times) than in cBA. Figure 3 illustrates a comparison of executing times of the cBA with oBA over 25 runs for ten benchmark functions. Clearly, all cases of testing duties of cBA are smaller than those obtained for