| Algorithm 3 Prioritized-based multiple contact-duration frame selection mechanisms (PMCdFS) algorithm. |
| Input: Initial deployed information of nodes and UAVs, , , . |
| Output: and |
| 1: for do |
| 2: Calculate the contact duration between and the (denoted as ), the (denoted as ), respectively; |
| 3: if then |
| 4: = ; |
| 5: else |
| 6: = ; |
| 7: end if |
| 8: end for |
| 9: return and ; |