## 4 RADC: Resource Allocation Based Data Classification
### Resource Allocation  
One of these solutions, which is very simple, efficient, and suitable for solving problems of allocation of limited resources between a set of independent activities, is that of Lagrange multipliers. The use of this technique does not guarantee that a solution will necessarily be found for all problems, but it is safe in the sense that any solution found by using them is a real solution [18]. To this end, the aim of this work is to optimize the resource allocation of the two selected classes of data by giving each of them an associated space taking into account two factors. The first one is the priority level of the space associated with data that is not important to the targeted network compared to the second space. The second factor is the frequency of requests received in each class. This is performed within the constraint of the maximum cache space in each router as formulated by the equation below:  
\[P\mid \begin{array}{cc}\max_{\vec{x}}&f(\vec{x})\\ \text{u.c}&g(\vec{x})=c\end{array}  \tag{5}\]  
Hence, our problem can be formulated as:  
\[P\mid \begin{array}{cc}\max_{C_{1},C_{2}}&f(C_{1},C_{2})\\ \text{u.c}&g(C_{1},C_{2})=\text{MaxC}\end{array}  \tag{6}\]  
where \(C_{1}\) and \(C_{2}\) represent, respectively, the space associated to the data that belong to the domain of the targeted network, and the second to the other data; \(Max\)C represents the maximum cache space in the router. The chosen objective function \(f(C_{1},C_{2})\) and the constrained \(g(C_{1},C_{2})\) that can give the best allocation to the two spaces are formulated according to:  
\[ \begin{array}{c}P\mid\begin{array}{c}\max_{C_{1},C_{2}}-\alpha C_{1}-\beta C _{2}^{k}\\ \text{u.c}\ C_{1}+C_{2}=\text{MaxC}\end{array}\end{array}  \tag{7}\]  
where \(\alpha\) and \(\beta\) represent, respectively, the frequency of requests that belong to the organization, and the requests that do not belong to the organization, These requests are classified using the Naive Bayes classifier. \(k\) represents the priority level of the space \(C_{2}\) with respect to the space \(C_{1}\), where the value of factor \(k\) takes the scale from 0.1 to 0.9 inspired from the work presented in [14]. The meaning of the scale is presented in Table 1 (Note: The values 0.2, 0.4, and 0.8 of the factor \(k\) mean that the importance of the space \(C_{1}\) in respect to \(C_{2}\) is situated between the two adjacent levels shown in the Table 1). The Lagrangian function associated with this program is written as shown below:  
\[L(C_{1},C_{2},\lambda)=-\alpha C_{1}-\beta C_{2}^{k}-\lambda(C_{1}+C_{2}- \text{Max}\,C) \tag{8}\]  
where \(\lambda\) is called the Lagrange multiplier associated with the constraint. \begin{table}
\begin{tabular}{c c} \hline
**Value** & **Meaning** \\ \hline
0.1 & The data in the \(C_{1}\) space have an obvious importance in the network compared to the \(C_{2}\) space. \\
0.3 & The data in the \(C_{1}\) space have a higher importance in the network compared to the \(C_{2}\) space. \\
0.6 & The data in the \(C_{1}\) space have a low importance in the network compared to the \(C_{2}\) space. \\
0.9 & The data in the \(C_{1}\) space have the same importance in the network compared to the \(C_{2}\) space. \\ \hline \end{tabular}
\end{table} 
Table 1: Meaning of the scale from 0.1 to 0.9. We obtain the desired spaces by calculating the derivatives of our variable as follows:  
\[\left\{ \begin{array}{l}\frac{\partial L}{\partial C_{1}}=0\Leftrightarrow-\alpha -\lambda=0\\ \frac{\partial L}{\partial C_{1}}=0\Leftrightarrow-\beta kC_{2}^{\frac{1}{2}-1 }-\lambda=0\\ \frac{\partial L}{\partial\lambda}=0\Leftrightarrow-C_{1}-C_{2}+\text{Max}\,C=0 \end{array} \right. \tag{9}\]  
Finally we obtain the two spaces \(C_{1}\) and \(C_{2}\), where \(C_{1}\) is equal to \(\left\lceil\text{Max}\,C-\left(\frac{\alpha}{k\beta}\right)^{\frac{1}{k-1}}\right\rceil\), and \(C_{2}\) is equal to \(\left\lfloor\left(\frac{\alpha}{k\beta}\right)^{\frac{1}{k-1}}\right\rfloor\).