# Hybrid Improved PSO Algorithm for Soil Property Parameter Estimation
## 3 Improvement of the PSO Algorithm
### Improvement in Position Update  
In the EDO algorithm, two matrices, \(\mathbf{X}\) and \(\mathbf{Y}\), are constructed. Matrix \(\mathbf{X}\) stores the historical best positions of all particles, while matrix \(\mathbf{Y}\) stores the newly generated positions of the particles. To simulate the memoryless property, changes in the positions in \(\mathbf{Y}\) do not need to consider the corresponding values in \(\mathbf{X}\). Before updating the position of particle \(i\), a random number \(\alpha_{i}\) is generated using a random number generator, where \(\alpha_{i}\) lies within the range of [0, 1]. If \(\alpha_{i}<0.5\), the position of particle \(i\) is updated according to Equations (21)-(24):  
\[v_{i}= \begin{cases}a\Big{(}y_{i}^{k}-\sigma^{2}\Big{)}+bx_{guide}^{k}&\quad if \ x_{i}^{k}=y_{i}^{k}\\ b\Big{(}y_{i}^{k}-\sigma^{2}\Big{)}+log(\varphi)*x_{i}^{k}&\quad else\end{cases}  \tag{21}\]  
\[ \begin{cases}\quad\quad\quad a=f^{10}\\ \quad\quad\quad b=f^{5}\\ \quad\quad f=2*rand(\,)-1\end{cases}  \tag{22}\]  
\[\sigma=\frac{x_{i}^{k}+y_{i}^{k}}{2} \tag{23}\]  
\[x_{guide}^{k}=\frac{x_{1}^{k}+x_{2}^{k}+x_{3}^{k}}{3} \tag{24}\]  
where \(v_{i}\) represents the updated position of particle \(i\); \(\sigma\) denotes the standard deviation; \(x_{i}^{k}\) is the historical best position of particle \(i\) during the \(k^{th}\) iteration, and \(y_{i}^{k}\) is the position of particle \(i\) during the \(k^{th}\) iteration. \(x_{guide}^{k}\) denotes the guiding solution of the swarm at the \(k^{th}\) iteration, where \(x_{1}^{k}\) is the optimal solution, \(x_{2}^{k}\) is the second-best solution, and \(x_{3}^{k}\) is the third-best solution of the population at the \(k^{th}\) iteration. rand() represents a random number in the range [0, 1], and \(\varphi\) also denotes a random number within the range [0, 1]. If \(\alpha_{i}\geq 0.5\), the particle swarm updates its position using the PSO algorithm. Since the PSO algorithm converges quickly, it enhances the computational speed of the overall algorithm. The updated formula is provided in Equation (25):  
\[ \begin{pmatrix}V_{i}^{k+1}=\omega V_{i}^{k}+c_{1}r_{1}\Big{(}P_{i}-X_{i}^{k} \Big{)}+c_{2}r_{2}\Big{(}G_{i}-X_{i}^{k}\Big{)}\\ v_{i}^{k+1}=X_{i}^{k}+V_{i}^{k+1}\end{pmatrix}  \tag{25}\]The PSO-EDO proposed in this study operates on the physical principle of randomly dividing the particle swarm into two subgroups: an EDO optimization subgroup and a PSO optimization subgroup. The EDO subgroup conducts its search based on the memoryless property of exponential distribution. For instance, in a discrete solution space (e.g., four possible directions: up, down, left, right), if a particle has moved left ten consecutive times, the probability of moving right in the next step remains 25%, completely independent of its historical trajectory. Meanwhile, the PSO subgroup achieves rapid convergence through inertia preservation, individual best (pbest), and global best (gbest) guidance mechanisms, thereby enhancing computational efficiency. After each iteration, particles that previously belonged to the PSO subgroup and may have become trapped in local optima have a chance to be randomly reassigned to the EDO subgroup in the subsequent iteration. This reassignment leverages the memoryless property to facilitate escape from local optima. In summary, the pseudocode for the PSO-EDO computational process is as follows (Algorithm 1):  
```
Set the maximum number of iterations \(K\), the number of particles \(N\), and the upper \(U_{b}\) and lower \(L_{b}\) bounds of the particle positions and the dimensions \(D\) of the fitness function. Initialize the population based on SPM chaotic mapping. Initialize the population \(\mathbf{X}\), compute the fitness of each individual, and sort them. Initialize the memoryless matrix \(\mathbf{Y}\) as \(\mathbf{Y}=\mathbf{X}\). for\(k=1:K\)  Identify the top three optimal individuals and compute the guiding solution \(x_{guide}^{k}\) using Equation (24). Calculate \(a\), \(b\), \(f\), and \(\sigma\) using Equations (22) and (23).