Begin
  for   to NP
    Select with probability based on
    if rand(0, 1) <   then
     for   to NP
     Select with probability based on
     if rand(0, 1) <   then
      Randomly select an SIV from
      Replace a random SIV in with
     end if
     end for
    end if
  end for
End.
Algorithm 3: The algorithm of habitat migration operator.