## 4 A Hybrid Algorithm for Power Allocation in Macrocell/Femtocell Architecture
In addition, when a \(MUE_{i}\) is close to the neighboring \(F_{l}\), it is considered that the channel gain \(|G_{F_{l},MUE_{i}}^{k}|^{2}\) is known from a \(F_{l}\); however, there is a lack of shadowing \(S(d_{Tx,RX})\) and fast fading \(F(\alpha)\) components, thus the \(RSS_{F_{l},MUE_{i}}^{k}\) can be represented as follows: \[RSS_{F_{l},MUE_{i}}^{k}=\frac{P_{F_{l}}^{k}}{|G_{F_{l},MUE_{i}}^{k}|^{2}},\] (8) where \(|G_{F_{l},MUE_{i}}^{k}|^{2}=L(d_{F_{l},MUE_{i}})\). Subsequently, the distance \(d_{F_{l},MUE_{i}}\) between \(MUE_{i}\) and an \(F_{l}\) is known too, hence an \(F_{l}\) can detect if the attenuation wall \(W_{Loss}\) is counted within the aforementioned \(|G_{F_{l},MUE_{i}}^{k}|^{2}\) or not. * It is expected that an \(F_{l}\) finds the \(RSS_{M,MUE_{i}}^{k}\) or it can capture it directly from an \(MUE_{i}\). Then, an \(F_{l}\) minimizes the transmitted power \(P_{F}^{k}\) in a certain context in order to ensure the required QoS of a victim \(MUE_{i}\). To do so, the \(RSS_{M,MUE_{i}}^{k}\) must be greater than the \(RSS_{F_{l},MUE_{i}}^{k}\) as in Equation (9): \[RSS_{M,MUE_{i}}^{k}>RSS_{F_{l},MUE_{i}}^{k}.\] (9)
* Then, \(F_{l}\) can adjust the allocation from \(P_{F_{l}}^{k}\) to \(P_{F_{l}}^{Ik}\) according to Equation (9) based on \(RSS_{M,MUE_{i}}^{k}\) and \(RSS_{F_{l},MUE_{i}}^{k}\) and substituting them in Equation (9): \[\frac{P_{F_{l}}^{k}}{|G_{F_{l},MUE_{i}}^{k}|^{2}}>\frac{P_{F_{l}}^{\prime k}}{ |G_{F_{l},MUE_{i}}^{k}|^{2}}.\] (10) Equating the RSSs on each side implies that \[P_{F_{l},MUE_{i}}^{\prime k}=\frac{P_{F_{l}}^{k}.|G_{F_{l},MUE_{i}}^{k}|^{2}}{ |G_{F_{l},MUE_{i}}^{k}|^{2}}.\] (11)```
Initiate\(SINR^{Threshold}\) if\(SINR^{k}_{M,MUE_{i}}<SINR^{Threshold}\)then calculate\(RSS^{k}_{M,MUE_{i}}\) endif for all\(F_{l}\in L\)do if\(SINR^{k}_{M,MUE_{i}}<SINR^{Threshold}\)then calculate\(RSS^{k}_{F_{l},MUE_{i}}\) endif if\(RSS^{k}_{M,MUE_{i}}\leq RSS^{k}_{F_{l},MUE_{i}}\)then  M identifies the received \(RSS^{k}_{F_{l},MUE_{i}}\) on \(F_{l}\) as the interfering signal endif endfor for all\(MUE_{i}\in I\)do find the average number of the MUEs impacted by femtocell \(AVG_{(RP_{PT_{\bar{F}_{l}}},T_{MUE})}=\frac{\Sigma^{MUE_{X}}_{MUE_{i}}RP_{PT_{ \bar{F}_{l}}}}{T_{MUE}}\) where \(RP_{PT_{\bar{F}_{l}}}= \begin{cases}1&if\;PT_{\bar{F}_{l}}\;\text{has equal \; positions to}\;F_{l}\\ 0&otherwise\end{cases} \) endfor for all\(F_{l}\in L\)do sort\(AVG_{(RP_{PT_{\bar{F}_{l}}},T_{MUE})}\) in a descending order create Master and Slave clusters according to \(PT_{F_{l}}\) calculate the maximum interference allowed by the victims \(MUE_{i}\) \(MI^{k}_{MUE_{i}}=\frac{RSS^{k}_{M,MUE_{i}}}{SINR^{Threshold}}-N_{0}\) for all\(F_{l}\in\) Master-Fs do calculate power adjustment \(P^{\prime}_{\bar{F}_{l}}=\underbrace{MI^{k}_{MUE_{i}}\cdot\frac{RSS^{k}_{F_{l}, MUE_{i}}}{\sum^{L}_{l=1}RSS^{k}_{F_{l},MUE_{i}}}\cdot\frac{P^{k}_{\bar{F}_{l}}}{ RSS^{k}_{F_{l},MUE_{i}}}}_{|\bar{G}^{k}_{F_{l},MUE_{i}}|^{2}}\) endfor for all\(F_{l}\in\) Slave-Fs do calculate power adjustment \(P^{\prime}_{\bar{F}_{l},MUE_{i}}=\frac{\frac{P^{k}_{\bar{F}_{l}}\cdot|G^{k}_{F_{ l},MUE_{i}}|^{2}}{|G^{k}_{F_{l},MUE_{i}}|^{2}}}{|G^{k}_{F_{l},MUE_{i}}|^{2}}\) endfor endfor
```

**Algorithm 1** Hybrid Power Allocation

```
Initiate\(SINR^{Threshold}\) if\(SINR^{k}_{M,MUE_{i}}<SINR^{Threshold}\)then calculate\(RSS^{k}_{M,MUE_{i}}\) endif for all\(F_{l}\in L\)do if\(SINR^{k}_{M,MUE_{i}}<SINR^{Threshold}\)then calculate\(RSS^{k}_{F_{l},MUE_{i}}\) endif if\(RSS^{k}_{M,MUE_{i}}\leq RSS^{k}_{F_{l},MUE_{i}}\)then  M identifies the received \(RSS^{k}_{F_{l},MUE_{i}}\) on \(F_{l}\) as the interfering signal endif endfor for all\(MUE_{i}\in I\)do find the average number of the MUEs impacted by femtocell \(AVG_{(RP_{PT_{\bar{F}_{l}}},T_{MUE})}=\frac{\Sigma^{MUE_{X}}_{MUE_{i}}RP_{PT_{ \bar{F}_{l}}}}{T_{MUE}}\) \(RP_{PT_{\bar{F}_{l}}}= \begin{cases}1&if\;PT_{\bar{F}_{l}}\;\text{has equal \; positions to}\;F_{l}\\ 0&otherwise\end{cases}