## 5 Link and Node Removal Considering Residual Capacity and Traffic Demands (LNR-RCTD)
### LNR-RCTD Algorithm Illustration  
We applied our algorithm on a simple network topology, as shown in Figure 2, to demonstrate it step by step working. We explain the LNR-RCTD in action by taking the example of single flow say \(f_{6,1}^{1}\) and let's assume its associated usable path is \(UP_{f_{6,1}^{1}}=\{v_{6},v_{7},v_{4},v_{3},v_{1}\}\). This routing path is used to transmit data traffic from source node \(v_{6}\) to destination node \(v_{1}\).The loop at line 1 of algorithm 1 operates for only this selected single flow. The loop at line 2 processes all the links in the path \(UP_{f_{6,1}^{1}}\) and each link will be tested to determine whether it is underutilized or not. This test is carried out by a subroutine at line 3. In our mentioned example, link \(e_{7,4}\) is detected as underutilized (This fact is evident from Figure 2, in which all the underutilized links are shown in red). After detecting underutilized link \(e_{7,4}\) on node \(v_{7}\) the LINK-OPTIMIIZATION algorithm is being activated at line 4. Before going into further discussion, we clarify an important concept here. \(UP_{f_{6,1}^{1}}=\{v_{1},v_{1+1},...,v_{n},v_{m}\)... \(v_{k}\}=\{v_{6},v_{7},v_{4},v_{3},v_{1}\}\) is the usable path for flow \(f_{6,1}^{1}\). This path is further divided into two parts, \(UNUP_{f_{6,1}^{1}}=\{v_{n},v_{m}\)... \(v_{k}\}=\{v_{7},v_{4},v_{3},v_{1}\}\) that is the unused portion of the path starting from the red (underutilized) link, and \(PP_{i,l-1}=\{v_{i},v_{i+1},...,v_{n-1}\}=\{v_{6}\}\) is the previous portion of the usable path before the occurrence of the red link. This concept will be used in constructing the new usable underutilized link-free path for flow \(f_{6,1}^{1}\). Figure 2: A small connected network topology. In the _LINK-OPTIMIZATION_ algorithm a loop at line 2 processes all the incident links of node \(v_{7}\) until it finds an alternate path for \(\mathit{UNUP}_{f_{6,1}^{1}}\). In the mentioned example, the incident links to node \(v_{7}\) are \(e_{7,2}\) and \(e_{7,5}\).The subroutine _PathFinder_ at line 3 will computes all available paths starting from node \(v_{7}\) and ending at destination node \(v_{1}\) for flow \(f_{6,1}^{1}\). We only compute those paths that are loop-free, meaning they do not contain the original source node \(v_{6}\) of flow \(p_{f_{6,1}^{1}}\). As in the mentioned example there are only two incident links at node \(v_{7}\), Thus, the available paths are collectively represented by \(p_{f_{6,1}^{1}}\)as shown in Table 3.  
The loop at line 4 processes all paths shown in Table 3 until it finds required alternative path. At line 12, subroutine Underutilize tests whether the current path contains any further underutilized links or not. If a path contains any underutilized link, it will not be selected. Table 4 shows underutilized link-free paths. Now onward, these are the only paths of interest. From line 13 to line 19 the algorithm ensures whether the current path fulfills the QoS requirements (_i.e._, bandwidth, delay and PLR) of flow \(f_{6,1}^{1}\). Table 5 represents the available paths and their respective QoS parameters. The value of residual capacity is as follows:  
\[Residual-Cap=Min\big{(}e_{i,j},e_{j,k},...,e_{l,n}\big{)} \tag{21}\]  
where 384 kbps of data rate, 400 ms of end-to-end delay and less than 2% of PLR are the QoS parameters for flow \(f_{6,1}^{1}\). Under such QoS constraints, the first path is not selected while the second path fulfills the desired QoS constraints therefore, that path will be selected. Thus, the new usable end-to-end path \(\mathit{NUP}_{f_{6,1}^{1}}\)is reconstructed according to Equation (22):  
\begin{table}
\begin{tabular}{c} \hline
**Table 3.**\(p_{f_{7,1}^{1}}\) for flow \(f_{6,1}^{1}\) from node \(v_{7}\) to node \(v_{1}\). \\ \hline \([  
\[NUP_{f^{1}_{6,1}}=PP_{ll-1,j}\cup P_{l,K} \tag{22}\]  
\(NUP_{f^{1}_{6,1}}=\{v_{6}\to v_{7}\to v_{2}\to v_{5}\to v_{3}\to v_{4}\to v_{1}\}\).