Output: CH is Selected with CH-ID;
Data: Input: Node-id, Weight
Result: CH Selection
Step     Deploy all the nodes;
Step    for    do
if    &&    then
Compute Behavior Level (Bl) // given by (6);
if ()
then
Declare as Malicious node and not allow then to
take part in CH selection
Else
Compute Waiting Time // given by (7);
Compute Degree of Connectivity // given by (8);
Compute Relative Mobility // given by (9)
end
end
Step   Compute Weight for current round // given (10);
Step    for    do
If ( ) // if weight of th node is greater
;
else
// node th not be a CH
end
Step    if    then
broadcast an advertisement message
//non-CH node join into the closest CH;
end
Algorithm 1: The proposed CH selection algorithm.