## 3 Dynamic Traffic Grooming Based on Virtualization-Plane-Aided Optimization
### DTG-LFA Algorithm  
In the EOSNs, the research of DTG mainly focuses on the overall network performance improvement and resource allocation planning. This section proposes a DTG-LFA algorithm for EOSNs. As shown in Figure 5, the set of available wavelength resources for each link of the candidate path is represented as \(U_{link}^{w,h}\), the resource utilization set of candidate paths is represented as \(U_{path}\). Time slots in \(U_{path}\) are denoted as \(u_{w,ls}^{p}\). The relationship between \(U_{path}\) and \(U_{link}^{w,h}\) is shown in Equation (7). \[U_{path}=\bigcup_{h=1}^{H}U_{link}^{w,h}. \tag{7}\]Find the time slot resources that meet the requirements of the request on the \(U_{path}\), and when a resource that can be allocated is found, pre-allocate this resource to the request to obtain the pre-allocated path resource utilization set \(pre\_U_{path}\), the usage of time slots is represented as \(u_{w,ts}^{p}\). When the difference in the number of slot hops before and after the allocation of available resource blocks is \(\Phi_{can}\leq 0\), it is used as candidate resource block \(B_{can}\). The calculation method of \(\Phi_{can}\) is shown in Equation (8). \[\Phi_{can}=\sum_{i=1}^{L-1}u_{w,ts}^{p}(i)\oplus u_{w,ts}^{p}(i+1)-\sum_{i=1}^{ L-1}u_{w,ts}^{p}(i)\oplus u_{w,ts}^{p}(i+1). \tag{8}\]  
The set of candidate resource blocks is \(B_{can}=\{B_{1},B_{2},\ldots,B_{n}\}\), and link fragment assessment is performed for each candidate resource block. Link fragment assessment is an essential indicator for evaluating the quality of time-slot resource blocks that can be allocated on a link. The first evaluation parameter is the distance \(T_{sp}\) from the resource block to the boundary, the calculation formula is as Equation (9). \[T_{sp}=min\{t_{sp}^{L},t_{sp}^{R}\}= \begin{cases}t_{abr}-1,&t_{abr}+t_{aer} \leq L+1\\ L-t_{aer},&t_{abr}+t_{aer}>L+1\end{cases} . \tag{9}\]  
Among them, \(t_{sp}^{L}=t_{abr}-1\) refers to the distance from the candidate's time slot resource to the first time slot, \(t_{sp}^{R}=L-t_{aer}\) refers to the distance from the candidate's time slot resource to the tail time slot. The second evaluation parameter is \(E_{b}\), which describes the impact on adjacent time slot resources, the calculation process is shown in Equation (10). \[E_{b}= \begin{cases}\sum_{h=1}^{H}u_{h}^{a},&t_{abr}=ts_{1}\\ \sum_{h=1}^{H}(u_{h}^{a}+u_{h}^{b}),&t_{abr}\in\{ts_{2},\ldots,L-t_{sr}\}\\ \sum_{h=1}^{H}u_{h}^{b}&t_{abr}=L-t_{sr}+1\end{cases}  \tag{10}\]  
Among them, \(u_{h}^{a}\) and \(u_{h}^{b}\) represent the occupancy of the next and previous time slot adjacent to the candidate resource block on the h-th link of the available path, respectively. \(H\) represents the number of links in the available path. The smaller the \(E_{b}\)-value, the fewer idle time slots adjacent to the candidate resource block, indicating that the resource block is connected to more occupied resources. Therefore, selecting resource blocks with small \(E_{b}\)-values. Figure 5: Resource block search scheme. The third evaluation parameter is resource usage \(S_{u}\), and the calculation formula is shown in Equation (11). \[S_{u}=H\times t_{sr}. \tag{11}\]  
Choosing a resource block with a smaller \(S_{u}\) value and occupying as few time slot resources as possible can leave more available resources for subsequent requests. Meanwhile, the resource usage \(S_{u}\) depends on the number of time slots required for the request and the number of links included in the path. As the number of time slots or links increases, the resource usage will increase, selecting resource blocks with smaller \(S_{u}\) values. Construct a resource block evaluation index \(F_{E}\) using the above three parameters. The calculation formula is shown in Equation (12). \[F_{E}=T_{sp}+E_{b}+S_{u}. \tag{12}\]  
The smaller the \(F_{E}\) value, the more resource blocks are connected to occupied time slots, and the more concentrated the resource allocation.