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
(1)
Ackley Function
(2)
where
Rastrigin Function
(3)
where
Rosenbrock Function
(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.