| Algorithm 1: Pseudocode of the BGOA-TVG algorithm. |
| Initialize , , and Max_Iterations |
| Initialize a population of solutions (i = 1, 2, …, n) |
| Evaluate each solution in the population |
| Set T as the best solution |
| While (t < Max_Iterations) |
| Update c using Equation (9) |
| For each search agent |
| Normalize the distances between grasshoppers in [1, 4] |
| Update the step vector ΔX of the current solution using Equation (10) |
| For i = 1: dim |
| Use Equation (8) to obtain the current position |
| Use Equations (10)–(13) to obtain the binary position |
| Use Equations (14)–(17) to obtain the final position |
| Calculate based on Equations (13), (15), and (16) |
| End Reevaluate the fitness of each individual in the population If there is a better solution, replace T with it Update T |
| End |
| End |
| Return T |