# Non-Cutting Moving Toolpath Optimization with Elitist Non-Dominated Sorting Genetic Algorithm-II
## 2 Path Optimization Problem Description
### Multi-Objective Functions and Weight Factors  
Typically, multiple objectives may present conflicting goals, meaning that improving one objective may require sacrificing one or more other objectives. This scenario represents a multi-objective optimization problem, where there is not a single optimal solution, but rather a collection of solutions between various objectives. Furthermore, the solutions are non-dominated, signifying that, if one or more objectives of a solution are superior to another, it is necessary that there are at least one or more inferior objectives. Recently, sophisticated evolutionary algorithms were proposed to overcome PP problems.  
The CNC PP process involves numerous variables. This paper focuses on optimizing the toolpath length and smoothness as they play a crucial role in achieving the desired machining results. The thoughtful selection of these two parameters significantly impacts both the energy usage and the machining performance, making them pivotal optimization variables.  
The PP has defined an optimization problem involving a sequence point, denoted as \(p\). These multi-objective functions should be minimized. Currently, PP formulation can be expressed through the following:  
\[p=[p_{0},p_{1},p_{2},\ldots,p_{n},p_{n+1}] \tag{8}\]  
The length of the sequence, denoted as \(L(p)\), is minimized as given in (9). This typically involves minimizing the total distance or path length between consecutive points in the sequence. The smoothness of the sequence is improved by minimizing \(S(p)\), as shown in (9). This is calculated as the average of angles formed by three consecutive points in the sequence, as described in the previous response.  
The overall optimization problem is computed as follows:  
\[F(p)=Min(\omega_{1}.L(p)+\omega_{2}.S(p)) \tag{9}\]  
Here, \(\omega_{1}\) and \(\omega_{2}\) are the weighting factors that determine the relative significance of the objective functions as compared to the others. The specific values of these weights would depend on the specific goals and priorities of the optimization problem. The weighted sum approach consolidates all of the multi-objective functions into a single scalar composite objective function by employing weighted summation [50; 51].  
Figure 2: Toolpath planning: (**a**) the original toolpath, (**b**) the newly generated toolpath considering the path smoothness optimization.  
In this study, to solve the multi-objective model using the NSGA-II, different target weight factors will result in different solutions during the two objective weight determination processes. The weighting factors are determined through considering the relationship between optimization objectives and their variables. The weighting factor values for the relevant objective functions are shown in Table 1. These preferences rely on the specific needs and goals of the optimization problem.  
In the optimization process, weighting factors are crucial in determining the importance of each objective relative to others. In this case, \(\omega_{1}\) and \(\omega_{2}\) are the weighting factors assigned to path length and path smoothness, respectively. The value of \(\omega_{1}\) is 0.9, indicating that the path length is significantly prioritized in the optimization process. This proposes a strong emphasis on minimizing the total distance of the toolpath, which can lead to reduced machining time and potentially lower tool wear on the machinery. On the other hand, \(\omega_{2}\) has a value of 0.1, showing that the path smoothness is less prioritized but still considered. Smoother paths can reduce the occurrence of the sharp turns or irregular movements, enhancing the quality of the surface form and prolonging the life of the cutting tool. Balancing these factors allows for an optimization that not only focuses on efficiency, but also maintains an acceptable level of quality in the final output.