## 6 The Proposed RAWC Scheme
### Scheme Detail
#### 6.2.2 Wavelength Conflict Degree  
When \(m\) (\(m\geq 2\)) QKD service requests (for ease of description, the m service requests are numbered \(R_{1}\), \(R_{2}\),..., \(R_{m}\)) arrive simultaneously at a given moment, wavelength conflicts caused by multiple services occupying the same link must be considered. The KSP algorithm is used to calculate K alternative paths for each service request. After determining the alternative paths for each service request, the wavelength conflict degree of each alternative path needs to be calculated. For service request \(R_{i}(1\leq i\leq m)\), the wavelength conflict degree of its alternative path \(p_{j}^{i}(1\leq j\leq K)\) is calculated as follows:  
\[\delta_{p_{j}^{i}} =\sum_{(u,v)\in L_{p_{j}^{i}}}\left(\sum_{k=1(k\
eq i)}^{m}\mu- \lambda_{area}(u,v)\right)\] \[=\sum_{(u,v)\in L_{p_{j}^{i}}}\sum_{k=1(k\
eq i)}^{m}\mu-\sum_{(u,v)\in L_{p_{j}^{i}}}\lambda_{area}(u,v) \tag{2}\] \[=\sum_{(u,v)\in L_{p_{j}^{i}}}\sum_{k=1(k\
eq i)}^{m}\mu-\lambda_ {area}\left(p_{j}^{i}\right)\]  
\[\mu= \begin{cases}1,&(u,v)\in p^{k}\\ 0,&(u,v)\
otin p^{k}\end{cases}  \tag{3}\]  
where \(p_{j}^{i}\) denotes the \(j\)th \((1\leq j\leq K)\) alternative path of the QKD service request \(R_{i}\); \(L_{p_{j}^{i}}\) is the link set contained in the path \(p_{j}^{i}\); \((u,v)\in L_{p_{j}^{i}}\) is a link of this link set; \(\lambda_{area}\left(p_{j}^{i}\right)\) is the total number of available wavelengths for path \(p_{j}^{i}\); \(p^{k}\) represents the communication path selected for service request \(R_{k}(1\leq k\leq m,k\
eq i)\); and \(\mu\) is the wavelength conflict marker of each link. When the communication path of request \(R_{k}\) other than the service request \(R_{i}\) contains \(\text{link}(u,v)\), it means that the two services have to share the wavelength resources of \(\text{link}(u,v)\); then, \(\mu=1\), otherwise \(\mu=0\). Note that the wavelength conflict degree is introduced to predict potential wavelength competition when choosing the path. It does not necessarily mean that wavelength conflicts will occur. The path with low wavelength conflicts is preferred to reduce the interference between service requests and improve the success rate of service requests. The path selection procedure based on wavelength conflict degree is as follows:  
1. Calculate the wavelength conflict degree of each alternative path for request \(R_{1}\). Firstly, assume for the moment that the path \(p_{1}^{k}(1<k\leq m)\) with the smallest weight of the other \((m-1)\) service requests is their communication path, which is used to calculate the wavelength conflict degree of each alternative path for \(R_{1}\). Then, the wavelength conflict degree \(\delta_{p_{j}^{1}}\) of each alternative path \(p_{j}^{1}(1\leq j\leq K)\) for \(R_{1}\) is calculated according to Equation (2). Finally, the path with the minimum wavelength conflict degree is selected as the communication path, denoted as \(p^{1}\). 2. Calculate the wavelength conflict degree of each alternative path for request \(R_{2}\). According to step 1, when calculating the wavelength conflict degree of the alternative paths for \(R_{2}\), the communication path of \(R_{1}\) is determined as \(p^{1}\). The path \(p_{1}^{k}(2<k\leq m)\) with the smallest weight of the other \((m-2)\) service requests is assumed to be their communication path. Then, calculate the wavelength conflict degree \(\delta_{p_{j}^{2}}\) of each alternative path \(p_{j}^{2}(1\leq j\leq K)\) for \(R_{2}\). Finally, select the path with the smallest wavelength conflict degree as the communication path, denoted as \(p^{2}\). 3. Calculate the wavelength conflict degree of each alternative path for request \(R_{3}\). According to steps 1 and 2, the communication paths for \(R_{1}\) and \(R_{2}\) are \(p^{1}\) and \(p^{2}\), respectively. Assume that the path \(p_{1}^{k}(3<k\leq m)\) with the smallest weight of the other \((m-3)\) service requests is their communication path.