Research Article
EER-RL: Energy-Efficient Routing Based on Reinforcement Learning
Algorithm 1
Network set-up and cluster head election algorithm.
| (1) | For i ⟵ n, do | | (2) | S(i).dist ⟵ Euclidean(S(i), sink) | | (3) | | | (4) | | | (5) | End for | | (6) | While length (CHtable) ≤ CHtot,do | | (7) | | | (8) | For i ⟵ 1 to n, do | | (9) | If, then | | (10) | If, then | | (11) | | | (12) | | | (13) | Else | | (14) | For , do | | (15) | | | (16) | If, then | | (17) | C ⟵ True | | (18) | Else | | (19) | C ⟵ False | | (20) | Break | | (21) | End if | | (22) | End for | | (23) | If C = = True, then | | (24) | | | (25) | | | (26) | End if | | (27) | End if | | (28) | End if | | (29) | End for | | (30) | End while |
|