1 Introduction

Swarm intelligence optimization algorithm comes from simulating the behavior of various groups in nature, human society and animals. The purpose of finding the global optimal value is to use the individual information interaction and cooperation in the group. Compared with other types of optimization algorithms, swarm intelligence optimization algorithm is simple, easy to implement, higher efficiency and accuracy. At present, the most popular swarm intelligence optimization algorithms are ant colony optimization (ACO) [1], differential evolution (DE) [2], particle swarm optimization (PSO) [3]. In recent years, some new swarm intelligent algorithms have been proposed, such as flower pollination algorithm (FPA) [4], cuckoo search (CS) [5], firefly algorithm (FA) [6], charged system search (CSS) [7], bat algorithm (BA) [8], grey wolf optimization (GWO) [9]. At present, swarm intelligent optimization algorithm, as a meta-heuristic algorithm based on swarm intelligence, has been widely used in many fields such as engineering, network communication, finance, automatic control and so on.

Symbiotic Organisms Search (SOS) was a new meta-heuristic algorithm proposed by Cheng and Prayogo [10]. Compared to most meta-heuristic algorithms, the SOS algorithm has an obvious advantage that the algorithm does not require special algorithm parameter settings. SOS algorithm structure is simple, easy to understand, so by more and more scholars of the study. At present, the symbiotic organism search algorithm has been applied to such as task scheduling in cloud computing environment [11], large-scale economic dispatch problem with valve-point effects [12], optimal power flow of power system with FACTS devices [13], DG placement in radial distribution network [14] and many other aspects.

In expressing neural network weights [15] and representing individual genes for evolutionary algorithms [16], the complex encoding [17] method has been applied. So this paper presents a complex-valued encoding symbiotic organisms search (CSOS). The original SOS algorithm is implemented in real-coded way to encode the algorithm. In this way, the application scope of the algorithm is limited to the real range, which limits the diversity of the population and is not conducive to the optimization of the algorithm. Compared with the real number coding, complex code has many advantages [15,16,17]. The contribution of this paper is to introduce the idea of complex coding into the SOS algorithm and propose a symbiotic organisms search algorithm based on complex coding. In the CSOS algorithm, the structure of the real and imaginary parts of the complex code is introduced into the SOS algorithm, and the two-dimensional coding space of the complex code is used to map the real-coded one-dimensional coding space. We use real and imaginary parts to collectively represent a biological individual in the population, and the real and imaginary parts are updated separately to find the optimal value of the algorithm. This haploid structure expands the information contained in the individual genes of the organism in the symbiotic organisms search algorithm, increases the biodiversity of the individual in the population, improves the possibility of obtaining the optimal solution, and enhances the optimization of the algorithm ability.

The remainder of this paper is structured as follows: Sect. 2 briefly introduces the basic symbiotic organism search (SOS) algorithm; Sect. 3 presents a complex-valued encoding symbiotic organisms search (CSOS) algorithm; simulation experiments and results analysis are presented in Sect. 4; Sect. 5 presents the conclusions of this paper.

2 Symbiotic organisms search (SOS)

Symbiotic Organism Search (SOS) was proposed by Cheng and Prayogo [10]. The SOS algorithm is inspired by the interaction between various organisms in an ecosystem. In nature, biological individuals usually use the symbiotic relationship with other organisms to improve their survival ability. In an ecosystem, mutualism, commensalism, and parasitism are the most fundamental relationships found in the living organisms. These three symbiotic relationships are shown in Fig. 1 [18]. The details about these processes are narrated below [10, 14].

2.1 Mutualism phase

This phase the interaction between two different organisms provide benefits to both of them. As shown in Fig. 1, the relationship between flower and pollinator is a classic example to explain the philosophy of mutualism.

In SOS, \(X_i\) is an organism (matched to the ith member of the ecosystem) that interacts with another randomly selected organism \(X_j\) from the ecosystem. Both the organisms are engaged in mutualism relationship with the goal of increasing their mutual survival advantage in the ecosystem. The new solution, after the mutualism phase for \(X_{{\textit{inew}}}\) and \(X_{{\textit{jnew}}}\), which is modeled in Eqs. (1) and (2),

$$\begin{aligned}&X_{{\textit{inew}}} =X_i +{\textit{rand}}(0,1) *(X_{{\text {best}}} -{\textit{Mutual}}\_{\textit{Vector}}*{\text {BF}}_1 ) \end{aligned}$$
(1)
$$\begin{aligned}&X_{{\textit{jnew}}} =X_j +{\textit{rand}}(0,1)*(X_{{\text {best}}} -{\textit{Mutual}}\_{\textit{Vector}}*{\text {BF}}_2 ) \end{aligned}$$
(2)
$$\begin{aligned}&{\textit{Mutual}}\_{\textit{Vector}} = \frac{{{X_i} + {X_j}}}{2} \end{aligned}$$
(3)

In ecosystems, the benefits of mutualism relationship may be unequal from each other. The benefit factors (BF\(_1\) and \({\text {BF}}_2\)) are randomly chosen 1 or 2. \({\textit{Mutual}}\_{\textit{Vector}}\) represents the relationship between the two biological \(X_i\) and \(X_j\).

2.2 Commensalism phase

The Commensalism phase is the relationship between the two random organisms which one to gain benefit, while the other one has no effect. The most common examples of commensalism relationships in nature are sharks and remora fish. The remora fish is usually absorbed on the shark and depends on the remaining food residue to survive. In this relationship, the remora fish unilaterally gets the benefit, while the shark does not affect.

Fig. 1
figure 1

Process of ‘Symbiosis’ among natural organisms in an ecosystem

In SOS, \(X_i\) from the ecosystem were randomly selected with a \(X_j\) composed of a mutualism relationship. Only \(X_i\) single side benefit from \(X_j\). According to the above rules, \(X_i\) update formula as (4).

$$\begin{aligned} X_{{\textit{inew}}} =X_i +{\textit{rand}}(-1,1)*(X_{{\text {best}}} -X_j ) \end{aligned}$$
(4)

2.3 Parasitism phase

In the parasitism phase, one organism randomly chooses another organism to establish a parasitism relationship. In this parasitism relationship, one organism benefits from another, and the other are the victims. The most common examples of parasitism relationships in nature are anopheles mosquito and human host.

In SOS, \(X_i\) by creating an artificial parasite called as \({\text {Parasite}}\_{\text {Vector}}\) to play the role of anopheles mosquito. \({\text {Parasite}}\_{\text {Vector}}\) was created by duplicating organism \(X_i\), then modifying the randomly selected dimensions using a random number. The organism \(X_j\) is randomly selected from the ecosystem and is used as a host. By comparing the fitness value of \(X_j\) and \({\text {Parasite}}\_{\text {Vector}}\) in the ecosystem, the better one will survive, while the other with low value that will be eliminated.

figure d

3 Complex-valued encoding symbiotic organisms search (CSOS)

In nature, the chromosome of complex biological tissue is generally provided by the parent body, each of which is provided with a pair of chromosomes. Because of the two-dimensional nature of complex coding, it is natural to use this to represent a pair of chromosomes in the allele. The real and imaginary parts of complex numbers are called real genes and virtual genes. For a problem with M independent variables, the complex representation is shown in Eq. (5).

$$\begin{aligned} x_{p}=R_p + {\textit{il}}_p\qquad p=1,2,3,{\ldots },M. \end{aligned}$$
(5)

The gene of the organism can be expressed as a diploid structure and recorded as (\(R_p,I_p\)). Where \(R_p\) and \(I_p\) represent the real and imaginary parts of the complex number, respectively. Thus, the chromosomal model of the organism can be represented as shown in the following Table 1.

Table 1 Symbiotic organisms chromosome model

3.1 Initializing the complex-valued encoding population

According to the definition interval [\(A_k ,B_k\)], \(k=1,2,{\ldots }M\), of the problem, M modules and M amplitudes [16] are randomly generated:

$$\begin{aligned} \rho _k= & {} \left[ 0,\frac{B_k -A_k}{2}\right] ,\quad {k}=1,2,{\ldots }{M} \end{aligned}$$
(6)
$$\begin{aligned} \theta _k= & {} \left[ -2\pi ,2\pi \right] , \quad {k}=1,2,{\ldots }{M} \end{aligned}$$
(7)

According to formula (8) we get M complex numbers:

$$\begin{aligned} X_{{\textit{Rk}}} +{\textit{iX}}_{{\textit{Ik}}} =\rho _k (\cos \theta _k +i\sin \theta _k), \quad {k}=1,2,{\ldots }{M} \end{aligned}$$
(8)

Through the above process, we can get M real part and M imaginary part at the same time and then update them, respectively, in the following way.

3.2 The updating method of CSOS

3.2.1 Mutualism phase

(1) Update the Real Parts:

$$\begin{aligned}&X_R (i+1)=X_R (i)+{\textit{rand}}(0,1)*(X_{{\textit{Rbest}}} -{\textit{Mutual}}\_{\textit{Vector}}_R *{\text {BF}}_1) \end{aligned}$$
(9)
$$\begin{aligned}&X_R (j+1)=X_R (j)+{\textit{rand}}(0,1)*(X_{{\textit{Rbest}}} -{\textit{Mutual}}\_{\textit{Vector}}_R*{\text {BF}}_2 ) \end{aligned}$$
(10)
$$\begin{aligned}&{\textit{Mutual}}\_{\textit{Vector}}_R =\frac{X_R (i)+X_R (j)}{2} \end{aligned}$$
(11)

(2) Update the Imaginary Parts

$$\begin{aligned} X_I (i+1)= & {} X_I (i)+{\textit{rand}}(0,1) *(X_{{\textit{Ibest}}} -{\textit{Mutual}}\_{\textit{Vector}}_I*\,\, BF_1 ) \end{aligned}$$
(12)
$$\begin{aligned} X_I (j+1)= & {} X_I (j)+{\textit{rand}}(0,1) *(X_{{\textit{Ibest}}} -{\textit{Mutual}}\_{\textit{Vector}}_I^ *\,\, {\text {BF}}_2 ) \end{aligned}$$
(13)
$$\begin{aligned} {\textit{Mutual}}\_{\textit{Vector}}_I= & {} \frac{X_I (i)+X_I (j)}{2} \end{aligned}$$
(14)

where \(X_{{\textit{Rbest}}}\) and \(X_{{\textit{Ibest}}}\) represent the optimal solution of real and imaginary parts of all living organisms in the whole symbiotic population. \({\textit{Mutual}}\_ {\textit{Vector}}_R\) and \({\textit{Mutual}}\_{\textit{Vector}}_I\) represent the real and imaginary parts of the two biological relationships, respectively.

3.2.2 Commensalism phase

(1) Update the Real Parts:

$$\begin{aligned} X_R (i+1)=X_R (i)+{\textit{rand}}(-1,1)*(X_{{\textit{Rbest}}} -X_R (j)) \end{aligned}$$
(15)

(2) Update the Imaginary Parts

$$\begin{aligned} X_I (i+1)=X_I (i)+{\textit{rand}}(-1,1)*(X_{{\textit{Ibest}}} -X_I (j)) \end{aligned}$$
(16)

3.2.3 Parasitism phase

(1) Update the Real Parts:

In SOS, \(X_R (i)\) by creating an artificial parasite called as \({\textit{Parasite}}\_{\textit{Vector}}_R\) to play the role of anopheles mosquito. \({\textit{Parasite}}\_{\textit{Vector}}_R\) was created by duplicating organism \(X_R(i)\), then modifying the randomly selected dimensions using a random number.

(2) Update the Imaginary Parts

Similarly, \(X_I (i)\) by creating an artificial parasite called as \({\textit{Parasite}}\_{\textit{Vector}}_I\) to play the role of anopheles mosquito. \({\textit{Parasite}}\_{\textit{Vector}}_I\) was created by duplicating organism, then modifying the randomly selected dimensions using a random number.

3.3 The calculation method of fitness value

Because the complex number is composed of two parts: the real part and the imaginary part, we need to transform the coding space in the computation of fitness [16]. Therefore, before calculating the fitness value, we need to convert the complex number to real number and then calculate the fitness function value. The concrete practices are as follows:

$$\begin{aligned}&\rho _n =\sqrt{X_{R_n }^2 +X_{I_n }^2 }, \quad n=1,2,{\ldots },M . \end{aligned}$$
(17)
$$\begin{aligned}&{\textit{RV}}_n =\rho _n {\text {sgn}} \left( \sin \left( \frac{X_{I_n } }{\rho _n }\right) \right) +\frac{B_k +A_k }{2}, \quad n=1,2,{\ldots },M. \end{aligned}$$
(18)

where \({\textit{RV}}_n\) is the real variable argument after conversion. According to the real variable, the corresponding fitness function value is calculated and evaluated. If it is better than the current optimal value, it is replaced. Otherwise, the next iteration is carried out.

3.4 CSOS algorithm pseudo code

The CSOS is to incorporate the two-dimensional idea of complex number into it. In CSOS, the real part and the imaginary part are updated, respectively, which enriches the diversity of the population and enhances the global searching ability of the individual in the algorithm, and improves the performance of the algorithm.

figure e

4 Simulation experiments and result analysis

To verify the effectiveness and superiority of Complex-Valued Encoding Organism Search Algorithm (CSOS), the test of 23 standard test functions [19, 20] were tested. These 23 standard test functions are widely used in the literature. Section 4.1 gives the environment configuration of the simulation experiment. Section 4.2 Comparison results of performance of each algorithm are given. Section 4.3 The Wilcoxon rank-sum test results for CSOS and several other algorithms are given.Section 4.4 CSOS is applied to the cantilever beam and welding beam two engineering optimization problems.

Table 2 Unimodal benchmark functions
Table 3 Multimodal benchmark functions
Table 4 Fixed-dimension multimodal benchmark functions

4.1 Experimental setup

The development environment for this test is MATLAB R2012a. The test runs on AMD Athlont (tm) II*4640 processor and 4 GB memory.

4.2 Comparison of each algorithm performance

The CSOS algorithm proposed in this paper is compared with the mainstream group intelligent optimization algorithm ABC [1], CS [5], FPA [4], GWO [9], CGWO [22], SOS [10] from four aspects: the best value, the worst value, the average value and the standard. The control parameters involved in the above algorithm are shown below.

ABC setting: limit \(=5D\) has been used as recommended in [21], the population size is 20. The maximum iteration number is 100.

CS setting: \(\beta =1.5,\rho _0 =1.5\) have been used as recommended in [5], the population size is 20. The maximum iteration number is 100.

Table 5 Simulation results for test functions \(f_{i},{i} =1,2,3,4,5,6,7\)

FPA setting: switch probability \(\rho =0.8\) in accordance with the suggestions given in [10], the population size is 20. The maximum iteration number is 100.

GWO setting: \(\vec {\alpha }\) Linearly decreased from 2 to 0 have been used as recommended in [9], the population size is 20. The maximum iteration number is 100.

CGWO setting: \(\vec {\alpha }\) Linearly decreased from 2 to 0 have been used as recommended in [22], the population size is 20. The maximum iteration number is 100.

SOS setting: the population size is 20. The maximum iteration number is 100.

Table 6 Simulation results for test functions \(f_{i},{i} =8,9,10,11\)
Table 7 Simulation results for test functions \(f_{i},{i} =12,13,14,15,16,17,18,19,20,21,22,23\)

In this paper, the fifteen independent tests of the three standard benchmark functions (unimodal benchmark functions, multimodal benchmark functions, fixed-dimension multimodal benchmark functions) in Tables 2, 3 and 4 were carried out. The results of unimodal, multimodal and fixed-dimension multimodal are shown in Tables 5, 6 and 7, respectively. In the table, the best fitness value, the worst fitness value, the average fitness value and the standard deviation in the experiment are, respectively, expressed by Best, Worst, Mean and Std. All algorithms are ranked according to the value of std.

Fig. 2
figure 2

\(D=30\), evolution curves of fitness value for \(f_{01}\)

Fig. 3
figure 3

\(D=30\), ANOVA test of global minimum for \(f_{01}\)

Fig. 4
figure 4

\(D=30\), evolution curves of fitness value for \(f_{02}\)

Fig. 5
figure 5

\(D=30\), ANOVA test of global minimum for \(f_{02}\)

Fig. 6
figure 6

\(D=30\), evolution curves of fitness value for \(f_{03}\)

Fig. 7
figure 7

\(D=30\), ANOVA test of global minimum for \(f_{03}\)

Fig. 8
figure 8

\(D=30\), evolution curves of fitness value for \(f_{04}\)

Fig. 9
figure 9

\(D=30\), ANOVA test of global minimum for \(f_{04}\)

Fig. 10
figure 10

\(D=30\), evolution curves of fitness value for \(f_{05}\)

Fig. 11
figure 11

\(D=30\), ANOVA test of global minimum for \(f_{05}\)

Fig. 12
figure 12

\(D=30\), evolution curves of fitness value for \(f_{06}\)

Fig. 13
figure 13

\(D=30\), ANOVA test of global minimum for \(f_{06}\)

According to the test results obtained in Table 5, only the CSOS algorithm finds the theoretical optimal value zero of the unimodal benchmark functions \(f_1, f_2, f_3, f_4\). This shows that compared with other algorithms, CSOS has a stronger ability to find the minimum. According to the mean value and the variance, we can see that it has high robustness in unimodal benchmark functions \(f_1, f_2, f_3, f_4\). \(f_5\) and \(f_6\) are only slightly worse than the SOS algorithm in finding global minimum values, but CSOS values are smaller and more stable in terms of variance. CSOS in \(f_7\) to find the minimum is less than other algorithms. In addition, the standard deviation of CSOS is the least, which indicates that it has more stability than other algorithms. Figures 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 and 15 shows CSOS and other algorithm convergence and the anova tests of the global minimum plots. It can be seen from the figure \(f_1- f_7\) in the CSOS std. map flat, indicating that CSOS relative to other algorithms have a stronger robustness. From the convergence diagram can also be seen, CSOS in the convergence speed and accuracy is relatively fast, only in the \(f_5, f_6\) convergence accuracy slightly worse than the SOS.

Fig. 14
figure 14

\(D=30\), evolution curves of fitness value for \(f_{07}\)

Fig. 15
figure 15

\(D=30\), ANOVA test of global minimum for \(f_{07}\)

Fig. 16
figure 16

\(D=30\), evolution curves of fitness value for \(f_{08}\)

Fig. 17
figure 17

\(D=30\), ANOVA test of global minimum for \(f_{08}\)

Fig. 18
figure 18

\(D=30\), evolution curves of fitness value for \(f_{09}\)

Similarly, according to the test results obtained in Table 6, the CSOS algorithm finds the theoretical optimal value zero of the multimodal benchmark functions \(f_{8}, f_{10}\). This shows that compared with other algorithms, CSOS has a stronger ability to find the minimum. According to the mean value and the variance, we can see that it has high robustness in high-dimensional unimodal functions \(f_8, f_{10}\). For function \(f_9\), it can be seen from the optimal value and the average value in the test result that the minimum value found by CSOS is better than other algorithms. In addition, the standard deviation of CSOS is the least, which indicates that it has more stability than other algorithms. For the \(f_{11}\), CSOS in the search accuracy on the poor, but the variance is smaller, higher stability. Figures 16, 17, 18, 19, 20, 21, 22 and 23 shows CSOS and other algorithm convergence and the anova tests of the global minimum plots. It can be seen that in addition to \(f_{11}\), CSOS has higher convergence accuracy and stronger robustness in \(f_8- f_{10}\).

Fig. 19
figure 19

\(D=30\), ANOVA test of global minimum for \(f_{09}\)

Fig. 20
figure 20

\(D=30\), evolution curves of fitness value for \(f_{10}\)

Fig. 21
figure 21

\(D=30\), ANOVA test of global minimum for \(f_{10}\)

Fig. 22
figure 22

\(D=30\), evolution curves of fitness value for \(f_{11}\)

Fig. 23
figure 23

\(D=30\), ANOVA test of global minimum for \(f_{11}\)

According to the test results in Table 7, it can be seen that CSOS has found the theoretical minimum in \(f_{12},f_{14}, f_{15}, f_{16},f_{19},f_{20},f_{21},f_{22}, f_{23}\). Meanwhile, in the functions \(f_{12}, f_{14}, f_{15}, f_{16}, f_{22}, f_{23}\), CSOS has a smaller standard deviation than other algorithms, which indicates that the CSOS has a stronger stability. For the function \(f_{13}, f_{17}, f_{18}\), we can find that the optimal fitness value and standard deviation of CSOS are worse than other algorithms. For the function \(f_{21}\), although the CSOS variance is the worst, but can be seen from the Table 7 CSOS find the global minimum, which shows that the \(f_{21}\) for the CSOS convergence accuracy but poor stability. Figures 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46 and 47 shows CSOS and other algorithm convergence and the anova tests of the global minimum plots. From the above data, it is easy to find that CSOS is also very competitive in terms of precision and robustness for fixed-dimension multimodal benchmark functions.

Fig. 24
figure 24

\(D=2\), evolution curves of fitness value for \(f_{12}\)

Fig. 25
figure 25

\(D=2\), ANOVA test of global minimum for \(f_{12}\)

Fig. 26
figure 26

\(D=4\), evolution curves of fitness value for \(f_{13}\)

Fig. 27
figure 27

\(D=4\), ANOVA test of global minimum for \(f_{13}\)

Fig. 28
figure 28

\(D=2\), evolution curves of fitness value for \(f_{14}\)

Fig. 29
figure 29

\(D=2\), ANOVA test of global minimum for \(f_{14}\)

Fig. 30
figure 30

\(D=2\), evolution curves of fitness value for \(f_{15}\)

Fig. 31
figure 31

\(D=2\), ANOVA test of global minimum for \(f_{15}\)

Fig. 32
figure 32

\(D=2\), evolution curves of fitness value for \(f_{16}\)

Fig. 33
figure 33

\(D=2\), ANOVA test of global minimum for \(f_{16}\)

Fig. 34
figure 34

\(D=3\), evolution curves of fitness value for \(f_{17}\)

Fig. 35
figure 35

\(D=3\), ANOVA test of global minimum for \(f_{17}\)

Fig. 36
figure 36

\(D=6\), evolution curves of fitness value for \(f_{18}\)

Fig. 37
figure 37

\(D=6\), ANOVA test of global minimum for \(f_{18}\)

Fig. 38
figure 38

\(D=4\), evolution curves of fitness value for \(f_{19}\)

Fig. 39
figure 39

\(D=4\), ANOVA test of global minimum for \(f_{19}\)

Fig. 40
figure 40

\(D=4\), evolution curves of fitness value for \(f_{20}\)

Fig. 41
figure 41

\(D=4\), ANOVA test of global minimum for \(f_{20}\)

4.3 p-Values of the Wilcoxon rank-sum test

In this paper, the Wilcoxon rank-sum test [23, 24] is used to verify the relationship between the CSOS algorithm and several other algorithms. The test to \(p=0.05\) as the standard, the test results are shown in Table 8.

Fig. 42
figure 42

\(D=4\), evolution curves of fitness value for \(f_{21}\)

Fig. 43
figure 43

\(D=4\), ANOVA test of global minimum for \(f_{21}\)

In Table 8, data with p-values greater than 0.05 are indicated by bold and underlined. CSOS vs. ABC, CSOS vs. GWO and CSOS vs. CS have two values greater than 0.05 in each set of contrast data. CSOS vs. FPA, CSOS vs. CGWO have one value greater than 0.05 in each set of contrast data. We compare CSOS and SOS, there are three values greater than 0.05. All other values were less than 0.05. Therefore, there are significant differences between CSOS and other algorithms. The experimental data are not obtained by accident.

4.4 CSOS for engineering optimization problem

In order to verify the effectiveness of CSOS for complex problems, this paper chooses two engineering examples of cantilever beam design optimization problem [25] and welding beam design optimization problem [26] to validate this project.

Fig. 44
figure 44

\(D=2\), evolution curves of fitness value for \(f_{22}\)

Fig. 45
figure 45

\(D=2\), ANOVA test of global minimum for \(f_{22}\)

4.4.1 Cantilever beam design problem

Cantilever structure shown in Fig. 48 [25], which is composed of five square hollow structure, each component with a variable. It can be seen from the figure that there are a downward force on the point 6 and a fixed support at the point 1. The objective is to minimize the weight of the beam. The problem formulation is as follows:

$$\begin{aligned}&\hbox {Minimize }f(x)=0.0624(x_1 +x_2 +x_3 +x_4 +x_5 );\\&\hbox {Subject to }g(x)=\frac{61}{x_1^3 }+\frac{37}{x_2^3 }+\frac{19}{x_3^3 }+\frac{7}{x_4^3 }+\frac{1}{x_5^3 }\le 1; \end{aligned}$$
Fig. 46
figure 46

\(D=2\), evolution curves of fitness value for \(f_{23}\)

Fig. 47
figure 47

\(D=2\), ANOVA test of global minimum for \(f_{23}\)

In this paper, the CSOS algorithm was tested with Method of Moving Asymptotes (MMA) [26], Generalized Convex Approximation (GCA_I) [26], GCA_II [26], CS [27], and Symbiotic Organisms Search (SOS) [27] in 20 independent experiments. The test results are shown in Table 9.

It can be seen from the data in Table 9 that CSOS can find a better optimal value than other algorithms. This shows the superiority of the CSOS algorithm in solving the cantilever problem.

4.4.2 Welded beam design problem

The purpose of the welded beam design problem is to obtain the minimum fabricating cost. The structural design of the welded beam is shown in Fig. 49 [26]. The constraints are as follows: shear stress \(({\tau })\), bending stress in the beam \(({\theta })\), end deflection of the beam \(({\delta })\), buckling load on the bar \((P_c)\), and side constraints. The four design variables associated with this problem are as follows:

  • Thickness of the weld (h)

  • Length of the welded joint (l)

  • Width of the bar (t)

  • Thickness of the bar (b)

Table 8 p Values of the Wilcoxon rank-sum test results
Fig. 48
figure 48

Cantilever beam design problem

Table 9 Comparison results for cantilever design problem
Fig. 49
figure 49

Design parameters of the welded beam design problem

The formula involved in the design of welded beam is as follows:

$$\begin{aligned} \hbox {Minimize }f(x)= & {} 1.10471x_1^2 x_2 +0.04811x_3 x_4 (14+x_2 );\\ \hbox {Subject to }g_1 (x)= & {} \tau (x)-\tau _{\max } \le 0,\\ g_2 (x)= & {} \sigma (x)-\sigma _{\max } \le 0,\\ g_3 (x)= & {} x_3 -x_4 \le 0,\\ g_4 (x)= & {} 0.125-x_1 \le 0,\\ \hbox {g}_5= & {} \delta (x)-0.25\le 0,\\ \hbox {g}_6= & {} P-P_c (x)\le 0,\\ g_7= & {} 0.10471x_1^2 +0.04811x_3 x_4 (14+x_2 )-5\le 0;\\ \hbox {Variable range }&\,\,0.1\le x_1 \le 2;0.1\le x_2 \le 10;0.1\le x_3 \le 10;0.1\le x_4 \le 2;\\ \hbox {Where }\quad \tau (x)= & {} \sqrt{\tau _1^2 +2\tau _1 \tau _2 \left( \frac{x_2 }{2R}\right) +\tau _2^2 };\\ \tau _1= & {} \frac{P}{\sqrt{2}x_1 x_2 };\\ \tau _2= & {} \frac{MR}{J};\\ M= & {} P\left( L+\frac{x_2 }{2}\right) ;\\ J(x)= & {} 2\left\{ \sqrt{2}x_1 x_2 \left[ \frac{x_2^2 }{4}+\left( \frac{x_{1+} x_2 }{2}\right) ^{2}\right] \right\} ;\\ R= & {} \sqrt{\frac{x_2^2 }{4}+\left( \frac{x_{1+} x_3 }{2}\right) ^{2}};\\ \sigma (x)= & {} \frac{6PL}{x_4 x_3^2 };\\ \delta (x)= & {} \frac{6PL^{3}}{Ex_3^3 x_4 };\\ P_c= & {} \frac{4.013E\sqrt{\frac{x_3^2 x_4^6 }{36}}}{L^{2}}\left( 1-\frac{x_3 }{2L}\sqrt{\frac{E}{4G}}\right) ;\\ \end{aligned}$$

The test was carried out independently 20 times; the test results shown in Table 10. The CSOS and GWO [9], GSA [9], CPSO [9], GA (Coello) [28], GA (Deb) [29], GA (Deb) [30], HS (Lee and Geem) [31], Random [32], Simplex [32], David [32] and APPROX [32] of the 20 independent experiments to verify the validity of CSOS for welding beam problem, the results shown in Table 10.

Table 10 Comparison results for cantilever design problem

Compared with other algorithms, CSOS found a higher solution in the design of the welded beam, and the relevant parameters are \(h = 0.2057296, l = 3.253120, t=9.03662391, b=0.2057296398\). This experiment shows the effectiveness of CSOS in the welding beam problem.

4.5 Result analysis

Simulation experiments have been done in Sects. 4.2 and 4.3. In Sect. 4.2, 23 standard benchmark functions were used to verify all aspects of CSOS performance. The experimental data are shown in Tables 5, 6 and 7. Figures 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46 and 47 shows the evaluation curves of fitness values, anova test of global minimum. According to the test data and figure can be seen, CSOS has a stronger ability to find the global minimum and better stability. In the Sect. 4.3, the test of CSOS Wilcoxon with other algorithms; the result is not accidental. In Sect. 4.4, two engineering examples are selected to verify the validity of the CSOS. The experimental results are shown in Tables 9 and 10. The results show that CSOS in engineering problems also have high accuracy and stability.

5 Conclusions

In this paper, the idea of complex-valued coding is incorporated into the symbiotic organisms search (SOS) algorithm, and a novel complex-valued encoding symbiotic organisms search (CSOS) algorithm is proposed. CSOS takes advantage of the feature of complex-valued encoding, that is, the two-dimensional coding space maps one-dimensional coding space, real and imaginary parts are updated separately, and each biological individual has inherent parallelism, which increases the population diversity and enhances the ability of the algorithm to find the global minimum. CSOS extends the application range of the symbiotic organisms search algorithm from a real number range to a complex number range. From the results of the 23 standard benchmark functions tests in this paper, CSOS has better optimization precision and stability than other algorithms. In future studies, it is recommended that CSOS be applied to more real-world engineering problems and solve some NP- hard problems in literature.