Research Article

Intelligent Computation Offloading for IoT Applications in Scalable Edge Computing Using Artificial Bee Colony Optimization

Algorithm 2

ABC to offload computation to the edge/cloud.
(1)Step1: Initialization
(2)q ← # of employed bees, of onlooker bees
(3) dimension of problem
(4) Max. of iterations allowed
(5)Create an initial population using Equation (20)
(6)Evaluate the fitness of the population
(7)repeat
(8) Step 2: Employed bees’ phase
(9)
(10)  whiledo
(11)    Compute new solution using Equation (21)
(12)    Compute the fitness value of new solution using Equation (23)
(13)    if in a neighborhood then
(14)          = , and
(15)    else
(16)        Increase by 1
(17)    end if
(18)    
(19)  end while
(20)  Step 3: Onlooker bees’ phase
(21)  
(22)  whiledo
(23)   Generate a random number such that
(24)   Calculate the probability using Equation (22)
(25)   ifthen
(26)      Compute new solution using Equation (21)
(27)      Compute the fitness value of new solution using Equation (23)
(28)      if in a neighborhood then
(29)          = , and
(30)      else
(31)         Increase by 1
(32)      end if
(33)   end if
(34)   
(35)   
(36)   ifthen
(37)      
(38)   end if
(39)end while
(40) Step 4: Scout bees’ phase
(41)ifthen
(42) Initialize randomly chosen solution using Equation (20)
(43)end if
(44)Step 5: Memorize the best solution achieved so far
(45)until maximum cycle number reached
(46)Output the best solution identified