Hi everyone and welcome back,

I am pleased to share my recent work here in this page with you. Yes, your guess is correct, it is again a new algorithm, but this time I have developed three algorithms for solving three different types of optimization problems. 

The main inspiration of the Dragonfly Algorithm (DA) algorithm originates from static and dynamic swarming behaviours. These two swarming behaviours are very similar to the two main phases of optimization using meta-heuristics: exploration and exploitation. Dragonflies create sub swarms and fly over different areas in a static swarm, which is the main objective of the exploration phase. In the static swarm, however, dragonflies fly in bigger swarms and along one direction, which is favourable in the exploitation phase. A conceptual model of the dynamic and static swarms are illustrated in the following image:

Static versus dynamic swarm

For simulating the swarming behaviour of dragonflies, I utilized the three primitive principles of swarming in insects proposed by Reynold as well as two other new concepts as shown in the following picture:

Primitive principles of individuals in swarm

These five concepts allowed me to simulate the behaviour of dragonflies in both dynamic and static swarms. The following figures shows how my proposed model moves the individuals around the search space with respect to each other as well as food source and enemy. Please note that the green asterisk is food source, the red asterisk indicates the enemy, black circles are individuals, and blue lines are the step vector of the dragonflies. To see the animation more than once, you need to refresh the page.

Simulation of dragonflies's swarm

I personally enjoyed watching the simulated dragonflies flying around. With the parameters(s, a, c, f, and e), I was able to simulate different swarming behaviour. For the above figure, I utilized s=0.1, a=0.1, c=0.7, f=1, and e=1. The flying speed of dragonflies slowed down because I linearly decreased w from 0.9 to 0.4. Otherwise, dragonflies only explore the search space without convergence towards a point (exploitation). Note that there is no random walk in the movement of alone individual in the above figure. Anyway, this part was really fun for me. After simulating the swarm of dragonflies, I proposed the DA algorithm for solving single-objective optimization problems. The Pseudo codes of this algorithm are as follows (for the equations, please refer to the paper):

Initialize the dragonflies population Xi (i = 1, 2, ..., n)
Initialize step vectors ΔXi (i = 1, 2, ..., n)
while the end condition is not satisfied
Calculate the objective values of all dragonflies
Update the food source and enemy
           Update w, s, a, c, f, and e
Calculate S, A, C, F, and E using Eqs. (3.1) to (3.5)
Update neighbouring radius
if a dragonfly has at least one  neighbouring dragonfly
          Update velocity vector using Eq. (3.6)
          Update position vector using Eq. (3.7)
else
          Update position vector using Eq. (3.8)
end if
Check and correct the new positions based on the boundaries of variables
end while

Since the DA algorithm is only able to solve continuous problems, I decided to implement the binary versison of this algorithm called Binary DA (BDA) for solving discrete problems. In order to do this, I utilized a v-shaped transefr function. If you are not familiar with transfer functions, you can find two papers in the list of my publications (or download them directly from here and here) that concentrate on transfer functions. Anyway, let's go back the BDA algorithm. I was saying that transfer functions are very cheap tools for converting a continuous algorithm to a binary one. Such functions define the probability of changing the elements of a position vector from 0 to 1 or vice versa. The transfer function that I used is illustrated as follows (for the equation, please refer to the paper):

A v-shaped transfer function

After all the pseudo codes of the BDA algorithm are as follows:

Initialize the dragonflies population Xi (i = 1, 2, ..., n)
Initialize step vectors ΔXi (i = 1, 2, ..., n)
while the end condition is not satisfied
Calculate the objective values of all dragonflies
Update the food source and enemy
Update w, s, a, c, f, and e
Calculate S, A, C, F, and E using Eqs. (3.1) to (3.5)
Update step vectors using Eq. (3.6)
Calculate the probabilities using Eq. (3.11)
Update position vectors using Eq. (3.12)
end while


Because the majority of real problems have multiple objectives, I decided to propose the multi-objective version of the DA algorithm called (MODA) as well. If you have no background in multi-objective optimization, you need to know that there is no more single solution for a given multi-objective problem. Multiple objective function prevent us from comparing the solutions with relational operators such as >, <, etc. Therefore, we have to use the definition of Pareto optimality to compare solutions. In this case, a solution is better than (dominates) another solution if and only if it shows better or equal objective value on all of the objectives and provides a better value in at least one of the objective functions. The answer for such problems is a set of solutions called Pareto optimal solutions set. This set includes Pareto optimal solutions that represents the best trade-offs between the objectives  If you still do not understand the concepts of Pareto optimality, you can have a look at my publications in the field of multi-objective optimization here, here, and here as well.

In order to solve multi-objective problems using meta-heuristics, an archive (repository) is widely used in the literature to maintain the Pareto optimal solutions during optimization. Two key points in finding a proper set of Pareto optimal solutions for a given problem are convergence and coverage. Convergence refers to the ability of a multi-objective algorithm in determining accurate approximations of Pareto optimal solutions. Coverage is the distribution of the obtained Pareto optimal solutions along the objectives. Since most of the current multi-objective algorithms in the literature are posteriori, the coverage and number of solutions are very important for decision making after the optimization process. The ultimate goal for a multi-objective optimizer is to find the most accurate approximation of true Pareto optimal solutions (convergence) with uniform distributions (coverage) across all objectives.

For solving multi-objective problems using the DA algorithm, it is first equipped with an archive to store and retrieve the best approximations of the true Pareto optimal solutions during optimization. The updating position of search agents is identical to that of DA, but the food sources are selected from the archive. In order to find a well-spread Pareto optimal front, a food source is chosen from the least populated region of the obtained Pareto optimal front, similarly to the Multi-Objective Particle Swarm Optimization (MOPSO) algorithm in the literature. To find the least populated area of the Pareto optimal front, the search space should be segmented. This is done by finding the best and worst objectives of Pareto optimal solutions obtained, defining a hyper sphere to cover all the solutions, and dividing the hyper spheres to equal sub hyper spheres in each iteration. After the creation of segments, the selection is done by a roulette-wheel mechanism.This mechanism allows the MODA algorithm to have higher probability of choosing food sources from the less populated segments. Therefore, the artificial dragonflies will be encouraged to fly around such regions and improve the distribution of the whole Pareto optimal front. For selecting enemies from the archive, however, the worst (most populated) hyper sphere should be chosen in order to discourage the artificial dragonflies from searching around non-promising crowded areas. The selection is done by a roulette-wheel mechanism again.

I have illustrated the conceptual model of the best hyper spheres for selecting a food source or removing a solution from the archive in the following image:

Selection mechanism of enemy and food sounce from the archive

The archive should be updated regularly in each iteration and may become full during optimization. Therefore, there should be a mechanism to manage the archive.  If a solution is dominated by at least one of the archive residences, it should be prevented from entering the archive. If a solution dominates some of the Pareto optimal solutions in the archive, they all should be removed from the archive, and the solution should be allowed to enter the archive. If a solution is non-dominated with respect to all of the solutions in the archive, it should be added to the archive. If the archive is full, one or more than one solutions may be removed from the most populated segments to accommodate new solution(s) in the archive. These rules are taken from the original MOPSO paper written by Professor Coello Coello and his colleagues. The above figure shows the best candidate hyper sphere (segments) to remove solutions (enemies) from in case the archive become full. All the parameters of the MODA algorithm are identical to those of the DA algorithm except two new parameters for defining the maximum number of hyper spheres and archive size.

After all, the pseudo codes of MODA are as follows (for the equations, please refer to the paper):

Initialize the dragonflies population Xi (i = 1, 2, ..., n)
Initialize step vectors ΔXi (i = 1, 2, ..., n)
Define the maximum number of hyper spheres (segments)
Define the archive size
while the end condition is not satisfied
Calculate the objective values of all dragonflies
Find the non-dominated solutions
Update the archive with respect to the obtained non-dominated solutions
if the archive is full
Run the archive maintenance mechanism to omit one of the current archive members
Add the new solution to the archive
end if
if any of the new added solutions to the archive is located outside the hyper spheres
Update and re-position all of the hyper spheres to cover the new solution(s)
end if
Select a food source from archive: X^+=SelectFood(archive)
Select an enemy from archive: X^-=SelectEnemy(archive)
Update step vectors using Eq. (3.11)
Update position vectors using Eq. (3.12)
Check and correct the new positions based on the boundaries of variables
end while

I do not want to present the results of the paper here, so you may refer to the paper for more information. I have tested the proposed DA, BDA, ad MODA algorithms on several test cases. The results showed the merits of my proposed algorithms in solving optimization problems with continuous  discrete, and multi-objective search spaces. Since I do love real engineering problems, I also optimized the shape of a 7-blade submarine's propeller in the paper. Although  I did not want to discuss the results here, I could not resist to not to talk about my lovely optimized propellers here :D ;).

This problem of propeller design has two objectives: cavitation versus efficiency. These two objectives are in conflict and restricted by a large number of constraints as other Computational Fluid Dynamics (CFD) problems. I have illustrated the shape of the propeller in the following image:

Propeller and submarineStructural parameters of the blade

the main structural parameters are the shapes of airfoils along the blades, which define the final shape of the propeller. The structure of each airfoil is determined by two parameters: maximum thickness and chord length. I considered ten airfoils along the blade in the paper, so there was a total of 20 structural parameters to be optimized by the MODA algorithm. I solved this real case study by the MODA algorithm equipped with 200 artificial dragonflies over 300 iterations. Since the problem of submarine propeller design has many constraints, MODA should be equipped with a constraint handling method. For simplicity, I utilized a death penalty, which assigns very low efficiency and large cavitation to the artificial dragonflies that violate any of the constraints. Therefore, they are dominated automatically when finding non-dominated solutions in the next iteration. I have presented the search history, obtained Pareto optimal front, and shape of some of the obtained Pareto optimal solutions by MODA all in the following figure:

Approximated Pareto optimal front by MODA

You see how beautiful these propellers are. It was really satisfying to me that the MODA algorithm was able to approximate the true Pareto optimal front for this problem easily.

I hope that you enjoyed reading my experience in developing  this algorithm as well. As always, it is my pleasure to make the source codes publicity available for everyone around the world. I appreciate your time for reading my papers and following my works and hope that these open source codes optimizers will be of some use in your research.

The source codes of DA are available here.
The Matlab Toolbox of DA is available here.
The source codes of BDA are available here.
The source codes of MODA are available here.

You can download the paper from here.  

If you have no access to Springerlink, drop me an e-mail here and I will send you the paper. Please also do not hesitate to contact me for any questions and criticisms. I am always happy to hear your thoughts :) 

If you have any questions or something to share, please feel free to post it at the end of this page in the comment section.

Have a great day
Regards,
Ali