## 2 Materials and Methods
### Proposed Application of the ACO Algorithm for the JSS Problem
```
Input:\(N\), \(M\), \(I_{\text{aco}}\), \(C_{\text{attr}}\), \(f_{\text{min}}\), \(f_{\text{max}}\), \(\alpha\), \(\beta\), \(\gamma\), \(\rho\), \(\lambda\) Output:\(T\), makespan Auxiliary Variables:\(f\), \(C_{s}\), routes, makespans, best_route, best_makespan Initialization:\(C_{s}=Count\_stages(N),f=\|n\times C_{s}|\cdot f_{\text{min}}\), best_makespan = \(\infty\) Begin ACO-ISS Algorithm
1 for(\(i=1,\,\ldots,\,I_{\text{aco}}\))do
2 for(\(a=1,\,\ldots,\,C_{\text{attr}}\))do
3\(\text{\emph{makespanes}}_{\text{\emph{a}}}\), \(\text{\emph{routes}}_{\text{\emph{a}}}=Ant\_route(N,\,M,\,C_{s},f,\,\alpha,\,\beta)\)
4 endfor
5 for(\(a=1,\,\ldots,\,C_{\text{attr}}\))do
6 for(\(s=1,\,\ldots,\,C_{\text{cs}}\))do
7\(j=\text{\emph{routes}}_{\text{\emph{a}},\text{\emph{s}}}\)
8\(f_{s_{j}}=f_{s_{j}}+(\gamma/\text{\emph{makespanes}}_{\text{\emph{a}}})^{\beta}\)
9 endfor
10 endfor
11\(a=\text{\emph{argmin}}_{\text{\emph{a}}}(\text{\emph{makespanes}}_{\text{ \emph{a}}})\)
12 if(\(\text{\emph{makespanes}}_{\text{\emph{a}}}<\text{\emph{best\_makespan}}\)) then
13\(\text{\emph{best\_makespan}}=\text{\emph{makespanes}}_{\text{\emph{a}}}\)
14\(\text{\emph{best\_route}}=\text{\emph{routes}}_{\text{\emph{a}}}\)
15 endif
16 for(\(s=1,\,\ldots,\,C_{s}\))do
17\(j=\text{\emph{best\_route}}_{\text{\emph{s}}}\)
18\(f_{s_{j}}=\lambda f_{s_{j}}\)
19 endfor
20 for(\(\varphi\in f\))do
21\(\varphi=\text{\emph{max}}(\text{\emph{min}}(\varphi\cdot(1-\rho),f_{\text{ max}}),f_{\text{min}})\)
22 endfor
23 endfor
24\(T=\text{\emph{ISS}}(\text{\emph{best\_route}})\)
25\(\text{\emph{makespan}}=\text{\emph{best\_makespan}}\)
26 returnT, makespan End ACO-ISS Algorithm
```  
**Algorithm 1** Pseudocode for the ACO Algorithm Application for JSS Problem  
In Algorithm 1 the following designations are introduced: \(I_{\text{aco}}\) is the number of ACO algorithm iterations; \(C_{\text{attr}}\) is the number of ants; \(C_{s}\) is the total number of all stages of all jobs; \(I[A\times B]\) is an identity matrix \(A\times B\). Each ant traverses the graph at each algorithm iteration (rows 2-4). After that, the application of the pheromone is performed in accordance with Equations (7) (rows 5-10), (9) (rows 11-19), and (8) (rows 20-22). The schedule obtained with the best-found route is the output result of the algorithm (rows 24-26). In Algorithm 2, the following designations are introduced: \(\emph{tabu\_list}\) is the list of job numbers for which all stages are added to the schedule; \(\emph{stage\_counters}\) is the vector of the counters of added stages for each job; \(\emph{stages}\) is the vector of the number of stages in each job. During the traversal, the ant at each step chooses an edge. Edge selection means job selection, as shown in Figures 2 and 3. The next stage of the selected job will be added to the schedule with the start of execution as soon as possible. Edge selection probabilities are calculated according to Equation 6 (rows 3-15). The probabilistic choice is made using roulette wheel simulation (rows 16-17). If the selected stage is the last stage for the corresponding job, then the stages of this job can no longer be selected (rows 18-21).