Abstract

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.

1. 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: () Evolutionary Algorithms (EAs) [2] based on emulating the process of natural evolution and survival of the fittest and () 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.

Without loss of generality, a CNOP can be defined aswhere is the solution vector and each decision variable , 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 into inequality constraints by using a small tolerance as follows: , .

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: () chemotaxis (swim and tumble movements are performed), () swarming (bacteria can communicate with each other to direct their search for nutrients), () reproduction (the best bacteria are duplicated and these replaced other bacteria), and () 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 [1719] 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, IMBFOA 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 four-bar mechanisms tackled in this research.

The proposed approach is compared against those BFOA-based 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.

2. Synthesis of Four-Bar Mechanisms

Figure 1 shows a planar four-bar mechanism formed by a reference bar , an input bar (crank), a coupler , and an output bar (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 (). is the distance between the origin points of both systems, is the rotation angle of the reference system, and   () corresponds to the angle for every bar in the mechanism; finally, the coordinate pair determines the position of the coupler.

2.1. Kinematics of the Mechanism

The kinematics of four-bar 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:Applying polar notation to each term of (2),Using the equation of Euler on (3) and separating the real and imaginary parts,Expressing the equation system (4) in terms of ,The compact form of Freudenstein’s equation is obtained by squaring system (5) and adding its terms as follows:whereThen the angle can be calculated as a function of the parameters , , , and ; this solution is generated by expressing and in terms of :A second-order lineal equation is obtained by substitution on (6):From the solution of (9), the angular position is given by (10):A similar process is carried out to get from (4) using Freudenstein’s equation. The correct sign for the radical must be selected in the equations for and , according to the configuration of the mechanism. Table 1 indicates the signs related with both configurations.

2.2. 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 thatIn the global coordinate system, this point is expressed asEquations (11) and (12) and the expressions from the kinematics of the mechanism are sufficient to calculate the position of along the trajectory.

2.3. 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.

2.3.1. 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 thatIn this work, Grashof’s law is given byTherefore, to ensure that the solution method fulfills this law, the following constraints were established:

2.3.2. 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 , it is required thatwhere is the number of precision points.

2.4. 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.

2.4.1. 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 asThe set of pairs of precision points is defined asThen, given a set of values of the mechanism bars and their parameters , 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:

2.4.2. 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 asThe vector of design variables iswhereThe 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, is the orientation angle of the system with respect to the horizontal, is its coordinate position, and the last six are the angle values for the input bar . The boundaries for each design variable are defined asThe single-objective numerical optimization problem for this case is described by the following:

(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 asFor this case it is considered that . The restriction given by (16) is not considered since the sequence of input angles is set byThe vector of design variables iswhereThe upper and lower values for the design variables are defined asThe objective function is defined by the following:

(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 iswhereand 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:Finally, it is important to note that the complexity of the study cases presented in the paper is high, due to two aspects. () 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. () Values of design variables with for case and for case : 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 and have not previously undergone a synchronization on the mechanism input bar.

3. 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 self-contained paper, in the next subsections, MBFOA, IMBFOA’s base algorithm, is presented. After that, IMBFOA is detailed. Finally, TS-MBFOA is introduced.

3.1. 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 .The swim allows the bacterium to follow the search direction and move to a new position . 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 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, , is better with respect to the previous position [28] (i.e., () both positions are feasible, but the new position has a better objective function value, () the new position is feasible while the previous one is not, or () 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 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 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., ).(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.

() Create an initial swarm of bacteria at random   ,  
() Evaluate each   ,
() for to do
()for to do
()   for to do
()    Perform the chemotaxis process (tumble-swim) with (38), (39) and the attractor operator in (41) for bacteria
      by considering the three feasibility rules as selection criteria
()   end
() end
() Perform the reproduction process by sorting all bacteria in the swarm based on the feasibility rules, duplicating
   the best bacteria and eliminating the remaining
()   Perform the elimination-dispersal process by eliminating the worst bacterium in the current swarm
() end
3.2. Improved MBFOA (IMBFOA)

IMBFOA was designed to improve MBFOA in its performance to solve CNOPs. Four changes were promoted: () two-swim movements within the chemotaxis process, one for exploration and another one for exploitation, () a skew mechanism for the initial swarm of bacteria, () a local search operator based on sequential quadratic programming, and () a reduction on the usage of the reproduction process. Below is the description of each change.(i)Two-Swim Operators. In the chemotaxis process, instead of the interval, the range for the tumble was set to , where and are user-defined parameters, , .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 is the new step size value for variable , while and are the current and maximum number of cycles of the algorithm, respectively. The initial 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 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 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.

) Create an initial swarm of bacteria by using the skew mechanism   ,  
() Evaluate   ,  
() for to do
() for to do
()    for to do
()       Perform the 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
()    end
()  end
()  if ( mod RepCycle == 0) then
() Perform the reproduction process by sorting all bacteria in the swarm based on the feasibility rules, duplicating
      the best bacteria and eliminating the remaining
() end
() Perform the elimination-dispersal process by eliminating the worst bacterium in the current swarm
() Update the step size vector with (44)
() if ( mod == 0) then
()  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.
() end
() end
3.3. 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) 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 . and are two bacteria randomly selected from the swarm (). 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 . 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 and , 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:where is a randomly generated value with uniform distribution within of decision variable . is a user-defined parameter to scale the step size, and its value should be close to zero, for example, . 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.

) Create an initial swarm of bacteria by using the skew mechanism   ,
() Evaluate   ,  
() for to do
()for to do
()    for to do
()     Perform the 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
()    end
()end
()if ( mod RepCycle == 0) then
()   Perform the reproduction process by sorting all bacteria in the swarm based on the feasibility rules, duplicating the
     best bacteria and eliminating the remaining
() end
()Perform the elimination-dispersal process by eliminating the worst bacterium in the current swarm
()Calculated the step size vector with (48)
() end

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, second-order information is not required as it was the case with IMBFOA.

4. 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 () assess the effectiveness of the proposed swims compared with the swims in IMBFOA and MBFOA, () compare the final results of TS-MBFOA against those of IMBFOA and MBFOA, () compare the final results of TS-MBFOA now against those obtained by a DE-based approach to solve mechanical engineering problems [41], and () 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.

4.1. Performance Measures

To evaluate the behavior of the compared algorithms, the following performance measures for nature-inspired constrained optimization, taken from [43], were computed:(i)Feasible run: a run where at least one feasible solution is found within Max_Evals.(ii)Feasible rate = (number of feasible runs)/total runs.(iii)Successful swim: A swim movement where the new position is better (based on the feasibility rules) than the original position.(iv)Successful swim rate = (number of successful swims)/total swims, where total swims = .

4.2. Parameter Setting

The parameter setting for nature-inspired algorithms is an open problem [44]. Therefore, to get suitable parameter values for the proposed algorithm, 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: () sampling new parameter configurations with a particular distribution, () choosing the most competitive configurations by means of racing, and () 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 is one out of four sets provided by iRace. The other three are the following: () , , , , , , , () , , , , , , , and () , , , , , , . As it can be seen, four parameters in the sets have different values: , , , and . 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 , , and . 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.

4.3. Experiment 1: Effectiveness of the Proposed Swims

The number of successful swims per generation obtained by TS-MBFOA, IMBFOA, and MBFOA on the three four-bar synthesis problems (, , and ) is presented in Figures 4, 5, and 6, where the run located in the median value of 30 independent runs is plotted. In the three figures, the effectiveness of the two proposed swims included in TS-MBFOA was superior in most of the process and particularly 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 were 3.68% by MBFOA, 2.16% by IMBFOA, and 7.26% by TS-MBFOA. In problem the successful swim rates were 2.31%, 3.76%, and 4.36%, by MBFOA, IMBFOA, and TS-MBFOA, respectively. Finally, in problem , 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.

4.4. 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 IMBFOA and BFOA in the three optimization problems.

To further understand the behavior of each BFOA-based 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.

4.5. Experiment 3: Comparison between TS-MBFOA and an Evolutionary Algorithm for Mechanical Design

The results of TS-MBFOA were compared against those obtained by 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 , 100 individuals and 1000 generations for problem , and 100 individuals and 5000 generations for problem . 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.

Despite the fact that no significant differences were observed in the results obtained by TS-MBFOA and the DE-based approach, TS-MBFOA was able to find those competitive results by using a single parameter setting, while the DE-based approach required a fine-tuning for each optimization problem. Furthermore, TS-MBFOA required less evaluations to reach such results in problem (500,000 against 750,000 evaluations in problem ).

4.6. Experiment 4: Simulation of Best Solutions

This final experiment simulated the mechanisms corresponding to the best solutions found by MBFOA, IMBFOA, TS-MBFOA, and the DE-based algorithms for the three problems. The results are analyzed from a mechanical point of view. The decision variable values of each best solution per algorithm per optimization problem are presented in Table 9. The graphical representations of the simulations are shown in Figures 10, 11, and 12 for problems , , and , respectively.

Regarding problem , 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 (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 (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 , TS-MBFOA was able to find a very competitive solution with less evaluations with respect to the DE-based approach, an algorithm whose performance has been highly competitive when solving mechanical design problems [41].

5. 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: () 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 (), () 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 (), and () design of a four-bar mechanism for tracking a trajectory delimited by a sequence of ten pairs of precision points (). 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 fine-tuned for each synthesis problem. TS-MBFOA also found a similar competitive result for problem 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.

Conflict of Interests

The authors declare that there is no conflict of interests regarding the publication of this paper.

Acknowledgments

Betania Hernández-Ocaña acknowledges support from Universidad Juárez Autónoma de Tabasco (UJAT) and Consejo Nacional de Ciencia y Tecnología (CONACyT) through a scholarship to pursue graduate studies at UJAT, Mexico. Efrén Mezura-Montes acknowledges support from CONACyT through Project no. 220522. Edgar Alfredo Portilla-Flores, Eduardo Vega-Alvarado, and Maria Bárbara Calva-Yáñez are grateful for Instituto Politécnico Nacional (IPN) for its support via Secretería de Investigación y Posgrado (SIP) with Project SIP-20151320.