# Resource Allocation for Network Slicing in RAN Using Case-Based Reasoning
## 2 System Model  
### General Model  
The virtualization of the cell from [13; 14], is shown in Figure 1. The model used for the research here considers a single-cell self-organization allocation as a first step. In the single cell approach, the entire 360\({}^{\circ}\) plane is equally divided into \(a\) sectors with \(b\) bands, yielding \(a\times b\) segments.By dividing the entire cell area into different segments, user locations can be mapped to virtual cells. Different cases are formed according to the distribution of users in each segment at each different snapshot. The interference from adjacent cells is considered in the mapping [13]. Initially, a two-slice scenario is considered, where each segment may contain slice1 users (S1) and slice2 users (S2) at the snapshot; \(|S1|\) and \(|S2|\) denote the number of \(S1\) and \(S2\) users, respectively. The slice ratio is defined as \(\omega\) and \(1-\omega\) for S1 and S2, respectively, where \(\omega\) is the fraction of total resource \(W\), and at the snapshot, we assume that the ratio will not change [14]. For a user \(u\) to be qualified, the bitrate of that slice user \(r_{u}\) must be greater or equal to its minimum requirement \(r_{u,min}\). The rate of slice user \(u\) is defined as \(r_{u}=\sum_{f=1}^{F}a_{f,u}r_{f,u}\geqslant\)\(r_{u,\min}\), where \(f\in\mathcal{F}=\{1,2\ldots F\}\) is the set of resource block (RB), when the RB \(f\) is assigned to user \(u\), \(a_{f,u}=1\), otherwise \(a_{f,u}=0\). From the well-known Shannon equation, the capacity contributed by RB \(f\) is  
\[r_{f,u}=B\log_{2}(1+\frac{P_{l}\!^{f}g_{h,u}\!^{f}}{\sigma^{2}+\sum_{l\in \mathcal{H},l\
eq h}P_{l}\!^{f}g_{l,u}\!^{f}}) \tag{1}\]  
where \(h\in\mathcal{H}=\{1,2\ldots H\}\), \(\mathcal{H}\) is denoted a set of base station (BS). \(B\) is the bandwidth of RB. \(\sigma^{2}\) is the noise power; \(g_{h,u}\!^{f}\) denotes the channel gain between the BS \(h\) and user \(u\) by RB \(f\), \(P_{h}\!^{f}\) is the transmit power of BS \(h\) by RB \(f\), \(l\) is the surrounding cells. \(P_{l}\!^{f}\) is the transmit power of BS \(l\) by RB \(f\), \(g_{l,u}\!^{f}\) denotes the channel gain between the BS \(l\) and user \(u\) by RB \(f\). A set of UEs is denoted as \(\mathcal{N}=\{1,2\ldots N\}\). The qualified user ratio over all slices for each cell is as follows:  
\[QUR=\frac{\sum_{u=1}^{n}q_{u}}{|S1|+|S1|} \tag{2}\]  
where \(q_{u}\) is a binary variable that represents the indicator of qualified user \(u\). \(n\in\mathcal{N}\). \(q_{u}\in\{0,1\}\), \(q_{u}=1\), if \(r_{u}\geqslant\delta_{s}\), otherwise \(q_{u}=0\). The \(r_{u}\) is the data rate of user \(u\). \(\delta_{s}\) is the rate requirement of slice \(s\in\{1,2\}\). The overall approach is to match the query case (a new case) to the values in the case library by CBR, as shown in Figure 2, by comparing the attributes of the query case to the cases in the library and determining their degree of match. The best matches are used to determine the slice ratio to be used for that query case. The advantage of CBR as a technique is that it can constantly enrich the case library to reduce the prediction error. The standard work process of CBR is introduced in [15]. The four main processes are _retrieve, reuse, revise,_ and _retain_. The matching process described above is the retrieve process and if a suitable match is found and its corresponding case solution can be used for the reuse by reassour allocation (RA). If a suitable solution for the new query cannot be found, a case revision needs to be carried out, which can be performed by exhaustive search. The revised case can be retained in the case library to enrich the samples. The O-KNN is utilized in the retrieve stage. Distance measurement and \(k\) value selection are two key factors of KNN. Distance measurement is determined by Euclidean distance. The \(k\) value is determined by least square, spare learning, and locality preserving projections. To speed up the retrieval, brute force was applied. Root mean square error  
Figure 1: Schematic of slice user distribution.