0% found this document useful (0 votes)
8 views43 pages

Natureinspired Algorithm UNIT6 ACO and BCO

Uploaded by

bukharimohsin176
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views43 pages

Natureinspired Algorithm UNIT6 ACO and BCO

Uploaded by

bukharimohsin176
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 43

Nature Inspired Algorithms:

Nature-inspired algorithms:

Nature-Inspired Algorithms (NIAs) are
computational algorithms that take inspiration from
natural processes and phenomena to solve complex
optimization and search problems.

These algorithms are often based on biological
evolution, animal behavior, physics, or other
natural systems. Examples include Genetic
Algorithms (GA), Particle Swarm Optimization
(PSO), Ant Colony Optimization (ACO), and
Artificial Bee Colony (ABC) algorithms.
Key Features of Nature-Inspired
Algorithms:
1. Stochastic Nature: NIAs are probabilistic rather than
deterministic, using randomness to explore and exploit
search spaces.
2. Population-Based: Most NIAs operate on a
population of potential solutions rather than a single
solution.
3. Adaptivity: These algorithms adapt dynamically
based on feedback from the environment or the fitness
landscape.
4. Parallelism: Many NIAs allow parallel processing, as
multiple candidate solutions evolve or interact
simultaneously.
5. Scalability: Suitable for large-scale, complex, or
multidimensional problems.
Differences Between Nature-
Inspired Algorithms and Traditional
Approaches:
Metaheuristics:

Metaheuristics are strategies that guide the search process.

The goal is to efficiently explore the search space in order to find
near–optimal solutions.

Techniques which constitute metaheuristic algorithms range
from simple local search procedures to complex learning processes.

Metaheuristic algorithms are approximate and usually non-
deterministic.

7
Ant Colony and Bee Colony
Optimization
ACO:

Ant Colony Optimization technique is purely inspired
from the foraging behaviour of ant colonies, first
introduced by Marco Dorigo in the 1990s.

Pheromones are organic chemical compounds secreted
by the ants that trigger a social response in members of
same species.

Since most ants live on the ground, they use the soil
surface to leave pheromone trails that may be followed
(smelled) by other ants.
Pseudocode:
Flowchart for ACO:
• Ants live in community nests and the underlying principle
of ACO is to observe the movement of the ants from their
nests in order to search for food in the shortest possible
path.
• Initially, ants start to move randomly in search of food
around their nests. This randomized search opens up
multiple routes from the nest to the food source.
• Now, based on the quality and quantity of the food, ants
carry a portion of the food back with necessary pheromone
concentration on its return path.
• Depending on these pheromone trials, the probability of
selection of a specific path by the following ants would be a
guiding factor to the food source.
• Evidently, this probability is based on the concentration as
well as the rate of evaporation of pheromone. It can also
be observed that since the evaporation rate of pheromone
is also a deciding factor, the length of each path can easily
be accounted for.
for simplicity, only two possible paths have been considered between the food source and
the ant nest. The stages can be analyzed as follows:
Stage 1: All ants are in their nest. There is no pheromone content in the environment. (For
algorithmic design, residual pheromone amount can be considered without interfering with
the probability)
Stage 2: Ants begin their search with equal (0.5 each) probability along each path. Clearly,
the curved path is the longer and hence the time taken by ants to reach food source is
greater than the other.
Stage 3: The ants through the shorter path reaches food source earlier. Now, evidently they
face with a similar selection dilemma, but this time due to pheromone trail along the shorter
path already available, probability of selection is higher.
Stage 4: More ants return via the shorter path and subsequently the pheromone
concentrations also increase. Moreover, due to evaporation, the pheromone concentration
in the longer path reduces, decreasing the probability of selection of this path in further
stages. Therefore, the whole colony gradually uses the shorter path in higher probabilities.
So, path optimization is attained.
Ant Colony Optimization


The way ants find their food in shortest path is
interesting.

Ants secrete pheromones to remember their path.

These pheromones evaporate with time.
Ant Colony Optimization..


Whenever an ant finds food , it marks its return
journey with pheromones.

Pheromones evaporate faster on longer paths.

Shorter paths serve as the way to food for most of
the other ants.
Ant Colony Optimization


The shorter path will be reinforced by the
pheromones further.

Finally , the ants arrive at the shortest path.
ACO-TSP


Given a graph with n nodes, should give the
shortest Hamiltonian cycle

m ants traverse the graph

Each ant starts at a random node
Transitions


Ants leave pheromone trails when they make a
transition

Trails are used in prioritizing transition
Transitions


Suppose ant k is at u.

Nk(u) be the nodes not visited by k

Tuv be the pheromone trail of edge (u,v)

k jumps from u to a node v in Nk(u) with
probability
puv(k) = Tuv ( 1/ d(u,v))
Iteration of AOC-TSP


m ants are started at random nodes

They traverse the graph prioritized on trails and
edge-weights

An iteration ends when all the ants visit all nodes

After each iteration, pheromone trails are updated.
Updating Pheromone trails


New trail should have two components
 Old trail left after evaporation and
 Trails added by ants traversing the edge during the
iteration

T'uv = (1-p) Tuv + ChangeIn(Tuv)

Solution gets better and better as the number of
iterations increase
Performance of TSP with ACO heuristic


Performs better than state-of-the-art TSP
algorithms for small (50-100) of nodes

The main point to appreciate is that Swarms give
us new algorithms for optimization
Bee Algorithm
The Artificial Bee Colony (ABC) algorithm is a
swarm-based meta-heuristic technique used for
numerical problem optimization. It was inspired
by honey bees’ clever foraging behaviour. The
model is made up of three key components:
employed and unemployed foraging bees, as
well as food sources.
About Bee Colony
Food sources, employed bees, a unemployed bees, foraging
behaviour, and dances may all be summarised in the brains of
genuine honey bees.
Food sources
•Bee chooses a certain flower (food source) when hunting for
food.
•The amount of nectar in this food source, efforts to put in to
collect this nectar, and distance to be travelled and in which
direction it is from the nest.
• This information that the bee gathers from this food supply.
• For the purpose of ease and simplicity, Bee maintains this
information as a single amount which could be referred to as
overall profitability for this particular food source.
Employed bees:
A certain group of bees takes use of the available food sources. These
bees are known as employed bees, and each of them maintains the
profitability of the linked food supply i.e., richness, distance, and
orientation from the hive.
Unemployed bees:
With a certain likelihood, employed bees communicate their information
with another set of bees known as unemployed bees. Unemployed bees
are in charge of summarising information from employed bees and
choosing a food source to exploit. These unemployed bees are further
separated into two groups.
•The Onlooker bees are the bees who gather information from the
colony’s hired workers and, after analysing the data, build a food source
for the colony.
•The Scouts bees are in charge of locating new food sources around the
hive.
Foraging Behaviour:

Foraging behaviour is the most significant attribute of
a honey bee swarm.

During the foraging phase, the bee exits the hive and
begins looking for food.

When a bee finds a food supply, it extracts and stores
the nectar.

The honey-making process then begins with the
production of enzymes, and after reaching the hive,
nectar is unloaded in empty cells.

Finally, the bee uses various sorts of dance to convey
the knowledge to other bees in the hive.
Dance:

To communicate with other bees in the hive about the
information collected about food sources the employed bee
performs a dance on various portions of the hive area.
Employed bees execute one of the following dance types
depending on the profitability of the food supply.
• The round dance is done when the food source is close to the
hive.
• Waggle dance notifies other bees about the direction of the
food supply in relation to the sunlight. This also indicated that
the food source is far away from the hive. The distance between
the food source and the hive is proportional to the speed of the
dance.
• If a bee takes a long time to discharge nectar, then begins
to tremble, indicating that the present profitability of the food
supply is unaware.
Bees Foraging


Recruitment Behaviour :
 Waggle Dancing
 series of alternating left and right loops
 Direction of dancing
 Duration of dancing

Navigation Behaviour :
 Path vector represents knowledge representation of
path by inspect.
About ABC:

Honey bees’ foraging behaviour inspired the ABC
algorithm. The honey bee swarm is an example of a
natural swarm that searches for food in a coordinated
and intelligent manner.

The honey bee swarm has several characteristics,
including the ability to convey information,
memorise the surroundings, retain and distribute
knowledge, and make decisions based on that
information.

The swarm adapts to changes in the environment by
dynamically assigning jobs and progressing through
social learning and teaching.
ABC algorithm is a population-based optimisation method that
evaluates fitness, therefore the population of candidate solutions is
predicted to gravitate toward the search space’s better fitness areas.
Through natural motivation, population-based optimisation algorithms
find near-optimal solutions to challenging optimisation problems.
Algorithm


It has two steps :
 ManageBeesActivity()
 CalculateVectors()

ManageBeesActivity: It handles agents activities
based on their internal state. That is it decides
action it has to take depending on the knowledge it
has.

CalculateVectors : It is used for administrative
purposes and calculates PI vectors for the agents.
Working of ABC:

Swarm-based optimization algorithms use
collaborative trial and error approaches to identify
solutions.

The ABC optimisation algorithms are driven by the
peer-to-peer learning behaviour of social colonies.
ABC consists of a population of potential solutions
and finds the optimal solution with an iterative
process.

The two essential factors that determine the
development of an ABC population are variation and
selection. The variation process explores diverse
sections of the search space. The selecting procedure
guarantees that past experiences are utilised.
The ABC algorithm is divided into four phases: the initialization
phase, the employed bees phase, the scout and the onlooker bees phase.
In the initialization of the population, ABC generates a uniformly
distributed population of solutions where each solution is a dimensional
vector. The number of dimensions depends on the number of variables
in the optimization problem for a particular food source in the
population.
The employed bees modify the current solution based on the
information from individual experiences and the fitness value of the
new solution. If the fitness value of the new food source is higher than
that of the old food source, the bee updates the position with the new
one and discards the old one. The position is updated using the
dimensional vectors defined earlier in the initial phase with the size of
steps needed to get the updated positions. Step size is a random number
between –1 to 1.
Uses of Bee Algorithm


Training neural networks for pattern recognition

Forming manufacturing cells.

Scheduling jobs for a production machine.

Data clustering
Comparisons

Ants use pheromones for back tracking route to
food source.

Bees instead use Path Integration. Bees are able to
compute their present location from past trajectory
continuously.

So bees can return to home through direct route
instead of back tracking their original route.

Does path emerge faster in this algorithm.
Results


Experiments with different test cases on these
algorithms show that.
 Bees algorithm is more efficient when finding and
collecting food, that is it takes less number of steps.
 Bees algorithm is more scalable it requires less
computation time to complete task.
 Bees algorithm is less adaptive than ACO.
Applications:


Swarmcasting:
 For fast downloads in a peer-to-peer file-sharing
network
 Fragments of a file are downloaded from different
hosts in the network, parallelly.

AntNet : a routing algorithm developed on the
framework of Ant Colony Optimization

BeeHive : another routing algorithm modelled on
the communicative behaviour of honey bees

You might also like