Skip to main content
. 2019 Mar 4;19(5):1105. doi: 10.3390/s19051105
Algorithm 1 Proposed ECTCO algorithm
Input:K,B,σ2,Tsmax,Gs.
ωk,dk,Hk,pktra,pkcir,fkl,fke,fkc,RkEC,kK.
Output:γ*.
  • 1:

    Initialize: compute P(k) by Gs and initialize all the matrices in Equation (22).

  • 2:

    solve the SDP problem Equation (22) without the rank-1 constraint to get its optimal solution G*.

  • 3:

    extract the first 3K elements from the last column of G* as γ.

  • 4:

    ifrank(G*)=1then

  • 5:

        construct γ* from γ.

  • 6:

    else

  • 7:

        for l=1 to L do

  • 8:

            generate random column vector ξlU(0,1).

  • 9:

            obtain random sample ξl by offloading probability based stochastic mapping method according to Equation (25).

  • 10:

            k=1;

  • 11:

            repeat

  • 12:

               if P(k)= then

  • 13:

                   RTk=0;

  • 14:

               else

  • 15:

                   compute RTk=maxjP(k)FTj;

  • 16:

               end if

  • 17:

               compute FTk by ξl and Equation (8);

  • 18:

               k=k+1;

  • 19:

            until k=K+1

  • 20:

            if FTK>Tsmax then

  • 21:

               discard the random sample ξl.

  • 22:

            else

  • 23:

               ξl as feasible solution ξ^(l),compute the energy cost by ξ^(l) and Equation (14) as E(l).

  • 24:

            end if

  • 25:

        end for

  • 26:

        choose the solution among ξ^(1),,ξ^(L) that yields the minimum energy cost: ξ*=argminξ^(l)E(l).

  • 27:

        compare ξ* with local computing only and cloud computing only solutions, update the one that yields the minimum energy cost as γ*.

  • 28:

    end if