Search code examples
linear-programmingscip

Is there a way for the SCIP optimization software to write the model into an LP / MPS file


Some commercial solvers like GuRoBi have a nifty function which can be used to write the optimization problem to a .lp file or a .mps file. For instance,GuRoBi python interface has this command,

model.write("test.lp")

I am using SCIP's c++ interface I was wondering if I can write the model I described in c++ to an lp file. Googling seems to just give me answers about reading .lp files and not writing.


Solution

  • You should call SCIPwriteOrigProblem.

    Example:

    int retcode = SCIPwriteOrigProblem(scip, "test.lp", NULL, FALSE);
    assert(retcode == SCIP_OKAY);