Research Article

An Intelligent Offloading System Based on Multiagent Reinforcement Learning

Algorithm 1

Loser Kuhn–Munkres Algorithm.
Input: calculate all vehicle-RSU pair matches using KM algorithm and the weight of vehicles pairing with RSUs’ weight; record the vehicle nodes that are not matched as the loser set.
 Output: updated pairs match
(1)Collect matched orders
(2)Initialize a directory challenge, arrays attacker, and challenger
(3)Travel across all the weights between Loser i and RSU j:
(4)If weight [Loser [i]] [j] > weight [match [j]] [j], then
(5) Challenge [Loser [i]] [j] = weight [Loser [i]] [j]]−weight [match [j]] [j]
(6) If Loser [i] is not in attacker, then
(7)  Attacker push (Loser [i])
(8) End if
(9) If j is not in attacker, then
(10)  Challenger push (Loser [i])
(11) End if
(12)End if
(13)Initialize a two-dimension array chaWeight
(14)Check if challenger j is in the challenge list of attacker i:
(15)If challenger [j] is not in Challenge [attacker [i]], then
(16) Challenge [attacker [i]] [challenger [j]] = 0
(17)End if
(18)chaWeight [i][j] = Challenge [attacker [i]] [challenger [j]]
(19)Calculate attacker-challenger pairs chaMatch with chaWeight by using KM algorithm
(20)For i = 1:challenger, do
(21) Match [challenger [i]] = attacker [chaMatch [i]]
(22)End for