Skip to main content
. 2019 Dec 24;20(1):122. doi: 10.3390/s20010122
Algorithm 2 Best-effort Algorithm
  • Input: 

    λi,μj,μm,τ1,τ2,τ3,Hi,B,σ,prj,prm;

  • Output: 

    x,P;

  • 1:

    for each i in I do

  • 2:

        for each j in J do

  • 3:

            allocate as many tasks of uei as possible to fnj till reach its capacity

  • 4:

        end for

  • 5:

        calculate Pi for each uei

  • 6:

    end for

  • 7:

    while the solution is infeasible do

  • 8:

        carry out the Best-effort strategy in fog level

  • 9:

        carry out the Best-effort strategy in MEC level

  • 10:

        if the solution is infeasible, decrease the xij with largest Pi unless xij becomes 0

  • 11:

    end while

  • 12:

    returnx,P