## 4 Solution Method
### Coding Repair Strategy  
During the actual coding operation, there will be problems of individual coding conflicting with constraints, and these coding methods are invalid, which will lead to a large number of infeasible individuals in the evolutionary process of the population, reducing the convergence speed of the population and leading to a decrease in the efficiency of the algorithm search [36]. Therefore, whenever the coding changes, the population coding needs to be checked and repaired to ensure the validity of the individuals of the population and to improve the search efficiency of the solution space. The invalid coding repair strategy is as follows:  
Step 1: Calculate the final remaining reserves of each type of hazardous material \(\epsilon_{Ti}^{k}\gets y_{i}^{k}-\sum_{t=1}^{T}x_{tij}^{k}\) at each reserve point after the individual completed all periods of allocation tasks.  
Step 2: Check \(\epsilon_{Ti}^{k}\). If there exists \(i\in\{1,2,\ldots,n\}\) satisfying \(\epsilon_{Ti}{}^{k}<0\), it means that the individual has a conflict of reserve quantities at the reserve point. Select the period \(t^{\prime}\) when \(a_{i}\) allocates the least quantity in this type \(k\) of hazardous materials, and update \(x_{tij}{}^{k}=0\) and \(\epsilon_{Ti}^{k}\). Repeat this step until \(\epsilon_{Ti}{}^{k}>0\) for any reserve point \(a_{i}\).  
Step 3: Check the allocation risk of each road section in each period. If there exists \(t\in\{1,2,\ \ldots,T\}\) satisfying \((h_{ij}{}^{u}+h_{ij}{}^{l})\times\sum_{k=1}^{K}x_{tij}{}^{k}\geq\theta_{R}\), the allocation risk of this period on this road section is too high to accept. It is necessary to reduce the number of hazardous materials on this road section at this allocation. Randomly select a type of hazardous material \(k^{\prime}\) that satisfies \(x_{tij}{}^{k^{\prime}}>0\), and do \(x_{tij}{}^{k}\gets x_{tij}{}^{k}-1\). Repeat this step until \((h_{ij}{}^{u}+h_{ij}{}^{l})\times\sum_{k=1}^{K}x_{tij}{}^{k}<\theta_{R}\) exists on any road section.  
Step 4: Check the demand satisfaction of each period. \(\forall t=1,2,\ldots,T\), if there exist \(k\in\{1,\ldots,K\}\) and \(j\in\{1,\ldots,m\}\) satisfying \(\sum_{i=1}^{n}x_{tij}{}^{k}<c_{tj}{}^{k}\), it means that the demand for hazardous materials of type \(k\) at consumption point \(d_{j}\) is not satisfied within that period  
Figure 3: The structure of the individual \(P\).  
and additional allocation is required; then, choose randomly a reserve point \(a_{i}\) that satisfies \(x_{it^{*}j}^{k}<\epsilon_{it^{*}j}^{k}\), and complete  
\[x_{it^{*}j}^{k}\leftarrow\min\Bigl{\{}x_{it^{*}j}^{k}+(c_{tj}^{k}-\sum_{i=1}^{n} x_{it^{*}j}^{k}),\epsilon_{it^{*}k}\Bigr{\}} \tag{19}\]  
Similarly, if there exist \(k\in\{1,\ldots,K\}\) and \(j\in\{1,\ldots,m\}\) satisfying \(\sum_{i=1}^{n}x_{it^{*}j}^{k}<c_{tj}^{k}\), it means that the quantity of hazardous materials allocated in this period is too much, which causes waste of resources; then, randomly select a reserve point \(a_{i}\), meeting \(x_{it^{*}j}^{k}>0\), and complete  
\[x_{it^{*}j}^{k}\leftarrow\max\Bigl{\{}x_{it^{*}j}^{k}-(\sum_{i=1}^{n}x_{it^{*} j}^{k}-c_{t}^{k}),0\Bigr{\}} \tag{20}\]  
After each update of \(x_{it^{*}j}\), update \(\epsilon_{Ti}^{k}\) at the same time. Repeat this step until \(\sum_{i=1}^{n}\sum_{j=1}^{m}x_{it^{*}j}^{k}=c_{t}^{k}\) is established for demands at all consumption points.  
Step 5: Recheck \(\epsilon_{Ti}^{k}\) and allocation risks of each road section according to Step 2-4. If all conditions are met, the repair will be completed, otherwise go to the corresponding step of Step 2-4.