| Algorithm 2 Levy-WOA workflow scheduling optimization algorithm |
| Input: task_list, allocation obtained from HEFT, Dag = (T, E), VM_list, pre data_size bandwidth population_size = 50, max_iterations = 200, = 0.01, = 1.5, = 1, = 0.5, = 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 using Equation (7) Obtain end time 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 of the workflow by Equation (11) Calculate 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 = 0 while do = rand(), = rand(). for each schedule in population do if < 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 in task_list: Obtain a new schedule by the spiral update in Bubble-net Attacking using Equations (29) and (30) else for task 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 = + 1 end while Return best_schedule |