# Binary PSO with Classification Trees Algorithm for Enhancing Power Efficiency in 5G Networks
## 4 Proposed Algorithms
### SC on/off Switching Using Linearly Increasing IW-BPSO Algorithm  
In this paper, SC switching utilizing a linearly increasing IW-BPSO algorithm is proposed. The UE can associate with an SC \(m\) if \(SINR_{k,m}\) exceeds a certain threshold (\(SINR_{thr}\)). At the beginning of our proposed algorithm, each UE \(k\) calculates the SINR from all SCs to determine all SCs that it can possibly associate with, then sorts the received SINR from these SCs in a descending order. The UE associates with the SC with the highest received SINR. If the number of UEs in this SC is larger than the maximum number of UEs in the SC (\(U_{max}\)), the UE connects with the SC having the next highest SINR. This continues until every UE is associated with one SC.  
To minimize the number of active SCs and to elevate the PE, it is required to switch off the excessive SCs, taking into consideration the QoS of the UEs, since the SINR of every UE exceeds \(SINR_{thr}\). Thus, a multi-objective optimization problem had to be solved; this problem can be written as:  
\[\text{{Objective1}}:\text{ min }\left(\sum_{n=1}^{M}\gamma_{m}\right)\text{{Objective2}}: \text{ max }\left(PE_{sys}\right) \tag{11}\]  
subject to:  
\[\gamma_{m},\text{ }\in\text{ }\left\{0,1\right\},\text{ }\forall\text{ }m\in M \tag{11a}\]  
\[\varphi_{m,k}\text{ }\in\text{ }\left\{0,1\right\},\text{ }\forall\text{ }m\in M,\text{ }k\in U_{m} \tag{11b}\]  
\[\sum_{m=1}^{M}\varphi_{m,k}\text{ }\gamma_{m}=1,\text{ }\forall\text{ }m\in M,\text{ }k\in U_{m} \tag{11c}\]  
\[U_{m}\leq U_{max},\text{ }\forall\text{ }m\in M \tag{11d}\]  
where constraint (11a) is the on/off state indicator of the SC. Constraint (11b) is the UE association indicator. Constraint (11c) states that the UE is associated with only one active SC. Constraint (11d) indicates that the number of UEs in an SC cannot exceed the maximum number of UEs in an SC (\(U_{max}\)).  
Algorithm 1 summarizes the proposed BPSO-based on/off SC switching algorithm. In line 1, after the random binary initialization of the population of every particle, the velocity of the particles is initialized as Equation (6). Then, for each iteration till the maximum number of iterations (\(Z_{max}\)) is reached, the IW (\(\omega_{z}\)) is computed (line 3) and the position (\(x_{j}\)) and velocity (\(v_{j}\)) of every particle \(j\) are updated using Equations (7) and (9), respectively (lines 5-6). Next, the fitness value of every particle \(j\) (F (\(x_{j}\))) is computed using Equation (11) (line 7). If \(F\left(x_{j}\right)<F\left(p_{best_{j}}\right)\), then \(P_{best_{j}}=x_{j}\), and if \(F\left(x_{j}\right)<F(G_{best})\), then \(G_{best}=x_{j}\) (lines 8-13).  
```
Inputs: Locations of UEs, locations of SCs, swarm size (\(N_{par}\)), maximum number of iterations (\(Z_{max}\)) Output: SC on/off indicator
1:Initialize the position (\(x_{j}\)) randomly and velocity (\(v_{j}\)) of every particle \(j\) as Equation (6).
2:For\(z=1\) to \(Z_{max}\)
3:Calculate\(\omega_{z}\) using Equation (10)
4:For each particle \(j\)
5:Update\(v_{j}\) using Equation (7)
6:Update\(x_{j}\) using Equation (9)
7:Calculatenew fitness value \(F\left(x_{j}\right)\) as Equation (5)
8:if\(F\left(x_{j}\right)<F\left(p_{best_{j}}\right)\)
9:\(P_{best_{j}}\text{ }\leftarrow\text{ }x_{j}\)
10:endif
11:if\(F\left(x_{j}\right)<F(G_{best})\)
12:\(G_{best}\text{ }\leftarrow\text{ }x_{j}\)
13:endif
14:endfor
15:endFor
```  
**Algorithm 1**Proposed linearly increasing IW-BPSO-based on/off SC switching.