# A Novel Binary QUasi-Affine TRansformation Evolutionary (QUATRE) Algorithm
## 3 Proposed Binary QUATRE Algorithm
### Binary QUATRE Algorithm--Approach 2 (BQUATRE2)  
The second approach of binary QUATRE algorithm (BQUATRE2) only converts the mutation matrix \(B\) to the binary. In this section, BQUATRE2 will be described in detail.  
Again, we suppose that the position matrix at \(Gth\) generation \(X_{G}\) is got. First of all, \(M\) and \(\overline{M}\) can be obtained in the same way.  
The mutation matrix \(B\) is calculated according to Equations (9) and (11). The particle \(i\) of \(B\) in \(k\) dimension can be denoted as \(b_{ik}\), where \(i=1,2,...,ps\) and \(k=1,2,...D\). Since all elements in \(B\) are continuous values, the improved families of transfer functions \(T_{i}(x)\) are used in this approach. In order to distinguish, the continuous mutation matrix is denoted as \(B^{cont}\), while the binary mutation matrix denoted as \(B^{bin}\).  
Then, we should convert the probability value \(T_{i}(x)\) to binary. If the S-shaped families of transfer functions are selected, consider the second case in Section 3.1, that is if \(X_{gbest,G}=0\), \(X_{r1,G}=0\) and \(X_{r2,G}=1\), then \(B\in[-2,0]\). In this situation, the \(b_{ik}\) should have a high probability to be \(0\) for only the value of \(X_{r2,G}\) is not \(0\). Similarly, consider the seventh case in Section 3.1, if \(X_{gbest,G}=1\), \(X_{r1,G}=1\) and \(X_{r2,G}=0\), then \(B\in[1,3]\). If the value of \(b_{ik}\) have a high probability to be \(0\), the design is reasonable. Therefore, if the S-shaped functions are selected, the Equation (7) is replaced by Equation (15) to updatedwith the probability value in BQUATRE2. Among them, \(b_{ik}^{bin}\) is the element of \(B^{bin}\), \(b_{ik}^{cont}\) is the element of \(B^{cont}\), where \(i=1,2,...ps\) and \(k=1,2,...D\).  
\[b_{ik}^{bin}=\left\{\begin{array}{ll}1,&rand<T_{i}(b_{ik}^{cont})\\ 0,&rand\geq T_{i}(b_{ik}^{cont})\end{array}\right. \tag{15}\]  
If the improved V-shaped, U-shaped or Z-shaped families of functions, which are described in Tables 7-9 are chosen, we still adopt the strategy shown as Equation (8) to update the probability value. In this approach, the update function is shown in Equation (16), where \(x_{ik,G}\) is a binary value that shows the position of particle \(i\) in \(k\) dimension at \(G\) generation. Then, the whole binary mutation matrix \(B^{bin}\) can be obtained. Finally, the position matrix \(X_{G+1}\) can be obtained.  
\[b_{ik}^{bin}=\left\{\begin{array}{ll}(x_{ik,G})^{-1},&rand<T_{i}(b_{ik}^{cont })\\ x_{ik,G},&rand\geq T_{i}(b_{ik}^{cont})\end{array}\right. \tag{16}\]  
The pseudo code of BQUATRE2 described in Algorithm 3.  
```
1: The dimension \(D\), population size \(ps\), max iterations \(MAXG\), fitness function \(f(X)\) mutation schema to calculate \(B\), and improved transfer function \(T_{i}(x)\).
2:Initialization:
3: Initialize searching space \(V\), \(G=1\), position matrix \(X_{G}\)\(X_{pbest,G}=X_{G}\) and calculation \(X_{gbest,G}\).
4:Iteration:
5:while\(G<MAXG|stopCriterion\)do
6: Generate matrix \(M\) by graduation (5), calculate \(\overline{M}\)
7:\(F=(F_{max}-F_{min})\times\frac{G}{MAXG}\)
8: Calculation continues mutation Matrix \(B^{cont}\) according to mutation schema.
9: Convert every element \(b_{ik}^{cont}\) to probability value \(T_{i}(b_{ik}^{cont})\) by improved transfer function.
10: Convert \(T_{i}(b_{ik}^{cont})\) to binary \(b_{ik}^{bin}\) by Equation (14) or Equation (15).
11:\(X_{G+1}=M\bigotimes X_{G}+\overline{M}\bigotimes B^{bin}\)
12:for\(i=1:ps\)do
13:if\(f(x_{i,G+1})\) optimal than \(f(x_{ipb,G})\) then
14:\(x_{ipb,G+1}=x_{i,G+1}\)
15:else
16:\(x_{ipb,G+1}=x_{ipb,G}\)
17:endif
18:endfor
19:\(X_{G+1}=X_{pbest,G+1}\)
20:\(x_{gbest,G+1}=opt\{X_{pbest,G+1}\}\).
21: Update \(X_{gbest,G+1}\) by Equation (2).
22:\(G=G+1\)
23:endwhile
24:The global optima \(X_{gbest,G},f(X_{gbest,G})\).
```  
**Algorithm 3**Pseudo code of binary QUATRE algorithm-Approach 2(BQUATRE2).