A New Metaheuristic Optimizer Inspired by Shopping Behavior

Abstract

This paper introduces a new metaheuristic inspired by the differing shopping behavior of men and women, called the Shopping Metaheuristic. It models optimization as a collaborative process between two agents: a man, who focuses on intensification (exploitation), and a woman, who prioritizes diversification (exploration). The goal is to enhance the balance between global exploration and local exploitation, improving convergence speed and avoiding local optima. To achieve this, the metaheuristic employs various strategies, including random jumps for exploration, adaptive step sizes, social influence mechanisms, communication between agents, and periodic intensification. These techniques help maintain a balance between broad search and fine-tuning solutions. The paper analyses its convergence behavior and explores a case study in smart agriculture. Finally, its performance is compared with traditional methods like Artificial Bee Colony, Genetic Algorithm, and Particle Swarm Optimization, as well as modern approaches like Spotted Hyena Optimizer and Dragonfly Optimization. The key observation is that both the Shopping Metaheuristic and Spotted Hyena Optimizer achieved the highest accuracy (0.993), outperforming the Dragonfly Optimization and Salp Swarm Algorithm, with the latter showing the lowest accuracy.

Share and Cite:

El-Dosuky, M. , Al-Bagmi, A. , Al-Muhaidib, G. and Al-Manna, N. (2026) A New Metaheuristic Optimizer Inspired by Shopping Behavior. Journal of Computer and Communications, 14, 37-50. doi: 10.4236/jcc.2026.149004.

1. Introduction

Metaheuristics are high-level optimization strategies that guide heuristics to efficiently explore and exploit search spaces, providing near-optimal solutions for complex problems [1]. A single metaheuristic cannot excel in all optimization problems because each algorithm’s design is tailored to certain problem types and may fail in others. This aligns with the No Free Lunch (NFL) theorem, which states that no optimization method is universally superior across all problem domains [2]. Metaheuristics typically balance two key aspects: exploration (searching diverse areas of the solution space) and exploitation (refining promising solutions) [3]. The proposed metaheuristic, inspired from shopping behavior, aims to better balance exploration and exploitation to speed up convergence and avoid local optima by using strategies such as random jumps, adaptive step sizes, agent communication, social influence, and periodic search intensification. This work is divided into six sections on introduction, literature review, proposed metaheuristic, evaluation, case study, and finally the conclusion with future directions.

2. Literature Review

As illustrated in Figure 1, metaheuristics can be classified into six main categories: bio-based, evolutionary-based, physics-based, swarm-based, human-based, and math-based [4]. All these categories are reviewed in the subsequent sections.

Figure 1. Taxonomy of recent metaheuristics as in MEALPY [4].

2.1. Bio-Based Algorithms

Biogeography-Based Optimization (BBO) models species migration to share features between solutions and maintain diversity, making it useful in power systems, image processing, and engineering [5]. Virus Colony Search (VCS) simulates viral infection and immune response to balance exploration and exploitation, with applications in scheduling and machine learning [6]. Wild Horse Optimizer (WHO) imitates herd behavior to guide search and adapt weaker solutions, proving effective in engineering and control problems [7]. Slime Mould Algorithm (SMA) reproduces slime mold foraging patterns using dynamic exploration-exploitation adjustments and is applied in feature selection, image segmentation, and engineering tasks [8].

2.2. Evolutionary-Based Algorithms

Genetic Algorithm (GA) uses selection, crossover, and mutation to evolve solutions and is widely applied in scheduling and machine learning [9]. Differential Evolution (DE) improves solutions through difference-based mutation and crossover, making it effective for global optimization in machine learning [10]. Evolution Strategies (ES) rely mainly on mutation and selection with adaptive step sizes, commonly used in reinforcement learning and robotics [11]. Coral Reef Optimization (CRO) simulates coral reproduction and colonization to evolve solutions, with applications in scheduling and neural networks [12]. Flower Pollination Algorithm (FPA) models pollination processes to balance local and global search, useful in feature selection, clustering, and engineering optimization [13].

2.3. Physics-Based Algorithms

Nuclear Reaction Optimization (NRO) models fission and fusion processes to split or merge solutions for efficient exploration, with applications in scheduling, and machine learning [14]. Electrostatic Field Optimization (EFO) simulates charged particle interactions based on Coulomb’s law, guiding solutions toward optima in function optimization and power systems [15]. Equilibrium Optimizer (EO) uses mass-equilibrium dynamics to balance exploration and exploitation, effective in feature selection, image segmentation, and optimization in general [16]. Henry Gas Solubility Optimization (HGSO) mimics gas-liquid solubility behavior with adaptive movement strategies, applied in engineering, image processing, and scheduling [17]. Multi-Verse Optimizer (MVO) draws on cosmological concepts like black and white holes to balance diversification and intensification, used in feature selection [18].

2.4. Swarm-Based Algorithms

Particle Swarm Optimization (PSO) models bird and fish social behavior, guiding particles by personal and global best positions, and is used in neural network training, scheduling, and robotics [19]. Ant Lion Optimizer (ALO) simulates ant lion predation to guide solutions toward better positions, applied in engineering, machine learning, and scheduling [20]. Whale Optimization Algorithm (WOA) imitates humpback whale hunting strategies for global optimization [21]. Harris Hawks Optimization (HHO) uses cooperative hunting behavior to balance exploration and exploitation, applied in image processing, and classification [22]. Hunger Games Search (HGS) models competitive survival strategies, balancing exploration and convergence for feature selection, scheduling, and engineering design [23].

2.5. Human-Based Algorithms

Chief Executive Officer Algorithm (CHIO) models organizational decision-making, guiding employee-solutions toward optima, used in engineering, scheduling, and optimization [24]. Teaching-Learning Optimization (TLO) mimics classroom teaching and learning with global and local search phases, applied in engineering, machine learning, and control systems [25]. Football-Based Optimization (FBIO) simulates football strategies to adapt solution movements, useful in scheduling, robotics, and classification [26]. Group Search Kicker Algorithm (GSKA) balances individual and cooperative human-like search behavior, used in feature selection and clustering [27].

2.6. Math-Based Algorithms

Arithmetic Optimization Algorithm (AOA) uses basic arithmetic operations for effective exploration and exploitation, applied in engineering, scheduling, and machine learning [28]. Chaos Game Optimization (CGO) employs chaotic maps to avoid local optima, suitable for global optimization [29]. Hill Climbing (HC) iteratively improves solutions through local adjustments, effective for gradient-based problems despite local optimum risks [30]. Golden Ball Optimizer (GBO) models football strategies to balance exploration and exploitation, used in engineering and scheduling [31]. Sine Cosine Algorithm (SCA) updates solution positions using sine and cosine functions, applied in engineering, image processing, and function optimization [32].

3. Proposed Metaheuristic

Table 1 highlights the differences between men and women in shopping across five aspects: shopping approach, product preferences, decision-making, online versus in-store behavior, and social influence. The table highlights notable differences in shopping behavior between men and women across several aspects. In terms of shopping approach, men tend to be goal-oriented, aiming for efficiency and speed, while women often adopt a more social and exploratory style, enjoying the process of browsing. Regarding product preferences, men typically prioritize practicality and functionality, often focusing on technology and gadgets, whereas women are more drawn to aesthetics, variety, and products that create an emotional connection. Decision-making also varies: men usually make quicker choices with minimal comparison, while women tend to be more thorough, comparing products and seeking advice before making a purchase. When it comes to the shopping environment, men often favor online shopping due to its convenience and speed, whereas women appreciate the in-store experience, valuing the tactile and social aspects of shopping. Lastly, social influence affects each gender differently; men are generally less swayed by external opinions, whereas women frequently consult reviews, seek opinions from friends or family, and are influenced by social media when making purchasing decisions.

Table 1. Comparison of shopping behavior between men and women.

Aspect

Men

Women

Shopping Approach

Goal-oriented, quick, efficient

Social, exploratory, enjoy browsing

Product Preferences

Focus on practicality, technology, and gadgets

Aesthetics, variety, and emotional connection

Decision-Making

Quick decisions with less comparison

Thorough evaluation, product comparison, and seeking advice

Online vs. In-Store

Prefer online shopping for speed and convenience

Enjoy the in-store shopping experience

Social Influence

Less influenced by others

Seek reviews, opinions, and social media recommendations

Figure 2. Proposed metaheuristic.

The proposed metaheuristic, as shown in Figure 2 and Figure 3, models a population of couples, each consisting of a man and a woman, to solve optimization problems. Initialization defines the problem, objective function, and search space, while assigning each couple a “shopping need” representing the solution they seek. The fitness of each individual is evaluated to measure how well their current position satisfies this need, forming the basis for subsequent search operations.

Figure 3. Flowchart of the proposed metaheuristic.

The metaheuristic simulates gender-based shopping behavior to balance exploration and exploitation. Women perform broad, exploratory searches to cover the search space widely, while men focus on local intensification to refine promising solutions. Cooperation between couples allows women to share exploration results with men, and social influence enables some women to consult others’ experiences, adding a collaborative dimension. Local and global updates further guide men toward refinement and women toward new regions, creating a dynamic interaction between diversification and intensification.

To avoid local minima and improve convergence, the metaheuristic employs several mechanisms: women occasionally perform random jumps, step sizes adapt over iterations, and periodic social influence nudges them toward the global best solutions. Communication between couples ensures promising regions are shared, while men periodically intensify search around their partner’s findings. The algorithm terminates when stopping criteria are met, producing the best solutions found by the swarm as the optimal or near-optimal results.

4. Evaluation

The proposed metaheuristic is evaluated in optimizing some common Congress on Evolutionary Computation (CEC) benchmark functions [33]:

Sphere Function

f( x )= i=1 d x i 2 (1)

Ackley Function

f( x )=aexp( b 1 d i=1 d x i 2 )exp( 1 d i=1 d cos( c x i ) )+a+e (2)

where

a=20,b=0.2,c=2π.

Rastrigin Function

f( x )=Ad+ i=1 d [ x i 2 Acos( 2π x i ) ] (3)

where

A=10.

Rosenbrock Function

f( x )= i=1 d1 [ 100 ( x i+1 x i 2 ) 2 + ( 1 x i ) 2 ] (4)

Figure 4 illustrates two visualizations of the Ackley function, a popular benchmark in optimization due to its many local minima and complex landscape. The left side shows a 2D contour plot with concentric colour bands representing function values, where cooler (blue) indicates lower values and warmer (red) indicates higher values. The red cross labelled “Best Path” marks the global minimum near the origin, representing the optimal solution. On the right, a 3D surface plot provides a perspective view of the function, highlighting its bowl-shaped surface surrounded by undulating ridges. The same is provided for Rastrigin function, as shown in Figure 5, and sphere function as in Figure 6.

Figure 4. Ackley function optimization.

Figure 5. Rastrigin function optimization.

Figure 6. Sphere function optimization.

5. Case Study

The Crop Recommendation Dataset from Kaggle is designed to help predict the most suitable crops for cultivation based on various soil and environmental conditions [34]. As shown in Table 2, it contains features such as soil nitrogen, phosphorus, and potassium levels, as well as temperature, humidity, pH, and rainfall. The target variable is the recommended crop type, determined by analyzing these input features. Organized in a tabular format, typically as CSV files. It is widely used in agricultural applications to build predictive models that optimize crop selection.

Table 2. Sample records from the crop recommendation dataset.

No.

N

P

K

Temperature

Humidity

pH

Rainfall

Label

0

90

42

43

20.88

82.00

6.50

202.94

rice

1

85

58

41

21.77

80.32

7.04

226.66

rice

2

60

55

44

23.00

82.32

7.84

263.96

rice

3

74

35

40

26.49

80.16

6.98

242.86

rice

4

78

42

42

20.13

81.60

7.63

262.72

rice

Figure 7 provides the confusion matrix of the application of the proposed shopping metaheuristic on the aforementioned dataset.

Table 3 provides F1-Score for each class, which balance Precision and Recall to provide a single performance metric. The model achieves excellent accuracy (97.84) with very high F1-Scores for most classes. However, lentil has the lowest F1-Score (0.667) due to low Precision and Recall. Table 4 compares the proposed shopping metaheuristic with three distinct Swarm Intelligence algorithms-the Dragonfly Optimization Algorithm (DOA), the Spotted Hyena Optimizer (SHO), and the Salp Swarm Algorithm (SSA).

Figure 7. Confusion matrix.

Table 3. Classification performance metrics by crop class.

Class

Recall

Precision

F1-Score

apple

0.919

1.000

0.958

banana

1.000

0.946

0.972

blackgram

0.971

0.971

0.971

chickpea

1.000

1.000

1.000

kidneybeans

1.000

0.864

0.927

lentil

0.667

0.667

0.667

mothbeans

1.000

1.000

1.000

mungbean

1.000

1.000

1.000

pigeonpeas

1.000

1.000

1.000

rice

0.860

1.000

0.925

Table 4. Best classification accuracy of different optimization algorithms.

Optimization Algorithm

Best Accuracy

Shopping Metaheuristic

0.9927

Dragonfly Optimization

0.9823

Spotted Hyena Optimizer

0.9927

Salp Swarm Algorithm

0.8564

The key observation is that both the Shopping Metaheuristic and Spotted Hyena Optimizer achieved the highest accuracy (0.993), outperforming the Dragonfly Optimization and Salp Swarm Algorithm, with the latter showing the lowest accuracy.

6. Conclusion and Future Work

This paper presents the Shopping Metaheuristic, a novel optimization algorithm inspired by the different shopping behavior of men and women, where men focus on exploitation and women on exploration. The algorithm employs strategies such as random jumps, adaptive step sizes, social influence, inter-agent communication, and periodic intensification to balance global search and local refinement, improving convergence and avoiding local optima. The metaheuristic is evaluated on CEC benchmark functions with additional analysis of convergence behavior and a case study in smart agriculture. Performance comparisons show that the Shopping Metaheuristic, along with the Spotted Hyena Optimizer, achieved the highest accuracy (0.993), outperforming Dragonfly Optimization and Salp Swarm Algorithm, the latter demonstrating the lowest accuracy. Based on the findings, three key recommendations are proposed. First, the data imbalance for the “lentil” class should be addressed, either by collecting additional data or by applying techniques such as SMOTE. Second, targeted feature engineering should be conducted to introduce new differentiating features, such as texture or shape analysis, to specifically resolve the confusion between rice and jute. Finally, implementing a hybrid optimization algorithm that combines the global search capabilities of the current metaheuristic with a strong local search method could potentially improve overall accuracy beyond 99%.

Author Contributions

Mohamed El-Dosuky: Conceptualization, Methodology, Formal Analysis, Validation, Writing Original Draft, Supervision. Athir Al-Bagmi: Software, Investigation, Experimental Evaluation, Visualization, Writing Review & Editing. Ghaida Al-Muhaidib: Algorithm Design, Software, Validation, Benchmark Testing, Visualization, Writing Review & Editing. Najla Al-Manna: Algorithm Design, Software, Literature Review, Validation, Writing Review & Editing. All authors contributed to the interpretation of the results, reviewed the manuscript, and approved the final version for publication.

Conflicts of Interest

The authors declare no conflicts of interest regarding the publication of this paper.

References

[1] Alorf, A. (2023) A Survey of Recently Developed Metaheuristics and Their Comparative Analysis. Engineering Applications of Artificial Intelligence, 117, Article 105622.[CrossRef]
[2] Wolpert, D.H. and Macready, W.G. (1997) No Free Lunch Theorems for Optimization. IEEE Transactions on Evolutionary Computation, 1, 67-82.[CrossRef]
[3] Morales-Castañeda, B., Zaldívar, D., Cuevas, E., Fausto, F. and Rodríguez, A. (2020) A Better Balance in Metaheuristic Algorithms: Does It Exist? Swarm and Evolutionary Computation, 54, Article 100671.[CrossRef]
[4] Van Thieu, N. and Mirjalili, S. (2023) MEALPY: An Open-Source Library for Latest Meta-Heuristic Algorithms in Python. Journal of Systems Architecture, 139, Article 102871.[CrossRef]
[5] Simon, D. (2008) Biogeography-Based Optimization. IEEE Transactions on Evolutionary Computation, 12, 702-713.[CrossRef]
[6] Li, M.D., Zhao, H., Weng, X.W. and Han, T. (2016) A Novel Nature-Inspired Algorithm for Optimization: Virus Colony Search. Advances in Engineering Software, 92, 65-88.[CrossRef]
[7] Naruei, I. and Keynia, F. (2022) Wild Horse Optimizer: A New Meta-Heuristic Algorithm for Solving Engineering Optimization Problems. Engineering with Computers, 38, 3025-3056.[CrossRef]
[8] Li, S., Chen, H., Wang, M., Heidari, A.A. and Mirjalili, S. (2020) Slime Mould Algorithm: A New Method for Stochastic Optimization. Future Generation Computer Systems, 111, 300-323.[CrossRef]
[9] Mirjalili, S. and Mirjalili, S.M. (2019) Genetic Algorithm. In: Studies in Computational Intelligence, Springer, 43-55.[CrossRef]
[10] Price, K.V. (2013) Differential Evolution. In: Intelligent Systems Reference Library, Springer, 187-214.[CrossRef]
[11] Hansen, N., Arnold, D.V. and Auger, A. (2015) Evolution Strategies. In: Springer Handbook of Computational Intelligence, Springer, 871-898.[CrossRef]
[12] Salcedo-Sanz, S., Del Ser, J., Landa-Torres, I., Gil-López, S. and Portilla-Figueras, J.A. (2014) The Coral Reefs Optimization Algorithm: A Novel Metaheuristic for Efficiently Solving Optimization Problems. The Scientific World Journal, 2014, 1-15.[CrossRef] [PubMed]
[13] Abdel-Basset, M. and Shawky, L.A. (2019) Flower Pollination Algorithm: A Comprehensive Review. Artificial Intelligence Review, 52, 2533-2557.[CrossRef]
[14] Wei, Z., Huang, C., Wang, X., Han, T. and Li, Y. (2019) Nuclear Reaction Optimization: A Novel and Powerful Physics-Based Algorithm for Global Optimization. IEEE Access, 7, 66084-66109.[CrossRef]
[15] Yurtkuran, A. (2019) An Improved Electromagnetic Field Optimization for the Global Optimization Problems. Computational Intelligence and Neuroscience, 2019, 1-20.[CrossRef] [PubMed]
[16] Faramarzi, A., Heidarinejad, M., Stephens, B. and Mirjalili, S. (2020) Equilibrium Optimizer: A Novel Optimization Algorithm. Knowledge-Based Systems, 191, Article 105190.[CrossRef]
[17] Hashim, F.A., Houssein, E.H., Mabrouk, M.S., Al-Atabany, W. and Mirjalili, S. (2019) Henry Gas Solubility Optimization: A Novel Physics-Based Algorithm. Future Generation Computer Systems, 101, 646-667.[CrossRef]
[18] Mirjalili, S., Mirjalili, S.M. and Hatamlou, A. (2016) Multi-Verse Optimizer: A Nature-Inspired Algorithm for Global Optimization. Neural Computing and Applications, 27, 495-513.[CrossRef]
[19] Kennedy, J. and Eberhart, R. (1995) Particle Swarm Optimization. Proceedings of ICNN’95—International Conference on Neural Networks, Perth, 27 November-1 December 1995, 1942-1948.[CrossRef]
[20] Mirjalili, S. (2015) The Ant Lion Optimizer. Advances in Engineering Software, 83, 80-98.[CrossRef]
[21] Mirjalili, S. and Lewis, A. (2016) The Whale Optimization Algorithm. Advances in Engineering Software, 95, 51-67.[CrossRef]
[22] Heidari, A.A., Mirjalili, S., Faris, H., Aljarah, I., Mafarja, M. and Chen, H. (2019) Harris Hawks Optimization: Algorithm and Applications. Future Generation Computer Systems, 97, 849-872.[CrossRef]
[23] Yang, Y., Chen, H., Heidari, A.A. and Gandomi, A.H. (2021) Hunger Games Search: Visions, Conception, Implementation, Deep Analysis, Perspectives, and towards Performance Shifts. Expert Systems with Applications, 177, Article 114864.[CrossRef]
[24] Jia, Y.W., Chen, X.T., Yao, C.B. and Li, X. (2023) CEO Election Optimization Algorithm and Its Application in Constrained Optimization Problem. Soft Computing, 27, 7363-7400.[CrossRef]
[25] Črepinšek, M., Liu, S.H. and Mernik, L. (2012) A Note on Teaching-Learning-Based Optimization Algorithm. Information Sciences, 212, 79-93.[CrossRef]
[26] Ab. Rashid, M.F.F. (2021) Tiki-Taka Algorithm: A Novel Metaheuristic Inspired by Football Playing Style. Engineering Computations, 38, 313-343.[CrossRef]
[27] Di Gaspero, L. and Schaerf, A. (2003) Multi-Neighbourhood Local Search with Application to Course Timetabling. In: Lecture Notes in Computer Science, Springer, 262-275.[CrossRef]
[28] Abualigah, L., Diabat, A., Mirjalili, S., Abd Elaziz, M. and Gandomi, A.H. (2021) The Arithmetic Optimization Algorithm. Computer Methods in Applied Mechanics and Engineering, 376, Article 113609.[CrossRef]
[29] Talatahari, S. and Azizi, M. (2021) Chaos Game Optimization: A Novel Metaheuristic Algorithm. Artificial Intelligence Review, 54, 917-1004.[CrossRef]
[30] Selman, B. and Gomes, C.P. (2006) Hill-Climbing Search. In: Encyclopedia of Cognitive Science, Palgrave Macmillan, 333-335.
[31] Osaba, E., Diaz, F. and Onieva, E. (2014) Golden Ball: A Novel Meta-Heuristic to Solve Combinatorial Optimization Problems Based on Soccer Concepts. Applied Intelligence, 41, 145-166.[CrossRef]
[32] Mirjalili, S. (2016) SCA: A Sine Cosine Algorithm for Solving Optimization Problems. Knowledge-Based Systems, 96, 120-133.[CrossRef]
[33] Tang, K. (2007) Benchmark Functions for the CEC’2010 Special Session and Competition on Large-Scale Global Optimization. Nature Inspired Computation and Applications Laboratory, University of Science and Technology of China.
[34] Kaggle (2020) Crop Recommendation Dataset.
https://www.kaggle.com/datasets/atharvaingle/crop-recommendation-dataset

Copyright © 2026 by authors and Scientific Research Publishing Inc.

Creative Commons License

This work and the related PDF file are licensed under a Creative Commons Attribution 4.0 International License.