# Resource Allocation for Network Slicing in RAN Using Case-Based Reasoning
## 3 Problem Formulation
To get the smallest reconstruction error, we use a least square loss function [22] as follows:  
\[\min_{\mathbf{W}}\sum_{i=1}^{m}||\mathbf{X}^{\mathrm{T}}\mathbf{w}_{i}-y_{i} ||_{2}^{2}=\min_{W}||\mathbf{X}^{\mathrm{T}}\mathbf{W}-\mathbf{Y}||_{F}^{2} \tag{5}\]  
\(||\mathbf{X}||_{F}^{2}=\left(\sum_{i}\left\|x_{i}\right\|_{2}^{2}\right)^{1/2}\) is the Frobenius norms of \(\mathbf{X}\). In this paper, we employ the following sparse objective function:  
\[\min_{\mathbf{W}}||\mathbf{X}^{\mathrm{T}}\mathbf{W}-\mathbf{Y}||_{F}^{2}+ \rho_{1}||\mathbf{W}||_{1}\mathbf{W}\succcurlyeq 0 \tag{6}\] \begin{table}
\begin{tabular}{c c} \hline \hline
**Weight Functions** & **Formula** \\ \hline inverse distance & \(\alpha(d)=1/d\) \\ \hline quadratic kernel & \(\alpha(d)=\begin{cases}\left(1-d^{2}\right),if\ |d|<1\\ 0,otherwise\end{cases}\) \\ \hline tricube kernel & \(\alpha(d)=\begin{cases}\left(1-\left|d\right|^{3}\right)^{3},if\ |d|<1\\ 0,otherwise\end{cases}\) \\ \hline variant of the triangular kernel & \(\alpha(d)=\begin{cases}\frac{1-\left|d\right|}{\left|d\right|},if\ |d|<1\\ 0,otherwise\end{cases}\) \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Weight functions. where \(||\textbf{W}||_{1}\) is an \(l_{1}\)-norm regularization term [23] to generate the sparse reconstruction coefficient, and \(\textbf{W}\succcurlyeq 0\) means that each element of **W** is nonnegative. The larger the value of \(\rho_{1}\), the more sparse is **W**. To make sure that the \(k\)-closest neighbors of the original data are kept in the new space after dimensional reduction, we impose the locality preserving projections (LPP) regularization term between the case library and themselves [24]. The case library \(\textbf{X}\in\mathbb{R}^{n\times d}\) is mapped to \(\textbf{Y}\in\mathbb{R}^{d\times m}\), a projection matrix is \(\textbf{W}\in\mathbb{R}^{n\times m}\), and \(y_{j}=\textbf{X}^{\text{T}}\textbf{w}_{j}\). As a result, LPP's objective function is as follows:  
\[\min_{\textbf{Y}=\textbf{X}^{\text{T}}\textbf{W}}\frac{1}{2}\sum_{i,j}^{d}s_{ ij}||y_{i}-y_{j}||_{2}^{2}=\min_{\textbf{W}}tr\Big{(}\textbf{W}^{\text{T}} \textbf{X}\textbf{L}\textbf{X}^{\text{T}}\textbf{W}\Big{)} \tag{7}\]  
Let \(s_{ij}\) denote the attribute similarity matrix. \(\textbf{S}=[s_{ij}]\in\mathbb{R}^{d\times d}\), which encodes the relationships between attributes. Let \(G\) denote a graph with \(d\) attributes. If nodes \(i\) and \(j\) are connected, we put \(s_{ij}=e^{-\frac{||y^{i}-y^{j}||^{2}}{2\sigma}}\), (\(\sigma\) is a tuning parameter constant). We use an adjacency matrix **S** to denote the attribute correlations graph. **D** is a diagonal matrix whose entries are column (or row, since **S** is symmetric) sums of **S**, \(\textbf{D}_{ii}=\sum_{j=1}^{d}s_{ij}\). \(\textbf{L}\in\mathbb{R}^{d\times d}\), \(\textbf{L}=\textbf{D}-\textbf{S}\) is the Laplacian matrix [25]. The proof is shown in Appendix A. Finally, the objective function for the reconstruction process can be defined as follows:  
\[f(\textbf{W})=\min_{\textbf{W}}(||\textbf{X}^{\text{T}}\textbf{W}-\textbf{Y} ||_{F}^{2}+\rho_{1}||\textbf{W}||_{1}+\rho_{2}tr\Big{(}\textbf{W}^{\text{T}} \textbf{X}\textbf{L}\textbf{X}^{\text{T}}\textbf{W}\Big{)},\textbf{W}\succcurlyeq 0 \tag{8}\]  
\(tr(\bullet)\) is the trace operator. We let Equation (8) take the first derivative with respect to \(\textbf{W}^{k}\), and then make it equal to 0 using the accelerated proximal gradient approach. The \(minf(\textbf{W})=s(\textbf{W})+r(\textbf{W})\). \(s(\textbf{W})\) is convex and differentiable as follows:  
\[\textbf{s}(\textbf{W})=\min_{\textbf{W}}(||\textbf{X}^{\text{T}}\textbf{W}- \textbf{Y}||_{F}^{2}+\rho_{2}tr\Big{(}\textbf{W}^{\text{T}}\textbf{X}\textbf{ L}\textbf{X}^{\text{T}}\textbf{W}\Big{)} \tag{9}\]  
\(\textbf{r}(\textbf{W})=\rho_{1}||\textbf{W}||_{1}\) is an \(l_{1}\)-norm regularization term [26]. Further let \(S(\textbf{W})=s(\textbf{W})_{1}+\rho_{2}s(\textbf{W})_{2}\).