# Hybrid Particle Swarm Optimization-Jaya Algorithm for Team Formation
## 5 Improved PSO-Jaya Optimization Algorithm (I-PSO-Jaya)
```
Input :P: Number of Particles, \(MaxIter\): Maximum Iterations, S: Skills Output :Min cost - The team's best subset with Minimum Communication Cost: \(f(X)\)
1 Initialize the positions of particles randomly within the search space;
2 Set the iteration counter \(c\gets 0\);
3 for\(i\gets 1\)to\(S\)do
4 for\(j\gets 1\)to\(P\)do
5 Generate the initial population randomly to initialize \(X_{i,j}^{c}\);
6 Compute the fitness function \(f(x_{i})^{c}\) of particle \(i\);
7 Set \(p_{\text{best}}^{c}\) as the best personal solution in the population;
8 Set \(g_{\text{best}}^{c}\) as the best global solution in the population;
9 repeat
10 for\(i\gets 1\)to\(S\)do
11 for\(j\gets 1\)to\(P\)do
12 Update velocity: \[v_{i}^{(c+1)}=v_{i}^{(c)}\oplus\alpha\otimes(p_{\text{best}_{i}}^{c}-x_{i}^{(c )})\oplus\beta\otimes(g_{\text{best}_{i}}^{c}-x_{i}^{(c)})\] ;
13 Update position: \[x_{i}^{(c+1)}=x_{i}^{(c)}\oplus v_{i}^{(c+1)}\] ;
14 Perform a crossover operation between \(g_{\text{best}}^{c}\) and the current solution \(x_{i}^{(c+1)}\);
15 Choose the best offspring solution \(x_{i}^{(c+1)}\) and update the solution using the Jaya equation:; \[X_{i,j}^{c+1}=X_{i,j}^{c}\oplus r_{1,j}^{c}\otimes[X_{i,\text{best}}^{c}-X_{i,j}^{c}]-r_{2,j}^{c}\otimes[X_{i,\text{worst}}^{c}-X_{i,j}^{c}]\] ;
16 if\(f(X_{i,j}^{(c+1)})\leq f(X_{i}^{(c)})\)then
17\(x_{i}^{(c+1)}=X_{i,j}^{(c+1)}\);
18
19 Increment the iteration counter \(c\gets c+1\);
20 Update the position of \(g_{\text{best}}^{c}\) to determine the optimized best solution \(f(X)^{(c+1)}\);
21 until\(c>MaxIter\);
22 Return the best solution \(f(X)\);
```  
**Algorithm 1**Improved PSO with Jaya Optimization (I-PSO-Jaya) Algorithm  
```
Input :P: Number of Particles, \(MaxIter\): Maximum Iterations, S: Skills Output :Min cost - The team's best subset with Minimum Communication Cost: \(f(X)\)
1 Initialize the positions of particles randomly within the search space;
2 Set the iteration counter \(c\gets 0\);
3 for\(i\gets 1\)to\(S\)do
4 for\(j\gets 1\)to\(P\)do
5 Generate the initial population randomly to initialize \(X_{i,j}^{c}\);
6 Compute the fitness function \(f(x_{i})^{c}\) of particle \(i\);
7 Set \(p_{\text{best}}^{c}\) as the best personal solution in the population;
8 Set \(g_{\text{best}}^{c}\) as the best global solution in the population;
9 repeat
10 for\(i\gets 1\)to\(S\)do
11 for\(j\gets 1\)to\(P\)do
12 Update velocity: \[v_{i}^{(c+1)}=v_{i}^{(c)}\oplus\alpha\otimes(p_{\text{best}_{i}}^{c}-x_{i}^{(c )})\oplus\beta\otimes(g_{\text{best}_{i}}^{c}-x_{i}^{(c)})\] ;
13 Update position: \[x_{i}^{(c+1)}=x_{i}^{(c)}\oplus v_{i}^{(c+1)}\] ;
14 Perform a crossover operation between \(g_{\text{best}}^{c}\) and the current solution \(x_{i}^{(c+1)}\);
15 Choose the best offspring solution \(x_{i}^{(c+1)}\) and update the solution using the Jaya equation:; \[X_{i,j}^{c+1}=X_{i,j}^{c}\oplus r_{1,j}^{c}\otimes[X_{i,\text{best}}^{c}-X_{i,j}^{c}]-r_{2,j}^{c}\otimes[X_{i,\text{worst}}^{c}-X_{i,j}^{c}]\] ;
16 if\(f(X_{i,j}^{(c+1)})\leq f(X_{i}^{(c)})\)then
17\(x_{i}^{(c+1)}=X_{i,j}^{(c+1)}\);
18
19 Increment the iteration counter \(c\gets c+1\);
20 Update the position of \(g_{\text{best}}^{c}\) to determine the optimized best solution \(f(X)^{(c+1)}\);
21 until\(c>MaxIter\);
22 Return the best solution \(f(X)\);
```  
**Algorithm 2**Improved PSO with Jaya Optimization (I-PSO-Jaya)  
Algorithm 3: The complexity of the algorithm is \(O(MaxIter\times S\times P)\). Complexity of I-PSO-Jaya:  
The time complexity of our proposed algorithm is calculated as follows:  
1. **Initialization**: The complexity is \(O(P)\). 2. **Initial Population Generation**: The complexity is \(O(S\times P)\). 3. **Fitness Computation and Best Solution Updates**: The complexity is \(O(P)\). 4. **Main Loop**: The loop iterates _MaxIter_ times, with the inner operations having a complexity of \(O(S\times P)\) for each iteration. Therefore, the overall time complexity of the algorithm is \(O(MaxIter\times S\times P)\).