## 4 Simulation Tests and Results  
In this section, the efficacy of both the genetic algorithm and the PSO algorithms in maximizing the coverage and the k-coverage of area in a WSN deployed at a two-dimensional squared area is investigated via analytical simulation tests performed in MathWorks MATLAB environment. Specifically, seven case studies were studied. In the first four of them, the two aforementioned algorithms were compared against each other. In the last three case studies, the efficacy of these two algorithms was compared to that of a relevant grid based PSO algorithm proposed in [30] and a Voronoi-based PSO algorithm proposed in [31]. It must be noted that in order to ensure a fair comparison, the simulation scenarios examined referred to the same conditions referred to in [31]. The optimal values for the control parameters of the GA and PSO algorithms were determined based on suggestions found in literature, in conjunction with trial and error tests. To be more specific, different control parameter combinations were tested, within the ranges suggested in literature [37; 38]. For each specific control parameter combination, 30 runs were conducted and the combination that produced the best value of the objective function on average during the 30 runs was finally chosen as the finest set of control parameters. Specifically, the main control parameters for the GA developed are presented in Table 1.  
The initial population on the chromosomes was created in a random way so that the bounds and the linear constrains were satisfied, provided that they existed. Later on, in order to choose the best parents, a stochastic method was used according to which the chromosomes of the population were placed as consecutive linear segments on a straight line so that the length of every segment was similar to its fitness. The algorithm searched on the line by making steps of the same size and in each step it chose the parent who corresponded to the linear segment on which it landed. The first step occurred as a random number, smaller than the size of the step. Afterwards, during the crossover process, a random binary vector of the same size as the chromosomes was created and in the points where \begin{table}
\begin{tabular}{c c} \hline \hline
**Control Parameters** & **Functions/Values** \\ \hline Creation Function & ‘CreationLinearFeasible’ \\ Selection Function & ‘SelectionStochUnif’ \\ Crossover Function & ‘CrossoverScattered’ \\ Crossover Fraction & 0.5 \\ Mutation Function & ‘MutationAdaptFeasible’ \\ Population Size & [200; 600] \\ Function Tolerance & 0.01 (for 50 generations) \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Genetic algorithm (GA) control parameters. this vector took the value of \"1\", the genes of the first parent were selected, whereas when it took the value of \"0\", the genes of the second parent were selected. The selected genes were combined for the offspring-chromosome to occur. For the mutation process, a function that takes under consideration the bounds and the constraints, which could potentially occur, was chosen. The size of the population differs in respect to the complexity of the problem. Therefore as far as first two simpler problems were concerned, the size of the population was chosen to be equal to 200; while in the last two and most difficult cases the population was chosen equal to 600 chromosomes. Similarly, the fundamental control parameters of the PSO algorithm were given the values that are presented in Table 2.  
The initial swarm was created by having the particles occupy random yet uniformly distributed positions in the area as long as these positions were within the boundaries.