# Power Optimization in Multi-Tier Heterogeneous Networks Using Genetic Algorithm
## 6 Proposed Algorithm
### Weight-Based User-Scheduling Algorithm  
Various scheduling algorithms have been proposed that consider the minimum distance between a user and an access point and the maximum channel gain between a user and an access point to improve network efficiency. The scenario under consideration involves a multi-layer heterogeneous network with a large number of APs located in a specific geographical area. Each AP serves a portion of the total number of users (\(C_{U}\)) distributed randomly within the network, with a group of users referred to as \(C_{U_{a}}\).  
The flowchart of Weight-based user-scheduling algorithm is depicted in Figure 3. Let us consider \(\{C_{U_{1}},C_{U_{2}},C_{U_{3}},\ldots,C_{U_{A}}\}\) the subset of users assigned to a group of APs \(\{1,2,\ldots A\}\). The pilot channels are sent to obtain the channel estimates before sending the data in the downlink. In the communication scenario under consideration, a large number of APs are deployed in a certain geographical area, and a group of randomly distributed users is served by the APs in the network. A set of \(l_{x}\) mutually orthogonal pilot sequences is transmitted in the uplink to minimize interference from subsequent pilot transmissions. The pilot assignment to users starts by selecting an AP, \(a^{*}\). In the weight-based user-scheduling Algorithm 1, the access point uses a hybrid approach that considers both the distance and received signal strength indicator (RSSI) of each user. The RSSI value of each user is frequently monitored by its serving and neighboring access point. A weight is then assigned to both the distance and RSSI. Finally, the user with the maximum value is assigned a subset of particular access points. Consider \(w_{d}\) the weight assigned to the distance and \(w_{\beta}\) the weight assigned to the RSSI value. To estimate the RSSI, the Alpha-Beta-Gamma (ABG) path loss model [38] is used and is given by  
\[PL^{ABG}(f,d)[\mathrm{dB}]=10\alpha_{A}log_{10}(\frac{d_{uu}}{1\,\mathrm{m}})+ \beta_{B}+10\gamma_{G}log_{10}(\frac{f}{1\,\mathrm{GHz}})+\chi_{\sigma}^{ABG} \tag{20}\]  
where \(PL^{ABG}(f,d)[\mathrm{dB}]\) denotes the path loss in dB over the frequency and distance, \(\alpha_{A}\) and \(\gamma_{G}\) are the coefficients, which are dependent on the frequency and distance, respectively, and \(\beta_{B}\) is the optimized set value for path loss in dB. \(\chi_{\sigma}^{ABG}\) is the standard deviation describing the large signal fluctuations about the mean path loss over the distance.  
\[R_{uu}=\rho_{CU_{i}}-PL^{ABG}(f,d) \tag{21}\]  
where \(\rho_{CU_{i}}\) represents the power allocated to the \(i\)th cellular user by all the serving APs. For each user \(u\), the access point \(A_{i}\) calculates a value that is given by the equation:  
\[\tau_{u_{a}}=w_{d}G_{ua}+w_{\beta}R_{uu} \tag{22}\]  
where \(G_{ua}\) denotes the free space loss in decibels between the access point and the user. \(f\) is the frequency of communication. \(R_{uu}\) denotes the RSSI value between the access point and user.  
\[G_{u_{a}}[\mathrm{dB}]=20 log_{10}(d_{uu})\mathrm{km}+20 log_{10}(f)-147.55 \tag{23}\]  
A user with a maximum value of \(\tau_{u_{a}}\), \(max(\tau_{u_{a}})\), is selected by the AP. This process repeats until the APs select all the user subsets.  
```
Input:\(A\), \(l_{p}\), \(C_{U}\) Output:\(C_{U_{a}}\), \(\{1,2,\ldots A\}\) Initialization:\(\{C_{U_{1}}=C_{U_{2}}=\ldots=C_{U_{A}}=\phi\}\) \(y\gets 1\) \(X\gets x\) \(N\gets n\) while\(u\) < \(l_{x}\)do \(lu\gets u\) while\(u>l_{x}\)do  find \(a*\gets max(\tau_{u_{a}})\) \(l^{\prime}\gets argmin_{l\in\{1,2,\ldots,l_{x}\}}\sum_{i=1,l_{i}=l}^{u-1} \beta_{i\alpha*}\) \(l_{u}\gets l^{\prime}\)  c = 1 while\(c<A\)do  c = c+1 1 1 \(l=1\) while\(l<l_{x}\)do 1 = 1+1 \(i\gets argmax_{ue\{1,2,\ldots,C_{U}\}}\tau_{u_{a}}\) \(C_{U_{i}}\gets C_{U_{i}}\cup\{u\}\)  end while  end while  end while  end while
```  
**Algorithm 1** Weight-based user-scheduling algorithm.