Skip to main content
. 2023 Feb 16;9(3):e13752. doi: 10.1016/j.heliyon.2023.e13752
Algorithm 3: Ant Colony Optimization
1. Ants population and ACO parameter were initialized.
2. Channel was initialized as a city so as to lay the initial pheromone according to Equation (3).
3. Random placement of ants in the city was done according to Equation (15).
4. Then, the generation of random number q:
 if q ≤ q0 probability of the next city is:
 Pi,jk = arg max (τ (i,j)). else, the probability of the next city is:
 Pi,jk = ∑τ(i,j) τ(i,s)
5. kth ant deposits pheromones at the visited city.
6. The local pheromone update for all cities is done with Equation (4) with the application of Equations (14), (18), (19), (20).
7. When kth ant finishes a tour, then, assign channel matrix according to combination city by ant kth.
Else repeat step 4.
8. PU-SINR and sum throughput are calculated based on matrix tour according to Equation 6
9. When all ants accomplished the tour, the global pheromone update is based on the path of the best ant according to equation (5) with the application of Equations (14), (15), (16), and (17).
10. At the end of the ACO process, Determine the optimal solution for channel assignment according to Equation (8).