Introduction

Optimization problems exist widely in the real world, and therefore methods used to solve these problems have been a hot topic. Traditional gradient-based methods (such as the steepest descent method and the Newton method) have been used to solve various optimization problems successfully. However, as the optimization problems come to be increasingly complicated, gradient-based methods are inefficient and inconvenient because they require substantial gradient information, are sensitive to initial values and need a large amount of enumeration memory. In the past few decades, evolutionary computing has become an attractive and effective optimization method for rapidly growing complex modern optimization problems. The optimization approaches inspired by biological systems have attracted considerable interest in recent years, which are quite successful in solving problems in optimal allocation of science and technology resources, industrial automation, economy and other fields.

As is known to all, human beings as the smartest creature in the earth are capable of solving a large number of complicated problems that other living beings, such as birds, ants, and fireflies, cannot tackle. Humans have a powerful learning ability, and the process of human learning is extremely complicated, of which the study is the part of neuropsychology, educational psychology, learning theory and pedagogy [1]. Actually, most of human learning activities are similar to the search process of metaheuristics. Motived by this thought, Wang et al. [2] proposed human learning optimization (HLO) based on a simplified human learning model in which three learning operators, i.e. the random learning operator (RLO), the individual learning operator (ILO), and the social learning operator (SLO), are developed to search out the optimal solution by mimicking the random learning strategy, the individual learning strategy, and the social learning strategy in the learning activities of humans, respectively. The performance of HLO, like other meta-heuristic algorithms, is sensitive to its parameter values. Therefore, to further improve the global search ability and the robustness of HLO, an adaptive simplified human learning optimization (ASHLO) [3] has been proposed. Later, based on the fact that the Intelligence Quotient (IQ) scores followed Gaussian distribution [4], a diverse human learning optimization algorithm [5] is proposed to improve the performance of HLO, in which the Gaussian distribution and dynamic adjustment strategy were introduced to strengthen the robustness of the algorithm. In addition to that, a new adaptive HLO based on sine–cosine functions [6] is developed, which enhances the explore and exploitation abilities of the algorithm periodically by tuning the control parameters with the sine and cosine functions. Recently, a novel adaptive human learning algorithm (IAHLO) [7] is developed to dynamically tune the control parameter of the random learning operator, which can efficiently develop the diversity at the beginning of iteration and perform the accurate local search at the end of search.

Since both individual learning and social learning operations in standard HLO copy their individual optima, and only random learning explores new solutions with a small probability, the algorithm is prone to fall into local optima. Therefore, it is necessary to design a new operation operator to further improve the performance of HLO. For this reasons, when an individual cannot continuously improve his fitness, a relearning operation is designed in [8]. This operator can eliminate the stored knowledge of the individual and make the individual start searching again with a good chance to escape from local optimum. Besides, the hybrid algorithm ASHLO-GA in [9] and HLO-PSO in [10] are proposed to tackle supply chain network design problem and the flexible job-shop scheduling problem (FJSP), respectively. Since binary algorithms are ineffective in solving high-dimensional continuous problems, a continuous HLO is firstly presented and integrated with the binary HLO to solve mixed-variable optimization problems [11]. Besides, a discrete HLO is proposed in [12] and successfully used to solve the production scheduling problem. Now, HLO has been successfully applied to knapsack problems [2, 3, 5, 8], text extraction [13], optimal power flow calculation [14, 15], financial markets forecasting [6], image segmentation [16] and intelligence control [17,18,19].

Nowadays, human learning has being been widely researched in multiple disciplines including computer [20], economics [21], sociology [22], etc. Human beings have social attributes and always interact with each other in the practice of life. Competition and cooperation are the two basic forms of interaction [23]. Actually, many social activities in humans contain both competition and cooperation [24]. Furthermore, competition can lead to higher levels of cooperation [25], and cooperation can further build competitive advantage [26]. Therefore, competition and cooperation can motivate learners to learn more efficiently and improve their efficiency in solving problems. In real life, people find and learn from individuals who are better than themselves by comparing with each other, which is the process of competition and cooperation. Comparing with each other can be seen as a process of competition, while learning from each other is cooperation. Through competition and cooperation, individuals can have more possibilities to learn new knowledge and diversify the group's overall structure [27]. The social learning operation of HLO is designed according to the “copy-the-best” strategy, which can easily lead to the algorithm falling into local optima. However, the introduction of cooperation mechanism can help the algorithm avoid falling into local optimization, because the learning mechanism of competition and cooperation can effectively increase the diversity of the population. Inspired by this learning mechanism, a human learning optimization with competitive and cooperative learning (HLOCC) is proposed in this paper, in which a novel competitive and cooperative learning strategy is developed to improve the balance between exploration and exploitation of HLO.

The rest of the paper is organized as follows. Section “Human learning optimization with competitive and cooperative learning” introduces the idea, operators and implementation of the proposed HLOCC in detail. The parameter study of HLOCC is given in section “Parameter study of HLOCC” to insightful analyze and explain why the developed competitive and cooperative learning operator can enhance the search ability of algorithm. Then the performance of HLOCC is evaluated and compared with recent state-of-art metaheuristics in section “Experimental results and discussions”. Finally, conclusions are drawn in section “Conclusions and future works”.

Human learning optimization with competitive and cooperative learning

As a binary metaheuristic, HLOCC adopts the binary-coding framework, and therefore each individual, i.e. the solution, is composed by a binary string as Eq. (1), in which each bit denotes a basic component of knowledge of problems,

$$ \begin{aligned} & x_{i} = \left[ {x_{i1} \, x_{i2} \cdots x_{ij} \cdots x_{iM} } \right],\\ & x_{ij} \in \left\{ {0,1} \right\},{1} \le i \le N,{1} \le j \le M \end{aligned} $$
(1)

where \({x}_{ij}\) is the j-th bit of the i-th individual, and N and M denote the size of population and the length of solutions, respectively. At the beginning of learning, humans usually have no prior knowledge of problems, thus each individual of HLOCC is initialized with “0” or “1” randomly.

Random learning operator

Random learning always exists in the human learning as usually there is no prior knowledge of new problems [28]. Besides, it is a simple but valid strategy for humans to explore new strategies and improve performance in the progress of learning. To imitate the random learning strategy, the random learning operator (RLO) is used in HLOCC as Eq. (2)

$$ x_{ij} = {\text{RLO}} = \left\{ {\begin{array}{*{20}l} {0,{ 0} \le r_{1} \le 0.5} \hfill \\ {1,{\text{ else}}} \hfill \\ \end{array} } \right. $$
(2)

where \({r}_{1}\) is a stochastic number between 0 and 1.

Individual learning operator

Individual learning [29, 30] is the ability of humans to build up knowledge through individual reflection. By following previous experience, people can avoid mistakes and improve the efficiency and effectiveness of learning. To mimic this learning behavior, L best individual solutions are memorized and stored in the individual knowledge database (IKD) of HLOCC for individual learning, which is defined as Eqs. (3) and (4):

$$ I{\text{KD}} = \left[ {\begin{array}{*{20}c} {{\text{ikd}}_{1} } \\ {{\text{ikd}}_{2} } \\ \vdots \\ {{\text{ikd}}_{i} } \\ \vdots \\ {{\text{ikd}}_{N} } \\ \end{array} } \right]{, 1} \le i \le N $$
(3)
$$ {\text{ikd}}_{i} = \left[ {\begin{array}{*{20}c} {{\text{ikd}}_{i1} } \\ {{\text{ikd}}_{i2} } \\ \vdots \\ {{\text{ikd}}_{ip} } \\ \vdots \\ {{\text{ikd}}_{iL} } \\ \end{array} } \right] = \left[ {\begin{array}{*{20}c} {{\text{ik}}_{i1,1} } & {{\text{ik}}_{i1,2} } & \cdots & {{\text{ik}}_{i1,j} } & \cdots & {{\text{ik}}_{i1,M} } \\ {{\text{ik}}_{i2,1} } & {{\text{ik}}_{i2,2} } & \cdots & {{\text{ik}}_{i2,j} } & \cdots & {{\text{ik}}_{i2,M} } \\ \vdots & \vdots & {} & \vdots & {} & \vdots \\ {{\text{ik}}_{ip,1} } & {{\text{ik}}_{ip,2} } & \cdots & {{\text{ik}}_{ip,j} } & \cdots & {{\text{ik}}_{ip,M} } \\ \vdots & \vdots & {} & \vdots & {} & \vdots \\ {{\text{ik}}_{iL,1} } & {{\text{ik}}_{iL,2} } & \cdots & {{\text{ik}}_{iL,j} } & \cdots & {{\text{ik}}_{iL,M} } \\ \end{array} \cdots } \right],\;1 \le p \le L $$
(4)

where \({\mathrm{ikd}}_{i}\) denotes the individual knowledge database of person i, and \({\mathrm{ikd}}_{ip}\) stands for the p-th best solution of person i.

When HLOCC performs the individual learning operator (ILO), the candidate solution learns from a random solution in its IKD as Eq. (5):

$$ x_{ij} = {\text{ik}}_{ip,j} $$
(5)

After a new population is generated, the fitness of all individuals is calculated according to the pre-defined fitness function to update the IKDs. Since HLOCC is designed for solving single-objective problems, the size of IKDs is set to 1 as suggested in previous works on HLO. Therefore, the new candidate replaces the original solution in the IKDs if and only if its fitness value is superior.

Competitive and cooperative learning operator

Competition and cooperation, as two basic modes of social cognition [31], occupy a critically important place in the research into individual as well as both group and societal behavior [32]. The social interdependence theory [33, 34] states that competitive and cooperative learning can significantly improve learning efficiency and make the overall structure of the group more diversified. Because the social learning of standard HLO relies too much on global optimization, the algorithm is easy to fall into local optimization. The competition and cooperation mechanism can increase the diversity of population, so that the algorithm can discover new solution areas. Inspired by these discoveries, a novel competitive and cooperative learning operator (CCLO) is developed to implement competitive and cooperative learning in HLOCC to increase the diversity of the population.

When performing CCLO, the current individual is compared with an individual randomly selected from a population that does not include itself according to the fitness value to determine whether the current individual is a winner or a loser. The winner's individual optimal solution is recognized, while the loser needs to learn from the winner’s experience. During the learning process, if the current individual is the winner, the standard HLO will continue to be followed, otherwise, the competitive and cooperative learning operator will be added to learn the winner’s individual optimal solution. The learning process can be represented by Eq. (6)

$$ x_{ij}^{{{\text{loser}}}} = ik_{kj}^{{{\text{winner}}}} ,k \ne i $$
(6)

where \(ik_{k}^{{{\text{winner}}}}\) denotes the IKD of winner individual k. The mechanisms of the competitive and cooperative learning can be described as Fig. 1.

Fig. 1
figure 1

Mechanisms of the competitive and cooperative learning

Social learning operator

Social learning [35] plays an important role in social environment because it allows human being to copy the best solutions in the population and accelerate the learning process. Although CCLO is also a social learning operation, the probability of learning the best individual is relatively small and the learning efficiency is low. When problems become extremely complicated and time-consuming, people prefer to learn from the individual with the highest social evaluation value in the population, that is, “copy the best” strategy[36]. It can quickly drive the whole population towards the best optimal solutions. Correspondingly, HLOCC conducts the social learning operator to emulate the “copy the best” behavior of humans, the best knowledge of population is stored in the social knowledge database (SKD) as Eq. (7)

$$ {\text{SKD}} = \left[ {\begin{array}{*{20}c} {{\text{skd}}_{1} } \\ {{\text{sk}}d_{2} } \\ \vdots \\ {{\text{sk}}d_{q} } \\ \vdots \\ {{\text{sk}}d_{H} } \\ \end{array} } \right] = \left[ {\begin{array}{*{20}c} {sk_{11} } & {{\text{sk}}_{12} } & \cdots & {{\text{sk}}_{1j} } & \cdots & {{\text{sk}}_{1M} } \\ {{\text{sk}}_{21} } & {{\text{sk}}_{22} } & \cdots & {{\text{sk}}_{2j} } & \cdots & {{\text{sk}}_{2M} } \\ \vdots & \vdots & {} & \vdots & {} & \vdots \\ {{\text{sk}}_{q1} } & {{\text{sk}}_{q2} } & \cdots & {{\text{sk}}_{qj} } & \cdots & {{\text{sk}}_{qM} } \\ \vdots & \vdots & {} & \vdots & {} & \vdots \\ {{\text{sk}}_{H1} } & {{\text{sk}}_{H2} } & \cdots & {{\text{sk}}_{Hj} } & \cdots & {{\text{sk}}_{HM} } \\ \end{array} } \right],\;1 \le q \le H $$
(7)

where \({\mathrm{skd}}_{q}\) denotes the q-th solution in the SKD and H is the size of SKD.

With the knowledge in the SKD, the HLOCC performs the social learning operator (SLO) to generate new candidate solutions as Eq. (8)

$$ x_{ij} = {\text{skd}}_{qj} $$
(8)

the size of SKD in HLOCC is also set to 1, and the new candidate is saved to replace the current one in the SKD only if it has a better fitness value.

Implementation of HLOCC

In summary, when the current individual is the winner, it will use the three learning operators like standard HLO, which can be described as Eq. (9), while if it is the loser, it will perform the random learning operator, the individual learning operator, the competitive and cooperative learning operator and the social learning operator to generate new candidate solutions, which are presented as Eq. (10)

$$ x_{ij}^{{{\text{winner}}}} = \left\{ {\begin{array}{*{20}l} {{\text{RLO}}} &\quad {0 \le r_{2} \le {\text{pr}}} \\ {{\text{ik}}_{kj}^{{{\text{winner}}}} } &\quad {{\text{pr}} \le r_{2} \le {\text{pi}}} \\ {{\text{sk}}_{qj} } &\quad {{\text{else}}} \\ \end{array} } \right. $$
(9)
$$ x_{{ij}}^{{{\text{loser}}}} = \left\{ {\begin{array}{lllll} {{\text{RLO}},} \hfill &\quad {0 \le r_{3} \le {\text{pr}}} \hfill \\ {{\text{ik}}_{{ipj}}^{{{\text{loser}}}} } \hfill &\quad {{\text{pr}} < r_{3} \le {\text{pil}}} \hfill \\ {{\text{ik}}_{{kj}}^{{{\text{winner}}}} } \hfill &\quad {{\text{pr}} < r_{3} \le {\text{pcc}}} \hfill \\ {{\text{sk}}_{{qj}} } \hfill &\quad {{\text{else}}} \hfill \\ \end{array} } \right. $$
(10)

where \(r_{2}\) is a stochastic number between 0 and 1; (pi–pr) and (1–pi) represent the probabilities of performing individual learning and social learning of the winner individual, respectively; and \(r_{3}\) is a stochastic number between 0 and 1; pr, (pil–pr), (pcc–pil), and (1–pcc) are the probabilities of the random learning, the individual learning, the competitive and cooperative learning, and social learning of the loser individual, respectively.

The implementation of HLOCC is described in Fig. 2.

Fig. 2
figure 2

The flowchart of HLOCC

Parameter study of HLOCC

Analysis of the control parameters

A parameter study was performed in this section to analyze and choose fair control parameter values for HLOCC. For simplicity, the control parameter pr and pi adopt the default value of HLO [2], i.e. 5/M and 0.85 + 2/M, since the learning strategy of the winner in HLOCC is as same as the standard HLO. Then pil and pcc are investigated as they together determine the probability of performing CCLO. The cross-combination method was used, and the alternate values of control parameters pil and pcc are listed in Table 1. Two functions, i.e. F2 and F8 chosen from the CEC17 benchmark functions [37], were adopted to investigate the influence of these two control parameters, and the characteristics of the CEC17 benchmark are given in Table 2. The size of population and the maximum number of iterations on the 10-dimensional functions were set to 50 and 3000, and they were increased to 100 and 6000 on the 30-dimensional functions. Each decision variable was encoded by 30 bits, and each function ran 100 times independently. To choose the optimal parameters combination, the mean value (Mean) are calculated as the performance indicator and shown in Table 3, where the best numbers are in bold. Note that pcc should be bigger than pil in HLOCC, and therefore only 71 cases which meet this requirement are listed in Table 3. The trails on 10-D F2, 10-D F8, 30-D F2 and 30-D F8 rank in the top 10 percent are all selected and the background are in italics. The parameter combination of trail 58 is adapted as the default parameter setting in this paper as it is the only one in the top 10 percent of all the four cases.

Table 1 Parameter values of pil and pcc
Table 2 CEC17 benchmark functions
Table 3 Results of parameter study

Table 3 shows that HLOCC obtains the best comprehensive results when pil and pcc are set to 0.88 and 0.96, which are chosen as the default values in this work as mentioned above. Obviously, the results in Table 3 display that the setting of performance pil and pcc plays an important role because they determine the probabilities of the individual learning, the competitive and cooperative learning and social learning. It is not difficult to find that the performance of HLOCC significantly drops when pil < 0.80, as a too small pil would spoil the principal learning mechanisms of HLO. The probability of competitive and cooperative learning in HLOCC is determined by the value of (pcc–pil) and it can be noticed that the performance of HLOCC reaches the best when (pcc–pil) = 0.06. In the whole population of HLOCC, some individuals perform HLO operation, while others perform CCLO operation. Compared with the way of generating new solutions in standard HLO, CCLO operation is added to HLOCC, which makes some individuals have the opportunity to learn from other individuals besides their own optima and the global optima, thus increasing the diversity of the algorithm, while reserving some individuals to perform standard HLO. At the same time, HLOCC also retains some individuals to perform standard HLO operations to ensure the convergence of the algorithm. Therefore, HLOCC can achieve a better trade-off between exploration and exploitation with CCLO, which will be further discussed and demonstrated in the next sub-section.

Role of competitive and cooperative learning

To clearly understand the role of the developed competitive and cooperative learning operator, the proposed HLOCC is compared with a variant named HLOCC1, in which only perform the CCLO, and the standard HLO without the CCLO. For a fair comparison, the parameters of standard HLO are set to the recommended values in [2], and the parameters are set as the operation of CCLO of HLCC in which the pil and pcc are 0.88 and 0.96,respectively. HLOCC, as well as HLO and HLOCC1 was adopted to solve the F2 and F8 from CEC17 benchmark functions. Since these two functions are representative Unimodal and Multimodal functions, it is convenient to reveal the performance change caused by CCLO in the search process of HLOCC through recording population diversity changes and comparing it with other HLO variants.

The average fitness value (AFV) curves and the Average Distance (AD) curves of three algorithms on F2 and F8 of 10-Dimensional and 30-Dimensinal are draw in Figs. 3, 4, 5, 6.The Average Distance is defined as the Hamming distance between the global best solution and the individual best solution as Eq. (11), which can be used to examine the variation in the exploration and exploitation abilities of algorithms under different strategies. Therefore, by comparing the AFV and AD curves of HLOCC, HLOCC1 and HLO, it can clearly to probe the impacts of CCLO.

$$ {\text{AD}} = \frac{{\sum\limits_{i = 1}^{N - 1} {\sum\limits_{j = 1}^{M} {\left| {ik_{ij} - sk_{j} } \right|} } }}{M \times (N - 1)},\;\;1 \le i \le N - 1,\;\;1 \le j \le M $$
(11)
Fig. 3
figure 3

The curves of fitness value and average distance of 10-Dimension F2

Fig. 4
figure 4

The curves of fitness value and average distance of 10-Dimension F8

Fig. 5
figure 5

The curves of fitness value and average distance of 30-Dimension F2

Fig. 6
figure 6

The curves of fitness value and average distance of 30-Dimension F8

It can be clearly seen from the fitness curves in Figs. 3, 4, 5, 6 that HLOCC achieves the best solutions on all the cases. The influences of CCLO can be concluded as follows:

  1. 1.

    By comparing HLOCC with HLO, it can be seen that the AD curve of HLO converges faster than HLOCC, and therefore HLO may not sufficiently explore solution space and is likely to be stuck in local optima. With the help of the CCLO, HLOCC can effectively maintain the diversity and prevent the algorithm form falling into the local optima.

  2. 2.

    By comparing HLOCC and HLOCC1, it can be found that HLOCC1 have the opportunities to learn from other individuals, rather than simply copying the SKD like HLO, thus its diversity is maintained well. However, as HLOCC1 only performs CCLO learning, all individuals have a small probability to learn SKD, so its convergence rate is slow.

In summary, the developed CCLO can efficiently retain the optimal bit values by learning the useful information of winner individual best solutions and simultaneously maintain the exploration ability by choosing two different random individuals for comparison each time. Therefore, with the introduction of the CCLO, HLOCC achieves a practically perfect trade-off between exploration and exploitation. Specifically, at the beginning of the search, the efficiency and reliability of the ILO, are low due to the random initialization of the population. At this time, the CCLO can efficiently find the optimal bit values by learning winner individual best solution, which boost the effectiveness and confidence of social learning operator and consequently enhance the exploitation ability of HLOCC. As the greedy strategy is adopted for the updating of IKDs and SKD, the risk of premature and being trapped in the local optimal increases quickly with the progress of the search. With the introduction of the random individual competition, some individuals in the population will maintain initial information that some useful information lost during the learning process has the opportunity to be recovered by the competitive and cooperative learning. The CCLO makes it less likely that information will be lost during the learning process, and therefore the global search ability is significantly enhanced.

Experimental results and discussions

To verify the performance, the proposed HLOCC, as well as eight recent algorithms, i.e. Simple Human Learning Optimization (SHLO) [2], Diverse Human Learning Optimization (DHLO) [8], Time-Varying Mirrored S-shaped Binary Particle Swarm Optimization (TVMSBPSO) [38], Binary Whale Optimization Algorithm (BWOA) [39], Binary Crow Search Algorithm (BinCSA) [40], Quadratic Binary Particle Swarm Optimization (QBPSO) [41], Improved Binary Differential Evolution (IBDE) [42] and Binary Gaining-sharing Knowledge-based Optimization (pBGSK) [43], were applied to solve the CEC17 benchmark functions. For a fair comparison, the recommended parameter values were adopted for all the algorithms, which are listed in Table 4. All the cases ran 100 times independently. Then HLOCC was tested on low-scaled, middle-scaled and large-scaled fifteen UFL Problems. The performance of HLOCC are compared with other state-of-art algorithms. In the third study, a different dataset named M* were tackled by HLOCC to analyze and discuss the performance of HLOCC.

Table 4 Parameters settings of the algorithms

CEC17 benchmark functions

Low-dimensional functions

HLOCC and other eight state-of-the-art algorithms are used to solve the 10-dimensional CEC17 functions. The numerical results, including Mean, the best value (Best) and the standard deviation (Std) are listed in Table 5, where the best results are marked with bold-face. Besides, the student's t test (t-test) and Wilcoxon signed-rank test (W-test) are performed and the corresponding results are also shown in Table 5, in which “+/§/#” indicate that the optimization result of HLOCC is obviously better than, similar to, or worse than the compared algorithm in the 95% confidence interval, respectively. In Table 5, the upper corner of the Mean represents the t-test result, and the lower corner of the Mean represents the W-test result. Note that the t-test, a parameter test, needs to satisfy the normality and homogeneity of variance, while the W-test, a nonparametric test, is not needed. Therefore, the t-test is more reliable when the Gaussian distribution assumption is met while the W-test would be more powerful when this assumption is violated. For convenience, the results of the t-test and W-test are summarized in Table 6, in which the total sore is calculated by subtracting Worse form Better.

Table 5 Results of all algorithms on the 10-dimensional benchmark functions
Table 6 Summary results of the t-test and W-test on the 30-dimensional benchmark functions

Table 5 shows that the proposed HLOCC has the best mean numerical results on 25 out of 30 functions and is only inferior to TVMSBPSO on F3. Besides, the summary results of the t-test in Table 5 indicate that the proposed HLOCC surpasses HLO, DHLO, TVMSBPSO, BWOA, BinCSA, QBPSO, IBDE and pBGSK on 28, 11, 27, 30, 28, 30, 30 and 30 out of 30 functions, respectively. The W-test results support that HLOCC significantly outperforms these compared algorithms on 29, 10, 29, 30, 29, 30, 30 and 30 out of 30 functions, respectively. Thus, it is fair to claim that HLOCC achieves the best performance on the low-dimensional functions.

High dimensional benchmark functions

For the high-dimensional functions, the total number of candidate solutions is increased to 2900, which becomes a challenge for all the algorithms. The results of all algorithms on the 30-dimensional benchmark functions are listed in Table 7, and the summarized t-test and W-test results are given in Table 8. From Table 7, it clearly shows that the HLOCC has the best optimization performance, which obtains 27 of the best mean numerical results out of 30 functions. Besides, Table 8 reveals that the optimization ability of HLOCC is better than others algorithms. Specifically, the t-test results show that HLOCC significantly outperforms HLO, DHLO, TVMSBPSO, BWOA, BinCSA, QBPSO, IBDE and pBGSK on 29, 24, 28, 30, 26, 28,29 and 30 functions while it is only worse than them on 0, 1, 1, 0, 0, 0, 0 and 0 functions, respectively. The W-test results show that HLOCC significantly outperforms HLO, DHLO, TVMSBPSO, BWOA, BinCSA, QBPSO, IBDE and pBGSK on 30, 25, 27, 30, 26, 28, 29 and 30 out of 30 functions, respectively, while it is only defeated by them on 0, 1, 1, 0, 0, 0, 0 and 0 functions, respectively. HLOCC maintains the positive total scores and even obtain a higher value than most compared algorithms, which shows the evident advantage of HLOCC.

Table 7 Results of all algorithms on the 30-dimensional benchmark functions
Table 8 Summary results of the t-test and W-test on the 30-dimensional benchmark functions

The uncapacitated facility location problem

The uncapacitated facility location problem (UFLP), also known as the simple plant location problem [44] or uncapacitated warehouse location problem [45], is a well-known binary optimization problem in operations research. The problem has only binary decision variables and is suitable for verifying the performance analysis and comparison of binary optimization algorithms. In the basic formula, the UFL problem consists of m numbers of customer demands and n numbers of facilities [46]. The problem has two costs, opening a facility at a potential location requires a fixed cost and the transshipment cost between the customer location and the facility. The aim of the problem is to minimize the total opening and transportation costs by setting decision variables 0 or 1, so as to meeting the demands of customers when determining the location of the facilities [47]. The value of decision variables 0 or 1 determines whether the facility is turned on or off. The general model for UFL problem can be mathematically stated as follows [48]:

$$ \min f = \sum\limits_{i = 1}^{n} {\sum\limits_{j = 1}^{m} {c_{ij} } } x_{ij} + \sum\limits_{i = 1}^{n} {f_{i} } y_{y} $$
(12)

subject to:

$$ \begin{gathered} \sum\limits_{i = 1}^{n} {x_{ij} = 1,\;j = 1,2, \ldots ,m} \hfill \\ x_{ij} - y_{i} \le 0,\;i = 1,2, \ldots ,n,j = 1,2, \ldots ,m \hfill \\ x_{ij} \in \left\{ {0,1} \right\},\;i = 1,2, \ldots ,n,j = 1,2, \ldots ,m \hfill \\ y_{i} \in \left\{ {0,1} \right\},\;i = 1,2, \ldots ,n \hfill \\ \end{gathered} $$
(13)

where the term \(c_{ij}\) is the transportation cost between the location of facility i and location of customer j; the term \(f_{ij}\) represents the cost of opening a facility at location i; The term \(x_{ij}\) and \(y_{i}\) are decision variables, being either 0 or 1. If customer j demands service from the facility at location i, the term \(x_{ij}\) will be set 1, otherwise, it will be set 0. In the same way, when a facility is opened at location i, the value of \(y_{i}\) is 1, otherwise it is 0.

In order to investigate and examine the effectiveness of the proposed algorithm, two benchmark data sets, i.e. ORLIB library with 15 benchmark instances [49] and the M* data set which taken from [50] are used to evaluate HLOCC. The optimum results of the two benchmark instances are shown in Tables 9 and 10, respectively. Six performance measures are used to validate the effectiveness of HLOCC: best, mean, worse, standard deviation gap and hit. Hit is the number of times the optimal result was achieved in the experimental runs. Gap shows the optimization error and the calculation of gap value is shown as Eq. (14).

$$ {\text{gap}} = \frac{{f^{{{\text{mean}}}} - f^{{{\text{opt}}}} }}{{f^{{{\text{opt}}}} }} \times 100 $$
(14)

where \(f^{{{\text{mean}}}}\) is the cost of the average results for all experimental runs and \(f^{opt}\) is the cost of the optimum solution to the problem.

Table 9 Optimum results of ORLIB problems
Table 10 Optimal results of M* results

To check the robustness and efficiency of HLOCC, it is compared with state-of-the-art algorithms. For a fair comparison results, the population size, number of runs, and maximum iterations are determined equally in methods that are chosen for comparison. In order to facilitate comparison, the population size is set to 400 which is the same as [40] and maximum iteration is set to 80,000. The results of 15 UFL problem and M* are obtained from 30 independent runs, and shown in Tables 11 and 12, respectively.

Table 11 Results of the HLOCC on ORLIB
Table 12 Results of the HLOCC on M*

A comparison of HLOCC with HLO and PSO variants

To investigate and to evaluate the effect of the proposed algorithm, performance comparisons with binary variants of HLO and PSO algorithms are performed. To provide a fair comparison, the population size and the max iteration numbers of the HLO, DHLO, TVMS-BPSO and QBPSO are set as the proposed algorithm, and the result of BPSO and IBPSO are taken from the study performed by Kiran [51]. The standard deviations and gap values of algorithms are presented in Table 13. The win/draw/lose numbers for each problem by comparing the HLOCC with other algorithms according to the gap scores are also listed in Table 13. It can be seen from Table 13 that the HLOCC outperforms binary HLO and PSO variants, and it has a superior performance on the 15 UFL problems. The proposed method achieves the optimum value with all runs for all problems. While the IBPSO cannot find the optimum value for all the runs in any of the problems, the BPSO and the QBSO obtained the optimum value in all runs for 2 and 6 problems, respectively. The DHLO and TVMSBPSO obtained optimal solutions for 30 runs on all instances except CapB and CapC. It can be observed that HLO is the most competitive of all the compared algorithms with HLOCC according to the gap values, since it can obtain 14 optimum value of the 15 UFL problems.

Table 13 Comparison of HLOCC with HLO and PSO variants

A comparison of HLOCC with the DE and GA variants

Table 14 shows the gap and hit of HLOCC, the DE and GA binary variants on 15 UFL problems. The experimental results of binary DE variants include DisDE/rand [52], BinDE [53] and various GA variants named GA-SP, GA-TP, GA-UP, GA-EC are directly taken from the reference [46]. For a fair comparison, the population size and the maximum iterations of IBDE [42] are all set as the proposed algorithm. The gap values and hit numbers of the binary DE variants, GA variants and HLOCC for 15 UFL problems are listed in Table 14. It can be seen that HLOCC is still the best of all the algorithms because it can find the optimum value for all the instances in 30 runs. It is worth noting that although IBDE was not proposed to solve the UFLP problem, it has better performance than other DE binary variants.

Table 14 Comparison of HLOCC with the GA and DE variants

A comparison of HLOCC with other state-of-the-are methods

ISS [46], JayasX [54], BinEHO [55], BinSSA [56] and BinCSA [40] have recently been presented in the literature for solving the UFLP. In reference [54], the Jaya algorithm has another variant named JayaX-LSM which uses not only binary operations but also a local search mechanism and it has better quality solution than JayasX. Therefore, the results of JayaX-LSM are used for comparison in this paper. The experimental results of algorithms except HLOCC are directly taken from [40]. The standard deviations and gap values of algorithms are presented in Table 15. The best gap values for each instance are shown in bold. All algorithms expect BinEHO achieve optimal values on small-size, medium-size and large-size instances for all runs. Table 15 also shows the numbers of win/draw/lose which are obtain by one-to-one comparison with other methods for HLOCC.

Table 15 Comparison of HLOCC with state-of-the-art methods

It can be seen that HLOCC is the best method on UFLP. It outperforms ISS, JayaX-LSM, BinEHO, BinSSA(Sim&Logic), and BinCSA, and HLOCC achieves the optimum value with all runs for 14 problems of the 15 UFL problems.

To evaluate the performance of all algorithms on the UFL problem, Friedman rank is performed with the gap results of algorithms given in Tables 13, 14 and 15. The Friedman rank and the final rank of nineteen different algorithms are presented in Table 16. HLOCC ranks first among 19 algorithms, so it can be concluded that HLOCC is an efficient method for solving UFL problem.

Table 16 Results of Friedman rank test for the UFL problem

Results on M*

The results of HLOCC are presented to show performance on M* benchmark instances in this section, and HLOCC is also compared with the well-known heuristic algorithms which have been used to solve the M* benchmark instances. All experiments are performed according to the same parameters and conditions for a fair comparison. The run times value is set as 100 in all the algorithms. The results of HLOCC on M* are shown in Table 12. The experimental results of the compared algorithms on the M* instances are directly from [40, 46, 56] and shown in Table 17. Table 18 shows the comparison results of TS1, TS3 and HLOCC on M* problems. HLOCC is a very efficient method on M* instances. Although MR* instances are the challenging problem in this study, the HLOCC also can achieve the optimum value for all the runs on MR2, MR4 and MR5. Over all runs, ISS and PLS obtained 8 of 20 optimal solutions on M* instances, LS obtained only 7 of 20, and BinSSA(Sim&Logic) and BinCSA obtained 10 and 12 of 20, respectively. The HLOCC and TS3 both obtained 16 of 20 instances, and TS1 obtained 18 success of 20M* datasets. Figure 7 shows the Friedman average rankings, based on average gap score. According to these rankings, HLOCC is the best algorithm of the eight methods. Although TS1 obtained the most optimal values among the 20 instances, Friedman ranked second in Fig. 7. This is mainly because the gap value of HLOCC is smaller, which indicates better robustness of the proposed algorithm.

Table 17 Comparison of HLOCC with ISS, PLS, LS BinSSA(Sim&Logic) and BinCSA
Table 18 The comparison results of TS1, TS3 and HLOCC
Fig. 7
figure 7

Results of Friedman rank test for the M* instance

Conclusions and future works

Humans are able to interact and share information with each other through competition and cooperation to effectively enhances the performance of learning. Therefore, a novel human learning optimization algorithm with competitive and cooperative learning is proposed in which a simple yet powerful competitive and cooperative learning operator is designed and introduced to improve the performance of HLO. Then the role and function of the developed competitive and cooperative learning operator are insightfully analyzed and discussed based on the variation of control parameter. The in-depth analysis results show that CCLO can help algorithm better explorer the search space and maintain the diversity at the beginning of search, and then find the optimal values more efficiently and fasten the convergence in the following iterations. Finally, the proposed HLOCC is applied to solve CEC17 benchmark functions and UFL problems to evaluate its performance. The experimental results demonstrate that HLOCC has advantages on performance with the improved exploration and exploitation abilities.

The social nature of human beings allows for a large amount of interactive behaviors, of which many are positive for human learning. The social phenomenon of competition and cooperation exists not only within the species, but also among different social groups. Therefore, the following research will focus on the relationship between competition and cooperation among different intermediaries, and design corresponding operators for HLO to further improve performance.