## 5 Link and Node Removal Considering Residual Capacity and Traffic Demands (LNR-RCTD)  
### LNR-RCTD Algorithm  
In this section, we discuss the development of our proposed heuristic algorithm called LNR-RCTD for un-optimized and random topology WMNs. The final outcome of our proposed heuristic LNR-RCTD is the connected graph \(G^{{}^{\prime}}\left(V^{{}^{\prime}}\,E^{{}^{\prime}}\ \right)\subseteq G(V,E)\), where \(V^{{}^{\prime}}\subseteq V\) and \(E^{{}^{\prime}}\subseteq E\). Node connectivity is based on radius of the node, which is further based on the transmission power (\(T_{r}\)) of that node. Increasing the value of \(T_{r}\) increases the degree of node connectivity and lowering the value of \(T_{r}\) decreases the degree of node connectivity. Therefore, \(T_{r}\) is a design parameter that has a significant impact on constructing an energy-efficient mesh topology. In this paper, our primary objective is to reconstruct an optimal connected mesh backbone topology. Therefore, the value of \(T_{r}\) is selected such that each WMR must be connected to atleast one other WMR. LNR-RCTD is significantly based on the APAC algorithm for computing the available paths between any two WMRs. APAC is an efficient algorithm that keeps track of all available paths and cycles between two network nodes, but not the all visited vertices, which significantly reduces its computational complexity. We modify APAC to compute the paths based on their QoS requirements between two WMRs. The LNR-RCTD algorithm finds underutilized network resources in multimedia and real-time enabled WMNs. It processes all traffic flows and their corresponding usable routing paths to detect underutilized links. A link is considered to be underutilized if it is being utilized below a specific threshold relative to its total assigned capacity. In our case we set the upper bound of this threshold to 10% and in the topology marking phase all networks links whose utilization are below this specified threshold are marked as underutilized. The underutilized links are marked by assigning the red color. If any underutilized link is identified, its corresponding traffic flow and routing path is processed by LINK-OPTIMIIZATION algorithm. It finds an alternative underutilized-link free routing path from the first detected underutilized link that fulfills its desired QoS and capacity requirements. If the desired path will be found that would be selected and a complete end-to-end new routing path will be constructed. After constructing new path the corresponding traffic flow will be redirected over this new routing path. If no desired alternative routing path will be found the previous path will be remain intact. Finally, the LINK-OPTIMIZATION algorithm computes the set of free links by re-computing and modifying the utilization of old and new paths. A link is considered to be free/extra if its total utilization becomes zero. In the end, the TOPOLOGY-OPTIMIZATION algorithm reconstructs the final and optimized connected network topology by removing the extra link and nodes from the original network topology. A node is considered to be extra if the sum of its all incident links becomes zero and such a node is also called isolated node. The LNR-RCTD algorithm (see Algorithm 1) is used to find the underutilized links in WMNs enabled with real-time and multimedia services and applications:  
(1) _Algorithm:_ LNR-RCTD algorithm processes for all traffic flows given by set of flows \(F\). It then finds underutilized link from the complete end-to-end path specified by \(UP_{f_{i,k}^{j}}\) of traffic flow \(f_{i,k}^{j}\in F\). If a underutilized link is detected it will be processed by _LINK-OPTIMIZATION_ algorithm. Finally, _TOPOLOGY-OPTIMIZATION_ algorithm constructs the final and optimized connected network topology. LINK-OPTIMIZATION algorithm (see Algorithm 2) is used to finds alternative underutilized-link free end-to-end paths that fulfill the desired QoS requirement of flow \(f_{i,k}^{j}\).