## 3 Solving Optimal Cutting Parameters Using Black Hole-Continuous Ant Colony Algorithm
### The Proposed Black Hole-Continuous Ant Colony Algorithm  
Although the ACO\({}_{\text{R}}\) has fast convergence speed; however, due to the low diversity of solutions in the optimization process, falling into local optima is a common challenge. After each iteration, the ACO\({}_{\text{R}}\) only selects the first \(k\) superior solutions for the next iteration, and the next \(m\) inferior solutions are discarded, so after running for a period of time, the probability of relatively superior solutions being selected as the guiding solutions is too high, resulting in the standard deviation vector \(\sigma_{ij}\) gradually tending toward 0 and failing to produce new solutions and the disappearance of solution diversity. Given that the energy consumption optimization model of a CNC lathe is a non-linear function involving two objectives and three variables, it is likely to exhibit multiple instances of local optima, so the ACO\({}_{\text{R}}\) cannot be guaranteed to exit the local optimum area. Combining the black hole algorithm with ACO\({}_{\text{R}}\) resulted in the formation of a hybrid algorithm known as BH-ACO\({}_{\text{R}}\), which was utilized to address this issue. The BH-ACO\({}_{\text{R}}\)'s distinctive feature is to process both the good and the bad solutions sorted in step 5 of the ACO\({}_{\text{R}}\). It designates the first \(k\) superior solutions as black holes and the last \(m\) inferior solutions as planets. Each planet is drawn towards the direction of the black holes to facilitate global search. Black holes, however, do not attract each other, hoping to discover better solutions during the movement process, thereby expanding the search scope and enhancing the variety of solutions. For the black hole itself, a dynamic local search strategy is used to improve optimization accuracy. If \(k\) solutions are generated randomly in the search space defined by Formula (15), the position of the \(i\)-th solution, encompassing three variables, can be expressed as follows:  
\[x_{i}=(x_{i}^{1},x_{i}^{2},x_{i}^{3})=(\sigma_{ci},f_{i},a_{pi}) \tag{22}\]  
Perform ACO\({}_{\text{R}}\) steps 2-4 or the generation of \(m\) new solutions. Because there are only three cutting parameters, leading to sampling that generates too many new solutions, this may lead to the repetition of solutions, subsequently impacting the optimization process negatively. So, the number of solutions, \(m\), generated per iteration should be set to 50. Calculate the function values associated with each solution using Equation (16) and subsequently arrange them in sorted order. The first \(k\) solutions that result in relatively small values for cutting specific energy and surface roughness are regarded as black holes, while the last m solutions are regarded as planets. 1. Planetary global search  
The planets will move towards the black hole in a global search to generate m new solutions, whose search algorithm can be expressed as  
\[X_{i,j}=X_{i,j}+(X_{b,j}-X_{i,j})\times rand(0,1) \tag{23}\]  
where \(i=1,2,\cdots,m_{t},\cdots 50\) denotes the \(i\)-th planet, \(b=1,2,\cdots,k\) denotes the \(b\) black hole, \(j=1,2,3\) denotes the \(j\) dimension, \(X_{i,j}\) denotes the position of the \(i\) planet in the \(j\) dimension, and \(X_{b,j}\) denotes the position of the \(b\) black hole in the \(j\) dimension. Since a black hole can absorb the material around it, when the planetary movement is complete, determine whether the planet is within the black hole's absorption radius, \(R_{b}\). Define \(R_{b}\) as follows:  
\[R_{b}=\left|\frac{F_{b}}{\sum\limits_{i=1}^{m}F_{i}}\right| \tag{24}\]  
where \(F_{b}\) denotes the size of the function value for the \(b\) black hole and \(F_{i}\) denotes the size of the function value for the \(i\) planet.