Research Article

Markov Approximation for Task Offloading and Computation Scaling in Mobile Edge Computing

Algorithm 1

The Markov approximation-based algorithm.
(1)The following procedures execute on the MD.
(2)procedure Initialization
(3)  for do
(4)   , and ,
(5)   Randomly assign m to the MD (i.e., ) or a MEC server (i.e., )
(6)  end for
(7)  Randomly pick a feasible from
(8)  Transit to STAGE 1
(9)end procedure
(10)procedure Stage 1: Wait (m)
(11)  Generate an exponentially distributed timer with mean equal to γ
(12)  Begin counting down by
(13)end procedure
(14)procedure Stage 2: Hop (m)
(15)  If expires then
(16)   Send RESET signals to , .
(17)   Generate a new configuration by randomly selecting another feasible device for m
(18)   if the target device is the MD then
(19)    , and ,
(20)    Randomly pick another feasible from
(21)   else if the target device is a MEC server then
(22)    , , and ,
(23)   end if
(24)   Migrate to the new configuration by the probability of
(25)   end if
(26)end procedure
(27)procedure Stage 3: Reset (m)
(28)  if does not expire and m receives a RESET message then
(29)   Terminate its current countdown timer
(30)   Transit to STAGE 1
(31)  end if
(32)end procedure