Ant Colony Optimization (ACO)
Firefly Algorithm
Modified Firefly Algorithm
BAT Algorithm
Artificial Bee Colony (ABC)
Presented by
Dr. C.Gokul,AP(Sl.Gr)/EEE
Velalar College of Engg & Tech , Erode
Metaheuristic Methods
• Ant Colony Optimization (ACO)
• Modified Ant Colony Optimization (MACO)
• Firefly Algorithm
• Modified Firefly Algorithm
• BAT Algorithm
• Artificial Bee Colony (ABC)
• Modified Artificial Bee Colony (MABC)
Ant Colony Optimization (ACO)
• ACO is inspired by the behavior of real ants
• Ants find shortest path from their nest to the food
• Pheromone: Ant excrete a hormone
• Ants find a shortest path due to pheromone trails left by ants
from their nest to the food and back
ACO Rules
• Pheromone Trail τ𝑖𝑗 - Degree of favorability
• ACO combines pheromone information with heuristic values
to find solutions
• Pheromone trail Update
𝜌 −Evaporation factor (determines the pheromone speed)
𝛥𝜏 −Amount of pheromone deposited by the ant
𝛾 −Waiting number until global best ant solution used again
𝜏𝑖𝑗 = 𝜌. 𝜏𝑖𝑗 + 𝛥𝜏
• Ant density model: Pheromone trail quantity left by ant
through their paths is constant.
probij - Probability of ant
τij - Pheromone trail
β - Parameter used to enhance the heuristic value.
𝑝𝑟𝑜𝑏𝑖𝑗 =
𝜏𝑖𝑗 𝛽
෍
j=1
𝑤
𝜏𝑖𝑗 𝛽
Ant Colony Optimization (MACO)
ACO based Test Scheduling Procedure
• Compute heuristic information (wprefer)
• Set ACO parameters
• Initialize pheromone trails
• While (result unsatisfied)
While ( )
While ( )
{
Ant exploration process
}
Find Iteration best ant solution
Find Global best ant solution
𝑁𝑖𝑏∠𝛾
𝑖∠𝑁𝑐𝑜𝑙𝑜𝑛𝑦
Firefly Algorithm
• Firefly Algorithm is inspired by the behavior of fireflies
• Firefly movement contains two elements:
➢ Approach to better solutions
➢ Move randomly
• Main assumptions:
➢All fireflies are unisex
➢Brightness is determined by objective function
𝐴𝑡𝑡𝑟𝑎𝑐𝑡𝑖𝑣𝑒𝑛𝑒𝑠𝑠 𝛼 𝐵𝑟𝑖𝑔ℎ𝑡𝑛𝑒𝑠𝑠,
𝐴𝑡𝑡𝑟𝑎𝑐𝑡𝑖𝑣𝑒𝑛𝑒𝑠𝑠 𝛼
1
𝐷𝑖𝑠𝑡𝑎𝑛𝑐𝑒
Distance, Attractiveness and Movement
• Distance between i and j fireflies at 𝑥𝑖and 𝑥𝑗
Cartesian distance 𝑟𝑖𝑗 = || 𝑥𝑖 – 𝑥𝑗||
• Attractiveness 𝛽 varies with distance between two fireflies
[𝛽0=1, 𝛾=1]
• Firefly movement
𝑥𝑖 = 𝑥𝑖 + 𝛽 (𝑥𝑗 − 𝑥𝑖) + α(rand-0.5)
For scheduling: Random number (rand)= 0.2, Randomization
parameter (α)=0.3
𝛽 = 𝛽0 𝑒−𝛾𝑟2
Yes
No
No
Define absorption coefficient γ
Formulate light intensity I [I=f(x)]
Initialize Fireflies parameters, initial population Xi, where i =1,
2…n
Increment Gen by 1
For i = 1: n
For j = 1: n
f (Xj) > f (Xi)
Move firefly i towards firefly j
Best solution obtained
Terminate Process
Gen >
maxGen
Yes
Evaluate new solutions
Flow chart for Firefly Algorithm
Modified Firefly Algorithm
• Drawbacks of Firefly algorithm
➢Update of firefly movement is not faster
➢Direction of the fireflies movement depends on α
➢α is high for fireflies which are spread in large search
space region
➢For better locations, less randomness is beneficial
• Modified Firefly algorithm
➢α should be high initially and then decreases
➢Fireflies are encouraged to move in all directions of search
space initially and then converge in later stages
➢Fireflies should cover the maximum predefined area
➢Increases the speed of movement
Firefly Movement Update
• Firefly movement
𝑥𝑖 = 𝑥𝑖 + 𝛽 (𝑥𝑗 − 𝑥𝑖) + (rand-0.5)
where
• Firefly i attracted to the best solution if no local best solution
existed in the neighbourhood
𝛼 𝑢𝑝𝑑𝑎𝑡𝑒
൯𝛼 𝑢𝑝𝑑𝑎𝑡𝑒 = 𝛼 + 𝜆(𝑥𝑖 − 𝑔 𝑏𝑒𝑠𝑡
Yes
No
No
Define absorption coefficient γ
Formulate light intensity I [I=f(x)]
Initialize Fireflies parameters, initial population Xi, where i =1,
2…n
Increment Gen by 1
For i = 1: n
For j = 1: n
f (Xj) > f (Xi)
Best solution obtained
Terminate Process
Gen >
maxGen
Yes
Update Distance, Movement by updating the value of α
Evaluate new solutions
Move firefly i towards firefly j
Flow chart for Modified Firefly Algorithm
BAT Algorithm
• BAT Algorithm is based on echo location behaviour of bats
• Bat emit signals (with frequency ‘f’) to locate prey. This
signals bounce back if they hit an object.
• Eco signals are used to calculate the distance
• After hitting and reflecting, the bats transform their own pulse
into useful information to explore how far away the prey is.
• Rate of pulse emission r[0,1]
– 0 means there is no emission
– 1 means Bat emission is maximum
BAT Algorithm Rules
• All bats use echolocation to sense distance and they know the
difference between food/prey
• Bats fly randomly with
– Velocity vi
– Position xi
– with a fixed frequency fmin
– varying wavelength λ
– Loudness A0 to search the prey
• Loudness varies from positive large value 𝐴0 to minimum
value 𝐴 𝑚𝑖𝑛.
Bat Motion
• 𝑓𝑖 = 𝑓 𝑚𝑖𝑛 + 𝑓𝑚𝑎𝑥 − 𝑓 𝑚𝑖𝑛 𝛽
𝑓 𝑚𝑖𝑛 =1 kHz, 𝑓𝑚𝑎𝑥 = 90 kHz, 𝛽𝜖 (0, 1)
• 𝑣𝑖
𝑡
= 𝑣𝑖
𝑡−1
+ 𝑥𝑖
𝑡
− 𝑥∗ 𝑓𝑖
𝑥∗ − Current best location
• 𝑥𝑖
𝑡
= 𝑥𝑖
𝑡−1
+ 𝑣𝑖
𝑡
𝑡 − Number of iterations
BAT Algorithm Pseudocode
• Initialize bat population, position, velocity and frequency
• Initialize pulse rates , loudness
• while(t <Max iterations)
Generate new solutions by adjusting frequency, updating
velocity and location
➢ if ( rand > ri )
Select a solution among the best solutions
Generate a local solution from selected best solution
end if
𝑟𝑖 𝐴𝑖
BAT Algorithm Pseudocode
Generate new solutions by flying randomly
➢ if (test the fitness of new solution w.r.to r and A)
Accept the new solutions
Increase pulse rate , loudness
end if
Rank the bats and find the current best 𝑥∗
end while
𝑟𝑖 𝐴𝑖
Artificial Bee Colony (ABC) Algorithm
• ABC is based on the intelligent behavior of bees when they
search for honey
• Three essential components
– Food Source
– Employed Bees
– Unemployed Bees
• Two modes of behavior
– Recruitment to a food source
– Neglect of a source
• Bees can memorize, share, communicate and store the
information based on which decisions can be made
Bees evaluate the different path according to
• Quality of food
• Amount of energy usage
Agents in ABC:
• Employed Bee: They carry information about food source and
share with the neighborhood.
• Onlooker Bee: Wait in their nest and select a food source
through the information shared by employed bees.
• Scout: Responsible for finding new food, the new nectar
sources
Artificial Bee Colony (ABC) Algorithm
• Initiates the foraging in the neighborhood
• Employed bee produces new trial food position vi around xi
where 𝑥𝑖 - current food source position,
j ε { 1,2, …., D},
k ε { 1,2, …., SN} are randomly picked indices,
D - Number of search dimensions,
SN - Number of employed bees,
𝜑𝑖𝑗 - Uniform random value from [-1,1]
Employed Bee Stage
൯𝑣𝑖𝑗 = 𝑥𝑖𝑗 + 𝜑𝑖𝑗(𝑥 𝑘𝑗 − 𝑥𝑖𝑗
• In this phase employed bees share the fitness information
about updated solutions and information about their position
• Probability Pi that the employed bee with food source xi
would be picked by an onlooker bee is
Onlooker Bee Stage
𝑃𝑖 =
)𝑓𝑖𝑡(𝑥𝑖
෌ 𝑛=1
𝑆 𝑁
)𝑓𝑖𝑡(𝑥 𝑛
• In this phase the neglected food source associated bee becomes
a scout bee
• The randomly chosen food source replaces the food source
within the search space.
• The scout bee replaces the abandoned food source xi with new
food source xi as
𝑥𝑖
𝑗
= 𝑥 𝑚𝑖𝑛
𝑗
+ 𝑟𝑎𝑛𝑑 0,1 𝑥 𝑚𝑎𝑥
𝑗
− 𝑥 𝑚𝑖𝑛
𝑗
𝑥 𝑚𝑖𝑛
𝑗
and 𝑥 𝑚𝑎𝑥
𝑗
are bounds of 𝑥𝑖 in 𝑗th direction.
Scout Bee Phase
STEP 1: Initialization of nectar sources
STEP 2: Search for new nectar sources
STEP 3: Probability for the scouter to select employed foragers
STEP 4: Production of scouter
STEP 5: Production of new solution
STEP 6: Replace the original solution
STEP 7: Neglect a solution and replace it with new one
STEP 8: The best solution ever is recorded.
STEP 9: Termination
ABC Procedure

ACO, Firefly, Modified Firefly, BAT, ABC algorithms

  • 1.
    Ant Colony Optimization(ACO) Firefly Algorithm Modified Firefly Algorithm BAT Algorithm Artificial Bee Colony (ABC) Presented by Dr. C.Gokul,AP(Sl.Gr)/EEE Velalar College of Engg & Tech , Erode
  • 2.
    Metaheuristic Methods • AntColony Optimization (ACO) • Modified Ant Colony Optimization (MACO) • Firefly Algorithm • Modified Firefly Algorithm • BAT Algorithm • Artificial Bee Colony (ABC) • Modified Artificial Bee Colony (MABC)
  • 3.
    Ant Colony Optimization(ACO) • ACO is inspired by the behavior of real ants • Ants find shortest path from their nest to the food • Pheromone: Ant excrete a hormone • Ants find a shortest path due to pheromone trails left by ants from their nest to the food and back
  • 4.
    ACO Rules • PheromoneTrail τ𝑖𝑗 - Degree of favorability • ACO combines pheromone information with heuristic values to find solutions • Pheromone trail Update 𝜌 −Evaporation factor (determines the pheromone speed) 𝛥𝜏 −Amount of pheromone deposited by the ant 𝛾 −Waiting number until global best ant solution used again 𝜏𝑖𝑗 = 𝜌. 𝜏𝑖𝑗 + 𝛥𝜏
  • 5.
    • Ant densitymodel: Pheromone trail quantity left by ant through their paths is constant. probij - Probability of ant τij - Pheromone trail β - Parameter used to enhance the heuristic value. 𝑝𝑟𝑜𝑏𝑖𝑗 = 𝜏𝑖𝑗 𝛽 ෍ j=1 𝑤 𝜏𝑖𝑗 𝛽 Ant Colony Optimization (MACO)
  • 6.
    ACO based TestScheduling Procedure • Compute heuristic information (wprefer) • Set ACO parameters • Initialize pheromone trails • While (result unsatisfied) While ( ) While ( ) { Ant exploration process } Find Iteration best ant solution Find Global best ant solution 𝑁𝑖𝑏∠𝛾 𝑖∠𝑁𝑐𝑜𝑙𝑜𝑛𝑦
  • 7.
    Firefly Algorithm • FireflyAlgorithm is inspired by the behavior of fireflies • Firefly movement contains two elements: ➢ Approach to better solutions ➢ Move randomly • Main assumptions: ➢All fireflies are unisex ➢Brightness is determined by objective function 𝐴𝑡𝑡𝑟𝑎𝑐𝑡𝑖𝑣𝑒𝑛𝑒𝑠𝑠 𝛼 𝐵𝑟𝑖𝑔ℎ𝑡𝑛𝑒𝑠𝑠, 𝐴𝑡𝑡𝑟𝑎𝑐𝑡𝑖𝑣𝑒𝑛𝑒𝑠𝑠 𝛼 1 𝐷𝑖𝑠𝑡𝑎𝑛𝑐𝑒
  • 8.
    Distance, Attractiveness andMovement • Distance between i and j fireflies at 𝑥𝑖and 𝑥𝑗 Cartesian distance 𝑟𝑖𝑗 = || 𝑥𝑖 – 𝑥𝑗|| • Attractiveness 𝛽 varies with distance between two fireflies [𝛽0=1, 𝛾=1] • Firefly movement 𝑥𝑖 = 𝑥𝑖 + 𝛽 (𝑥𝑗 − 𝑥𝑖) + α(rand-0.5) For scheduling: Random number (rand)= 0.2, Randomization parameter (α)=0.3 𝛽 = 𝛽0 𝑒−𝛾𝑟2
  • 9.
    Yes No No Define absorption coefficientγ Formulate light intensity I [I=f(x)] Initialize Fireflies parameters, initial population Xi, where i =1, 2…n Increment Gen by 1 For i = 1: n For j = 1: n f (Xj) > f (Xi) Move firefly i towards firefly j Best solution obtained Terminate Process Gen > maxGen Yes Evaluate new solutions Flow chart for Firefly Algorithm
  • 10.
    Modified Firefly Algorithm •Drawbacks of Firefly algorithm ➢Update of firefly movement is not faster ➢Direction of the fireflies movement depends on α ➢α is high for fireflies which are spread in large search space region ➢For better locations, less randomness is beneficial • Modified Firefly algorithm ➢α should be high initially and then decreases ➢Fireflies are encouraged to move in all directions of search space initially and then converge in later stages ➢Fireflies should cover the maximum predefined area ➢Increases the speed of movement
  • 11.
    Firefly Movement Update •Firefly movement 𝑥𝑖 = 𝑥𝑖 + 𝛽 (𝑥𝑗 − 𝑥𝑖) + (rand-0.5) where • Firefly i attracted to the best solution if no local best solution existed in the neighbourhood 𝛼 𝑢𝑝𝑑𝑎𝑡𝑒 ൯𝛼 𝑢𝑝𝑑𝑎𝑡𝑒 = 𝛼 + 𝜆(𝑥𝑖 − 𝑔 𝑏𝑒𝑠𝑡
  • 12.
    Yes No No Define absorption coefficientγ Formulate light intensity I [I=f(x)] Initialize Fireflies parameters, initial population Xi, where i =1, 2…n Increment Gen by 1 For i = 1: n For j = 1: n f (Xj) > f (Xi) Best solution obtained Terminate Process Gen > maxGen Yes Update Distance, Movement by updating the value of α Evaluate new solutions Move firefly i towards firefly j Flow chart for Modified Firefly Algorithm
  • 13.
    BAT Algorithm • BATAlgorithm is based on echo location behaviour of bats • Bat emit signals (with frequency ‘f’) to locate prey. This signals bounce back if they hit an object. • Eco signals are used to calculate the distance • After hitting and reflecting, the bats transform their own pulse into useful information to explore how far away the prey is. • Rate of pulse emission r[0,1] – 0 means there is no emission – 1 means Bat emission is maximum
  • 14.
    BAT Algorithm Rules •All bats use echolocation to sense distance and they know the difference between food/prey • Bats fly randomly with – Velocity vi – Position xi – with a fixed frequency fmin – varying wavelength λ – Loudness A0 to search the prey • Loudness varies from positive large value 𝐴0 to minimum value 𝐴 𝑚𝑖𝑛.
  • 15.
    Bat Motion • 𝑓𝑖= 𝑓 𝑚𝑖𝑛 + 𝑓𝑚𝑎𝑥 − 𝑓 𝑚𝑖𝑛 𝛽 𝑓 𝑚𝑖𝑛 =1 kHz, 𝑓𝑚𝑎𝑥 = 90 kHz, 𝛽𝜖 (0, 1) • 𝑣𝑖 𝑡 = 𝑣𝑖 𝑡−1 + 𝑥𝑖 𝑡 − 𝑥∗ 𝑓𝑖 𝑥∗ − Current best location • 𝑥𝑖 𝑡 = 𝑥𝑖 𝑡−1 + 𝑣𝑖 𝑡 𝑡 − Number of iterations
  • 16.
    BAT Algorithm Pseudocode •Initialize bat population, position, velocity and frequency • Initialize pulse rates , loudness • while(t <Max iterations) Generate new solutions by adjusting frequency, updating velocity and location ➢ if ( rand > ri ) Select a solution among the best solutions Generate a local solution from selected best solution end if 𝑟𝑖 𝐴𝑖
  • 17.
    BAT Algorithm Pseudocode Generatenew solutions by flying randomly ➢ if (test the fitness of new solution w.r.to r and A) Accept the new solutions Increase pulse rate , loudness end if Rank the bats and find the current best 𝑥∗ end while 𝑟𝑖 𝐴𝑖
  • 18.
    Artificial Bee Colony(ABC) Algorithm • ABC is based on the intelligent behavior of bees when they search for honey • Three essential components – Food Source – Employed Bees – Unemployed Bees • Two modes of behavior – Recruitment to a food source – Neglect of a source • Bees can memorize, share, communicate and store the information based on which decisions can be made
  • 19.
    Bees evaluate thedifferent path according to • Quality of food • Amount of energy usage Agents in ABC: • Employed Bee: They carry information about food source and share with the neighborhood. • Onlooker Bee: Wait in their nest and select a food source through the information shared by employed bees. • Scout: Responsible for finding new food, the new nectar sources Artificial Bee Colony (ABC) Algorithm
  • 20.
    • Initiates theforaging in the neighborhood • Employed bee produces new trial food position vi around xi where 𝑥𝑖 - current food source position, j ε { 1,2, …., D}, k ε { 1,2, …., SN} are randomly picked indices, D - Number of search dimensions, SN - Number of employed bees, 𝜑𝑖𝑗 - Uniform random value from [-1,1] Employed Bee Stage ൯𝑣𝑖𝑗 = 𝑥𝑖𝑗 + 𝜑𝑖𝑗(𝑥 𝑘𝑗 − 𝑥𝑖𝑗
  • 21.
    • In thisphase employed bees share the fitness information about updated solutions and information about their position • Probability Pi that the employed bee with food source xi would be picked by an onlooker bee is Onlooker Bee Stage 𝑃𝑖 = )𝑓𝑖𝑡(𝑥𝑖 ෌ 𝑛=1 𝑆 𝑁 )𝑓𝑖𝑡(𝑥 𝑛
  • 22.
    • In thisphase the neglected food source associated bee becomes a scout bee • The randomly chosen food source replaces the food source within the search space. • The scout bee replaces the abandoned food source xi with new food source xi as 𝑥𝑖 𝑗 = 𝑥 𝑚𝑖𝑛 𝑗 + 𝑟𝑎𝑛𝑑 0,1 𝑥 𝑚𝑎𝑥 𝑗 − 𝑥 𝑚𝑖𝑛 𝑗 𝑥 𝑚𝑖𝑛 𝑗 and 𝑥 𝑚𝑎𝑥 𝑗 are bounds of 𝑥𝑖 in 𝑗th direction. Scout Bee Phase
  • 23.
    STEP 1: Initializationof nectar sources STEP 2: Search for new nectar sources STEP 3: Probability for the scouter to select employed foragers STEP 4: Production of scouter STEP 5: Production of new solution STEP 6: Replace the original solution STEP 7: Neglect a solution and replace it with new one STEP 8: The best solution ever is recorded. STEP 9: Termination ABC Procedure