1 Introduction

Many real-life optimization problems possess complicated properties, such as multimodality, high dimensionality and non-differentiability, so that they are difficult to solve. Many experts and scholars have indicated that exact optimization techniques, such as steepest decent, dynamic programming and linear programming, failed to provide an optimal solution for optimization problems of these types [1, 2]. For instance, many traditional optimization methods require the gradient information of optimization problems so that they cannot approach nondifferentiable problems. Therefore, a great deal of efficient nature-inspired meta-heuristic optimization techniques, which do not demand the gradient information of optimization problems, have been proposed to address these complex optimization problems.

During the last three decades, the research of meta-heuristics intelligent optimization algorithm has become a research hotspot. Many state-of-the-art swarm optimization algorithms were proposed and developed in recent decades. Particle swarm optimization (PSO) [3] was proposed based on the foraging behavior of birds. Artificial bee colony [4] was proposed based on the foraging behavior of honey bees. Gravitational search algorithm (GSA) [5] was proposed based on the principle of gravitational force. Krill herds (KH) algorithm [6] was proposed based on the foraging behavior of krill herds. Social-spider optimization algorithm (SSO) [7] was proposed based on the cooperative behavior between the female spiders and the male spiders. Sine Cosine Algorithm (SCA) [8] was proposed based on the sine and cosine functions. Teaching–learning-based optimization (TLBO) [9] algorithm was proposed based on the teaching–learning behavior of class. Moreover, these nature-inspired meta-heuristic optimization methods have been proved that they are suitable to solve those complex function problems [4, 10, 11] and difficult real-life problems [12,13,14,15].

Teaching–learning-based optimization algorithm (TLBO) is a sort of novel population-based optimization method, which is proposed to obtain global solutions of continuous non-linear functions or engineering optimization problems. It has several superior properties, such as less computational effort, high consistency and less setting parameters. The TLBO has been applied to a wide range of real-world optimization problems, such as electrical engineering [16,17,18,19], manufacturing processes [20, 21] and economic load dispatch [22]. However, many researchers still proposed a large number of variants to improve the performance of TLBO algorithm. In order to improve the solution quality and quicken the convergence speed of the TLBO, Li et al. [23] proposed a kind of ameliorated teaching learning based optimization algorithm. In [24], the elitism mechanism is introduced in TLBO to enhance its performance. To enhance the exploration and exploitation capacities of TLBO, Rao et al., introduced some improved mechanisms in teaching–learning-based optimization algorithm [25]. In literature [26], quasi-opposition based learning concept was integrated with original TLBO to accelerate the convergence speed of TLBO.

In literature [1], Rao R.V. etc. indicated some nature-inspired population-based optimization algorithms had several limitations in one or the other aspects. Hence, many researchers proposed all kinds of mechanisms to improve the performance of algorithms. The enhancement of one algorithm is divided into two ways. The first way was done by modifying the existing algorithms. The second way was done by combining the strengths of different optimization algorithms. In this paper, a modified teaching–learning-based optimization algorithm is proposed by the first way.

Although the TLBO algorithm has shown good performance for a wide range of real-world optimization problems, its solution quality and convergence speed are still improved further by some methods. In order to improve the solution quality and convergence speed of TLBO, a modified teaching–learning-based optimization algorithm is proposed, namely MTLBO. In this paper, a new concept is firstly introduced, which is called ‘actual teaching learning situation’ (ATLS). In a real-life class, superior student has good self-learning ability and comprehensive ability, who either obtains knowledge from teacher and a more superior student or studies independently. For an underachiever, he gets knowledge from teacher or a more superior student principally. Moreover, a good teacher makes his or her efforts to bring the learners to his or her level in terms of knowledge. The MTLBO algorithm also has two phases, namely ‘teacher phase’ and ‘learner phase’. In teacher phase, all students are divided into two groups according to the mean result in the class. We assume that if one student’s comprehensive mark is higher than the mean result, the student is considered as a superior. Otherwise, the student is regarded as an underachiever. In learner phase, the students are also divided into two groups. The first group includes the top half of the student and the second group contains the remaining students. The first group members are regarded as superior students. Oppositely, the second group members are underachievers. According to the analysis of ATLS, a superior and an underachiever have different solution updating mechanisms. The detailed computation process of MTLBO is presented in Sect. 3. It is noted that the MTLBO algorithm has a good balance between exploration and exploitation. In literature [27], authors defined the exploration and exploitation, “Exploration is the process of visiting entirely new regions of a search space, whilst exploitation is the process of visiting those regions of a search space within the neighborhood of previously visited points”. To evaluate the performance of MTLBO, 23 unconstraint benchmark numerical functions and 28 CEC2017 benchmark functions are selected as the test suite. Compared with the original TLBO, the proposed MTLBO algorithm not only enhances the solution quality, but also improves the convergence speed on most testing functions. In addition, simulations on 23 benchmark functions demonstrate that MTLBO outperforms several algorithms in general, including the artificial bee colony (ABC) [4], gravitational search algorithm(GSA) [5], Krill herds(KH) algorithm [6], social-spider optimization algorithm (SSO) [7], Sine Cosine Algorithm (SCA) [8].

The main contributions of this paper are summarized as follows:

  1. 1.

    This paper firstly proposes the concept of ‘actual teaching learning situation’ (ATLS).

  2. 2.

    Based on ATLS, a modified teaching–learning-based optimization algorithm is proposed.

  3. 3.

    The proposed MTLBO is applied to solve 23 unconstraint benchmark functions and 28 CEC2017 functions.

  4. 4.

    The solution quality and convergence speed of the original TLBO are improved obviously.

The rest of this paper is organized as follows. Section 2 reviews the basic TLBO algorithm. Section 3 presents the proposed MTLBO algorithm in detail. Section 4 shows the performance evaluation of the MTLBO. Section 5 concludes this paper.

2 Teaching–learning-based optimization algorithm

Teaching–learning-based optimization algorithm (TLBO) is a novel population-based meta-heuristic intelligent algorithm, which is inspired and proposed by the influence of a teacher on the output of learners in a class. For the TLBO algorithm, it has two vital parts, namely ‘Teacher phase’ and ‘Learner phase’. The teaching–learning-based optimization algorithm is described briefly as follows.

2.1 Teacher phase

In teacher phase, learners obtain knowledge from their teacher. The teacher is regarded as the most knowledgeable person in a class, who makes big efforts to bring learners up to his or her level. Supposed that at any iteration i, Mi is the mean value of the marks and Ti is the teacher. The teacher will put effort to move the mean value Mi to its own level. However, it is hardly realized and the teacher is able to improve the mean of the class room depending on his or her capability. Therefore, the difference between the teacher Ti and the existing mean Mi is given by the Eq. (1). In this phase, the existing solution is updated based on the diff according to the following expression (2).

$$diff={r_i}({T_i} - {T_F}{M_i})$$
(1)
$${X_{new,i}}={X_{old,i}}+diff$$
(2)

where \({X_{old,i}}\) is the ith learner’s mark before updating, \({X_{new,i}}\) is the mark after learning from the teacher. \({r_i}\) is the uniform random numbers from 0 to 1.\({T_F}=round[1+rand(0,1)\{ 2 - 1\} ]\) is a teaching factor, which controls the mean value to be changed. During the algorithm, teaching factor is generated randomly in the range [1, 2]. If \({T_F}\) is equal to 1, the mean value of the class room is not increased in the knowledge level. Oppositely, 2 indicate that the mean value of the class room completes transfer of knowledge.

2.2 Learner phase

In this phase, learners increase their knowledge through learning mutually. A learner can improve his or her knowledge through interacting randomly with other learners, such as group discussions, presentations and formal communications. Moreover, a learner gains knowledge from the more knowledge and experience person. The modification process of learners could be described as follows.

At any iteration i, randomly select two learners \({X_i}\) and \({X_j}\), where \(i \ne j\).

$${X_{new,i}}=\left\{ \begin{gathered} \begin{array}{*{20}{c}} {{X_{old,i}}+{r_i}({X_i} - {X_j})}&{\begin{array}{*{20}{c}} {if}&{f({X_i})<f({X_j})} \end{array}} \end{array} \hfill \\ \begin{array}{*{20}{c}} {{X_{old,i}}+{r_i}({X_j} - {X_i})}&{if}&{f({X_i})>f({X_j})} \end{array} \hfill \\ \end{gathered} \right.$$
(3)

The \({X_{new}}\) is accepted if it gives a better function value.

3 The modified teaching–learning-based optimization algorithm

In this section, a new concept is firstly introduced, which is called ‘actual teaching learning situation’ (ATLS). In a real-life class, one student is considered as a superior student or an underachiever according to his or her comprehensive results. For a superior student, he or she has good self-learning ability, so he or she can not only increase his or her knowledge relying on self-study, but also obtain knowledge from teacher or a more superior student. For an underachiever, they obtain knowledge from their teacher or a more superior student principally. Moreover, a good teacher makes his or her efforts to bring the learners to his or her level in terms of knowledge. Based on the actual ‘teaching learning’ situation, a modified teaching–learning-based optimization algorithm, namely MTLBO, is proposed to enhance the solution quality and accelerate the convergence speed of the conventional TLBO. The MTLBO algorithm is described in detail as follows.

3.1 Teacher phase

In this phase, all students are divided into two groups based on the mean value of the class room. One group contains the superior students, another includes the underachievers. We assume that if one student’s comprehensive mark is higher than the mean mark of the class, the student is considered as a superior student. Otherwise, the student is regarded as an underachiever. In this paper, the proposed MTLBO is used to solve the minimum optimization problem, so the individual presents the best performance with the lowest fitness value. In MTLBO, for a superior student, he can get knowledge from the best individual and study independently. The meaning of study independent is that the superior student still searches the optimal solution along with his previous information direction. For an underachiever, he obtains knowledge from his teacher. Based on the above analysis, the solution updating mechanism is shown in Eq. (4). Moreover, the expression of inertia weight is presented in Eq. (5).

$$X_{{new,i}} = \left\{ \begin{aligned} &X_{{old,i}} \times W + (X_{{best}} - X_{{old,i}} ) \times rand\quad if\quad f(X_{{old,i}} ) < f(X_{{mean}} ) \hfill \\ & (X_{{old,i}} + (rand - 0.5) \times 2 \times (X_{{mean}} - X_{{old,i}} )) \times \sin \left( {\frac{\pi }{2} \times \frac{{iter}}{{MaxIter}}} \right) + diff \times \cos \left( {\frac{\pi }{2} \times \frac{{iter}}{{MaxIter}}} \right)\quad if\quad f(X_{{old,i}} )> f(X_{{mean}} ) \hfill \\ \end{aligned} \right.$$
(4)
$$W={\omega _{start}} - ({\omega _{start}} - {\omega _{end}}) \times \frac{{iter}}{{MaxIter}}$$
(5)

Seen from Eq. (4), \({X_{mean}}\) is the mean result, W is the inertia weight which decides to balance the exploration and exploitation ability. Additionally, we also introduce \(\sin (\frac{\pi }{2} \times \frac{{iter}}{{MaxIter}})\) and \(\cos (\frac{\pi }{2} \times \frac{{iter}}{{MaxIter}})\) as inertia weights which can accelerate the convergence speed. \(iter\) is the current iteration, \(MaxIter\) is the maximum iteration. Seen from Eq. (5), the inertia weight descends linearly from\({\omega _{start}}\) to \({\omega _{end}}\). Therefore, the adjustment process of inertia weight allows the MTLBO algorithm to explore the search space in the initial steps and to exploit the optimal solution in the latter steps.

It is noted that the two inertia weights \(\sin (\frac{\pi }{2} \times \frac{{iter}}{{MaxIter}})\) and \(\cos (\frac{\pi }{2} \times \frac{{iter}}{{MaxIter}})\) are firstly introduced to accelerate the convergence speed of TLBO. With the operation of MTLBO, the changing curves of two inertia weights are shown in Fig. 1. For an underachiever, his fitness value \(f({X_{old,i}})\) is higher than the mean fitness value \(f({X_{mean}})\), so he obtains knowledge from his teacher at the early stage. So the teacher plays an important role to improve the student’s knowledge in the initial step. With the running of MTLBO, all individuals close to the optimal solution gradually if the algorithm shows good global convergence ability. Therefore, to avoid trapping into local optimum, the diversity of the population is increased in the latter step. Based on the analysis, the solution quality and convergence speed of MTLBO are indeed enhanced by the two inertia weights.

Fig. 1
figure 1

The simulation curves of sin(x) and cos(x) function

3.2 Learner phase

After teacher phase, the fitness values of all learners are sorted in ascending order. Then, the students are divided into two groups, where the first group includes the top half students and the second group contains the remaining students. The first group members are regarded as superior students, so they can not only obtain knowledge from a more superior student, but also study independently. The second group members get knowledge from their teacher principally. Therefore, the first group students update their results based on Eq. (6). On the contrary, the second group learners update their results according to Eq. (7).

$$\begin{gathered} \begin{array}{*{20}{c}} {if}&{f({X_{old,i}})>f({X_{neighbour}})} \end{array} \hfill \\ \begin{array}{*{20}{c}} {}&{{X_{new,i}}={X_{old,i}}+({X_{neighbour}} - {X_{old,i}}) \times \cos \left( {\frac{\pi }{2} \times \frac{{iter}}{{MaxIter}}} \right)} \end{array} \hfill \\ else \hfill \\ \begin{array}{*{20}{c}} {}&{{X_{new,i}}={X_{old,i}}+(rand - 0.5) \times 2 \times ({X_{upper\lim it}} - {X_{lower\lim it}})} \end{array} \hfill \\ end \hfill \\ \end{gathered}$$
(6)
$${X_{new,i}}={X_{old,i}}+({X_{best}} - {X_{old,i}}) \times \cos \left( {\frac{\pi }{2} \times \frac{{iter}}{{MaxIter}}} \right)$$
(7)

Shown in Eq. (6), in jth iteration, for a learner \({X_i}\), randomly selects a learner \({X_{neighbour}}\), where \(neighbour \ne i\). If \({X_{neighbour}}\) has a smaller fitness value than \({X_i}\), the student \({X_i}\) will obtain the knowledge from \({X_{neighbour}}\); otherwise, he will learn knowledge by himself. Based on this kind of mechanism, the diversity of the population will be increased and the convergence speed will be quickened simultaneously. For the second group members, there is a big gap between the latter of half learners and the teacher, so a big correction is needed to improve the learner’s mark. Also, the convergence speed is accelerated obviously.

3.3 MTLBO procedure

In order to improve the performance of the conventional TLBO, a sort of new TLBO variant is proposed. Based on the aforementioned explanations of the proposed optimization algorithm, the general procedure of MTLBO algorithm is given in detail as follows.

figure a

4 Experimental study and discussion

4.1 Experimental setup

In this section, to evaluate the performance of MTLBO, 23 famous unconstraint benchmark numerical function problems are adopted, which includes 7 unimodal high dimension functions (F1–F7), 6 multimodal high dimension functions (F8–F13) and 10 fixed dimension functions (F14–F23). For unimodal test functions, every function has only one global optima solution, which makes them be beneficial for verifying the convergence speed and exploitation of algorithm. For multimodal test functions, every function has multiple local solutions other than the global optimal solution. These multimodal test functions are suitable to measure the local optima avoidance and the explorative ability of algorithms. These testing functions are described in detail in Table 1, in which includes the searching range, the theory global optima and functional characteristics.

Table 1 23 benchmark functions used in experiments

In addition, the performance of the proposed MTLBO algorithm is compared with other heuristic optimization algorithms: artificial bee colony (ABC) [4], Gravitational Search Algorithm (GSA) [5], Krill Herds algorithm (KH) [6], Social-Spider Optimization algorithm (SSO) [7], Sine Cosine Algorithm (SCA) [8] and TLBO. They are the state-of-the-art optimization algorithms in recent years. The preset parameters of each algorithm are given in Table 2, where contains population size, maximal iteration and algorithm specific-parameter etc. Shown in Table 2, the maximum iteration indicates that every algorithm stops optimizing after 1000 circles. Dimension represents the dimensions of optimization parameters. For ABC, if a position cannot be improved further through a predetermined number of cycles called Limit then that food source is assumed to be abandoned [4]. For GSA, \({G_0}\) is the initial gravitational constant and \(\alpha\) is a constant. In [5], the initial gravitational constant \({G_0}\) is equal to 100 and \(\alpha\) is equal to 20. For SSO, PF is a probability threshold. For SCA, \(a\) is a constant, which is set 2 in [8]. Note that: in original TLBO, duplicate elimination process is applied to increase the population diversity. However, the process is not used in our algorithm. So the number of function evaluations of MTLBO algorithm is = (2 × population size × number of generations). The computation cost will be decreased when the two algorithms have the same maximum generations. In this paper, the population size of the TLBO and MTLBO algorithm is set to 20.

Table 2 Parameters setting

The tests are implemented on Intel (R) Core(TM)64 × 2 Dual Core Processor T5670 @1.80, 1.79 GHz and 2 GB RAM. All algorithms are coded and carried out in Matlab 2009 version under the Windows XP Professional.

4.2 Comparison with other algorithms

In this subsection, simulations using MTLBO, ABC, GSA, KH, SSO, SCA and TLBO are conducted on all the above 23 functions. Due to the stochastic nature of meta-heuristics, the results of one single run may be unreliable. Therefore, each algorithm runs 30 times independently to reduce the statistical error. The performance of different optimization algorithms in terms of the mean and standard deviation (SD) of solutions obtained in the 30 independent runs for 20 and 50 dimensional functions. The maximal iteration 1000 is used as the stopping criterion.

4.2.1 The analysis of experimental results for unimodal functions

In this subsection, 7 unimodal functions are adopted to evaluate the performance of MTLBO. The experimental results of 20 and 50 dimensional functions are listed in Tables 3 and 4, respectively. Boldface in the tables indicates the best results. The mean value is smaller, the performance of algorithm is better. The standard deviation value is lower, the stability of algorithm is stronger. For these tables, it is easy to see that MTLBO algorithm wins the smallest mean value and standard deviation value in 5 unimodal functions. Additionally, Fig. 2 graphically presents the comparison in terms of convergence speed and solution quality for solving 6 unimodal functions (F1, F2, F4, F5, F6 and F7) with 20 dimensions. The detailed analysis of experimental results is given as follows.

Table 3 The mean solution and standard deviation of the 30 trails obtained for 20 dimensional functions
Table 4 The mean solution and standard deviation of the 30 trails obtained for 50 dimensional functions
Fig. 2
figure 2

Convergence curves of the 7 methods on 6 unimodal functions with 20 dimensions

Tables 3 and 4 show that MTLBO outperforms some other methods in terms of the mean and standard deviation for some unimodal functions. Shown in Table 3, the performance of MTLBO is the best than all other methods for functions F1, F2, F4, F5 and F7. The GSA has the smallest mean and standard deviation for function F6. The SSO displays the best performance for function F3. Particularly, compared with TLBO, the MTLBO shows better performance for functions F1, F2, F4, F5, F6 and F7. The results reveal that MTLBO algorithm enhances the solution quality. Table 4 indicates that the mean and the standard deviation of MTLBO is the best than all other algorithms for functions F1, F4, F5 and F7. The GSA also has the smallest mean and standard deviation for function F6. The SSO still displays the best performance for function F3. The KH shows the best performance for functions F1 and F2. Compared with TLBO, MTLBO shows better performance for all the 7 functions. In short, MTLBO outperforms all the other algorithms on most functions.

4.2.2 The analysis of experimental results for multimodal functions

In this subsection, 6 multimodal functions are used to evaluate the performance of MTLBO. The experimental results of 20 and 50 dimensional functions are listed in Tables 5 and 6, respectively. Boldface in the tables indicates the best results. The mean value is smaller, the performance of algorithm is better. The standard deviation value is lower, the stability of algorithm is stronger. According to these tables, the proposed MTLBO algorithm presents superior performance on most functions. Additionally, Fig. 3 graphically presents the comparison in terms of convergence speed and solution quality for solving 4 unimodal functions (F9, F10, F11 and F12) with 50 dimensions. The detailed analysis of experimental results is given as follows.

Table 5 The mean solution and standard deviation of the 30 trails obtained for 20 dimensional functions
Table 6 The mean solution and standard deviation of the 30 trails obtained for 50 dimensional functions
Fig. 3
figure 3

Convergence curves of the 7 methods on 4 multimodal functions with 50 dimensions

Seen from Table 5, the performance of MTLBO is better than other algorithms for functions F8, F9, F10 and F11. The ABC has the smallest mean and standard deviation for function F12. The GSA has better performance in terms of the mean and the standard deviation than all other methods for function F13. The KH shows the best performance than all other algorithms for functions F9, F10 and F11. The original TLBO has good performance for function F9. Table 6 shows the performance results for 50 dimensional functions. For this table, it is easy to observe that MTLBO wins the smallest mean and standard deviation for functions F8, F9, F10 and F11 as well. Moreover, the ABC has the smallest mean and standard deviation in two functions F12 and F13. The KH algorithm also obtains the better performance for functions F9, F10 and F11. Compared with TLBO, MTLBO shows better performance for all functions except function F13. In brief, the proposed MTLBO improves the solution quality for multi-modal functions.

4.2.3 The analysis of experimental results for fixed dimension functions

In this subsection, 10 fixed dimension functions are applied to evaluate the performance of the proposed modified teaching–learning-based optimization algorithm. The experimental results are listed in Table 7. According to this Table, the ABC can achieve the global optimal solution on all functions. The GSA can find the global optima on 4 functions (F14, F16, F17, F18). The SSO algorithm can find the global optima or the solutions close to the global optima on 9 functions except F14. The KH can find the global optima only on two functions (F14, F15). The SCA can find the global solutions on 6 functions (F14, F15, F16, F17, F18, F19). For TLBO, it can achieve the global optima solution on 7 functions (F14, F15, F16, F17, F18, F19, F20). The MTLBO can find the global optima on six functions (F14, F17, F18, F21, F22, F23) with short running time. For the remaining functions, MTLBO can obtain the solution quite close to the global optima. Particularly, compared with TLBO, the running time of MTLBO is shorter on all fixed dimension functions. It is noted that although the solution updating mechanism of MTLBO is more complex than the original TLBO, the MTLBO algorithm eliminates the duplicate elimination process. Hence, the computation cost will be decreased when the two methods have the same maximum generation. Moreover, three inertia weights are introduced in MTLBO to enhance the convergence speed and solution quality. Therefore, MTLBO is able to obtain good solution with low simulation time.

Table 7 The comparison results of fixed dimension functions for 7 optimization algorithms

4.3 Comparisons with TLBO on CEC2017 benchmark functions

In this subsection, the performance of MTLBO is compared with TLBO on 28 CEC2017 benchmark functions, which are obtained from the literature [28]. These functions contain 2 unimodal functions, 7 simple multimodal functions, 10 hybrid functions and 9 composition functions. The detailed descriptions of these functions are recorded in literature [28]. For both MTLBO and TLBO, the population size is 40 and the maximum iteration is 500. In order to reduce the computation error, MTLBO and TLBO separately run 30 times for every testing function. Average results of 30 trials of simulations are listed in Tables 8, 9 and 10, respectively.

Table 8 The mean solution and standard deviation of the 30 trails obtained for 10 dimensional functions
Table 9 The mean solution and standard deviation of the 30 trails obtained for 30 dimensional functions
Table 10 The mean solution and standard deviation of the 30 trails obtained for 50 dimensional functions

Seen from Tables 8, 9 and 10, TLBO and MTLBO gain similar performance on most testing functions. However, the two algorithms cannot get the global optima for every testing function. Therefore, TLBO and MTLBO are suitable to solve the basic benchmark functions that have global optima in zero point. In the future, we will focus on solving the problem of TLBO and MTLBO.

5 Conclusions

In this paper, a variant of TLBO which is called MTLBO is proposed to enhance the solution quality and convergence speed of TLBO. The proposed MTLBO algorithm firstly introduces the concept of ‘actual teaching–learning situation’ so that the population updating mechanism is conformed to the real class. Also, three inertia weights are used to enhance the solution quality and convergence speed and balance the exploration and exploitation of MTLBO. The performance of MTLBO algorithm is verified over a series of 23 unconstraint benchmark numerical function problems. The results reveal that the proposed MTLBO outperforms other state-of-the-art algorithms on most functions. In addition, 28 CEC2017 benchmark functions are used to verify the performance of MTLBO. The experimental results reveal that the current version of MTLBO can not present satisfactory performance on these testing functions.

In the future, the MTLBO will be improved and used to solve more challenging rotated and shifted functions and optimize the structure of artificial neural network. Simultaneously, it will be used for real life problems.