/*Stage 1. Linear Expansion Algorithm (LE)       */
/*For a tail                     */
If  Priority == “ 𝑇 then /*Last robot in the line    */
if  Object detected   Object assigned sonar range limit then
  Stop driving;
   Search for RSSI of AP root 1 “ 𝑅 1 ”;
  until 𝑅 1 RSSI found;
  if 𝑅 1 RSSI assigned RSSI threshold limit then
    Stop driving;
   Drive straight;
Algorithm 3: The LE algorithm for a tail.