## 3 Suboptimal Subcarrier and Power Allocation
### Suboptimal Subcarrier Allocation Algorithm  
The ant colony optimization (ACO) algorithm is an intelligence-optimized algorithm deriving from the illumination of ants' food-seeking behavior [28]. Due to its less parameters and stronger robustness,the ACO algorithm is widely utilized to solve the optimization problems such as the traveling salesman problem and other scheduling problems [29, 30]. In this paper, the ACO algorithm is applied to solve the subcarrier allocation problem in the resource allocation of OFDMA system. The structure diagram of subcarrier allocation by ACO algorithm is shown in Figure 2.  
Starting from the nest, the ants go through the node network to reach the food point. In the ants' paths in the node network, if an ant pass the node (_k,n_), subcarrier \(n\) is distributed to user \(k\). In the ACO algorithm, each node has a different attraction to ants, and the \"attraction\" is defined by the transition probability _P_(_k,n_). The larger the _P_(_k,n_), the larger the probability that the ants pass the node (_k,n_) and select user \(k\) to obtain the _n_th subcarrier. In order to satisfy the constraint C3 in Equation (4), no ant is allowed to walk from one user to another user in the same subcarrier. In order to reduce the complexity of subcarrier allocation, each selected point in the ants' paths is distributed with equal power _P_\({}_{tot}\)/_N_. The algorithm can be described as follows. (1) Set the parameters of the number of ants and iterations. Initialize the equal pheromone \(\tau_{k,n}\) in the subcarriers. (2) Define the transition probability of ants _P_(_k,n_), which means the probability that the subcarrier \(n\) is assigned to user \(k\). The transition probability _P_(_k,n_) can be expressed as  
\[P\left({k,n}\right)= \begin{cases}\begin{aligned} \left[{\tau_{k,n}}\right]^{ \alpha}\left[{\eta_{k,n}}\right]^{\beta}\\ \sum_{{k\in N\left({s^{\prime}}\right)}}\left[{\tau_{k,n}}\right]^{ \alpha}\left[{\eta_{k,n}}\right]^{\beta},\end{aligned}&\ \ l\in N\left({s^{\prime}}\right)\\ 0,\ l\in N\left({s^{\prime}}\right)\end{cases}  \tag{7}\]  
where \(\eta_{k,n}\) is the heuristic information, \(\alpha\) and \(\beta\) are the weight factors. _N_(_s\({}^{p}\)_) is the collection of allowed transferred positions for current ants. Figure 2: The structure diagram of subcarrier allocation by ant colony optimization (ACO) algorithm. Considering the system sum rate and proportional fairness among users, we define the heuristic information \(\eta_{k,n}\) as the function of the data rate of user \(k\) in subcarrier \(n\), which is \(r_{k,n}\), and the system fairness index \(J\), respectively. The heuristic information \(\eta_{k,n}\) is defined as  
\[\eta_{k,n}=\frac{\log_{2}\biggl{(}1+\frac{r_{k,n}}{1-J}\biggr{)}}{ \sum_{l_{k}\in N\left(s^{\prime}\right)}\log_{2}\biggl{(}1+\frac{r_{l,n}}{1-J} \biggr{)}} \tag{8}\]  
According to Equations (7) and (8), the user with higher data rate \(r_{k,n}\) and higher contribution to the fairness index \(J\) has higher probability to obtain the subcarrier. The logarithmic form in Equation (8) is to slow down the change of the heuristic information on different users in different subcarriers and thus to increase the randomness of the ACO algorithm rather than the linear function. Moreover, the introduced [PERSON]'s fairness index \(J\) in heuristic information ensures that every user receive a certain number of subcarriers. Otherwise, the proportionality constraints won't be achieved no matter how the power is allocated. The \(R_{k}\) and \(J\) are updated according to Equations (5) and (6) after a subcarrier distribution to user \(k\). (3) In the ACO algorithm, the pseudo-random proportion rule is adopted, which can be described as follows. 1. Generate a uniformly distributed random number \(q\) in the interval [0-1]. 2. If \(q\leq q_{0}\) (\(q_{0}\) is a fixed parameter value), then \[k=\arg\max_{l_{k}N\left(s^{\prime}\right)}\left\{\tau_{l,n}^{\alpha}\eta_{l,n}^ {\beta}\right\}\] (9)
3. If \(q>q_{0}\), then choose path according to \(P(k,n)\).