Professional Documents
Culture Documents
OPTIMIZATION ALGORITHM
Author: Syedali Mirjalili
Submitted by
Bushra Hanif
16F-MS-EE-17
Submitted to
Dr. Inam ul Hassan
1.1. Introduction
The duty of a stochastic multi-objective optimization algorithm is to determine the set of best
trade-offs between the objectives, the so called Pareto optimal set.Optimization techniques are
reflected as one of the finest techniques for finding optimal design using machines. Multi-objective
optimization The main focus of this work deals with finding solutions for problems having more
than one objectives. And obviously there is more than one solution for such problems due to the
nature of multi-objective problems. While mono-objective problem has only one global optimum.
Multiple objectives is the main challenge in multi-objective optimization. The responsibility of a
stochastic multi-objective optimization algorithm is to find out the set of best trade-offs between
the given objectives which is called Pareto optimal set [1].
To understand the concept of Pareto optimality, we evaluate the following example:
We consider a simple problem which is unconstrained and having two design objectives: 1 and
2, which are functions of a single design variable x. We want to minimize design objectives
simultaneously. Below figure 1 provides the plot of both objective functions on the same vertical
axis and the design variable x on the horizontal axis.
Figure 1
If we minimize each objective function individually and ignore the other objective then we will
get the point that relates to the minimum of the objective which is being minimized. These two
points are indicated by stars in above figure 1. If we suppose that we are at the minimum of
Objective 1 (Point M1) and we want a design that has a lower value for Objective 2 then what we
have at Point M1. In order to obtain this, we will have to move to the right of Point M1 i.e. point
B. while doing so, Objective 2 has decreased in value, but the value of Objective 1 will increase.
As we are trying to minimize both objectives, thus in order to improve the value of 2, we have to
compromise on the performance of 1. Actually this is true for all points between M1 and M2.
And we call these points Pareto optimal solutions or non-dominated solutions.
Definition:
"Pareto optimal solutions are those for which any improvement in one objective will result in the
worsening of at least one other objective. That is, a tradeoff will take place.
There are two main approaches in the literature of multi objective optimization using stochastic
optimization techniques:
A posteriori versus a priori[2].
For a priori approaches, a multi-objective optimization problem is converted to a single-
objective by aggregating the objectives. A set of weights defines how much the objectives are
important. After the objective aggregation, a single-objective optimization algorithm is able to
easily solve the problem. The main drawbacks of this approach is that an algorithm should be run
multiple times to find out the Pareto optimal set.
A posterior approaches benefit from maintaining multi objective formulation of a multi-
objective problems and finding the Pareto optimal set in just one run.
This work proposes a multi-objective Ant Lion Optimizer (ALO) for solving engineering
problems.
Figure 2
The edge of the cone is sharp sufficient for insects to fall down to the bottom of the trap easily.
Once the antlion realizes that a prey is in the trap then it tries to catch it. However, ants generally
are not caught immediately and they try to escape from the trap. In this case antlions throw sands
towards to edge of the pit in order to slide the prey into the bottom of the pit. When a prey is caught
into the jaw, it is pulled under the soil and consumed. After consuming the prey, antlions throw
the leftovers outside the pit and adjust the pit for the next hunt.
Another interesting behavior that has been observed in life style of antlions is relevant to the size
of the trap and two things: (1) level of hunger (2) shape of the moon. Antlions tend to dig out larger
traps as they become hungrier and/or when the moon is full. They have been developed and
adapted this way to improve their chance of existence. It also has been discovered that an antlion
does not directly observe the shape of the moon to decide about the size of the trap, but it has an
internal astral clock to make such decisions.
The main inspiration of the ALO algorithm comes from the seeking behavior of antlions larvae.
In the next subsection the behavior of antlions and their prey in nature is first modelled
mathematically. An optimization algorithm is then proposed based on the mathematical model.
There are two populations in the ALO algorithm:
(1) set of ants
(2) Set of antlions.
The general steps of Ant lion optimize to change these two sets and finally estimate the global
optimum for a given optimization problem are as follows:
a) The ant set is initialized with random values and are the main search agents in the ALO.
b) The fitness value of each ant is evaluated using an objective function in each iteration.
c) Ants move over the search space using random walks around the antlions.
d) The population of antlions is never evaluated. In fact, antlions assumed to be on the location
of ants in the first iteration and relocate to the new positions of ants in the rest of iterations if the
ants become better.
e) There is one antlion assigned to each ant and updates its position if the ant becomes fitter.
f) There is also an elite antlion which impacts the movement of ants regardless of their distance.
g) If any antlion becomes better than the elite, it will be replaced with the elite.
h) Steps b to g are repeatedly executed until the satisfaction of an end criterion.
I) the position and fitness value of the elite antlion are
returned as the best estimation for the global optimum.
In order to solve optimization problems, this algorithm mimics:
a) Random walk of ants
b) Entrapment in an antlion pit
c) Constructing a pit,
d) Sliding ant towards antlions,
e) Catching prey
f) Re-constructing the pit
g) Elitism.
Figure 3
The position of ants are saved and utilized during optimization in the following matrix:
Where,
MAnt is the matrix for saving the position of each ant.
Ai,j = the value of the j-th variable (dimension) of i-th ant
n = the number of ants
d = the number of variables.
Position of an ant refers the parameters for a particular solution. Matrix MAnt has been reflected to
save the position of all ants (variables of all solutions) during optimization. For evaluating each
ant, a fitness (objective) function is utilized during optimization and the following matrix stores
the fitness value of all ants:
Where,
MOA is the matrix for saving the fitness of each ant
Ai,j = the value of j-th dimension of i-th ant
n = the number of ants
f = the objective function.
In addition to ants we assume the antlions are also hiding somewhere in the search space. In order
to save their positions and fitness values following matrices are utilized:
Where,
MAntlion is the matrix for saving the position of each antlion
ALi,j = the j-th dimensions value of i-th antlion
n = the number of antlions, and d is the number of variables (dimension).
Where,
MOAL is the matrix for saving the fitness of each antlion
ALi,j = the j-th dimensions value of i-th antlion
n = number of antlions
f = objective function.
During optimization following conditions are applied:
Ants move around the search space using different random walks
Random walks are applied to all the dimension of ants.
Random walks are affected by the traps of antlions.
Antlions can build pits proportional to their fitness (the higher fitness, the larger pit).
Antlions with larger pits have the higher probability to catch ants.
Each ant can be caught by an antlion in each iteration and the elite (fittest antlion).
The range of random walk is decreased adaptively to simulate sliding ants towards antlions.
If an ant becomes fitter than an antlion, this means that it is caught and pulled under the
sand by the antlion.
An antlion repositions itself to the latest caught prey and builds a pit to improve its change
of catching another prey after each hunt.
1.2
Where,
ai = The minimum of random walk of i-th variable
bi = The maximum of random walk in i-th variable
ci= The minimum of maximum of random walk in i-th variable
= The minimum of i-th variable at t-th iteration
= the maximum of i-th variable at t-th iteration.
Above equation should be applied in each iteration to guarantee the occurrence of random walks
inside the search space.
1.2.2. Trapping in antlions pits
As discussed above that random walks of ants are affected by antlions traps. In order to
mathematically model this assumption the following equations are proposed:
Cit = Antlionjt + Ct 1.3
dit = Antlionjt + dt 1.4
Where,
Ct = the minimum of all variables at t-th iteration
dt = the vector including the maximum of all variables at t-th iteration
Cit = the minimum of all variables for i-th ant
dit = the maximum of all variables for i-th ant
Antlionjt = the position of the selected j-th antlion at t-th iteration.
Equations (1.3) and (1.4) show that ants randomly walk in a hyper sphere defined by the vectors c
and d around a selected antlion.
= 1.6
Where,
I = ratio, I = 1 + 10wT/t where t = current iteration, T = the maximum number of iterations
w is defined based on the current iteration (w = 2 when
t > 0.1T , w = 3 when t > 0.5T , w = 4 when t > 0.75T ,
w = 5 when t > 0.9T , and w = 6 when t > 0.95T ).
The parameter w in the equation for I is able to adjust the accuracy level of exploitation
= Minimum of all variables at t-th iteration
= Indicates the vector including the maximum of all variables at t-th iteration.
1.2.6 Elitism
Elitism is an important characteristic of evolutionary algorithms that permits them to maintain the
best solution(s) which are obtained at any stage of optimization process. In this study the best
antlion obtained until now in each iteration is saved and considered as an elite. Since the elite is
the fittest antlion, it should be able to affect the movements of all the ants during iterations. So it
is assumed that every ant randomly walks around a selected antlion by the roulette wheel and the
elite simultaneously as follows [3]:
+
= 1.8
2
Where,
= the random walk around the antlion selected by the roulette wheel at t-th iteration,
= the random walk around the elite at t-th iteration
Indicates the position of i-th ant at t-th iteration.
As this is multi-objective ALO so there are different approaches for finding and storing Pareto
optimal solutions using heuristic algorithms. In this work we employ an archive to store Pareto
optimal solutions and obviously there should be a limit for archive and solutions should be chosen
from the archive
in a way to improve the distribution. For measuring the distribution of the solutions in the archive,
we use niching. In this approach, the vicinity of each solution is investigated considering a pre-
defined radius. The number of solutions in the vicinity is then counted and considered as the
measure of distribution. To improve the distribution of the solutions in the archive, we considered
two mechanisms:
Firstly, the antlions are selected from the solutions with the least populated neighborhood. The
following equation is used in this regard that defines the probability of choosing a solution in the
archive:
P i = c / Ni 1.9
Where,
c is a constant and should be greater than 1 and Ni is the number of solutions in the vicinity of the
i-th solution.
Secondly, when the archive is full, the solutions with most populated neighborhood are removed
from the archive to accommodate new solutions. The following equation is used in this regard
that defines the probability of removing a solution from the archive:
Pi = Ni / c 1.10
Where c is a constant and should be greater than 1 and Ni is the number of solutions in the
vicinity of the i-th solution.
In order to require ALO to solve multi-objective problems, equation 1.7 should be modified due
to the nature of multi-objective problems.
Antlionjt = Antit if f(Antit) < f(Antlionjt) 1.11
Where,
t = the current iteration,
Antlionjt = position of selected j-th antlion at t-th iteration
Antit = the position of i-th ant at t-th iteration.
Another modification is for the selection of random antlions and elite in equation 1.8. We utilize
a roulette wheel and equation 1.8 to select a non-dominated solution from the archive. The
pseudocodes of the MOALO algorithm are shown in Figure 4.
Figure 4
Chapter no. 02
Implementing ALO in MATLAB
2.1 Initialization
In order to implement the ALO Algorithm in MATLAB, Ive followed the steps as discussed in
Chapter 01. First step is to initialize the positions of ants and antlions i.e. Ive initialized matrices
Aant and Aantlion as discussed in chapter 01. This is done by generating random functions available
in MATLAB. Source code is given in figure 5:
Figure 5
The initialization function takes four inputs, number of antlions to hunt aunts ( SearchAgents_no),
dimension of movement (dim), upper bound (ub) and lower bound(lb) in order to keep the random
motion of antlions in limits.
Figure 8
Figure shows the choice function which takes an array and returns the index of most weighted
number in array. In our case, it takes antlion number as input array and returns the suitable antlion
to hunt the ants.
3.1
2.5 Simulation Results
Figure 11
In figure 8 graph represents the best Pareto optimal fronts of test function which are found in 100
iterations.
3.1. Introduction
Speed reducers are mechanical devices (5) generally used for two purposes. The primary use is to
multiply the amount of torque generated by an input power source to increase the amount of usable
work. They also reduce the input power source speed to achieve desired output speeds.
Figure 12 Figure 13
Figure 9 and figure 10 shows the schematic of the speed reducer to be designed.
The design of the speed reducer is considered with the face width (b) , module of teeth (m),
number of teeth on pining (z), length of shaft 1 between bearings (l1) , length of the shaft 2 between
bearings (l2), diameter of the shaft 1 (d1), diameter of shaft 2 (d2) respectively. The constraints
include limitations on the bending stress of gear teeth, surface stress, transverse deflections of shaft
1 and 2 due to transmitted force, and stresses in shafts 1 and 2. Our objective is to minimize the
total weight and stress of the speed reducer. The weight of the speed reducer includes both the
weight of the gears as well as the weight of the shafts [4].
3.2.3 Constraints:
Where,
2.6 x1 3.6, 0.7 x2 0.8, 17 x3 28
7.3 x4 8.3, 7.3 x5 8.3, 2.9 x6 3.9
5 x7 5.5
Chapter no. 04
Solving Speed Reducer Design Problem using MOALO
Algorithm in MATLAB
Figure 14
Figure 15
Figure 16
Figure 17
At 50 iterations:
Figure 18
At 100 iterations:
Figure 19
At 500 iterations:
Figure 20
5.1. Conclusion
Multi Objective Ant Lion optimizer Algorithm is a metaheuristic approach inspired by nature. It
is developed to solve engineering problems with multiple objectives. Monotonically decreasing
behavior makes this algorithm best to solve the engineering problems which is discussed in detail
in previous chapters. Even in first 50-100 iterations, the desired objective is achieved with certain
error.
In this document, simulations of speed reducer design problem has been shown using different
number of iterations and different number of available solutions in Archive using multi objective
ant lion optimizer. Figure 18, 19 and 20 in chapter 4 shows different results at iteration 50,100 and
500 and at 100, 40 and 400 available solutions in archive respectively. Figure 18, 19 and 20 show
the Pareto optimal fronts with objective function 1 values at X-axis and values of objective
function 2 at y-axis. It can be seen that if we get the minimum value of objective function 1 then
at the same time the value of objective function 2 is not the best optimized. So we have to
compromise on any one of the objective function to obtain optimal solution. In all these cases, the
convergence behavior of the multi objective ant lion optimizer algorithm remained quite
convincing.
Multi objective Ant lion optimizer algorithm is not only best for the constrained problems but also
has capability of handling unconstrained problems. The simulation of one unconstrained multi
objective test function has been shown in chapter 2. Also some of unconstrained engineering
problems are proposed to solve in [1] by multi-objective ant lion optimizer.
A comparison of multi objective Ant Lion Optimizer with MOPSO (Multi Objective Particle
Sworn Optimization), NSGA-II is discussed in [1] on different test functions, MOALO is the best
so far.
References
[2] M. B. J. E. Goodenough J, "Perspectives on animal behavior.," in John Wiley & Sons, 2009.
[4] C. CAC, "Use of a self-adaptive penalty approach for engineering optimization problems.,"
2000.