The classic mean – variance portfolio model is elegant, but real trading constraints (buy-in thresholds, cardinality limits, min/max position sizes) quickly turn it into a hard mixed-integer nonlinear problem. This paper tackles that constrained setting with a modified Spiral Optimization Algorithm (SOA)— a metaheuristic designed to search complex feasible regions where convex solvers or gradient methods are not directly applicable. This note focuses on the formulation (what constraints are added and how), how SOA explores the search space, and what the reported results say about solution quality under practical constraints.
Background
A portfolio is a combination of assets (stocks, bonds, real estate, cash, etc.) designed to meet an investment objective. Investors typically want higher return under controlled risk, but return and risk trade off against each other. Markowitz ’ s (1959) mean – variance framework is the classical foundation: expected return captures reward, and variance (or covariance) captures risk.
In practice, additional trading constraints are common (minimum
buy-in, upper bounds, and “ choose only
Mean – variance portfolio optimization as an MINLP
Base mean – variance problem
Let
Assume future asset returns can be estimated statistically, and risk
is measured by the variance of returns. Let
The optimization objective is to minimize total risk, i.e., minimize
the portfolio variance
If short selling is disallowed, enforce
Buy-in threshold constraint
A buy-in threshold sets a minimum allocation
Cardinality constraint
The cardinality constraint restricts the portfolio to exactly (or at
most)
Mixed-integer nonlinear programming (MINLP)
Following standard MINLP notation (e.g., Kania & Sidarto, 2016),
an MINLP can be written as:
Numerical example
The paper reports experiments on a five-asset dataset from
Bartholomew-Biggs & Kane (2009). The mean return vector is:
Conclusion
The paper proposes a modified spiral optimization method (SOA-MINLP) to handle mean – variance portfolio optimization with buy-in and cardinality constraints. The numerical study suggests SOA-MINLP can find competitive solutions under these nonconvex, discrete constraints, and the paper compares it against baselines such as Quasi-Newton and DIRECT-type methods.
Spiral Optimization Algorithm (SOA) Basics
Core idea
SOA is a metaheuristic inspired by spiral trajectories in nature (e.g., spiral phyllotaxis in plants, spiral galaxies). The algorithm iteratively updates candidate solutions by moving them toward a center point along a spiral path.
Update rule (simplified):
-
Key property: The spiral path allows exploration
(early iterations, large
Why SOA for constrained MINLP?
Traditional gradient-based methods struggle with:
- Integer constraints: Gradient is undefined for
binary variables
- Non-convexity: Multiple local optima
- Feasibility: Hard to maintain constraints during optimization
SOA handles these naturally:
- Metaheuristic: Does not require gradients
- Global search: Spiral trajectory explores diverse regions
- Constraint handling: Penalty method or repair operators
Modified SOA for Portfolio Optimization
Constraint handling via penalty
The paper uses a penalty method to convert
constrained optimization into unconstrained:
-
Intuition: Infeasible solutions get heavily penalized, pushing the search toward the feasible region.
Algorithm steps
Initialize: Generate random candidate solutions
Evaluate: Compute penalized objective
for each candidateFind best:
Update: For each candidate, apply spiral update toward
Repair: Project back to bounds (e.g.,
)Repeat: Until convergence or max iterations
Performance Comparison
The paper compares SOA against baseline solvers:
| Solver | Risk (variance) | Feasibility | Runtime |
|---|---|---|---|
| SOA-MINLP | 0.6969 | ✅ Feasible | Fast |
| Quasi-Newton | 0.7123 | ⚠️ Sometimes infeasible | Medium |
| DIRECT | 0.7458 | ✅ Feasible | Slow |
Key takeaway: SOA achieves lower risk while maintaining feasibility and reasonable runtime.
Practical Considerations
When to use SOA?
✅ Good fit:
- Non-convex, constrained optimization
- Mixed-integer problems (binary + continuous variables)
- Small to medium scale (n < 100 assets)
❌ Not ideal:
- Very large scale (n > 1000 assets) → use specialized solvers (e.g., Gurobi, CPLEX)
- Convex problems → use gradient-based methods (faster and more reliable)
Tuning SOA hyperparameters
Key knobs:
- Population size N: Larger N → better exploration, slower
- Max iterations: Depends on problem difficulty
- Spiral angle decay: Faster decay → quicker convergence, risk of local optima
- Penalty weight
: Too small → infeasible solutions; too large → numerical issues
Rule of thumb: Start with N=50, max_iter=100,
Limitations and Extensions
Limitations
- Stochastic: SOA can return different solutions on different runs (need multiple runs + ensemble)
- No optimality guarantee: Metaheuristics do not prove global optimality
- Scalability: Struggles with very large portfolios (n > 100)
Possible extensions
- Hybrid SOA + local search: Use SOA for global exploration, then refine with gradient-based local search
- Multi-objective SOA: Optimize return and risk simultaneously (Pareto front)
- Robust portfolio: Extend to worst-case optimization under uncertainty
Conclusion
The paper demonstrates that modified SOA is a viable solver for mean – variance portfolio optimization with realistic trading constraints (buy-in thresholds, cardinality limits). The key innovation is adapting the spiral trajectory to handle mixed-integer nonlinear constraints via penalty methods. While not guaranteed to find the global optimum, SOA provides high-quality feasible solutions in reasonable time, making it suitable for practical portfolio construction where exact optimality is less critical than tractability and interpretability.
For practitioners: if your portfolio model includes integer constraints (e.g., "select exactly K stocks"), SOA-type metaheuristics are worth exploring before resorting to expensive commercial solvers.
The constrained mean variance portfolio optimization problem represents a significant challenge in quantitative finance because it combines the theoretical elegance of Markowitz's framework with the practical realities of real-world trading. Traditional quadratic programming solvers work well for the unconstrained or simply-bounded case, but as soon as practitioners introduce cardinality constraints (select exactly K assets), minimum buy-in thresholds (if you hold an asset at all, hold at least L percent), and transaction costs, the problem becomes a mixed-integer nonlinear program that defeats standard convex optimization tools.
Metaheuristic approaches like Spiral Optimization Algorithm gain traction in this space precisely because they do not require convexity or differentiability assumptions. The spiral trajectory provides a natural balance between exploration (when the spiral is wide) and exploitation (when the spiral tightens around promising regions). This contrasts with simpler metaheuristics like genetic algorithms or particle swarm optimization, which often struggle with the delicate balance between global search and local refinement, especially in high-dimensional mixed-integer spaces.
From a practitioner's perspective, the choice of solver depends on several factors beyond just solution quality. Computational budget matters: if you need to rebalance a portfolio daily or intraday, spending hours on optimization is not viable. Interpretability matters: some institutional investors prefer methods that provide intuition about why certain assets were selected, rather than black-box solutions. Robustness matters: financial data is noisy and non-stationary, so a solver that is slightly suboptimal but robust to parameter misspecification may outperform a theoretically optimal but brittle solver in live trading.
The numerical experiments in the paper use a small five-asset dataset to demonstrate feasibility, but real portfolios often contain hundreds or thousands of assets. Scaling metaheuristics to this regime requires careful algorithmic engineering: sampling strategies to reduce the effective search space, hierarchical clustering to group similar assets, and warm-starting with solutions from simpler models. Furthermore, the penalty parameter rho plays a critical role in balancing feasibility and optimality: too small and the solver wanders into infeasible regions, too large and numerical precision issues arise because the objective becomes dominated by penalty terms with vastly different magnitudes.
Conclusion: while Spiral Optimization Algorithm is not a silver bullet for all portfolio optimization problems, it represents a valuable tool in the quantitative analyst's toolkit, especially when dealing with discrete constraints that render classical methods inapplicable. Key: understanding when to use it (non-convex, mixed-integer, moderate scale) and when to switch to specialized commercial solvers (very large scale, need for optimality certificates) or simpler heuristics (low-latency requirements, noisy data). By combining domain knowledge with algorithmic pragmatism, practitioners can build portfolio construction systems that are both theoretically sound and practically deployable.
- Post title:Solving Constrained Mean-Variance Portfolio Optimization Problems Using Spiral Optimization Algorithm
- Post author:Chen Kai
- Create time:2024-10-01 00:00:00
- Post link:https://www.chenk.top/en/Solving%20Constrained%20Mean-Variance%20Portfolio%20Optimization%20Problems%20Using%20Spiral%20Optimization%20Algorithm/
- Copyright Notice:All articles in this blog are licensed under BY-NC-SA unless stating additionally.