Research Article

A Reputation Value-Based Task-Sharing Strategy in Opportunistic Complex Social Networks

Algorithm 2

Resource allocation based on the Lagrange multiplier method.
Input: the reputation value , the minimum computational resource of every device i, the total computational resource of the MEC server
Output: the deserved computational resource of every device i
(1)Begin
(2)For i = 1 to M
(3)//Calculate the authoritative decision factors
(4)End for
(5)//Construct Lagrangian function
(6)For each device i requesting for resource
(7)Calculate the partial derivative of with respect to
(8)If
(9)For i = 1 to M
(10)  
(11)End for
(12)End if
(13)Print
Stop