| Input: AOI and Rc |
(1) | Begin |
(2) | Find ()//i = 1, 2, 3, …. number of neighbors |
(3) | Check for PC = physical constraint |
(4) | If PC = true |
(5) | Send (owned ID, CM)//CM = cannot move |
(6) | Go to (step 48) |
(7) | End if |
(8) | If receive (some IDs, CM) |
(9) | Update (some IDs, CM)//in neighbor’s list |
(10) | End if |
(11) | If |
(12) | Compare (owned ID with IDs) |
(13) | End if |
(14) | If owned ID > all IDs |
(15) | Send (owned ID, distribution admin) to rest of neighbors |
(16) | Calculate (distance with each neighbor) |
(17) | If all neighbors’ distances = |
(18) | End if |
(19) | If distance < |
(20) | Send (move away)//to maintain distance |
(21) | End if |
(22) | End if |
(23) | Else |
(24) | Send (calculate possible movement distance)//to those neighbors whose distance is > |
(25) | Wait |
(26) | Receive (possible movement distances of all neighboring nodes) |
(27) | Calculate (actual distance—possible distance to move)//to find out which node can maintain |
(28) | Send (adjust, distance to move) |
(29) | End if |
(30) | If receive (move away) |
(31) | Move//to maintain |
(32) | Else if receive (calculate possible movement distance) |
(33) | If distribution admin >1 |
(34) | Send (CM)//to distribution admins |
(35) | Else |
(36) | Calculate (possible movement distance)//keeping in mind d and by averaging possible movement distance of each neighboring node |
(37) | Send (adjustable distance)//to distribution admin |
(38) | End if |
(39) | End |
(40) | Else if receive (adjust, distance to move) |
(41) | Move//to adjust that |
(42) | End if |
(43) | Update all neighboring node distances (di) |
(44) | If all |
(45) | Go to (step 36) |
(46) | End if |
(47) | Else if all di = Rc/2 |
(48) | Determine directional matrix = DM |
(49) | End if |
(50) | End |
(51) | Determine DM |
(52) | If DM = LN//leaf node |
(53) | Go to (step 66) |
(54) | Else if DM = IN//intermediate node |
(55) | Go to (step 64) |
(56) | Else if DM = CV//CV = cut-vertex |
(57) | Check availability of four recovery nodes |
(58) | If availability = false |
(59) | Go to (step 64) |
(60) | If availability = true |
(61) | Set at least four neighboring nodes as recovery nodes |
(62) | End if |
(63) | End |
(64) | Set at least two neighboring nodes as recovery nodes |
(65) | If availability of two nodes = false |
(66) | Set at least one neighboring node as recovery node |
(67) | End if |
(68) | End |