Node Scheduling for AF-Based Over-the-Air Computation

Over-the-air computation is a promising technique for efficiently aggregating data in sensor networks. This method requires that signals from all nodes arrive at the sink aligned in signal magnitude, which faces the reliability issue, especially in times of channel fading. To solve this problem, in this letter, we propose an amplify-and-forward based relay, Coherent Relay with Node Scheduling (CohR-NS), where a relay node is used to help forward signals of multiple nodes. Relay transmission power (TP) increases with the number of nodes using the relay, which is a bottleneck. We investigate how relay TP changes with relay position, and under the constraint of relay TP, study (i) how to select nodes to use relay when not all nodes requiring a relay can be supported simultaneously, (ii) how to select more nodes to use relay so as to reduce node TP, when there is a surplus in relay TP. We formulate this as an ILP (integer linear programming) problem, propose an efficient heuristic method, and confirm its effectiveness by simulation evaluation.

AirComp requires that signals from all nodes arrive at the sink simultaneously and be aligned in signal magnitude. However, this is difficult when some nodes face channel fading. Transmission power (TP) control [6], [7], which preamplifies signals, helps to partially solve this problem, but it alone cannot well deal with deep fading.
Among the methods [8] to improving the reliability of AirComp, one is CohRelay, an amplify-and-forward (AF) based relay method [9], where one relay node is used to help multiple nodes, forwarding their signals to the sink. It was shown that the relay TP increases with the number of nodes using relay, which becomes the bottleneck of the system. But the constraint of relay TP is not explicitly considered.
In this letter, we propose a Coherent Relay with Node Scheduling (CohR-NS) method to optimize computation mean squared error (MSE) of the AF-based AirComp. We start with the optimal solution where all nodes transmit their signals directly. Then, we use the relay to help nodes whose signal magnitudes are misaligned, and further study how to schedule fewer or more nodes to use the relay, according to relay TP. To the best of our knowledge, this is the first work on node scheduling for AirComp.
The contribution of this letter is three-fold, as follows: • We investigate how relay TP changes with relay position, which enables new policies for node scheduling. • We formulate node scheduling as an ILP problem and propose an efficient heuristic method. • We analyze and discuss the effectiveness, complexity, and optimality of the proposed scheduling method. Simulation evaluations confirm that the proposed method effectively reduces MSE meanwhile suppresses node TP.

II. RELAY MODEL FOR AIRCOMP
We consider a task of data aggregation in a sensor network consisting of K nodes, a sink d and a relay r, as shown in Fig. 1. Sink d collects data from all nodes and computes a function of these data, sum as an example in this letter. Nodes near the sink directly transmit their signals to the sink, but nodes far from the sink may experience deep channel fading. A This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ relay r is used to help these nodes, by forwarding an extra copy of their signals. In the transmission, both relay r and nodes face the constraint of maximal transmission power. Therefore, all nodes are divided into two groups. A node k ∈ N d will only directly transmit its signal to sink d while a node k ∈ N r will use relay r, besides the direct transmission. Here, N r ∪ N d = {1, 2, . . . , K }, and N r ∩ N d is empty. All nodes, relay r and sink d use a single antenna. The extension of this model to support multiple antennas at the sink is left as future work.
We assume that (i) channel coefficients, h k ,r ∈ C (C is the set of complex numbers) from node k to relay r, h k ,d ∈ C from node k to sink d, and h r ,d ∈ C from relay r to sink d, are constant within the period of transmission, and (ii) sink d knows all the channel coefficients. This assumption on the availability of channel coefficients is common in previous studies on AirComp [6], [7].
The whole transmission is divided into two slots, analogy to the conventional unicast AF method [10]. In the first slot, all nodes in N r simultaneously transmit their signals to relay r, and node k transmits a signal x k ∈ C, which has zero mean and unit variance (E{|x k | 2 } = 1, |x k | ≤ v ), using a Tx-scaling factor b k ,1 . After applying a Rx-scaling factor a r ∈ C, the computation result at relay r is In the second slot, all nodes, including both nodes in N r and those in N d , simultaneously transmit their signals to sink d, and node k uses a Tx-scaling factor b k ,2 . Meanwhile, relay r also forwards the signals (y r ) received in the first slot, using a Tx-scaling factor b r . Then, after applying a Rx-scaling factor a d ∈ C, the computation result at sink d is Here, n r and n d are additive white Gaussian noise with zero mean and variance being σ 2 . This result can be rewritten as where a r = a d h r ,d b r a r is the equivalent Rx-scaling factor for the relayed signals. The computation MSE is computed as the expectation of squared difference between y d and k x k , with respect to random signals (x k ) and noises (n d , n r ), as follows: where it is assumed that signals are uncorrelated and independent of noises. Because it is possible to adjust the phase of b k ,1 and b k ,2 to ensure that a r h k ,r b k ,1 and a d h k ,d b k ,2 are positive real numbers, for simplicity, it is assumed that d all belong to R + , the set of positive real numbers, in the analysis. The instantaneous TP, |b k ,i x k | 2 , i = 1, 2, should be no more than P , the maximal TP. Let P max denote P /v 2 . Then, we have |b k ,i | 2 ≤ P /v 2 = P max . A node k ∈ N d only transmits in the second slot, b k ,1 = 0 and |b k ,2 | 2 ≤ P max . A node k ∈ N r transmits its signal twice, and the overall TP constraint, |b k ,1 | 2 + |b k ,2 | 2 ≤ P max , is also applied. At the relay node, the power to transmit a signal x k is The selection of N r should both ensure k ∈Nr TxR k ≤ P max and minimize MSE. Then, the problem is how to find optimal parameters (a r , a d , b k ,1 , b k ,2 ) and node scheduling (N r ) that minimize MSE, under the power constraint, as follows:

III. SCHEDULING NODES TO USE RELAY
To solve the problem in (6), it is necessary to first decide N r , which is called node scheduling.

A. Initializing N r
Without relay, a r = 0, all nodes directly transmit their signals to the sink, and MSE is computed as follows, where b k and a are the Tx-and Rx-scaling factors, respectively. Then, the optimal Rx-scaling factor a = a 0 is computed by considering misalignment in signal magnitude [6], [7]. A straightforward relay method is to let nodes whose signals are misaligned form a set N r and the other nodes form a set N d .

B. Deciding Node Transmission Power
When using a relay, node k divides its TP into two parts, b k ,1 and b k ,2 , and transmits its signal twice. Sink d receives two copies of the same signal (one directly and the other via relay). With properly set parameters, the two copies are in phase and add constructively. This is called coherent relay, which helps to achieve larger signal magnitude with the same overall power. The signal magnitude is a sum of two parts, , so that the overall magnitude approaches 1.0. To effectively use node TP, it is necessary to properly compute b k ,1 and b k ,2 , under the constraint |b k , and the equality holds if and only if With |b k , In the basic method, with a d fixed to a 0 and the initial N r , other parameters a r , b k ,1 , b k ,2 will be computed by minimizing MSE r in (4). This method only tries to fill the gap in the magnitude of misaligned signals, and is called CohR-ZF (zeroforcing). It is not necessarily optimal. In addition, γ k (P max ) may still be less than 1 because of the constraint of relay TP.

C. Node Scheduling
Now look back at the TP consumed at the relay for a node k ∈ N r in (5). There are two cases to be considered.

1) Case (i):
When relay r is close to node k while far from sink d, h r ,d is small and h k ,r is large, which leads to large TxR k . The number of nodes that can be helped by the relay is small. So it is possible that not all nodes in N r can be helped.
We compute the reduced MSE for x k as the difference of MSE before and after using relay, The MSE for x k after using relay is 0, if γ k (P max ) is no less than 1.0. The required relay TP TxR k is computed by (5). Here both MSE k and TxR k are non-negative.
A flag I k is used to denote the node scheduling. I k = 1 indicates that node k ∈ N r uses the relay, and 0 otherwise. It is expected that MSE is reduced to the largest extent with the limited relay TP. Then, the node scheduling problem in case (i) is defined as follows: Then, all nodes with I k = 1 in N r forms a new N r . This is an ILP (integer linear programming) problem [11], which is NP-hard. Here we consider a heuristic method. Because relay TP is limited, it is expected that a large MSE k is achieved at the cost of a small TxR k . Hence, we compute as the metric for evaluating the priority of a node using relay. Nodes with low priority will be removed from N r to N d if the overall relay TP, k ∈Nr TxR k , is greater than the constraint.
2) Case (ii): When relay r is close to sink d, but far from node k, h r ,d is large and h k ,r is small. So TxR k tends to be small. In such cases, there is a surplus in relay TP after helping nodes whose signals are misaligned in the direct transmission. Nodes in N d do not need help to reduce MSE, but the TP at nodes may be large. Then, the remaining relay TP can be used to reduce node TP. By using a small amount of relay TP, we wish to reduce more node TP. Because the relay TP is limited, it is also necessary to decide which nodes to move from N d to N r first.
By using relay, the TP saved at node k is the difference before and after using relay, TxP k = b 2 k −(b 2 k ,1 +b 2 k ,2 ) ≥ 0, while the TP consumed at relay for node k is TxR k . Using I k to indicate whether node k ∈ N d uses the relay, node scheduling is defined as follows: Then, all nodes with I k = 1 in N d are moved to N r . This is also an ILP problem. Here, we consider a heuristic method, and compute as the metric. Obviously, a node with larger η k (η k > 1) should be given higher priority to use the relay, unless the constraint of relay TP is reached. The heuristic method to the ILP problem is not necessarily optimal. For the cases where |N r | or |N d | is no more than 16, we confirmed by brute force search that the heuristic metric in (13) is optimal with a probability 97.8% and the heuristic metric in (15) is optimal with a probability 74.6%.

D. Whole Algorithm
In order to use relay to reduce MSE more aggressively, it is necessary to adjust both a d and a r . But separately adjusting a d and a r may over reduce the noise and greatly increase node TP [9]. To focus on minimizing signal distortion, we choose to keep noise power fixed. In other words, a 2 d + (a r ) 2 = a 2 0 . Then, when switching a node from direct transmission to using relay, its signal magnitude, is a decreasing function of a d if h k ,r > h k ,d , which is the typical case. So signal distortion |1 − min(γ k (P ), 1)| decreases with a d until it reaches 0. If node TP is large enough, magnitudes of signals in N d remain 1.0, while the overall MSE decreases. But this requires larger node TP for the direct transmission, and more nodes will be removed from N d to N r . Under the constraint of relay TP, some nodes cannot use the relay, and the overall MSE will increase again. Therefore, we can gradually decrease a d from a 0 while increase a r from 0, so that MSE may reach a minimum. Although this is not necessarily the global minimum, it is so under most cases, and in the case of a local minimum, its difference from the global minimum is small.
Invoke ProcRelay (N r , h k ,r , h k ,d , a r , a d ), get b k ,1 8: Compute TxR k for k ∈ N r by (5) 9: if ( k ∈Nr TxR k >P max ) then Dec nodes in N r 10: Compute ξ k for k ∈ N r by (13) 11: Sort nodes in N r in increasing order of ξ k 12:  return a r , a d , MSE(a r , a d ) 29: end procedure 30: procedure PROCRELAY (N r , h k ,r , h k ,d , a r , a d )

38:
return MSE r 39: end procedure The whole process of finding optimal parameters and the corresponding computation MSE is described in Algorithm 1. With K nodes, the complexity is O(K 2 ) in AirComp. In Algorithm 1, finding the initial value a 0 by AirComp (line 2) takes the same computation. The computation costs of computing TxR (lines 7-8), decreasing nodes in N r (lines 9-12) and moving nodes from  Simulation scenario: 50 nodes (×) randomly distributed in a 400m × 200m area, 1 sink (♦, (100, 100)) and 1 relay ( , (250, 100)). Node deployment changes per evaluation.

IV. SIMULATION EVALUATION
Here, we evaluate the proposed method (CohR-NS), comparing it with the AirComp method [6] that only exploits the direct link, the SimRelay (when a node uses a relay, its direct transmission is neglected), and CohRelay method in [9]. SimRelay and CohRelay are modified so that the overall relay TP is no more than the constraint. The basic method only involving Sections III-A and III-B is named as CohR-ZF. The method that iterates over all possible a d to find global minimal MSE is called CohR-Opt. Fig. 2 shows the simulation scenario. 50 sensor nodes are randomly and uniformly distributed in a rectangle area (400m × 200m). The frequency is set to 2.4GHz. A hybrid free-space/two-ray path loss model is used and path loss is 80dB at a distance of 90m. Each link experiences independent block Rayleigh fading (channel gains are the same in two slots). It is assumed that the relay-sink link does not experience fading. As for the power setting, P max = 15dB, and P max · E{|x k | 2 } corresponds to 5dBm. When receiving signals, both sink d and relay r first amplify each signal to around the noise level (the strength of all signals is much greater than that of noise) for the A/D conversion and then amplify the signal in the digital domain to E{|x k | 2 } = σ 2 = 1 without affecting signal to noise ratio. In the evaluation, we mainly use MSE and average power as the metrics. Average power is computed as the ratio of the overall power (TP of all nodes and the relay plus receive power of the relay, for which, it is assumed that the relay consumes the same power for receiving and transmission for simplicity) to the number of nodes. The simulation is run for 500 times in the MATLAB environment and the average results are presented.
First we fix the sink position to (100, 100) and change the relay position along the line Y=100, from (125, 100) to (400, 100). The relay-sink distance changes from 25m to 300m accordingly. Fig. 3(a) shows the computation MSE in different methods. AirComp has the largest MSE, while SimRelay and CohRelay reduce MSE by using the relay. But it is obvious that their performance degrades when relay-sink distance increases. In comparison, CohR-ZF helps to reduce MSE in the long distance range, while CohR-NS further achieves the least MSE in the whole range. We also confirmed that the degradation of MSE in CohR-NS in comparison to CohR-Opt is only 0.05% and 0.28%, nearly optimal, when relay-sink distance is 150m and 200m, respectively.  There is a tradeoff between MSE and power consumption, and a low computation MSE is usually achieved at the cost of increased power. As shown in Fig. 3(b), average power increases a little in CohR-NS, compared with that in CohRelay. But it is still less than that in AirComp in the typical distance ranges, because using coherent relay helps to reduce node TP. Fig. 3(c) shows the number of nodes requiring or using relay in different methods. Unsurprisingly, when the relaysink distance increases, more power is required for helping each node, and the number of nodes using relay decreases in all relay methods. But more nodes can use the relay in CohR-NS than in other methods. It is this aggressive relay policy that helps CohR-NS to reduce MSE.
Next we evaluate the impact of the number of nodes in the network. The relay-sink distance is fixed to 150m, but the number of nodes is changed from 20 to 500. Computation MSE and average power are summarized in Table I. It is clear that MSE increases with the number of nodes, because it becomes difficult to align signal magnitude when there are more nodes. As a result, signal magnitude actually decreases, so nodes with large channel gain can save power, and the average power decreases. Compared with CohRelay, MSE reduction in CohR-NS is more than twice the increase in average power, which confirms that the proposed method is effective in reducing MSE while suppressing the increase of power consumption.

V. CONCLUSION
AirComp as a promising data aggregation method for future sensor networks faces the reliability issue. To address this problem, this letter enhances the AF based relay method for AirComp and proposes a new method for node scheduling, considering the constraint of relay TP and node TP. Simulation evaluations confirm that the proposed method is more effective than previous methods in reducing computation MSE meanwhile suppressing the increase of power consumption, and scales better with the number of nodes. In the future, we will further study the relay selection problem.