## 4 Brown-Field Migration Aware Routing and Spectrum Assignment Algorithm
### Brown-Field Migration Aware Routing and Spectrum Assignment Algorithm  
Based on the constructed probabilistic migration label model, we proposed a _PML-based BMA-RSA_ algorithm to provide migration-aware dynamic connection provisioning before network migration begins in optical networks, evolving from fixed-grid to flex-grid, which can greatly reduce the interruption of services. By adopting this algorithm in the node upgrade optical networks, the data transmission interruption caused by node upgrade can be effectively avoided in the beginning stages, and traffic survivability can be guaranteed. The related network definitions and algorithm parameters as the basis of the algorithm are explained in Table 1, and the detailed procedures of the proposed _PML-based BMA-RSA_ algorithm are shown in Algorithm 1. When a connection request \(R(S,D,B)\) arrives, firstly, we calculate the node upgrade probability after considering the self-influence and the inter-fluence. According to the upgrade probability of each node and the distance between the source node and the current node, we construct the _PML_ model, which consists of the label of each node. Initially, the NodeSet only contains the source node. As shown in Table 1, we should ideally traverse all nodes that are connected to the source node by links. If a node \(j\) has the minimum label, we add the node \(j\) into NodeSet and put \(\text{link}(src,j)\) into \(LinkSet\). For each \(\text{link}(i,j)\) for which node \(j\) is outside the NodeSet, we find the node that has the minimum value of label and incorporate this node into the NodeSet, and put \(\text{link}(i,j)\) into LinkSet. In the process of selecting nodes to join the NodeSet, some nodes already exist in the NodeSet, \begin{table}
\begin{tabular}{c l} \hline \hline
**Notations** & \multicolumn{1}{c}{**Definition**} \\ \hline \(R(S,D,B)\) & A set of service connection requests \\ \(G(V,E,P)\) & Physical topology \\ \(V_{F1}\) & Set of fixed-grid nodes \\ \(V_{FL}\) & Set of flex-grid nodes \\ \(S_{FI}\) & Number of slots required in a fixed-grid link for \(B\) \\ \(S_{FL}\) & Number of slots required in a flex-grid link for \(B\) \\ \(P_{R}\) & The optimal path for service provisioning \\ \(\varnothing_{s}\) & Boolean value which defines if the source node is a fixed-grid node, the value is equal to \(0\), otherwise the value is equal to \(1\) \\ \(\varnothing_{s(l)}\) & Boolean value which defines if the start node of link \(l\) is a fixed-grid node, the value is equal to \(0\), otherwise the value is equal to \(1\) \\ \(\varnothing_{e(l)}\) & Boolean value which defines if the end node of link \(l\) is fixed-grid node, the value is equal to \(0\), otherwise the value is equal to \(1\) \\ \(F_{min}^{n,ith}\) & The minimum unoccupied frequency slot sequence number \(i\) on the \(n\)_th_ wavelength \\ \(F^{n,ith}\) & The unoccupied frequency slot sequence number \(j\) on the \(n\)_th_ wavelength for \(R\) \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Related parameters of _BMA-RSA_ algorithm. and new nodes need to be integrated into the NodeSet. If the label value of the nodes of choice have a label value higher than the sum of the label values of the nodes that have been added to the NodeSet, then the label of the node needs to be upgraded according to Equation (2). If all nodes are traversed, we will find the optimal path according to the source node and the destination node. The next step is to allocate resources for the path, for which the constraints of spectrum continuity and contiguity are considered. For the nodes on the path, we check and clarify the attributes of each node according to \(V_{FI}\) and \(V_{FL}\). In the first case, the source node of path \(P_{R}\) is a fixed-grid node, so we traverse \(S_{FI}\) the consecutive frequency slots starting with \(F_{min}^{n,ith}\) for each link and check whether they are unoccupied, and if \(S_{FI}\) consecutive frequency slots are unoccupied, then allocate spectrum resource and return \(S_{FI}\), \(F^{n,jith}\).