1
$\begingroup$

I am using Java to call the API of or-tools in IntelliJ IDEA to solve a mixed-integer programming problem. There are some modeling statements such as ModelSolver solver = new ModelSolver("SCIP"); and ModelBuilder model = new ModelBuilder();.

Prior to solving, I want to output a readable model file with suffix lp or mps. I tried model.exportToFile("mip.lp") and model.exportToFile("mip.mps"), which can output files normally but in binary form. If I output the file with the suffix txt, it can be opened normally on a mac but with poor readability.

In addition, I also tried model.exportToLpString(true); and model.exportToMpsString(true); methods, but I could not find the output file in the project path. Is there any way to output a more readable model file to speed up debugging?

Additionally, I want to set parameters during the solving process, such as solver.setSolverSpecificParameters("limits/gap=0.01");. Are there any other optional parameters for this input? I could not find the official manual for it.

$\endgroup$

1 Answer 1

1
$\begingroup$

ModelBuilder.exportToMpsString() returns a string as the name suggests.

See the doc.

Parameters must be parsable by the solver. In your example, refer to the scip manual.

$\endgroup$
1
  • $\begingroup$ Great, thanks, it works. $\endgroup$
    – Ying
    Commented Sep 17, 2023 at 7:07

Not the answer you're looking for? Browse other questions tagged or ask your own question.