| Algorithm 1: An algorithm for the swimming method. |
| 1:Input: , ,,, . |
| 2:Output: New value of the after swimming movement. |
| 3: /*for computing swim length*/ |
| 4: while do /*for not exceeding the maximum number of swim steps */ |
| 5: |
| 6: if then /* a more advantageous direction*/ |
| 7: |
| 8: |
| 9: end if |
| 10: end while |
| 11: return |