# Non-Cutting Moving Toolpath Optimization with Elitist Non-Dominated Sorting Genetic Algorithm-II
## 3 NSGA-II-Based PP Optimization Model  
In this study, a meta-heuristic-based planner is designed to generate a trajectory comprising advanced and rotated primitives. Initially, the PP file is globally optimized for length and smoothness using the NSGA-II in the first step. The fitness function employed in optimization prioritizes the generation of paths characterized by shortness and smoothness. In this section, the NSGA-II is presented as an optimization tool, and subsequently, the optimized procedures guided by the NSGA-II technique are described to generate an initial feasible path for the second part of the PP. The goal of this stage is to establish a short and feasible path using the NSGA-II algorithm. This path is systematically created by identifying a sequence of nodes derived from a set of geometrically random configurations within the scenario's free space. The selection of nodes for the feasible path is determined through a new generation process employing the NSGA-II. Regarding the application of the NSGA-II, the optimization goal in theory is determined by two main factors when the manufacturing conditions are determined: path length and path smoothness. The correct selection of these two elements significantly impacts energy consumption and machining quality, making them the primary optimization variables. The NSGA-II has demonstrated its capability to preserve various solutions and achieve optimization more effectively than other multi-objective optimization models [52]. The NSGA-II is a well-structured optimization model and a recognized algorithm with its popularity and maturity. The NSGA-II stands out as a commonly used multi-objective genetic algorithm, offering advantages such as reduced complexity when compared to the well-classification genetic algorithm, along with a fast execution speed and an effective solution process [53; 54; 55; 56]. The NSGA-II algorithm operates the following steps:  
1. An initial population, \(P(0)\), (POP) of size, \(S\), is arbitrarily created. Then, the non-dominated sorting with a child population, \(Q(0)\), is attained, initializing \(g=0\). 2. The two generations, \(P(g)\) and \(Q(g)\), are associated to generate a new population \(R(g)\). 3. The crowding distance (CD) of the individuals is determined while the non-dominated sorting of the population, \(R(g)\), is carried out. The most suitable individual is then chosen based on the order value and CD to create a new parent set, \(P(g+1)\). 4. The new parent set \(P(g+1)\) is designated and mutated to generate a new children population, \(Q(g+1)\). 5. The algorithm checks if the stopping criteria has been met. If not, \(g\) is incremented by step 1, and the process returns to step 2. The initial steps, from 1 to 2, involve the initial procedures, which include the generation and evaluation of the initial population \(P(0)\). Additionally, a new population set, \(R(g)\), is created to retain the non-dominated solutions discovered during the algorithm execution. Step 4 is the crucial stage of the algorithm, representing the main iteration that continues until the stopping criteria is met. During the iteration, two new populations, namely \(P(g)\) and \(Q(g)\), are established. \(P(g)\) is utilized to keep designated individuals from the population, \(P(0)\), while \(Q(g)\) keeps the offspring individuals. The selection step is utilized to determine the population from \(P(0)\), and the chosen individuals are stored in \(P(g)\). These individuals in \(P(g)\) are paired, and offspring individuals are created via the crossover method, subsequently being incorporated into child population \(Q(g)\). Various methods are executed for each individual within \(P(g)\), resulting in the generation of new individuals stored in \(Q(g)\). After applying genetical steps to the individuals in \(P(g)\), the children population \(Q(g)\) is calculated, and possible individuals are added to \(R(g)\). Then, the individuals in the \(R(g)\) population sets are updated, retaining non-dominated solutions while excluding others.