Introduction

Bio-inspired swarm intelligence and human-swarm interaction strategies

Bio-inspired swarm intelligence (SI) algorithms address complex problems by emulating the flexible, robust and decentralized behaviors of social organisms in nature1,2,3,4,5,6. These algorithms draw inspiration from diverse biological species, including microorganisms, birds, amphibians, and other wildlife7. Recent advances focus on improving SI performance through targeted modifications of individual and interactive swarm behaviors, incorporating natural dynamics such as cooperation, competition, mutualism, and predation8,9. For example, the Sailfish Optimizer (SFO) models predator–prey interactions between sailfish and sardines to enhance solution exploration, exploitation, and convergence speed10. In parallel, artificial intelligence (AI) techniques such as reinforcement learning (RL) have been integrated into SI frameworks (e.g., RL-augmented particle swarm optimization), enabling adaptive learning and higher-level control of swarm individuals11.

Human-swarm interaction (HSI), widely studied in swarm robotics, offers an additional pathway to enhance SI algorithms12,13. HSI integrates human input into swarm-based optimization processes, thereby improving algorithmic adaptability and convergence behavior. Kolling et al.14 categorized human interaction into four types: (1) intermittent interaction, where selected individuals undergo behavior shifts; (2) environmental interaction, involving passive behavior change due to manipulated local conditions; (3) persistent interaction, where operators continuously guide behaviors; and (4) parameter setting interaction, involving human adjustment of free parameters to steer emergent behaviors. These interaction types collectively inform the evolution and refinement of SI algorithms. For example, intermittent and persistent interactions mimic genetic mutation and behavioral specialization, while environmental interaction parallels natural selection by shaping local swarm dynamics. Parameter tuning reflects human-guided adaptation, and interactive machine learning (IML) frameworks enable real-time human feedback to improve swarm robustness, adaptability, and interpretability6,14,15,16.

Monkey algorithm and existing improvements

The monkey algorithm (MA) is a bio-inspired SI algorithm modeled on the mountain-climbing behavior of monkeys17. It simulates three core actions—climb, watch-jump, and somersault – to iteratively explore and refine solutions in complex, multivariate optimization problems17. As illustrated in Fig. 1, individuals follow a sequence of climb, watch-jump, climb, and somersault, through which candidate solutions are searched, evaluated, and updated. Similar to other SI algorithms, MA has undergone continuous enhancements for broader applicability18. Table 1 summarizes typical modifications and their strategies, many of which align with HSI categories introduced earlier.

  • Intermittent interaction is evident in hybrid approaches that fuse MA with other algorithms, such as genetic algorithms (GA), immune algorithms (IA), particle swarm optimization (PSO), artificial bee colony (ABC), and krill herd algorithm (KHA)19,20,21,22,23. These integrations introduce novel behaviors and enhance search dynamics.

  • Environmental interaction appears in the information-sharing mechanisms with globally optimal individuals during the climb and somersault phases, aimed at improving individual update efficiency20,24,25.

  • Fine-tuning of behavioral parameters such as position, distance, and movement often involves replacing constants with dynamic variables to promote adaptability24,26,27,28.

  • Some variants adopt population partitioning, which improves both individual interaction efficiency19,29 and behavior utilization24.

Fig. 1
Fig. 1
Full size image

Procedures of the MA (Revised from17).

Table 1 Typical strategies of improved MAs.

These strategies collectively increase the algorithm’s adaptability, convergence speed, and solution diversity across a wide range of applications.

Motivation and objectives

This study addresses a key limitation in conventional enhancements to swarm intelligence (SI) algorithms, which largely rely on algorithmic fusion for incremental performance gains. Such approaches often overlook the systematic integration of human expertise as a foundational design element. In contrast, this work embeds human intelligence (HI) directly into the behavioral framework of the swarm through human-defined constraints, adaptive operators, and behavior reconfiguration strategies34. Unlike algorithm fusion, which combines predefined SI components, the proposed human-swarm interaction (HSI) enhancements maintain the theoretical integrity of the original algorithm while enabling the dynamic incorporation of human cognitive heuristics. Importantly, this integration does not rely on real-time user input or external interfaces—such as application programming interfaces (APIs), graphical user interfaces (GUIs), or dynamic feedback loops—commonly found in HSI systems6, thereby reducing deployment complexity and operational cost.

The second objective is to systematically analyze behavioral and interactional limitations of the original Monkey Algorithm (MA) and implement targeted HSI-based modifications. Going beyond generic techniques like inertial weight tuning (Section"Monkey algorithm and existing improvements"), the proposed framework tackles high-complexity issues such as exploration–exploitation balance through methodologically diverse interventions.

The remainder of this paper is organized as follows. Section"The proposed improved monkey algorithm"analyzes the shortcomings of the original MA and introduces three HSI-based improvements. Sections"Evaluation of the proposed algorithm with benchmark functions"–"Application of the proposed algorithm in engineering problems"evaluate the enhanced MA using seven benchmark functions and five practical engineering problems, showing superior accuracy, stability, and efficiency relative to the original MA, four baseline SI algorithms, and 36 state-of-the-art methods. Section"Conclusions and outlook"concludes with key findings and directions for future research.

The proposed improved monkey algorithm

The original monkey algorithm (MA) often suffers from premature convergence and inefficient exploration capabilities in high-dimensional search spaces. To overcome these limitations, we propose an improved MA that integrates HSI-inspired strategies to enhance both global search diversity and local refinement accuracy. This study implements three principal strategies to enhance the performance of the original MA, drawing from the reviewed human intelligences (HIs) and previous improvements to MA discussed earlier. The first strategy involves replacing the fixed step length with an adaptive one in the climb process. Prior research has explored adaptive step lengths, correlating them with the climb number24 or performance over two consecutive time steps28, typically resulting in shorter steps as the solutions approach convergence. In contrast, we propose an improved MA that evaluates individual positions over the five most recent time steps, employing both the maximum and average values to update the next step length. The proposed adaptive step length not only broadens the assessment scope for solution convergence but also incorporates a novel indicator—the individual position—avoids the assumption that step length must decrease monotonically. This feature is particularly beneficial in cases where newly discovered regions warrant exploratory flexibility during the climb phase.

figure a

Algorithm 1. Updated climb process in HSI-MA.

The second strategy involves population partitioning and behavioral shift. As indicated by the stop criterion in Fig. 1, variations in both individual position and performance typically manifest at the end of the climb process. Previously, the swarm either adapted to follow a single behavior21 or was partitioned to exhibit different behaviors24 during the subsequent watch-jump process. Both strategies relied heavily on individual performance. In the proposed MA, individuals maintaining their positions or performance levels at the final stage of the climb process are assigned to the watch process. Conversely, those exhibiting potential for further exploration in their current regions are assigned to commence the second climb process. Additionally, the area designated for the watch process is expanded to encompass the entire feasible domain in the proposed MA, thereby enhancing the scope of observation. This strategy introduces a greater level of HI by considering each individual’s adaptability to various behaviors and promoting specialized behaviors accordingly. The SI is thus significantly improved through the organization and optimization of individual behaviors. This strategy is further leveraged to initiate the somersault process in the proposed MA, aimed at enhancing the overall search efficacy of the swarm.

figure b

Algorithm 2. Updated watch-jump process in HSI-MA.

The third strategy incorporates the concept of intermittent interaction, assigning new behaviors to selected subsets of the swarm to elicit novel emergent behavior. Following the somersault process, this strategy involves calculating a matrix representing the Euclidean distances between pairs of individuals, which helps assess the degree of swarm aggregation. In instances of high aggregation, the position of a randomly selected individual is shifted to a random position within the solution domain, emulating the “scout” mechanism from the artificial bee colony (ABC) algorithm35. While this strategy borrows behaviors from an established algorithm, it embodies HI by overcoming the original algorithm’s constraints and choosing the most suitable behavior for the situation. Importantly, the integration of the “scouting” behavior among monkey individuals adheres to biological principles, ensuring the efficiency and interpretability of the modified algorithm.

figure c

Algorithm 3. Search process in HSI-MA.

Figure 2 illustrates the comparison between the original and proposed algorithms. The applied modification strategies center on refining the inherent behaviors of the original swarm, maintaining the foundational principles of swarm intelligence (SI) while enhancing its structure, adaptability, and efficiency through the incorporation of HI. This synergistic interaction between SI and HI allows the modified MA to develop more sophisticated and context-specific behaviors, thus equipping it to effectively tackle complex problem environments.

Fig. 2
Fig. 2
Full size image

Flow of the proposed monkey algorithm.

Evaluation of the proposed algorithm with benchmark functions

As listed in Table 2, this study employs six multimodal functions and one unimodal function as the benchmark functions to evaluate the performance of the proposed algorithm36,37. Simulating real optimization challenges, these functions demonstrate the proposed MA’s capabilities in both identifying optimal solutions and managing multiple feasible solutions. Additionally, we define each benchmark function across seven dimensions (2, 4, 6, 8, 10, 15 and 20) to assess the proposed algorithm’s performance in real-world scenarios with escalating complexity and interactions.

Table 2 Information of applied benchmark functions.

In addition to the original MA, we employed four fundamental algorithms—particle swarm optimization (PSO), genetic algorithm (GA), firefly algorithm (FA)38, and sine cosine algorithm (SCA)39 to verify the performance of the proposed algorithm. The selected algorithms encompass fundamental search mechanisms and operational paradigms. Their performance has been rigorously validated against benchmark datasets and remains extensively referenced as evaluation criteria for assessing the efficacy of novel algorithmic approaches40. For a consistent comparison, as in Table 3 for all benchmark problems in this section, and the population size of to.

Table 3 Algorithm hyperparameters for benchmark functions.

This study methodically quantifies algorithmic performance through accuracy (best/averaged values), stability (standard deviation), and search efficiency metrics, tracking objective function dynamics across iterations. Analysis of 1000-iteration outcomes from 100 independent runs generated a 29,400-case dataset (6 algorithms × 7 functions × 7 dimensions × 100 runs), enabling systematic evaluation of optimization robustness and precision. Figures 3-9 display the violin plots, which illustrate the distribution of the function value across repetitive runs after 1,000 iterations41. For each combination of function type and dimension, the superior performance of the proposed HSI-MA over other algorithms is highlighted by lower median values of the function value and more compact violin plot distributions. This superiority is consistent across all function dimensions and has been proved statistically significant by the p-values from the Wilcoxon rank-sum test39,42 detailed in Table 4. Furthermore, we calculated the best, average, and standard deviation of the function value across repetitive runs, as detailed in Table 5-7. Cases that exhibit higher accuracy and stability (i.e., lowest average and standard deviation of the function value) are emphasized in bold within these tables, with the majority attributed to the enhanced performance of the proposed HSI-MA.

Fig. 3
Fig. 3
Full size image

Violin plot of Ackley function results with different dimensions: (a) D = 2; (b) D = 4; (c) D = 6; (d) D = 8; (e) D = 10; (f) D = 15; (g) D = 20.

Fig. 4
Fig. 4
Full size image

Violin plot of Rastrigin function results with different dimensions: (a) D = 2; (b) D = 4; (c) D = 6; (d) D = 8; (e) D = 10; (f) D = 15; (g) D = 20.

Fig. 5
Fig. 5
Full size image

Violin plot of Drop-wave function results with different dimensions: (a) D = 2; (b) D = 4; (c) D = 6; (d) D = 8; (e) D = 10; (f) D = 15; (g) D = 20.

Fig. 6
Fig. 6
Full size image

Violin plot of Griewank function results with different dimensions: (a) D = 2; (b) D = 4; (c) D = 6; (d) D = 8; (e) D = 10; (f) D = 15; (g) D = 20.

Fig. 7
Fig. 7
Full size image

Violin plot of Levy function results with different dimensions: (a) D = 2; (b) D = 4; (c) D = 6; (d) D = 8; (e) D = 10; (f) D = 15; (g) D = 20.

Fig. 8
Fig. 8
Full size image

Violin plot of Weierstrass function results with different dimensions: (a) D = 2; (b) D = 4; (c) D = 6; (d) D = 8; (e) D = 10; (f) D = 15; (g) D = 20.

Fig. 9
Fig. 9
Full size image

Violin plot of Sphere function results with different dimensions: (a) D = 2; (b) D = 4; (c) D = 6; (d) D = 8; (e) D = 10; (f) D = 15; (g) D = 20.

Table 4 p-Values of the Wilcoxon rank-sum test.
Table 5 Best result among repetitive cases.
Table 6 Averaged results of repetitive cases.
Table 7 Standard deviation of repetitive cases.

We evaluated the search efficiency of the applied algorithms using the sphere function, which lacks local optima, thus allowing for a straightforward assessment of the algorithm’s ability to converge to the global optimum. Figure 10 illustrates the variation in the function value across 1,000 iterations. Consistent with other performance metrics, the proposed HSI-MA demonstrated superior search efficiency over other algorithms across all function dimensions. This superiority is highlighted by a rapid decrease in the function value during the initial (less than 10) iterations, followed by significantly shorter plateau periods. These findings substantiate the effectiveness of the applied modification strategies in enhancing the organization and optimization of the swarm behaviors.

Fig. 10
Fig. 10
Full size image

Search efficiency of applied algorithms for different function dimensions: (a) D = 2; (b) D = 4; (c) D = 6; (d) D = 8; (e) D = 10; (f) D = 15; (g) D = 20.

Application of the proposed algorithm in engineering problems

This study further evaluates the performance of the proposed algorithm using five representative engineering problems, as detailed in Table 810,43,44,45,46,47,48,49,50. In addition to a physical illustration of the problem, Table 8 outlines the two components of the objective function—the optimization function to be minimized and the constraints applied as a penalty term50. Practical engineering problems involve more complex search domains and constraints, unlike benchmark functions. Moreover, to assess the effectiveness of the proposed algorithm, we conducted comparisons with 36 state-of-the-art algorithms that incorporate more advanced and innovative SI and HI techniques than the fundamental ones utilized in Section"Application of the proposed algorithm in engineering problems".

Table 8 Information of applied engineering problems.

Table 9 presents the accuracy and stability of the proposed algorithm, evaluated through the best, worst, average, and standard deviation of the optimization function values across 30 repetitive runs. Among all algorithms, HSI-MA consistently exhibited superior performance, with most metrics ranking first (emphasized in bold in the table) when applied to these five engineering problems. The convergence speed of HSI-MA was also assessed and compared to an innovative bio-inspired algorithm—the Ivy algorithm (IVYA)50. As shown in Fig. 11, HSI-MA achieved higher accuracy, as indicated by the mean optimization function value, after more than 10,000 iterations. Additionally, similar to its performance on benchmark functions, HSI-MA experienced a rapid decrease in the optimization function value within the first 10 iterations, a faster rate than IVYA.

Table 9 Performance of algorithms on the applied engineering problems*.
Fig. 11
Fig. 11
Full size image

Search efficiency of IVYA and HSI-MA for (a) Three-bar truss problem; (b) Pressure vessel optimization problem; (c) Tension/compression spring design; (d) Piston lever optimal design; (e) Tubular column design.

Conclusions and outlook

This work demonstrates the feasibility of enhancing the monkey algorithm (MA) by incorporating human-swarm interaction (HSI) based strategies. By inducing novel emergent behaviors and refining the intrinsic behaviors of the original algorithm, we achieved significant improvements of the algorithm in terms of accuracy, stability, and search efficiency. The major findings are detailed as follows.

  • Inspired by the intermittent, persistent, and parameter-setting interactions within HSI, this study explored three corresponding strategies, including introducing new individual behavior, implementing behavior specialization, and refining original individual behaviors.

  • Across seven unimodal and multimodal benchmark functions of seven dimensions, the proposed HSI-MA demonstrated significant improvements in optimization accuracy and stability. Relative to the original MA and four fundamental swarm intelligence (SI) algorithms, HSI-MA achieved orders-of-magnitude improvements in the best, average, and standard deviation of function values after 1,000 iterations over 100 repetitive runs.

  • Illustrated in the sphere function value with iterations, HSI-MA achieved significant improvements in search efficiency, characterized by a rapid decrease in the function value during the initial 10 iterations and substantially shorter plateau periods.

  • In five practical engineering problems, HSI-MA exhibited superior performance in optimization accuracy and stability. Relative to 36 advanced and innovative algorithms, HSI-MA ranked first in most metrics, including the best, worst, average, and standard deviation of optimization function values across 30 repetitive runs. Specifically, HSI-MA achieved a faster optimization rate than an innovative bio-inspired algorithm within the first 10 iterations.

For future research, a comprehensive evaluation should consider the balance between efficiency, complexity, time, and cost. Additionally, future work may explore deeper interactions with HI, such as the incorporation of human-operated functions or interfaces, or adaptive human collaboration. This study has demonstrated better performance than the conventional algorithm fusion technique, through algorithm modification by integrating human intelligence (HI) to improve the structure, adaptability, and efficiency of the original MA.