## 5 LBMSA Algorithm  
Since the RMSA problem is part of the RMSSA problem and the RMSA problem is NP-hard, the RMSSA problem is also NP-hard. To solve the RMSSA problem, we proposed a heuristic algorithm called spatial lane and spectrum block minimization based on the simulated annealing (LBMSA) algorithm, as shown in Algorithms 1 and 2. First, the LBMSA algorithm classifies all traffic requests with the same source and destination nodes (link directional) into the same set \(\overline{T}_{s,d}\) (Algorithm 1: lines 1-3). The traffic rate \(r\) of all traffic requests in each \(\overline{T}_{s,d}\) are summed to obtain \(\sum_{t\in\overline{T}_{s,d}}r\), and all \(\overline{T}_{s,d}\) are sorted in descending order according to \(\sum_{t\in\overline{T}_{s,d}}r\) (Algorithm 1: lines 4-6). The RMSSA is performed one by one starting from the \(\overline{T}_{s,d}\) with the \(\max\left(\sum_{t\in\overline{T}_{s,d}}r\right)\) value and the specific allocation method is the same in different \(\overline{T}_{s,d}\). Once the RMSSA of all traffic requests in a \(\overline{T}_{s,d}\) has been finished, the RMSSA for the next \(\overline{T}_{s,d}\) is carried out (Algorithm 1: lines 7-29). When performing RMSSA in each \(\overline{T}_{s,d}\), all traffic requests in that \(\overline{T}_{s,d}\) are first randomly ordered, and each traffic request is assigned in that order in turn (Algorithm 1: line 8). The SA algorithm is then used to optimize the order of traffic requests in \(\overline{T}_{s,d}\). The order of traffic requests is adjusted by iterations so that the objective function value is minimized while all traffic requests in \(\overline{T}_{s,d}\) are carried on the network (Algorithm 1: lines 12-23). The process of performing RMSSA in each \(\overline{T}_{s,d}\) is as follows. Following the random ordering of the traffic requests in \(\overline{T}_{s,d}\), the network resource allocation scheme \(X_{0}(\Lambda,\Omega)\) under that order and the corresponding fitness value \(f(X_{0})\) are obtained, which are used as the initial parameter values for the SA optimization process (Algorithm 1: lines 9-10). Following the reordering the traffic requests using the SA algorithm, Algorithm 2 is used to allocate space resources and spectrum resources to each traffic request in turn. The KSP algorithm is used to find the shortest routing path for each traffic request and calculate all possible options for CNs and MFs on that routing path (Algorithm 2: lines 2-3). Calculate the number of SLs and SBs that will be occupied corresponding to the different options and select the option that minimizes \(\sum_{e\in E}l_{\max}\) over the entire network (Algorithm 2: lines 4-7). Select the option with the smallest \(\sum_{t\in T}\sum_{e\in E}\zeta_{e}^{t}\) when the \(\sum_{e\in E}l_{\max}\) of different options are equal (Algorithm 2: lines 8-9). First-fit (FF) policy is used to assign SLs and SBs to a traffic request. In other words, starting from the SL with the smallest index, the unoccupiednetwork resources that can carry the traffic request are searched in the order of SB index from smallest to largest. The following two points should be noted. First, when traffic requests in different \(\overline{T}_{s,d}\) are carried on the same SL, the GB (one SB) is supposed to be set between these traffic requests. Second, all traffic requests are classified according to whether the nodes are the same so that traffic requests are transmitted by the Type I Sch or Type II Sch as much as possible, which reduces the use of WXCs and thus the switching cost. The time complexity of the LBMSA algorithm is related to the SA algorithm. Let the initial temperature of the SA algorithm be \(\mathrm{T}_{0}\), the cooling rate be \(\beta\), the end temperature be \(\mathrm{T}_{\mathrm{e}}\), and there is \(\mathrm{T}_{\mathrm{e}}=(1-\beta)^{\mathrm{k}}\mathrm{T}_{0}\). The SA algorithm terminates at \(\mathrm{k}>\frac{\ln\frac{\Lambda}{\Omega}}{\ln\beta}\).