Skip to main content
. 2025 Jul 30;25(15):4705. doi: 10.3390/s25154705
Algorithm 2 Levy-WOA workflow scheduling optimization algorithm
Input: task_list, allocation obtained from HEFT, Dag = (T, E), VM_list, pre(ti),
data_size(ti,tj), bandwidth(VMk,VMl), population_size = 50, max_iterations Tmax = 200, α = 0.01, β = 1.5, η = 1, ω1 = 0.5, ω2 = 0.5

Output: the best solution best_schedule

population = []
for i = 1 to population_size-1 do
        schedule = {}
        for task in task_list do
                vm = random_select(VM_list)
                Obtain the start time Sta_Tk,i using Equation (7)
                   Obtain end time Fin_Tk,i of the current task and Equation (9)
                schedule[task] = (vm, start_time, end_time)
        end for
                population.append(schedule)
end for
             population.append(allocation)
For each schedule in population do
      Calculate makespan FN of the workflow by Equation (11)
      Calculate total cost Total_Cost by Equation (12)
      Calculate fitness value using Equation (23)
  end for
  Return Initial “best_schedule” with the highest fitness value among the population
  Return Initial “best_fitness” with the hightest fitness value among the population
                t = 0
while t < Tmax do
                aa=22tTmaxp = rand(), φ = rand().
        for each schedule in population do
                if p < 0.5 then
                        Obtain a new schedule by Encircling Prey of WOA using Equations (24)–(28)
                else
                     if φ < 0.5 then
                           l = rand (−1, 1)
                          for task ti in task_list:
                                Obtain a new schedule by the spiral update in Bubble-net Attacking using Equations (29) and (30)
                     else
                             for task ti in task_list:
                                        Obtain a new schedule by Levy Flight Perturbation using Equations (31)–(34)
                       end if
               end if
              Calculate” current_fitness” the fitness value of the current new schedule using Equation (23)
              If current_fitness > best_fitness then
              best_schedule the current new schedule
              best_fitness the current_fitness
              end if
end for
      t = t + 1
end while
Return best_schedule