1 Introduction

Swarm intelligence algorithms have been widely used in different areas in order to solve various problems. There are many algorithms in swarm intelligence that are developed by simulating the behaviors of the creatures in nature [1, 20, 21]. There are some relatively popular algorithms such as ant colony optimization algorithm (ACO) [2], particle swarm optimization algorithm (PSO) [3] and so on. Among them, a novel optimizing method, Artificial Fish Swarm Algorithm (AFSA), was referred to the behavior of fish swarm. It was proposed by the domestic scholars LI Xiao-lei, SHAO Zhi-jiang and QIAN Ji-xin in 2002 [4]. Similar to most social animals, the fish has its unique way of living. In the water, most fishes exist in the place that has rich food. According to this, AFSA is a kind of swarm intelligence algorithm that imitates the specific behavior of individuals and information interactions among them during preying process in real environment. As far as order is concerned, in AFSA each artificial fish (AF) individual explores food by four behaviors, which are random moving, preying, following, and swarming. Preying behavior laid the foundation of algorithm convergence, swarming behavior enhances the stability and global convergence of the algorithm, following behavior speeds up the algorithm convergence, evaluating of the four behaviors provides guarantee of algorithm convergence speed and stability. Each AF individual has a self-information that includes visual range, current position, food concentration, moving step length, crowing divisor etc., which decided the fish chooses next behavior in the range of motion, and these behaviors can influence each other. Ref. [5, 22] expounded five characteristics of AFSA: (1) parallelism, (2) simplification, (3) global searching ability, (4) fast convergence and (5) not sensitive to the requirements of the objective functions. Therefore, more scholars have studied on AFSA to pursuit better performance in many aspects.

Many practical (industrial/engineering) and challenging problems are multi-objective, where the related solution is a set of points that give trade-offs for the different targets. Introducing multi-objective optimization for AFSA is inspired by our team’s research in evolutionary computing for similar problems [6]. In this paper, a new method named “A novel Artificial Fish Swarm Optimization Algorithm Aided by Ocean Current Power (AFSAOCP)” has been proposed.

Section 2 introduces the standard AFSA. In Section 3, a detailed description about some recent variants is put forward. Section 4 presents the proposed AFSAOCP. Section 5 makes comparative experiments on several widely used benchmark function and analyzes the related experimental results, and conclusions are made in Section 6.

2 Basic Artificial Fish Swarm Algorithm (AFSA)

Artificial Fish in the environment is the main part of the problem solution space, where an Artificial Fish next-step behavior depends on the previous moment and the current state of environment. Artificial Fishes exert influence on their neighbor or companions by their own activities and vice versa

As shown in Fig. 1, an Artificial Fish perceives external things with sense of sight. Current position of an Artificial Fish can be written as: X={X 1,X 2,...,X n }, where X i (i=1,2,...,n) is the control variable. The V i s u a l is used to indicate sight field of an Artificial Fish and X v is a position in visual where AF’s view for a moment. The step length is expressed as S t e p and the next position of an Artificial Fish is described as X n e x t . If X v has better food consistence than current position of AF, it will consider to go one S t e p toward X v , which causes change in AF position from X to X n e x t ,but if the current position of AF is better than X v , it continues searching in its V i s u a l area. The process can be expressed as follows in formulas (2-1) and (2-2):

$$ X_{v} =X+Visual \bullet Rand() $$
(2-1)
$$ X_{next} =X+\frac{X_{v} -X}{\vert \vert X_{v} -X\vert \vert }\bullet Step\bullet Rand() $$
(2-2)

In the two formulas, R a n d() denotes some random numbers which are between 0 to 1.

Fig. 1
figure 1

The concept of AF’s vision

Food consistence in position X represents fitness value of this position and Y = f(X)Y is an objective function. The distance between two AFs which are in t and X t positions is shown by d i j =|X i X j |. The maximum tries of AF during preying process is represented by B e s t F i s h t = X , which means the maximum number of attempts by the fish.

AF has four kinds of behaviors and are described as follows:

  1. 1)

    Preying behavior

This is a natural behavior of AF that is the tendency of food, the current position of AF i is X i and randomly chooses a position in its sight field is x j by formula (2-3).

$$ X_{j} = X_{i} + Visual \bullet Rand() $$
(2-3)

If Y i <Y j , the AF makes a step towards the position of X j by formula (2-4).

$$ X_{i}^{t+1} = X_{i}^{t} + \frac{X_{j} - X_{i}^{t}}{\parallel X_{j} - X_{i}^{t}\parallel} \bullet Step \bullet Rand() $$
(2-4)

But while Y i >Y j is true, the position will be updated, namely, position X j is selected again, and then AF needs to judge whether it satisfies the forwarding condition or not. If T r y_n u m b e r still does not find the fitness condition, AF will move a new position randomly by formula (2-5).

$$ X_{i}^{t+1} = X_{i}^{t} + Visual \bullet Rand() $$
(2-5)

The Pseudo code of preying behavior is show as follows:

$$\begin{array}{@{}rcl@{}} &&float ~prey()\\ &&\{\\ &&\hspace*{25pt} for(i = 0;i\textless Try\_number;i++)\\ &&\hspace*{25pt} \{\\ &&\hspace*{56pt} X_{j}=X_{i}+ Rand() \bullet Visual;\\ &&\hspace*{56pt} if(Y_{j}\textless Y_{i})\\ &&\hspace*{75pt} X_{i/next}\,=\,X_{i} \,+\, Rand() \bullet Step \bullet \frac{X_{j} -X_{i}}{\vert \vert X_{j} -X_{i} \vert \vert}_{;}\\ &&\hspace*{56pt} else\\ &&\hspace*{75pt} X_{i/next}=X_{i} + Rand() \bullet Step;\\ &&\hspace*{24pt} \}\\ &&return~foodconsistence(X_{i/next});\\ &&\} \end{array} $$
  1. 2)

    Swarming behavior

During searching for food, AFs will group together spontaneously so as to guarantee their own survival. This kind of behavior can not only be helpful to reduce the amount of AFs that are trapped into local optimal solutions, but are also useful to gather around the regions of the majority AFs that have global optimal solution. There are two action rules among AFs in the AFSA: (1) as far as possible move toward the center of the adjacent partners; (2) to avoid overcrowding. The current position of AF i is X i , the number of partners in the current field (d i j <V i s u a l) is n f and center position is X c . If Y c /n f >δ Y i , there is plenty of food in the partner’s center and it’s not too crowded here. Then the AF can move a step towards that central position according to formula (2-6). Otherwise, it executes preying behavior.

$$ X_{i}^{t+1} ={X_{i}^{t}} +\frac{X_{c} -{X_{i}^{t}} }{\parallel X_{c} -{X_{i}^{t}} \parallel}\bullet Step \bullet Rand() $$
(2-6)

The Pseudo code of swarming behavior is show as follows:

$$\begin{array}{@{}rcl@{}} &&float~swarm()\\ &&\{\\ &&\hspace*{20pt} n_{f}= 0;X_{c} = 0;\\ &&\hspace*{20pt} for(j = 0;j\textless FishNumber;j++)\\ &&\hspace*{20pt} \{\\ &&\hspace*{48pt} if(d_{i,j}\textless Visual)\\ &&\hspace*{48pt} \{n_{f}++;X_{c}+=X_{j};\}\\ &&\hspace*{55pt} X_{c} =\frac{X_{c} }{n_{f} }_{;}\\ &&\hspace*{48pt} if(\frac{Y_{c}}{n_{f}}>\delta Y_{i})\\ &&\hspace*{70pt} X_{i/next}\,=\,X_{i} \,+\, Rand()\bullet Step \bullet\frac{X_{j} -X_{i} }{\parallel X_{j} -X_{i} \parallel}_{;}\\ &&\hspace*{48pt} else\\ &&\hspace*{62pt} prey();\\ &&\hspace*{20pt} \}\\ &&return~foodconsistence(X_{i/next});\\ &&\} \end{array} $$
  1. 3)

    Following behavior

When AF finds a region that has enough food and is not too crowded, AF’s nearby partners will follow it and quickly reach to this hot point. Following behavior is a kind of pursuit behavior where the neighbors have highest fitness. In optimum algorithm, it can be understood as a process of moving forward nearby optimal partner. The current position of AF is \(_{X_{i}}\), AF searches for partner \(_{X_{j}}\) with the maximum food consistence in current field(\(_{d_{ij} <Visual})\), written as \(_{Y_{j}}\). If \(_{Y_{j} /n_{f}>\delta Y_{i}}\), there is enough food in the partner’s center and it’s not too crowded here. Then, the AF can move a step towards that central position according to formula (2-7). Otherwise, it executes preying behavior.

$$ X_{i}^{t+1} ={X_{i}^{t}} +\frac{X_{j} -{X_{i}^{t}} }{\parallel X_{j} -{X_{i}^{t}} \parallel}\bullet Step\bullet Rand() $$
(2-7)

The Pseudo code of following behavior is show as follows:

$$\begin{array}{@{}rcl@{}} &&float~f\!ollow()\\ &&\{\\ &&\hspace*{25pt} Y_{min}=\infty;\\ &&\hspace*{25pt} for(j = 0;j\textless FishNumber;j++)\\ &&\hspace*{25pt} \{\\ &&\hspace*{55pt} if(d_{i,j}\textless Visual \& \& Y_{j}\textless Y_{min})\\ &&\hspace*{55pt} \{Y_{min}=Y_{j};X_{min}=X_{j};\}\\ &&\hspace*{55pt} n_{f=0;}\\ &&\hspace*{55pt} f\!or(j=0;j\textless FishNumber;j++)\\ &&\hspace*{75pt} if(d_{min,j}\textless Visual)\\ &&\hspace*{75pt} \{n_{f}++;\}\\ &&\hspace*{75pt} if(\frac{Y_{\min}}{n_{f}}>\delta Y_{i})\\ &&\hspace*{72pt} X_{i/next}\,=\,X_{i} \,+\, Rand()\bullet Step\bullet \!\frac{X_{\min}\,-\,X_{i}}{\parallel X_{\min}\,-\,X_{i} \parallel}_{;}\\ &&\hspace*{55pt} else\\ &&\hspace*{75pt} prey();\\ &&\}\\ &&return~foodconsistence(X_{i/next});\\ &&\} \end{array} $$
  1. 4)

    Random behavior

To enlarge its search space, artificial fish will move a step randomly in its perception range and reach to a new position. This is a simple behavior that chooses a position randomly in AF’s sight field, and then move forward to it. In a word, it is a default behavior of preying behavior.

AFSA should initialize relative parameters, evaluate the four behaviors and choose the optimal behavior. The procedure of the basic AFSA is show as follows:

  1. Step 1:

    Initializing parameters.

  2. Step 2:

    Randomly generating initial population

  3. Step 3:

    Calculating every fish’s food concentration (objective function), and putting the optimal value in the bulletin board

  4. Step 4:

    For each of AF

    1. 1)

      Calculating the fitness value of following behavior and swarming behavior, and then selecting the optimal behavior as the moving direction of AF by selection strategy, the default behavior is preying behavior.

    2. 2)

      Calculating every AF’s food concentration, and its optimal value compared with the values in the bulletin board, the bulletin board always maintains optimal values.

  5. Step 5:

    Determining whether it satisfies the end’s condition, if satisfy ends, otherwise go to step 4.

3 The related research

The basic AFSA requirement is not limited in the objective function, parameters and initial values, but it’s one of the most effective algorithms in solving optimization problems. Many researchers have worked on improving its performance in various ways and developed many variants.

In Ref. [7], a method of population adaptation which has the feature of fast convergence, good global search capability, strong robustness. In this paper, the author applied the Artificial Fish Swarm (AFSA) to multi-objective optimization problems. An improved AFSA named IAFSA is proposed in Ref. [8], where the author suggests that adjust parameters V i s u a l and S t e p adaptively with iterative operation is necessary, so V i s u a l and S t e p are put forward to optimize the parameters of LS-SVM. Ref. [9] introduces an improved algorithm that two new adaptive methods based on AFSA execution in order to control the capability of global and local searching adaptively. In this paper, firstly, selected larger initial value for V i s u a l and S t e p. After that, by approaching the target, AF can accurately investigate the environment by smaller V i s u a l and S t e p. In Ref. [10], an improved AFSA by genetic algorithm is proposed, where the variation factor of genetic algorithm is introduced to AFSA. With a concept that is mentioned when (r e c o r d F CF C<e p s) has appeared for several times continuously, it will execute variation factor on each AF’s parameter with probability p. An improved AFSA named HAFSA is applied in Ref. [11]. This algorithm is based on PSO and AFSA: it makes full use of the fast local convergence performance of PSO and the global convergence performance of AFSA, and then is used for solving ill-conditioned linear systems of equations. Modified artificial fish swarm algorithm (MAFSA) is proposed to optimize the reactive power optimization is in Ref. [12].

Based on the above discussion, a novel Artificial Fish Swarm Optimization Algorithm Aided by Ocean Current Power (called AFSAOCP) fully considers the characteristics of fish life. The algorithm improves the performance of optimization algorithm through the implementation of a new mutation strategy and demonstrates a significant performance improvement over the AAFSA1 (the adaptive step length) [13], AAFSA2(introduces a new behavior) [14] and IAFSA [15].

4 The AFSAOCP

In order to keep balance between global search ability and local search ability of artificial fish swarm algorithm, step strategies can help AF timely to arrive at the extreme value point of convergence. But if the step length exceeds a certain range, it can possibly slow convergence speed, but also appear even oscillation phenomenon. In order to deal with these problems, and inspired by the phenomenon of symbiosis, AFSAOCP is put forward.

4.1 Ocean current

The ocean current is the surface water in the density of sea water, wind, and a variety of other factors which influence it along the direction of a certain large scale regular flow [16].

There are dozens of major ocean currents, often called the high temperature from tropical sea warm current, known as a cold snap from cold water temperature is relatively low. Ocean current is generally divided into wind current, compensation flow and density flow, and wind current is the main form [17, 18].

Figure 2 is the wind current schematic diagram. If the water on the surface of the ocean is in the atmospheric circulation and near the ground under the action of wind current, we call it wind current. In the northern hemisphere, the wind current is flowing by clockwise direction around the subtropical high. However, in the southern hemisphere, it is anticlockwise direction. The wind current is close to the ground under the action of wind, and to produce water friction coriolis force balance of current. There is a significant impact on ocean current in the global scope of sea: Pacific equatorial current, north equatorial current, south equatorial current, north Pacific warm current and warm Atlantic [19].

Fig. 2
figure 2

The formation of the ocean current

This above is a macroscopic description of ocean current. For microcosm, on the one hand, we know that there are many reasons that cause currents, one of which was caused by uneven terrain. According to the flow, it’s not parallel degree and bending degree, but the ocean is divided into the gradient flow and rapidly varied flow. The gradient flow refers to streamline the parallel linear flow. Rapidly varied flow refers to the curvature of the streamline, the flow that has the bigger curvature or included angle. It is shown in Fig. 3.

Fig. 3
figure 3

Gradually varied flow and Rapidly varied flow

On the other hand, we know that wind current is the main form of ocean current. Therefore, with the increasing depth of the sea, the influence of the wind on the water is more and more small. In other words, the flow velocity of ocean current reaches the maximum at the surface, slowing down with the increase of depth. In order to facilitate research, we divided the ocean into three layers (shown in Fig. 4). From the top to the bottom velocity decreases, which is for us to face the artificial fishes after grouping analysis is done. The flow rate from the ocean surface to the seabed decreasing, which is based on artificial fish grouping.

Fig. 4
figure 4

The hierarchical diagram of ocean

Next, let us analyze the situation of fishes in the ocean. In order to facilitate the research, we assume an artificial fish as a particle which is in a three-dimensional space. The particle under the action of external force is affected by the following Fig. 4.

In the Fig. 5, particle P is moving along the Y axis. At the same time, the velocity component v 1 and v 2, which are coming from the X axis and Z axis, affect P’s speed. The trajectories of P will be decided according to the three directions of the three speeds eventually. The detailed trajectory is shown in Fig. 5.

Fig. 5
figure 5

Effects of the particle in three-dimensional space

In Fig. 6, the X axis and Y axis show the flow of ocean current, fishes from point A to point B. R1 showed that fishes’ swimming route without ocean current effect. R2said fishes under the influence by ocean current move to point B with curve of the parade route.

Fig. 6
figure 6

The trajectories of fishes

4.2 New searching strategy

Since the ocean current is one of the Marine natural phenomena, its velocity will inevitably affect the speed of artificial fishes. Firstly, AF is swimming along ocean current, saying there is a pair of invisible hand to promote AF forward. Details are followed in Fig. 7.

Fig. 7
figure 7

Ocean currents make a positive difference in fish’s preying (‘ + ’ influence)

Secondly, if AF is swimming against the current, their ability to pursue food may be impeded. Details are followed in Fig. 8.

Fig. 8
figure 8

Ocean currents make a negative difference in fish’s preying (‘ −’ influence)

AF depends on a swimming motion to go from place to place in their search for food, and gradually they populated the ocean with different speed. With this in mind, we divide artificial fishes in different groups according to their speed range. By comparison, the optimal fish (local best) in each group can be chosen out, at the same time each iteration of the optimal fish (global best) can also be concluded. The graphical description of grouping and procedures of each subgroup will be shown in Fig. 9.

Fig. 9
figure 9

Grouping and procedures of each subgroup

In Fig. 9, Artificial fishes are divided into three groups by the strength of influence (‘ + ’, ” and ‘’), each subgroup is moving with the different step length. The normal artificial fishes’ (‘’ subgroup) speed is v, the speed of ocean current is v o c e a n , so the step length is S t e p and mobile way according to formula (2-7). Therefore, in contrast to the current direction (that is adverse current) of artificial fishes’ speed is v 1(‘ + ’ subgroup), we know v 1>v, so the step length is \(Step+v_{ocean} \cdot \cos \alpha \), and mobile way according to formula (4-1).

$$ X_{i}^{t+1} ={X_{i}^{t}} +\frac{X_{j} -{X_{i}^{t}} }{\parallel X_{j} -{X_{i}^{t}} \parallel}\bullet(Step+v_{ocean} \cdot \cos \alpha )\bullet Rand() $$
(4-1)

The same as the current direction (that is fair current) of the artificial fishes’ speed is v 2(‘’ subgroup), we know v 2<v, so the step length is \(Step-v_{ocean} \cdot \cos (\pi -\beta )\). And mobile way is computing according to formula (4-2).

$$ X_{i}^{t+1} ={X_{i}^{t}} +\frac{X_{j} -{X_{i}^{t}} }{\parallel X_{j} -{X_{i}^{t}} \parallel}\bullet (Step-v_{ocean} \cdot \cos (\pi -\beta ))\bullet Rand() $$
(4-2)

after each iteration finishes, artificial fishes will be divided into three subgroups again.

4.3 Procedures of AFSAOCP

The procedures of the AFSAOCP is similar to the AFSA described in Section 2, including initialization, evaluation of behaviors, and selection of the optimal behavior. Repeat these steps until the conditions of the end of the algorithm are met.

But there is a difference between AFSAOCP and AFSA. The main difference is that considering the influence of the ocean current to living conditions of the fish in Section 4.1, we improve the evolution of fish: each individual in the initial population will generate three subgroups to improve the convergence speed through the iteration of the algorithm. So flow chart of AFSAOCP is shown in Fig. 10.

Fig. 10
figure 10

Flow chart of AFSAOCP

In Fig. 10 and Table 1:

  • F i s h N u m: The number of artificial fishes.

  • b v a l u e: The best value of every iteration

  • i t e r N u m: The maximum number of iterations

  • t r y N u m: The maximum number of attempts

  • Y i : The fish i fitness values

  • v a l u e A F S A O C P: The optimal value of the AFSAOCP.

Table 1 Pseudo code of the AFSAOCP

According to the above chart of the AFSAOCP, the relative algorithm is defined as follows. Pseudo code of the AFSAOCP is shown in Table 1 and the grouping part of the algorithm is from line 04 to line 37.

5 Experimentation

In this section, the proposed AFSAOCP is compared with the AFSA, AAFSA1, AAFSA2 and IAFSA .

5.1 The analysis of parameters

The main basic parameters of AFSAOCP is the number of artificial fishes F i s h N u m, field of vision V i s u a l, crowded degree factor δ and the angle of artificial fishes and ocean α,β. This section analyses the influence of various parameters on the algorithm precision in the algorithm, so that the subsequent simulation experiments can be more effectively carried out than before.

This section forms different parameter values using test function experiment and comparison, which used test function for Rosenbrock, specific expression such as (5-1).

$$ f(x)=\sum\limits_{i=1}^{N-1} {(100({x_{i}^{2}} -x_{i+1}^{2} )^{2}+(x_{i} -1)^{2})} $$
(5-1)
  1. (1)

    The number of artificial fishes F i s h N u m

The size of the artificial fish decided the convergence speed of the algorithm. This experiment respectively sets the number of artificial fish to 10, 30, 60, 100, 200 and the experimental results are shown in Table 2.

Table 2 The influence of different artificial fish scale for solution

According to Table 1, we can see that when the scale is small, the algorithm requires a short period of time, but the optimal value is poorer; the scale is large, the optimal value of the algorithm is better, but at the same time the execution time is too long. Therefore, the size of the artificial fishes should be moderate that the algorithm not only has the better optimal value, but also can make the execution time as short as possible.

  1. (2)

    The artificial fishes’ view V i s u a l

Behavior evaluation in view of artificial fishes has a bigger impact and it will affect the convergence of the algorithm. We know the fish’s field of vision is limited, so this experiment set of artificial fishes’ view of 0.1, 1, 10, 30, 50 and experimental results are shown in Table 3.

Table 3 The influence of different view for solution

According to Table 2, when the view of the artificial fish is small, the time required for the algorithm to run is shorter, but the optimal value obtained is the worst. With the increase of test field of vision, the average time of the algorithm is getting longer and longer, and the average optimal value of the algorithm is gradually tending to be ideal. The reason is that when the sight is small, the main behavior of artificial fishes are the preying behavior and random behavior, whereas if the visual field is larger, the main behavior of artificial fishes are the following behavior and swarming behavior. Overall, under the condition of the same time, it is easier to find the global optimal value and convergence of the artificial fish with larger view.

  1. (3)

    Crowding degree factor δ

Crowding degree factor is one of the standards that is being used to determine whether artificial fishes perform the behavior. This experiment set crowding degree factor to 0.1, 0.618, 5, 10, 15, and experimental results are shown in Table 4.

Table 4 The influence of different crowding degree factor for solution

According to Table 4, the crowding degree factor influence on the speed of the algorithm implementation is not big, so crowding degree factor should be to achieve the optimal value is closer to the ideal.

  1. (4)

    The angle of artificial fishes and ocean α,β

If there is an angle between the direction of the current, it will affect the speed of artificial fishes. α,β expresses the angle of artificial fishes and ocean.

According to Table 5, the angle α influence on the speed of the algorithm implementation is not big, so crowding degree factor should be to achieve the optimal value is closer to the ideal.

Table 5 The influence of mobile angle α for solution

According to Table 6 , the angle β influence on the speed of the algorithm implementation is not big, so crowding degree factor should be to achieve the optimal value is closer to the ideal.

Table 6 The influence of mobile angle β for solution

5.2 Description of benchmark functions

All the definitions of the benchmark functions are given according to the number in Table 7.

  1. 1)

    \(f_{1} =\sum \limits _{i=1}^{N} {({x_{i}^{2}} -10\cos (2\pi x_{i} )+10)}\) Rastrigin is a non-convex function. It is highly multimodal and valuated on the hypercube x i ∈[−10,10], for all i=1,...,N.

  2. 2)

    \(f_{2}(x)=-0.0001(\vert \sin (x_{1} )\sin (x_{2} )\exp (\vert 100-\frac {\sqrt {{x_{1}^{2}}+{x_{2}^{2}} } }{\pi }\vert )\vert +1)^{0.1}\), Cross-in-Tray function has multiple global minima. It is usually evaluated on the square x i ∈[−10,10], for all i=1,2.

  3. 3)

    \(f_{3} (x)=0.5+\frac {\sin ^{2}({x_{1}^{2}} -{x_{2}^{2}} )-0.5}{[1+0.001({x_{1}^{2}} +{x_{2}^{2}} )]^{2}}\), Schaffer function N.2 is shown on a smaller input domain in the second plot to show detail. It is usually evaluated on the square x i ∈[−100,100], for all i=1,2.

  4. 4)

    \(f_{4} =-\frac {1+\cos (12\sqrt {{x_{1}^{2}} +{x_{2}^{2}} } )}{0.5({x_{1}^{2}} +{x_{2}^{2}} )+2}\), Drop-Wave function is multimodal and highly complex. It is usually evaluated on the square x i ∈[−5.12,5.12], for all i=1,2.

  5. 5)

    \(f_{5} =-\vert \sin (x_{1} )\cos (x_{2} )\exp (\vert 1-\frac {\sqrt {{x_{1}^{2}} +{x_{2}^{2}} } }{\pi }\vert )\vert \), Holder Table function has many local minima, with four global minima. It is usually evaluated on the square x i ∈[−10,10], for all i=1,2.

  6. 6)

    \(f_{6} =\sum \limits _{i=1}^{N} {{x_{i}^{2}} } \) Sphere function is usually evaluated on the hypercube x i ∈[−10,10], for all i=1,...,N.

  7. 7)

    \(f_{7} (x)=\sin ^{2}(\pi \omega _{1} )+\sum \limits _{i=1}^{N-1} {(\omega _{i} -1)[1+10\sin ^{2}(\pi \omega _{i} -1)]} +(\omega _{N} -1)^{2}[1+\sin ^{2}(2\pi \omega _{N} )]\), Levy function is usually evaluated on the hypercube x i ∈[−10,10], for all i=1,...,N.

  8. 8)

    \(f_{8} (x)=\frac {1}{4000}\sum \limits _{i=1}^{N} {x^{2}-\prod \limits _{i=1}^{N} {con(\frac {x_{i} }{\sqrt i })} } +1\), Griewank function is usually evaluated on the hypercube x i ∈[−100,100], for all i=1,...,N.

  9. 9)

    \(f_{9} (x)=\sum \limits _{i=1}^{N-1} {(100({x_{i}^{2}}-x_{i+1}^{2} } )^{2}+(x_{i} -1)^{2})\), Rosenbrock function is usually evaluated on the hypercube x i ∈[−100,100], for all i=1,...,N.

  10. 10)

    \(f_{10} (x)=\sum \limits _{i=1}^{N} {({\sum \limits _{j}^{i}} {x_{i} )^{2}+shifting} } \) , and s h i f t i n g=10, Schwefel Problem1.2 function is usually evaluated on the hypercube x i ∈[−100,100], for all i=1,...,N.

Table 7 Dimensions, search ranges, and brief description of test functions

5.3 Experimental setting and parameterization

To be fair, the initial conditions of each algorithm are consistent. The population size is set to be 60. The size of the subgroup is set to 20. The 10 dimensional test function experiments are running in f 7(x),f 8(x),f 9(x),f 10(x), others are running in the 2 dimensional test function experiments, and in order to demonstrate their general performances that each function id running independently for 25 times.

Experimental environment configuration: Operation system is Windows 7; Minimum memory is 4G; Processor Type is Intel-Core-i3; Development tools & version is Matlab-R2012a.

5.4 Computational results and discussion

For each test function, Table 8 shows the comparison results of AFSA, AAFSA1, AAFSA1, IAFSA and AFSAOCP. In this table avg and std, respectively represent the optimal value and standard deviation after 25 independent experiments.

Table 8 Avg and std. different of test functions about nine algorithms

Figures 11121314 and 15 illustrate the detailed convergence curves of AFSA, AAFSA1, AAFSA1, IAFSA and AFSAOCP for the 10 benchmark functions, which were drawn by using the average value of the 25 runs.

Fig. 11
figure 11

The convergence curve of the f 1(x) to f 2(x) test functions in different algorithms

Fig. 12
figure 12

The convergence curve of the f 3(x) to f 4(x) test functions in different algorithms

Fig. 13
figure 13

The convergence curve of the f 5(x) to f 6(x) test functions in different algorithms

Fig. 14
figure 14

The convergence curve of the f 7(x) to f 8(x) test functions in different algorithms

Fig. 15
figure 15

The convergence curve of the f 9(x) to f 10(x) test functions in different algorithms

Figures 11 to 15 and Table 8 show that the convergence rate and accuracy of AFSAOCP are much better than other AF algorithms with the same dimension in solving great majority benchmark functions, such as f 2(x),f 3(x),f 5(x),f 6(x),f 8(x),f 9(x),f 10(x). That is AFSAOCP has a more powerful global search capability and faster convergence speed than AFSA, AAFSA1, AAFSA2 and IAFSA but its performance is not as good as f 1(x) and f 4(x). In the two functions, we can see that AAFSA2 is best among other algorithms. The cause of this result may be that the algorithm introduces a new behavior: swallowing behavior. The fishes in the process of iteration will gradually appear the worst fish, which will affect the convergence rate of the whole fishes. Therefore, swallowing behavior can eliminate the worst fish, and effectively avoid the worst fish affect on the overall effect of the algorithm.

On the basis of precision guarantee, we count the time required for different algorithms to get results. Specific data is shown in Table 9 and we line out the time in bold which is the shortest.

Table 9 The mean time of different algorithms

According to the data on Table 9, AFSAOCP takes the shortest time in benchmark functions test, except in f 3(x) and f 4(x), where these functions are relatively simple and low-dimensional, and performs worst in f 6(x).

To compare AFSAOCP with different algorithms, we select some algorithms which have come from our team’s research results, this is Ref. [23]. Specific data is shown in Table 10.

Table 10 The comparison results of function optimization

6 Convergence analysis of the AFSAOCP

In this section, we analyze the convergence of AFSAOCP algorithm. Firstly, the values of the parameters used in the analysis are given for details.

  • X S −− a set of All artificial fishes;

  • F(X)–A certain kind of food concentration;

  • \({X_{S}^{i}} \)–non-empty subsets of X S ;

  • X i,j−−position information of j-th Artificial Fish in\({X_{S}^{i}} \);

  • X i,jX k,l– state transition probability p i j,k l ;

  • p i j,k – state transition probability of any Artificial Fish from X i,jto \({X_{S}^{k}} \);

  • p i,k – state transition probability of any Artificial Fish from\({X_{S}^{i}} \textit {to}{X_{S}^{k}} \);

  • Then \(p_{ij,k} =\sum \limits _{l=1}^{\vert {X_{S}^{k}} \vert } {p_{ij,kl} } ,\sum \limits _{k=1}^{F} {p_{ij,k} =1} ,p_{i,k} \ge p_{ij,k} \)

Lemma

In the artificial fish algorithm, \(\forall X^{i,j}\in {X_{S}^{i}} ,i=1,2,...,F,j=1,2,...,{X_{S}^{i}} \) , there are constraint of formula ( 6-1 ) and ( 6-2 ):

$$ \forall k>i,p_{i,k} =0 $$
(6-1)
$$ \exists k<i,p_{i,k} >0 $$
(6-2)

Proof

X t is after the t-th iteration of Artificial Fish which has gotten the best food concentration, it is called B e s t F i s h t = X , and then F(B e s t F i s h t) = F i . From the update value after each iteration, we can see:

$$\begin{array}{@{}rcl@{}} F(X^{t+1})&\le& F(X^{t})\Rightarrow \forall k>i,p_{ij,kl} =0\Rightarrow \forall k>i,\\ p_{ij,k} &=&\sum\limits_{l=1}^{\vert {X_{S}^{i}} \vert } {p_{i,j,kl} } =0\Rightarrow \forall k>i,p_{i,k} =0 \end{array} $$

AF will choose one behavior that according to the results of the evaluation of foraging behavior, and the probability of three behaviors should be p s w a r m ,p f o l l o w ,p p r e y ≥0. The AF eventually will choose one correct behavior in AFSAOCP, so p s w a r m + p f o l l o w + p p r e y =1, and then ∃k<i,p i,k >0 ⌈ proven ⌋ □

Theorem

AFSAOCP has global convergence.

Proof

the theorem will use the stability of the random matrix reasoning. For each \({X_{S}^{i}} ,i=1,2,...,F\), it can be seen as a state of finite markov chain. According to (51), transfer matrix of the markov chain is:

$$P=\left[{{\begin{array}{llll} {p_{1,1} } \hfill & 0 \hfill & {...} \hfill & 0 \hfill \\ {p_{2.1} } \hfill & \hfill & {...} \hfill & 0 \hfill \\ {\vdots} \hfill & {\vdots} \hfill & \hfill & {\vdots} \hfill \\ {p_{F,1} } \hfill & {p_{F,2} } \hfill & {...} \hfill & {p_{F,F} } \hfill \\ \end{array}}} \right]=\left[ {{\begin{array}{*{20}c} C \hfill & 0 \hfill \\ R \hfill & T \hfill \\ \end{array} }} \right]. $$

According the (6-2), we can infer that:

$$\begin{array}{@{}rcl@{}} p_{2,1} &>&0,R=(p_{2,1} ,p_{3,1} ,...,p_{F,1} )^{T},\\ C&=&(p_{1,1} )\ne 0, T=\left[ {{\begin{array}{*{20}c} {p_{2,2} } \hfill & {...} \hfill & 0 \hfill \\ {\vdots} \hfill & \hfill & {\vdots} \hfill \\ {p_{F,2} } \hfill & {...} \hfill & {p_{F,F} } \hfill \\ \end{array} }} \right]\ne 0, \end{array} $$

Therefore, P is the random matrix that can be classified, and meets the conditions of the theorem, so there is

$$\begin{array}{@{}rcl@{}} P^{\infty }&=&\lim\limits_{k\to \infty } \left[ {{\begin{array}{c} {C^{k}}\\ {\sum\limits_{i=1}^{k-1} {T^{i}RC^{k-i}}}\\ \end{array} }{\begin{array}{c} {...}\\ {...}\\ \end{array} }{\begin{array}{c} 0\\ {T^{k}}\\ \end{array}}} \right]\\ &=&\left[{{\begin{array}{l} {C^{\infty }}\\ {R^{\infty }}\\ \end{array}}{\begin{array}{l} {...}\\ {...}\\ \end{array}}{\begin{array}{l} 0\\ T \\ \end{array}}} \right],C^{\infty }=(1),R^{\infty }=(1,1,...,1)^{T}, \end{array} $$

And then,

$$P^{\infty }=\left[ {{\begin{array}{cccc} 1 \hfill & 0 \hfill & {...} \hfill & 0 \hfill \\ 1 \hfill & \hfill & {...} \hfill & 0 \hfill \\ {\vdots} \hfill & {\vdots} \hfill & \hfill & {\vdots} \hfill \\ 1 \hfill & 0 \hfill & {...} \hfill & 0 \hfill \\ \end{array} }} \right]. $$

The matrix is stable random matrix, so \(\lim \limits _{t\to \infty } p\{F(X^{t})=F_{Best} \}=1 \quad F_{best} \) is the optimal objective function value, namely F b e s t = f(X t). Therefore, AFSAOCP has global convergence, prove to complete. ⌈ proven ⌋ □

7 Conclusion

Optimization problems exist in many areas, A novel Artificial Fish Swarm Optimization Algorithm Aided by Ocean Current Power (AFSAOCP) is put forward in this paper. The main idea has the following two points: introduce the current ideas and grouping evolution. The main idea to consider that the ocean current always influences fishes’ speed, including positive influence and negative influence. The experimental studies in this paper show that the proposed AFSAOCP algorithm improves the existing performance of other algorithms compared to some same benchmarks.

The AFSAOCP also has a very big development space. In the future, it is very interesting to discuss that different fish have different speeds and the problem angle of fish swimming. In addition, it is very meaningful to change the mutation strategy of the fish’s S t e p . We believe that the dynamic value of S t e p or other fixed value would make the AFSAOCP better.