Research Article
MMW-NOMA: An Uplink NOMA Communication System Based on the Node Pairing Algorithm of Maximum and Minimum Weight in Underwater Acoustic Networks
Algorithm 1
The maximum and minimum weight-based pairing algorithm.
1: Procedure() | 2: Input:λ, η | //input the residual energy factor, distance factor | 3: For (i =0; i <20; i++) { | 4: | //calculate the Euclidean distance between node i and buoy B | 5: | //compute the pairing weight of node i | 6: Map.Add(, i); | //map node i and the corresponding pair weight | 7: } | 8: End for | 9: keyVlaues = map.getKeys(); | //calculate the weights of all mapped nodes; | 10: Sort(keyVlaues); | //order the node weight | 11: m =0 | //the pointer points to the minimum weight of the node | 12: n = arr.Length – 1 | //the pointer points to the maximum weight of the node | 13: While (m < n) do | 14: { | 15: Max = map.getValues(keyVlaues[n]) | //get the node of maximum weight | 16: Min = map.getValues(keyVlaues[m]) | //get node of minimum weight | 17: Nodes.Add()//add a node pair | 18: m++ | //move the pointer to the second smallest weight | 19: n-- | //move the pointer to the next highest weight | 20: } | 21: End while | 22: Output: //output the paired node pair nodes | 23: End procedure |
|