# Optimizing Investment Portfolios with Bacterial Foraging and Robust Risk Management
## 1 Introduction  
In the rapidly evolving financial landscape, traditional portfolio management strategies face increasing challenges in addressing the complexities of dynamic markets. Investors, ranging from individuals to institutions, are tasked with achieving a delicate balance between maximizing returns and minimizing risks while navigating economic uncertainties, global interconnectedness, and volatile market conditions. Although classical approaches, such as the Markowitz mean-variance model, provide a robust foundation for portfolio optimization, their limitations become apparent when confronted with high-dimensional and non-linear decision spaces [1, 2]. To overcome these challenges, researchers have turned to computational intelligence and optimization techniques inspired by nature. Nature-inspired algorithms (NIAs) emulate biological processes, such as natural selection, foraging, and swarming, to solve complex optimization problems. Among the most prominent methods are genetic algorithms (GAs) [3], particle swarm optimization (PSO) [4], ant colony optimization (ACO) [5], differential evolution (DE) [6], and bacterial foraging optimization (BFO) [7]. These algorithms are renowned for their adaptability, scalability, and ability to explore vast solution spaces effectively [8, 9, 10]. Swarm intelligence (SI), a subset of NIAs, has gained particular traction in the field of portfolio optimization due to its collaborative and decentralized decision-making processes. Algorithms such as PSO, ACO, and BFO have demonstrated exceptional performance in handling multi-objective problems, including risk-return trade-offs and dynamic constraints [11, 12, 13, 14]. While previous studies have explored the use of SI algorithms, such as PSO [13] and hybrid GA approaches [15], BFO offers unique advantages in high-dimensional and constrained optimization tasks due to its nature-inspired mechanismsof chemotaxis, reproduction, and elimination-dispersal [15; 16; 17]. Unlike PSO and ACO, which focus on swarm behavior, BFO draws from bacterial foraging strategies, enabling it to explore solution spaces with both local precision and global exploration. This unique attribute makes it particularly suited for complex financial optimization problems, such as portfolio management under uncertainty. This study investigates the application of the BFO algorithm to pinpoint the most effective approach for optimizing portfolios. While other BFO-based applications [15; 16] have been proposed, this study extends the algorithm's application by incorporating advanced risk-adjusted performance metrics, such as the Sharpe ratio, and introducing constraints relevant to real-world portfolio optimization, such as transaction costs and stop-loss mechanisms [18; 19; 20; 21]. These enhancements position the proposed method as a novel extension of existing BFO methodologies. Previous research by the author has explored various swarm intelligence algorithms, including the Artificial Bee Colony, Firefly, Whale, and Crow Search algorithms, demonstrating their efficacy in diverse applications [22; 23; 24]. The integration of swarm intelligence algorithms into portfolio optimization has led to innovative solutions for managing financial portfolios under uncertainty. These methods are adept at balancing risk and return while incorporating constraints such as transaction costs, minimum and maximum asset weights, and stop-loss mechanisms [18; 19; 20; 21]. Recent advancements have extended their applications to areas such as socially responsible investing, environmental, social, and governance (ESG) criteria, and adaptive rebalancing strategies [25; 26; 27; 28; 29; 30; 31]. This study not only compares the proposed BFO approach with traditional SI algorithms but also highlights its advantages in achieving higher risk-adjusted returns and its adaptability to dynamic market environments. This article is structured as follows: Section 1 introduces the key challenges in portfolio optimization and the rationale for exploring bio-inspired algorithms.