| Algorithm 1. QPSO pseudocode. |
| 1: Step 1: Setting population size and random initialization of particle positions and velocities. |
| 2: Begin |
| 3: While optimal solution not reached yet, do: |
| 4: For each particle i |
| 5: Step 2: Update the particles positions using Equation (13) |
| 6: Step 3: Evaluation of particles fitness according to required objective function |
| 7: Step 4: Calculate fitness of each particle (pbest and gbest) using Equation (14) |
| 8: end for |
| 9: Step 5: Update pbest, gbest, and p using Equation (15) |
| 10: End While |
| 11: End |