Research Article

Location-Aware Source Routing Protocol for Underwater Acoustic Networks of AUVs

Algorithm 3

A simplified version of the algorithm used to merge the link data from the link cache and the tracking system. At the conclusion of the merge, contains the merged link table.
Links are sorted into ascending order of the node IDs of their endpoints.
   SORT-PREDICTED-LINKS ()
(2) SORT-CACHED-LINKS ()
    Initialize the temporary merged link table.
(3)
POP removes and returns the head element.
(4) POP( )
(5) POP( )
   Loop until both link tables are empty.
(6) while     or  
(7)  if     then
    They represent the same link. Choose one based on origin and age.
(8)   CHOOSE-LINK( )
(9)   POP( )
(10)  POP( )
(11) else if     then
(12)  
(13)    POP( )
(14)  else
(15)  
(16)   POP( )
(17)  end if
(18) end while