Interactive exchange
For (Each bacterium)
If (Individual exchange)
If (Dynamic neighbor oriented)
    Choose one in two neighbor bacteria, compare the fitness,
    replace the poorer one
else (Random oriented)
    Randomly choose a bacterium from the group, compare the
    fitness, replace the poorer one
End if
else if (Group exchange)
    Compute the group best, compare the fitness, replace the poor
End if
End For
Pseudocode 3: Pseudocode of interactive exchange.