## 3 The RNN-Based Algorithm for Resource Allocation
### Task Assignment Algorithm Based on the RNN Model
Here, each possible assignment decision \((r,v)\) is represented by a neuron, \(N(r,v)\), and a list of symbols used for the approach is summarized in Table 2.  
The excitatory and inhibitory signals' arrival rates of each neuron, \(N(r,v)\), are specified so that the RNN can be used for the heuristic solution to optimization problems [27]. Hence, we represent the external rate of excitation and inhibition as:  
\[\Lambda(r,v)=max\{0,b(r,v)\}\qquad\lambda(r,v)=max\{0,-b(r,v)\}\] \[\text{Minimize }C=\sum_{v\in V}\sum_{r\in R}C(r,v)p(r,v)+\sum_{v\in V}K(v) \prod_{r\in R}\{1-(1-L(r,v))p(r,v)\} \tag{13}\]0  
where \(K(v)(1-L(r,v))\) is the expected reduction in the penalty of not rescuing victim \(v\) if rescuer \(r\) has been dispatched to save it, and \(C(r,v)\) is the cost of triggering rescuer \(r\) to save victim \(v\). \(b(r,v)\) can be viewed as a characteristic of the neuron, \((r,v)\), where \(b(r,v)>0\) if this allocation could minimize the overall cost of task assignments and \(b(r,v)\leq 0\) if not. That is, if the expected reduction in the cost of not  
\begin{table}
\begin{tabular}{c l} \hline \hline
**Notation** & **Definition** \\ \hline \(K(v)\) & Penalty for not rescuing victim \(v\) \\ \(L(r,v)\) & Probability rescuer \(r\) is unable to rescue victim \(v\) \\ \(C(r,v)\) & Cost for saving victim \(v\) by rescuer \(r\) \\ \(\Lambda(r,v)\) & External arrival rate of excitatory signals to neuron (\(r\), \(v\)) \\ \(\lambda(r,v)\) & External arrival rate of inhibitory signals to neuron (\(r\), \(v\)) \\ \(w^{+}(r,v;r^{\prime},v^{\prime})\) & Rate of excitatory signals to neuron (\(r\), \(v\)) from firing neuron (\(r^{\prime}\), \(v^{\prime}\)) \\ \(w^{-}(r,v;r^{\prime},v  
saving victim \(v\) is larger than the cost of allocating rescuer \(r\) to victim \(v\) (i.e., \(b(r,v)>0\)), then we think this assignment is efficient, while if not, then this allocation will not be executed. Moreover, in order to avoid resource wastage [45], we discourage the allocation of more than one rescuer to the same victim; thus, we set the inhibitory weights [27]:  
\[\text{Minimize }C=\sum_{v\in V}\sum_{r\in R}C(r,v)p(r,v)+\sum_{v\in V}K(v) \prod_{r\in R}\{1-(1-L(r,v))p(r,v)\} \tag{13}\]1  
which indicates that if the allocation of rescuer \(r\) to victim \(v\) is able to minimize the objective function (i.e., \(b(r,v)>0\)), the allocations of other rescuers to the same victim should be discouraged, otherwise (\(b(r,v)\leq 0\)); this allocation should have no effect on other assignments (\(w^{-}(r,v;r^{\prime},v)=0\)). Similarly, we wish to avoid assigning more than one victim to the same rescuer:  
\[\text{Minimize }C=\sum_{v\in V}\sum_{r\in R}C(r,v)p(r,v)+\sum_{v\in V}K(v) \prod_{r\in R}\{1-(1-L(r,v))p(r,v)\} \tag{13}\]2  
For the sake of simplicity, we are not reinforcing or impairing the other assignments [27], so that \(w^{+}(r,v;r^{\prime},v^{\prime})=0\) and \(w^{-}(r,v;r^{\prime},v^{\prime})=0\) for all other \(r\), \(r^{\prime}\) and \(v\), \(v^{\prime}\). Hence, we rewrite Equation (8):  
\[\text{Minimize }C=\sum_{v\in V}\sum_{r\in R}C(r,v)p(r,v)+\sum_{v\in V}K(v) \prod_{r\in R}\{1-(1-L(r,v))p(r,v)\} \tag{13}\]3  
Equation (11) is then rewritten:  
\[\text{Minimize }C=\sum_{v\in V}\sum_{r\in R}C(r,v)p(r,v)+\sum_{v\in V}K(v) \prod_{r\in R}\{1-(1-L(r,v))p(r,v)\} \tag{13}\]4 \[\text{Minimize }C=\sum_{v\in V}\sum_{r\in R}C(r,v)p(r,v)+\sum_{v\in V}K(v) \prod_{r\in R}\{1-(1-L(r,v))p(r,v)\} \tag{13}\]5  
When there are civilians who are trapped in hazardous areas, the rescuers will be notified by the sensor network in the DBES multi-agent environment. Next, Equation (17) is solved iteratively until convergence in the following manner (Algorithm 1) to obtain an optimal assignment of rescuers to victims. In the algorithm, \(R\) is the original set of rescuers and \(R_{rem}\) is the set of remaining rescuers. \(S\) is the solution set where the assigned rescuer-victim pairs are stored [27], and \(K_{cur}(v)\) is the current penalty of victim \(v\), which will be updated if victim \(v\) is allocated a rescuer.