# Pilot Sequence Allocation Schemes in Massive MIMO Systems Using Heuristic Approaches
## 4 Proposed Solutions
### Variable Neighbourhood Search
At each generation, only the best suitable individuals survive and transmit their genes to the next generation. To further specify how the GA is applied to the optimization problem, we define the fitness function as the function \(\mathcal{J}\) in (9). In addition, the GA will have three operators: a proportional fitness selection to define the parents for each new individual, the crossover operator and the the mutation operator. The first step in each iteration is to select the parents for the next generation. Here we apply a fitness proportional selection, i.e., the probability of each individual \(i\) at some generation \(t\) to be selected as a parent is proportional to \(\mathcal{J}(\mathbf{x}_{i}[t])\). Mathematically, the probability of \(i\) being selected as a parent is defined as:

\[\Pr(\mathbf{\Phi}_{i})=\frac{\mathcal{J}(\mathbf{\Phi}_{i})}{\sum\limits_{j=1 }^{N}\mathcal{J}(\mathbf{\Phi}_{j})} \tag{24}\]

The crossover operator is responsible for combining the parent's chromosomes and generating the children's ones. To do this and simultaneously satisfy the constraints in Equations (10)-(12), we propose the use of a one-point crossover. To understand how the crossover operation is carried out, we first revisit the pilot sequence allocation hypermatrix which is a \(K\times T_{p}\times L\) hypermatrix. Moreover, the crossover point is set at one of the cells and is defined as \(\ell^{\prime}\). Hence, the first child is made of the individual allocation matrices from both parents: from cell \(1\) to \(\ell^{\prime}\), the matrices are from the first parent and from cell \(\ell^{\prime}+1\) to \(L\) from the second parent. Its sibling is the mirror of that, i.e., the first parent passes the matrices from \(\ell^{\prime}+1\) to \(L\), while the second parent the matrices from \(1\) to \(\ell\). We define \(\ell^{\prime}=\lfloor L/2\rfloor\). The choice of this technique among the many others in the literature is involved in creating children to AG where they did not respect all the constraints of the problem domain. For this reason, the one-point crossover utilized granted that all children generated of crossing fathers are on the feasible solution for the problem. To preserve the best solution throughout the generations if all the descendants at a given generation are worse than the best individual so far, we replace the worst individual of that generation with the best solution from the previous generation. Finally, the mutation of an individual is carried out in a way that also satisfies the constraints in Equations (10)-(12). Without the loss of generality, let \(K=T_{p}\) be even. The first step of the mutation operator is to generate a random permutation of the numbers from one to \(K\) for each cell \(\ell\). Let \(\mathbf{p}_{\ell}=[p_{1},\dots,p_{K}]\) be that permutation, the first half of the permutation \(\mathbf{p}_{\ell}\), i.e., from \(p_{1}\) to \(p_{\frac{K}{2}}\), is paired up element-wise with the second half, that is \(p_{\frac{K}{2}+1}\) to \(p_{K}\). Finally, we perform operations in the child hypermatrix such that for each cell's permutation the users defined by the number in each half permutation swap their pilot sequence. It is worth noting that mutation does not happen for every individual since there is a mutation rate \(T_{m}\in(0,1)\) which defines the probability of a mutation occurring in each member of a population. These three operations happen at each iteration of the GA and are repeated until the maximum number of generations is achieved. The pseudocode for the adapted binary GA is presented in Algorithm 3. The literature has other candidate solutions for use, but this problem as described in Section 2 is a combinatorial optimization problem. In a general way, the methods utilized are mathematically complex and in binary or integer scenarios. Considering all the constraints introduced, the approach in the literature is not easy to adapt.