Skip to main content
. 2021 May 19;21(10):3523. doi: 10.3390/s21103523
Algorithm 1 Partial Offloading with Partitioning

Input: {m,γ,n,ri,ki,λi}

Output: {z*,op*}

  • 1:

    PR Matrix of possible partitions

  • 2:

    OP Matrix of possible offloading policies

  • 3:

    fork=1:MZido

  • 4:

        P(k)PR(k,:)

  • 5:

        for l=1:2i do

  • 6:

            e(l)OP(l,:)

  • 7:

            for j=1:i do

  • 8:

               if (e(j)=0) then

  • 9:

                   cost(j)flc using (18)

  • 10:

               else

  • 11:

                   cost(j)foc using (19)

  • 12:

               end if

  • 13:

            end for

  • 14:

            cost1(l)sum(cost)

  • 15:

        end for

  • 16:

        [index,cost2(k)]min(cost1)

  • 17:

        OP1(k)OP(index,:)

  • 18:

    end for

  • 19:

    [index,costminimum]min(cost2)

  • 20:

    op*OP1(index,:)

  • 21:

    z*PR(index,:)

  • 22:

    Save input data: input{m,γ,n,ri,ki,λi}

  • 23:

    Save output data: labels{z*,op*}

  • 24:

    Train the DNN: Trained_DNNtrain(input,labels)