Research Article

EER-RL: Energy-Efficient Routing Based on Reinforcement Learning

Algorithm 2

Cluster formation.
(1)For i ⟵ 1 to CHtot,do
(2)For j ⟵ 1 to n, do
(3)  
(4)  If, then
(5)   
(6)  End if
(7)End for
(8)End for
(9)For j ⟵ 1 to n, do
(10)If, then
(11)  
(12)Else
(13)  For i ⟵ 1 to CHtot,do
(14)   If, then
(15)    If, then
(16)     
(17)     Create Neigh (j,:)
(18)     
(19)    End if
(20)   End if
(21)  End for
(22)End if
(23)End for