Input: (vehicle electability), (vehicle speed)
for (number of cluster members)
  if then
   j becomes CH
   
   break
  end if
end for
if then
  for
   
   for
    if then
     
    elseif then
     
    end if
   end for
   if then
     j becomes CH
    break
   end if
  end for
end if
Algorithm 1: Cluster head selection.