Bees Algorithm
Bees Algorithm
Doctor of Philosophy
By
School of Engineering
Cardiff University
United Kingdom
2011
DECLARATION AND STATEMENTS
DECLARATION
This work has not previously been accepted in substance for any degree and is
not concurrently submitted in candidature for any degree.
STATEMENT 1
This thesis is being submitted in partial fulfilment of the requirements for the
degree of ………………………… (insert MCh, MD, MPhil, PhD etc, as
appropriate)
STATEMENT 2
STATEMENT 3
ii
In the name of Allah,
the Most Merciful, the Most Kind
iii
DEDICATION
MY GRANDPARENTS,
MY PARENTS,
MY IN-LAWS,
MY WIFE BAYAN,
iv
ACKNOWLEDGEMENTS
I would like to express my gratitude to all those who have helped me, in any
way, to successfully complete my PhD thesis.
I owe my parents, brothers and sisters a great gratitude for all their love and
support. Special love goes to my beloved mother, Nadrah, may Allah be mercy
with her.
This work would not have been possible without the support, appreciation and
patience of my wife Bayan and our children Abdullah and Jude.
v
ABSTRACT
An improved swarm-based optimisation algorithm from the Bees Algorithm
family for solving complex optimisation problems is proposed. Like other Bees
with random exploratory global search. This thesis details the development and
The development includes a new method of tuning the Bees Algorithm called
Meta Bees Algorithm and the functionality of the proposed method is compared
algorithms.
A new fitness evaluation method has been developed to enable the Bees
Algorithm was tested on the optimisation of parameter values for the Ant
Finally, the Bees Algorithm has been adapted and employed to solve complex
sequencing.
vi
CONTENTS
DEDICATION iv
ACKNOWLEDGEMENTS v
ABSTRACT vi
LIST OF FIGURES x
ABBREVIATIONS xiv
NOMENCLATURE xvi
1. INTRODUCTION 19
1.1 PROBLEM STATEMENT 19
1.2 RESEARCH AIM AND OBJECTIVES 21
1.3 THESIS ORGANISATION 23
vii
2.3.6.7 Applications and optimisation problems 53
2.3.7 Honeybees Inspiration: Behaviour, Algorithms and Application 54
2.3.7.1 The Nesting Site Selection 54
2.3.7.2 Honeybees Mating Behaviour 56
2.3.7.3 Honeybee teamwork strategy 58
2.3.7.4 Foraging Behaviour of the Honeybees 58
1. BeeHive Algorithm 61
2. BeeAdHoc Algorithm 61
3. The Honey Bee Algorithm 62
4. The Virtual Bee Algorithm 62
5. The ABC algorithm 63
6. Bee Colony Optimisation 64
2.4 THE BEES ALGORITHM AND ITS SUCCESSORS 64
2.4.1 Standard Bees Algorithm 64
2.4.2 Improvements and Applications 64
2.5 SUMMARY 69
viii
5.1 BEES ALGORITHM CHARACTERISTICS FOR COMBINATORIAL OPTIMISATION
PROBLEMS 148
5.2 THE BEES ALGORITHM FOR SOLVING THE TRAVELLING SALESMAN PROBLEM
151
5.2.1 Implementing the Bees Algorithm for the Travelling Salesman Problem 152
5.2.2 The Bees Algorithm with Neighbourhood operators 157
5.2.3 Experiment Results using the Bees Algorithm 163
5.3 THE BEES ALGORITHM AS APPLIED TO THE PRINTED CIRCUIT BOARD
ASSEMBLY OPTIMISATION PROBLEM 166
5.3.1 Printed Circuit Board Assembly 167
5.3.2 The Proposed Bees Algorithm for PCB Benchmark Problems 180
5.3.3 PCB Component Assembly Using a MBTD Machine 183
5.3.4 Experimental Results 185
5.4 DISCUSSION 185
5.5 SUMMARY 194
6. CONCLUSION 195
6.1 CONTRIBUTIONS 195
6.2 CONCLUSIONS 196
6.3 FUTURE WORK 197
REFERENCES 199
ix
LIST OF FIGURES
Figure Caption Page
2.1 Topology of an LVQ Network 34
2.2 Application of the ACS for a Simple TSP Problem 48
x
3.17 Distribution of Random Numbers in both 10 and 100 117
(a-b) Bins for the Griewangk Function
xi
5.7 Evolution of Best Assembly Time for Case 1 – Without 189
Seeding
5.8 Optimal Assembly Sequence (25.92 sec) after 160 192
Iterations for Case 1 – Without Seeding
5.9 Assembly Sequence (29.00 sec) Employed as a Seed 190
for Case 2 – with Seeding
5.10 Evolution of Best Assembly Time (29.00 sec) for Case 191
2 – with Seeding
5.11 Optimal Assembly Sequence (25.08 sec) after 100 192
Iterations for Case 2 – with Seeding
xii
LIST OF TABLES
xiii
ABBREVIATIONS
2-Opt Two (paths) Optimal
ABC Artificial Bee Colony
ACO Ant Colony Optimisation
ACS Ant Colony System
ATSP Asymmetric Travelling Salesman Problem
CACO Continuous Ant Colony Optimisation
CAP Component Allocation Problem
CIAC Continuous Interacting Ant Colony
CPU Central Process Unit
CSP Component Sequencing Problem
DNA Deoxyribonucleic Acid
EA Evolutionary Algorithms
EP Evolutionary Programming
ES Evolutionary Strategy
FAP Feeder Arrangement Problem
Gas Genetic Algorithms
MBTD Moving Board with Time Delay
MMAS Max-Min Ant Colony System
NE SIMPSA Stochastic Simulated Annealing Optimisation Procedure
PAP Pick and Place Machine
PC Personal Computer
PCB Printed Circuit Board
PID Proportional Integral Derivative
PSO Particle Swarm Optimisation
RAM Random Access Memory
SA Simulated Annealing
SI Swarm Intelligence
SIMPSA Deterministic Simplex Method
xiv
SMT Surface Mount Technology
SQP Sequential Quadratic Programming
TS Tabu Search
TSP Travelling Salesman Problem
xv
NOMENCLATURE
CHAPTER 2
q0 An exploitation/exploration parameter
Local pheromone decay parameter
0 The initial value of the pheromone trails
CHAPTER 3
xvi
Nsp The number of bees recruited for the other (m-e) selected
sites
Ngh The initial size of each patch
fi(X) Objective functions
maxF Maximum value of the function F
minF Minimum value of the function F
X The column vector
CHAPTER 5
Mean value of the process variable being monitored
Standard deviation of the process
d(ci,cj ) The distance between cities i and j
F1 A feeder
H An assembly head
F2 Multiple feeders
DTotal The total distance between all visited cities (components)
V The average speed of movement of the table or assembly
head
TTotal The cycle time
N The total number of components
Ti The time required to place the component Ci
G The number of assembly heads positioned between the pick-
up and placement heads on the turret
t1 The time for the table to move from the location of
component Ci-1
C0 The starting position of the table
xi x coordinate of the component ci
yi y coordinate of the component ci
vx The velocity of the x-y table in the x direction
xvii
vy The velocity of the x-y table in the y direction
t2 The time for the feeder array to change the pick-up feeder
from the feeder supplying component Ci+g to that supplying
component Ci+g+1
Ci+g+1 The component that is to be picked-up when component Ci is
placed onto the PCB
CN The last component to be assembled onto a given PCB
xi The x coordinate of the feeder fi
yi The y coordinate of the feeder fi
vf The speed of the feeder carrier
N The number of cities in a TSP
xviii
CHAPTER 1
INTRODUCTION
1.1 PROBLEM STATEMENT
have posed difficult issues for engineers. These challenges have been met
problems only. Also, it has not yet been tested for dynamic problems.
good results. However, the tuning normally has to be carried out manually,
19
The main motivations for the research presented in this thesis were:
automatically tuning the Bees Algorithm called the Meta Bees Algorithm.
problem.
20
1.2 RESEARCH AIM AND OBJECTIVES
The overall aim of this work was to prove the hypothesis that the new Bees
optimisation techniques.
Bees Algorithm.
methods.
21
To achieve the above objectives, the following methodology was adopted:
extended by adding a new evaluation method for the fitness function of both
local and global search parts of the Bees Algorithm. The performance of the
method.
22
1.3 THESIS ORGANISATION
the work presented in the thesis. This covers material on the Evolutionary
Algorithm). The results of this study were tested with five benchmark
algorithms.
carry out this task was designed with a new fitness evaluation method based
on computing the average fitness value for each bee over a number of trials
23
rather than computing the value of a single trial. The method enabled the
even when the location visited by a bee remains the same. To test the
employed. This test took the shape of parameter setting for the Ant Colony
Problem (TSP).
problems. The development of the Bees Algorithm for the TSP serves as an
24
CHAPTER 2
with the Bees Algorithm. The chapter emphasises two main algorithms,
namely those inspired by ants and honeybees. How they function both in
nature and in engineering practice is looked at. The application of these two
2.1 OPTIMISATION
constraints that determine the allowed values of the variables, and the search
25
1. The degree of nonlinearity of the objective function determines whether
problem where the search space changes over time (Blackwell and Branke,
2004).
26
provides a brief description of the various elements of these algorithms
are two possibilities: Single Point Search (Trajectory) (SPS) which is also
is also known as a Swarm Based Search (SBS). With SPS the algorithm
greedy criterion to make this decision, which accepts the new parameter if
27
o Exact algorithms are methods which utilise mathematical models and try
they try to prove that the solution obtained is actually an optimal one.
instances in the exact methods category are Branch and Bound (Wiener
short computation time but the algorithm does not guarantee finding an
optimal solution and may fall in local optima missing the true optimum
relatively few modifications. They can produce solutions beyond those that
28
evolutionary approaches, Tabu Search, Simulated Annealing, and Multistart
Kochenberger, 2003).
5. In the way the algorithm builds a solution, there are two methods:
by step). They are speedy and return reasonably good solutions but not
Heuristic (GCH).
better solution and replace the current one. However it may get stuck in a
poor quality local optimum. An example of an IIAs is the Two (two paths)
detail in chapter five of this thesis. There are algorithms that employ both
techniques, they initially use the constructive method then follow it up with
29
Lin-Kernighan Heuristics (Aarts et al., 1988; Helsgaun, 2000), Simulated
2004), the Ant Colony System (Stützle and Hoos, 1997) and the Bee System
techniques:
are not employed whereas with the second approach random elements are
discussing ACO.
inspiration from. Of the most recent are a group of algorithms which get
are Artificial Intelligence (AI) and Swarm Intelligence (SI) (Bonabeau et al.,
1999).
30
memory of the past history of the search such as recently performed steps
the same algorithm encodes solutions with discrete variables when solving
(weights) between elements and thus the neural network can be trained to
31
a set of vectors. The weights on the connection between the input vectors
and the hidden vectors determine the activity of each hidden layer. ANNs
are trained by comparing the output and the target of the network until they
are matched.
There are many types and structures of ANNs such as Feed-forward neural
Spiking Neural Networks (Pham and Sahran, 2006) and Learning Vector
The LVQ neural network was developed by Kohonen (Kohonen, 1989) and
The network is fully connected between the input and hidden layers and
partially connected between the hidden and output layers, with each output
32
Kohonen neurons). The weights of the connections between the hidden and
output neurons are fixed at 1. The weights of the input to hidden neuron
the network for recognition, the hidden neuron whose reference vector is
closest in terms of Euclidean distance to the input vector is said to win the
competition against all the other hidden neurons to have its output set to "1".
All other hidden neurons are forced to produce a "0". The output neuron
connected to the cluster of hidden neurons that contains the winning neuron
also emits a "1" and all other output neurons, a "0". The output neuron that
produces a "1" gives the class of the input vector, each output neuron being
The learning method is supervised (Jain and Dubes, 1988) and based on
updated. During learning, the neurons in the hidden layer compete amongst
themselves in order to find the winning neuron whose weight vector is most
similar to the input vector (Kohonen, 1990). The winning neuron gives the
class of the input vector. Only the winning neuron will modify its weights
whether the class indicated by the winning neuron is correct or not. If the
winning neuron belongs to the same class as the input vector (the
33
slightly closer to the input vector (positive reinforcement). On the contrary,
if the class of the winning neuron is different from the input vector class
34
LVQ Network Training Procedure
error function. The error function defines the total difference between the
actual output and the desired output of the network over a set of training
network a pattern of known class taken randomly from the training set. If
the class of the pattern is correctly identified by the network, the error
The procedure is repeated for all the patterns in the training set and the error
components for all the patterns are summed to yield the value of the error
this material increases their energies and these energies give these atoms a
35
carried out too quickly many irregularities and defects will be seen in the
crystal structure. A slower fall to the lower energy rates will allow a more
degree to which the inputs are allowed to vary. This often leads the
the search progresses until some stopping criterion has been satisfied. It uses
contains the solutions that have been visited in the recent n number of
previous solutions. These solutions will be excluded in the search unless one
36
and Karaboga, 2000). The TS can be employed for solving combinatorial
having a fitness value, and a genome encoding the main features of the
that removes poor individuals from the population, thus allowing better
In the 1960s, Rechenberg and his colleagues were the first to apply the
37
systems and modern technology (Rechenberg, 1965). Standard Evolutionary
languages. However, it was only ten years later that EPs gained worldwide
(1975).
Strategies (ESs). However, the original applications for which GAs and ESs
were developed are different. While ESs were applied first to continuous
38
equivalent integer variables. A GA initially selects its population randomly
the population, a GA runs a mutation operator that changes the bit value, in
the case of a binary coding, from 0 to 1 and vice versa. A GA evaluates the
Reynolds in the late 80s inspired Russel Ebenhart and James Kennedy to
particle in a PSO has a position and a velocity. These particles are attracted
to positions in the search space that have high fitness. Each particle has a
memory function that remembers two pieces of information, the first piece
of information results from the memory of the particle of its past states as
the best-so-far position that it has visited, called the local best, and the
39
particles as the global best position attained by the whole swarm, called the
global best. Both the local best position of each particle and the global best
position of the entire swarm guide the movements of all particles towards
PSO has been applied to many problems such as the training of Feed-
foraging behaviour of real ant colonies and was proposed by Dorigo and
et al., 1996). The collective trail laying and trail following behaviour of ants
enable them to find the shortest path from the food source to their nest.
Ants start their journey for food from their nest by exploring the
back to the nest by the ants which will also lay a chemical substance called
trails laid by ants recruits more ants to choose the same path to the food
source and guides others to the nest. When an ant deposits pheromone on a
40
path that is not one of the shortest, the pheromone will evaporate. As time
passes the path will not be followed by other ants and this mechanism is
called negative feedback. The more ants that follow a certain path, the more
pheromone will be deposited and this reinforces the quality of this path.
This mechanism is called positive feedback. Hence the ants find the shortest
paths between the nest and food sources (Dorigo and Stützle, 2004;
colony of identical ants. All ant-based algorithms use the positive feedback
Ant colony optimisation has been studied thoroughly and many algorithms
have been developed such as the Ant System (AS), Max-Min Ant System
(MMAS), Ant Colony System (ACS) and others (Engelbrecht, 2005). The
41
The management of the pheromone trails
namely the Ant Colony System (ACS). This algorithm has been tested and
The Ant Colony System (ACS) is based on four elements that are employed
rule, a local update for the pheromone trail, and the use of a candidate list
42
the corresponding link, ηij =1/dij is a heuristic value which is the reverse of
the distance between the two cities i and j, β is a parameter that determines
lN iJ (t )iJ (t )
iJ
k (Dorigo, 2004)
i
exploitation and has a double function. When q ≤ q0, the decision rule
exploits the knowledge available about the problem such as the heuristic
knowledge about distances between cities in the case of TSP problem, and
(cities in case of the TSP) instead of the best current solution. The local
43
pheromone trail updates are performed by applying Equation (2.3) (Dorigo,
2004).
Equation (2.3)
ij (t ) (1 ) ij (t ) 0
(Dorigo, 2004)
setting τ0 = (n.Lnn)-1, where n is the number of cities in the TSP instance and
(NNH), produced good results. The effect of the local update rule is that
each time an ant uses an arc (i, j) its pheromone trail τij is reduced, so that
the arc becomes less desirable for the following ants. This allows an
increase in the exploration of arcs that have not been visited and avoids
path, which is usually a local optimal solution, and more ants keep choosing
this path over and over until eventually all ants choose this path and the
The third element of the ACS is the global pheromone trail update where at
the end of an iteration of the algorithm, once all the ants have built a
solution, a pheromone trail is added to the arcs (edges) employed by the ant
that found the best tour from the beginning of the trial. The rule of this
44
offline global pheromone trail update is shown in Equation (2.4) (Dorigo,
2004).
Equation (2.4)
ij (t 1) (1 ) ij (t ) ij (t )
(Dorigo, 2004)
where τij is the pheromone trail level on the edge (ij), φ Є (0, 1) is a
1/Lbest where Lbest is the length of the global-best tour Tgb found since the
beginning of the trail or the length of the iteration-best tour Tib found during
With the forth element, the ACS exploits a data structure called the
a list of preferred cities to be visited from a given city. The candidate list of
city i, it chooses a city to move to that is on the candidate list but has not
been previously visited by that ant. All visited cities are placed on a list
called the Tabu list which is referred to before visiting a city. After visiting
all cities on the candidate list, other cities are then examined.
45
To explain how the ACS operates, the following simple example is
cities. In this example, there are eight cities (A to H) and for simplicity, it is
assumed that ant one is placed in city A, ant two is placed in city B and so
on. Every time an ant (k) needs to move from city i to city j, it adds its
current location to its Tabu list and then uses Equation (2.1) where it
generates a random value for the parameter q, when q ≤ q0, ant (k) becomes
greedy and exploits the knowledge available about the problem and goes to
city (j) which has the maximum product of the amount of pheromone on the
edge (ij) and the shortest distance between the two cities. While when q >
q0, the ant (k) explores new solutions using a probability decision from
Equation (2.2). Each city has a candidate list; its length is defined by the
number of cities listed (cl). In this example, cl = 2, where cities (B) and (H)
are on the candidate list of city (A) and they will be explored by ant (1)
before other cities. In this example, it is assumed that ant (1) moves from
city (A) to city (B), then city (B) will be added to the Tabu list to avoid
being visited twice by the same ant. After moving from city (A) to city (B),
ant (1) updates the pheromone on the link between the two cities using local
update Equation (2.3). For the next step, ant (1) again calculates the
possibilities of moving from its current city (B) to those cities that are not in
its Tabu list (C to H) using the same Equation (2.1) and so on until ant (1)
46
visits all the seven cities as shown in Figure 2.2. The length of the tour made
by ant (1) will be calculated by adding the length of the arc between each
two cities from the tour. The process will be accomplished by each ant and
at the end of the iteration there will be eight tours generated by eight ants.
The shortest of these tours will be selected as the best tour and the arcs that
form this tour will be updated using the global update formula in Equation
(2.4). The ants are placed again randomly for a second iteration. The
47
D B D
C
A A
E E
H F H F
G G
(a) (b)
B D B D
C C
A A
E E
H F H F
G G
(c) (d)
B D B D
C C
A A
E E
H F H F
G G
(e) (f)
B D B D
C C
A A
E E
H F H F
G G
(g) (h)
48
2.3.6.4 ACO and the Speed of Convergence
The time and number of evaluations consumed in finding the best solution
factor is controllable and the other is not. The first factor is the right
selection of the values of the set of parameters for the metaheuristic method.
The other factor is the stochastic nature of these types of methods i.e. the
can be seen when the ACS is applied to solve a TSP problem. It is initialised
by setting the value of its parameters such as the number of ants (M) and the
in the distribution of the ants over the available cities. It should be noted
that, for each iteration, these positions are always chosen randomly.
49
- A value of q0 define close to one decreases the convergence time but
search space but also increase the computation time to a large extent
al., 2006).
limitation of tuning only five parameters and the values obtained are not
50
method to determine relevant parameter setting based again on the statistical
statistical analysis.
Other approaches have been carried out to optimise the parameters of ant
systems. These approaches can be divided into three groups; the first group
is that of proposed methods to find the best parameter settings for one or
find the proper parameter set, while the third group tries to connect the
Of the first group (Dorigo and Gambardella, 1997) presented a formula for
the optimum number of ants based on the value of ρ and q0. Watanabe and
system. Hao et al., (2006) have chosen three parameters to optimise (β, ρ
and q0) and have developed a parameter study strategy based on PSO. A
51
hybridised algorithm using GA and ACS-TSP was attempted by Pilat and
White (2002) to solve the TSP faster but their attempt failed to bring results
better than those of the original ACS (Dorigo and Gambardella, 1997).
Pellegrini et al., (2006) employed the F-Race algorithm to find the four
optimum parameters (m, ρ, α and q0) for the Max-Min Ant Colony System
(MMAS).
Of the second group Pilat and White (2002) proposed a Meta ACS using the
GA as another layer wrapping the ACS to optimise its parameters. They had
better results on their study which considered only three parameters (β, ρ,
three parameters (β, ρ and q0) for a TSP instance. In doing so they tried to
connect the TSP class with the optimum set of parameters. Also, Figlali et
al. (2005) investigated the parameters of the ACS with the randomly
52
2.3.6.6 ACO and Local Search
Most ACO algorithms are coupled with operators or local search techniques.
The outcome in performance has been similar to that of the best heuristic
combinatorial (Dorigo et al., 1999) and continuous (Dréo and Siarry, 2004)
problems like the TSP, scheduling problems e.g. the job-shop scheduling
problem (Figlali et al. 2005), the vehicle routing problem (Farooq, 2008),
the quadratic assignment problem (Stützle, 1997) and they were also
employed as classifiers (Martens et al., 2007). The ACO was then employed
et al., 2000).
53
2.3.7 Honeybees Inspiration: Behaviour, Algorithms and Application
which can mimic the bees searching abilities. The algorithms are then
behaviour have emerged in the literature, namely, the nesting site selection
(Seeley and Visscher, 2003; Passino et al., 2008), the mating behaviour
(Haddad et al., 2006; Sung, 2003), the honeybee teamwork strategy (Sadik
et al., 2006) and the foraging behaviour (Seeley, 1996) and. These types of
many applications.
when the size of the hive becomes too small for the honeybees to live in, a
swarm of half the old colony with the mother queen flies a few meters from
the hive and gathers in a tree or on a branch to form a cluster. Then only the
scout bees from this swarm cluster begin to search for potential nest sites in
54
Scouts assess the quality of sites based on cavity volume, entrance height,
entrance area, and other attributes that are likely correlated with colony
success. A dozen or more potential nest sites are initially advertised by the
bees advertise just one site which is not necessarily the one that was first
During the first stages of this optimisation technique, each returning bee
observe dances. If they easily find a dancer they get recruited to a relatively
high quality site. If they must wait too long to find a dancer, this would
indicate that there are not many good nest-sites currently being assessed so
they explore the environment for more sites. The number of recruits to each
certain number of bees at the site, the bees from that site ‘‘choose it’’ by
returning to the cluster to prompt lift-off and then they guide the swarm to
complete the nest-site selection process as fast as possible since weather and
enough time must be dedicated to ensure that many bees can conduct
55
likely to be the best site that the swarm has found. Hence, during nest-site
selection the swarm strikes a balance between time minimisation and site
increase of dancing just before liftoff. The analysis of the dancing records of
individual scout bees confirmed that there is much turnover in the dancing
bees over the course of a decision making process (Passino et al., 2008).
Most bees that dance for a site cease doing so after a few hours, letting the
representing the different potential nest sites. The groups compete for
and ultimately excludes its competitors. The site whose dancers prevail in
Each normal honeybee colony consists of the queen, drones, workers, and
honeybees and specialise in laying eggs. Drones are the sires or fathers of
the colony. They are haploid and act to amplify the genome of their mothers
56
Therefore, drones are considered agents that propagate one of the gametes
Workers specialise in brood care and sometimes lay eggs. Broods arise
The marriage process in honeybees was hard to observe as the queens mate
during their mating flight far from the nest. A mating flight starts with a
dance performed by the queens who then start a mating flight during which
the drones follow the queens and mate with them in the air. In a typical
mating, sperm reaches the spermatheca and accumulates there to form the
genetic pool of the colony. Each time a queen lays fertilised eggs, she
Just as the queen bee is the only bee in a hive that breeds with the others, the
set of others. Thus the algorithm aims to retain the best solutions in the
"gene pool," and achieve a better answer. This differs from the traditional
approach, which selects both parents randomly from the whole pool
(Abbass, 2001). This natural behaviour also led to the Queen-Bee Evolution
57
other bees selected as parents by a selection procedure. This method when
increases the probability that the GA will fall into premature convergence
In Honeybees, the queen controls the nest and all the other bees provide
extracting nectar which they deliver back to the nest where it is employed to
make honey. When a queen dies, a new queen is raised by feeding a normal
behaviour and agent teamwork strategies, which are later employed in the
search over enormous fields surrounding the hive. They search for flower
58
patches that provide plentiful amounts of nectar or pollen that are easy to
employing scout bees to search for adequate flower patches where nectar is
plentiful, easy to extract, and rich in sugar content. Scout bees search
When they return to the hive, those who have found a high-quality food
that they have collected during the search process and then signal the
“waggle dance” on the dance floor (Frisch, 1976). The mysterious waggle
area of the hive called the “dance floor”, and communicates three basic
located, its distance from the hive, and its quality rating (Frisch, 1976;
Camazine et at., 2003). After the waggle dance, the dancer bee goes back to
the flower patch, followed by other nestmates recruited from the hive. The
number of recruited bees depends on the quality rating of the patch. Flower
59
patches that contain rich and easily available nectar or pollen sources attract
information guides the colony to send its bees to flower patches precisely,
dance. This dance gives the colony a chance to evaluate different patches
et al., 2003). This allows the colony to gather food quickly and efficiently.
While harvesting the source, the bees monitor the food level. This
when they return to the hive (Camazine et al., 2003). If the food source is
still good enough and calls for more recruitment, then that patch will be
source.
Once a recruited forager returns to the hive, it will in turn waggle dance to
direct other idle bees towards the food source. Thanks to this mechanism,
the most profitable food sources attract the largest number of foragers
(Tereshko and Lee, 2002), and thus the bee colony optimises the efficiency
of the food collection process (i.e. the amount of food collected versus the
60
During harvesting when the bees detect that there is no more nectar in a
flower patch, bees will abandon it and interrupt the dances intended to
1. BeeHive Algorithm
in (Wedde et al., 2004). The artificial bee agents are employed in packet
routing table. Two types of agents are employed – short distance bee agents
number of hops and long distance bee agents which travel to all nodes of the
network. Though the paper talks in terms of bees, it only loosely follows
The BeeHive algorithm (Wedde et al., 2004) was introduced and applied to
2. BeeAdHoc Algorithm
61
behaviour of honeybees. The algorithm mainly utilises two types of agents,
scouts and foragers, for doing routing in mobile ad hoc networks. The
less control packets to do routing. The results showed that the BeeAdHoc
In (Yang, 2005), the author describes a virtual bee algorithm where the
source or how agent communication is carried out is given in this work. Nor
are there any comparative results to check the validity of the algorithm.
62
5. The ABC algorithm
and Basturk (2008) proposed the ABC algorithm. Although the two
between the ABC and the BA. The two optimisation methods can be
described using the same flowchart, and the site abandonment procedure is
also employed in the ABC algorithm. Differently from the BA, the ABC
uses the roulette wheel selection method (Karaboga and Basturk, 2008) to
simulate the recruiting of foragers through the waggle dance. The main
crossover operation (Pham and Karaboga, 2000) between the dancer bee and
randomly determined. Since the second bee is randomly selected from the
whole population, the crossover operation may generate a forager bee which
is relatively far from the dancer bee. In particular, the forager bee may be
placed outside the fitness peak that it is meant to exploit. For this reason, the
63
6. Bee Colony Optimisation
al., 2006) to solve transportation problems and was called Bee Colony
ACO.
The Bees Algorithm is a population based search algorithm that imitates the
food foraging behaviour of honeybees to find the optimal solution for both
The Bees Algorithm balances between the global and the local search. The
64
also extended to a vast number of new continuous and combinatorial
optimisation problems.
The Bees Algorithm was also applied to train different types of neural
network (Pham et al., 2006c; Pham et al., 2006e), the training of the Radial
Basis Functions network (Pham et al., 2006d), the training of the Spiking
Neural Networks (Pham and Sahran, 2006) and the training of the Support
Vector Machine (Pham et al., 2007a). These trainings were for recognising
results showed the testing and training accuracies using the Bees Algorithm
Algorithm applied to the welded beam design problem. The objective of the
65
design is to minimise the cost of fabrication while finding a feasible
width. The Bees Algorithm produced better results (less cost) than almost
Haj Darwish, 2008) and with Pareto optimality (Pham et al., 2008a).
includes new search operators, and a new selection procedure that enhances
all the problems, the Bees Algorithm found very satisfactory optima and the
results proved the high reliability of the proposed technique (Pham et al.,
2008b).
was adapted to search the protein conformational search space to find the
many biological functions in the human body. The structure of the protein
66
computationally, the protein must be properly represented. The algorithm
One of the first implementations of the Bees Algorithm in discrete space for
where the Bees Algorithm was employed for solving the cell formation
problem (Pham et al., 2007b). Experimental results indicated that the Bees
common due date for a machine to minimise the penalties associated with
stable and robust than other existing optimisation techniques such as GA,
The Bees Algorithm was successfully applied for PCB assembly planning
(Pham et al., 2007d). The computational experiments showed that the Bees
Bees Algorithm was also copped with TRIZ-inspired operators for the same
application (Ang et. al, 2009) where a shorter time was obtained as
67
The Bees Algorithm was also applied to solve the Scholar Timetabling
al., 2007e). The algorithm has been also employed to design mechanical
The algorithm was also employed to obtain the optimal sink path for large-
scale sensor networks (Saad et al., 2008). Another usage of the Bees
The Bees Algorithm was also applied to clustering problems to improve the
results of the K-means (Pham et al., 2007f) and the C-means (Pham et al.,
2008f) algorithms
mating them with the selected ones. Also, two new methods were proposed
for the Bees Algorithm namely the ‘shrinking’ method for neighbourhood
size and the idea of ‘abandon sites’ which is employed when stuck in a local
68
In another arrangement, an adaptive neighbourhood search and random
2.5 SUMMARY
this chapter alongside the terms and definitions often employed in the study
69
CHAPTER 3
new method of tuning the Bees Algorithm called Meta Bees Algorithm (a
Bees Algorithm within a Bees Algorithm). The tuned Bees Algorithm has
algorithms.
inspiration from the food foraging behaviour of honeybees to search for the
algorithm randomly samples the solution space looking for areas of high
to study these two main searches performed by the Bees Algorithm, a set of
experiments was run where the Bees Algorithm was applied to several
70
function optimisation problems. The effects of the Bees Algorithm
The bee population size is fixed to n scout bees. These bees randomly
sample the solution space with uniform probability across the space. Each
scout bee evaluates the visited site (i.e. solution) via the fitness function.
The population size n is one of the key parameters in the Bees Algorithm.
The effect of changing the population size on the mean number of iterations
correct solution is shown in Figure 3.3. Also shown in Figure 3.4 is a graph
size.
Figure 3.2 shows that the number of iterations required to obtain the
71
Random Initialisation (n)
Selection n
New Population
Random (n-m)
Yes
Solution
Figure 3.1 Flowchart of the Standard Bees Algorithm
72
500
400
300
200
Mean Iterations
100
0
40 100 160 220 280 340 400 460
70 130 190 250 310 370 430
Population (n)
73
40000
30000
Mean Generated Points
20000
10000
40 100 160 220 280 340 400 460
70 130 190 250 310 370 430
Population (n)
74
Successfulness
100
Fails in 1000 runs
80
60
40
20
0
0 50 100 150 200
n ( Population )
75
Figure 3.3 shows how an increase in population size leads to an increase in the
points is defined as the mean of the number of times the objective function was
called.
required as shown in Figure 3.4 (where Fails represents a case where the
arrive at the solution with fewer iterations, the population should be larger than
(the algorithm reliability, the number of iterations and the number of function
concept of the Bees Algorithm. After ranking the sampled solutions and
locating the most promising ones (i.e. the highest ranking locations), other bees
76
are recruited to search the fitness landscape in the neighbourhood of these
solutions.
predefined neighbourhood range. For each selected site, bees are randomly
distributed to find a better solution. As shown in Figure 3.5, only the best bee is
chosen to advertise its source after which the centre of the neighbourhood field
In undertaking the study of this form of local search, three issues have been
taken into account; the number of recruited bees in the neighbourhood range,
The number of recruited bees around selected sites should be defined properly.
When the number is increased, the number of function evaluations will also be
increased and vice versa, when the number decreases, the chance of finding a
77
Fitness Fitness
B
Best Bee
**
*
* A *
* A
*
*
**
x x
78
(B) The Patch Size (Neighbourhood Range)
problem spaces. Three different strategies have been applied to improve the
efficiency and robustness of the Bees Algorithm. These are (1) a fixed
iteration strategy and (3) hybrid strategies combining the two previous
strategies where, for instance, the first strategy can be employed up to the 50th
iteration and then the second strategy employed up to the stopping criteria.
With the first strategy, a neighbourhood width for all selected sites was fixed to
a certain range that is sufficient to deal with the complexity of the problem
space. In this strategy, beginning from the first iteration, all the bees harvest on
the same size fields which are defined as (ngh) in Equation (3.1).
However, in the second strategy, the region changes proportional to the number
of iterations. All sites have the same range value and this range will be
79
narrowed down depending on the iteration as shown in Equation (3.2). This
Finally, the third strategy was implemented as a combination of the first two
These neighbourhood range strategies have been tested using the De Jong
function benchmark presented in Table 3.1. These tests were run independently
10 times and the mean of these 10 runs is presented in Figure 3.6 with the
number of iterations being set to 1000. The parameters set for this test were as
follows:
The population is set to 15, the selected sites are 5, the elite sites 2, bees around
neighbourhood spread of 0.01 is defined as an initial range for all strategies. For
the third, mixed, strategy the first 20 iterations of the algorithm employed the
first strategy (fixed ranges) and thereafter the second strategy of narrowing
down the ranges was employed. It is clear from the results in Figure 3.6 that the
first strategy reaches its minimum value before any of the other strategies.
80
However, the second and third strategies gave similar results for this relatively
simple problem space. Thus, it does not make sense to employ the more
complex second and third methods as the first strategy can be said to be both a
81
Table 3.1 Test Functions (Mathur et al., 2000)
Function Global
No Interval Function
Name Optimum
X(1,1)
max F (3905.93) 100( x1 x2) 2 (1 x1) 2
2
1 De Jong [-2.048, 2.048]
F=3905.93
( x1 x2 10)
2
Martin and X(5,5)
2
Gaddy
[0, 10] min F ( x1 x2)2 F=0
3
Rosenbrock X(1,1)
min F 100( x1 x2) 2 (1 x1) 2
2
3 [-1.2, 1.2]
(2D) F=0
Rosenbrock X(1,1)
min F 100( x1 x2) 2 (1 x1) 2
2
4 [-10, 10]
(2D) F=0
50 2 50 xi 100
xi 100
1
min F
4000 i 1 cos
1 X( 1 00 )
5 Griewank [-600, 600] i 1 i
F=0
82
3906.5
3906
0 10 20 30 40 50
3905.5
3905
1st Strategy
Fitness
3904.5
2nd Strategy
3904 3rd Strategy
3903.5
3903
3902.5
3902
Iteration
83
(C) The Recruitment Strategy (Site Selection)
Site Selection.
employed and sites with better fitness have more chance of being selected.
However, with the Best Selection technique (greedy selection), the best sites
methods, ranging from pure Probabilistic Selection (q=0) to pure Best Selection
(q=1), have been investigated. The mean number of iterations required to reach
the answer and the success of each combination are shown in Figures 3.7 and
3.8.
From the experimental results, the Best Site selection technique demonstrated
roulette wheel which causes the algorithm to take longer and makes it more
complicated, and thus the Best Site selection has been recommended for use.
84
Figure 3.7 Mean Iterations required for Different Combinations of methods
85
Successfulness
100
Fails in 1000 runs
80 q=0
60 q=0.1
q=0.5
40 q=0.9
20 q=1
0
0 50 100 150 200
n ( Population )
86
3.2 THE BEES ALGORITHM PARAMETER TUNING
The Bees Algorithm, like all other metaheuristic search algorithms including
Tabu Search (TS), Simulated Annealing (SA) and ACO, invariably requires a
parameters directly impact on the performance of the solver and as such, the
researcher will often hand-tune parameter values before the application of the
As shown in the first section of this chapter, the search strategy of the Bees
sampling. The explorative search (scout bees) and exploitative search (recruited
In spite of the fact that most of the work that has been carried out in this field
states the need for a mechanism to tune the Bees Algorithm parameters,
comparatively very little research has been carried out into the analysis of the
parameter values or the way they can be automatically derived or tuned. The
optimisation of the Bees Algorithm has been carried out, in the past, according
87
to experimental trial and error and the values of its parameters were decided
conducting a number of trials, they were fixed and kept unchanged for all the
Bees Algorithm on its performance and the speed of convergence had been
carried out (Pham et al., 2005). The experiments were conducted to test
different parameters of the algorithm and the effects of changing one parameter
while keeping other parameters fixed. Researchers (Pham et al., 2006b) have
indicated that one of the drawbacks of the original Bees Algorithm is the
number of tuneable parameters used and that further work should target the
(Pham et al., 2007d) to drop these numbers which concluded that even though
of the learning parameters, a smaller parameter set would ease the optimisation
No research has been conducted into either the statistical analysis of the Bees
Bees Algorithm on top of another Bees Algorithm during the parameter search
88
process and find the optimal settings, although this may incur a computational
overhead.
The proposed combined Bees Algorithm, called Meta Bees Algorithm, is used
to evolve suitable parameter values using its own optimisation process while
finding an area where the effects of these parameters on the algorithm are less.
modify and determine the appropriate parameter values while the problem is
For this work, the Bees Algorithm was ‘wrapped around’ a second Bees
Algorithm (the Wrapper). Figure 3.9 shows the pseudocode of the Meta Bees
Algorithm and Figure 3.10 demonstrates the flow of information between the
two Bees Algorithms. It can be seen that each bee of the Wrapper Bees
Algorithm represents a set of Bees Algorithm parameters and, again, the fitness
89
values are the total number of function evaluations required by the Bees
Algorithm to find the optimum solution for the function optimisation. The Bees
The performance of the Meta Bees Algorithm was evaluated on a set of five
proposed method for each problem, the results obtained were compared with
the results given by the standard Bees Algorithm an with the other optimisation
learning scenarios that were chosen from amongst widely used benchmarks in
the literature (Mathur et al., 2000). Table 3.1 shows the equations of the five
is given together with the range of the variables and the global minimum. The
narrow, parabolic shaped valley. Finding the valley is trivial, however locating
90
behaviour, with a rough multi-modal surface created by a cosinusoidal “noise”
component.
3- Select the solutions that satisfy the criterion and add them to the solution set
7- Recruit bees for selected sites (more bees for best e sites) and evaluate
fitness.
91
92
The Bees Algorithm - Wrapper
93
3.3.2 The Meta Bees Algorithm Implementation
the number of scout bees, n, the number of high-quality sites that are selected
for neighbourhood search, m, the number of elite (top-rated) sites amongst the
best m sites, e, the number of bees recruited for a neighbourhood search around
the e elite sites, nep, the number of bees recruited for a neighbourhood search
around the remaining (m-e) sites, nsp, the initial size of each flower patch, ngh,
In addition to the above seven main parameters, two extra parameters have been
parameter and the site abandonment parameter. However, these two extra
parameters have not been included in this study as the aim of the research was
to show how well the standard Bees Algorithm can perform without the need to
bee to select a value for each parameter before commencing the selection of the
solution components. Thus each bee maintains its own parameter values and in
turn uses these to adapt the parameter values. Selection of a parameter value is
94
based exclusively on the fitness of the solution i.e. if an improvement in the
As shown in Figures 3.10 and 3.11, the Meta Bees Algorithm consists of two
Bees Algorithms namely the Wrapper Bees Algorithm and the Wrapped Bees
Algorithm. The parameters values of the Wrapper Bees Algorithm have been
nep1 = 5, nsp1 = 3, ngh1 = 0.1 and the stopping criterion is 10000 iterations or
Each parameter of the Wrapped Bees Algorithm of the Meta Bees Algorithm is
given a suitable range in which its value can lay (Table 3.2). The initial value of
randomly generated within the range given in the table (3.2) with the following
m ≤ n Equation (3.3)
e ≤ m Equation (3.4)
95
n1 n2 x1
Bees Algorithm
m1 ‘Wrapper’ m2 C
e1 e2 x3
Bees Algorithm Function
nep1 nep2 ‘Wrapped’ x4 Optimisation
nsp1 nsp2 B
ngh1 ngh2 xd
Fitness Function
Number of Evaluations
96
Table 3.2 Range of Values Available to the wrapped Bees Algorithm
Value
Bees Algorithm Parameters Symbol
Minimum Maximum
97
3.3.3 Experimental Results
The experiments were performed using the Meta Bees Algorithm to evolve its
own parameter values. It was run 100 times for each parameter setting on each
benchmark problem. For each of the 100 trials, the Wrapped Bees Algorithm
50000 learning cycles had elapsed. The number of evaluations was recorded.
0 F x f 0.001
E
F x f else
Equation (3.5)
programs were coded in the C language and compiled with Microsoft Visual
C++. Each problem instance was run across 100 random seeds.
98
3.3.4 Comparison between the Standard Bees Algorithm and the Meta
Bees Algorithm
Table 3.3 shows the empirically derived Bees Algorithm parameter values used
Table 3.4 shows the results of running the Meta Bees Algorithm to optimise the
parameter values employed in the Wrapped Bees Algorithm while solving the
- n: The values were generally between 3 and 7, with 4 being most common.
- m: The value was the same (3) for all the optimisation functions.
- e: The value was the same (1) for all the optimisation functions.
- nsp: The value was the same (1) for all the optimisation functions.
- nep: The range of values was between 7 and 8, with 8 being the more
common.
- ngh: Generally the range of values was between 0.02 and 0.06 with 0.02
99
Table 3.3 Standard Bees Algorithm Parameter Settings
ngh
Function No. n m e nsp nep
(initial)
1 De Jong 10 3 1 2 4 0.1
5 Griewank 50 5 2 10 20 5
100
Table 3.4 Meta Bees Algorithm Parameter settings
1 De Jong 4 3 1 1 8 0.03
5 Griewank 3 3 1 1 8 0.06
101
Table 3.5 shows a comparison of the results obtained with the Meta Bees
SIMPSA) (Mathur et al., 2000), the Genetic Algorithm (GA) (Mathur et al.,
2000) and the Ant Colony System (ACS) (Mathur et al., 2000).
The average number of evolutions i.e. the numbers of points visited is shown
for 100 independent runs in Table 3.5. Inspection of the runtimes (number of
evaluations) for both algorithms, the Meta Bees Algorithm and standard Bees
Algorithm, reveal that overall, the Meta Bees Algorithm produced more stable
values for the Bees Algorithm parameters with a smaller number of evolutions
for most of the minimisation functions except the second function (Martin and
Gaddy).
A T-Test and Random Distribution test were performed to evaluate the results
obtained using the standard Bees Algorithm and Meta Bees Algorithm to see if
their means are statistically different from each other. These were to ensure
102
Table 3.5 Experimental Results
Standard Bees
SIMPSA NE-SIMPSA GA ACS Meta Bees Algorithm
Algorithm (*)
Funct. no.
Mean no. Mean no. Mean no. Mean no. Mean no. Mean no.
succ %
succ %
succ %
succ %
succ %
succ %
of evaluations of evaluations of evaluations of evaluations of evaluations of evaluations
1 *** *** *** *** 100 10160 100 6000 100 868 100 683
2 *** *** *** *** 100 2844 100 1688 100 526 100 608
3 100 10780 100 4508 100 10212 100 6842 100 631 100 571
4 100 12500 100 5007 *** *** 100 7505 100 2306 100 1471
5 *** *** *** *** 100 200000 100 50000 100 20998 100 16920
103
3.3.5 Statistical Analysis of the T-Test
Equation (2.1)
Robustness(S(t)) = [θ - σθ, θ + σθ]
(Engelbrecht, 2005)
simulation runs, and σθ is the variance in the performance criterion. The smaller
the value of σθ the smaller the range performance values unto which the
Test is performed. The T-Test checks the relationship between two variables, in
this case two different sets of parameters of the same algorithm and it tries to
104
2. If it does, how strong is the relationship?
In other words, tests for statistical significance are employed to address the
question: what is the probability that the relationship between two variables is
- to test whether there are differences between two groups on the same
variable based on the mean (average) value of that variable for each group;
some standard;
- to test whether the same group has different mean (average) scores on
different variables;
The test is employed for comparing the means of two samples even if they have
different numbers of replicates. The test compares the actual difference between
two means in relation to the variation in the data (expressed as the standard
expectation to test against is required. In this case, for the Bees Algorithm and
the Meta Bees Algorithm, the null hypothesis is that there is no difference in the
performance of the two algorithms. The T-Test will help to decide if the data is
105
consistent with this or departs significantly from this expectation. The T-Test
assesses whether the means of two groups are statistically different from each
other by providing an alpha (α) parameter. The parameter has three ranges:
Where
The formula for the T-Test is a ratio. The numerator of the ratio is the
The first test applied to the obtained results was the T-Test (Schneider and
Kirkpatrick, 2006). The T-Test was applied to all pairs of solutions and the
level. That is, the Meta Bees Algorithm requires significantly fewer evaluations
106
To demonstrate this significance graphically, the number of evaluations for
each independent run for both the Bees Algorithm and Meta Bees Algorithm
that were required to optimise the five functions studied in this chapter are
shown in Figure 3.12 (a-e) (in figure (e), the line representing the original
occasion the Bees Algorithm required fewer evaluations but that on average,
over 100 runs, the Meta Bees Algorithm required fewer evaluations. The T-Test
was conducted on the Meta Bees Algorithm and the original Bees Algorithm.
Table 3.6 shows the alpha values of each test function after applying the T-Test
to these functions.
These values indicate that the results obtained by both the Meta Bees Algorithm
and the original Bees Algorithm are most significantly different with a
107
Table 3.6. The Values of Alpha of each Test Function
Funct. no. 1 2 3 4 5
108
25000
20000
Number of Evaluations
15000
Original Parameters
10000
Optimised Parameters
5000
0
1 5 9 13 17 21 25 29 33 37 41 45 49 53 57 61 65 69 73 77 81 85 89 93 97
solutions
90000
80000
Number of Evaluations
70000
60000
50000
40000 Original Parameters
solutions
80000
70000
Number of Evaluations
60000
50000
40000
Original Parameters
30000 Optimised Parameters
20000
10000
0
1 5 9 13 17 21 25 29 33 37 41 45 49 53 57 61 65 69 73 77 81 85 89 93 97
solutions
109
300000
250000
Number of Evaluations
200000
150000
Original Parameters
50000
0
1 5 9 13 17 21 25 29 33 37 41 45 49 53 57 61 65 69 73 77 81 85 89 93 97
solutions
3000
2500
2000
Original Parameters
1500 Optimised Parameters
1000
500
0
1 5 9 13 17 21 25 29 33 37 41 45 49 53 57 61 65 69 73 77 81 85 89 93 97
solutions
110
3.3.5.2 Random Distribution Test
A Random Distribution test was also performed to the both results obtained
using the standard Bees Algorithm and Meta Bees Algorithm to ensure the
quality of the random numbers generated by the system. The Bees Algorithm
includes some randomisation in its two local and global searches such as the
initial distribution of the scout bees over the search space and the recruitment of
bees within the neighbourhood search area. This requires generating a sequence
finite, after a certain number of calls the sequence of random numbers that has
already been produced is repeated again. Hence, the larger this sequence length
is, the better the number generator should be. Random number generators
always need at least one integer value called the seed to get started. Different
seeds do not usually lead to different sequences of random numbers, but the
random numbers which often leads to different results. Various tests have been
number which means that every point of the search space has the same
probability of being chosen and not being biased to certain parts of the search
111
will affect the mechanism of how the Bees Algorithm explores new solutions as
discussed in chapter 3.
To test the quality of the random numbers a normalised distribution test was
test, the interval is divided into certain number of subintervals called bins and
then how many numbers there are in each bin are displayed. Figures 3.13 to
3.17 show two series of histograms that show the distribution of the generated
random numbers during the Bees Algorithm search. One histogram is divided
into 10 bins and the other is divided into 100 bins. For the value of bins equal to
10, some intervals get more random numbers than others, but as bins grow, the
distribution of the random numbers becomes more and more equal among the
intervals and graphs are smoother thus more acceptable randomness in the
112
90
80
Number of bin count
70
60
50
40
30
20
10
0
0 0.2 0.4 0.6 0.8 1
Intervals
(a) 10 bins
800
700
Number of bin count
600
500
400
300
200
100
0
0 0.2 0.4 0.6 0.8 1
Intervals
113
600
Number of bin count
500
400
300
200
100
0
0 0.2 0.4 0.6 0.8 1
Intervals
(a) 10 bins
5000
Number of bin count
4000
3000
2000
1000
0
0 0.2 0.4 0.6 0.8 1
Intervals
Figure 3.14 Distribution of Random Numbers in both 10 and 100 Bins for the
Martin and Gaddy Function
114
600
Number of bin count
500
400
300
200
100
0
0 0.2 0.4 0.6 0.8 1
Intervals
(a) 10 bins
5000
Number of bin count
4000
3000
2000
1000
0
0 0.2 0.4 0.6 0.8 1
Intervals
115
800
700
Number of bin count
600
500
400
300
200
100
0
0 0.2 0.4 0.6 0.8 1
Intervals
(a) 10 bins
8000
7000
Number of bin count
6000
5000
4000
3000
2000
1000
0
0 0.2 0.4 0.6 0.8 1
Intervals
116
16
14
Number of bin count
12
10
8
6
4
2
0
0 0.2 0.4 0.6 0.8 1
Intervals
(a) 10 bins
90
80
Number of bin count
70
60
50
40
30
20
10
0
0 0.2 0.4 0.6 0.8 1
Intervals
117
3.4 SUMMARY
The aim of the study reported in this chapter was to characterise the behaviour
of the Meta Bees Algorithm, highlight its strengths and weaknesses and show
the differences between the performance and reliability of the proposed method
and inexact way to find appropriate parameter values to suit various classes of
the algorithmic mechanics of the Bees Algorithm are used to produce suitable
The performance of the Meta Bees Algorithm was evaluated using five
benchmark minimisation tasks. The results were compared with those produced
118
by the Standard Bees Algorithm, the SIMPSA, the NE SIMPSA, the GA and
ACS.
The results for the function optimisation instances used to test this notion
suggest that its performance, in terms of solution costs and run times, is
2006b) were employed. In fact the performance in terms of objective cost was
often an improvement over the standard set. This may be attributed to the
ability of the new Meta Bees Algorithm to tailor parameter values to the
The results reveal that the improved solver generally performs well against one
that uses standard/fixed parameter values. This is attributed to the fact that
The results also highlight the importance for the Bees Algorithm to conduct a
the results show that good quality solutions are achieved for a range of function
optimisation problems.
119
The tests proved the strength of the Bees Algorithm in terms of accuracy,
learning speed and robustness. In four of the five benchmark cases considered,
procedures.
The results reveal that for the function optimisation problem, the use of the
Meta Bees Algorithm solver generally performs well against one that employs a
standard set of parameter values. This is attributed to the fact that parameter
120
CHAPTER 4
This chapter describes the application of the Bees Algorithm and statistical
carry out this task was designed with a new fitness evaluation method based on
computing the average fitness value for each bee over a number of trials rather
than computing the value of a single trial. The method enabled the algorithm to
be applied to those situations where the returned value of the fitness function of
a site is different every time this function is called. Hence, there is a need to
evaluate this site a number of times by sending a number of bees to the same
site (point) and then calculating their average value. This means that the
number of bees sent to each site is not constant and it is based on feedback
information gathered from the bees recruited so-far to the same point. To test
employed. This test took the shape of parameter setting for the ACS algorithm
The chapter is organised as follows: the new modified Bees Algorithm for
Section three details the analysis of the algorithm and the steps that it takes to
121
converge to the near optimum solution. The application of the algorithm to
problems. The algorithm works like the original Bees Algorithm (see Figure
3.1) but with the inclusion of a new statistical part which leads the Bees
Algorithm to evaluate the performance of each bee (see Figure 4.1). The
original Bees Algorithm involves calling the fitness function of the site where
the bee has been placed either randomly or directly within the patch. In
deterministic problems such as those the Bees Algorithm has dealt with before,
the value of the fitness function is fixed for the same site visited by a bee and
hence evaluating it only once is enough. However, with the new algorithm, the
that every time the fitness function is called, its return value will be different so
bees to the same site and then calculating their average value. The number of
bees sent to each site is not constant and it is based on feedback information
gathered from the bees recruited so-far to the same point. The feedback
122
information that will determine the number of bees sent to the same point is
based on the slope of the line formed from the linear regression of the fitness
values of the sent bees. The algorithm will stop sending more bees to the same
site when it indicates a near horizontal line. By adopting this technique, a more
accurate average fitness value for the sent bees to the same site is guaranteed
while at the same time consuming the minimum number of evaluations. The
accuracy of this average value will depend on the minimum number of bees
sent to the same point and the minimum acceptable slope value.
Figure 4.1 shows the pseudocode of the new algorithm. It is exactly like the
standard Bees Algorithm, the only difference being in the way that a bee is
slope value will determine the accuracy and the speed of convergence of the
algorithm. If the acceptable slope value is very small, the algorithm will take a
longer time to converge but its accuracy will be very high. On the other hand, if
a higher acceptable slope value is chosen, the running time will drop, but so
123
1. Initialise population with random solutions.
2. Evaluate fitness of the population by calling the subroutine.
3. While (stopping criterion not met)
// forming new population.
4. Select sites for neighbourhood search.
5. Recruit bees for selected sites (more bees for best e sites) and evaluate
fitness by calling the subroutine.
6. Select the fittest bee from each patch.
7. Assign remaining bees to search randomly and evaluate their fitness.
8. End While.
Figure 4.1 Pseudocode of the Modified Bees Algorithm for Solving Stochastic
Problems
124
4.2 COMPUTATION EXPERIMENTS
The experimental analysis was conducted in three stages; the first stage was to
answer the question of why there was a need to evaluate the same point in a
search space more than once in a stochastic problem. To address this, a study
on the parameters of the ACS and their influence on the speed of convergence
of the TSP instance was performed. Secondly, a study and analysis was
studying the relationship between the slope of the line formed from the linear
regression of the average fitness values of the sent bees and the accuracy of
these values obtained by the algorithm. Finally, based on these two previous
stages, the proposed method was applied on the ACS to find the best
solution on a TSP instant. The stages outlined above are now discussed in
detail.
two different experiments with different sets of parameter values. Figure 4.2
shows the first experiment on the variation of the number of function evolutions
that the ACS uses to find the optimum solution of a TSP instance called
125
Oliver30 (Oliver et al., 1987) and is illustrated in Figure 4.3 over 50 runs using
the same set of parameters shown in Table 4.1. Statistical information, see
Table 4.2, shows that the average value of the fitness which represents the value
Figure 4.4 shows the second experiment using a different set of parameters as
shown in Table 4.3 for the same TSP instance. Table 4.4 shows statistical
information from this experiment where the average value over 50 runs is 2370.
126
Table 4.1 Parameters employed in the First Experiment
m β ρ q0
11 4 0.2 0.7
127
1800
1600
1400
1200
Fitness
1000
800
600
400
200
0
-200 0 10 20 30 40 50 60
Runs
Figure 4.2 Fitness Values for the First Experiment over 50 Runs
128
Figure 4.3 Oliver30 TSP Problem
129
Table 4.2 Statistical information for the first experiment
50 22 1584 463
130
Table 4.3 Parameters employed in the Second Experiment
m β ρ q0
25 13 0.7 0.2
131
14000
12000
10000
8000
Fitness
6000
4000
2000
0
0 10 20 30 40 50 60
-2000
Runs
Figure 4.4 Fitness Values for the Second Experiment over 50 Runs.
132
Table 4.4 Statistical Results from the Second Experiment
133
The above two experiments demonstrated:
2. Although the same set of parameters were employed for each of the two
experiments over 50 runs each, the fitness value was never the same.
evaluating the same point (a set of parameters in this case) several times
and hence the need for the proposed method. In summary, this revealed
To demonstrate the relationship between the slope of the line formed from the
linear regression of the average fitness values of the sent bees and the values
134
optimisation problem. Figures 4.5, 4.6 and 4.7 show three different variations
problem. Figure 4.5 shows the variation of fitness values for five runs. In this
figure the slope is not equal to zero, which means more evaluations and fitness
values are needed to obtain a more accurate average value. This means that five
Figure 4.6 shows the variation of fitness values obtained from evaluating the
same stochastic problem over 22 runs, the slope of the line formed is near to
zero and the line is nearly horizontal. When the average value of slope of the
line for 22 runs is compared to the average of 90 runs, Figure 4.7, it shows that
The slope of the line formed by applying a least-squares liner regression on the
bees sent to the same point is an indication of the number of evaluations that is
value of its fitness. By using this type of feedback in the modified Bees
Algorithm, it will ensure having a more accurate average value while requiring
problems.
135
Table 4.5 shows the average obtained for three different numbers of runs; 5, 22
and 90 runs, where the average values found were 658, 472 and 471
respectively.
136
1400
1200
1000
y = 92.4x + 380.6
Fitness
800
R2 = 0.0881
600
400
200
0
0 1 2 3 4 5 6
Runs
137
1800
1600
1400
1200
Fitness
1000
800
600 y = 0.4457x + 493.48
400 R2 = 5E-05
200
0
0 5 10 15 20 25
Runs
138
3500
3000
2500
Fitness
Axis Title
2000
1500
1000
y = -0.0953x + 476.6
500
R2 = 3E-05
0
0 20 40 60 80 100
Runs
Axis Title
139
Table 4.5 Fitness Values for 5, 22 and 90 Runs
Fitness Value
Number of Runs
MAX MIN Average
5 1232 88 658
22 1584 22 472
90 3267 22 471
140
4.2.3 The Proposed Bees Algorithm
The problem of setting parameters can now be solved using the modified Bees
tested on the problem of finding the best parameter values for the ACS by
The fitness value is the total number of evaluations consumed by the ACS to
find the optimum solution of the TSP instance (see Figure 4.8).
The ACS parameters chosen to be optimised are the number of ants (m), the
parameter that determines the relative influence of the heuristic value (β), the
algorithm (q0) and the parameter that governs the local pheromone evaporation
(φ). The search spaces for these parameters are shown in Table 4.6. The other
parameters (the length of the candidate list (cl = 10), the parameter that governs
global pheromone decay (φ=0.1) and the initial value of the pheromone trails
value (τ0) are initialised by their default values as mentioned in section 2.4.6.3.
141
Figure 4.8 Layers Showing the Bees Algorithm Wrapping the ACS-TSP
142
Table 4.7 shows the best parameters obtained by applying the modified Bees
1GB of RAM. The process took three days to arrive at the best parameters for
the Oliver30 dataset using the programming language C#.Net 2008 and the .Net
framework 3.5.
143
Table 4.6 Search Spaces of the ACS Parameters
Parameter m β ρ q0
Min value 2 0 0 0
144
Table 4.7 The Optimum Results Obtained from the Modified Bees Algorithm Compared to
Mean no.
References m β ρ q0
of evaluations
145
4.3 SUMMARY
The key operation in this method was the multiple evaluation of the fitness of
each parameter setting tried, when using a modified version of the Bees
new algorithm was tested on the problem of finding the best values of the
The results obtained show that the algorithm was able to effectively find near
parameter sets that were suggested by other parameter settings methods such as
Further work could investigate the possibility of using the variation in the
many well-kown TSP benchmarking instances for finding the best parameters
146
for them by taking the average of these optimum parameters for different
instances.
147
CHAPTER 5
This chapter discusses the use of the Bees Algorithm to solve combinatorial
machine.
following:
148
there is a cost function which associates a cost to each solution generated by
feasible sequence of components such that the cost of the solution is minimised
when implemented in the minimisation problem (Pham et al., 2007a) and such
nodes and links between nodes (Engelbrecht, 2005). Each node represents one
of the components, and a link represents a transition from one node to the next.
A cost is associated with each link. The objective of the Bees Algorithm is to
traverse this graph, in order to construct a minimum cost path. The constructed
149
path represents a sequence of components, i.e. a solution to the optimisation
A bee has a memory to store information on the path constructed. The memory
only once.
One or more termination conditions are associated with each bee. These
observed’.
combinatorial problems, the Bees Algorithm has been applied to the TSP as it is
easy to understand, has numerous applications and has been studied extensively
by researchers from various disciplines (Aarts et al., 1988; Chandra et al., 1999;
Freisleben and Merz, 1996; Gambardella and Dorigo, 1996; Helsgaun, 2000;
150
Knox, 1994; Laporte, 1992). In addition, the TSP is considered difficult to
means that the time complexity of finding an optimal solution to these types of
problems grows exponentially with the problem size (e.g. the number of cities)
must be computed in order to determine the optimal path. Rather than searching
all possible tours to find an optimal solution, a common approach for this class
The TSP is a problem of finding the shortest tour that visits all the nodes of a
fully connected graph, the nodes of which represent locations, and the arcs
The TSP has been one of the most popular combinatorial optimisation problems
travelling from city B to city A. This would be the case if we only consider
distance, however if other factors are taken into account then we may not be
151
able to assign the same weight to travelling in both directions between two
cities. Such cases are called asymmetric TSPs or ATSPs (Freisleben and Merz,
1996). There are numerous techniques employed for tackling this class of
Johnson, 1979).
In the subsequent section, the main steps required to implement the Bees
Problem
(Johnson and McGeoch, 1997). Thus in general the search space consists of all
N! permutations.
The Bees Algorithm can be applied to the TSP in a straightforward way. Where
each bee represents a candidate tour and where the first and the last element of
152
the bee represent the city of origin. For example, the bee b (B, D, A, E, C, B)
represents a tour from city B, via cities D, A, E and C, then back to city B.
When applying the Bees Algorithm to a TSP as shown in Figure 5.1, the
sequence of each bee. Each bee becomes a symbolic string representing the
length of N is needed to encode each candidate solution where each bee will
visit (C) number of cities generated randomly from one to (C), which
formulates (C) links employed as the initial population for each bee.
generate letters between A and E and once a letter is generated (i.e. B in this
example) it will not be allowed to appear again. The first letter generated will
appear again at the end to give a closed tour. Then the generator generates
another letter (D in the above example), and so on until all the five letters are
In step 2, the fitness computation process (i.e. the performance evaluation of the
candidate solutions) is carried out for each patch visited by each bee. This is
completed by calculating the distance between each two adjacent cities in the
153
sequence and adding all the distances together to find the total length of each
N 1
f ( ) d (c (i ) , c (i1) ) d (c ( N ) , c (1) ) Equation 5.1
i 1
Where d(ci,cj ) is the distance between cities i and j, and (i) for i=[1], N
defines a permutation.
For the next step, step 3, the m patches (i.e. the tours) with the highest fitness
search.
such as mutation, inversion, swap and insertion (single or multiple). For the test
problems considered in the next section, the single-point insertion and the two-
paths optimal (2-Opt) operators (Burke et al., 1999) are adopted and shown.
selected patches, and more tours will be created for the best e patches. In step 6,
only the bee with the highest fitness (lowest tour length) in each patch will be
154
selected to form the next bee population. In step 7, the remaining bees in the
population are placed randomly around the search space to scout for new
Steps 4-7 are repeated until either the best fitness value (which will be
designated as the ‘global best tour’) has been found or the specified maximum
At the end of each iteration, the colony will have two parts to its new
population: representatives from the selected patches, and scout bees assigned
to conduct random searches. These steps are repeated until a stopping criterion
is met.
155
1- Initialise population with random solutions.
5- Recruit bees for selected sites (more bees for best sites) and evaluate fitness.
156
5.2.2 The Bees Algorithm with Neighbourhood operators
manner (Ibaraki, 1997). Two neighbourhood operators for the TSP have been
A. Single-point insertion
shown in Figure 5.2a, will be modified in the following way. The insertion
between two randomly chosen positions B and E. This section is then inserted
at a randomly selected point within the sequence; in this case, it is placed after
point D. It must be noted that this is carried out while preserving the visiting
order of the positions on the inserted section, producing the new sequence: C A
157
Original closed sequence : C B E A D (C)
C B
C B
D
C
B
158
B. The 2-Opt operator
The two (two paths) optimal (2-Opt) algorithm is a tour improvement procedure
(Okano et al., 1999). The best-known tour improvement procedures have been
found to be edge exchange procedures (Lin and Kernighan, 1973) such as the k-
Opt algorithm where all exchanges of k edges are tested until there is no
feasible exchange that improves the current solution; this solution is said to be
A 2-Opt operator involves randomly breaking a sequence into two paths. The
visiting order of the positions (cities) on one of the paths is then reversed before
the two paths are reconnected. The application of a 2-Opt operator to a closed
In addition to the use of single-point insertion, the 2-Opt local search algorithm
will be applied to the Bees Algorithm for the TSP. In the 2-Opt algorithm, two
tours are considered neighbours if one can be obtained from the other by
deleting two edges, reversing one of the resulting two paths, and reconnecting
them. In the TSP, the 2-Opt neighbours of the tour are pair-wise part exchanges
within the current solution sequence. For example, with a number of cities n = 5
159
and an original solution sequence of (C, B, D, A, E) shown in Figure 5.3b, it
will be modified in the following way. Two edges will be deleted randomly
(e.g. BD and EC), thus breaking the sequence into two paths (CB) and (DAE).
One of the paths (DAE) will be reversed to become (EAD) and then the two
then reconnected.
160
Original closed sequence: C B D A E (C)
Broken-up sequence: CB -- D A E
Path 1: CB
Path 2: DAE
161
C
B
C
B
C
B
D
Figure 5.3b 2-Opt Operator
162
In addition to the random way, there are different ways to generate a starting
tour for the initial application of the 2-Opt algorithm. A typically way is to use
instruction: "At each stage visit the unvisited city nearest to the current city"
(Lawler et al., 1985). In this study however, the starting point is rapidly attained
For the purpose of comparison with other optimisation techniques, the Bees
these problems were 16, 44 and 91 cities with optimum solutions equal to
which is the distance between two points is employed in these examples. Table
5.1 presents the results produced by the Bees Algorithm along with those
produced by three other approaches for the same TSPs. These approaches are
the GA, SA and Ant Colony System (ACS) (Stützle and Hoos, 1997).
163
Table 5.1 Performance of the Bees Algorithm Compared to the GA, SA and ACS
TSP instances
164
The results show that the Bees Algorithm is able to find the optimal solution for
two of the benchmark problems (16 cities and 44 cities) and a near optimal
solution to the third problem. The Bees Algorithm required less time (a fewer
number of iterations) to find the solution to all three problems than either the
GA or SA. However, while it could outperform the ACS for the smallest sized
problem (16 cities), it needed more time for larger numbers of cities. Table 5.1
also shows that the performance of the Bees Algorithm generally drops when
the size of the problem instances increases. One of the reasons could be the
The next part of this chapter discusses the use of the Bees Algorithm to solve
more complex optimisation problems than the TSP and that is the Printed
Circuit Board (PCB) assembly planning problem. This is carried out over four
sections:
The first part, Section 5.4.1, reviews the basic types of PCB assembly machines
have been applied. The second part, Section 5.4.2, describes the general use of
the Bees Algorithm to generate optimal PCB assembly plans. The third part,
placement machine. The final part, Section 5.4.4, presents the results obtained.
165
5.3 THE BEES ALGORITHM AS APPLIED TO THE PRINTED
CIRCUIT BOARD ASSEMBLY OPTIMISATION PROBLEM
shapes and sizes employing various types of surface mount technology (SMT)
have the ability of fast component placement and can handle high and rapid
minimise the time needed to process the different components. Similar to the
TSP, this time grows exponentially with the problem size (i.e. the number of
components).
In order to make full use of the high speeds of these placement machines, many
Evolutionary Programming (EP) (Nelson and Wille 1995). Results have shown
that these techniques are able to provide near-optimal solutions in a short period
of time.
166
5.3.1 Printed Circuit Board Assembly
Table 5.2 illustrates three types of machines for placing through-hole and
In a type–1 machine, a single feeder F1, which can take the form of a magazine,
location in the horizontal x-y plane. The head H also deposits components onto
the PCB at a fixed point in the x-y plane. The table T moves in the x-y plane so
that components are placed at the desired locations on the PCB. This type of
assembly machine is the simplest and is normally adopted when only one type
167
In a type–2 machine, the feeder (or feeder array) and the table are stationary
(and hence the PCB is also held in at a fixed location). The single assembly
head H (again, there is no turret) moves in the x-y plane carrying components to
PCB.
(2) A feeder array F2 that moves along the x-axis to bring the feeder with the
(3) A table T that moves in the x-y plane to position different points of the
feeder and the table have reached their designated positions and the turret has
completed indexing the appropriate pick-up and placement heads (Ayob et al.,
2002). This type of machine can also place components of different types. The
168
synchronisation of the multiple feeders, the multi-head turret pick-and-place
169
Table 5.2 Types of PCB Assembly Machines and their Characteristics (Ang et al., 2009), T:
Table, F1: Single Feeder, F2: Multiple Feeders, H: Head.
Machine Type Type–1 Type–2 Type–3
F2
F1
Model of H
system
Turret
T F2
Model of Travelling salesman Pick and place Moving Board with Time Delay (MBTD)
problem
Description of The machine assembles the The head H moves in the x-y axis to pick The multi-head turret H picks the components
assembling components while only the table and place (assemble) the components from the feeder array F2 (which moves in a
process T that holds the PCB may move while the table T that holds the PCB is single axis to provide the right component for
in the x-y axis. The component is stationary. The feeder array F2 is also assembly) with one head while placing them
fed directly into the assembly stationary. with the other onto the PC board after rotating.
head H. The PCB is held by a table that moves in the x-y
axis in accordance with the sequence and
location of the component that needs to be
assembled.
Key 1. The path to assemble the 1. The feeder slot arrangement. 1. The feeder slot arrangement.
characteristics components 2. The shortest path to assemble the 2. The shortest path to assemble the
of solution components. components.
3. The number of heads on the assembly
turret.
170
B. Printed Circuit Board Assembly Planning
PCB assembly planning involves two types of tasks: set-up management and
arrangement, the relative positioning of the feeders in the array requires setting
optimise the movements of the table (in a type–1 machine) or the assembly
head (in a type–2 machine). This problem could be viewed as a typical TSP for
N Equation 5.1a
DTotal D(Ci , Ci 1 )
i 1 (Ho and Ji, 2007b)
171
Where N is the total number of components to be placed onto a PCB and D(Ci,
Ci+1) is the distance travelled by the table or the assembly head when moving
from the placement position for component Ci to the placement position for
component Ci+1. (Note that the placement position for CN+1 is usually taken to
be the same as that for C1, the starting position, as CN is the last component to
As the cycle time is the real factor of interest in this problem, the objective
Equation 5.1b
D
TTotal Total
V (Ho and Ji, 2007b)
In a type–3 machine, known as the Moving Board with a Time Delay (MBTD),
as shown in Figure 5.4, the assembly time is affected by three factors. These are
the movement of the PCB, the shifting time of the turret head, and the travelling
time of the feeder carrier. The total assembly time needed for a PCB is the
summation of the dominating times associated with these three factors for all
board components. The formula for the total assembly time is defined in
Equation 5.2.
172
N Equation 5.2
TTotal Ti
i 1 (Ho and Ji, 2007b)
Where N is the total number of components to be placed and Ti, the time
Equation 5.3
Ti max[ t1 (ci 1 , ci ), t 2 ( f i g 1 , f i g ), t3 ]
(Ho and Ji, 2007b)
Where g is the number of assembly heads positioned between the pick-up and
placement heads on the turret, t1 is the time for the table to move from the
is the starting position of the table, and is given by the Chebyshev metric:
Equation 5.4
x x y yi1
t1 (ci , ci1 ) max i i1 , i
v vy
x (Ho and Ji, 2007b)
component ci,, vx and vy are the velocities of the x-y table in the x and y
directions respectively (both velocities are assigned as 60mm/s for this study),
173
t2 is the time for the feeder array to change the pick-up feeder from the feeder
onto the PCB. (As CN is the last component to be assembled onto a given PCB,
CN+g and CN+g+1 are the gth and (g+1)th components to be placed onto the next
PCB.) The Chebyshev metric essentially takes into consideration the x-y
movement of the board table as independent motions. This is usually the case
when the x-y table is controlled by two motors, each separately controlling the
x and y movement.
The distance between feeders is measured using the Euclidean metric. The
2 2
Equation 5.5
x jf xif y jf yif
t2 ( f i , f j )
vf (Ho and Ji, 2007b)
Where xi is the x coordinate of the feeder fi, yi is the y coordinate of the feeder
fi, and vf is the speed of the feeder carrier (vf is 60mm/s in the case study).
174
For the case study in this chapter, the feeders are arranged in a straight line (y-
the x-coordinates for the feeders are the same throughout, and any variation due
t3 is the time taken by the turret to index the assembly heads by one position
and is set as 0.25 seconds per step. Generally, indexing takes place one position
As there are three moving parts in this type of machine (a board, a feeder, and a
turret), each moving part has to wait for the other two parts to complete their
movements before the next component can be picked up or placed. Hence, the
time Ti, defined in Equation 5.3, needed for the placement of component i is the
maximum time between the board movement t1, the feeder movement t2, and
the indexing time during each pickup and placement t3. The problem with this
sequence of the board components and assign the various types of components
to the feeders such that the total assembly time is minimised (Ho and Ji, 2007a).
Another aspect of this process that must be addressed is the more complex, but
denoted as, F = {f1…, fj, …, fR-1, fR}, where fj is the feeder for the jth component
175
type, and the sequence of placement of components denoted as C ={c1…, ci,
…, cN-1, cN}, where ci is the ith component to be placed (Figure 5.5) in order to
176
The rotary movement
The y-axis of the multi-head turret
movement of
The y-axis
the PCB
movement of the
mounting
feeder
table
PCB mounting
table
The x-axis movement of the PCB mounting PCB Feeder
table system
Multi-head with 10
turret (with 2 slots
heads in this
diagram)
Figure 5.4 PCB Assembly Machine of the MBTD Type (with 2 Rotary Turret Heads, 10 Feeder Slots and a
Moveable Assembly Table)
177
Component Assembly Link Feeder Arrangement Link
c1 c2 c3 c4 . . . cN-3 cN-2 cN-1 cN f1 f2 . . . fR-1 fR
178
Previous researchers have applied a variety of techniques to provide a solution
included the GA (Maimon and Brha, 1998; Wong and Leu, 1993; Ong and
Khoo, 1999; Ho and Ji, 2007b), EP (Nelson and Wille, 1995), the minimal
spanning tree technique (Leipala and Nevalainen, 1989), and rule-based expert
system techniques (Yeo et al., 1996). The GA has been successfully employed
to solve the Moving Board with a Time Delay (MBTD) problem (Wong and
Leu, 1993; Ong and Khoo, 1999). Four genetic operators and two-links were
assignment problems. It was shown that the method is easily adaptable to the
2002), the researchers focused on the application of the GA to solve the MBTD
problem for a high-speed PCB assembly machine where eight operators (four
paper (Yeo et al., 1996), a rule-based frame system for PCB assembly was
179
component sequencing and the feeder arrangement problems together for the
Of these four techniques, the GA and EP seem to be the most popular due to
their simple implementation and robustness against local optimum traps where
a local, but not global minimum is found. A comparison of the results obtained
planning problem will be presented. These results were compared with the
results found when applying the Bees Algorithm to the same problem.
Figure 5.6 shows the flowchart of the Bees Algorithm when applied to the
of the Bees Algorithm have been initialised; the algorithm generates initial
solutions (i.e. scout bees) for both component sequencing and feeder
arrangement problems. Hence each bee is comprised of two links (as shown in
Figure 5.5). The first link represents the sequence of component placements and
180
The scout bees are normally created by randomly generating feeder
arrangements and placement sequences and then checking that they are valid. A
(A) might correspond to feeder (A) which supplies 100 resistors. The
with the total number of labels (i.e. the length of the sequence) being equal to
Next, the fitness of each bee is measured, where each fitness is given as the
assembly time, found using Equation 5.3. The fitness values are then sorted and
the bees with higher fitness values are selected and a neighbourhood search is
initiated using the 2-Opt local search heuristic for the first link and the single-
point insertion algorithm for the second link. The fittest bee from each site is
then selected to form the next bee population. The remaining bees in the
population are placed randomly around the search space to scout for new
potential solutions (sequences). This process is repeated until either the best
fitness value has been found or the specified maximum number of iterations has
been reached.
181
Initialise Bees Algorithm parameters
182
5.3.3 PCB Component Assembly Using a MBTD Machine
The problem employed to test the ability of the BA to perform PCB assembly
planning for a type–3 machine is detailed in (Leu et al., 1993). For this
problem, the number of components to be placed onto a PCB is 50 and there are
the placement positions and the parameters of the assembly machine (speed of
movement of the table, assembly heads and indexing time of the turret)
At first, the PCB problem was solved with the initial positions of the scout bees
Bees Algorithm was then made by introducing a good patch (a good initial
solution) to one of the scout bees. The location of that patch was found by
optimising only the component placement sequence (the first link) thus treating
183
Table 5.3 The Parameters of the MBTD Assembly Machine
Number of components 50
Number of feeders 10
184
5.3.4 Experimental Results
The main features of the Bees Algorithm employed in this work have been
chosen by running a set of trail experiments and shown in Table 5.4. As can be
noticed from this table, the number of parameters in the Bees Algorithm has
been reduced from six to three. This is because the elite sites parameter (e) was
not employed and hence the number of recruited bees (nep) around it was not
employed either. In addition, the patch size parameter (ngh) was not needed
because a local search operator e.g. either the 2-Opt or single-point insertion,
Table 5.4 also shows that the population size n was initialised to 100 bees for
the first iteration. This then dropped to be equal to the number of selected sites
m (20 sites). The recruited bees were then: nep, that is 50 bees for each of the
best m sites.
5.4 DISCUSSION
Figure 5.7 shows the evolution of the best assembly time as the operation of the
Bees Algorithm progresses for the first case where a good starting solution was
not chosen (without “seeding”). After 160 iterations, the best assembly time
185
For the second case where seeding was employed, the sequence produced an
Figure 5.10 shows the evolution of the best assembly time and Figure 5.11 the
optimal sequence after 100 iterations with an assembly time of 24.08 seconds.
For comparison, Table 5.5 presents the above results found using the Bees
Algorithm alongside those produced by other researchers for the same problem
using the GA (Ho and Ji, 2007b; Leu et al., 1993; Ong and Tan, 2002) and EP
According to Table 5.5, the performance of the Bees Algorithm with seeding
seconds), the simple GA (51.5 seconds), the hybrid GA (25.5 second) and EP
186
Table 5.4 The Parameters of the Bees Algorithm
Value
Seeding initial
Bees Algorithm parameters Symbol Completely random
population with a
initial population
good solution
100 100
onwards) onwards)
187
Figure 5.7 Evolution of Best Assembly Time for Case 1 – Without Seeding
188
Figure 5.8 Optimal Assembly Sequence (25.92 sec) after 160 Iterations for
case 1 – Without Seeding
189
Figure 5.9 Assembly Sequence (29.00 sec) Employed as a Seed for Case 2 –
With Seeding
190
Figure 5.10 Evolution of Best Assembly Time (29.00 sec) for case 2 –
With Seeding
191
Figure 5.11 Optimal Assembly Sequence (24.08 sec) after 100 Iterations for
case 2 – With Seeding
192
Table 5.5 Results Obtained using Different Algorithms
193
5.5 SUMMARY
This chapter has described the application of the Bees Algorithm to the
seconds obtained by the Bees Algorithm was 6% shorter than the best assembly
time reported in the literature to date, 25.5 seconds. If the assembly machine
was employed continuously, 24 hours a day, 365 days a year, such a saving in
72,000 PCBs.
The performance of the Bees Algorithm for solving the component sequencing
candidate solutions that had to be generated and evaluated (as seen with the
assembly task.
194
CHAPTER 6
CONCLUSION
This chapter summarises the main contributions of this work and the
6.1 CONTRIBUTIONS
This research has introduced the Bees Algorithm as a swarm-based tool for
three. This was attained by making some of the parameters dependent on others
and by the selection of the best sites only and not selecting the elite bees as is
195
the case with the standard Bees Algorithm. This in return eliminated the need to
choose the number of recruited bees around the elite sites (nep). In addition, the
patch size parameter was not required because a local search operator e.g. either
the 2-Opt or single-point insertion, was employed for this type of combinatorial
problem.
6.2 CONCLUSIONS
All algorithms have a set of parameters that control their behaviour. These are
arrive at solutions to the problem at hand. This set of parameters depends on the
techniques.
The use of the activity of foraging bees as model for an optimisation process
was shown to provide substantial benefits especially when compared with other
optimisation techniques.
The research in this thesis has extended the application of the Bees Algorithm
196
Algorithm was employed to optimise stochastic problems based on statistical
from six to three which makes the tuning easier. The algorithm can also adapt
When combined with a local search algorithm (2-Opt), the Bees Algorithm was
There are a number of directions that can be pursued in order to enhance the
1. The Bees Algorithm could be combined with any of the Ant Colony
developed that employs the Bees Algorithm as a global search and the ACS as a
local search.
2. The Bees Algorithm was employed to tune its own parameters. It can be
tested on the tuning of other algorithms and techniques, for example, online
197
3. The Bees Algorithm could be applied to other types of combinatorial
Algorithm. For example, the standard deviation of the fitness values which
modified Bees Algorithm to find the best and most stable solution.
198
REFERENCES
Aarts, E. H. L., Korst, J. H. M. and Vanlaarhoven, P. J. M. 1988. A quantitative
analysis of the simulated annealing algorithm – A case study for the traveling
pp. 99-114.
Ang, M.C., Pham, D.T., Ng, K.W. 2009. Application of the Bees Algorithm
Ayob, M., Cowling, P. and Kendall, G. 2002. Optimisation for surface mount
placement machines. In: Proceeding of IEEE ICIT'02. Bangkok, 2002, pp. 498-
503.
Azeem, M.F. and Saad A.M. 2004. Modified Queen Bee Evolution Based
299-303.
199
Bahamish, H. A. A., Abdullah, R. and Abdul Salam, R. A. 2008. Protein
Conformational Search Using Bees Algorithm. In: 2nd IEEE Asia International
Beekman, M., Fathke, R., and Seeley, T. 2006. How does an informed minority
of scouts guide a honey bee swarm as it flies to its new home? Animal
Behavior, 71(1):161–171.
Bilchev, G. and Parmee, I.C. 1995. The ant colony metaphor for searching
200
Blackwell, T. and Branke, J., 2004. Multi-swarm optimization in dynamic
Bonabeau, E., Dorigo, M., and Theraulaz, G. 1999. Swarm intelligence: from
Burke, E.K., Cowling, P.I. and Keuthen, R. 1999. New models and heuristics
Camazine, S., Deneubourg, J.L., Franks, N.R., Sneyd, J., Theraula, G., and
University Press.
Chandra, B., Karloff, H. and Tovey, C. 1999. New results on the old k-opt
Coy, S.P., Golden, B.L., Runger, G.C., and Wasil, E.A. 2001. Using
201
Deneubourg, J.L., Aron, S., Goss, S. and Pasteels, J.M., 1990. The self-
Press.
Dorigo, M., Di Caro, G., and Gambardella, L.M. 1999. Ant algorithms for
Dréo, J. and Siarry, P., 2004. Continuous interacting ant colony algorithm
841–856.
Eberhart, R., Shi, Y. and Kennedy, J. 2001. Swarm intelligence. San Francisco:
202
Hoboken, N.J. Wiley.
Figlali, N., Özkale, C., Engin, O. and Figlali, A. 2005. Investigation of ant
Freisleben, B. and Merz, P. 1996. A genetic local search algorithm for solving
Frisch, K.V. 1976. Bees: their vision, chemical senses and language. Revised
Fogel, L.J., Owens, A.J., and Walsh, M.J. 1966. Artificial intelligence through
203
Gaertner, D. and Clark, K. 2005. On optimal parameters for ant colony
Artificial Intelligence, Las Vegas, Nevada, USA, CSREA, 2005, pp. 83 - 89.
Garey, M.R. and Johnson, D.S. 1979. Computers and intractability: A guide to
Cardiff University.
204
Hao, Z.-F., Cai, R.-C., and Huang, H. 2006. An adaptive parameter control
Ho, W. and Ji, P. 2007b. Optimal production planning for PCB assembly.
London: Springer.
evolutionary computation. Ed. Back, T., Fogel, D.B. and Michalewicz, Z. IOP
205
Johnson, D.S. and McGeoch, L.A. 1997. Local search in combinatorial
Springer-Verlag ,Berlin.
Kohonen, T. 1990. The Self-Organising Map". Procs. IEEE, 78(9), pp. 1464-
1480.
231-247.
206
Lawler, E.L., Lenstra, J.K., Rinnooy Kan, A.H.G. and Shmoys, D.B. 1985. The
Dispatch Using the Bees Algorithm with Weighted Sum. In: EU-Korea
Lin, S. and Kernighan, B.W. 1973. An effective heuristic algorithm for the
Ling, W. and Luo, H. 2007. An adaptive parameter control strategy for ant
207
Lucic, P. and Teodorovic, D. 2003. Computing with bees: attacking complex
Martens, D., De Backer, M., Haesen, R., Vanthienen, J., Snoeck, M., Baesens,
Merz, P. and Freisleben, B. 1997. Genetic local search for the TSP: New
208
Nelson, K.M. and Wille, L.T. 1995. Comparative study of heuristics for optimal
Okano, H., Misono, S. and Iwano, K. 1999. TSP construction heuristics and
their relationships to the 2-Opt. Journal of Heuristics (1), pp. 71-88, Kluwer
Oliver, I. M., Smith, D.J. and Holland, J.R.C. 1987. A study of permutation
Second Int. Conf. Genetic Algorithms and their Applications. Cambridge, MA,
Ong, N. and Khoo, L.P. 1999. Genetic algorithm approach in PCB assembly.
Ong, N.S. and Tan, W.C. 2002. Sequence placement planning for high-speed
optimisation and control, IEEE Control Systems Magazine (June), pp. 52-67.
209
Passino, K.M., Seeley, T.D., and Visscher, P.K., 2008. Swarm cognition in
Pellegrini P., Favaretto D. and Moretti E. 2006. On MAX -MIN ant system's
Pham, D.T., Afify, A.A. and Koç, E. 2007b. Manufacturing cell formation
Pham, D.T. and Oztemel, E. 1992. Control Chart Recognition Using Neural
train Neural Networks for Wood Defect Classification. In: 4th International
Pham, D.T., Ghanbarzadeh, A., Koç, E., Otri, S., Rahim, S. and Zaidi, M.
2006b. The Bees Algorithm - A novel tool for complex optimisation problems.
454-459.
210
Pham, D.T., Koc, E., Ghanbarzadeh, A., and Otri, S. 2006c. Optimisation of the
Turkey, 2006.
Pham, D. T., Koc, E., Lee, J.Y. and Phrueksanant, J., 2007c. Using the Bees
Pham D. T., Lee J. Y., Haj Darwish A., and Soroka A. J. 2008a. Multi-objective
Scotland, 2008.
Pham, D.T., Castellani, M. and Fahmy, A.A., 2008e. Learning the inverse
211
Pham, D.T., and Karaboga, D., 2000. Intelligent optimisation techniques:
Pham D. T. and Sahran S., 2006. “Control Chart Pattern Recognition with
045157-8.
Pham, D.T., Ghanbarzadeh, A., Koc, E., and Otri. S., 2006d. Application of the
Bees Algorithm to the training of radial basis function networks for control
212
chart pattern recognition. In: 5th CIRP International Seminar on Intelligent
Pham, D.T., Ghanbarzadeh, A., Koc, E., Otri, S., Rahim, S., and Zaidi, M.,
Pham, D. T., Muhamad, Z., Mahmuddin, M., Ghanbarzadeh, A., Koc, E. and
Otri, S. 2007a. Using the Bees Algorithm to optimise a support vector machine
Algorithm. In: 17th IFAC World Congress COEX, South Korea, 2008, pp.
6100-6105.
Pham, D.T., Otri, S. and Darwish, A.H., 2007d. Application of the Bees
Pham, D.T., Soroka, A.J., Ghanbarzadeh, A., Koc, E., Otri, S. and
213
defects using the Bees Algorithm. In: IEEE International Conference on
Pham, D.T., Otri, S., Afify, A., Mahmuddin, M., and Al-Jabbouli, H. 2007f.
Data clustering using the Bees Algorithm. In: 40th CIRP International
Pham, D. T., Otri, S., Ghanbarzadeh, A., and Koc, E. 2006a. Application of the
Pilat, M.L. and White, T. 2002. Using Genetic Algorithms to optimize ACS-
Rego, C. and Glover, F. 2002. Local search and metaheuristics. Gutin and
214
Rosenkrantz, D.J., Stearns, R.E. and Lewis, P.M. 1977. An analysis of several
Saad, E.M., Awadalla, M.H., Darwish, R.R. 2008"A Data Gathering Algorithm
Sadik, S., Ali, A., Ahmad, F. and Suguri, H. 2006. "Using Honey Bee
Work in Design, 2006. CSCWD '06. 10th International Conference on, pp.1-6.
Seeley, T.D. 1996. The wisdom of the hive: The social physiology of honey bee
honey bee swarm perceive the completion of their group decision making.
215
Socha K. 2003. The influence of run-time limits on choosing ant system
Stützle, T., 1997. MAX-MIN Ant System for the quadratic assignment
Germany, 1997.
Stützle, T. and Hoos, H. 1997. MAX-MIN ant system and local search for the
Teodorovic, D., Lucic, P., Markovic, G. and Orco, M. D. 2006. Bee colony
216
Tereshko, V. and Lee, T., 2002. How information-mapping patterns determine
Evolutionary Computation Conference, Chicago, IL, USA, 2003 (2), pp. 1355-
1362.
tolerant routing algorithm inspired by honey bee behavior. 2nd ed. Lecture
Wedde, H.F., Farooq, M., Pannenbaecker, T., Vogel, B., Mueller, C., Meth, J.,
mobile ad hoc networks inspired by bee behaviour. In: Proceedings of the 2005
217
White, C.M. and Yen, G.G. 2004. A hybrid evolutionary algorithm for
Wolpert, D.H. and Macready, W.G., 1997. No free lunch theorems for
82.
Wong, H. and Leu, M.C. 1993. Adaptive genetic algorithm for optimal printed
circuit board assembly planning. Annals of the CIRP. 42, pp. 17-20.
Wong, K. Y., Komarudin, 2008. Parameter tuning for ant colony optimization:
Yeo, S.H., Low, C.W. and Yong, K.H. 1996. A rule-based frame system for
218
Zecchin, A.C., Simpson, A.R., Maier, H.R. and Nixon, J.B. 2005. Parametric
219
220