This repository provides a benchmark whose results are presented in the paper:
"Where’s Ben Nevis? A 2D optimisation benchmark with 957,174 local optima based on Great Britain terrain data",
Yuhang Wei, Michael Clerx, Gary R. Mirams, 2024, arXiv, https://doi.org/10.48550/arXiv.2410.02422
This benchmark uses the nevis package which turns Ordnance Survey Terrain 50 data into a linearly interpolated surface for optimisation problems.
Tested on Ubuntu 22.04.3 LTS with Python 3.10.12.
- Use a Python virtual environment:
python3 -m venv venv && source venv/bin/activate. - Install the required packages
pip install -r requirements.txt. Alternatively, you may runpip install numpy pandas matplotlib seaborn scipy nevis optuna optuna-dashboard pints nlopt jupyter ipython pymongo pybind11 python-dotenv tqdm. - Download the required data for the
nevismodule by runningpython3 -c "import nevis; nevis.download_os_terrain_50()", if you haven't done so. - Run the the algorithm of finding local optima and their basin of attraction (as specified in
basin-problem/README.md). In other words, you need to run:
cd basin-problem
sudo apt install python3.10-dev g++ inkscape
python setup.py installand then run python calculate.py twice. Then cd ... (inkscape is installed because it is needed later for converting SVG to PDF.)
- Go to
./basin-problem/ipynb/and runfig-1.ipynbandtable-1.ipynbto produce Figure 1 and Table 1. - Create a directory
./result/bymkdir result. - Navigate to the
srcdirectory bycd src, then runpython3 run.py cmaes de da mlsl nm pso. This script will run the hyper-parameter tuning process and save the run results for the best instance for each of the following algorithms: CMA-ES, Differential Evolution, Dual Annealing, MLSL, Nelder-Mead, and PSO (Nelder-Mead does not have hyper-parameters so the tuning process is skipped). To speed up the process, you can run the tuning process for different algorithms concurrently in separate terminals; for example, you could runpython3 run.py cmaes nm dain one terminal andpython3 run.py pso mlsl dein another. For a full list of available options, usepython3 run.py --help. - Go to
./ipynb/plots/and runall.ipynb. You should then find in./ipynb/plots/imgs/three figures:Fig2.pdf,Fig3.pdfandFig4.pdf, which correspond to Figures 2, 3, 4 in the paper. Tables 5 and 6 are also produced in this notebook.
Class definitions for the benchmarking framework.
./src/frameworkcontains class definitions for the framework../src/algorithmscontains algorithms defined using the framework../src/tutorial.ipynbis a tutorial for using this framework.
Some Jupyter notebooks.
interval_size.ipynbThe number of grid points that fall in each height interval.lowest_point.ipynbThe lowest point withinnmeters away from the peaks. Could be useful in selecting height threshold for successful runs.
all.ipynbPlot most tables and figures in the paper.de.ipynbGenerating plots and animations for Differential Evolution.nelder-mead-multi.ipynbGenerating plots and animations for Nelder-Mead.animationThis directory contains some sample animations.
This directory has some notebooks from early trials. Some algorithms used have been re-implemented in the framework.
baseline.ipynbSome trials of baseline algorithms on this problem.baseline_grid.ipynbGrid search as a baseline algorithm. The plot methods have been reimplemented in the framework, and the algorithm itself is too inefficient.cmaes.ipynbA run of CMA-ES with plots.DIRECT.ipynbDIRECT algorithms (with different variations implemented innlopt).fitting-with-shgo.ipynbSHGO algorithm.plot.ipynbResults and plots from earlier experiments.result.ipynbResults and plots from earlier experiments.simulated_annealing.ipynbSimulated annealing and dual annealing.tol-test.ipynbTesting the effect of absolute/relative tolerance on local optimisers.variable-boundary.ipynbAn attempt to generate multiple problem instances by setting random boundaries. Aborted.
Scripts for finding all the local optima and their basin of attraction on the grid.
Images used in documents and Jupyter notebooks.
Legacy documents and presentation slides about this project.