| Algorithm 1: The routing mechanism. |
| Initialize (); |
| While xi. next_hop ! = source node |
| for xj in Ni do |
| calculate ce, ct, P; |
| nodes satisfy are saved in set ; |
| end for |
| if then |
| set to , ; |
| calculate the direct reward r; |
| select the node xj with maximum value in set Ni; |
| calculate (xi, ah),; |
| aj = argmax((xi, ah)); |
| else aj = argmax((xi, ah)) |
| end if |
| xi = xj |