## 5 Ant Colony Optimization
For the pheromone count in the next iteration, the current  
Figure 4: BACA environment and search space. Ants initiate at the root and at each decision-making step; ants choose between activating a sensor (1) or maintaining it inactive (0). Figure 5: Ant traversal path. Ants intelligently navigate through the search space, activating sensors that maximize area coverage and minimize overlap. iteration pheromone count is multiplied by the evaporation coefficient. In the second step, the pheromone trails are updated to reinforce the paths associated with better solutions. The BACA keeps track of the current iteration's best solution, denoted as \(S^{ib}\), and the global best solution, denoted as \(S^{sb}\), enabling continuous updates to the best solution and eventual return after the algorithm concludes. The second step is represented by  
\[\tau_{i,j}(t+1)\leftarrow\ \tau_{i,j}(t+1)+\rho\sum_{k=1}^{m}\Delta\tau \tag{7}\]  
where \(\sum_{k=1}^{m}\Delta\tau\) is a parameter that represents the sum of the pheromone paths. The update process involves the evaporation of previous pheromone trails and the addition of new pheromone paths, reinforcing better solutions. By using the fitness function and updating the pheromones after each iteration, the ants are exploring different combinations of activated sensor nodes that eventually result in a near-optimal solution. In the fourth phase, after we have completed a specific number of iterations, the fitness function is used to find the solution with the highest fitness value. We initialize this as our current solution for the hill climbing (HC) and simulated annealing (SA) algorithms. We then use HC and SA to further explore the solution space and compare the effectiveness of coverage between the two. The process of these algorithms is further explained in Section 6. Finally, in the fifth phase, we apply termination criteria. The algorithm terminates once the established number of iterations or a certain amount of time is reached. The structure of the BACA combined with SA can be represented by the flowchart shown in Figure 6.  
Figure 6: Flow chart of BACA with HC or SA. The research methodology commences with the initialization of the parameters, establishing a framework for subsequent algorithm processes. The BACA is then deployed to construct an initial solution, where the foraging behavior of ants is emulated to strategically activate sensors. The fitness of this initial configuration is evaluated, and the optimal solution constructed by the BACA is used as the initial solution for the HC or SA algorithm. Should the BACA-HC or BACA-SA convergence indicate the attainment of an optimal solution, the system will end. Otherwise, a new set of ants is initialized, and the process is repeated. Additionally, the pseudo-code of the binary ant colony algorithm can be represented in Algorithm 1. ```
Input : an amount of ants and the maximum number of iterations Output : the best solution in the form of a binary string obtained during the iteration
1 BACA Parameters:
2//pheromone trails
3//number of ants
4//maximum iterations
5//pheromone evaporation rate
6 Initialization:
7//pheromone trails
8//best solution
9//best fitness
10 forachiterationdo
11 forachantdo
12 construct solutions by flipping bits in binary string representation
13 evaluate fitness of solution using fitness function
14 iffitness\(>\)best solutionthen
15 update best solution
16 update best fitness
17 update pheromone trials based on the fitness of the ant's solution
18 apply pheromone evaporation to all pheromone trials
19 return the best solution obtained during the iteration
```  
**Algorithm 1**Binary Ant Colony Algorithm