# Parallel Compact Differential Evolution for Optimization Applied to Image Segmentation
## 3 Parallel Compact Differential Evolution
```
1\(t=0\)\(g=3\)//Groups Initialization
2 fori=1:gdo
3 Initialize \(Group[i].PV\)
4 generate \(Group[i].elite\) by \(Group[i].PV\)
5 whilebudget conditiondo
6 //Mutation
7 parallelforevery groupdo
8 generate 3 individuals \(Group[m].x_{r}\), \(Group[m].x_{s}\), \(Group[m].x_{t}\) by \(Group[m].PV\)
9 compute \(Group[m].x^{{}^{\prime}}_{off}=Group[m].x_{t}+F*(Group[m].x_{r}-Group[m].x_{s})\)//Crossover
10\(Group[m].x_{off}=Group[m].x^{{}^{\prime}}_{off}\)
11 fori=1:ndo
12 ifrand(0,1)>Crthen
13\(Group[m].x_{off}[i]=Group[m].elite[i]\)//Selection
14\([winner,loser]=\)compete\((Group[m].x_{off},Group[m].elite)\)
15 if\(Group[m].x_{off}==winner\)then
16\(Group[m].elite=Group[m].x_{off}\)
17 //PV Update
18 fori=1:ndo
19\(Group[m].u^{t+1}[i]=Group[m].u^{t}[i]+(winner[i]-loser[i])/Np\)
20\(temp=(Group[m].\sigma^{t}[i])^{2}+(Group[m].u^{t}[i])^{2}-(Group[m].u^{t+1}[i])^{2}\)
21\(Group[m].\sigma^{t+1}[i]=\sqrt{temp+(winner[i]^{2}-loser[i]^{2})/Np}\)
22
23 Find the group with the most adaptable solution and record the group number as \(I\)
24 if\(mod(t,\theta)==0\)then
25 fori=1:gdo
26\(Group[i].PV=Group[I].PV\)
27\(Group[i].elite=Group[I].elite\)
28\(t=t+1\)
29
```
1\(t=0\)
2\(g=3\)//Groups Initialization
3 same as pcDE(optimal elite)
4 whilebudget conditiondo//Mutation
5 parallelforeverygroupdo
6 same as ppe-cDE(optimal elite)
7//Crossover
8 same as ppe-cDE(optimal elite)
9//Selection
10 same as ppe-cDE(optimal elite)
11//PV Update
12 same as ppe-cDE(optimal elite)
13 if\(mod(t,\theta)==0\)then
14 fori=1:ndo
15 Initialize\(PVsum[i]=0\)
16 Initialize\(elitesum[i]=0\)
17 fori=1:gdo
18\(PVsum=PVsum+Group[i].PV\)
19\(elitesum=elitesum+Group[i].elite\)
20 fori=1:gdo
21\(Group[i].PV=PVsum/g\)
22\(Group[i].elite=elitesum/g\)
23\(t=t+1\)
```

**Algorithm 5**pcDE (mean elite) algorithm pseudocode (rand/1/bin)

## 4 Numerical Results

Figure 2 shows the test function used in this paper, with f1, f2, f8, f9, f15-f17 coming from [37], f3-f7, f10, f19 from [38], f11-f14, f20 from [39], f18, f21-f25 from [40]. For each test function, we test it with the previously mentioned algorithms. f1-f17 are tested with \(n=10\) and \(n=30\); f18-f25 are tested in the specified dimensions. Each algorithm runs independently for 10 times. The number of parallel groups is set to 3. Each test is performed in \(5000*n\) iterations. The number of virtual population Np is set as \(2*n\). The mean of 10 independent experiments is used as the experimental result. Table 1 shows the experimental results of two parallel strategies (persistent elitism version, \(F=0.1\), \(Cr=0.1\), rand/1/bin). Table 2 shows the experimental results of two parallel strategies (non-persistent elitism version, \(F=0.1\), \(Cr=0.1\), rand/1/bin). The best results are highlighted in boldface. From Table 1, we can see that in the 17 tests with n = 10, pcDE achieves the best results of 15 tests, while cDE only achieves 2; when n = 30, the result is the same; in the 8 tests with n = various, pcDE achieves the best results of 6 tests, while cDE achieves only 2. From Table 2, we can see that in the 17 tests with n = 10, pcDE achieves the best results of 16 tests, while cDE only achieves 1; when n = 30, pcDE achieves the best results of 14 tests, while cDE achieves only 3; in the 8 tests with n = various, pcDE achieves the best results of all tests. From the above data, we can see that the performance of pcDE is significantly better than that of cDE. Figure 3 shows the performance trends of pcDE and cDE algorithms. We also test the effects of two communication strategies on experimental results under three different schemes. The three schemes are:1.rand/1/bin, 2.best/1/bin, 3.rand-to-best/1/bin.