Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to set Solver Specific Parameter for XPRESS in JAVA #4208

Open
SnehasishChar opened this issue Apr 29, 2024 · 4 comments
Open

Unable to set Solver Specific Parameter for XPRESS in JAVA #4208

SnehasishChar opened this issue Apr 29, 2024 · 4 comments
Assignees
Labels
Bug Solver: XPRESS XPRESS Solver related issue
Milestone

Comments

@SnehasishChar
Copy link

SnehasishChar commented Apr 29, 2024

Version: 9.9.3963
Language: Java

Solver: XPRESS

OS: Windows

I am trying to update the value of the control parameters of XPRESS solver to improve the performance. But the values are not updating accordingly for some specific parameter..

I am trying to update in the following way:

String mipAbsStop = "MIPABSSTOP " + eps_optimal_absolute;
String optimalityTol = "OPTIMALITYTOL " + eps_optimal_absolute;
String mipRelStop = "MIPRELSTOP " + eps_optimal_relative;
String maxTime = "SOLTIMELIMIT " + solveTimeLimit;
String heurEmp = "HEUREMPHASIS " + 1;
String cutStrategy = "CUTSTRATEGY " + 1;
String feasTol = "FEASTOL " + eps_optimal_absolute;
String solverParams = optimalityTol + " " + mipRelStop + " " + maxTime + " " + heurEmp + " "
		+ cutStrategy + " " + mipAbsStop + " " + feasTol;

solver.setSolverSpecificParametersAsString(solverParams);

The values that are not getting set is as follows:

  • OPTIMALITYTOL
  • FEASTOL
@SnehasishChar SnehasishChar changed the title Unable to set Solver Specific Parameter for XPRESS Unable to set Solver Specific Parameter for XPRESS in JAVA Apr 29, 2024
@Mizux Mizux added Solver: XPRESS XPRESS Solver related issue Bug labels Apr 29, 2024
@Mizux Mizux added this to the v10.0 milestone Apr 29, 2024
@Mizux Mizux self-assigned this Apr 29, 2024
@lperron
Copy link
Collaborator

lperron commented Apr 29, 2024

try with \n after each parameter

@SnehasishChar
Copy link
Author

SnehasishChar commented Apr 29, 2024

try with \n after each parameter

Still not working. @lperron

@lperron
Copy link
Collaborator

lperron commented Apr 29, 2024 via email

@pet-mit
Copy link
Contributor

pet-mit commented Aug 13, 2024

Hello @SnehasishChar
This was happening because OPTIMALITYTOL & FEASTOL were set by the MPSolverParameters object, which overrides the solver-specific parameters (in current released versions).
It has been fixed here: #4244, so still not released. It will be fixed in the next version of or-tools.
Meanwhile, you can use MPSolverParameters.primalTolerance to set FEASTOL, and MPSolverParameters.dualTolerance to set OPTIMALITYTOL.

Here is an example in Java :

solver.setSolverSpecificParametersAsString(solverParams);
MPSolverParameters params = new MPSolverParameters();
params.setDoubleParam(MPSolverParameters.DoubleParam.PRIMAL_TOLERANCE, eps1); // FEASTOL
params.setDoubleParam(MPSolverParameters.DoubleParam.DUAL_TOLERANCE, eps2); // OPTIMALITYTOL
solver.solve(params);

Hope this helps!

PS: this is currently true for all XPRESS parameters that can be set through MPSolverParameters, not only these 2

@lperron I just saw this, don't hesitate to tag us next time :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Solver: XPRESS XPRESS Solver related issue
Projects
None yet
Development

No branches or pull requests

4 participants