ROC++ is a C++ based platform for modeling, automatically reformulating, and solving robust optimization problems.
ROC++ can address both single- and multi-stage problems involving exogenous and/or endogenous uncertain parameters and real- and/or binary-valued adaptive variables.
Please visit our website for more detailed information.
ROC++ requires at least one of the following MILP solvers:
- GUROBI
- SCIP
- Note that SCIP needs at leaset one LP solver, the supported LP solver interfaces are listed here.
- If you want to solve a nonlinear MIP porblem, you need to have at least one of NLP solver supported by SCIP.
- The compilation instructions of SCIP are here using CMake and here using Makefiles.
After installation of the solvers, we can build the ROCPP
project using CMake by the following steps:
mkdir build
cd build
# use the following line to choose SCIP as the solver
cmake -DEXAMPLE=EXAMPLE_NAME -DSOLVER=SCIP ..
# or use the follwoing line to choose Gurobi as the solver and also specify the path to Gurobi
cmake -DEXAMPLE=EXAMPLE_NAME -DGUROBI_DIR=/path/to/gurobi ..
make
CMake will build files in a separated directory. Users need to create this directory, usually called build
or whatever other names. Then run cmake -DEXAMPLE=EXAMPLE_NAME -DGUROBI_DIR=/path/to/gurobi ..
or cmake -DEXAMPLE=EXAMPLE_NAME -DSOLVER=SCIP ..
to configure the build. The option EXAMPLE
indicates the example to run. SOLVER
set the solver to use. If you choose GUROBI as the solver, you need to specify the path to gurobi to GUROBI_DIR
. The following table lists detailed information on CMake options.
Next, run make
to compile the source code. A generated executable can be found in bin
. In macOS, you need to give the system permission to run the executable. A library ROCPP.a
will also be created and put in the folder lib
.
We use pybind11 to create Python bindings of the C++ code.
We add pybind11 as a submodule of this repo.
If you clone this repo, an empty pybind11
directory will be created. Run the following commands to initialize the local configuration files and fetch the data.
git submodule init
git submodule update
If you directly download the .zip, then there will be an empty pybind11 directory. You need to download it here and replace the empty one.
Now we are able to build the ROPY
library by the following steps. Note that we don't need to create a new build folder if it already existed.
mkdir build
cd build
# use the following line to choose SCIP as the solver
cmake -DBUILD_PYTHON=ON -DSOLVER=SCIP ..
# or use the follwoing line to choose Gurobi as the solver and also specify the path to Gurobi
cmake -DBUILD_PYTHON=ON -DGUROBI_DIR=/path/to/gurobi ..
make
By setting the option BUILD_PYTHON
to ON
, we choose to build a library for python. A library ROPY.python-version.so
will be created and put in the folder lib
. To use the library, we need to put it in the same directory of python files and add a line from ROPY import *
at the top of the file. See more examples in the scripts/examples_py
folder.
CMake Options | type | Avaliable values | Description |
---|---|---|---|
EXAMPLE | string | BB, RSFC, PB | Name of the example to run in the folder scripts/examples_cpp , can also be the names of users created .cpp files |
SOLVER | string | GUROBI(default), SCIP | Name of the solvers that are supported by ROCPP, SCIP by default |
GUROBI_DIR | path | - | Path to the folder which contains the Gurobi libraries and include folder |
BUILD_PYTHON | bool | ON, OFF(default) | If ON , then a .so library for python will be created, else an executable of the specific example will be generated |
To get the same results, run the RSFC, PB, and BB examples following the instructions above.
The documentation of ROCPP generated by Doxygen can be found here.
We hope that you find ROC++ useful in your work. If you do use it, please cite us as:
P Vayanos, Q Jin, and G Elissaios. ROC++: Robust Optimization in C++. Underreview at Informs Journal of Computing, 2020.
If you use the ROCPPKadapt approximator, please also cite the paper:
Vayanos P, Georghiou A, Yu H (2019) Robust optimization with decision-dependent information discovery. Under review at Management Science.
If you use the ROCPPPiecewise approximator, please also cite the paper:
Vayanos P, Kuhn D, Rustem B (2011) Decision rules for information discovery in multi-stage stochastic programming. Proceedings of the 50th IEEE Conference on Decision and Control , 7368โ7373.