# Multi-Objective PSO with Variable Number of Dimensions for Space Robot Path Optimization
## 3 Optimization Methods
### Variable Number of Dimensions MOPSO
#### 3.1.2 Vndompos  
The MOPSO algorithm as described in the previous subsection is used as the general framework of the novel VNDMODPSO algorithm. The MOPSO algorithm also needs only few significant changes in order to solve VND-formulated problems. First, the particle's dimension, \(N_{p}\), in the initial iteration \(i=1\) is selected randomly for every \(p\)-th particle. All dimensions from the list of possible dimensions, \(\mathcal{N}\), should be selected with a uniform probability. The number of particles with individual dimensions should be approximately equal to \(N_{\text{A}}/||\mathcal{N}||\). The particles' dimensions are distributed so that there are no or minimal differences between sizes of dimensional clusters, i.e., sets of particles with the same dimension. If \(N_{\text{A}}\geq||\mathcal{N}||\), it should be ensured that at least one particle is in every dimensional cluster from the list \(\mathcal{N}\). Next, we need to enable the DSVs \(\mathbf{u}\), manipulated by VNDMOPSO, to have different dimensions. Therefore, the four vectors, \(\mathbf{g}_{p}\), \(\mathbf{b}_{p}\), \(\mathbf{v}_{p}\), and \(\mathbf{u}_{p}\), used in (7), can be of three different lengths:  
1. \(N_{\text{g}}\): size of the global best, \(\mathbf{g}\);
2. \(N_{\text{b}}\): size of the personal best, \(\mathbf{b}\);
3. \(N_{\text{u}}\): the previous dimension of the agent \(\mathbf{u}(i-1)\) (and its velocity \(\mathbf{v}(i-1)\), also). The new dimension, \(N_{p}\), of the \(p\)-th particle is determined based on the simple approach presented in Algorithm 2. The new dimension is selected on a random basis but taking into account user-defined probabilities [19]:  
1. \(p_{\text{g}}\): probability of global best dimension, \(N_{\text{g}}\);
2. \(p_{\text{b}}\): probability of personal best dimension, \(N_{\text{b}}\). The probabilities are set so that \(\big{(}p_{\rm g}+p_{\rm b}\big{)}\leq 1.0\), as shown in Figure 2a. The lower the values of \(p_{\rm g}\) and \(p_{\rm b}\) are, the higher the diversity of dimensions of particles is. In an extreme case when \(p_{\rm g}+p_{\rm b}=0\), all the particles remain in their initial randomly selected dimension. On the other hand, the dimensional diversity is quickly lost when \(p_{\rm g}+p_{\rm b}=1.0\). In that case, the particles are forced to change their dimension to the dimension of non-dominated DSVs that are found in the early iterations of the optimization and stored in \(\mathcal{E}\). After the new dimension, \(N_{p}\), of the \(p\)-th particle is selected using Algorithm 2, the potentially different dimensions of vectors \(\mathbf{g}_{p}\), \(\mathbf{b}_{p}\), \(\mathbf{v}_{p}\), and \(\mathbf{u}_{p}\) have to be balanced. The process of balancing the dimensions of the vectors is shown in Figure 2b. The vectors whose dimensions are higher than the selected one are trimmed so that their sizes are equal to \(N_{p}\). On the other hand, if any vector has fewer elements than \(N_{p}\), the missing elements are taken from the other vector, having at least \(N_{p}\) elements. Please note that the priority is decreasing from the \(\mathbf{g}_{p}\), over \(\mathbf{b}_{p}\), to \(\mathbf{v}_{p}\), so that the convergence is strengthened. The global best, \(\mathbf{g}_{p}\), and personal best, \(\mathbf{b}_{p}\), contain non-dominated vectors. The general pseudocode of the VNDMOPSO is summarized in Algorithm 3. The VNDMOPSO needs inputs in the form of (1) problem definition (the definition of objective functions, \(\mathbf{f}\), the list of feasible dimensions, \(\mathcal{N}\), and the limits of the decision space, \(\Omega\)); and (2) set of user-defined control parameters, \(\mathcal{S}\).