
52 Bat Algorithm
This gives f (x
1
1
) = 5.1882, which is better than x
best
. So we update it as the
new best solution
x
best
= [1.8060, 2.0485, 2.8545]. (4.20)
Similarly, we do this for the rest of the other four solutions in the popula-
tion. Once the first iteration is done, we vary r and A again, and then carry
out another loop over the whole population.
The bat algorithm can be efficient. For the objective function, the optimal
solution is x
∗
= [1, 1, 1]. Using the above codes, we can typically get f
best
=
4.9 × 10
−16
after 500 iterations.
4.6 Conclusion
The bat algorithm is a simple, flexible and yet efficient algorithm for solv-
ing optimization problems. In