# An Enhanced Particle Swarm Optimization (PSO) Algorithm Employing Quasi-Random Numbers
## 2 Materials and Methods
The corresponding position is updated according to the following equation:  
\[x_{n+1}{}^{ij}=x_{n}{}^{ij}+v_{n+1}^{ij} \tag{2}\]
* Check Stopping Criteria:
* If the maximum number of iterations is reached or a satisfactory solution is found, stop the algorithm. * Otherwise, go back to step 2 and repeat the process. * Output: Return the global best position as the solution to the optimization problem. * **Quasi-random sequence enhancements*
* In this work, we hypothesize that the success of PSO depends on the choice of appropriate random samples. At each iteration of PSO, two random numbers are generated for each decision variable, as shown in Equation (1). These random numbers are computer-generated random numbers and are called pseudorandom numbers or Monte Carlo random numbers. A sequence of random numbers must have two essential properties: uniformity, i.e., they are equally probable everywhere, and independence, i.e., the current value of a random variable has no relation with the previous values. Figure 1 shows the two random variables generated using a computer (Monte Carlo or pseudorandom numbers) with samples equal to 100. As seen in the figure, for uniformity, the points should be equally distributed; that is not the case here. We need more samples to cover the points equally in
that 2-dimensional space. This means more iterations of the algorithm. To circumvent this problem and to increase the efficiency of PSO, we are presenting a construct based on quasi-random numbers. Some well-known quasi-random sequences are Halton, Hammersley, Sobol, Faure, Korobov, and Neiderreiter [11; 12; 13]. The choice of an appropriate quasi-Monte Carlo sequence is a function of discrepancy. Discrepancy is a quantitative measure of the deviation of the sequence from the uniform distribution. Therefore, it is desirable to choose a low discrepancy sequence. The Halton, SOBOL, and Hammersley are some examples of low-discrepancy sequences. Here, we are working with the two sequences, Halton and SOBOL, as described below. **Halton Sequence Points:**  
The design of Halton points is given below. Any integer n can be written in radix-R notation (R is an integer) as follows:  
\[n\equiv n_{m}n_{m-1}\ldots n_{2}n_{1}n_{0} \tag{3}\]  
\[n=n_{0}+n_{1}R+n_{2}R^{2}+\ldots+n_{m}R^{m} \tag{4}\]  
where \(m=[\log_{R}n]=[\ln n/\ln R]\) (the square brackets denote the integral part). A unique fraction between 0 and 1 called the inverse radix number can be constructed by reversing the order of the digits of n around the decimal point as follows:  
\[\varphi_{R}(n)=n_{0}n_{1}n_{2}\ldots n_{m}=n_{0}R^{-1}+n_{1}R^{-2}+\ldots+n_{ m}R^{-m-1} \tag{5}\]  
The Halton points on a \(k\)-dimensional cube are given by the following sequence:  
\[\stackrel{{\rightarrow}}{{z}}_{k}(n)=\left(\varphi_{R_{1}}(n), \varphi_{R_{2}}(n),\ldots,\varphi_{R_{k-1}}(n)\right),\;n=1,2,\ldots,N+1 \tag{6}\]  
where \(R_{1}\), \(R_{2}\),...\(R_{k-1}\) are the first \(k-1\) prime numbers. The Halton points are \(\stackrel{{\rightarrow}}{{x}}_{k}(n)=1-\stackrel{{ \rightarrow}}{{z}}_{k}(n)\). Figure 1: Two-dimensional pseudorandom numbers (100 points). Figure 2 shows 2-dimensional Halton points (100 samples), which shows better uniformity than Figure 1.  
**SOBOL Sequence Points:**  
Like many other quasi-random sequences, the SOBOL sequence starts from the Van der Corput sequence in base 2. To generate the Vander Corput sequence, consider the k-th point in the Sobol sequence; this integer k can be written as a linear combination of a nonnegative power of base 2 as follows. \[k=a_{0}(k)+2a_{1}(k)+2^{2}a_{2}(k)+\ldots+2^{r}a_{r}(k) \tag{7}\]  
where \(r\) is a large number. Then, the \(k^{th}\) element in the Sobol sequence is given by the following equation:  
\[x^{k}=1/2y_{1}(k)+1/2^{2}y_{2}(k)+\ldots+1/2^{r}y_{r}(k) \tag{8}\]  
where the coefficients \(y_{i}(k)\) can be obtained using the following expression:  
\[ \begin{cases}y_{1}(k)\\ y_{2}(k)\\ \cdots\\ y_{r}(k)\end{cases} =\text{V} \begin{pmatrix}a_{0}(k)\\ a_{1}(k)\\ \ldots\\ a_{r-1}(k)\end{pmatrix}