A Divide-and-Conquer Bat Algorithm with Direction of Mean Best Position for Optimization of Cutting Parameters in CNC Turnings

Optimization of machining parameters is an important problem in the modern manufacturing world due to production efficiency and economics. This problem is well known to be complex and is regarded as a strongly nondeterministic polynomial (NP)-hard problem. To reduce the production cost of work-pieces in computer numerical control (CNC) machining, a novel optimization algorithm based on a combination of the bat algorithm and a divide-and-conquer strategy is proposed. First, the basic bat algorithm (BA) is modified with the aim to avoid finding the local optimal solution. In addition, a Gaussian quantum bat algorithm with direction of mean best position is developed. Second, in order to reduce the complexity of the optimization problem, the whole optimization problem is divided into several subproblems by using a divide-and-conquer strategy according to the characteristic of multipass turning operations. Finally, under a large number of machining constraints, the cutting parameters of the two stages of roughing and finishing are simultaneously optimized. Simulation results show that the proposed algorithm can find better combinations of the machining parameters than other algorithms proposed previously to further reduce the production cost. In addition, the outcome of our work presents a novel way to solve the complex optimization problem of machining parameters with a combination of traditional mathematical methods and swarm intelligence algorithms.


Introduction
In the manufacturing field, computer numerical control (CNC) machining refers to the computerized digital control of automated machine tools used to process rough material into semifinished or finished parts; it is one of the most common technologies. e main purpose of CNC machining is to save machining costs and improve machining efficiency and machining quality. Machining costs can be saved by selecting reasonable machining parameters, which introduces an optimization problem, i.e., selecting the optimal machining parameters to achieve the goal of reducing machining costs under the given machining constraints. Earlier research on the optimization of machining parameters mainly used traditional mathematical processing methods such as dynamic programming, sequential unconstrained minimization technique (SUMT), and linear or nonlinear programming. However, in general, the optimization problems of machining parameters are nonlinear and complicated problems with multiple constraints. erefore, it is difficult to obtain satisfactory optimization solutions using traditional methods [1,2]. In recent years, many scholars have applied swarm intelligence algorithms to the optimization problems of machining parameters in the field of computer integrated manufacturing. By using swarm intelligence algorithms to search for approximate optimal solutions of the problem, some research results have been achieved [3][4][5][6][7][8][9][10][11][12][13][14][15][16].
However, most previous studies were devoted to combining swarm intelligence algorithms with various local improvement algorithms [3][4][5][6][7][8][9][10][11]17] (e.g., population diversification, local greedy search, and the use of heuristics as local search) in the hope of obtaining better results. However, because they did not fully consider the characteristics of the turning problem with multiple machining processes, the results obtained by the algorithms were similar, and it was difficult to significantly reduce the machining cost. To address this bottleneck, this paper proposes a novel optimization algorithm by fully considering the characteristics of the turning problem while effectively exploiting the global optimization performance of the swarm intelligence algorithm. By combining the improved bat algorithm with the divide-and-conquer strategy, the performance of the optimization algorithm is substantially improved. e final optimization algorithm is able to find better results. e rest of this paper is organized as follows. Section 2 represents the related works, especially the intelligent algorithms for optimization problems in CNC turning. Section 3 describes the mathematical model for the optimization of machining parameters in CNC turnings. Section 4 first introduces the bat algorithm, then proposes the Gaussian quantum bat algorithm with direction of mean best position (GQMBA), and finally elaborates on the idea of the combination of GQMBA and the divide-and-conquer strategy for solving the machining parameter optimization problems. In Section 5, simulation experiments are conducted, and different algorithms are compared. Finally, the concluding comments and some future research directions are presented in the last section.

Related Works
Optimization of turning parameters is an important issue in the manufacturing field. Early studies used traditional mathematical methods to find optimized machining parameters. Metaheuristic algorithms are also used to solve optimization problems of machining parameters. Chen and Tsai first proposed a mathematical model for the optimization problem of machining parameters in turnings and then combined Hooke-Jeeves pattern search (PS) into the simulated annealing (SA) algorithm to form a hybrid optimization algorithm (SA/PS) to solve the optimization problem [3]. Onwubolu and Kumalo [4] proposed a genetic algorithm (GA) to optimize the machining parameters in turnings but did not consider the constraint that the number of rough passes must be an integer. Chen and Chen [5] pointed out this shortcoming in the research of Onwubolu and Kumalo [4]. However, the optimization results obtained by the GA corrected by Chen and Chen were not better than those obtained by SA/PS. Additionally, based on a GA, Sankar [6] used a modified genetic algorithm (MGA) to search for optimized cutting parameters in turnings. e improved MGA used a specific crossover operator and three different mutation operators to enhance the diversity of the population and prevent the algorithm from converging to a local optimal solution. In addition to SA and GA, some studies applied other intelligent algorithms to the optimization problem of machining parameters. Vijayakumar [7], Wang [8], and Xie and Guo [16] developed new heuristic algorithms to overcome optimization problems based on the ant colony optimization (ACO) algorithm. In addition, the particle swarm optimization algorithm (PSO) is also one of the most widely used swarm intelligence methods [18]. Srinivas et al. proposed a PSO algorithm where the inertia coefficient decreased linearly with every iteration to solve the cutting parameter optimization problem [9]. Yildiz [10] and Costa et al. [12] also contributed different solutions based on the PSO algorithm to the problem. After comprehensive analysis of the previous research methods and results, Raja and Baskar [11] applied three optimization algorithms (SA, GA, and PSO) to three different machining parameter optimization models (single-pass turning, multipass turning, and surface grinding) to conduct experiments and compare the results of various types of intelligent optimization algorithms to the machining parameter optimization problem. e results showed that the optimization effect and computational efficiency of PSO are better than those of SA and GA. Scatter search (SS) is one of the optimization algorithms developed in the field of metaheuristics. Chen [19] focused on the application of the scatter search method in solving the optimization problem in turnings. By comparing it with other algorithms, the experimental results showed that the SS obtained superior machining parameters than some of the metaheuristic methods.
In recent years, in addition to the abovementioned classical intelligent algorithms, some new swarm intelligent algorithms have been proposed by researchers. Xu et al. proposed an improved flower pollination algorithm (FPA) and compared the obtained results with those of related studies [20]. Mellal and Williams used the cuckoo optimization algorithm (COA), one of the advanced bioinspired optimization algorithms, to minimize the unit production cost [21]. e experimental results showed that the COA algorithm is very competitive compared with other algorithms. Due to the successful application of swarm intelligence algorithms for optimization problems, Sofuoglu et al. used three heuristic algorithms, GA, PSO and COA, to solve three different problems, which were more efficient and effective than other algorithms [22]. Similarly, Yildiz developed a new hybrid optimization algorithm to minimize the production cost by adding the Taguchi method that actively acted on the differential evolution algorithm to form a hybrid Taguchi-differential evolution algorithm (HRDE) [23]. e results showed that the hybrid algorithm was more effective than evolutionary algorithms presented in many related studies. In another work by Yildiz, he proposed a similar hybrid optimization method to determine the optimal machining parameters [24]. is method combined the differential evolution algorithm and receptor editing algorithm (DERE). e goal of the mathematical model was to determine the optimal machining parameters to reduce the unit production cost. e method has been experimentally proven to be an effective technique for optimizing machining parameters. Furthermore, in 2013, Yildiz proposed a parameter optimization method based on the artificial bee colony (ABC) algorithm [25] and a hybrid robust teaching-learning-based optimization algorithm (HRTLBO) based on the combination of guided learning optimization and the Taguchi method [26]. Compared with other methods, these proposed algorithms perform well, and better solutions can be found with them. Belloufi et al. provided specific application examples to illustrate the effectiveness of the proposed firefly algorithm (FA) for parameter optimization in multipass turnings [27].

Mathematical Model for Optimizing Machining Parameters in CNC Turnings
To optimize the machining parameters in multipass turnings, the mathematical model proposed in the literature [3,20] takes a large number of actual machining constraints into account and is closer to real-world machining. Since the model has been cited in many studies, the optimization model is used in this paper. e cutting parameters to be optimized include rough cutting speed V r , rough feeding rate f r , rough depth of cut d r , the number of rough cuts n, finish cutting speed V s , finish feeding rate f s , and finish depth of cut d s . e unit production cost (UC) consists of the following four components: (1) Machining cost during real cutting time C M (2) Machine idle cost for setup operations and tool idling motion C I (3) Cost of tool replacement C R (4) Tool cost C T us, the UC can be expressed as follows: where k 0 is the sum of worker cost and management cost per unit time ($/min). D and L are the diameter and length of the work-piece (mm), respectively. d t is the depth of material to be removed (mm). h 1 , h 2 are the constants related to tool idle time and tool-in/out time, respectively. t c , t e are the preparation time for loading and unloading time (min) and time required to exchange a tool (min), respectively. T p is the tool life (min). k t is the cutting edge cost ($/edge). e number of the rough cut is as follows: e objective of the model is to minimize the UC (V r , V s , f r , f s , d r , d s , n) under many machining constraints on rough and finish turnings. e constraints are summarized as follows [3][4][5][6][7][8]: (1) e upper and lower constraints of V r , V s , f r , f s , d r , and d s (2) Tool life constraints (3) Cutting force, cutting power, and surface roughness constraint (4) Stable cutting region constraint; chip-tool interface temperature constraint (5) Constraints on the interconnection between roughing and finishing parameters

Overview of the Bat Algorithm.
e bat algorithm (BA) [28] is a swarm intelligence search algorithm proposed to simulate the echolocation mechanism of bats when foraging. It achieves the localization of search targets by continuously adjusting the frequency and loudness of sound waves. It uses frequency tuning to increase the population diversity and uses automatic scaling to maintain a balance between global and local searches. e frequency, velocity, and position of the i-th bat in the bat population are represented as follows: Here, f i denotes the ultrasound frequency emitted by the i-th bat. f max and f min denote the upper and lower bounds of ultrasound frequency, respectively. β denotes a random number generated by a uniform distribution within the range of [0,1]. v t t and v t−1 t denote the velocity of the i-th bat during the t-th and (t−1)-th iterations, respectively. x i t and x i t−1 denote the position value of the i-th bat during the t-th and (t−1)-th iterations, respectively. e above expressions ensure the global search capability of the algorithm.
In the local search phase, BA uses a random walk strategy to generate feasible solutions at candidate locations. is strategy can be given by the following equation: where ε is the random number generated by the uniform distribution on the range [−1, 1] that determines the direction of the new candidate feasible solution and ‾A t denotes the average acoustic loudness of all bats in the t-th iteration.
During the foraging process, as the bat approaches the foraging target, the bat will gradually adjust the loudness A and emission rate r of the ultrasound, making the loudness gradually decrease and the emission rate gradually increase to achieve more accurate positioning. e process is shown in the following equations: In formula (6), r 0 i denotes the initial pulse emission rate of the i-th bat, and both α and c are constants between (0, 1).

Overview of the Quantum-Behaved Bat Algorithm with
Mean Best Position Directed. Due to the lack of population diversity in the original BA, there is the problem of falling into local optima during the search. By analyzing the flight trajectory of bats, Zhu et al. proposed the quantum-behaved bat algorithm with mean best position directed (QMBA) [29]. e quantum computing mutation operator introduced by the algorithm can enhance population diversity and avoid premature convergence. At the same time, its average optimal position introduced in the local search phase can improve the convergence speed in the later stage of the search. e QMBA still retains the main body of the BA, which controls the global search and local search based on the ultrasonic loudness and the sending rate. e difference lies in its improved position update formula and local search strategy. e position update formula in QMBA introduces a mechanism for adaptively adjusting the step size according to the distance. Its strategy for updating the position is expressed as follows: where η is the random number generated through the uniform distribution probability function between [0,1]. δ d represents the distance between the d-th dimensional value of the current global optimum position and the d-th dimensional value of the i-th bat, which is mathematically expressed as follows: When δ d is less than a given threshold TH, the i-th bat can fly for food at will; when the value of δ d is greater than a given threshold TH, the i-th bat flies toward the current global optimal position. is strategy ensures the global search ability of the bat population to fly toward food.
In the local search process, QMBA no longer uses the random walk search strategy but decides the selection of the mutation strategy based on the mutation probability p m . e first mutation strategy is to use the quantum computing mutation operator, which is expressed as follows: where both U and rand are the random numbers generated by the uniform distribution probability function between [0,1]. μ is an adaptive linearly decreasing weighting factor that can be expressed as follows: where μ max and μ min denote the initial and final values of μ, respectively. mbest represents the average of the current optimal position of all bats during the t-th iteration, i.e., the average optimal position, which can be obtained from the following equation: where P i t denotes the current optimal position of the i-th bat, M denotes the population size, and D denotes the dimension of the problem. e second mutation strategy, which also introduces the average optimal position into the mutation operator, is expressed as follows: where ϕ denotes the random number generated by a uniform distribution between [0,1]. Both mutation strategies introduce the average optimal position to guide the local search, which can improve the accuracy of the search and speed up the convergence of the algorithm due to the use of statistical information of bat positions.

Gaussian Quantum Bat Algorithm with Direction of Mean Best Position.
e QMBA algorithm improves the global search capability and accuracy of the algorithm by introducing the mechanism of the distance adaptive adjustment step, quantum computing mutation operator, and average optimal position-oriented mechanism on the basis of BA. However, the probability density functions used to generate the random numbers in QMBA are all uniformly distributed. Several works [30,31] have shown that long-tailed distributions such as Gaussian distributions are able to perform more accurate searches in the region near the previous generation of individuals, improving the local search capability while providing larger search steps and random walk distances. Expanding the search space can improve the ability of the algorithm to jump out of the local optimum. Based on the above findings, this paper proposes the Gaussian quantum bat algorithm with direction of mean best position (GQMBA) for quantum behavior bats using a Gaussian distribution [32].
In GQMBA, random numbers are no longer generated by the uniformly distributed probability density function. To meet the requirements of the quantum computing mutation operator for random numbers in QMBA, we use the absolute value of the Gaussian distribution probability density function, in which the mean is zero and the variance is one instead (i.e., normal distribution). e one-dimensional probability density function of abs (N(0, 1)) is expressed as follows: GQMBA modifies the three formulas in QMBA accordingly. First, the parameter η in (14) is changed to be generated with a Gaussian distribution, and (7) is modified in GQMBA as follows: 4 Computational Intelligence and Neuroscience where G � abs (N(0,1)). Similarly, substituting for the parameter U in (9), the modified quantum computing mutation operator is expressed as follows: Since q(0) � 0, G � abs (N(0,1)) satisfies the domain of definition of the function ln().
Finally, the random number ϕ in (12) is replaced with (16) as follows: e pseudocode of GQMBA is given by Figure 1, in which Np denotes the total number of bats.
Our first significant contribution is that the Gaussian distribution is introduced in QMBA to generate random numbers. e theoretical analysis above shows that the strategy can enhance the ability of the algorithm to jump out of the local optimum and avoid premature convergence. erefore, it is applied to the optimization problem of the cutting parameter in this paper.

Divide-and-Conquer Strategy for the Optimization Problem in Multipass Turnings.
To improve the performance of the algorithm, the idea of the divide-and-conquer strategy is used to decompose the original problem into several subproblems, which can reduce the complexity of the original optimization problem. For each subproblem, the number of rough cuts is a fixed value. By conquering the subproblems one by one, the whole optimization problem can be solved. In addition, we calculate the theoretical lower bound on UC for each subproblem. Modified BA is first used to search for the optimal solution in the case of the minimum theoretical lower bound on UC, thus hopefully reducing the enumeration of the subproblems. e divide-and-conquer strategy is depicted in Figure 2 and described as follows: (4) Starting from subproblem i, BA is used to solve subproblem i, and the optimal solution, UC iO , is obtained. (5) If all subproblems are enumerated or the UC iO found is less than the theoretical lower bound of subsequent subproblems UC (i + 1)L , the method terminates and the optimal solution is output.

4.5.
e Framework of the Proposed Algorithm Based on GQMBA and the Divide-and-Conquer Strategy. By dividing the complicated multipass turning optimization problem into simple subproblems, the optimization problem can be solved by solving these subproblems one by one. e framework of the optimization algorithm based on GQMBA and the divide-and-conquer strategy (referred to as the GQMBA-DC algorithm) is shown in Figure 3, and the main steps are as follows: (4) Initialize the parameters and set the ultrasonic frequency f i , ultrasonic emission rate r i , and ultrasonic loudness A i .
(5) e global search and local search are controlled by continuously adjusting the acoustic frequency and loudness to update the speed and position to generate new solutions. For the GQMBA-DC, the main body of the BA is retained, but the position update formula and the local search strategy are different. e position update formula introduces a mechanism for adaptively adjusting the step size according to the distance, while the local search strategy also introduces the average optimal position to guide the local search. (6) If A i is greater than the random value rand and the current solution is the optimal solution, perform the next step; otherwise, return to step (5). (7) Accepting the new solution increases r i and decreases A i (as a bat gets closer to the target, the two values change to achieve more accurate localization).

Handling of Constraints.
e processing of constraints is very important for the swarm intelligence optimization algorithm; constraint processing by adding a penalty function is one of the common methods in optimization algorithms. e penalty function is a kind of constraint function. In the process of finding the optimal solution of the algorithm, the objective function is calculated by combining the penalty function, which can gradually eliminate solutions that do not satisfy the constraints and retain solutions that satisfy the constraints.
For the handling of constraints in the optimization algorithm, the bats (individuals) that violate the constraints are penalized using a penalty function to reduce the value of the objective. Different levels of penalties are imposed for different constraint violations. e more constraints that are violated, the heavier the penalty will be. us, by using a reasonable penalty function, the objective function value can converge to the direction of the optimal solution. e penalty function is expressed as where k is the number of constraints and h i is a nondimensional constraint violation.

Simulation Experiments
During the machining processes, a cut tool is used for both roughing cuts and finishing cuts. Due to different machining conditions, the tool wear rates for rough and finish turnings are usually different. e tool life equation can be expressed as follows: Machining examples from the literature [3][4][5][6][7][8] were used to test the performance of the optimization algorithm with the specific parameters shown in Table 1. Additionally, two different machining optimization problems with cutting depths of 6 mm and 8 mm were tested. Computational Intelligence and Neuroscience e algorithm was run 100 times independently on a Windows platform (CPU E3 3.5 GHz and 16 GB memory). e average value of UC was given and compared with the results obtained by previous algorithms, such as SA/PS [3], FE-GA [5], MGA [6], ACO [6], and PSO [9]. e average UC, standard deviation, number of search points, and running time for each algorithm are shown in Tables 2-5. e best results have been underlined and bolded in Tables 2-5.
Tables 2-4 show that the average UCs obtained by the proposed GQMBA-DC are smaller than those given by other algorithms. e standard deviations of the results are small, which in turn indicates that the algorithm is stable. e proposed algorithm can find the optimization results within 30 seconds for different tool life formulas and cutting depths, which shows that the proposed algorithm is an efficient algorithm. Specifically, as shown in Tables 2 and 3, the results of both cases of GQMBA-DC outperform PSO [9] when the tool life equation is T p � T r + T s . As shown in Table 4, when the tool life equation is T p � θT r + (1 − θ)T s , the proposed GQMBA-DC can save 10% compared with the result given by the MGA [6]. Compared with other algorithms, such as SA/PS [3], FE-GA [5], HC [6], NM [6], ACO [6], and DP-FS [33], GQMBA-DC can further save production costs. Because the case of d t � 8 cm is not covered in previous literature, only the results of our algorithm are given in Table 5. us, the above experimental results show that the GQMBA-DC algorithm can effectively solve the optimization problem of cutting parameters to find optimal machining parameters, which, in turn, can further reduce the production cost.
From the perspective of the optimal UC value, comparisons between the proposed GQMBA-DC and other algorithms were also conducted. e comparison of the optimal UC values in Tables 6-9 shows that the optimal UC results obtained by the GQMBA-DC are almost always smaller than the optimal results of UC obtained by other algorithms without constraint violation. e best results have been underlined and bolded in Tables 6-9. Specifically, the results found by the proposed algorithm are comparable to those achieved by HPSO [12], FPA [20], and COA [21] for the tool life equation of T p � T r + T s and d t � 6 mm, which is only one ten-thousandth of the difference, as shown in Table 6. e GQMBA-DC can further reduce the production cost compared with the other algorithms (i.e., HRDE [23], DERE [24], DE [24], and HRTLBO [26]), as shown in Table 6. A similar situation can also be found in Tables 7-9 in different test examples. In addition, the optimal combination of cutting parameters (V r , V s , f r , f s , d r , d s ) for different cases is also given in Tables 6-9. e GQMBA-DC algorithm can find better results than the previously proposed algorithms in terms of both the average UC and the best UC. us, it is clear that the proposed GQMBA-DC can perform significantly better than other algorithms on solution quality in CNC turnings. erefore, the algorithm combining the modified BA with the divide-and-conquer strategy is effective.
To overcome the different complex optimization problems in various fields, we need to carefully consider the characteristics of the specific problem and use the specific characteristics (domain knowledge) to design the optimization algorithm. In our work, for the optimization problem of machining parameters, since the machining process can be divided into different numbers of roughing cuts, we decompose the whole optimization problem of machining parameters into several simple subproblems according to the different numbers of roughing cuts. Each subproblem can be conquered individually, which greatly reduces the space of the problem solution. At the same time, to avoid enumerating all subproblems and save calculation time, we derived the theoretical lower bound on UC for each subproblem by   using the characteristics of the subproblems. en, the algorithm first searches the solution space from the subproblem with a smaller theoretical lower bound on UC. By following these steps, the algorithm can quickly find the optimal solution to the problem.
On the other hand, the performance of the combination of traditional divide-and-conquer strategy and swarm intelligence algorithm is better than the algorithms that only use traditional mathematical methods or swarm intelligence algorithms, as proven by the simulation experiments.       e convergence curves of GQMBA-DC for different mathematical models (tool life equation) and test cases are shown in Figures 4-7. e proposed algorithm converges to the final solution after approximately 150 generations, which indicates that the algorithm converges quickly to find satisfactory results.

Conclusions and Future Work
To solve the nonlinear optimization problem of machining parameters in CNC turnings, this paper proposes an optimization algorithm combining the bat algorithm and the divide-and-conquer strategy. First, based on the classical BA, the Gaussian quantum bat algorithm with direction of mean best position (GQMBA) is proposed by using a Gaussian distribution to generate random numbers. Second, the divide-and-conquer strategy is used to divide the complicated optimization problem into several subproblems and conquer them one by one.
e simulation results show that the GQMBA-DC algorithm proposed in this paper has a stronger search capability than previous algorithms. Specifically, the proposed algorithm can find a better cutting parameter set and further reduce the production cost.
Future research can be considered from two aspects. From the algorithmic point of view, the emerging swarm intelligence algorithm can also be applied to the optimization problem, which may be able to find a better combination of machining parameters, thus reducing costs. In recent years, deep learning methods have been widely applied in various studies; deep learning methods may be considered to reconstruct mathematical models in the optimization of turning parameters [34]. On the other hand, from the perspective of new machining types, to improve the machining efficiency and quality, there are multiple tools to realize machining operations simultaneously in modern CNC turnings. erefore, research on this type of machining optimization problem is also of great concern.
Data Availability e data used to support the findings of this study are included in the paper.

Conflicts of Interest
e authors declare that they have no conflicts of interest to report regarding the present study.