Two-Swim Operators in the Modified Bacterial Foraging Algorithm for the Optimal Synthesis of Four-Bar Mechanisms

This paper presents two-swim operators to be added to the chemotaxis process of the modified bacterial foraging optimization algorithm to solve three instances of the synthesis of four-bar planar mechanisms. One swim favors exploration while the second one promotes fine movements in the neighborhood of each bacterium. The combined effect of the new operators looks to increase the production of better solutions during the search. As a consequence, the ability of the algorithm to escape from local optimum solutions is enhanced. The algorithm is tested through four experiments and its results are compared against two BFOA-based algorithms and also against a differential evolution algorithm designed for mechanical design problems. The overall results indicate that the proposed algorithm outperforms other BFOA-based approaches and finds highly competitive mechanisms, with a single set of parameter values and with less evaluations in the first synthesis problem, with respect to those mechanisms obtained by the differential evolution algorithm, which needed a parameter fine-tuning process for each optimization problem.


Introduction
Nature-inspired algorithms (NIAs) have been successfully used to solve Constrained Numerical Optimization Problems (CNOPs) using constraint-handling techniques [1] given that, originally, these algorithms were designed to deal solely with unconstrained search spaces. NIAs can be comprised of two groups: (1) Evolutionary Algorithms (EAs) [2] based on emulating the process of natural evolution and survival of the fittest and (2) Swarm Intelligence Algorithms (SIAs) [3] based on cooperative behaviors of simple organisms such as insects, birds, fish, or bacteria. EAs are one of the most used metaheuristics. However, SIAs have been gaining popularity among researchers and practitioners, mainly with the Particle Swarm Optimization (PSO) [4] and the Ant Colony Optimization (ACO) [5] algorithms.
where ⃗ = [ 1 , 2 , . . . , ] ∈ is the solution vector and each decision variable , = 1, . . . , is bounded by lower and upper limits ≤ ≤ , which define the search space ; is the number of inequality constraints and is the number of equality constraints (in both cases, the constraints can be linear or nonlinear). If denotes the feasible region, then it must be clear that ⊆ . As it is commonly found in the specialized literature of nature-inspired algorithms to solve CNOPs [1, 6, 7] equality constraints are transformed 2 Computational Intelligence and Neuroscience into inequality constraints by using a small tolerance > 0 as follows: |ℎ ( ⃗ )| − ≤ 0, = 1, . . . , .
In the context of mechanical engineering, synthesis is the design process of mechanical systems [8]. Four-bar mechanisms are widely used in machinery design, since they are the simplest articulated mechanisms for controlled movement with one degree of freedom. The synthesis of these mechanisms is a well-known CNOP, and originally two classical approaches were used for this synthesis: graphical and analytical methods. However, implementing such solutions is a complicated issue and their results are quite limited; for this reason, the design of these mechanisms is a case of hard numerical optimization. There are several types of syntheses; this work addresses the dimensional design of a mechanism, that is, to calculate the length of the necessary links for generating a specific movement [9].
The synthesis of four-bar mechanisms has been carried out with different nature-inspired metaheuristics. In [10] a modified Genetic Algorithm (GA) with a penalty function as constraint-handler was proposed. differential evolution (DE) and a variable control method for deviations were applied in [11]. In [12] the synthesis of a mechanism for tracking a trajectory of points, based on Simulated Annealing (SA), was developed. Regarding this same tracking problem, a performance comparison among three different metaheuristics, GA, DE, and PSO, was presented in [13], while the Artificial Bee Colony (ABC), PSO, a binary GA (BGA), and a hybrid GA-PSO approach were used in [14]. Finally, in [15] the synthesis of a planar four-bar mechanism for position control using the Harmony Search (HS) algorithm was carried out. From the abovementioned literature review, the diversity of nature-inspired algorithms to solve the synthesis of four-bar mechanisms is noticeable.
On the other hand, there are algorithms whose usage in this type of optimization problems has been less explored, as it is the case of the Bacterial Foraging Optimization Algorithm (BFOA), which is a SIA proposed by Passino in 2002 to solve unconstrained numerical optimization problems [16]. BFOA emulates the behavior of bacterium E. coli in the search of nutrients in its environment. The goal of each bacterium is to maximize the energy it obtains per each unit of time spent on the foraging process while avoiding noxious substances. BFOA is considered a SIA because bacteria can communicate among them. Such behavior can be summarized in four processes: (1) chemotaxis (swim and tumble movements are performed), (2) swarming (bacteria can communicate with each other to direct their search for nutrients), (3) reproduction (the best bacteria are duplicated and these replaced other bacteria), and (4) elimination-dispersal (the worst bacteria are eliminated and new bacteria are randomly dispersed).
Regarding unconstrained optimization, BFOA has been combined with other algorithms, particularly with EAs, to improve its performance, for example, with a GA in [17][18][19] and DE in [20]. Mutation operators have been added to BFOA in [21]. Moreover, hybrids with other SIAs [22], and particularly with PSO, are found in the specialized literature [23,24]. Furthermore, BFOA was also combined with artificial immune system's clonal selection and fuzzy logic within its chemotaxis process in [25].
When dealing with constrained search spaces there are different approaches [26]; for example, in [27], BFOA was adapted to solve CNOPs in a proposal called Modified-BFOA (MBFOA) which used a set of feasibility rules [28] as constraint-handler. Moreover, MBFOA was simplified and improved in its step size handling in the swim operator in [29]. Further modifications were proposed in [30,31] to solve multiobjective CNOPs, where some four-bar mechanisms were tackled. More recently, MBFOA was further improved to solve CNOPs in the so-called Improved MBFOA (IMBFOA for short) [32] where the idea of two-swim movements within the chemotaxis process was initially explored. However, IMB-FOA heavily depends on a local search based on sequential quadratic programming. IMBFOA is the starting point of this research, focused on the optimal synthesis of four-bar mechanisms. Finally, BFOA has been combined with two NIAs BFOA-DE-PSO in [33,34], and the idea of using micropopulations was explored in [35].
From the above literature review, it was found that NIAs are a valid option to solve four-bar mechanisms. However, the usage of BFOA-based approaches is still scarce. Furthermore, the incorporation of additional variation operators in those BFOA-based approaches is more frequent in unconstrained optimization. The abovementioned is the main motivation of this work, where two improved swims (and different from those in IMBFOA) are proposed to enhance the capabilities of MBFOA to deal with four-bar mechanisms optimization. Furthermore, such two-swim mechanism performance allows eliminating the second-order local search operator. Therefore, the contribution of this work consists in getting knowledge about the type of operators which provide better results in those constrained search spaces defined by the fourbar mechanisms tackled in this research.
The proposed approach is compared against those BFOAbased approaches for constrained optimization (IMBFOA and MBFOA) and also against a DE-based approach designed to solve mechanical design problems. To the best of the authors' knowledge, this is the first time that the variation operators of a BFOA-based approach are studied in such a way that they improve the capabilities of the algorithm to solve a set of four-bar synthesis problems.
The document is organized as follows: in Section 2 the general synthesis of a four-bar mechanism is explained, including the kinematics of the mechanism and its coupler, as well as the specifications of the three case studies to solve. In Section 3, brief descriptions of MBFOA and IMBFOA are presented and the new proposal "Two-Swim MBFOA" (TS-MBFOA) is introduced. Section 4 shows the results obtained by TS-MBFOA and their comparison against those obtained by other NIAs. Finally, Section 5 presents the conclusions and future work of this research. Figure 1 shows a planar four-bar mechanism formed by a reference bar 1 , an input bar 2 (crank), a coupler 3 , and an output bar 4 (rocker). In order to analyze this mechanism two coordinate systems are established: a system that is fixed to the real world ( ) and another for self-reference Computational Intelligence and Neuroscience ( ). ( 0 , 0 ) is the distance between the origin points of both systems, 0 is the rotation angle of the reference system, and ( = 2, 3, 4) corresponds to the angle for every bar in the mechanism; finally, the coordinate pair ( , ) determines the position of the coupler.

Kinematics of the Mechanism.
The kinematics of fourbar mechanisms have been extensively treated; a detailed explanation is found in [36,37]. For analyzing the mechanism position, the closed loop equation can be established as follows: (2) Applying polar notation to each term of (2), Using the equation of Euler on (3) and separating the real and imaginary parts, 1 cos 1 + 4 cos 4 = 2 cos 2 + 3 cos 3 , Expressing the equation system (4) in terms of 4 , 4 cos 4 = 2 cos 2 + 3 cos 3 − 1 cos 1 , The compact form of Freudenstein's equation is obtained by squaring system (5) and adding its terms as follows: where 1 = 2 3 ( 2 cos 2 − 1 cos 1 ) , Open Then the angle 3 can be calculated as a function of the parameters 1 , 1 , 1 , and 2 ; this solution is generated by expressing sin 3 and cos 3 in terms of tan( 3 /2): , A second-order lineal equation is obtained by substitution on (6): From the solution of (9), the angular position 3 is given by (10): A similar process is carried out to get 4 from (4) using Freudenstein's equation. The correct sign for the radical must be selected in the equations for 3 and 4 , according to the configuration of the mechanism. Table 1 indicates the signs related with both configurations.

Kinematics of the Coupler.
Since the point of interest in the coupler is , to determine its position in the reference system it has to be established that In the global coordinate system, this point is expressed as Equations (11) and (12) and the expressions from the kinematics of the mechanism are sufficient to calculate the position of along the trajectory.

Design Constraints.
One of the most important aspects involved in a mechanism design is to accomplish the constraints on its performance, which are related to mobility criteria and the size and shape of the mechanism itself.

4
Computational Intelligence and Neuroscience

Grashof 's Law.
Grashof 's law is a fundamental consideration when designing a four-bar mechanism, since it defines the criteria to ensure complete mobility for at least one link of that mechanism. This law establishes that for a planar four-bar linkage, the sum of the shortest and the largest bars cannot be larger than the sum of the remaining bars, if a continual relative rotation between two elements is desired [8].
If is the length of the shortest link, represents the largest bar, and , indicate the remaining elements, it is established that In this work, Grashof 's law is given by Therefore, to ensure that the solution method fulfills this law, the following constraints were established:

Sequence of Input Angles.
Since the general problem of synthesis addressed in this work is the generation of trajectories based on sequences of successive precision points representing different positions of the coupler, the values of the crank angles have to be ordered in correspondence with these sequences. If the angle for a specific point is denoted as 2 , it is required that where is the number of precision points.

Optimization Strategies.
After properly establishing the kinematics of the mechanism, the design problem can be defined as a numerical optimization case, and then it is necessary to specify the appropriate mathematical expressions for evaluating the performance of the system.

Objective Function.
This work addresses the synthesis of a planar mechanism in order to calculate the length of its bars, the rotation angle in respect to the reference system, the distance between the coordinate systems, and the set of angles for the input bar to generate a trajectory corresponding to a sequence of precision points. In the global coordinate system , the point of the precision pair is indicated as The set of pairs of precision points is defined as Then, given a set of values of the mechanism bars and their parameters 0 , 0 , 0 , each point of the coupler can be expressed as a function of the input bar position: Accordingly, it is desired to minimize the distance (error) between the precision point and the calculated point . To quantify the overall error the following function is proposed:

Case Studies
(1) 01. It is the design of a four-bar mechanism that follows a linear vertical path defined by a sequence of six precision points, without a previously established synchronization. The set of precision points is defined as (20,20) , (20,25) , (20,30) , (20,35) , (20,40) , The vector of design variables is where The first four variables correspond to the lengths of the bars in the mechanism presented in Figure 1, the following two are the position of the coupler, 0 is the orientation angle of the system with respect to the horizontal, 2 = ( 0 , 0 ) is its coordinate position, and the last six are the angle values for the input bar 2 . The boundaries for each design variable are defined as The single-objective numerical optimization problem for this case is described by the following: Computational Intelligence and Neuroscience (2) 02. It is the design of a four-bar mechanism that follows a trajectory defined by a sequence of five unaligned precision points, with a previously established synchronization for each point. The set of precision points is defined as For this case it is considered that 0 , 0 , 0 = 0. The restriction given by (16) is not considered since the sequence of input angles is set by The vector of design variables is where The upper and lower values for the design variables are defined as The objective function is defined by the following: subject to: (3) 03. It is the design of a four-bar mechanism for tracking a trajectory delimited by pairs of precision points. This case considers a sequence with ten pairs of precision points given by the coordinates shown in Table 2.
The vector of design is where and its variables are limited by Because in this case the trajectory is defined by pairs of precision points, the objective function in (20) is modified in order to consider the error with respect to each point. Therefore, the new function is given by the following: subject to: Computational Intelligence and Neuroscience Finally, it is important to note that the complexity of the study cases presented in the paper is high, due to two aspects. (1) A large number of precision points that must touch the mechanism: in the state of the art of synthesis mechanisms, cases with four precision points maximum are solved using graphic methods or MPM's. (2) Values of design variables 2 with = 1, . . . , 6 for case 01 and = 1, . . . , 10 for case 02: these must have an ascending or descending order, which implies a strong constraint for finding solution vectors to ensure a proper mechanism functioning. Additionally, cases 01 and 02 have not previously undergone a synchronization on the mechanism input bar.

Two-Swim Modified Bacterial Foraging Optimization Algorithm (TS-MBFOA)
TS-MBFOA is inspired by the ideas of IMBFOA, a recently proposed BFOA-based algorithm to solve CNOPs by using two-swim operators, a skew mechanism for the initial swarm of bacteria, a second-order local search operator, and a limited usage of the reproduction step [32]. To get a selfcontained paper, in the next subsections, MBFOA, IMBFOA's base algorithm, is presented. After that, IMBFOA is detailed. Finally, TS-MBFOA is introduced.

Modified Bacterial Foraging Optimization Algorithm (MBFOA).
MBFOA is based on the original BFOA [16], but it was proposed to solve CNOPs. Each one of its elements is detailed as follows.
(i) A bacterium represents a potential solution to the CNOP (i.e., a -dimensional real-value vector identified as ⃗ in Section 1), and it is denoted as ( , ), where is its chemotaxis loop index and is a generational (cycle) loop index. Within a cycle, three inner processes are carried out: chemotaxis, reproduction, and elimination-dispersal. Swarming process is added to the chemotaxis process.
(ii) Chemotaxis. In this process, each bacterium in the current swarm performs a tumble-swim movement. The tumble, as proposed by Passino [16], consists of a search direction ( ) generated at random with uniform distribution as presented in the following: where Δ( ) is a -dimensional real-value vector generated at random with uniform distribution where each one of its elements has values between [−1, 1].
The swim allows the bacterium ( , ) to follow the search direction and move to a new position ( + 1, ). The swim is computed as indicated in the following: where ( ) is the step size vector and its values are calculated by considering the limits of each design variable , defined by the expression in the following: where Δ is the difference between the upper and lower limits of each variable : − , is the number of variables, and ∈ [0, 1] is a user-defined parameter that scales the step size value of bacteria. This vector remains fixed during the search process. MBFOA, like other BFOA-based algorithms as shown in [26], is particularly sensitive to this parameter and such behavior has motivated further studies as that in [29].
If the new position, ( + 1, ), is better with respect to the previous position ( , ) [28] (i.e., (1) both positions are feasible, but the new position has a better objective function value, (2) the new position is feasible while the previous one is not, or (3) both positions are infeasible, but the new position has a lower sum of constraint violation), another swim in the same direction will be carried out by taking this better solution as the new starting position. Otherwise, a new tumble is computed. The process stops after attempts (parameter defined by the user).
(iii) Swarming. MBFOA includes an attractor movement within the chemotaxis process, which lets each bacterium in the swarm follow the bacterium located in the most promising region of the search space, that is, either the feasible bacterium with the best objective function value or the bacterium with the lowest sum of constraint violation if no feasible bacteria are found in the current swarm. Such information is given by the three feasibility rules used in the chemotaxis process. The movement is detailed in the following: where ( + 1, ) is the new position of bacterium , ( , ) is the current position of bacterium , ( ) is the current position of the best bacterium in the swarm so far at cycle , and (user-defined parameter) defines the closeness of the new position of bacterium with respect to the position of the best Computational Intelligence and Neuroscience 7 bacterium ( ). The attractor movement is applied once within the chemotaxis loop. In the remaining steps, the tumble-swim movement is used. Both the tumble-swim and swarming movements can generate variable values outside their limits. Therefore, a simple repair mechanism is used as in [38], where the violated value is multiplied by 2 and the violated limit is subtracted (i.e., valid = 2 * violated limit − invalid ). (iv) Reproduction. The swarm is sorted based on the same three rules adopted in the chemotaxis process and the first are cloned (these bacteria are considered as the best ones), and the remaining − (the worst bacteria) are eliminated ( is the swarm size).
(v) Elimination-Dispersal. This process eliminates only the worst bacterium ( , ) based on the already mentioned feasibility rules, and a new randomly generated bacterium is inserted as a replacement.
In Algorithm 1 the corresponding MBFOA pseudocode is presented, and its user-defined parameters are summarized in the caption.

Improved MBFOA (IMBFOA).
IMBFOA was designed to improve MBFOA in its performance to solve CNOPs. Four changes were promoted: (1) two-swim movements within the chemotaxis process, one for exploration and another one for exploitation, (2) a skew mechanism for the initial swarm of bacteria, (3) a local search operator based on sequential quadratic programming, and (4) a reduction on the usage of the reproduction process. Below is the description of each change.
The first swim, focused on exploration, is computed as indicated in the following: where ( ) is computed as in (38), but now considering the updated range and not using the step size vector. The second swim, focused on exploitation, is computed as indicated in the following: where ( , ) is a dynamic step size vector [29]. However, each value of vector ( , ) decreases dynamically at each cycle of the algorithm as indicated in the following: where ( , +1) is the new step size value for variable , while and MAX are the current and maximum number of cycles of the algorithm, respectively. The initial ( , 0) is computed as indicated in (40), but the parameter is no longer used.
The first swim is applied until no improvement is obtained, and then the second swim takes place and so on. The process stops, as in the chemotaxis process in MBFOA, after attempts.
(ii) Skew Mechanism for the Initial Swarm. The initial swarm of bacteria is generated by considering three groups. In the first group there are randomly generated bacteria but with their location skewed to the lower limit of the decision variables . In the second group there are randomly generated bacteria but with their location skewed to the upper limit of the decision variables . Finally, a third group of randomly generated bacteria are created as in the original MBFOA (i.e., without any skew). The three groups use random values with uniform distribution. The details to set the limits per variable for the first and second group are presented in the following: where ss is the skew size. A high value decreases the skew effect, while a low value increases it.
(iii) Local Search Operator. Sequential Quadratic Programming (SQP) [39] is the local search operator in IMBFOA. This search is applied to the best bacterium in the swarm after the chemotaxis, swarming, reproduction, and elimination-dispersal processes. The user can define the local search operator usage frequency with the LS parameter.
(iv) Scarce Usage of the Reproduction Step. To reduce premature convergence due to bacteria duplication, the reproduction takes place only at certain cycles of the algorithm, defined by the RepCycle parameter.
Algorithm 2 includes the IMBFOA pseudocode and its parameters are in the caption.

Two-Swim MBFOA (TS-MBFOA)
. TS-MBFOA revisits the two swims originally proposed in IMBFOA to enhance its search capabilities and to simplify them as well. In this way, two new swims to be applied within the chemotaxis process are proposed in this work. The first one of them aims to complement the swarming operator by letting a bacterium to explore other areas of the search space with the guide of randomly chosen bacteria. The second swim focuses on slight movements of the bacterium in its vicinity by using the original swim proposed by Passino [16], but with very small step size values.
The details of each one of the two proposed swims are presented below.
(1) Create an initial swarm of bacteria by using the skew mechanism ( , 0) ∀ , = 1, . . . , Evaluate ( , 0) ∀ , = 1, . . . , (3) for = 1 to MAX do (4) for = 1 to do (5) for = 1 to do (6) P e r f o r m t h e chemotaxis process by using the two swims in (42) and (43) and the attractor operator in (41) for bacteria ( , ) by considering the three feasibility rules as selection criteria (7) end (8) end (9) if ( mod RepCycle == 0) then (10) P erformthereproduction process by sorting all bacteria in the swarm based on the feasibility rules, duplicating the best bacteria and eliminating the remaining − (11) end (12) Performtheelimination-dispersal process by eliminating the worst bacterium ( , ) in the current swarm (13) Update the step size vector with (44) (14) if ( mod LS == 0) then (15) Apply the local search operator (i.e., SQP) to the best bacterium in the swarm. If the obtained bacterium is better than the original best bacterium, it takes its place in the swarm. (16) end (17) end Algorithm 2: IMBFOA pseudocode. Input parameters are number of bacteria , chemotaxis loop limit , number of bacteria for reproduction , scaling factor , the reproduction cycle RepCycle, the number of cycles MAX, the local search frequency LS , and for the search direction, and ss for the skew mechanism.
(1) Exploration Swim. The first swim is computed as indicated in the following: where is the user-defined parameter utilized in MBFOA's swarming operator and its value is now greater than 1. 1 ( , ) and 2 ( , ) are two bacteria randomly selected from the swarm ( ̸ = 1 ̸ = 2 ). This swim operator uses the position of such two bacteria to determine a search direction considering the current position of the bacterium ready to swim ( , ) as the starting point. Figure 2 shows the behavior of this swim operator using a space of two decision variables, each one into a range of [−5, 5]. In this example, the new position of the bacterium after the swim will fall in the purple spot defined by bact1 and bact2, which are 1 ( , ) and 2 ( , ), respectively. The best bacterium is included so as to remark that this operator aims to find different regions of the search space (i.e., not those on the neighborhood of the best current solution as the swarming movement promotes).
(2) Exploitation Swim. The second swim returns to be original swim based on random search directions but is now coupled with small random step size values to precisely favor fine movements, as indicated in the following: where the step size values comprise a -dimensional random vector called again ( , ) [29], calculated at each generation as shown in the following: ( , ) = * Δ ( ) , = 1, . . . , , where Δ ( ) is a randomly generated value with uniform distribution within [ , ] of decision variable . is a userdefined parameter to scale the step size, and its value should be close to zero, for example, 5.00 − 03. At the first cycle, the step size is calculated using just Δ ( ) to allow bacteria in the initial swarm to move in different directions within the search space while avoiding attractors at the start of the process, as suggested in [40]. Figure 3 shows the swim behavior, where the bacterium represented as a green triangle will move by using a random search direction but close to its current position, regardless of the positions of other bacteria in the swarm.
Algorithm 3 presents TS-MBFOA pseudocode, and its parameters are detailed in the caption.
The combined expected effect of both proposed swims with the swarming operator, all three inside the chemotaxis process, is an enhanced ability to avoid local optimum solutions and a promotion of a faster convergence. Such effect is possible because of the fact that TS-MBFOA has a swim for exploration (first proposed swim), a swim to favor convergence (swarming operator from MBFOA), and a fine-swim to further improve good quality solutions (second proposed swim). Finally, it is important to remark that the local search based on SQP is not used in TS-MBFOA. Therefore, secondorder information is not required as it was the case with IMBFOA.

Results and Analysis
TS-MBFOA was used to solve the three four-bar synthesis design problems stated in Section 2. A summary of their main features is presented in Table 3. Four experiments were designed to (1) assess the effectiveness of the proposed swims compared with the swims in IMBFOA and MBFOA, (2) compare the final results of TS-MBFOA against those of IMBFOA and MBFOA, (3) compare the final results of TS-MBFOA now against those obtained by a DE-based approach to solve mechanical engineering problems [41], and (4) simulate the best four-bar systems obtained by each one of the three algorithms in each one of the optimization problems to analyze their behavior from a mechanical point of view. The Wilcoxon Signed-Rank Test (WSRT) [42] was used to validate the differences observed in the samples of 30 independent runs computed per algorithm per test problem in the experiments. TS-MBFOA was coded in MATLAB R2009b and executed on a PC with a 3.5 Core 2 Duo Processor, 4 GB of RAM, and 64-bit Windows 7 operating system.

Performance Measures.
To evaluate the behavior of the compared algorithms, the following performance measures for nature-inspired constrained optimization, taken from [43], were computed: (iv) Successful swim rate = (number of successful swims)/ total swims, where total swims = × × MAX.

Parameter
Setting. The parameter setting for natureinspired algorithms is an open problem [44]. Therefore, to get suitable parameter values for the proposed algorithm, (1) Create an initial swarm of bacteria by using the skew mechanism ( , 0) ∀ , = 1, . . . , (2) Evaluate ( , 0) ∀ , = 1, . . . , (3) for = 1 to MAX do (4) for = 1 to do (5) for = 1 to do (6) P e r f o r m t h e chemotaxis process by using the two swims in (46) and (47) and the attractor operator in (41) for bacteria ( , ) by considering the three feasibility rules as selection criteria (7) end (8) end (9) if ( mod RepCycle == 0) then (10) Perform the reproduction process by sorting all bacteria in the swarm based on the feasibility rules, duplicating the best bacteria and eliminating the remaining − (11) end (12) Perform the elimination-dispersal process by eliminating the worst bacterium ( , ) in the current swarm (13) Calculated the step size vector with (48) (14) end Algorithm 3: TS-MBFOA pseudocode. Input parameters are number of bacteria , chemotaxis loop limit , scaling stepsize , number of bacteria for reproduction , scaling factor , the reproduction cycle RepCycle, ss for the skew mechanism, and the number of cycles MAX. a tuning process was carried out by the iRace tool [45]. iRace implements the iterated racing procedure for automatic algorithm configuration. Iterated racing is a generalization of the iterated F-race and consists of three phases: (1) sampling new parameter configurations with a particular distribution, (2) choosing the most competitive configurations by means of racing, and (3) updating the sampling distribution to favor better configurations. For details about iRace the reader is referred to [45]. The user-defined parameter of TS-MBFOA is shown in Table 4. The parameter values for MBFOA and IMBFOA were taken from [29] and [32], respectively.
The set of parameters for TS-MBFOA in Table 4  This suggests that TS-MBFOA is not very sensitive to those parameters. From those four parameters, has been reported as very sensitive in previous MBFOA versions [29]. However, TS-MBFOA shows less sensitivity to its value. On the other hand, the parameters with similar values in the sets are , RepCycle, and ss. This suggests that TS-MBFOA requires a more careful tuning of the swarm size, the reproduction frequency, and the initial skew in the population. However, the tuning process could deal with such sensitivity. late in the search. On the other hand, the number of successful swims in MBFOA showed a decreasing tendency in the three synthesis problems. Finally, the number of successful swims in IMBFOA was the lowest in the three problems but showed some improvement at the end of the search, but it did not outperform those successful swims by TS-MBFOA. To provide further evidence to the above finding, the successful swim rates in problem 01 were 3.68% by MBFOA, 2.16% by IMBFOA, and 7.26% by TS-MBFOA. In problem 02 the successful swim rates were 2.31%, 3.76%, and 4.36%, by MBFOA, IMBFOA, and TS-MBFOA, respectively. Finally, in problem 03, the rates were 2.14%, 3.76% and 6.53% by MBFOA, IMBFOA, and TS-MBFOA, respectively. As a conclusion of this first experiment, the two proposed swims were able to generate a greater number of better solutions during the search, mainly in late generations, unlike the swims in IMBFOA and BFOA. It remains to be seen if such behavior leads to better final results.

Experiment 2: Final Results
Comparison among BFOA-Based Approaches. As a first element of analysis, the feasible rates obtained by TS-MBFOA, IMBFOA, and MBFOA in the three four-bar synthesis problems are shown in Table 5. It is clear that the three algorithms were able to consistently reach the feasible region of the search space.   The statistical results obtained by MBFOA, IMBFOA, and TS-MBFOA on the three four-bar synthesis problems are presented in Table 6 in terms of best, average, and standard deviation values of 30 independent runs. According to the 95%-confidence Wilcoxon Signed-Rank Test, the differences observed in the samples of runs in Table 6 are significant. Based on such information, TS-MBFOA outperformed IMB-FOA and BFOA in the three optimization problems.
To further understand the behavior of each BFOAbased algorithm, the convergence plots for each optimization problem are shown in Figures 7, 8, and 9 using the run located in the median value of the 30 independent runs. To complement the information, in Table 7, the objective function value of the best solution found in such run is presented per algorithm per optimization problem.
Those results suggest that the combination of the two proposed swims allowed TS-MBFOA to avoid local optimum    solutions and find even more promising areas in the feasible region of the search space. In contrast, IMBFOA and MBFOA got trapped in those local attractors. Finally, based on the best solution found in the run located in the median value out of the 30 independent runs, TS-MBFOA was the most consistent algorithm to reach competitive values. a differential-evolution-based approach designed to solve mechanical design problems [41]. The parameter values used for such algorithm were the following: 100 individuals and 7500 generations for problem 01, 100 individuals and 1000 generations for problem 02, and 100 individuals and 5000 generations for problem 03. and values were randomly generated at each generation within the following intervals: [0.3, 0.9] and [0.8, 1.0], respectively. Table 8 includes the statistical results of 30 independent runs carried out by TS-MBFOA and the DE-based approach. It is important to mention that in the 30 runs, both algorithms found feasible solutions. Moreover, the 95%-confidence Wilcoxon test indicated that the differences between the algorithms in the final results were not significant.

Experiment 3: Comparison between TS-MBFOA and an
Despite the fact that no significant differences were observed in the results obtained by TS-MBFOA and the DEbased approach, TS-MBFOA was able to find those competitive results by using a single parameter setting, while the DEbased approach required a fine-tuning for each optimization problem. Furthermore, TS-MBFOA required less evaluations to reach such results in problem 01 (500,000 against 750,000 evaluations in problem 01).
Computational Intelligence and Neuroscience  Table 9. The graphical representations of the simulations are shown in Figures 10, 11, and 12 for problems 01, 02, and 03, respectively.
Regarding problem 01, Figure 10 indicates that the four algorithms found mechanisms (solutions) whose trajectories pass over the six precision points. However, the mechanisms generated by MBFOA and IMBFOA are less efficient in terms of time and energy consumption because their recovering loops to start tracking the points again are much longer than those obtained by TS-MBFOA and the DE-based approach.
The mechanisms provided by TS-MBFOA, the DE-based approach, and MBFOA in problem 02 ( Figure 11) were equally good from a mechanical point of view, that is, the trajectories of the three mechanisms pass over the five precision points and their elements vary in less than 25% among them. The exception was the mechanism obtained by IMBFOA because it was deficient; that is, its transmission did not pass over the trajectory specified by the five precision points.
For the most complex problem 03 (Figure 12), the mechanisms provided by TS-MBFOA and the DE-based approach showed a similar path through the precision point pairs. Furthermore, the length of the bars is quite uniform (see Table 9). In contrast, the mechanism found by MBFOA fails in some precision point pairs and the length of its bars is not as uniform as those of the mechanisms obtained by TS-MBFOA and the DE-based approach. Large bars may  produce undesired effects such as bad alignment, weak balancing because of a transverse flexion produced by internal loads, and a bigger stress between mechanical elements on the tightening points related with the transmission angle of the mechanism. Finally, IMBFOA failed to provide a competitive mechanism based on both number of precision point pairs covered and bar length uniformity. From this last experiment, the simulation of the best solutions suggests that TS-MBFOA was able to find, from a mechanical point of view, high-quality four-bar mechanisms in the three instances presented in this work. Particularly in problem 01, TS-MBFOA was able to find a very competitive solution with less evaluations with respect to the DEbased approach, an algorithm whose performance has been highly competitive when solving mechanical design problems [41].

Conclusions and Future Work
This work proposed two-swim operators for the modified bacterial foraging optimization algorithm (TS-MBFOA), to solve three instances of the synthesis of four-bar planar mechanisms: (1) design of a four-bar mechanism that follows a linear vertical path defined by a sequence of six precision points, without a previously established synchronization ( 01), (2) design of a four-bar mechanism that follows a trajectory defined by a sequence of five unaligned precision points, with a previously established synchronization for each point ( 02), and (3) design of a four-bar mechanism for tracking a trajectory delimited by a sequence of ten pairs of precision points ( 03). The first swim favored exploration of the search space by using locations of other bacteria, while the second swim promoted fine movements in the vicinity of the bacterium position by using small step size values.    TS-MBFOA was analyzed in four experiments, where it was found that the two swims, unlike those of the other two BFOA-based algorithms, provided a larger number of better solutions along the search, even in its last cycles. Moreover, TS-MBFOA was able to consistently generate feasible solutions in the three optimization problems and its final results clearly outperformed those of MBFOA and IMBFOA because of its ability to avoid local optimum solutions. Furthermore, TS-MBFOA was able to obtain, with a single set of parameter values, competitive results in the three synthesis problems, with respect to one evolutionary algorithm designed for mechanical design optimization which required being finetuned for each synthesis problem. TS-MBFOA also found a similar competitive result for problem 01 but with less evaluations than the DE-based approach. Finally, from a mechanical point of view, the best solutions obtained by TS-MBFOA for the three optimization problems were highly competitive, suitable, and better than those found by MBFOA and IMBFOA.
The future work consists in revisiting the design of TS-MBFOA for studying the sensitivity to some of its parameters and trying to adapt their values. Finally, optimization problems of other mechanisms will be stated and solved.