Giter VIP home page Giter VIP logo

rocpp's Introduction

ROCPP

Introduction

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.

How to use

Dependencies

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.

Compile

ROCPP project

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.

ROPY library

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

Replicating

To get the same results, run the RSFC, PB, and BB examples following the instructions above.

Documentation

The documentation of ROCPP generated by Doxygen can be found here.

Please cite us

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.

rocpp's People

Contributors

qingjin313 avatar phebe-vayanos avatar robust-opt-cpp avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.