Hello,
My team and I are willing to model LP problem using OR-Tools and then solving
them by sending the LP in a file to CPlex or Gurobi. We do not want to directly
link CPlex or Gurobi to Or-tools as a third party solver.
For this purpose we have used the .mps file format. Nevertheless, the float
number precision seems to only be of 5 numbers. This is not enough for our usecases.
Is there a better suited file format handled by Or-tools? Like the .nl file format?
Is there a way to increase the .mps file format’s precision?
We use Or-Tools via Java.
Here is the way get the .mps:
String solverName = "SCIP";
Loader.loadNativeLibraries();
MPSolver solver = MPSolver.createSolver(solverName);
double infinity = Double.POSITIVE_INFINITY;
MPVariable x = solver.makeIntVar(0.0, infinity, "x");
MPConstraint c0 = solver.makeConstraint(-infinity, 17.5, "c0");
c0.setCoefficient(x, 1);
MPConstraint c1 = solver.makeConstraint(-infinity, 3.5, "c1");
c1.setCoefficient(x, 1.12345678912345);
MPObjective objective = solver.objective();
objective.setCoefficient(x, 1);
objective.setMaximization();
final MPSolver.ResultStatus resultStatus = solver.solve();
String mps_text = solver.exportModelAsMpsFormat();
System.out.println("MPS: " + mps_text);
Here is the output:
MPS: * Generated by MPModelProtoExporter
* Name :
* Format : Free
* Constraints : 2
* Variables : 1
* Binary : 0
* Integer : 1
* Continuous : 0
NAME
OBJSENSE
MAX
ROWS
N COST
L c0
L c1
COLUMNS
INTSTART 'MARKER' 'INTORG'
x COST 1 c0 1
x c1 1.12346
INTEND 'MARKER' 'INTEND'
RHS
RHS c0 17.5123 c1 3.5
BOUNDS
LI BOUND x 0
ENDATA
Thank you.
--
You received this message because you are subscribed to the Google Groups "or-tools-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to or-tools-discu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/or-tools-discuss/d8d66ca6-bb4b-4f67-9b20-7bb7115009a7n%40googlegroups.com.
We have hard time linking Or-Tools to the third party solvers on windows, that's why we are considering linking them using files.
Thank you for your answer :).
--
You received this message because you are subscribed to the Google Groups "or-tools-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to or-tools-discu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/or-tools-discuss/c7c381c0-581e-4ae0-a003-c56312824479n%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "or-tools-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to or-tools-discu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/or-tools-discuss/20a24b6f-abc9-412a-a19d-112f889b1194n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/or-tools-discuss/128bba66-39c6-4aa4-90a0-9b335f4699a2n%40googlegroups.com.