A user-friendly Bees Algorithm for continuous and combinatorial optimisation

Abstract This paper introduces a new variant of the Bees Algorithm (BA) called Bees Algorithm with 2-parameter (BA2), which is a population-based metaheuristic algorithm designed to solve continuous and combinatorial optimisation problems. The proposed algorithm simplified the BA’s parameters by combining exploration and exploitation strategies while preserving the algorithm’s core principles to efficiently search for optimal solutions. The paper provides a detailed description of the algorithm’s core principles and its application to two engineering problems, the air-cooling system design (ACSD) and the printed circuit board assembly sequence optimisation (PASO). The results show that BA2 outperforms previous versions of the basic BA in terms of convergence speed and solution quality. However, the authors acknowledge that further research is needed to test the scalability and generalisability of the algorithm to larger and more diverse optimisation problems. Overall, this paper provides valuable insights into the potential of metaheuristics for solving real-world optimisation problems.


Introduction
Metaheuristics have become increasingly important in today's complex optimisation landscape due to their ability to handle large-scale, nonlinear, nonconvex, and NP-hard problems more efficiently than exact methods.As the size and complexity of real-world problems grow, exact methods often become computationally infeasible or less effective, whereas metaheuristics can provide good-quality solutions within a reasonable time frame.Additionally, metaheuristics can adapt better to noisy or dynamic environments, tackle multi-objective optimisation problems, and work effectively with limited information or computational resources.These qualities make metaheuristics an essential tool for addressing the increasingly complex and diverse optimisation challenges that arise in modern applications across various domains.
While metaheuristics offer several advantages in solving complex optimisation problems, they also come with certain disadvantages.These include the lack of optimality guarantees in a very complex problem, as metaheuristics typically find near-optimal solutions rather than exact ones.Additionally, they may suffer from premature convergence, where the algorithm becomes trapped in local optima and fails to explore the entire search space effectively.Metaheuristic solutions heavily rely on parameter settings, making it challenging to find the optimal configuration for a specific problem, particularly for users with limited domain knowledge (Riff & Montero, 2013).This initial parameter setting issue, which is a major weakness, can lead to suboptimal performance and slow convergence if not addressed properly.
Many metaheuristic algorithms, including the Bees Algorithm, involve tuning several initial parameters, such as population size, exploration, exploitation, and termination criteria.Determining the ideal combination of these parameters can be a daunting task, particularly for individuals new to the algorithm.In the basic Bees Algorithm, there are at least seven initial parameters (Pham et al., 2005(Pham et al., , 2006) that need to be configured before optimising a problem.These include the scout population size (n), the numbers of elite (e) and selected (m) sites, the numbers of elite (nep) and non-elite selected (nsp) workers, and the neighbourhood size (ngh).Additionally, in the standard BA version, users must also set other initial parameters: the neighbourhood search shrinking rate (shrink) and stagnation limit (stlim) of the abandonment strategy, which helps in escaping local optimum traps.Balancing exploration and exploitation requires adjusting at least four parameters, which can be difficult for novice users who are unfamiliar with the intricacies of the Bees Algorithm.To further complicate matters, users also need to consider the termination parameters.This paper will examine the principles of BA 2 to address the challenge of complex parameter settings and explore its applications in both the continuous and combinatorial domains.BA 2 introduces a novel search procedure that reduces the initial parameters of the basic Bees Algorithm without fundamentally changing its nature.This updated algorithm only requires two parameters for exploration and exploitation in the solution space, making it more efficient and easier to implement than the basic and standard BA.
The next section will provide a literature review of the Basic Bees Algorithm, featuring six parameters, and the Standard Bees Algorithm, which includes eight parameters.This review will encompass 15 years of development and a wide range of applications from engineering to bioinformatics.Section three will focus on the fundamental concepts of the proposed BA 2 algorithm, highlighting the inspiration drawn from bee foraging behaviour, which simultaneously encompasses exploration and exploitation.Section four will focus on computational examples of BA 2 applied to continuous and combinatorial problems, specifically optimising air-cooling system design (ACSD) and printed circuit board (PCB) assembly sequence optimisation (PASO) problems.The ACSD problem involves optimising systems to fulfil specific requirements, while the PASO problem is a well-known combinatorial routing problem aimed at finding the shortest assembly route for components on a PCB.The results of the proposed BA 2 algorithm will be presented and compared with outcomes from previous versions to highlight the improvements achieved.
The fifth section concludes the paper by summarising the findings obtained, highlighting the enhanced efficiency and applicability of BA 2 to various real-world challenges and proposing future research directions.
The main contribution of this work is the reduction of the BA's initial parameters while preserving the algorithm's core principles and the demonstration of the successful application of BA 2 to two engineering optimisation problems, representing both continuous and combinatorial problems.

The Bees Algorithm
The Bees Algorithm is a straightforward population-based metaheuristic algorithm used for addressing continuous and combinatorial optimisation problems (Lones, 2020) and one of the beeinspired algorithms.Drawing inspiration from the foraging behaviour of honeybees (Pham et al., 2005), this intelligent algorithm emulates the process of bees locating nectar and sharing information about food sources within their hive.Initially, the Bees Algorithm was designed for searching in continuous space and was assessed using numerical functions.In contrast, other popular algorithms, such as the genetic algorithm (GA), ant colony optimisation (ACO), tabu search (TS), and simulated annealing (SA), were initially developed to tackle combinatorial problems in discrete space.The performance of these algorithms was evaluated using the travelling salesman problem (TSP) as the standard test function.
BA has gained popularity in a wide range of applications, such as engineering design, machine learning, and scheduling, due to its ability to efficiently solve complex optimisation problems.However, one of the main challenges of BA is the need to tune its fixed set of parameters manually, which can be a time-consuming process and may not always result in the best possible solution.The basic and standard versions of the Bees Algorithm require six and eight initial parameters, as mentioned above, and initial inputs such as: the error threshold and the maximum number of function evaluations (NFE) or iterations (nIt) are often used as stopping criteria.

Bee-inspired algorithms
There are at least eight prominent bee-inspired metaheuristic algorithms, including Mating Bee Optimization (MBO) proposed by Abbass (2001), Bee Colony Optimisation (BCO) by Lucic (2002) as an extension idea from the Bees System by Lucic and Teodorovic (2001), Bee Evolution for Genetic Algorithms (BEGA) by Jung (2003), Honey Bees Algorithm (HBA) by Nakrani and Tovey (2004), Bees Algorithm (BA) by Pham et al. (2005), Artificial Bee Colony (ABC) by Karaboga (2005), Bee Swarm Optimisation (BSO) by Akbari et al. (2010) and Generic Bee Colony Optimisation (GBCO) by Wong (2012).These algorithms draw inspiration from two aspects of bee behaviour: foraging and mating.Mostly, the algorithms that mirror the foraging actions of bees (BA, ABC, HBA, BSO, BCO, GBCO) use the roles of worker and scout bees to search for solutions.The solutions are depicted as N-dimensional vectors that represent the position of a bee agent, all striving to locate the best food source, or the global optimum.MBO and BEGA, on the other hand, are inspired by the mating and reproduction of bees.Here, every solution embodies a bee's genotype with the queen bee signifying the best solution, drones indicating trial or random solutions, and worker bees relating to unique heuristic functions.
In general, these bee-inspired algorithms begin by generating initial solutions at random.The process of selection and creation of new solutions continues until the algorithm fulfils a termination condition, usually leading to a solution that is near-optimal.The convergence rate and the degree of accuracy can vary between algorithms, resulting in a broad range of algorithms, each with a distinct level of search efficiency.Achieving a balance between exploration and exploitation, which are critical components of population-based metaheuristics, is vital to prevent premature convergence or stagnation in the search process (Darbandi, 2017).Probabilistic functions largely drive the selection and creation of new solutions, and the main differences between algorithms lie in the specific functions they use (Solgi & Loáiciga, 2021).
Regarding initial parameters, ABC and HBA stand out with only five parameters, the least among the group.BSO uses the most, with eight parameters.BCO, GBCO and MBO have six parameters, while BA and BEGA use seven (these numbers are based on the original versions of the algorithms).To address the complexity of choosing appropriate values for all these parameters, researchers have investigated automatic parameter tuning (Phan et al., 2020).An example is the study by Tan et al. (2021) that used machine learning to tune two of the GBCO parameters on the TSP.In parallel, as reported here for the BA, efforts have been invested in reducing the number of parameters that require tuning.

Core principles of basic BA
As a foraging-inspired algorithm, Basic BA uses scout bees and worker bees to do exploration and exploitation.The algorithm unfolds in four primary phases: Parameter Setting, Initialisation, Local Search, Global Search, and Population Ranking.

Parameters setting
Before running the Basic BA, its initial parameters must be established.These six parameters include: the number of scout bees (n), the number of selected potential patches with high honey resource (m), the number of the highest quality patches deemed as elite patches (e), the number of worker bees on the non-elite selected patches (nsp), the number of worker bees on the elite patches (nep), and the range of neighbourhood search in the solution space (ngh).For the number of patches, e m n h je; m; n h i0 as the n scout bees are representing all visited patches.The relationship between the parameters is as follows: e<m<n, representing the natural progressive selection from all visited patches to the elite ones.Ideally, "n" should be significantly larger than the problem dimension, with a minimum of three scout bees.Similarly, nsp<nep, indicating that more worker bees are assigned to the more potential patches.The range of neighbourhood search parameter should 0<ngh<0:25, as it governs the search radius during the local search.Additionally, it needs to set two initial inputs value, the maximum number of iterations (nIt) and the solution space boundaries (x max ; x min ), which is not impact the algorithm performance.

Initialisation
Basic BA starts by dispatching the scout bees (n) across the field to identify potential patches.These patches are uniformly random distributed (U min; max ½ �) within the predefined solution space, which is set according to the upper (x max ) and lower (x min ) boundaries of the solution space (see Eq.1).The greater the value of "n", the more comprehensive the initial solutions that represented space equally.The positions of all scouts (xscout i ð Þ) are calculated as follows:

Population Ranking-1
After finding the patches, scout bees return to the hive and communicate their discoveries via a "waggle dance".Patches are evaluated based on their quality, with those demonstrating superior fitness values earning a higher ranking.Patches with better fitness values (represented by a scout) attract more worker bees.

Local Search
Scouts with followers (workers) revisit their patches to exploit them further.For the elite patches, "nep" worker bees accompany their scout to extract resources from the associated patch, with "nsp" workers doing the same for non-elite selected patches.All worker bees exploit the area around their scout, using the scout's position as the centre and ngh � ðx max À x min Þ as the search radius (see Eq.2).If a worker discovers a patch with a better fitness value within the neighbourhood of a patch, the scout bee moves to that worker's location.The positions of all workers (xworker i; j ð Þ) are calculated as follows:

Global Search
The remaining scout bees, those without followers, re-exploring the field for more potential patches.These scouts re-initialise a new random solution rather than modifying the current solution.The search procedure mirrors the initialisation phase.If a scout identifies a patch with a superior fitness value within the field (solution space), the scout's location will be updated.

Population Ranking-2
Post search completion, all the bees return to the hive for a comprehensive evaluation of all the patches.This step also employs a greedy ranking approach, where the best fitness value across all scouts is selected as the optimal solution provided by the Basic BA.
It should be noted that in the continuous formulation, the movements or modifications (Eqs. 1 to 3) are applicable to all variables, whereas in the combinatorial version, only a selected subset of variables undergo modification.
This process continues until a stopping condition is met.In summary, Algorithm 1 presents the Basic BA pseudocode in its most simple form.
In the standard BA (continues) version, two more initial parameters are included, which determine the approach for abandoning unproductive sites and reducing the neighbourhood search scope.The shrinking procedure was first introduced by Pham and Ghanbarzadeh (2007), followed by Pham and Darwish (2008).In their 2008 work, the shrinking procedure was employed alongside fuzzy logic control to ascertain the number of worker bees assigned to each patch.This represented the sole attempt at simplifying the initial parameters of the BA during that period.
The standard Bees Algorithm, introduced by Pham and Castellani (2009), builds upon the basic version by incorporating an additional initial parameter, the stagnation limit (stlim), to establish a site abandonment process aimed at enhancing efficiency and effectiveness.It also retains the shrinking procedure proposed by Pham and Ghanbarzadeh (2007).When stlim reaches its 19: End maximum value, worker bees abandon sites that have exhausted their honey resources.These refinements allow the Bees Algorithm to avoid local optima more effectively.
Two years after it was introduced, the Bees Algorithm was used to solve combinatorial problems such as scheduling (Pham et al., 2007) and PCB assembly sequences (Pham et al., 2007).More applications include timetabling, circuit design, gene sequencing, supply chain management, vehicle routing, disassembly planning, and path planning.For combinatorial problems, the Bees Algorithm uses a different search procedure than for continuous problems.Combinatorial problems have special features such as discrete search spaces, limited constraints, ordered solutions, and cost functions (Koc, 2010;Otri, 2011).
The Basic Bees Algorithm for combinatorial optimisation problems (CBA) is similar to the continuous version but with different global and local search procedures.In the combinatorial version, the global search usually employs a constructive heuristic to create the initial solution using random permutation generator, while the local search uses a special random generator instead of moving inside a given radius.This random generator produces a random number and modifies the initial solution by making swapping, reversing, and insertion operations on it.While the continuous version of the algorithm uses "ngh" within the solution space range (ngh � ðx max À x min Þ) for searching movement, the combinatorial version of the Basic Bees Algorithm employs the problem's dimension (ngh � dim).Algorithm 2 presents combinatorial search operator in its most basic form (Ismail et al., 2020).
Figure 1 illustrates a movement within a combinatorial problem.This is because of the inherent difference between continuous and combinatorial domains, which originate from the structure of their respective solution spaces.The search movement in combinatorial optimisation involves integer movements within a discrete space.

Bees algorithm with two parameters (BA 2 )
This section discusses into the fundamental principles of BA 2 , highlighting the key distinctions from the basic BA, while still preserving the core principles of the basic BA and investigate the exploration and exploitation balance in both algorithms.We undertake a visualisation-based analysis utilising "peaks" function for exploration and exploitation balance analysis.

Core principles of BA 2
As a version of BA, it is critical for BA 2 to uphold the algorithm's fundamental principles.BA 2 holds on to the main phases and rules of BA, such as giving more worker bees to good patches for a full search.The main change in BA 2 combines its two types of searching, exploration and exploitation.
It does this by making a new function that tells each worker on a patch to either stay close to the scout or move far away while keeps assigning more worker bees to good patches.
The concept of merging these two search processes is derived from Woodgate et al. ( 2017) assertion that worker bees both exploit and explore a patch.His research, which involved the use of a heat map sensor, revealed that worker bees would explore or exploit a field corresponding to the distribution of resources in that patch.Furthermore, they would extend their exploration when the honey supply within their current patch gets depleted.As depicted in Figure 2, one bee is dedicated to exploitation (Figure 2a), while the other allocates equal efforts to both exploitation and exploration (Figure 2b).
The BA 2 algorithm streamlines the search process by including a particular function and blending the exploration and exploitation procedures.These functions generate the number of worker bees and the radius of the most populated areas for each patch based on their rank.The assigned workers then carry out both exploration and exploitation tasks on each patch.In this basic form of BA 2 , the recruited workers are generated once by processing the information on the quality of a patch defined by its rank relative to other patches.
The number of workers assigned to each patch (w k ) is determined by a linear function based on their rank (k) among the total number of patches (n), as shown in Eq.4.The number of workers for the most promising patch (w k¼1 ) is equal to the total maximum number of employed workers (w max = nep), while the minimum number of workers (w min ) is equal to one (see Eq.5).It is important to note that the number of workers assigned to each patch must be an integer.Additionally, the most likely swarming area for the patch with the highest potential will be near (a k¼1 = 0) the centre of the patch or scout position, while the patch with the lowest potential will have a larger coverage (a k¼n = 1) that tend to explore (see Eqs.6-7).The location of each worker bee will depend on the neighbourhood radius, which is determined by the value of ngh k (see Eq.8).The balance (exploration and exploitation) of BA 2 can be credited to the triangular random number generator (TRNG) (Kotz & Van Dorp, 2004), which controls the locations where the worker bees swarm.In Eqs. 6, 7 and 8, a k refers to the most likely value within the triangular distribution T[0, a k , 1] which ranges between 0 and 1, where 0 corresponds to the smallest coverage or closest proximity to the centre of the flower patch and 1 signifies the largest coverage or distance from the centre.Note that even when a k is set to 0, the value of T [0, 0, 1] will not be exactly 0, but rather a small value close to 0 within the range 0 to 1.
The triangular random number can be obtained from Eq. 9: In Eq. 9, random variable U is sampled from a uniform distribution within the range (0, 1), and The power of the triangular random distribution lies in its ability to accurately represent random conditions when information is limited.By adjusting the most likely value as the swarming area based on the potential rank (a k ), the algorithm can adapt to various random conditions and establish the exploration-exploitation integration search.The minimum and maximum ranges of a k are set to 0 and 1, respectively, allowing each patch to incorporate both exploitation (0<a k <0:5) and exploration (0:5<a k <1) aspects during the search process (ngh k ¼ T 0; a k ; 1 ½ �).As a result, the BA 2 search procedure is as follows: Figure 3 illustrates the role of the triangular distribution in managing the worker bees' swarm around a scout bee.As observable in both diagrams, exploration and exploitation are present, but they exhibit different ratios.For the T[0,0.25,1]distribution, the majority, 80%, of the worker bees are searching in the area near the scout, whereas the opposite scenario applies to T[0,0.75,1].Through this function, BA 2 successfully blends exploration and exploitation across all patches, but the ratio varies depending on the quality or rank of the patches.
) b ( ) a (  Algorithm 3 provides the pseudocode of BA 2 in its simplest form. For combinatorial optimisation, a different concept of neighbourhood is needed.The radius movement of ngh k in BA 2 translates into sequence length or range movement in the twoparameter combinatorial BA (BA 2C ).In the combinatorial version, a short-range subsequence holds a similar significance as a small neighbourhood radius does in the continuous version.The BA 2C uses the same combinatorial operator as the basic BA version, which includes the swap, reverse, and insert procedures (refer to Algorithm 2 for more information).It could be seen from the figures that basic BA separates local and global search using parameters of elite (e), and selected patches (m).The local search in BA takes place on m patches utilising a random number generator with a uniform distribution inside a neighbourhood defined by radius ngh.The search is conducted by nep and nsp workers.The global search in BA occurs over the entire solution space.In contrast, in BA 2 , both the local and global searches perturb the current solutions within a dynamic radius ngh k generated by a triangular random number regulator.The searches are conducted by w 1 ; � � � ; w n workers (w 1 ¼ nep).The global search of BA 2 has a larger radius, ngh k , compared to the local search (ngh k is greater than 0.5).The local and global searches in BA 2 depend on the ranks of the workers following the fitness ranking of all n scouts.Therefore, in BA 2 , the global and local searches operate without requiring parameters e, m, nsp, and ngh.
The Bees Algorithm with two parameters for combinatorial optimisation problems (CBA 2 ) shares similarities with its continuous counterpart (BA 2 ), though the search procedures differ.In the combinatorial version, the search procedure tweaks the current solution by executing swapping, reversing, and insertion operations, as outlined in Algorithm 2.

Comparison of exploitation-exploration balance between BA and BA 2
As we can see in the previous section, in the basic BA, the search method has separate exploitation and exploration phases.Exploitation and exploration are carried out independently at m and n À mlocations.The scouts do not recruit or have no worker at the (n À m) sites, as these sites 4: Determine the number of worker bees for all sites (using Eq.5), nep worker will exploit/explore on the best site and 1 bee on the worst site; or patches are less attractive to exploit.The exploitation process uses a uniform distribution number (within the span of ngh projection) to manipulate honey at potential patches.It is worth emphasising that in the BA, all workers present in the selected sites (m) will use the same neighbourhood (ngh) for exploration, unlike in the BA 2 method, where the neighbourhood (ngh k ) is determined based on the rank of the site.
The basic BA also tends more to exploit rather than explore (Pham & Darwish, 2008) (also can be seen in Figure 5(a-c).This focus on exploitation helps the algorithm look carefully at potential areas and find the best solutions quickly.However, exploration is also important, so the algorithm does not get stuck in local optima solutions and looks at the whole space of solutions.In the basic BA, the remaining scout bees as the main exploration operator use a uniform random number reinitialisation to look at the whole search space well.In this way, scout bees with the lowest rank can visit many different areas, even if they do not bring more bees.The balance between exploitation and exploration is important for the best results because it helps the algorithm search well and focus on the best areas in the space of solutions.These figures support the earlier statement that the basic BA generally intends more towards exploitation than exploration.In contrast, BA 2 achieves a more balanced approach between these two processes.In BA's pattern, there are 20 remaining bees (purple dots) that have no followers to forage the field.These bees are responsible for exploring new areas to find food sources, while the other worker bees exploit the already known food sources.In the next pattern of BA 2 , Figure 5b-d, all worker bees simultaneously explore new areas and exploit known food sources, except for the two scout bees with the lowest potential (purple dots).These two bees will primarily be exploring the area with only one assigned worker.These scouts, labelled k = 39 and k = 40, are considered to have the lowest quality, so they only have one assigned worker bee, with w k¼39 ¼ 1; 48 � 1 and w k¼40 ¼ 1.In this benchmark function, both algorithms, BA and BA 2 , were able to find the highest point for the "peaks" function problem after 200 iterations, despite these two having different exploration-exploitation balances.

BA 2 and CBA 2 implementation for real problems
To evaluate the performance of the proposed BA 2 algorithm, two engineering problems were selected.Engineering problems are often challenging due to their complexity and nonlinearity, which involve multiple variables and constraints that must be satisfied to achieve an optimised solution (Gandomi et al., 2013).
The first engineering problem was the design of an air-cooling system, which is a continuous problem.The second problem was the optimisation of a printed circuit board assembly sequence plan, which is a combinatorial problem.By applying the BA 2 algorithm to these two engineering problems, the effectiveness of the algorithm could be demonstrated and evaluated.As mentioned above, before using BA to solve an optimisation problem, there is a need to set the initial parameters of the algorithm.To compare these two algorithms, BA and BA 2 , a fair scenario must be arranged.
Table 1 provides the initial population size for both algorithms, which in this case the total population is set as 425 bees.The population of the basic BA is computed as follows: (e:nep) + ((m À e).nsp) + (n À m).On the other hand, the population of BA 2 is calculated as the sum of w k for k = 1 to n.

Case study-1: Air-cooling system design (ACSD)
In this continuous problem, the air needs to be cooled from 95 to 10°C between two stages of air compression, and a facility is shown in Figure 6 to perform this cooling.The process involves cooling the air first in a precooler and then in a refrigeration unit.Water is used to cool the air, and it passes through the condenser of the refrigeration unit, then into the precooler, and finally to a cooling tower where it releases heat to the atmosphere.The flow rate and specific heat of both air and water are given, and the water leaves the cooling tower at a temperature of 24°C.
The system is designed for minimum cost, which includes the cost of the refrigeration unit, precooler, and cooling tower, designated as x 1 , x 2 , and x 3 , respectively, in pounds.The cost of the refrigeration unit or the compressor power is designed to be 48q 1 and is expressed as x 1 ¼ 48q 1 , the precooler design has a capacity of 50q 2 from the coil pipe and is expressed as x 2 ¼ 50q 2 t 3 À t 1 , and the cooling tower unit is expressed as x 3 ¼ 25q 3 , where q 1 ; q 2 ; q 3 is the cooling capacity of the units.The compression power P kW required by the refrigeration unit in 0:25q 1 , and both q 1 and the compression power must be absorbed by the condenser cooling water passing through the refrigeration unit.The complete set of constraint equations is:  The set of Eqs.13-21 includes nine equations, and there are ten variables, namely, q 1 , q 2 , q 3 , P, x 1 , x 2 , x 3 , t 1 , t 2 , and t 3 .The objective, Eq.22, is to eliminate all variables and equations except for the three optimisation variables, x 1 , x 2 , and x 3 .As the elimination process proceeds, the number of unknowns will always be one more than the number of equations.Therefore, when all variables except the three x's are eliminated, there should be two constraints remaining, which are Egs.23-24.These two equations represent the constraints of the optimisation problem.Thus, the complete mathematical statement of this optimisation problem is as follows: Table 2 was employed to record and compare the solutions obtained by BA, BA 2 , and exact method (Gurobipy).The table includes the best obtained, average, worst, standard deviation from 30 independent running experiments, and their (BA and BA 2 ) convergence graphics.The results indicated that the solution found by BA 2 was comparable to the best solution found by the basic BA algorithm; although it may be slightly better, the difference was not statistically significant when comparing the average values of the experiments (see Figure 7).
Experiments were also conducted using an exact optimisation method using the Gurobipy software (f 1 x ð Þ = 4683.8251)and the results were very close to those obtained by BA and BA 2 .This finding suggests that BA 2 can be as effective, or even more effective, than its predecessor in solving continuous optimisation problems even though utilising fewer initial parameter settings.

Case study-2: PCB assembly sequence optimisation (PASO) problem
In addressing this combinatorial problem utilising CBA (Ismail et al., 2020) and CBA 2 , we seek to optimise the assembly sequence of a printed circuit board (PCB) by determining the best sequence for placing 50 components on the board, with the aim to minimise assembly time.The optimisation of the PCB assembly  Figure 8 (a) provides a general representation of a PCB assembly machine, which is made up of three components: a feeder F1 (or an array of feeders F2) that supplies the necessary components, an assembly head H that picks up the components from F1 or F2 and places them onto the PCB, and a table T that carries the PCB.Figures 8 (b) and 8 (c) illustrate the location and coordinates of the components that are being placed onto the PCB.In a type-1 machine, a single feeder F1 supplies components to a single assembly head H (without a turret) at a fixed location in the horizontal X-Y plane.Head H also deposits components onto the PCB at a fixed point in the X-Y plane.Table T moves in the X-Y plane to position  components at the desired locations on the PCB.This type of assembly machine is the simplest and is typically employed when only one type of component needs to be placed.
Process optimisation for an assembly machine typically involves a component sequencing problem.The objective of component placement sequencing is to optimise the movements of the table.This problem can be viewed as a symmetrical TSP, for which the objective function (Pham et al., 2007) can be expressed as: where Nis the total number of components to be placed onto a board (PCB), and Þrepresents the distance travelled by the table or the assembly head when moving from the placement position for component Þ is usually considered to be the same as that for C 1 ð Þ, the starting position, since C N ð Þ is the last component to be placed onto a given PCB.)As the cycle time is the critical factor of interest in this problem, the objective function is typically rewritten as: where v is the average speed of movement of the table or assembly head (60 mm/s).
Table 3 presents the results' comparison between two algorithms, namely, CBA and CBA 2 , used for optimising the PASO problem.The results showed that CBA 2 outperformed the basic CBA, with a difference of one second between their best and average values.Moreover, the CBA 2 algorithm provided significantly better results compared to previous research on CBA for this PASO problem, reducing assembly time by more than five seconds (from 24.08 seconds to 18.5677) compared to the best solution found previously (Pham et al., 2007).The study assessed the robustness of the CBA 2 algorithm by running the optimisation program independently 30 times, and the results showed that the algorithm had better accuracy and convergence performance compared to the CBA.Specifically, the CBA 2 algorithm achieved convergence of under 1,200 mm (total distance) or 20 seconds of assembly time at the ± 1000 th iteration, while the CBA took until the ± 1800 th iteration to achieve convergence in under 20 seconds of assembly time (see Figure 9).
It is important to mention that the CBA algorithm also exhibited improved performance in this study compared to CBA in previous research (Pham et al., 2007).The superior solution obtained by the current CBA algorithm can be attributed to the application of the combinatorial neighbour search operator, which utilises a combination of reversion, swap, and insertion (Ismail et al., 2020).In contrast, previous research has only employed reversion or 2-opt moves.

Discussion
BA 2 shares the strengths of BA without its main limitation associated with the large number of parameters that need to be set by the user.There have been many studies of the types of problems for which BA is most suitable.As BA 2 is based on the same core principles as BA, BA 2 is by design able to handle the same kinds of problems.
From the results presented, it could be seen that the performance of BA 2 is similar to that of BA on the ACSD problem (case study 1) which has relatively few variables.It is recalled that the local search operator in BA 2 does not select which solution variables to modify.Although this could quickly yield reasonably accurate results for problems of small dimensions like ACSD, this approach could give poor accuracy for higher dimensions.In contrast, CBA 2 is selective about the variables that it modifies.This makes CBA 2 more suitable for handling high-dimensional problems and is why it shows a marked increase in accuracy compared to CBA in the PASO problem (case study 2).
There are some potential limitations in this work that should be considered.One possible limitation is the generalisability of the results.The experimental outcomes discussed in the previous section are specific to two distinct optimisation problems, with the problem dimension being relatively small.Hence, we recommend extending the investigation to a broader range of applications and exploring (C)BA 2 's scalability in managing large-scale optimisation problems.
A third potential limitation is the selection of parameter settings utilised in the experiments.We employed specific parameter settings for (C)BA 2 , acknowledging that different settings may lead to different results.Therefore, the results may not be generalisable to other parameter settings.However, our work so far has revealed that the algorithm is relatively insensitive to n and nep and, in any case, it is much simpler to decide the values of those two parameters than having to set the seven parameters of the original BA.Nevertheless, in future investigations, it would be valuable to conduct parameter settings analyses to understand the impact of n and nep on the algorithm's performance.
Lastly, in this paper we have focused on comparing BA 2 and its predecessor BA to demonstrate that the new algorithm is just as effective despite having a much reduced number of parameters.We have not yet evaluated the performance of BA 2 against that of other state-of-the-art optimisation algorithms, which could be the subject of future investigations.

Conclusion
In conclusion, this paper introduces new variants of the Bees Algorithm (BA) called BA 2 and CBA 2 , which integrate exploration and exploitation strategies to efficiently solve complex optimisation problems.The introduced algorithms are tested on two engineering problems, namely the air-cooling system design (ACSD) and the printed circuit board assembly sequence optimisation (PASO) and compared with previous versions of the basic BA and CBA.The results demonstrate that BA 2 and CBA 2 outperform their predecessors in terms of convergence speed and solution accuracy.
This study reveals a significant benefit of BA 2, a superior balance between exploration and exploitation, reflecting its capacity to distribute bees evenly across the solution space.This marks a substantial improvement over its predecessor.This attribute of BA 2 allows it to investigate the solution space more thoroughly and efficiently, thereby increasing the likelihood of identifying the global optimum solution and avoiding local optima traps.
The codes for BA, CBA, BA 2 , and CBA 2 are available in Appendix 1 and 2, or they can be accessed on the website www.github.com/asrulharunismail.Further research is needed to test the scalability and generalisability of the algorithm to more diverse optimisation problems.Additionally, future studies should also develop a local search operator with variable selection to improve accuracy and convergence quality for larger dimension problems.
where a denotes the minimum possible value of t ∈ T [a, b, c], b represents the most likely value, and c indicates the maximum possible value.

Figure
Figure 3. Triangular random number generator of swarming point.

Figure
Figure 4. Functions comparison of initial parameters and its procedures of (a) BA and (b) BA 2 .

Figure 4
Figure 4 presents comparison of functions inside each phase between BA and BA 2 based on their simple initial parameters setting scenario.The parameters for BA are set as n = 3, e = 1, m = 2, nep = 20, nsp = 10, ngh = 0.1 while for BA 2 with n = 3, nep = 20.
n initial sites/solutions from the nscout bees (using Eq.1); 3: Evaluate the fitness of the ninitial solutions;

Figure 5 .
Figure 5.The search patterns of BA and BA 2 in the "peaks" function.
process (a type-1 machine problem) resembles to the well-known travelling salesman problems (TSPs).TSPs are essential examples of combinatorial optimisation problems and are classified within the complexity class of NP-complete.

Figure
Figure 8. PCB assembly sequence optimisation (a) the machine (b) the component location (c) the coordinates (Pham et al., 2007).

Figure 7 .
Figure 7.Comparison of convergence (average) for BA 2 and BA in ACSD.

Figure 9 .
Figure 9.Comparison of convergence (average) for CBA 2 and CBA in PASO.

Algorithm 1: Basic Bees Algorithm (Ismail, 2021)
1: Start2: Set the parametersof n,e,m,nep,nsp,ngh,nIt;3: Generate n initial sites/solutions from the n scout bees (using Eq.1); 4: Evaluate the fitness of the ninitial solutions; 5: Select m sites/solutions with the best fitness scores for neighbourhood search;6:while iteration < nIt do 7: for each site i (i = 1, ..., e)8:Exploit inside radii ngh of the site iby nepworker bees (using Eq.3), and replace the site i, if a new site is found with better fitness scores within the nghof site i;9: end for 10: for each site j (j = e+1, ..., m)11:Exploit inside radii ngh of the site jby nspworker bees (using Eq.3), and replace the site jif a new site is found with the better fitness scores within the ngh of site j;12: end for 13: for each site k (k = m+1, ..., n)14:Assign remaining (n À m) scout bees to search randomly the new sites/solutions and evaluate their 18: Report the site with the best fitness score from all sites; Exploit and explore the area inside radii ngh k of a site by the worker bees (Eq.11), and replace the scout if a worker is found with the better fitness scores within the ngh k ; mathworks.com/help/matlab/ref/peaks.html].