Download as pdf or txt
Download as pdf or txt
You are on page 1of 20

Chapter 3

OPTIMIZATION

This chapter gives a brief introduction to meaning of optimization problems and trends in
solving different optimization problems. Further this chapter elaborates on various optimization
techniques and in particular two swarm based meta-heuristic techniques: Ant Colony
Optimization & Particle Swarm Optimization.

1.1 Introduction
Optimization problems are common to almost all domains. Optimization deals with finding the
best solution which is optimal or near-optimal. For large problems it is often difficult to find the
optimal solution. Optimality is defined with respect to some goal or goals. These goals are also
known as objective functions. Problem solving is not a one-step solution but a series of steps
that need to be followed sequentially one after the other. Researchers have also defined the
steps that one must follow to solve a problem like, recognizing and defining problems,
constructing and solving models, and evaluating and implementing solutions [17]. Scheduling
of tasks in cloud is an optimization problem that is concerned with the efficient allocation of
limited resources to meet desired objective. Objective is defined via an objective function.
Generally, there are many possible alternatives to consider and an objective determines which
of these alternatives is best. So, all moves around the objective function. Slightest of change in
the objective function can lead to different solution or alternative.
Developers are confronted with a large number of optimization problems. In such problems,
different decision alternatives exist and developer has to select one of these. Impact of selecting
one of the available alternatives as optimal or near-optimal can be measured by some kind of
evaluation criteria. Generally, the optimization problems deal with either maximizing or
minimizing the evaluation function. For example, increasing the profits and decreasing the cost.
In optimization problems, developers are interested in choosing the alternative that either
maximizes or minimizes an evaluation function which is defined on the selected evaluation
criteria.
Optimization problems have the following characteristics:

• Numbers of decision alternatives are available from which one alternative is selected.
• Selection of the alternate is subject to constraints that limit the number of available
alternatives.
• Evaluation criteria is directly affected by choice of decision alternate.
• An evaluation function defined on the decision alternatives helps to describe the effect of
thedifferent decision alternatives.
Decision alternate for an optimization problem should be based on all available constraints and
the one that maximizes/minimizes the evaluation function.
Formally we can say that optimization problem is to find an x* X for which
f (x*) ≥ f (x) for all x X (maximization problem)
f (x*) ≤ f (x) for all x X (minimization problem)where:
Xis a set of feasible solutions x X f :X →R is an evaluation function that assigns a real value
to every element x of the search [17].

3.2 Search Spaces

In optimization models, decision variables x∈X indirectly contain the definition of the search
space X. Formally, search space may be defined as set of feasible solutions of an optimization
problem. Search space also define relationships between solutions.
Topological space is also a second name for search space. A topological space describes the
similarities between the solutions using relationships between the set of solutions and not by
defining distances between solutions. A topological space is an ordered pair (X,T), where X is a
set of solutions and T is a collection of subsets of X called open sets. Metric search spaces are a
specialized form of topological spaces where the similarities between solutions are measured by
a distance. Neighborhoodis used to find the solutions that are similar to each other [17].

Optimal Solutions

A globally optimal solution for an optimization problem is defined as the solution x∗∈X, where
f(x∗) ≤ f(x) for all x ∈X (minimization problem). It is important that neighbourhood, a metric or
search space is defined for the solution properly in order to define the globally optimal solution.
Given a problem instance (X, f) and a neighborhood function N, a feasible solution X is
called locally optimal (minimization problem) with respect to N if
f(xI) ≤ f(x) for all x∈N(xI)
A locally optimal solution does not exist if no neighborhood is defined. Furthermore, the
neighbourhood helps to determine the existence of local optima as different local optima
solutions are provided by neighbours at the same time for the same problem [17].
Optimization is used to ensure that near optimal (if not optimal) solutions are provided to the
user. The effort needed to the solve that problem refers to the problem difficulty which can be
expressed in terms of computing time needed and memory space needed to solve it.

3.3 Problem Difficulty


The complexity of an algorithm is the effort required to solve a particular problem in terms of
memory needed and time required to solve it. The effort needed increases with the increase in
input size of the problem. The effort needed by some algorithms grow exponentially as the input
size grows. Effort is defined in terms of minimum time needed to solve a problem [17].
Both the algorithm complexity and problem difficulty are closely related. Complexity of an
algorithm can be defined in terms of both the minimum and the maximum effort needed to solve
the problem. Complexity or effort needed to solve a problem is always defined in terms of
maximum effort or the upper bound of the complexity for any solution available.
Lower bound complexity is used to express the effort only when it can be proved that no other
algorithm exists that can solve the problem in lesser time.

3.4 Complexity Classes


The decision problems using the Computational complexity can be categorizedusing their
difficulty. The number of resources required and the effort needed is used to represent the
problems difficulty [17].
Complexity to solve a problem is defined both in terms of the time complexity and the space
complexity. Number of operations or number of steps needed to solve a problem define the time
complexity of the problem and for some problems it can be extremely large [17]. On the other
hand, space complexity refers to the maximum memory that will be required to solve the
problem [17]. Both the complexities are inversely related to each other depending on the
constraint, we can improve one type of complexity by compromising on other complexity. Both
can be represented using lower and upper bound. Upper bound defines that there exists a
solution to the problem and lower bound defines that there does not exist any other solution that
will take less effort then the chosen solution to solve the problem. A complexity class is a set of
computational problems where the amount of computational resources that are necessary to
solve the problem shows the same asymptotic behaviour [17]. Input size is crucial in defining
the bounds or efforts needed to solve the problem. Usually, n is much smaller than the size |X| of
the search space. Typical bounds are asymptotic lower or upper bounds on the time that is
necessary to solve a particular problem.

3.4.1 Complexity Class P


Here, P stands for polynomial time and the problems that are solvable in polynomial time for
the worst-case complexity can be defined using this class. The time that is necessary to solve a
decision problem in P is asymptotically bounded (for n >n0) by a polynomial function O(nk).
Every problem that belongs to class P is guaranteed to have a solution that takes polynomial
time to solve it, i.e.O(nk), for some k [17].

3.4.2 Complexity Class NP


Some problems exist for which the answer may be a yes or no. Of these problems, for some it is
possible to verify the result yes in polynomial time, but it is not possible to specify the time it
requires to verify the result no. In other words, the time to provide solution yes for a problem
much be polynomial or polynomial bound [17].
Such problems come under the class NP, where NP stands for non-deterministic time. For such
class of problems, the solution yes is verifiable in polynomial time and the solutions do not
specify any lime limit it will take to verify the solution no. Informally, the class NP consists of
all “reasonable” problems of practical importance where a yes solution can be verified in
polynomial time: this means the objective value of the optimal solution can be calculated fast.
For problems not in NP, even verifying that a solution is valid (is a yes answer) can be
extremely difficult (needs exponential time).
Non-deterministic algorithms can also be used to define complexity class NP. Non-deterministic
algorithms are algorithms which have the additional ability to guess any verifiable intermediate
result in a single step. If we assume that we find a yes solution for a decision problem by
iteratively assigning values to the decision variables, a non-deterministic algorithm always
selects the value (possibility) that leads to a yes answer, if a yes answer exists for the problem.
Therefore, we can view a non-deterministic algorithm as an algorithm that always guesses the
right possibility whenever the correctness can be checked in polynomial time. The class NP is
the set of all decision problems that can be solved by a non-deterministic algorithm in worst-
case polynomial time. The two definitions of NP are equivalent to each other. Although non-
deterministic algorithms cannot be executed directly by conventional computers, this concept is
important and helpful for the analysis of the computational complexity of problems [17].
All problems that are in P also belong to the class NP. Therefore, P ⊆NP. An important question
in computational complexity is whether P is a proper subset of NP (P ⊂NP) or whether NP is
equal to P (P = NP). Most researchers assume that P = NP and there are problems that are in NP,
but not in P.

3.4.3 Tractable and Intractable Problems


It is possible to make a difference between exponential running time and polynomial running
for an algorithm. Tractable problems are the one for which a solution can be found for the
worst-case scenario using a polynomial-time algorithm and the upper bound for the same can be
defines in terms of power of some constant k such as O(nk).“Usually, tractable problems are
easy to solve as running time increases relatively slowly with larger input size n. For example,
finding the lowest element in an unordered list of size n is tractable as there are algorithms with
time complexity that is O(n). Spending twice as much effort solving the problem allows us to
solve problems twice as large.”

Problems that cannot be solved in polynomial time are called intractable problems for which it
is possible to define lower bound on the running time. For example, guessing the correct
number for a digital door lock with n digits is an intractable problem, as the time necessary for
finding the correct key is Ω(10n). For this problem, the size of the problem is n, whereas the size
of the search space is |X| = 10n. The effort to find the correct key depends on n and increases at
the same rate as the size of the search space. Below is the growth rate of some common
functions [17].
Table 3.1:Polynomial (top) and exponential
(bottom) functions [17] Function Growth Rate
Constant O(1)
Logarithmic O(logn)
Linear O(n)
Quasilinear O(nlogn)
Quadratic O(n2)
polynomial (of order c) O(nc), c >1
Exponential O(kn)
Factorial O(n!)
super-exponential O(nn)

We can categories problems into three different types on the basis of the difficulty.
• First type of problems that can be easily solved in P (polynomial time) are called tractable
problems.
• Second category of problem is more difficult as compared to tractable problems and there
does not exist any polynomial time solution for it, called the intractable problems.
• Problems where no polynomial-time algorithm is known but intractability has not yet been
shown. These problems are also difficult.

3.4.4 NP-Hard and NP-Complete


It is easy to solve the tractable problems in P (polynomial time) using the “right” algorithm.
Some problems are not part of class P, but are part of class NP.Such problems are extremely
complex and cannot be solved in polynomial time.
Among the decision problems in NP, it is possible to covert those into polynomial time
algorithms using a little effort. Consequently, a problem is denoted NP-hard if an algorithm for
solving this problem is polynomial-time reducible to an algorithm that is able to solve any
problem in NP. A problem A is polynomial-time reducible to a different problem B if and only
if there is a transformation that transforms [17].
3.5 Classification of optimization algorithms: Number of methods are available to solve the
Optimization problems. Broadly, the solution to optimization problems can be classified into
deterministic algorithms and non-deterministic algorithms [18]:

1.5.1 Deterministic algorithms


These algorithms are iterative in nature. No matter how many times you execute them, they
provide the same solution by following the same path. The algorithms are based on the
mathematical model. Past few decades have seen major research in the design and development
of deterministic algorithms.
Some of the examples of classical deterministic algorithms aredynamic programming,
gradientbased (GB) and gradient-free (GF) methods, linear programming (LP), convex
programming, quadratic programming and nonlinear programming (NLP). Mostly used for
solving problems in continuous space, deterministic algorithms are extremely accurate.
Objective functions for each solution must provide some gradientbased information for these
deterministic algorithms to decide which path they need to follow next. Also, a suitable starting
point must be selected with proper definition of constraints is important.
3.5.2 Non-deterministic or stochastic methodsin sharp contrast to deterministic algorithms
happen to produce different solutions rather than the same solution and also tend to explore
different paths in the overall search space to provide these solutions in each run. Deterministic
algorithms tend to get caught in local optima and non-deterministic algorithms escape the local
optima by exploring different regions of search space simlutaneosly and reach global optima.
[19].
Fig. 3.1: Classification of optimization algorithm[20]

Stochastic optimization algorithms are of two types


Heuristicalgorithms use trial and error to find or discover solutions. The general problem with
heuristic algorithms is that they do not assure that the solution will be the best solution. Another
major limitation is that these are problem dependent.

The second generation of the optimisation methods is meta-heuristicthat gives much better
results than the heuristic algorithms and are used to solve extremely large and complex
problems that cannot be solved in polynomial time. Agents in metaheuristic algorithms tend to
explore the search space at the same time to look for near optimal solutions based on some pre-
defined objective function. Metaheuristic algorithms can be broadly classified into different
categories given in the literature [21,22]. Metaheuristic algorithms can be class into categories
like trajectory-based algorithms or population-based algorithms.
3.6 Nature-Inspired Computing
As the name suggests, it refers to a set of algorithms that are inspired by some natural
phenomena like the environment, science or animals. They tend to provide the guidelines for
solving many difficult computing problems. The heuristic guidelines used are often simple, and
the rules are usually inspired by natural phenomena or laws.

Broad Classification of Nature Inspired Computing: They can be grouped into three broad
classes: Physics-based algorithms (PBA), Chemistry-based algorithms (CBA) and
Biology-based algorithms (BBA) [23].
Fig. 3.2: Classification of nature inspired computing techniques [20]

3.6.1 Biology-Based Algorithms:

Biology-based “algorithms canbe classified into three groups:

Evolutionary Algorithms (EA): The fundamental idea of evolutionary algorithms is based on


Darwin‟s theory of evolution. Different variants of EAs such as Evolutionary Programming
(EP)[24], Evolution Strategies (ES) [25, 26], Genetic Algorithm (GA) [27], Genetic
Programming (GP), Differential Evolution (DE) and Cultural Algorithm (CA) are discussed in
the book by Siddique and Adeli [28].
Swarm Intelligence algorithms (SIA): These algorithms find their motivation from natural
behaviour of animals used by them to either survive or do routine daily work. Self-organised
coordination of ants searching for food or birds moving to their hones making large smarms are
best examples of it [29, 30].”
Fig. 3.3: Classification of Bio-inspired algorithms[20]

3.7 Modelling approach:


It refers to the process of understanding the methodologies and the biological behaviour of some
natural phenomena and mapping it to the problem in hand. Following are the steps that are
followed to model a bio-inspired algorithm to solve a problem:
Fig. 3.4: Modelling approach [31]
3.8 SWARM INTELLIGENCE
Swarm intelligence algorithms are inspired from the collective behaviour of species [32, 33].
Some of the examples of such species are bees, ants, fish, & birds. the concept of such
algorithms originated from the social behaviour of species that compete for foods. Two of the
most popular swarm intelligence algorithms are Ant Colony Optimization algorithm based on
behaviour of ants and Particle Swarm Optimization based on the behaviour of birds or fishes.

3.8.1 Ant Colony Optimization Algorithms


Ant Colony Optimization (ACO) comes under the category of metaheuristic algorithms. The
algorithm is based on real ants and how they search for food. The ants travel from their colony
to the food source. The idea taken is that ants based on path taken by earlier ants are able to find
the shortest path from colony to source of food. The ants leave pheromones as they walk.
Initially random ants select random paths. The pheromone they leave also evaporates but at
lesser intensity. So, the shortest path after some time is the one with highest pheromone
intensity which leads all other ants to follow that path. After a certain period, all ants choose
that path and which happens to be the shortest path [45].
Figure 3.5 illustrates an experiment done by Goss et al. [34] with a real colony of Argentine
ants (Iridomyrmex humilis). Ants do not rely on what they see. In the experiment, there exists
two paths between the food source and the colony of the ants. Each ant on its way to food leave
a chemical trail (pheromone) on the ground. The pheromone is a chemical substance that is also
volatile in nature and evaporates after some time. As ants leave pheromone chemical on
multiple paths as they move, the shorter paths tends to have more concentration of pheromone
and all remaining ants then follow that path eventually leading to the search of the shortest path
to the food source.
Fig. 3.5:Inspiration from an ant colony searching an optimal path
between the food andthe nest.
Why the amount of pheromone on shorter path is more than that on the larger path? It should be
otherwise. Actually, the chemical substance is volatile and has a decreasing action over time due
to evaporation process. At the very beginning, there is an equal probability for every ant to
choose either of the two paths. With time, the shorter path requires less time to reach the
destination and hence the concentration of chemical is more on that path as evaporation is less.
In the figure above, left trail is shorter than the right one leaving a higher level of pheromone.
Now, more ants are expected to follow that path due to higher pheromone trail. As the time
passes by, a situation is reached when all the ants start to follow the shorter path. This indirect
form of cooperation is known as stigmergy.
Following the algorithm for describing the Ant Colony Optimization. It begins by initializing
the pheromone value which is then followed by two iterations. The first iteration is used to
construct the solution and the second iteration is used to update the pheromone value.
“Algorithm
Template of the ACO.
Initialize the pheromone trails ;
Repeat
For each ant Do
Solution construction using the pheromone trail ;Update the pheromone trails:
Evaporation ;
Reinforcement ;
Until Stopping criteria
Output: Best solution found or a set of solutions.”

The ACO solutions are based on a probabilistic state transition rule. Artificial ants can be
considered as stochastic greedy procedures to construct a solution in a probabilistic manner by
adding solution components to partial ones until a complete solution is derived. Pheromone
trails are used to save the characteristics of “good” generated solutions that are used as a guide
to construct new solutions by the ants. Heuristic knowledge gained with each iteration is used to
update the value of the pheromone. Also, problem-specific information is used as hints to ants
in their decisions to construct solutions.

Value of the pheromone is generally assigned as a constant value at the beginning of the
solution. The update of the pheromone is carried out using the generated solutions. Update rule
for the global pheromone is applied in two phases. One at the time of evaporation phase where
the pheromone trail decreases automatically. Each pheromone value is reduced by a fixed
proportion:

τij= (1 − ρ)τij, ∀i,j∈ [1,n] [35]

where ρ ∈]0,1] represents the reduction rate of the pheromone. Evaporation is key to ensuring
that all ants to not move to premature convergence toward “good” solutions. The second phase
is called the reinforcement phase where the pheromone trail is updated according to the
generated solutions. Three different strategies may be applied [35]:

1. The pheromone trail τijis update immediately after every step of the solution
construction, also known as step-by-step update [36].
2. Updating of the pheromone trail τij is done only after the complete solution has been
generated and is called online delayed updating of pheromones.
3. Updating of the pheromone trail τij is done only after complete solution is generated by
all the ants. It is the most popular of all the methods for updating pheromone:
4. The pheromone trail τij depends on the best solution provided by all the ants that are
involved in generating the solution.
5. Last strategy is based on ranking of k ants. Pheromone value is updated on the basis of
the solution provided by best k ants with an amount depending on the ranking of the
solutions.ACO scores over other optimization algorithms because of its convergence
properties. Theoretical convergence analysis of ACO algorithms is given in. The first
convergence results were presented in. Comprehensive survey of theoretical results for
ant colony optimization are given in.

What are challenges in front of the designer when it comes to implementing ACO for problems
like scheduling or other problems? The key issues in designing an ACO is determining the
following:
Pheromone information:
Central idea of ACO is based on pheromone model. Need to define the vector of model
parameters τ called pheromone trail parameters. The pheromone values τi ∈τ should reflect the
relevant information in the construction of the solution for a given problem.
Solution construction:
Pheromone alone cannot lead to the solution and there is a need to define the local heuristic for
guiding the search.
Pheromone update:

Mainly “the reinforcementlearning strategy for the pheromone information has to be defined.
The ant system (AS) was the first application of ACO in the domain of combinatorial
optimization used for solving the travelling salesman problem. ACO algorithms can also be
used to solve the continuous optimization problems. The main issue in adapting the ACO
metaheuristic for continuous optimization is to model a continuous nest neighborhood by a
discrete structure or change the pheromone model by a continuous one. It is easy to implement
ACO for combinatorial problems. For combinatorial problems, the pheromone trails are
associated with a finite set of values related to the decisions that the ants make. The same is not
possible for continuous optimization problems. ACO was first adapted for continuous
optimization in [37]. A shift from using a discrete probability distribution to a continuous one
has led to the extensive use of ACO for continuous optimization problems as well.
It is important to initialize the parameters of ACO algorithms Table below summarizes the key
parameters of a basic ACO algorithm. It is possible to adjust some of these dynamically. For
instance, α and β can be adjusted in a dynamic or an adaptive manner during the search. The
optimal values for the parameters α and β are very sensitive to the target problem. What is the
number of ants that will be used? It is not critical but depends on the problem in hand. For
instance, in cloud scheduling the number of ants cannot be more than the number of available
resources. In other words, the number of ants for the solution depends on the computational
capacity of the experiments.”

Table 3.2: Parameters of the ACO Algorithm


Parameter Role Practical Values
Α Pheromone influence –
Β Heuristic influence –
Ρ Evaporation rate [0.01,0.2]
K Number of ants [10,50]

3.8.2 Particle Swarm Optimization

After ACO, Particle swarm optimization is also based on swarm intelligence. It is a popular
stochastic population-based metaheuristic. It mimics the social behaviour of organisms such as
birds and fishes in search of a place with enough food or position themselves against a target.
Coordinated behaviour for such swarms using local movements emerges without any central
control. In a sharp contrast to ACO, PSO was originally designed and implemented for
continuous optimization problems [38].
The first step in using PSO for solving discrete problems is to encode the problem. A particle in
the solution space can be best represented using a vector of size 1 * n, where n refers to the
number of tasks to be scheduled and value of the particle position for the vector represents the
resource index [50-57]. In simple words, this vector represents the mapping of all tasks on
available resources. other than single dimension vector, matrix can be also be used to represent
the encoding scheme, the size of the matrix is m * n, where m represents the available resources
to serve the tasks and n represents the number of tasks to be scheduled. The value for each cell
[ij] is [0,1], i.e, whether the task i has been assigned to the resource j or not. Other than
positions, velocity can also be represented using the matrix. Velocity refers to both the speed
and the direction. At each iteration, a particle moves from one position to another in the
decision space. Each solution is represented using vertex xi. A particle has its own position and
velocity, which means the flying direction and step of the particle (Fig. 3.6). The success of
some particles will influence the behavior of their peers. Each particle successively adjusts its
position xi on the basis of best position visited by itself (pbesti) or the whole swarm (gbest). The
vector (pg− xi) represents the difference between the current position of the particle i and the
best position of its neighbourhood [61].
Fig.3.6:Associated article positions using Particle swarm optimization. [60]

Definition of neighbourhood is must for each particle as it helps in influencing the position of
the peer particles. It is possible to define the neighbourhood of each particle using one the
following two methods:
 gbest Method: Whole population of particles is used to define the neighborhood using the
global best method.
 lbest Method: Topology is defined for the complete swarm in order to implement local
best method.In this topology, neighbourhood of a particle can be defined as the set of
particles that are in direct connection with it, or it is empty in case the articles are isolated.
Three vectors are used to represent a particle in PSO:
 The position (current) for each particle in the search space is represented using x-vector.
 The position (best) for each particle found by itself is represented using p-vector.
 The direction in which the particle will move is represented using a v-vector.

Fitness for the x-vector is represented using the x-fitness records and fitness for the p-vector is
represented using the p-fitness records

PSO begins which random initialization of the particles and further they are updated in each
iteration by searching for optimal result based on some criteria or objective function. The
movement of each particle during iterations depend on the best solution found by itself or te
best value found by any other particle so far, i.e. pbest or gbest respectively.

When a particle takes part of the population as its topological neighbors, the best value is a local
best and is called lbest [61].After finding the two best values, the particle updates its velocity
and positions with following equation (a) and (b) [38].

v[] = v[] + c1 * rand() * (pbest[] - present[]) + c2 * rand() * (gbest[] - present[]) (a)


present[] = persent[] + v[] (b)

The pseudo code of the procedure is as follows [38]:


“For each particle
Initialize particle
END
Do
For each particle
Calculate fitness value
If the fitness value is better than the best fitness value (pBest) in history
set current value as the new pBest
End
Choose the particle with the best fitness value of all the particles as the gBest
For each particle
Calculate particle velocity according equation (a)
Update particle position according equation (b)
End”
While maximum iterations or minimum error criteria is not attained

Particles' velocities on each dimension are clamped to a maximum velocity Vmax. If the sum of
accelerations would cause the velocity on that dimension to exceed Vmax, which is a parameter
specified by the user. Then the velocity on that dimension is limited to Vmax [38].

3.9 Evolutionary Computation


Evolutionary computation algorithms are inspired by biological evolution. Evolutionary
algorithms are also known as population-based trial and error problem solvers with a
metaheuristic or stochastic optimization character. These algorithms are based on generation of
initial set of candidate solutions and iteratively updating these solutions. Idea is to remove the
less desired solutions stochastically with each new iteration or generation. In biological
terminology, a population of solutions is subjected to natural selection and mutation. As a
result, the population will gradually evolve to increase in fitness, in this case the chosen fitness
function of the algorithm. the ability to produce highly optimized solutions for a wide range of
problems make them popular in computer science. A large number of variations of algorithms
in this family exist that are natural solutions to many computer science problems.

3.9.1 Genetic Algorithm

Genetic Algorithm (GA) is a search-based optimization technique. It is based on the principles


of Genetics and Natural Selection. The main objective of using genetic algorithm to find near
optimal solution for very large and complex problems in lesser time. The main usage of genetic
algorithm is in the field of machine learning and is applied to optimization problems.
Genetic Algorithms (GAs) are also known as search-based algorithms based on the concepts of
natural selection and genetics. genetic algorithms belong to the family of evolutionary
computation. John Holland and team developed Genetic Algorithms at the University of
Michigan and has since been successfully implemented in various optimization problems.
various extensions to Genetic Algorithms have also been tested.
It all begins with a population of possible solutions to the given problem. These solutions are
then put to recombination and mutation producing new solutions or generations. The process is
repeated over again and again to produce series of generations. Selection of solutions or
candidates is based on a fitness function which is designed on the basis of the problem in hand.
The solutions or candidates with better value have more chances of getting selected again and
the less desired solutions with poor value are dynamically removed. The better individuals or
solutions keep evolving over generations, till we reach a stopping criterion.

Following are some basic terminologies used in GA:


Population − It is a subset of all the possible solutions to the given problem.
Chromosomes − A chromosome is one such solution to the given problem.
Gene − A gene is one element position of a chromosome.
Generation− A generation, is simply the full set of the results of a GA iteration.
Selection − Selection refers to assigning higher probability of using best performing (highest
fitness) chromosomes for breeding the next generation.
Crossover – It is method used for selecting chromosomes to be used for breeding the subsequent
generations. A pair of selected strings of N bits in length would be chosen, and a random integer
c generated as point of crossover of some size (say, 0 <c<N). The 2 strings are then
independently split at this crossover point c and reassembled using the head of one string and the
tail of the other, forming a pair of new chromosomes.
Mutation – It is a technique that simply flip the bit of a random gene and push the entire
chromosome forward to the subsequent generation.
Fitness – It refers to a metric to measure the best fit of a hypothesis.
The fitness function based on which the selection of fit chromosomes is done is key to the
success of genetic algorithm. Also, the decision on how to terminate the genetic algorithm plays
vital role in its execution time and overall accuracy.

Pseudo-Code for Genetic Algorithm


//initialize the population and compute the fitness
initialize population
find fitness of population
do
parent selection
crossover with probability pc
mutation with probability pm
decode and fitness calculation
survivor selection
while (termination criteria is reached);
// the final solution is returned
return best
Fig. 3.7: Genetic algorithms steps.

You might also like