Application of precedence constrained travelling salesman problem model for tool path optimization in CNC milling machines

Article


Introduction
Nowadays, to achieve an effective and efficient production system for a company is very important due to the tough competition conditions. In this context, one of the most important factors that provide efficient production is increasing capacity utilization in operations, which directly affects factory production efficiency. With regards to the innovations in the field of mechanical engineering, Computer Numerical Control (CNC) machines are mostly employed in the various manufacturing process to increase production efficiency [1][2][3]. The total production time for a part in CNC machines basically consists of two components: The machining time when the tool is actually cutting material and the non-productive time when the tool is travelling in the air or the tool is switched in the magazine [4].
Regarding the machining time, it should be noted that there exist many researches have been studied in the literature to reduce total production time by optimizing the machining parameters [5,6]. On the other hand, fewer studies are introduced in the field of optimization to reduce non-productive times in CNC machines [4]. One of the critical issues in process planning of CNC machines to reduce non-productive times is tool path planning for machining since the tool path generation in current CAM technology is still based on the only geometric computations and away from being an optimum manufacturing process, which may lead a considerable increase on total production time [7]. The tool path planning is simply named in the literature as tool path optimization problem (TPOP) and results in travelling salesman problem (TSP) as each tool-path contour can be considered as a city coordinate to be visited [8]. Since the TSP is known as an NP-Hard combinatorial problem, the TPOP can also be considered as a complicated problem to solve. The TPOP can be investigated as the extension of the hole drilling path optimization problem (HDPOP). The HDPOP simply considers the routing a single bit over a workpiece in such a way that all holes are visited in the fastest manner [9]. The HDPOP is classified into two versions concerning the number of tools required for the machining operations on the workpieces: • Single tool hole drilling path optimization problem (STHDPOP) • Multi-tool hole drilling path optimization problem (MTHDPOP) The STHDPOP is the most basic version, where every hole has to be drilled by a single specific tool. Due to only one type of tool is used, a tool switch is not required for the operations. However, the processing time of each hole can be different with respect to hole depth [9]. In case the holes on a workpiece require different diameter or different type of finishing, the STHDPOP shade into the MTHDPOP. As a result of multiple tool usage, tool switch and tool travel times have to be taken into account [10,11]. A detailed literature review on HDPOP is presented by Dewil et al. [9] and Abidin et al. [10], in which various heuristic approaches proposed to solve HDPOP are listed. Considering both single and multi-tool hole drilling path optimization problems, well-known simulated annealing algorithm [12], tabu search algorithm [13] ant colony optimization algorithm [11,14,15], particle swarm optimization algorithm [16][17][18], genetic algorithm [19][20][21][22][23] are proposed. In addition to these algorithms, various recent algorithms are also implemented to HDPOP, such as biogeography based optimization [24], charged system search algorithm [25], hybrid cuckoo search-genetic algorithm [26], shuffled frog leaping algorithm [18], optimal foraging algorithm [27], etc. According to the review study of Abidin et al. [10], in which 41 papers are taken into account, the modelling approaches of HDPOP can be classified into three main groups: TSP based models, precedence constrained travelling salesman problem (PCTSP) based models, and travelling cutting tool problem (TCP) based models. From the reviewed papers, the TSP concept is the most widely used in modeling the HDPOP about 92%, while 5% of them consider the PCTSP and 3% of them consider the TCP. A similar result is reported by Dewil et al. [9] that only 7 of 53 reviewed papers consider the PCTSP based model. In this study, TPOP in CNC milling machines of a company is taken into account to increase the internal operational efficiency of the machines. The mathematical model of the problem is formulated based on PCTSP. To solve the TPOP efficiently, a newly developed bio-inspired optimization algorithm called Satin Bowerbird Optimizer (SBO) is used. SBO is first introduced by Moosavi and Bardsiri [28] to efficiently estimate software development effort. Since the original version of the SBO is introduced for the global optimization problems, the SBO is modified with two components: Discretization procedure for representing a solution for TPOP, and local search procedure. In this context, the main contributions of the proposed study are as follows: • The TPOP is formulated based on the PCTSP.
• To the author' knowledge, this is the first application of the SBO in a combinatorial optimization problem.
• The original version of the SBO is modified with discretization and local search procedures.
• Detailed comparisons are presented for the proposed SBO with statistical significance tests.
• A real-life application of the SBO to the TPOP is carried out by considering hole drilling processes of three different products produced by the company. The rest of the paper is organized as follows. In Section 2, the TPOP is described with the considered assumptions. Mathematical formulation of the TPOP is presented in Section 3 as a mixed integer mathematical model. Details of the proposed algorithm are given in Section 4. Section 5 presents the computational results of the proposed algorithm. Finally, conclusions are given in Section 6.

Problem definition
The TPOP addressed in this study is the extension of the MTHDPOP in which precedences of the operations are taken into account. In literature, this problem is called a multi-tool hole drilling path optimization problem with precedence constraints (MTHDPOP-PC). In MTHDPOP-PC, a specific sequence of drilling operations is defined for each hole [24]. Figure 1 shows an illustrative tool operation for the MTHDPOP-PC, where operation has to be completed before operation . In this case, the operation can be defined as the precedence of operation . With regards to the precedence constraints, Figure 2a presents an example part of tool sequence for multi-tool hole drilling, where the sequence of operations for the holes are given in Table 1. According to the given Application of precedence constrained travelling salesman problem model for tool path optimization… 61 operational sequences, hole 1 ( 11 ) needs to be drilled by only tool 1, hole 2 ( 21 and 22 ) needs to be drilled by tools 1 and 2, respectively, and hole 3 ( 31 , 32 and 33 ) needs to be drilled by tools 1, 2, and 3 in that order. For better visualization, Figure 2b shows an operational precedence graph of the example, where 0 and 7 present the start and end of the hole drilling process. As a consequence of the example, it can be specified that the multi-tool hole drilling path optimization problem with precedence is identical to the well-known PCTSP since both of the problems shows the same characteristics.    Based on the MTHDPOP-PC, the TPOP can be described as finding the best operational plan for the CNC milling machines that minimizes total idle and unnecessary times of the tools for internal operations regarding the following assumptions: • In addition to the hole making, different type of milling operations in CNC milling machines (such as reaming, boring, counterboring, tapping, etc.) are considered on the workpiece.
• The production process of a workpiece starts and ends at the magazine.
• Each milling operation may need a pre-process before it starts. In other words, a milling operation cannot be processed until its precedence operations are completed.
• Each milling operation can be processed by only one type of tool and can be completed in one pass.
• Tools can be used for multiple milling operations.
• In case a tool switch operation is required between two milling operations, the spindle has to visit the magazine.

Model formulation
Since the MTHDPOP-PC is identical to the PCTSP, which is shown in the previous section, the mathematical model formulation of the TPOP is proposed based on the PCTSP model introduced by Kubo and Kasugai [29]. The proposed model is the extension of the well-known TSP model, where the general form of the TSP model is modified by taking the precedence of the tool operations into account. In this context, the proposed mathematical model of the TPOP is formulated as follows: Notations 0 Tool magazine point in CNC machine Number of points on the product to be processed in CNC machine. This can also be assumed as the number of milling operations operated in the CNC machine.
Travelling time from operation to operation including processing time of operation and tool switch time at the magazine if the tool is switched; , = 0, … , Binary data and 1 if milling operation is precedence of milling operation ; , = 1, … ,

Decision Variables
Binary variable and equals to 1 if the tool travels from operation to operation , 0 otherwise; , = 0, … , Positive variable to avoid sub-tours; = 0, … , .
I. Kucukoglu Eq. (1) defines the objective function of the model which aims to minimize total operational times in CNC milling machine. Eq. (2) and Eq. (3) ensure that each operation is operated once in the CNC milling machine. Eq. (4) eliminates the sub-tour for the tool path. These constraints assign an auxiliary non-repetitive variable to each node for a Hamilton tour [30,31]. Operational precedence for the tool is guaranteed by Eq. (5). Finally, the decision variables of the proposed model are defined in Eq. (6) and Eq. (7).

Proposed algorithm
The SBO is a recently proposed bio-inspired metaheuristic algorithm introduced by Moosavi and Bardsiri [28] to efficiently estimate software development effort. The SBO is inspired by the attraction of the male bowerbirds to the female bowerbirds for mating by constructing a bower, a structure built from sticks and twigs, and decorating the surrounding area. Based on the behavior of the bowerbirds, the SBO is structured as follows. Similar to other meta-heuristic algorithms, the SBO starts with a randomly generated population consists of bowers. Let = { ,1 , ,2 , … , , } represents the ℎ bower, where is the problem size. Each bower is generated by using the following equation where = 1, … , and = 1, … , . Here and are the lower and upper bounds of parameter , respectively. Finally, is a uniformly distributed random number. After the initialization step, the fitness of each bower is calculated by using equation (9), where ( ) is the cost function of bower . Then the bowers are sorted based on their fitness value in descending order. To prevent the experience of best bowerbird in population, elitism is applied for the population. To do this, the position of the best bower built by birds is identified as elite.
In each iteration, SBO starts to generate a new population by calculating the probability of the bowers to identify their attractiveness. The probabilities of the bowers are calculated as shown in Equation (10).
Following the probability calculation step, new changes at any bower are calculated by using the Equations (11) and (12). In Equation (11), is the elite bower of the current population, and is the target bower, which is calculated by the roulette wheel selection procedure. Finally, is the attraction power in the goal bower, which is controlled by greatest step size parameter .
At the end of each cycle, a mutation procedure is carried out by applying random changes to the bowers with a certain probability, which is described as _ in this study. The random changes on the bower are determined by , = , + ( × (0,1)) (13) where (0,1) is a standard normal distributed random number and is a proportion of space width which is calculated by using Equation 14. The in Equation 14 is controlled by parameter , which is the percent of the difference between the and .
At the end of each iteration, the fitness values of newly generated bowers are evaluated. Then, the bowers from the old population and newly generated bowers are combined and re-sorted with respect to their fitness. The new population is formed by removing the last bowers from the sorted population. Finally, the elite is updated if the first bower in the new population is fitter than the existing elite.
According to the procedures of the SBO described above, Algorithm 1 presents the main steps of the algorithm. For more details for the SBO, readers can refer to [28] and access to the source code of the algorithm given by the authors.
Since the original version of the SBOis introduced to optimize global optimization problems, this paper introduces a modified version of the SBO for the TPOP, which is called modified satin bowerbird optimizer (MSBO). The MSBO integrates two main procedures to SBO: Discretization and local search. The discretization procedure converts the continuous solution vector of the algorithm to the discrete solution vector considering the precedence constraints. In the local search procedure, two simple movement End For 10 : Evaluation of bowers 11 : Re-sorting and selection 12 : Update elite bower 13 : Until the termination criterion is satisfied

Discretization procedure
One of the critical issue for the continuous metaheuristic algorithms while solving the combinatorial problems is discretization procedure to represent a solution for the considered problem. Since many problems require discrete search spaces, there exist several techniques to convert continuous solution to discrete solution, which can be classified into three main groups [32]: (i) rounding off generic technique, (ii) priority position techniques, (iii) specific techniques associated with meta-heuristic discretizations. In this study, the smallest position value rule, which is one of the priority position techniques introduced by [33], is used in the MSBO to convert a continuous solution vector to discrete solution vector. The smallest position value method converts the continuous values to a permutation order of the position values by sorting the positions with respect to ascending order of the position values. The smallest position value method provides a permutation order for a continuous solution vector. However, a feasible solution cannot always be produced for the TPOP by this method because of the precedences of some operations in the CNC machine. Therefore, the smallest position value is adapted to the TPOP with the following insertion rule. According to the position values in ascending order, a candidate position with the smallest position value can be inserted into the permutation order if and only if its precedence operations are inserted to the order previously. An example of the modified smallest position value rule for the TPOP is shown in Table 2, where the permutation order of the positions with respect to operational precedence is 4 − 5 − 2 − 3 − 1.

Local search
After a permutation ordered solution is obtained in the discretization step for each bower, a local search procedure is carried out by consecutively applying two simple operators: ( , ), and ( , ). In ( , )operator, a specific position ( ) in permutation order is inserted into another specific location ( ). In swap operation, locations of two specific positions ( , ) are replaced. Figure 3 shows an illustrative example of both insertion and swap operations. For both the operators, the best improvement strategy is taken into account and each operator is repeated if any improvement is provided at the end of the search.

Computational results and discussion
Computational studies for the MSBO are formed into two parts. In the first part, the performance of the MSBO is tested by comparing the proposed algorithm with SBO and also two recent meta-heuristic algorithms. In the second part, the MSBO is carried out for the real-life problem of the company. Moreover, managerial insights of the results are discussed in the last sub-section. All experiments are performed on a workstation equipped with a 3.4GHz Xeon E5-2643v3 and 64 GB RAM. However, a single thread is used for the algorithm runs. According to preliminary experiments, the parameter values of the MSBO are identified as follows: = 0.25, = 0.50 and, _ = 0.05.

Performance analyses of the MSBO
Since the PCTSP is also known as the sequential ordering problem (SOP), a well-known SOP dataset from the TSPLIB repository is used in order to test the performance of the proposed MSBO. The SOP dataset includes 41 different sized instances, where the number of nodes to be visited varies between 9-380. Each instance consists of a number of nodes and distances for each pair of nodes. The aim of the problem is to find a minimum Hamiltonian path from the first node to the last node with minimum length by considering the precedence constraints. Regarding the maximum TPOP size of the company, 27 of 41 instances from the dataset (up to 100 nodes) are used for the performance analyses. In this subsection, the MBSO is first compared with the SBO and two variants of the MBSO. To point out the effect of local search procedure on the solution quality, the first variant of the MBSO considers only insertion operation in the local search part, which is named MSBO I . Similarly, the second variant considers only swap operation, which is named MSBO S . The algorithms are repeated 30 times for each instance, and the results of each instance are identified via the average result of 30 runs (mean), and the standard deviation of the results (std). Table 3 presents the results of the SBO, MSBO I , MSBO S , and MSBO. Furthermore Table 3 shows a statistical comparison of the algorithms based on paired t-test with a significance level of 0.05. For each pair of algorithms, the successful one is shown if there is a significant difference between the algorithm results. In this perspective, it should be clearly seen from Table 3 that the MSBO I and MSBO show better performance for all instances with respect to the SBO and MSBO S . On the other hand, the MSBO outperforms the MSBO I for three instances. However, the average results of the MBSO are mostly better than the average results of MSBO I . Thus, it should be concluded from Table 3 that the proposed MBSO outperforms the SBO, MSBO I , and MSBO S . Another performance analysis for the MSBO is made by comparing the proposed algorithm with two recent meta-heuristic algorithms proposed for the PCTSP and SOP, which are Adaptive Evolutionary Algorithm (AEA) introduced by Sung and Jeong [34] and an improved Ant Colony System (ACS) introduced by Skinderowics [35]. Table 4 shows the available results of the AEA and ACS and comparisons between MBSO and other two algorithms, where "best" and "time" represent the best results and average computational time of the runs for a specified instance. To identify the better results for the comparisons, the smallest values in a row are written in bold. Table 4 additionally presents the best-known solutions of the instances, which are also known as optimal solution excepting "prob.100", "ry48p.2", and "ry48p.3". Here, it should be noted that the two results of AEA given by the authors are less than the optimum solutions. Therefore, it is not notable to compare the MBSO with AEA for these instances. For the other instances, it can be seen from Table 4 that proposed MBSO outperforms the AEA for each instance. With regards to the ACS solutions, better results are obtained for most of the instances by the MBSO. For the computational times, it is reported by the Sung and Jeong [34] that the computational time of the AEA varies between 0.01-290.93 seconds for the considered problems. For the ACS, the authors report that the results are obtained with 60 seconds time limitation [35]. Regarding both the algorithm times, the CPU times of the MBSO, which are shown in Table 4, are acceptable for the real-life applications.

Table 3. Comparisons of SBO and MSBO variants
Application of precedence constrained travelling salesman problem model for tool path optimization… 65

Application of the MSBO to real-life TPOP problem
In the second part of the computational studies, the proposed MSBO is carried out for the real-life TPOP problem of the company. In this context, three different products produced over than thousands in a year by the company are taken into account. Solid models of the products 1, 2, and 3 are presented in Figure 4a, 4b, and 4c respectively. Table 5 shows the number of milling operations and tools required to produce these products in CNC milling machines. To compare the performance of the MSBO, first, the mathematical model of the problem is solved for each product by using Gurobi 7.5.1 solver on MPL 5.0 software with 10 hours time limitation. The input data of the models are determined by using SolidCAM software, which is also used by the company for their production process.
(c) Product 3. Following the Gurobi computations, the MSBO is performed for the TPOP problems of the company. Results of the Gurobi solver and MBSO are shown in Table 6. Additionally, operational times of the productions carried out by the company are presented in Table 6, and percentage improvements provided by the Gurobi and MBSO are pointed out in the columns named "Imp%". It should be concluded from Table 6 that an optimum solution is found by Gurobi for only product 1. For the other two problems, the computations are terminated at the end of the time limit and, upper bounds of the solution are taken into account for the comparisons. According to the Gurobi results, an improvement with up to 2.22% is provided for the drilling operations of the company. On the other hand, MBSO could find the optimum solution for product 1 and better result than the upper bound of the Gurobi solutions for product 2 (with 4.05% improvement). Regarding the average computational times of the MBSO, it should be noted that better results can be obtained by the proposed algorithm in shorter CPU times with respect to the Gurobi solver. As a result of the computational studies for these parts, it should be noted that considerable variable cost savings are provided for the company since these products are produced over than thousands in a year.

Managerial insights
The computational results of the MBSO show the efficiency and the robustness of the proposed solution methodology. Similar to most of the meta-heuristic algorithm, the tuned parameter set directly affects the performance of the algorithm. Therefore, a preliminary study is made in order to find the best parameter values for the MBSO. On the other hand, computational studies on the SOP dataset show that the local search procedure significantly affects the performance of the MBSO. Particularly, MBSO with the insertion move, and the combination of insertion-swap move show superior performance. Although, these procedures increase the computational times of the algorithm, with reasonable time limits better results can be obtained by using both local searches. Another interesting observation of the results is the stability of the MBSO solutions. It can be clearly seen from the computations that the standard deviations of most of the results are 0. Comparing with the ACS results, a less standard deviation is observed by MBSO for 6 of 8 instances.
When the results of the case-stud are analyzed, an improvement is provided by the MBSO for each case even though the number of problems is limited with three product types. For these experiments, the most significant saving is provided on the largest problem. Furthermore, the MBSO outperforms the Gurobi regarding both the results and CPU times. As a consequence, the MBSO can be efficiently used in the optimization of CNC operations at the tactical and operational decision-making level. In particular, the proposed MBSO is capable of finding the optimal or near-optimal solution for the real-life TPOPs for the CNC machines. Since an improvement on a process in mass production system provides considerable cost savings for the companies, the proposed study has a potential to take forward the researches on this field. In practice, considering that such production parts consist of numerous CNC operations, operational times and machining costs can be significantly reduced by the MBSO.

Conclusion
This paper addresses the TPOP in CNC milling machines to improve the internal operational efficiency of a company. To find the best tool path in the CNC machines, the mathematical model of the problem is formulated based on the assumptions of PCTSP. With this assumption, tool movement between two operational points is allowed if the successor operation is not the precedence of the predecessor operations. To efficiently solve the considered problem, a newly developed SBO is taken into account and modified its original version with discretization and local search procedures. The computational studies for the proposed MSBO are formed into two parts. In the first part, the MSBO is carried out on a well-known benchmark problem set introduced for the PCTSP, and compared with two recent meta-heuristic algorithms. Results of these computations show that the proposed MSBO is capable of finding efficient solution for the TPOP by finding better results with respect to the other two algorithms. Then, the proposed MSBO is applied for real-life drilling operations of three products. For this case, with up to 4.05% improvement on the operational times is achieved by the MSBO. As a future work, this study can be extended by