swissQuant · Quantitative analytics for institutional finance
A Custom Portfolio Optimizer, Up to 40% More Risk-Return Efficient Than Standard Heuristics
A spatial Branch-and-Bound built at ETH IFOR with swissQuant, delivering certified-optimal portfolios on a non-convex problem standard MIP solvers can only attempt heuristically
Modern asset managers want portfolios where every position carries a fair share of risk, not just a fair share of capital. The constraint that enforces this is mathematically nasty, and most off-the-shelf solvers either give up or return numbers no one can defend in front of a risk committee.
We worked with swissQuant and ETH Zurich's Institute for Operations Research to build a Branch-and-Bound algorithm that solves the problem to certified global optimality. The output isn't just a portfolio, it's a portfolio with a proof.
The challenge
swissQuant's institutional clients required portfolios where each asset's marginal contribution to total volatility stays inside a tight tolerance. The math behind that constraint is non-convex, and off-the-shelf quadratic and conic solvers either return infeasible solutions or hit time limits as the asset universe grows.
Heuristics produce a point but no bound on how far that point sits from optimal. That's awkward when the result has to land on a portfolio manager's desk and be defended.
Our approach
We reformulated the problem as a Quadratically Constrained Quadratic Program and built a spatial Branch-and-Bound algorithm with custom convex relaxations on every node. Tight bound-tightening, smart branching rules, and a benchmark of six algorithmic variants on real MSCI World data identified the configuration that consistently wins.
Alongside the exact engine, we shipped two industry-friendly heuristics that warm-start the search or serve as a fast fallback when a certified optimum isn't worth the wait.
The outcome
Deliverable: a documented Python implementation of the spatial Branch-and-Bound on McCormick relaxations, the two warm-start heuristics, and the reproducible MSCI World test harnesses, ready to plug into swissQuant's internal valuation pipeline.
On real five-year MSCI World data (top-100 instruments, four-currency basket, daily log-returns Jan 2015 – Jan 2020), the algorithm closes a 40% objective gap left open by the iterative heuristic on 33-asset portfolios. In the most non-convex regime (n = 11, τ = 1) the heuristic returns a positive objective where the true optimum is negative, a 160% relative gap; our algorithm finds the certified optimum.
Technical deep dive
The model behind the result.
The model
We measure portfolio risk by volatility R(x) = √(xᵀΣx). For a long-only portfolio x, the marginal risk contribution of asset i follows from the Euler decomposition of volatility:
Marginal risk contributions sum exactly to the portfolio's total volatility.
Relative marginal risk: asset i may contribute at most a fraction cᵢ of the total risk.
Problem (P): mean-variance with rMRC constraints. τ trades off risk against expected return μ.
Reformulation: auxiliary variables y, z lift all the non-convexity into clean bilinear equalities.
The McCormick envelope: four linear inequalities per asset that bound the bilinear term z_i = x_i y_i given box bounds on (x_i, y_i).
Each Branch-and-Bound node solves a convex relaxation built from these McCormick inequalities. Branching subdivides the box on x, the bounds on y are recomputed analytically, and the search terminates when the gap between the best feasible incumbent and the lowest open lower bound is below the tolerance.
Benchmark
Runtime of the best B&B configuration on MSCI World benchmarks.
| Universe size | c-factor | τ ≤ 0.6 | τ = 0.7 | τ = 0.8 | τ = 0.9 | τ = 1.0 |
|---|---|---|---|---|---|---|
| n = 11 | 1.5/n | 22.3 s | 11.0 s | 12.7 s | 14.1 s | 17.3 s |
| n = 22 | 1.5/n | 198.9 s | 217.0 s | 107.3 s | 68.2 s | 64.7 s |
| n = 33 | 1.5/n | 674.3 s | 1658.4 s | 2219.0 s | 34.4 s | 57.3 s |
| n = 44 | 2/n | 1223.6 s | 1883.5 s | 1232.2 s | 761.5 s | 598.2 s |
| n = 54 | 2/n | - | - | - | 1238.8 s | 621.1 s |
Times in seconds, single-threaded relaxation calls, one-hour cap. Test bed: random subsets of the MSCI World top 100, daily log-returns Jan 2015 – Jan 2020, four-currency basket. Em-dashes indicate the configuration did not close the optimality gap within the budget.
From the record



Techniques
- Spatial Branch-and-Bound
- McCormick envelope relaxations
- Bilinear reformulation of QCQP
- Adaptive bound-tightening on relaxation duals
- Risk-parity & risk-budgeting modeling
- Mean-variance with non-convex risk constraints
Stack
- Python
- Gurobi
- NumPy
- MSCI World data pipeline
A problem like this?