# A Hybrid Brain Storm Optimization Algorithm to Solve the Emergency Relief Routing Model
## 5 Solving the ERRP Model Based on the Proposed Hybrid Algorithm
### Objective Function  
The objective function (or the total cost) consists of the total travel distance, the default costs, and the patients' deprivation costs. The total travel distance is the sum of the distance in each relief route. The default costs include the penalty cost of violating loading constraints and the penalty cost of breaking time window constraints. The patients' distress is the sum of the deprivation cost of each patient at the time they receive the relief operation. When calculating the objective function, a penalty factor is added to the relief routes and patients which violate the constraints to make each relief route satisfy the loading and time window constraints. The total cost of the relief solutions is calculated as follows:  
\[f(s)=c(s)+\alpha\times q(s)+\beta\times w(s)+dc(s) \tag{18}\]  
\[c(s)=\sum_{k=1}^{K}\sum_{i,j\in N}x_{ijk} \tag{19}\]  
\[q(s)=\sum_{k=1}^{K}\{\max\{(L_{0k}-C),0\}+\sum_{j\in N}\max\{\left[L_{j}-C-M \left(1-\sum_{i,j\in N}x_{ijk}\right)\right],0\}\} \tag{20}\]  
\[w(s)=\sum_{i=1}^{n}\max\{(l_{i}-b_{i}),0\} \tag{21}\]\[dc(s)=\sum_{i=1}^{n}DC(l_{i}-b_{i}) \tag{22}\]  
where \(s\) is the relief solution transformed from an individual, \(V=\{0,1,2,\cdots,n+1\}\) is the set of all nodes, including the patients and the emergency logistics center (the emergency logistics center at the start and end of each relief route is represented by 0 and \(n+1\), respectively), \(N=V\{0,n+1\}=\{1,2,\cdots,n\}\) is the set of patients obtained by deleting 0 and \(n+1\) from \(V\), respectively, \(i\) and \(j\) are the patient numbers, \(K\) is the set of relief vehicles, \(k\) denotes the vehicle number, \(L_{ok}\) is the loading of the relief vehicle \(k\) when it leaves the emergency logistics center, \(L_{j}\) is the loading of the relief vehicle after operating patient \(j\), \(x_{ijk}\) refers to whether vehicle \(k\) travels from patient \(i\) to patient \(j\), \(C\) is the maximum loading of the relief vehicle, \(M\) is a sufficiently large positive number, \(l_{i}\) denotes the time when the relief vehicle reaches the patient \(i\), \(b_{i}\) is the right time window for patient \(i\), \(DC\) is a function for calculating the deprivation cost, \(f(s)\) is the objective function of the current relief solution, which consists of the total travel distance, default cost, and deprivation costs, \(c(s)\) is the total travel distance by relief vehicles, obtained by accumulating the distances between adjacent nodes in each relief route, \(q(s)\) represents the sum of the loading constraints violated by each relief route, obtained by comparing the loading of the relief vehicle after serving each patient with the maximum loading, \(w(s)\) denotes the sum of the violated patients' time window constraints, obtained by comparing the time when the relief vehicle reaches the patient with the patient's left time window, and \(dc(s)\) refers to the sum of patients' deprivation costs, obtained by accumulating the deprivation cost of each patient at the time of receiving relief.