Research Article

Blockchain-Enhanced Fair Task Scheduling for Cloud-Fog-Edge Coordination Environments: Model and Algorithm

Algorithm 1

Connect sti with an appropriate access point ap.
Input: AP, sti, coverage, trust_threshold
Output: the matching of sti to an appropriate ap
(1)for each apj in AP do
(2)   Calculate the distance from sti to apj;
(3)   Calculate trust from sti to apj;
(4)   if (distancesti_apj ≤ coverage) && (truststi_apj ≥ trust_threshold) then
(5)    apj − > APcandidate
(6)   end if
(7)done
(8)for each apk in APcandidatedo
(9)   if ( distancesti_apk < min_distance) then
(10)    min_distance = distancesti_apk;
(11)    apchosen=apk;
(12)   end if
(13)done
(14)if apchosen! = NULL then
(15)  connect sti to apchosen;
(16)end if