Implementation of the Multi-Objective methodologies for advanced sparse portoflio optimization presented in
In case you employ this code for research purposes, please cite:
@Article{Annunziata2025,
author={Annunziata, Arturo and Lapucci, Matteo and Mansueto, Pierluigi and Pucci, Davide},
title={On the computation of the efficient frontier in advanced sparse portfolio optimization},
journal={4OR},
year={2025},
month={Sep},
day={11},
issn={1614-2411},
doi={10.1007/s10288-025-00600-3},
url={https://doi.org/10.1007/s10288-025-00600-3}
}
To run the code, a working Anaconda installation is required. We recommend creating a new conda environment with Python 3.10.6 or above.
Required dependencies can be installed using:
pip install -r requirements.txt
Note that the dependency nsma will also install gurobipy as Gurobi is used to solve direction subproblems. Make sure a valid licence is available.
The code is provided with a toy dataset. As for the datasets tested in the paper, some of them can be downloaded from francescocesarone.com/data-sets, while others can be provided upon request.
In order to run the experiments, execute the following:
python main.py [options]
specifying the required options:
| Option | Type | Description | Default |
|---|---|---|---|
--single_point_methods |
list[str] |
List of phase 1 methods to be tested (MOHyb, Gurobi, NG2, NS, MOSPD) |
None (required) |
--max_t_p1 |
float |
Time limit for phase 1 methods (expressed in minutes) | None (required) |
--max_t_p2 |
float |
Time limit for phase 2 methods (expressed in minutes) | None (required) |
--objectives |
list[str] |
List of objectives (Variance, Mean, SR, ESG, Skew) |
None (required) |
--prob_path |
str |
Problem path | None (required) |
--s |
int |
Upper Bound for the Solution Cardinality | None (required) |
Other useful optional parameters are:
| Option | Type | Description | Default |
|---|---|---|---|
--plot_pareto_front |
bool |
Plot Pareto front during the execution | False |
--general_export |
bool |
Export fronts (including plots), execution times and arguments files | False |
--export_pareto_solutions |
bool |
Export pareto solutions to file | False |
--beta_bounds |
[str, str] |
Bounds for beta | ['None', 'None'] |
The full list of parameters is available in parser_management.py, containing also the settings for each algorithm, for the line-search and for Gurobi.
An example usage is:
python main.py --single_point_methods NS --NS_local_opt MOIHT --max_t_p1 2 --max_t_p2 2 \
--prob_path datasets/TOY1 --objectives Variance Mean --s 2 \
--plot_pareto_front --general_export --export_pareto_solutions
Davide Pucci, Pierluigi Mansueto
Global Optimization Laboratory (GOL)
University of Florence
Email: davide dot pucci at unifi dot it, pierluigi dot mansueto at unifi dot it