## 4 Proposed Solution
### Objective Function  
A simple function that satisfies the objective of simultaneously maximizing the RSS values from both the server and client nodes would be \(f(p_{r})=RSS_{c}(p_{r})+RSS_{s}(p_{r})\); however, this results in multiple optimum positions, each resulting in a sub-optimum solution. Thus, a different objective function that satisfies all of the constraints has to be chosen. For example, [PERSON] and [PERSON] [PERSON] and [PERSON] (1976) used \(f(p_{r})=min\{SNR_{c}(p_{r}),SNR_{s}(p_{r})\}\) as the objective function for a similar problem statement and adopted a least squares gradient estimation (LSGE) method for determining the gradient of the objective function and to deal with the non-smooth nature of the objective function. As our algorithm will rely purely on the spatial gradient approximation (using measurements), determining the gradients for solving a non-smooth objective function has many practical difficulties (Stein  
A stochastic gradient ascent (SGA) algorithm is used to recursively update the relay node's position based on the RSS gradients as follows:  
\[{x_{r}}^{i+1} =x_{r}^{i}+\gamma g_{x}(\vv{p}_{r}^{\star i}) \tag{11}\] \[{y_{r}}^{i+1} =y_{r}^{i}+\gamma g_{y}(\vv{p}_{r}^{\star i})\]  
The relay node's position vector \(\vv{p}_{r}^{\star i}=(x_{r}^{i},y_{r}^{i})\) is updated at every \(i{-}th\) iteration. \(\gamma\in\mathbb{R}_{+}\) is the learning rate (also called \"step size\"), whose value will be determined in real time in each iteration. The selection of this learning rate is crucial to obtain fast convergence [38] and should satisfy the conditions \(\sum_{i}\gamma_{i}=\infty\) and \(\sum_{i}\gamma_{i}^{2}<\infty\). The choice of the learning rate \(\gamma\) will be discussed in Section 4.5.1. The multi-variate gradient vector \(\vv{g}=(g_{x},g_{y})\) of the objective function is determined in the following way:  
\[g_{x}=\
abla_{x}f=\frac{\partial f}{\partial x}=\frac{\partial f }{\partial(RSS_{c})}\cdot\frac{\partial(RSS_{c})}{\partial x}+\frac{\partial f }{\partial(RSS_{s})}\cdot\frac{\partial(RSS_{s})}{\partial x} \tag{12}\] \[g_{y}=\
abla_{y}f=\frac{\partial f}{\partial y}=\frac{\partial f }{\partial(RSS_{c})}\cdot\frac{\partial(RSS_{c})}{\partial y}+\frac{\partial f }{\partial(RSS_{s})}\cdot\frac{\partial(RSS_{s})}{\partial y}\]  
\[\text{where, }\frac{\partial f}{\partial(RSS_{c})}=\frac{e^{RSS_{s}}}{e^{RSS_{c} }+e^{RSS_{s}}}\text{ and }\frac{\partial f}{\partial(RSS_{s})}=\frac{e^{RSS_{c}}}{e^{RSS_{c}}+e^{RSS_ {s}}} \tag{13}\]  
The above method is called the stochastic gradient ascent method, because the objective function \(f\) has both deterministic and stochastic parts, as it is a function of RSS (Section 3.1), and therefore, the stochastic gradient vector is \(\vv{g}(p_{r})=\vv{\
abla f}(p_{r})+\vv{\epsilon}\). The \(\vv{\epsilon}\) is the noise vector in the gradient measurements at every iteration. The RSS gradient vector \(\vv{g}\) is approximated by measurements at a single position of the relay node. Thus, we try to increase robustness and achieve fast convergence by using the concept of stochastic gradient ascent [39]. The SGA method requires that the objective function \(f(p_{r})\) is concave and the gradient \(g(p_{r})\) is locally Lipschitz continuous to guarantee convergence [37] and, thus, to reach the global optimum value. We show below how the convergence requirements for the SGA method are met. Proof for concavity: to prove that \(f\) is concave, it is necessary to show that the Hessian matrix (second-order partial derivatives) is negative semi-definite (NSD) (refer to Remark 2.2.11 in [40]). We have the Hessian matrix,  
\[H=\
abla^{2}(f)=\left[ \begin{array}{cc}\frac{\partial^{2}f}{ \partial x^{2}}&\frac{\partial^{2}f}{\partial x\partial y}\\ \frac{\partial^{2}f}{\partial y\partial x}&\frac{\partial^{2}f}{\partial y^{2 }}\end{array} \right]=\left[