Process Planning for Large Container Ship Propeller Shaft Machining Based on an Improved Ant Colony Algorithm

: To accommodate the production and manufacture of complex and customized marine components and to avoid the empirical nature of process planning, machining operations can be automatically sequenced and optimized using ant colony algorithms. However, traditional ant colony algorithms exhibit issues in the context of machining process planning. In this study, an improved ant colony algorithm is proposed to address these challenges. The introduction of a tiered distribution of initial pheromones mitigates the blindness of initial searches. By incorporating the number of iterations into the expectation heuristic function and introducing a ‘reward–penalty system’ for pheromones, the contradictions between convergence speed and the tendency to fall into local optima are avoided. Applying the improved ant colony algorithm to the process planning of large container ship propeller shaft machining, this study constructs a ‘distance’ model for each machining unit and develops a process constraint table. The results show significant improvements in initial search capabilities and convergence speed with the improved ant colony algorithm while also resolving the contradiction between convergence speed and optimal solutions. This verifies the feasibility and effectiveness of the improved ant colony algorithm in intelligent process planning for ships.


Introduction
In recent years, with the advent of Industry 4.0 and Industry 5.0, the shipbuilding industry has gradually transitioned towards intelligence and digitization [1].However, the complexity of multivariable and time-varying factors remains a major challenge in the production of ship components [2].Specifically, the production of large container ship propeller shafts, characterized by complex processes and customization, renders traditional process planning methods inadequate.Consequently, the role of computer-aided process planning as a bridge between customized design and actual manufacturing is becoming increasingly prominent.Statistics show that computer-aided process planning can reduce the workload of process planning for new parts or products by approximately 58% [3].Traditional process planning methods, being overly reliant on experience, often lead to the generation of multiple process routes for a single propeller shaft, necessitating numerous trial-and-error experiments for time and cost estimation, resulting in inefficiency in the production process [4].Currently, there is a global effort to find effective solutions to these challenges and to explore how to more quickly and effectively complete process planning for different components [5].Therefore, the quick and efficient automation of process planning in the context of complex, multi-process, and customized manufacturing has become an urgent problem to solve.
Process planning in machining involves selecting and sequencing machining operations (such as milling, drilling, and turning) for a given part, in compliance with design standards and manufacturing practices.It is one of the most complex dynamic decisionmaking problems and a key aspect of computer-aided process planning.Researchers have proposed various methods for process planning, including process reuse methods, rule-based inference methods, machine learning-based methods, and heuristic algorithm optimization-based methods, each with its own advantages and disadvantages, as depicted in Table 1.Over the past few decades, heuristic algorithm optimization-based methods have become increasingly mature and stable.Compared to other heuristic algorithms, the ant colony algorithm stands out for its few adjustable parameters, strong positive feedback capability, and ability to adapt to changes and handle complex dynamic environments.Consequently, it has been widely applied to path planning problems in domains such as robotics, network routing, and logistics.Zhang [6] utilized an improved elite ant colony optimization algorithm to solve the grain emergency vehicle dispatch model, demonstrating its effectiveness in distribution scheduling.Sara Perez-Carabaza et al. [7] used an ant colony algorithm to enable UAV trajectory optimization planners to quickly obtain high-quality solutions.Xiang et al. [8] proposed an ant colony algorithm based on the diversity of demand coverage, maintaining diversity in routes to effectively respond to emerging customer requests.The increasing complexity of customized large parts has extended production cycles when relying solely on experiential process route planning.Traditional ant colony algorithms suffer from issues like prolonged reaction times, significant initial search blindness, and the trade-off between convergence speed and local optima.These challenges often result in extended processing times, imprecise process planning routes, or even non-convergence in multi-step processing planning.Hence, this study proposes an enhanced ant colony algorithm tailored for process planning.It aims to mitigate local optima traps, enhance initial search capabilities, optimize convergence speed, and potentially offer effective solutions for process planning of complex, customized large parts.In the realm of intelligent manufacturing within the marine equipment sector, the fabrication of propeller shafts for large container ships stands out for its significant complexity and high degree of customization.In this study, focusing on the production of large container ship propeller shafts, the shaft machining process planning problem is analogized to a path optimization problem.A 'distance' model for various machining units with differences and similarities is established.Using the improved ant colony algorithm, machining units are selected and sequenced according to the constraint table, resulting in an optimal process planning route.By innovating the initial pheromone distribution method, a pheromone tiered distribution based primarily on basic process planning principles is proposed.Analyzing the optimal process routes in the first iterations of multiple tests, the improved ant colony algorithm effectively resolves the issue of weak initial search capabilities of the traditional algorithm, enhancing the guidance of subsequent searches.Furthermore, by innovating the expectation heuristic function and pheromones updating methods, a heuristic function factor based on the number of iterations and a pheromone update method based on the 'reward-penalty system' are proposed.A decay coefficient that changes with the number of iterations is incorporated into the expectation heuristic function, strengthening the role of pheromones in the later stages of iterative searches and avoiding the contradiction of increased convergence speed leading to local optima.This study aims to apply the improved ant colony algorithm to the process planning of large container ship propeller shafts, addressing issues such as empirical process routes, blindness in algorithm searches, and contradictions in optimal convergence.It provides technical and methodological support for the transition from Industry 4.0 to Industry 5.0 in intelligent manufacturing and data support for the industrial application of the improved ant colony algorithm.

Traditional Ant Colony Algorithm
The ant colony algorithm (ACA) simulates the foraging paths of ants in nature to solve combinatorial path optimization problems.The more ants there are on a path, the higher the concentration of pheromones, leading to an increased likelihood of that path being chosen by other ants.
Assuming at time t, the m ant is located at point i, its transition probability P M ij is determined by Equations ( 1) and (2).
where C represents the set of points that the ants allowed to select at time t + 1; τ α ij (t) is the pheromone function on the path <i, j> at time t, η β ij (t) is the expectation heuristic function on the path <i, j> at time t; α is the heuristic factor, β is the expectation heuristic factor, and d ij is the Euclidean distance between points i and j.
To avoid excessive accumulation of pheromones, the pheromone level is updated after each iteration.The pheromone level at time t + 1 is determined by Equation (3).
where ρ represents the pheromone volatility coefficient, with 0 < ρ < 1, ∆τ ij (t) denotes the total increase in pheromone level on the path <i, j>, and ∆τ m ij (t) indicates the amount of pheromone deposited by the m ant on the path <i, j> during the current iteration.
Different pheromone update methods lead to different calculations of pheromone increment.Among these, the ant cycle system, represented by Equation ( 4), is the most commonly used.
where Q is a constant representing the total amount of pheromone, and L m is the total length of the path traveled by the m ant in this iteration.

Initial Pheromones
In ACA, the initial pheromone concentration is set to the total amount of pheromone Q, which results in the initial searches being blind and random, with limited subsequent guidance, making the algorithm more challenging.Hence, this study adopts a tiered pheromone concentration distribution to avoid blind initial searches, as shown in Equation (5).
Here, δ represents the weight of the initial pheromone distribution with a value between 0 < δ ≤ 1, and Q is the total amount of pheromone.

Expectation Heuristic Function
From Equation (2), it can be observed that the expectation heuristic function value is inversely proportional to the distance from the next node to the destination point, encouraging ants to choose shorter distances.However, in the later stages of the search, more attention should be given to the influence of pheromone concentration on ant selection while reducing the impact of the expectation heuristic function.Therefore, in this study, a self-regulating coefficient ξ is introduced into the expectation heuristic function to reduce its impact on the transition probability in the later stages of the search, as shown in Equations ( 6) and (7).
ξ = I max − I/I max , I = I max 1/I max , I ̸ = I max (7) Here, ξ is the self-regulating coefficient of the expectation heuristic function, I represents the current iteration number, and I max is the maximum iteration number.

Pheromone Update Rules
In ACA, the pheromone update mechanism does not incorporate scenarios where inferior paths are encountered during the iteration.In this study, on the basis of local and global updates, a 'reward-penalty system' is introduced.It 'rewards' the best paths and 'penalizes' the worst paths during the current iteration, as shown in Equation (8).To prevent the algorithm from stagnating too early, upper and lower limits are set for pheromone concentration, constraining it within the range [τ max , τ min ].The maximum and minimum values of pheromone are calculated using Equations ( 9)- (11).
Here, L best represents the best path in the current iteration, and L worst represents the worst path in the current iteration.
Here, f best represents the best path in each iteration, and n is the number of nodes traversed by the ants.

Construction of a Process Planning Model
The production and manufacturing of large container ship propeller shafts belong to a personalized customization process.Traditional process planning relies heavily on the experience of workers, resulting in low efficiency and accuracy.The goal of process planning is to obtain the optimal mechanical machining sequence combination while meeting processing requirements.By comparing the differences and similarities in the machinery, tools, fixtures, clamping positions, and processing characteristic units used in each machining unit of the large container ship propeller shaft, a 'distance' model for the shaft's process planning is established, as shown in Equation (12).The model assumes that the manufacturing resources of the enterprise will not change in the near future.
where W F , W S , W M , W CT , W C , and W CP represent the weights of the machining feature unit, machining stages, machining machines, machining tools, machining fixtures, and clamping positions, respectively.
and CP m i , CP m j are the machining feature unit, machining stages, machining machines, machining tools, machining fixtures, and clamping positions of machining units m i and m j .∆(x, y) is the discriminant function between machining units m i and m j , as shown in Equation (13).

Constraint Conditions and Processing Methods
For the sorting of machining processes, there are generally four basic principles: (a) process the datum surface first; (b) perform roughing before finishing; (c) machine the surface before machining the hole; and (d) machine the primary surface before the secondary surface.
According to the four basic constraints of part processes in the improved ant colony algorithm (IACA), the initial distribution of pheromones for each machining unit is first improved.Based on different initial pheromone distribution weights δ, the initial pheromone values for corresponding machining stages are calculated using Equation (5).Secondly, a constraint table R m x is added to each machining unit.Assuming that the machining unit m i must be machined before machining unit m j , the existence of m j is included in the constraint table R m j .All operations performed before m j are stored in R m j .When selecting m j , it is necessary to first check whether the constraint table R m j is an empty set.If it is an empty set, there is a certain probability of selecting m j .

The Specific Steps
Applying IACA to the process planning of large container ship propeller shafts, the algorithm flow is shown in Figure 1, with specific steps as follows: Step 1: Initialize parameters.Set parameters such as the number of ants , the tota pheromone amount , the heuristic factor , the and expectation heuristic factor .
Step 3: Select the process.Place ants at points where the constraint table  is a empty set as starting points.Add this point to the ant's path and remove this point from the constraint tables  of all processes.Then, calculate the probability of selecting th next process based on whether the constraint table  is empty and Equation (1).
Step 4: Update pheromones.Perform both local and global pheromone updates an apply the 'reward-penalty system'.
Step 5: Update the expectation heuristic function.Update the expectation heuristi function based on the number of iterations.
Step 6: Complete the search.Check if the termination conditions are met and calcu late the length of the process planning path using Equation (12).

Application of the Process Planning Model (1) Division of Machining Units for Large Container Ship Propeller Shaft
The machining steps for the large container ship propeller shaft are roughly as fo lows: blank machining, roughing, semi-finishing, stress relief treatment, finishing, dril ing, and checking.To improve the model's practicality and minimize machining errors we drew a scaled model of the actual-sized shaft, retaining all machining steps.By subd viding the shaft, the machining details of each step could be clearly depicted, as illustrate in Figure 2. The shaft segments mainly included right flange  , transition shaft end  Step 1: Initialize parameters.Set parameters such as the number of ants m, the total pheromone amount Q, the heuristic factor α, the and expectation heuristic factor β.
Step 3: Select the process.Place ants at points where the constraint table R m x is an empty set as starting points.Add this point to the ant's path and remove this point from the constraint tables R m x of all processes.Then, calculate the probability of selecting the next process based on whether the constraint table R m x is empty and Equation (1).
Step 4: Update pheromones.Perform both local and global pheromone updates and apply the 'reward-penalty system'.
Step 5: Update the expectation heuristic function.Update the expectation heuristic function based on the number of iterations.
Step 6: Complete the search.Check if the termination conditions are met and calculate the length of the process planning path using Equation ( 12).

Application of the Process Planning Model (1) Division of Machining Units for Large Container Ship Propeller Shaft
The machining steps for the large container ship propeller shaft are roughly as follows: blank machining, roughing, semi-finishing, stress relief treatment, finishing, drilling, and checking.To improve the model's practicality and minimize machining errors, we drew a scaled model of the actual-sized shaft, retaining all machining steps.By subdividing the shaft, the machining details of each step could be clearly depicted, as illustrated in Figure 2. The shaft segments mainly included right flange f 1 , transition shaft end f 2 , front common shaft end f 3 , composite shaft end f 4 , rear common shaft end f 5 , tail vertebral body f 6 , and threaded shaft end f 7 .A detailed analysis of the machining steps for each shaft segment is shown in Table 2.  2.  While adhering to the four basic principles of process planning, it is also important to consider the 'concentration' of each machining stage.For example, in Appendix A, if the initial machining selection has the roughing unit  as the positioning reference for  , at this point, both the roughing unit  and the semi-finishing unit  for  can be chosen simultaneously.This may lead to a lack of concentration at each machining

Shaft End Characteristics
Machining Feature Unit Operation Boring, reaming Roughing, semi-finishing Roughing, semi-finishing Roughing, semi-finishing, finishing f 1−7 Roughing, semi-finishing, finishing Roughing, semi-finishing, finishing Roughing, semi-finishing, finishing Roughing, semi-finishing, finishing Roughing, semi-finishing, finishing Roughing, semi-finishing, finishing Roughing, semi-finishing f 7−5 Drilling (2) Initial Information Pheromone Distribution While adhering to the four basic principles of process planning, it is also important to consider the 'concentration' of each machining stage.For example, in Appendix A, if the initial machining selection has the roughing unit m 8 as the positioning reference for f 1−5 , at this point, both the roughing unit m 10 and the semi-finishing unit m 11 for f 1−6 can be chosen simultaneously.This may lead to a lack of concentration at each machining stage.Therefore, a hierarchical initial information pheromone distribution method needs to be adopted, where the initial pheromones for the rough machining stage should be greater than those for the semi-finishing stage, and the initial pheromones for the semi-finishing stage should be greater than those for the finishing stage.In this study, the initial distribution weights for pheromones satisfied the following: 1 ≥ δ Roughing > δ Semi Finishing > δ Finishing > 0.
(3) Model Weight Coefficients In the mathematical model for the process planning of large container ship propeller shafts, weights represent the extent to which actual production conditions in the workshop affect the process.Based on the actual workshop conditions, due to the large size of the propeller shaft, changing the machining equipment will inevitably require the workpiece to be re-clamped, which is very time-consuming.Therefore, the weight of machining machines W M is the largest.The weights for machining fixtures W C and clamping positions W CP are the second largest.Different machining stages will use different cutting parameters, and the machining time will also vary.Therefore, the weight of machining stages W S ranks third.In production, it is preferable to minimize the movement of the cutting tool along the machining path and to machine from one end to the other as much as possible.Therefore, the weight of the machining feature units W F ranks fourth.Tool changes during machining have the shortest time, so the weight of machining tools W CT is the smallest.Specifically, In this study, the total weight sum was set to 1, and the actual values were determined based on the production line of the enterprise.For example, Each machining unit has a constraint table R m x that stores the machining units that must be performed before the current machining units.Based on the analysis of the machining process for large container ship propeller shafts, constraint tables were set for each machining unit, as shown in Table 3.Each pair forms a column, where 'machining units' represent the machining units for large container ship propeller shafts, totaling 45 steps, and 'constraint table' signifies the constraint units of the machining units.Upon the completion of machining a constraint unit from the constraint table, the corresponding machining units will then have a certain probability of being selected.m 8 and m 43 are used to machine the positioning reference holes on the left and right ends of the propeller shaft, so m 8 and m 43 have no constraints in front of them and can be used as the starting positions for machining.
The constraint table can guide the choices made by ants.First, select the initial machining position in m 8 or m 43 .If m 8 is chosen, remove m 8 from the constraint tables of various machining units and bring out the machining units with empty constraint tables, which are m 5 , m 6 , m 9 and m 10 .Then, make a choice based on the calculated probabilities and continue this process until all machining steps are completed.As shown in Figure 3. (3) Model Weight Coefficients In the mathematical model for the process planning of large container ship propeller shafts, weights represent the extent to which actual production conditions in the workshop affect the process.Based on the actual workshop conditions, due to the large size of the propeller shaft, changing the machining equipment will inevitably require the workpiece to be re-clamped, which is very time-consuming.Therefore, the weight of machining machines  is the largest.The weights for machining fixtures  and clamping positions  are the second largest.Different machining stages will use different cutting parameters, and the machining time will also vary.Therefore, the weight of machining stages  ranks third.In production, it is preferable to minimize the movement of the cutting tool along the machining path and to machine from one end to the other as much as possible.Therefore, the weight of the machining feature units  ranks fourth.Tool changes during machining have the shortest time, so the weight of machining tools  is the smallest.Specifically,  >  / >  >  >  .In this study, the total weight sum was set to 1, and the actual values were determined based on the production line of the enterprise.For example,  = 0.3 ,  =  = 0.2,  = 0.15,  = 0.1,  = 0.05.

(4) Machining Constraint Table Each machining unit has a constraint table 𝑅
that stores the machining units that must be performed before the current machining units.Based on the analysis of the machining process for large container ship propeller shafts, constraint tables were set for each machining unit, as shown in Table 3.Each pair forms a column, where 'machining units' represent the machining units for large container ship propeller shafts, totaling 45 steps, and 'constraint table' signifies the constraint units of the machining units.Upon the completion of machining a constraint unit from the constraint table, the corresponding machining units will then have a certain probability of being selected. and  are used to machine the positioning reference holes on the left and right ends of the propeller shaft, so  and  have no constraints in front of them and can be used as the starting positions for machining.
The constraint table can guide the choices made by ants.First, select the initial machining position in  or  .If  is chosen, remove  from the constraint tables of various machining units and bring out the machining units with empty constraint tables, which are  ,  ,  and  .Then, make a choice based on the calculated probabilities and continue this process until all machining steps are completed.As shown in Figure 3.In each pair of columns, the former represents the machining units for large container ship propeller shafts, while the latter represents the constraint units of the current machining units.

Parameter Optimization and Selection
The ant colony algorithm is primarily influenced by the calculation probability of selecting path points and the method of updating pheromones.From Equations ( 1) and ( 3), it can be seen that the ant colony algorithm has three main parameters: the heuristic factor α, the expectation heuristic factor β, and the volatilization coefficient ρ.The range of values for each parameter is shown in Table 4.

Parameter
Value Ranges To date, there is no comprehensive analysis method available to directly determine the optimal parameter combination.Therefore, based on the practical issues of large container ship propeller shaft process planning and the actual production circumstances of the enterprise, we employed a single-factor control variable method.By systematically altering one parameter at a time, we analyzed the individual impacts of each parameter on algorithmic results, thereby determining the weighted optimal parameter combination.The modeling environment was as follows: Windows 11 64-bit; processor: Intel (R) Core (TM) i7-8750H; clock speed: 2.20 GHz; memory: 8 GB; algorithm simulation software: PyCharm 2023.3.
The initial settings of parameters for the model simulation were as follows: Ant_number = 100, Itermax = 200, Q = 100, β = 0.6, ρ = 0.3.The algorithm's convergence iterations and the best path length were tested for α values ranging from 0.7 to 2.0.The simulation experimental results are shown in Figure 4.
The value of the heuristic factor α has a significant impact on the ant colony algorithm.A lower α weakens the effect of pheromones, promoting exploration of new paths but delaying convergence.Conversely, a higher α strengthens path dependence, reduces exploration of new routes, and facilitates local optima.From Figure 4, it can be observed that when the information pheromone factor α is small, both algorithms have poor search capabilities and are prone to getting stuck in local optima.As α gradually increases, the search capabilities of both algorithms improve.Moreover, the improved ant colony algorithm not only maintains high search capabilities but also achieves faster convergence compared to the traditional ant colony algorithm.When α is in the range of [1.0, 1.2], both algorithms exhibit fast convergence and good search capabilities.Specifically, when α = 1.1, the search capabilities and convergence speed are excellent, with the improved ant colony algorithm converging in 22 iterations and achieving a global optimal path length of 7.85.increases, the search capabilities of both algorithms improve.Moreover, the improved ant colony algorithm not only maintains high search capabilities but also achieves faster convergence compared to the traditional ant colony algorithm.When  is in the range of [1.0，1.2],both algorithms exhibit fast convergence and good search capabilities.Specifically, when  = 1.1, the search capabilities and convergence speed are excellent, with the improved ant colony algorithm converging in 22 iterations and achieving a global optimal path length of 7.85.A smaller value of the expectation heuristic factor  can lead to an unclear direction in the ant colony algorithm, prolonging the search time and resulting in slow convergence.On the other hand, a larger  may lead to premature convergence to local optimal solutions.From Figure 5, it can be observed that when  is small, both algorithms have an unclear search direction and slow convergence.As  gradually increases, both algorithms converge faster but may produce suboptimal search results, possibly getting stuck in local optima.When  is in the range of [4.9, 5.1], both algorithms exhibit strong guidance during the search and achieve faster convergence.Specifically, when  = 5.0, the improved ant colony algorithm converges in 29 iterations and achieves a global optimal path length of 7.8.
In the same experimental setup with  = 1.1 and  = 5 , the algorithm's performance was tested for different values of the volatilization coefficient ρ ranging from 0.1 to 0.9, and the results are shown in Figure 6.In the same environment, the parameters were set as follows: Ant_number = 100, Itermax = 200, Q = 100, α = 1.1, ρ = 0.3.The algorithm was tested for different values of the expectation heuristic factor β ranging from 4.5 to 5.5, and the results are shown in Figure 5.
A smaller value of the expectation heuristic factor β can lead to an unclear direction in the ant colony algorithm, prolonging the search time and resulting in slow convergence.On the other hand, a larger β may lead to premature convergence to local optimal solutions.From Figure 5, it can be observed that when β is small, both algorithms have an unclear search direction and slow convergence.As β gradually increases, both algorithms converge faster but may produce suboptimal search results, possibly getting stuck in local optima.When β is in the range of [4.9, 5.1], both algorithms exhibit strong guidance during the search and achieve faster convergence.Specifically, when β = 5.0, the improved ant colony algorithm converges in 29 iterations and achieves a global optimal path length of 7.8.
In the same experimental setup with α = 1.1 and β = 5, the algorithm's performance was tested for different values of the volatilization coefficient ρ ranging from 0.1 to 0.9, and the results are shown in Figure 6.
A smaller value of the volatilization coefficient ρ leads to slow pheromone evaporation, increasing the risk of getting stuck in local optimal solutions.Conversely, a larger ρ causes rapid pheromone evaporation, affecting the utilization of previous search experiences and slowing down algorithm convergence.From Figure 6, it can be observed that when ρ is too small, both algorithms produce suboptimal search results, indicating that they are trapped in local optima.As ρ gradually increases, the search capabilities of both algorithms deteriorate, and the convergence speed decreases.When ρ is in the range of [0.2, 0.3], both algorithms exhibit good search capabilities and convergence speed.Specifically, when ρ = 0.2, the improved ant colony algorithm converges in 30 iterations and achieves a global optimal path length of 7.8.A smaller value of the volatilization coefficient  leads to slow pheromone evaporation, increasing the risk of getting stuck in local optimal solutions.Conversely, a larger  causes rapid pheromone evaporation, affecting the utilization of previous search experiences and slowing down algorithm convergence.From Figure 6, it can be observed that when  is too small, both algorithms produce suboptimal search results, indicating that they are trapped in local optima.As  gradually increases, the search capabilities of both algorithms deteriorate, and the convergence speed decreases.When  is in the range of [0.2, 0.3], both algorithms exhibit good search capabilities and convergence speed.Specifically, when  = 0.2, the improved ant colony algorithm converges in 30 iterations and achieves a global optimal path length of 7.8.A smaller value of the volatilization coefficient  leads to slow pheromone evaporation, increasing the risk of getting stuck in local optimal solutions.Conversely, a larger  causes rapid pheromone evaporation, affecting the utilization of previous search experiences and slowing down algorithm convergence.From Figure 6, it can be observed that when  is too small, both algorithms produce suboptimal search results, indicating that they are trapped in local optima.As  gradually increases, the search capabilities of both algorithms deteriorate, and the convergence speed decreases.When  is in the range of [0.2, 0.3], both algorithms exhibit good search capabilities and convergence speed.Specifically, when  = 0.2, the improved ant colony algorithm converges in 30 iterations and achieves a global optimal path length of 7.8.

Comparison with Other Algorithms
When αϵ[1.0, 1.2], β ∈ [5.0, 5.2], and ρ ∈ [0.2, 0.3], the performance of the ant colony algorithm is superior.To validate the effectiveness and superiority of this algorithm, model simulation experiments were conducted with the following improved ant colony algorithm parameters: Ant_number = 100, Itermax = 200, Q = 100, α = 1.1, β = 5.0, ρ = 0.2.To eliminate randomness, ACA, IACA, genetic algorithm (GA), and particle swarm optimization (PSO) were each tested ten times.The average optimal path value, average number of iterations, and average runtime for each algorithm over the ten tests were calculated and are recorded in Table 5.It can be observed that, compared to GA, ACA and IACA exhibit significant advantages in convergence speed and final convergence results, indicating that ACA and IACA are relatively simpler and more controllable in adjusting algorithm parameters.Compared to PSO, ACA and IACA demonstrate better iteration stability, suggesting that ACA and IACA are less prone to being trapped in local optima and thus escaping the iteration process.In comparison to ACA, IACA achieves further improvements in convergence speed and iteration stability while also avoiding the contradiction between convergence speed and susceptibility to local optima.Additionally, to compare the initial search capabilities and convergence speeds of ACA and IACA, we further analyzed the optimal iteration results of the two algorithms, as shown in Figure 7. optima and thus escaping the iteration process.In comparison to ACA, IACA achieves further improvements in convergence speed and iteration stability while also avoiding the contradiction between convergence speed and susceptibility to local optima.Additionally, to compare the initial search capabilities and convergence speeds of ACA and IACA, we further analyzed the optimal iteration results of the two algorithms, as shown in Figure 7.
From Figure 7 and Table 5, it can be observed that in the ten tests conducted, both ACA and IACA achieve an optimal path value of 7.8.However, the latter exhibits stronger stability in terms of the average optimal path value.The initial iteration's optimal path value for ACA differs from the average optimal path value by approximately 48% to 74%.Moreover, the average iteration counts and average running times for the ACA are relatively high, indicating that the initial search of the ACA is highly blind and lacks strong guidance for subsequent iterations, resulting in slow convergence.In contrast, the initial iteration's optimal path value for the IACA is significantly lower than that of ACA, differing from the average optimal path value by approximately 15% to 27%.Additionally, the average iteration count decreases by about 79%, and the average running time decreases by approximately 83%.This suggests that the improved algorithm avoids the blind search in the initial phase, leading to improved convergence speed.From Figure 7 and Table 5, it can be observed that in the ten tests conducted, both ACA and IACA achieve an optimal path value of 7.8.However, the latter exhibits stronger stability in terms of the average optimal path value.The initial iteration's optimal path value for ACA differs from the average optimal path value by approximately 48% to 74%.Moreover, the average iteration counts and average running times for the ACA are relatively high, indicating that the initial search of the ACA is highly blind and lacks strong guidance for subsequent iterations, resulting in slow convergence.In contrast, the initial iteration's optimal path value for the IACA is significantly lower than that of ACA, differing from the average optimal path value by approximately 15% to 27%.Additionally, the average iteration count decreases by about 79%, and the average running time decreases by approximately 83%.This suggests that the improved algorithm avoids the blind search in the initial phase, leading to improved convergence speed.
The optimized process routes of the two algorithms were compared with the existing enterprise process route, as shown in Table 6.It can be concluded that, in the current machining process route for large container ship propeller shafts, tool changes occur 11 times, workpiece clamping is changed five times, and the machine tool is changed once.The optimized machining process route reduces tool changes to 8 times, maintains workpiece clamping changes at five times, and machine tool changes at 1 time.Moreover, it reduces two workpiece rotations and includes two additional drilling operations in the optimized route.However, during detailed machining, the optimization result of ACA involves tool movement from both ends towards the center, while IACA adopts a tool path that starts from one end to the other and then reverses at the end of machining.This reduces unnecessary tool movements during machining, improves the continuity of the machining path, and makes the entire machining process more compact and efficient.
for each machining stage of the shaft were summed to obtain the fundamental machining times for each machining stage of the shaft.Concurrently, practical machining tests were conducted for all three machining schemes, and the machining times for each scheme were recorded, as shown in Table 8.From Tables 7 and 8, it can be concluded that in the basic processing time, both the traditional ant colony algorithm and the improved ant colony algorithm optimized processing routes reduce the number of drilling operations for f 1 and f 7 by two times, resulting in a current drilling time of 35.4 min, saving approximately 59.4 min compared to the existing enterprise process route.In the auxiliary processing time, the optimized route reduces part turning by two times, saving approximately 300 min, and also reduces tool changes by three times, saving about 96.3 min.The process route optimized by the traditional ant colony algorithm saves about 455.7 min compared to the existing enterprise process route.IACA further optimizes the tool path, effectively reducing tool movement time, saving approximately 40 min again.Therefore, IACA saves about 415.7 min compared to the existing enterprise process route.

Process Cost Analysis
Process cost generally refers to the manufacturing cost closely associated with the production stage and the process.It consists of variable costs and fixed costs.Variable costs mainly include labor wages, tool consumption expenses, etc., while fixed costs mainly encompass equipment depreciation, maintenance fees, etc.When choosing among several technically equivalent process options, it is common to compare the process costs of each option, with the one with the lowest process cost considered the optimal solution.
The processing equipment used for large container ship propeller shafts are generalpurpose machine tools.Additionally, these propeller shafts are produced as single pieces, so there is no need for specialized fixtures.Therefore, four cost factors, namely, machine operator wages, depreciation of general-purpose machine tools, tool maintenance costs, and depreciation of general-purpose fixtures, were considered.
Machine operator wages: where T d represents the total time for a single unit, Z h is the unit time wage for machine tool workers, and α is the additional wage rate for the compensation reward mechanism.General machine tool depreciation cost: where P M is the machine tool price, R M is the machine tool depreciation rate, F is the machine tool working time, and ω M is the machine tool load factor.Tool maintenance cost: where n is the number of times a tool can be sharpened, P o is the cost of sharpening the tool once, T j is the basic machining time, and T e is the durability of the tool.General fixture depreciation cost: where P C is the fixture price, R C is the fixture depreciation rate, ω C is the utilization rate of the fixture in production, and F is the fixture working time similar to the machine tool.As shown in Table 9.Based on the calculations from the above formulas, the economic comparison of the existing enterprise process route and the two optimized algorithms is presented in Table 10.It can be observed that all the process costs for the optimized process routes are lower than the current enterprise solution.Specifically, when comparing ACA and IACA in terms of machine tool worker wages, the former decreases by CNY 668.4,while the latter decreases by CNY 727.1.The depreciation cost of general machine tools decreases by CNY 23.5 for the former and CNY 25.6 for the latter.Both algorithms result in a reduction of CNY 1.5 in tool maintenance costs.As for the depreciation cost of general fixtures, the former decreases by CNY 1 and the latter by CNY 1.1.In total, the process cost decreases by CNY 694.4 for the former and CNY 755.3 for the latter.The improved ant colony algorithm reduces the cost by an additional CNY 60.9 compared to the traditional ant colony algorithm.
J. Mar.Sci.Eng.2024, 12, x FOR PEER REVIEW 7 of 19 front common shaft end  , composite shaft end  , rear common shaft end  , tail vertebral body  , and threaded shaft end  .A detailed analysis of the machining steps for each shaft segment is shown in Table

Figure 2 .
Figure 2. The machining process of large container ship propeller shafts and a schematic of the shaft end.

Figure 2 .
Figure 2. The machining process of large container ship propeller shafts and a schematic of the shaft end.

J
. Mar. Sci.Eng.2024, 12, x FOR PEER REVIEW 8 of 19 distribution weights for pheromones satisfied the following:

Figure 3 .
Figure 3.The role of constraint tables.Figure 3. The role of constraint tables.

Figure 3 .
Figure 3.The role of constraint tables.Figure 3. The role of constraint tables.

Figure 4 .
Figure 4. Relationship between the heuristic factor, the number of iterations, and the optimal path length.In the same environment, the parameters were set as follows: _ = 100,  = 200,  = 100,  = 1.1,  = 0.3.The algorithm was tested for different values of the expectation heuristic factor β ranging from 4.5 to 5.5, and the results are shown in Figure 5.A smaller value of the expectation heuristic factor  can lead to an unclear direction in the ant colony algorithm, prolonging the search time and resulting in slow convergence.On the other hand, a larger  may lead to premature convergence to local optimal solutions.From Figure5, it can be observed that when  is small, both algorithms have an unclear search direction and slow convergence.As  gradually increases, both algorithms converge faster but may produce suboptimal search results, possibly getting stuck in local optima.When  is in the range of [4.9, 5.1], both algorithms exhibit strong guidance during the search and achieve faster convergence.Specifically, when  = 5.0, the improved ant colony algorithm converges in 29 iterations and achieves a global optimal path length of 7.8.In the same experimental setup with  = 1.1 and  = 5 , the algorithm's performance was tested for different values of the volatilization coefficient ρ ranging from 0.1 to 0.9, and the results are shown in Figure6.

Figure 4 .
Figure 4. Relationship between the heuristic factor, the number of iterations, and the optimal path length.

J 19 Figure 5 .
Figure 5. Relationship between the expectation heuristic factor, the number of iterations, and the optimal path length.

Figure 6 .
Figure 6.Relationship between the volatilization coefficient, the number of iterations, and the optimal path length.

Figure 5 .
Figure 5. Relationship between the expectation heuristic factor, the number of iterations, and the optimal path length.

Figure 5 .
Figure 5. Relationship between the expectation heuristic factor, the number of iterations, and the optimal path length.

Figure 6 .
Figure 6.Relationship between the volatilization coefficient, the number of iterations, and the optimal path length.

Figure 6 .
Figure 6.Relationship between the volatilization coefficient, the number of iterations, and the optimal path length.

Figure 7 .
Figure 7. (a) Optimal path values for the first iteration; (b) optimal path convergence curve.Figure 7. (a) Optimal path values for the first iteration; (b) optimal path convergence curve.

Figure 7 .
Figure 7. (a) Optimal path values for the first iteration; (b) optimal path convergence curve.Figure 7. (a) Optimal path values for the first iteration; (b) optimal path convergence curve.

Table 2 .
Detailed machining attributes of each shaft end.

Table 2 .
Detailed machining attributes of each shaft end.

Table 3 .
Constraint table for each machining unit.

Table 5 .
Comparison of process planning.

Table 5 .
Comparison of process planning.

Table 6 .
Large container ship propeller shaft process planning.

Table 7 .
The basic processing time.

Table 8 .
Comparison of working time quotas for the three options.

Table 9 .
Value of each process cost item.

Table 10 .
Comparison of the economics of the three options.