## 3 The RNN-Based Algorithm for Resource Allocation
### The Random Neural Network Model  
The RNN can solve the optimization problem of allocating a set of tasks to a limited set of resources simultaneously very quickly and quite accurately [3], and the basic ideas for the RNN model purposed in [29, 30] are shown below.  
The main symbols used for the RNN model are summarized in Table 1, and an application of one earlier result (Theorem 1) proposed in [46] is being used.  
Let \(\lambda^{-}(i)\) and \(\lambda^{+}(i)\), \(i=1,...,N\) be given by the following system of equations  
\[\lambda^{-}(i)=\lambda(i)+\sum_{j=1}^{N}f_{j}q_{j}p^{-}(j,i) \tag{1}\]  
\begin{table}
\begin{tabular}{c l} \hline \hline
**Notation** & **Definition** \\ \hline \(f_{i}\) & Firing rate for neuron \(i\) \\ \(k_{i}(t)\) & Internal state of neuron \(i\) at time \(t\) \\ \(\Lambda(i)\) & Excitatory spike from the outside world to neuron \(i\) \\ \(\lambda(i)\) & Inhibitory spike from the outside world to neuron \(i\) \\ \(p^{+}(i,j)\) & Probability of excitatory spike from neuron \(i\) to neuron \(j\) \\ \(p^{-}(i,j)\) & Probability of inhibitory spike from neuron \(i\) to neuron \(j\) \\ \(d(i)\) & Probability of departure spike from neuron \(i\) to the outside world \\ \(q_{i}\) & Probability of neuron \(i\) being excited \\ \(\pi(\underline{\xi})\) & Stationary probability distribution \\ \hline \hline \end{tabular}
\end{table}
Table 1: List of the random neural network (RNN) training model symbols [3].  
\[\lambda^{+}(i)=\Lambda(i)+\sum_{j=1}^{N}f_{j}q_{j}p^{+}(j,i) \tag{2}\]  
_where_  
\[q_{i}=\lambda^{+}(i)/(f_{i}+\lambda^{-}(i)) \tag{3}\]  
_If a unique nonnegative solution, \(\{\lambda^{-}(i),\lambda^{+}(i)\}\), exists for the nonlinear system of Equations (1) to (3), such that \(q_{i}<1\ \ \forall i\), then_  
\[\pi(\underline{k})=\prod_{i=1}^{N}(1-q_{i})q_{i}^{k_{i}} \tag{4}\]  
The network will have a solution if \(q_{i}<1\): this guarantees that the total arrival rate is less than the total departure rate, so that the network will be finally in steady state. According to the definition of \(p^{+}(i,j)\), \(p^{-}(i,j)\) and \(d(i)\) in Table 1, we have a relationship between three different types of probabilities.  
\[d(i)=1-\sum_{j=1}^{N}\left[p^{+}(i,j)+p^{-}(i,j)\right] \tag{5}\]  
We now use notation \"weight\" [47] to represent the rates at which the neurons interact [3], and the weights are defined as a simple product form of the firing rate and its corresponding probability.  
\[w^{+}(i,j)=f_{i}p^{+}(i,j) \tag{6}\]  
\[w^{-}(i,j)=f_{i}p^{-}(i,j) \tag{7}\]  
By combining Equations (5) to (7), we can rewrite Equation (5):  
\[f_{i} = \frac{f_{i}\sum_{j=1}^{N}\left[p^{+}(i,j)+p^{-}(i,j)\right]}{1-d( i)}\] \[f_{i} = \frac{\sum_{j=1}^{N}\left[w^{+}(i,j)+w^{-}(i,j)\right]}{1-d(i)} \tag{8}\]  
The denominator of \(q_{i}\) in Equation (3) can then be rewritten by combining Equations (1) and (7):  
\[D(i) = f_{i}+\lambda^{-}(i)\] \[D(i) = f_{i}+\lambda(i)+\sum_{j=1}^{N}f_{j}q_{j}p^{-}(j,i)\] \[D(i) = f_{i}+\lambda(i)+\sum_{j=1}^{N}q_{j}w^{-}(j,i) \tag{9}\]  
By combining Equations (2) and (6), its numerator becomes:  
\[N(i) = \lambda^{+}(i)\] \[N(i) = \Lambda(i)+\sum_{j=1}^{N}f_{j}q_{j}p^{+}(j,i)\] \[N(i) = \Lambda(i)+\sum_{j=1}^{N}q_{j}w^{+}(j,i) \tag{10}\]\[\text{so that }\quad q_{i}=N(i)/D(i) \tag{11}\]  
The results can be used to design an efficient learning algorithm by updating the weights of all neurons and then selecting a neuron that has the largest \(q\).