|
Algorithm 1 Relay Decision (RD) Algorithm for Forming Topology |
| 1: input one value as the iteration time
|
| 2: For
|
| 3: ; //initialize a star network topology |
| 4: ; //obtain relay candidates |
| 5: End
|
| 6: While
|
| 7: sort elements in into a queue in an ascending order of distance |
| 8: While
is not empty |
| 9: pull out the head of ; |
| 10: For
|
| 11: assume an established link for transmission; |
| 12: compute the optimized power ; |
| 13: compute the candidate assessment function ; |
| 14: End
|
| 15: choose node as the relay of that satisfies where
|
| 16: End
|
| 17: ; |
| 18: End
|