(1) procedure RP-MR ( 𝐺 , 𝐿 / 2 , 𝑠 )
(2)  Orient tree-shaped topology into a directed case with the root 𝑠 ;
(3)  Compute 𝜅 𝑣 for each node 𝑣 using a bottom-up fashion;
(4)  Compute 𝐶 ( ) in a bottom-up fashion, where = { 𝑠 } ;
(5)  Compute 𝐶 ( 𝑣 ) for each node 𝑣 by using Lemma ( 6) in a top-down fashion;
(6)  Calculate the 𝑐 s a v e ( ) for the trajectories (shorter than 𝐿 ) that originate from node s by using Lemma ( 6), respectively;
(7)  Combine each pair of trajectories found in Step (6). Calculating the 𝑐 s a v e ( ) in the same way;
(8)  Computing the in-network data transmission cost 𝐶 ( o p t ) for the path with maximum 𝑐 s a v e from the compound paths set;
(9)  return 𝑝 o p t and 𝐶 ( o p t ) ;
(10) end procedure
Algorithm 1: RP-MR algorithm.