This paper develops a novel hybrid framework that integrates clustering-enhanced Particle Swarm Optimization (PSO) with stretching techniques to solve Markowitz’s quadratic portfolio optimization problem. The proposed approach avoids local optima traps that plague traditional optimization methods, while the stretching function modifications enhance the algorithm’s global search capabilities. The framework comprises four distinct algorithmic variants: a baseline SWARM PSO with stretching algorithm, and three clustering-enhanced extensions incorporating Hierarchical, K-means, and DBSCAN techniques. These clustering enhancements strategically group assets based on risk–return characteristics to improve portfolio diversification and risk management. Implementation in R enables comprehensive analysis of portfolio weight allocation patterns and diversification metrics across varying market structures. Empirical validation using daily price data from six major international stock market indices spanning January 2020 to December 2025 demonstrates the framework’s generalization capability in constructing buy-and-hold investment portfolios. The results reveal significant market-specific algorithmic effectiveness, with K-means variants achieving competitive efficacy in Eurostoxx and Belgian markets, DBSCAN demonstrating strong effectiveness in Chinese equity markets, Hierarchical clustering showing robust results in Indian market conditions, and the baseline SWARM algorithm exhibiting relative efficiency in French and Danish indices. Performance evaluation encompasses comprehensive risk-adjusted metrics, including Portfolio Return, Volatility, Sharpe Ratio, Calmar Ratio, and Value at Risk, providing portfolio managers with an adaptive, market-responsive optimization toolkit.
Julien Chevallier (Wed,) studied this question.