## 4 Proposed Snake Optimizer
### Pseudocode and Operational Flow
Figure 5:5 Histogram of final fitness values for SO in Scenario 3 after 100 iterations. robust across all runs, while the collision rate varies slightly more than in the shorter iteration scenarios, with some runs showing noticeable collisions. Spectral capacity remains stable, indicating that the optimizer effectively manages the trade-off between avoiding collisions and maximizing spectral capacity. ### Discussion

#### 5.4.1 Scenario 1

In Scenario 1, where there were 10 SUs, 5 PUs, and 15 available frequency bands, SO was evaluated with different iteration counts: 30, 50, and 100. For 30 iterations, the mean final fitness value achieved was 14.40 with a standard deviation of 0.52. The algorithm converged on average after eight iterations. The spectrum utilization efficiency was 96.00%, with a mean collision rate of 0.06 and a spectral capacity of 14.40 bps/Hz. The best SU band allocations varied across the 10 runs, with users generally occupying different bands, reflecting effective optimization. When the iteration count was increased to 50, the mean final fitness slightly decreased to 14.30, with a standard deviation of 0.48. The algorithm showed faster convergence, averaging 5.80 iterations. The spectrum utilization efficiency was 95.33%, and the collision rate was marginally higher at 0.07, leading to a spectral capacity of 14.30 bps/Hz. The best SU allocations again varied across runs, with different patterns of band occupancy by the users. For 100 iterations, the mean final fitness value improved to 14.50, with a slightly higher standard deviation of 0.53. The convergence time increased to 12.80 iterations, indicating that the optimizer explored more solutions before settling. The spectrum utilization efficiency reached 96.67%, the collision rate dropped to 0.05, and the spectral capacity improved to 14.50 bps/Hz. The best SU band allocations reflected diverse patterns across the 10 runs, showing a consistent allocation of users to different bands. #### 5.4.2 Scenario 2

In Scenario 2, with 8 SUs, 4 PUs, and 12 available frequency bands, SO's performance across 30, 50, and 100 iterations was analyzed. Figure 5:6 Spectrum utilization efficiency, collision rate, and spectral capacity across 10 runs for Scenario 3 with 100 iterations. For 30 iterations, the mean final fitness value was 11.60, with a standard deviation of 0.52. The optimizer converged in seven iterations on average. The spectrum utilization efficiency was 96.67%, the collision rate was 0.05, and the spectral capacity was 11.60 \(\mathrm{bps}/\mathrm{Hz}\). The best SU band allocations across the runs showed effective use of available bands, with users generally occupying separate bands. Increasing the iteration count to 50, the mean final fitness improved slightly to 11.70, with a standard deviation of 0.48. The mean convergence time increased to 11.60 iterations, indicating a more thorough search. The spectrum utilization efficiency increased to 97.50%, with a reduced collision rate of 0.04 and a spectral capacity of 11.70 \(\mathrm{bps}/\mathrm{Hz}\). The best SU band allocations again varied, with users effectively distributed across the bands. With 100 iterations, the mean final fitness reached 11.80, with a standard deviation of 0.42. The convergence time averaged 11.70 iterations. The spectrum utilization efficiency further improved to 98.33%, and the collision rate decreased to 0.03, resulting in a spectral capacity of 11.80 \(\mathrm{bps}/\mathrm{Hz}\). The best SU band allocations continued to reflect effective optimization, with minimal collisions and high efficiency. #### 5.4.3 Scenario 3

In Scenario 3, which involved 12 SUs, 6 PUs, and 20 available frequency bands, SO was again tested with 30, 50, and 100 iterations. For 30 iterations, the mean final fitness was 19.20, with a standard deviation of 0.63. The optimizer converged on average after 11.60 iterations. The spectrum utilization efficiency was 96.00%, with a mean collision rate of 0.07 and a spectral capacity of 19.20 \(\mathrm{bps}/\mathrm{Hz}\).