Skip to main content
. 2017 Apr 19;17(4):900. doi: 10.3390/s17040900
Algorithm 1 Relay Decision (RD) Algorithm for Forming Topology
1: input one value as the iteration time irt
2: For iS/{hub}
3: ri=hub; //initialize a star network topology
4: cad(i)=S/{i,hub}; //obtain relay candidates
5: End
6: While irt0
7: sort elements in S/{hub} into a queue Q in an ascending order of distance
8: While Q is not empty
9: pull out the head i of Q;
10: For jcad(i)
11: assume an established link(i,j) for transmission;
12: compute the optimized power Pi,jopt;
13: compute the candidate assessment function Seli,j;
14: End
15: choose node ri as the relay of i that satisfies Seli,ri=max{Seli,j} where jcad(i)
16: End
17: irt=irt1;
18: End