Search code examples
c++scip

SCIP how to add objective function in my source code by using c++ when I use SCIP


I want to use SCIP as a MIP solver, but I do not know how to add objective function in my source code. I did not find related code in SCIP C++ example code.


Solution

  • SCIP only understands linear objective functions, i.e., every variable has an objective coefficient that can be passed as SCIP_Real obj to

    All example projects of SCIP create variables and set objective coefficients in one form or another. Note that SCIP by default minimizes a given objective function. A good example how to setup a simple MIP is the n-queens example in the examples directory of SCIP. This example sets up a maximization problem!

    Nonlinear objective functions can be added as a constraint instead, using an artificial objective variable, whose value is bounded by the constraint, with objective coefficient 1. Good examples of setting up nonlinear problems can be browsed in the Callable Library example.