## 5 Solving Method  
Since the decision-making process of the NMG optimization model built in this paper is divided into two stages, and the objective function includes the binary variables \(\beta_{mpkn}\) and \(bl_{ijn}\) and the continuous variable \(sl_{in}\), this problem is essentially a multi-stage mixed-integer stochastic programming problem. The information about the damage scenario is uncertain, which makes it difficult to solve the problem in a short period of time. Refs. [32; 33] use the common approach of scenario generation to represent information uncertainty, which involves generating a predetermined number of scenarios with corresponding probabilities and uncertainty parameters. The uncertain parameters in this paper include the location of damaged lines, the priority weight of nodes, etc. The progressive hedging algorithm has been proven to be an effective method for solving multi-stage stochastic programming problems [25; 34], especially for problems with discrete decision variables at each stage [35]. Therefore, this algorithm is implemented in the Gurobi solver to solve the proposed two-stage stochastic programming problem based on scenario generation. The stochastic programming model in this paper can be summarized in the following form:  
\[\min_{x,y}TC=c^{T}x+\sum_{\omega\in\Omega}\Pr(\omega)d^{T}_{\omega}y_{\omega} \tag{25}\]  
\[\text{s.t. }(x,y_{\omega})\in Q_{\omega},\forall\omega\in\Omega \tag{26}\]  
where the decision vector \(x\) denotes the first-stage variables which represent the \"here and now\" decisions, such as the pre-positioning decisions (\(\alpha_{mp}\)) and capacity purchasingschemes of MES devices (\(G_{m}\)), and \(y_{\omega}\) denotes the second-stage variables which represent the \"wait and see\" recourse actions determined by a given \(x\) and a certain scenario \(\omega\), such as the re-allocation decisions (\(\beta_{mpkn}\)) and switch operation schemes of boundary lines (\(bl_{ijn}\)). Vectors \(c\) and \(d_{\omega}\) denote the coefficients corresponding to the aforementioned variables, and \(\Omega\) is the set of scenarios. Restriction (26) represents the feasible region of decision variables \(x\) and \(y_{\omega}\) in scenario \(\omega\) with some constraints, i.e., Constraints (2)-(23). With the non-anticipativity constraints (29) enforcing the first-stage decision in every scenario being the same, the primary problem can be equivalently transformed to (27) and (28) to utilize duality theory. \[\min_{x_{\omega},y_{\omega}}TC=\sum_{\omega\in\Omega}\Pr(\omega)(c^{T}x_{ \omega}+d_{\omega}^{T}y_{\omega}) \tag{27}\]  
\[\text{s.t. }(x_{\omega},y_{\omega})\in\mathcal{Q}_{\omega},\forall\omega\in\Omega \tag{28}\]  
\[x_{1}=\cdots x_{\omega},\forall\omega=1,\ldots,|\Omega| \tag{29}\]  
Based on duality theory, the best lower bound can be obtained by solving the following problem:  
\[TC\geq\max_{\delta}\left\{\min_{x,\hat{x},y}\sum_{\omega\in\Omega}\Pr(\omega )(c^{T}x_{\omega}+d_{\omega}^{T}y_{\omega}+\delta^{T}(x_{\omega}-\hat{x})+ \rho/2\parallel x-\hat{x}\parallel_{2}^{2})\right\} \tag{30}\]  
\[\text{s.t. }\sum_{\omega\in\Omega}\Pr(\omega)\delta_{\omega}=0,(x_{\omega},y_{ \omega})\in\mathcal{Q}_{\omega},\forall\omega\in\Omega \tag{31}\]  
where \(\hat{x}\) is a new vector variable of first-stage decisions for finding a solution with the same constraints, and \(\rho\) is a penalty parameter. The steps of PHA are described in Algorithm 1.