Research Article

Security and Cost-Aware Computation Offloading via Deep Reinforcement Learning in Mobile Edge Computing

Algorithm 1

DQN-based computation task offloading algorithm.
Begin
(1)Initialize the replay memory with a size of , the minibatch with a size of .
(2)for do
(3) At beginning of the th time slot, observe the system state
(4) Select an action randomly with probability or with probability 1 − 
(5) Offload the tasks according to action and observe the cost and the new system state at the next time slot .
(6) Store the transition experience into replay memory
(7) Randomly sample a minibatch of transition experience from replay memory
(8) Train the -network based on the loss function of the selected transition experiences
(9) Calculate the loss value between the current predicted value and the target value
(10)end for
(11)Record the set of optimal weights
End