# A Compact Bat Algorithm for Unequal Clustering in Wireless Sensor Networks
## 4 Experiments with Numerical Problems  
To validate the quality performance of the proposed algorithm, we select ten optimal numerical problems [38] to prove the accuracy and rate of the cBA. The cBA measurements are compared with the original bat algorithm (oBA) with respect to solution quality. The two techniques used to verify the performance of the proposed cBA include similarity measure and time complexity analysis. The similarity measure uses a probability cosine with an adopted Pearson's correlation coefficient that considers the measured ratio (r) for two result solutions. The time complexity analysis uses the number of related variables employed in the optimization process. All the selected test functions for the outcomes of the experiment averaged over 25 runs. Minimized outcomes of optimization are calculated for all functions. Let \(X=\{x_{1},\,x_{2},\,\ldots,\,x_{n}\}\) be the \(n\)-population size real-value vector. The related initial data of test functions, i.e., range boundaries, max iteration, and dimension are listed in Table 1.  
Initial setting of parameters for the two algorithms of cBA and oBA are set such as loudness of \(A\) is set to 0.25, pulse rate \(r_{i}^{0}\) is set to 0.5, virtual population size \(N\) is set to 40, dimension is set to 30, minimum/maximum frequency (\(fmin\), \(fmax\)) are set to initial boundaries of the lowest and highest of range functions, maxiteration is set to 5000, and the number runs is set to 25. The final result is obtained by taking the average of the outcomes from all runs. The obtained results of cBA are compared with the oBA. A comparison of the quality of performance and running time for the optimization problems of the cBA with oBA methods are shown in Table 2. Data in the oBA and the cBA columns in Table 2 represents the averaged outcomes of 25 runs for the original bat algorithm and the compact bat algorithm, respectively. Rate deviation (\(RD\)) is a rated deviation that represents the percentage of the deviation on the primary bat algorithm outcomes for the cBA, respectively. Clearly, almost all cases of benchmark functions for optimizing in both cBA and oBC have a small percentage of deviation. It shows that the accuracy of the cBA is as good as that of the oBA. The average percentage of deviation \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Name** & **Test Functions** & **Range** & **Dimension** & **Iteration** \\ \hline Rosenbrock & \(f_{1}(x)=\sum\limits_{i=1}^{n-1}(100\times\left(x_{i-1}-x_{i}^{2}\right)^{2}+(1 -x_{i})^{2}\) & \(\pm 100\) & 30 & 5000 \\ \hline Quadric & \(f_{2}(x)=\sum\limits_{i=1}^{n}\sum\limits_{k=1}^{i}x_{i}\) & \(\pm 100\) & 30 & 5000 \\ \hline Ackley & \(f_{3}(x)=\ 20+e-20e^{-0.2\sum\limits_{i=1}^{\frac{\sum_{i=1}^{n}x_{i}^{2}}{n}}}-e^{ \frac{\sum_{i=1}^{n}\cos(2\mu_{i})}{n}}\) & \(\pm 32\) & 30 & 5000 \\ \hline Rastrigin & \(f_{4}(x)=\sum_{i=1}^{N}[10+x_{i}^{2}-10\cos 2\pi x_{i}]\) & \(\pm 5.12\) & 30 & 5000 \\ \hline Griewangk & \(f_{5}(x)=1+\sum\limits_{i=1}^{N}\frac{x_{i}^{2}}{4000}+\prod\limits_{i=1}^{N}cos \frac{x_{i}}{\sqrt{x_{i}}}\) & \(\pm 100\) & 30 & 5000 \\ \hline Spherical & \(f_{6}(x)=\sum\limits_{i=1}^{N}x_{i}^{2}\) & \(\pm 100\) & 30 & 5000 \\ \hline Quartic Noisy & \(f_{7}(x)=random[0,1)+\sum\limits_{i=1}^{N}i\times x_{i}^{4}\) & \(\pm 1.28\) & 30 & 5000 \\ \hline Schwefel & \(f_{8}(x)=418.983n-\sum\limits_{i=1}^{N}x_{i}\times\sin\left(\sqrt{x_{i}}\right)\) & \(\pm 100\) & 30 & 5000 \\ \hline Langermann & \(f_{9}(x)=\sum_{i=1}^{n}\{x_{i}^{2}-10\cos(2\pi x_{i})+10\}\) & \(\pm 5.12\) & 30 & 5000 \\ \hline Shubert & \(f_{10}(x)=-20\exp(-0.2\sqrt{\frac{1}{n}\sum_{i=1}^{n}x_{i}^{2}})-\) & \(\pm 32\) & 30 & 5000 \\  & \(\exp\left(\frac{1}{n}\sum_{i=1}^{n}\cos(2\pi x_{i})\right)+20+e\) & & & \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Ten selected benchmark functions of testing. for ten test-function evaluations is only 3%. However, the average time consumption of cBA is 24% faster than that of oBA.