# Provision of Energy- and Wavelength-Efficient Traffic
## 3 Traffic Grooming Algorithm Design
### Sub-Wavelength Grooming Algorithm  
After obtaining the matching pairs, we can construct the sub-wavelength units which can be denoted by \(\mathcal{U}^{*}=\left\{\mathcal{U}^{*}_{1},\mathcal{U}^{*}_{2},\cdots, \mathcal{U}^{*}_{2}\right\}\), where \(\mathcal{U}^{*}_{i}\) represents that a group of connection requests is aggregated into sub-wavelength \(i\). The path set of the sub-wavelength units can be expressed as \(L_{\mathcal{U}^{*}}=\left\{L_{\mathcal{U}^{*}_{1}},L_{\mathcal{U}^{*}_{2}}, \cdots,L_{\mathcal{U}^{*}_{2}}\right\}\), where \(L_{\mathcal{U}^{*}_{i}}=\max\{L_{\mathcal{S}_{n}}\},\mathcal{S}_{n}\in\mathcal{ U}^{*}_{i}\). To decrease the number of wavelengths, several sub-wavelengths are groomed into the same wavelength so long as the path affiliation \(L_{\mathcal{U}^{*}_{1}}\subseteq L_{\mathcal{U}^{*}_{2}}\subseteq\cdots \subseteq L_{\mathcal{U}^{*}_{2}}\) is satisfied. We define the wavelength set as \(\mathcal{W}\), and hence the wavelength-minimized problem can be transformed into  
\[\min_{\mathcal{W}=\left\{\mathcal{W}_{1},\mathcal{W}_{2},\cdots, \mathcal{W}_{\Phi}\right\}}(\max|\mathcal{W}|) \tag{13}\] \[\text{\emph{s.t.}}\max|\mathcal{W}|=\Phi-Num(\mathcal{W}_{\varphi })_{1\leq\varphi\leq\Phi}^{\mathcal{W}_{\varphi}\cap\mathcal{U}^{*}=\varnothing}\] (14) \[L_{\mathcal{U}^{*}_{1}}\subseteq L_{\mathcal{U}^{*}_{2}}\subseteq \cdots\subseteq L_{\mathcal{U}^{*}_{2}} \tag{15}\]  
where the \(Num(\mathcal{W}_{\varphi})_{1\leq\varphi\leq\Phi}^{\mathcal{W}_{\varphi}\cap \mathcal{U}^{*}=\varnothing}\) is the number of idle wavelengths after the sub-wavelength grooming. Through the transformation, the binary variable \(\mu^{\omega}_{ij}\) can be eliminated and the analytical derivation is greatly simplified. In addition, the flow conservation limitation is converted into the path affiliation problem, as shown in (15). The SG algorithm is implemented by establishing a matching \(\Re\) which serves a mapping between \(\mathcal{U}^{*}\) and \(\mathcal{W}\), so that for each sub-wavelength \(\mathcal{U}^{*}_{i}\) and each wavelength \(\mathcal{W}_{\varphi}\), we have: (i) \(\Re(\mathcal{U}^{*}_{i})=\mathcal{W}_{\varphi}\) if and only if \(\mathcal{U}^{*}_{i}\in\Re(\mathcal{W}_{\varphi})\); (ii) \(\Re(\mathcal{W}_{\varphi})\subseteq\mathcal{U}^{*}\cup\varnothing\) and \(|\Re(\mathcal{W}_{\varphi})|\leq\mathcal{I}\); (iii) \(\Re(\mathcal{U}^{*}_{i})\in\mathcal{W}\) and \(\big{|}\Re(\mathcal{U}^{*}_{i})\big{|}\leq 1\). Specifically, each matching pair is denoted by \((\mathcal{U}^{*}_{i},\mathcal{W}_{\varphi})_{L_{\mathcal{U}^{*}_{i}}\subseteq L _{\mathcal{U}^{*}_{i}}\subseteq\cdots\subseteq L_{\mathcal{U}^{*}_{i}}}\), satisfying the flow conservation constraints. We aim at finding a matching such that the consumed wavelengths can be minimized. Given a matched sub-wavelength unit \((\mathcal{S}_{n},\mathcal{U}_{i})\), it prefers to be aggregated to form a new pair \((\mathcal{W}_{\varphi^{\prime}},(\mathcal{S}_{n},\mathcal{U}_{j}))\) with more energy consumption and less used wavelengths. Therefore, we construct a preference matrix \(Z_{n,j}\) to depict the mutual effect. Each element in \(Z_{n,j}\) is defined as  
\[\varsigma^{(\mathcal{S}_{n},\mathcal{U}_{i})}_{(\mathcal{W}_{\varphi^{\prime}}, (\mathcal{S}_{n},\mathcal{U}_{j}))}=\Xi(\mathcal{S}_{n},\mathcal{U}_{i})^{ \rho_{1}|\mathcal{W}_{\varphi^{\prime}}|}/\Xi(\mathcal{S}_{n},\mathcal{U}_{j}) ^{\rho_{2}} \tag{16}\]  
where \(\rho_{1}\) and \(\rho_{2}\) are the preference parameters.