## 3 Models and Methods
### Particle Swarm Optimization  
PSO is a well-known optimization algorithm that belongs to the swarm intelligence category. Several examples are available in the literature where neural networks are successfully trained using PSO. This algorithm essentially consists of numerous particles that float through the problem space analyzing the possible solutions and progressing to the best ones. The initialization of the algorithm is performed by generating N particles with arbitrary positions \(x_{i}\) moving with the velocities \(v_{i}\). Any \(i\)th particle's velocity vector can be denoted by \(v_{i}=(v_{i1},v_{i2},v_{i3},\ldots,v_{in})\) and the position vector \(x_{i}=(x_{i1},x_{i2},x_{i3},\ldots,x_{in})\) in N-dimensional space. Every particle maintains a record of the best-found positions/solution in the problem space called personal best denoted by \(pbest_{i}\), as well as the best position found by all particles in the neighborhood represented by \(gbest_{i}\). Let \(pbest_{i}=(x_{i1}^{pbest},x_{i2}^{gbest},x_{i3}^{pbest},\ldots,x_{in}^{pbest})\), and \(gbest=(x_{1}^{gbest},x_{2}^{gbest},x_{3}^{gbest},\ldots,x_{in}^{gbest})\) are, respectively, the best position of a particle i and the global best positions found by the particles. At every iteration k, every particle relocates itself to a new position depending on its previous location and velocity. On the contrary, the typical evolutionary algorithms evaluate the new solutions by using the operator's mutation and crossover. The fitness is determined via objective functions, and eventually, this fitness evaluates which positions are the best possible solutions. Every particle position is updated depending on the best personal position of its own, as well as of its neighborhood. After (predefined) numbers of calculation steps, the particles should be converging toward the best solution/position by using equations of motion as shown in Equation (5). \[v_{i}^{k+1}=wv_{i}^{k}+c_{1}r_{1}(pbest_{i}^{k}-x_{i}^{k})+c_{2}r_{2}(gbest_{i }^{k}-p_{i}^{k}) \tag{5}\]  
In Equation (5), \(v_{i}^{k}\) represents the velocity of the dimension \(d\) of the particle \(i\) in time \(t\). Equation (6) is used to update the position of a particle. In Equation (6), \(p_{i}^{k}\) refers to the position of particle \(i\) at time \(t\) in \(d\)th dimension and \(v_{i}^{k+1}\) is the velocity calculated in Equation (5) [27]. Algorithm 2 shows the steps of PSO. \[p_{i}^{k+1}=p_{i}^{k}+v_{i}^{k+1} \tag{6}\]```
Input :initial population Output : best particles \(P\)=population size \(p\)=\(i_{th}\) particle in \(P\)  calculate fitness of \(p\) according to Equation (4)  calculate velocity of \(p\) according to Equation (5) \(gbest\)=global best position \(pbest\)=particles' best position for each particle \(p\) in \(P\)do  Initialize \(X_{ij}^{t}\) randomly  initialize velocity \(v\) randomly  evaluate \(p_{i}\)  update \(pbest\) and \(gbest\)  end for return best particle
```

**Algorithm 2**Particle Swarm Optimization

### Proposed Algorithm

The proposed resource utilization prediction algorithm is trained with hybrid GA-PSO for better resource management. Due to the huge size of user applications and large number of resources, resource management becomes a challenge. The accuracy of the resource prediction model strongly influences resource utilization and other factors related to cloud performance. The prediction model should have the ability to handle multiple resources. GA-PSO algorithms are used to combine the two training models to help the effective management of cloud resources. Literature shows that increasing the number of iteration of GA-based algorithms leads to improved solutions in comparison to other algorithms. However, large number of iterations leads to more execution time for convergence to best solutions. On the other hand, PSO yields solutions in less time as compared to other algorithms. However, PSO suffers from the problem of fast convergence and local optima. The proposed algorithm takes advantage of the strength of both GA and PSO to produce better results.