Research Article

ReLeC: A Reinforcement Learning-Based Clustering-Enhanced Protocol for Efficient Energy Optimization in Wireless Sensor Networks

Algorithm 2

Cluster formation.
for head in len(CHtotal), do
for each node i, do
  set distCH(node i; CH head) =Euclidean
if distCH, then
   CH head invites node i
  end
end
for each node , do
if , then
  set node ’s destination =
else
  for in len, do
   if invites , then
    if distCH
    min, then
    set node ’s destination =
     create
     add node to Cluster
     end
  end
for each node , do