# Textile Flexible Job-Shop Scheduling Based on a Modified Ant Colony Optimization Algorithm
## 3 Product Ant Colony Optimization Algorithm
### Original ACO Algorithm Description  
The ACO algorithm is an intelligent optimization algorithm proposed by the Italian scholar [PERSON] [27] based on the ant foraging principle. Ants release a substance called \"pheromones\" during their movement [28], and ant colonies communicate and cooperate through pheromones. Ants tend to follow paths with high pheromone concentrations, leaving behind pheromones on the path between the starting point of the path and the location of the food when foraging. A shorter path will have a larger number of ants passing through, corresponding to the concentration of its pheromone being high, which will prompt subsequent ants to favor the path to obtain the shortest path.  
Ants randomly select routes based on the roulette wheel selection strategy. The probability calculation formula for ant \(k\) from node \(i\) to node \(j\) is given by Equation (14) [29].  
\[p_{ij}^{k}=\left\{\begin{array}{cc}\frac{[\tau_{ij}(k)]^{k}\cdot[\eta_{ij}(k )]^{\beta}}{\sum\limits_{s\in all\textit{long}}k[[\tau_{ik}(k)]^{k}\cdot[ \eta_{ik}(k)]^{\beta}]}&s\in allowed_{k}\\ 0&s\
otin allowed_{k}\end{array}\right., \tag{14}\]where \(s\in allowed_{k}\) represents all target nodes that ant \(k\) can travel through from node \(i\), \(\tau_{ij}(k)\) corresponds to the pheromone value accumulated by ant \(k\) traveling from node \(i\) to node \(j\), \(\eta_{ij}(k)\) corresponds to the heuristic value for ant \(k\) from node \(i\) to node \(j\), and \(\alpha\) and \(\beta\) tune the relative importance in probability of the amount of the pheromone versus the heuristic distance. When \(\alpha\) is larger, the influence of the pheromone will be greater, and the algorithm's search space will be larger. The larger \(\beta\) is, the greater the influence of the heuristic function, and the more precise the algorithm's search.  
The heuristic function influences the ant search process. The larger its value, the more likely the ants are to choose a path with a higher heuristic value, resulting in a more fixed direction for the algorithm's evolution. The heuristic function is typically inversely related to the distance:  
\[\eta_{ij}=\frac{1}{d_{ij}}, \tag{15}\]  
where \(\eta_{ij}\) is the heuristic value of ants traveling from node \(i\) to node \(j\) and \(d_{ij}\) is the distance traveled by ants from node \(i\) to node \(j\).  
The algorithm locally updates all the path pheromones based on the pheromones left along the pathway routes as the ants move. The local pheromone update rules are shown in Equations (16) and (17). Equation (16) represents the pheromones accumulated by all ants in a certain iteration, while Equation (17) represents the pheromones accumulated by ant k during its search:  
\[\Delta\tau_{ij} =\sum_{k=1}^{Z}\Delta\tau_{ij}^{k} \tag{16}\] \[\Delta\tau_{ij}^{k} =\left\{\begin{array}{cc}\frac{Q}{d_{ij}}&\text{if }ant\ from\ i\ to\ j\\ 0&\text{else}\end{array}\right., \tag{17}\]  
where \(\Delta\tau_{ij}\) is the pheromone accumulated by ants traveling from node \(i\) to node \(j\) during their searching, \(Z\) is the number of searching ants set by the algorithm, \(\Delta\tau_{ij}^{k}\) is the pheromone accumulated by ant \(k\) from node \(i\) to node \(j\), \(Q\) is the pheromone enhancement parameter, and \(d_{ij}\) is the distance traveled by ant \(k\) from node \(i\) to node \(j\).  
The pheromone will be globally updated before the algorithm moves to the next iteration, and it will evaporate over time. The global pheromone update rule is shown as Equation (18):  
\[\tau_{ij}(x+1)=(1-\rho)\cdot\tau_{ij}(x)+\Delta\tau_{ij}, \tag{18}\]  
where \(x\) represents the current number of iterations, \(\tau_{ij}\) is the updated total pheromone value, and \(\rho\) is the pheromone evaporate parameter.