## 4 Proposed Solution
### Multi-Sensor Sampling  
#### 4.5.1 Finite Differences  
A fundamental attribute of the stochastic optimization algorithm is the 2D RSS gradient vector \(\overline{\
abla RSS}=(\
abla_{x}RSS,\
abla_{y}RSS)=(\frac{\partial RSS}{ \partial x},\frac{\partial RSS}{\partial y})\), which can be estimated using spatially-distributed RSS measurements from sensors on-board the relay robot. As our intention is to provide a sampling method that is both simple to implement (in different hardware platforms) and reliable to guarantee performance, we make use of multiple wireless transceivers as sensors to enhance reliability and redundancy in wireless networking and implicitly use the concept of multi-sensor spatial diversity to measure RSS gradients instead of methods, such as the least squares gradient estimation (LSGE) method [16; 19], search-based methods [46] and multi-antenna spatial diversity techniques [20; 23; 27]. Finite difference methods, such as forward finite differences (FFD), backward finite differences (BFD) and central finite differences (CFD) are typically used to estimate the gradient using measurements that are spatially distributed about a central point [38]. The RSS gradients are determined using four sensors distributed spatially around the center of the relay node to measure the RSS from the server and client nodes (\(RSS_{s}\) and \(RSS_{c}\)) at appropriate spacing, as shown in Figure 4. The setup also requires a benchmark RSS sample from both the server and client nodes (denoted as \(\overline{RSS_{c}}\) and \(\overline{RSS_{s}}\)) at the center of the relay node to determine the direction of change in the RSS. This benchmark value can alternatively be determined using interpolation of the RSS from four distributed sensors, provided they are positioned with geometrical symmetry. The RSS gradients of the client node \([\
abla_{x}RSS_{c},\
abla_{y}RSS_{c}]\) and of the server node \([\
abla_{x}RSS_{s},\
abla_{y}RSS_{s}]\) can be obtained using the derivative approximations with the CFD algorithm, as shown below:  
\[ \begin{split}\
abla_{x}RSS_{c}&=\frac{\partial RSS_{ c}}{\partial x}\doteq\frac{RSS_{c}(x+\Delta x,y)-RSS_{c}(x-\Delta x,y)}{2\Delta x}\\ \
abla_{y}RSS_{c}&=\frac{\partial RSS_{c}}{\partial y }\doteq\frac{RSS_{c}(x,y+\Delta y)-RSS_{c}(x,y-\Delta y)}{2\Delta y}\\ \
abla_{x}RSS_{s}&=\frac{\partial RSS_{s}}{\partial x }\doteq\frac{RSS_{s}(x+\Delta x,y)-RSS_{s}(x-\Delta x,y)}{2\Delta x}\\ \
abla_{y}RSS_{s}&=\frac{\partial RSS_{s}}{\partial y }\doteq\frac{RSS_{s}(x,y+\Delta y)-RSS_{s}(x,y-\Delta y)}{2\Delta y}\end{split}  \tag{17}\]  
where \(\Delta x\) and \(\Delta y\) are the spacing of the RSS sensors along the x- and y-axis, respectively, on the relay node. The sensors are placed at \((x+\Delta x,y)\),\((x-\Delta x,y)\),\((x,y+\Delta y)\) and \((x,y-\Delta y)\) with the benchmark sensor being at \((x,y)\) on the relay node in the CFD scheme. The authors in [38] show that the CFD method is more accurate than the FFD method, and in the CFD scheme, the stochastic error in gradient estimation is four-times lower than the FFD scheme. We have already experimentally proven this fact in our previous work [15] and have shown that the CFD algorithm had better performance than the FFD algorithm. Hence, we propose to use the CFD algorithm as a solution to Problem 3. Nevertheless, the FFD or the BFD algorithms can still be used for redundancy (see Section 4.5.2). To minimize errors due to noise in the gradient measurements, the gradient measurements are normalized as follows:  
\[ \begin{split}\|\
abla_{x}RSS_{c}\|&=\frac{\
abla _{x}RSS_{c}}{\sqrt{\left(\
abla_{x}RSS_{c}\right)^{2}+\left(\
abla_{y}RSS_{c} \right)^{2}}}\,;\|\
abla_{y}RSS_{c}\|=\frac{\
abla_{y}RSS_{c}}{\sqrt{\left( \
abla_{x}RSS_{c}\right)^{2}+\left(\
abla_{y}RSS_{c}\right)^{2}}}\\ \|\
abla_{x}RSS_{s}\|&=\frac{\
abla_{x}RSS_{s}}{ \sqrt{\left(\
abla_{x}RSS_{s}\right)^{2}+\left(\
abla_{y}RSS_{s}\right)^{2}}} \,;\|\
abla_{y}RSS_{s}\|=\frac{\
abla_{y}RSS_{s}}{\sqrt{\left(\
abla_{x}RSS_{ s}\right)^{2}+\left(\
abla_{y}RSS_{s}\right)^{2}}}\end{split}