# User-BS Selection Strategy Optimization with RSSI-Based Reliability in 5G Wireless Networks
## 4 Wireless BS Selection-Strategy Optimization Based on Identified Distribution  
First, the optimization problem is simplified. According to the calculation formula of \(RSSI(d)\), \(RSSI(d_{i}(x))\) is negatively correlated with \(\log_{10}d_{i}(x)\), so original optimization Problem (18) can be simplified to  
\[\min_{s\in\mathcal{S}}\iint\sum_{i=1}^{N}s_{i}(x)R_{BS}(i)\log_{10 }d_{i}(x)f(x)dx \tag{20}\] \[=\min_{s\in\mathcal{S}}\sum_{i=1}^{N}\iint s_{i}(x)R_{BS}(i)\log_{ 10}d_{i}(x)f(x)dx.\]  
The actual optimization objective of the above optimization problem is functional \(s\) instead of variable \(x\). The general idea of finding the extreme value of a functional is to construct a Lagrangian functional according to the Lagrangian multiplier theorem and then set the Frechet derivative of the Lagrangian functional to zero.  
Assuming a uniform distribution and that \(s_{i}(x)\) is fixed for all \(x\) locations, the optimization function is set to be:  
\[f(s)=\sum_{i=1}^{N}\iint_{\mathcal{C}}s_{i}R_{BS}(i)\log_{10}d_{i}(x)\frac{1}{ A_{\mathcal{C}}}dx. \tag{21}\]  
with constraints:  
\[\begin{split} g_{i}(s)=M\iint s_{i}(x)f(x)dx-N_{BS}(i)& \leq 0,\\ 1-\sum_{i=1}^{N}s_{i}(x)&=0,\end{split} \tag{22}\]for \(i=1,2,\ldots,N\) and \(x\
otin C_{i}\), where \(\mathcal{C}=\cup_{i=1}^{N}C_{i}\), \(A_{\mathcal{C}}\) represents the area of the region \(\mathcal{C}\). According to the Lagrangian multiplier theorem, the Lagrangian functional is:  
\[L(s,\alpha,\beta)=f(s)+\sum_{i=1}^{N}\alpha_{i}g_{i}(s)+\beta(1-\sum_{i=1}^{N}s _{i}(x)). \tag{23}\]  
The Frechet derivative operator \(L\) of Formula (23) is calculated, and KKT conditions (24)-(27) are solved:  
\[\
abla_{s_{i}}L(s,\alpha,\beta)=0, \tag{24}\]  
\[\alpha_{i}g_{i}(s)=0, \tag{25}\]  
\[\alpha_{i}>0, \tag{26}\]  
\[1-\sum_{i=1}^{N}s_{i}(x)=0, \tag{27}\]  
Then, we can obtain \(s_{i}=N_{BS}(i)/N\).  
The above method can only be applied to simple functionals. For more complex functionals, the commonly used functional optimization methods are variational methods and optimal control.  
Variational method is a branch of mathematics developed at the end of the 17 th century. It is a field of mathematics dealing with functions as opposed to ordinary calculus dealing with functions of numbers. The Euler-Lagrange (E-L) equation is the key theorem of the variational method that corresponds to the critical point of the functional. The E-L equation is only a necessary condition for the functional to have extreme values, but not sufficient. That is, when the functional has extreme values, the E-L equation holds.  
Classical variational theory can only solve the problem of unconstrained control, but most of the problems in engineering practice are control-constrained. Therefore, modern variational theory with optimal control as the research object appeared. Optimal control refers to seeking a control under given constraint conditions to allow for the given system performance index reach the maximal (or minimal) value. The main methods to solve the optimal control problem are the classical variational method, the maximal-value principle, and dynamic programming.  
The simplest form of variational method for a functional is:  
\[J[y(x)]=\int_{x_{1}}^{x_{2}}F(x,y(x),y^{\prime}(x))dx. \tag{28}\]  
In our optimization problem, \(F\) only depends on \(y\) and with no \(y^{\prime}\); at this time, \(F_{y}\equiv 0\), so Euler equation \(F_{y}(x,y)=0\) or \(F_{y}(y)=0\). This is a functional equation whose solution does not contain any constants. The solution of this function usually does not meet the boundary conditions, and the variational problem has no solution. It is difficult to directly calculate it through mathematical methods, so we attempted to use the most advanced method, optimal control algorithms, which combines modern theoretical ideas to help in solving problems such as dynamic programming, which is an efficient mathematical method for the study and optimization of multistage sequential decision-making problems such as resource allocation.