# Textile Flexible Job-Shop Scheduling Based on a Modified Ant Colony Optimization Algorithm
## 3 Product Ant Colony Optimization Algorithm
### Multi-Pheromone of Product Ant Colony  
In the original ACO algorithm, ants search for paths based on a single pheromone between route nodes. For the PACO proposed by the T-FJSP explored in this paper, having a single pheromone makes it difficult to satisfy the release of pheromones when different ants in the colony visit each route. Therefore, this paper adopts multi-pheromone combined with PACO. Each ant has a pheromone, and the number of pheromones corresponds to the number of ants in the product ant colony, that is, the number of pheromones corresponds to the number of textiles to be produced in the textile workshop.  
Figure 2: Multi product ant colonies search for optimization.  
Each pheromone corresponds to the paths between all accessible machine nodes of the ant, where the pheromone between machines belonging to the same operation and non-adjacent operations is 0. The expression of any pheromone is a square matrix:  
\[\left[\begin{array}{cccc}\tau_{11}&\tau_{12}&\cdots&\tau_{1m}\\ \tau_{21}&\tau_{22}&\cdots&\tau_{2m}\\ \cdots&\cdots&\cdots&\cdots\\ \tau_{m1}&\tau_{m2}&\cdots&\tau_{mm}\end{array}\right]_{m\times m} \tag{20}\]  
Each row of the pheromone matrix corresponds to a machine. In the matrix, \(\tau\) represents the pheromone deposited by an ant in the product ant colony when accessing a machine and \(m\) denotes the rank of the square matrix, representing the number of machines in the textile workshop. In each row, only the nodes of all the machines in the adjacent operation corresponding to the machine in that row are not 0, while the remaining corresponding pheromones are all set to 0.  
Based on the multi-pheromone matrix designed for the product ant colony and the total completion time of the workshop, the PACO algorithm is formulated by improving the local pheromone update rule of the original ACO algorithm. When the algorithm iterates once, the total workshop completion time for that iteration is calculated. To minimize the total workshop completion time trend of the algorithm, the next iteration's pheromone should be inversely proportional to the total completion time of the workshop. Therefore, the local pheromone update rule is expressed as Equation (21).  
\[\Delta\tau_{ij}^{k}=\left\{\begin{array}{ll}\frac{Q}{T}&if\ ant\ from\ i\ to\ j\\ 0&else\end{array}\right., \tag{21}\]  
where \(\Delta\tau_{ij}^{k}\) is the pheromone accumulated by the \(k\)-th group of product ant colonies from machine \(i\) to machine \(j\), \(Q\) is the pheromone enhancement parameter, and \(T\) represents the total completion time of the workshop for the current iteration of the algorithm.  
Assuming the algorithm has \(Z\) groups of product ant colonies, the global pheromone update rule of the PACO algorithm, shown in Equation (22), is derived according to Equation (18).  
\[\tau_{ij}(x+1)=(1-\rho)\cdot\tau(x)+\sum_{k=1}^{Z}\Delta\tau_{ij}^{k}, \tag{22}\]  
where \(\tau_{ij}(x)\) represents the global pheromone for the ant colony to move from machine \(i\) to machine \(j\) during the \(x\)-th iteration and \(\Delta\tau^{k}\) represents the accumulated local pheromone of the \(k\)-th group of product ant colonies.