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

MPSolver gets stuck and does not respect time limit when dealing with high numerical values #4484

Open
Fredrik2002 opened this issue Dec 30, 2024 · 1 comment
Assignees
Labels
Solver: Linear Solver Related to all Linear Solver (GLOP, BOP, CBC etc...) Solver: SCIP SCIP Solver related issue
Milestone

Comments

@Fredrik2002
Copy link

What version of OR-Tools and what language are you using?
Google OR-Tools version: 9.11.4210
SCIP 9.0.0 [LP solver: Glop 9.11]
Language: Java
Java version: 21.0.5 (JDK)
Apache Maven 3.9.9

Which solver are you using (e.g. CP-SAT, Routing Solver, GLOP, BOP, Gurobi)
MPSolver.OptimizationProblemType.SCIP_MIXED_INTEGER_PROGRAMMING

What operating system (Linux, Windows, ...) and version?
I tried on both Windows 11 24H2 and Ubuntu 22.04.2 LTS (WSL). I don't have any fully Linux-based machine.

What did you do?
I used the basic example provided here https://developers.google.com/optimization/install/java/pkg_linux and loaded my proto model (1233 variables & 1367 constraints)

MPModelProto modelProto = MPModelProto.parseFrom(new FileInputStream("model.proto"));
MPSolver solver = new MPSolver("WRSP", MPSolver.OptimizationProblemType.SCIP_MIXED_INTEGER_PROGRAMMING);
solver.setTimeLimit(Duration.ofSeconds(300).getSeconds()*1000);
solver.loadModelFromProto(modelProto);
solver.enableOutput();

// [START solve]
System.out.println("Solving with " + solver.solverVersion());
final MPSolver.ResultStatus resultStatus = solver.solve();
// [END solve]

// [START print_solution]
System.out.println("Status: " + resultStatus);

Steps to reproduce the behavior:

  1. Pull the example repo https://github.com/or-tools/java_or-tools
  2. Download the model and put it at the root of the repo (downloadable here : https://github.com/Fredrik2002/Proto-Models)
  3. Replace lines 35-97 of BasicExample.java by the code above (don't forget imports and make main method to throw IOException)
  4. Compile and run with mvn compile -B and maven exec:java

What did you expect to see

SCIP Status  :  solving was interrupted [time limit reached]
Solving Time (sec) : 300.00 (more or less)

What did you see instead?
The output showing the solving in real time gets stuck after a few seconds, and the solving process does not stop after the 300 seconds, but after 421s (7min instead of 5)
Image

With a 60 seconds time limit :
Image

With a 30 minutes time limit : (2623 seconds = 43 minutes and 43 seconds)
Image

As you can see, the more time you give to the solver, the more time it takes to stop, and it always gets stuck at the same point

Anything else we should know about your project / environment
In the tests above, I have some constraints with some coefficients set to $10^6$. I tried with $10^9$ and the solver took even more time to stop. I then tried with $1500$ (the minimum I can afford) and I still experienced the issue, but less, 331 sec instead of 421 when running with $10^6$. So I might guess that the problem comes from here.

I can provide more models experiencing the same issue if needed (but with much more variables and constraints)

@lperron
Copy link
Collaborator

lperron commented Dec 31, 2024

looks like a scip issue.

@Mizux Mizux added Solver: Linear Solver Related to all Linear Solver (GLOP, BOP, CBC etc...) Solver: SCIP SCIP Solver related issue labels Jan 1, 2025
@Mizux Mizux added this to the Backlog milestone Jan 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Solver: Linear Solver Related to all Linear Solver (GLOP, BOP, CBC etc...) Solver: SCIP SCIP Solver related issue
Projects
None yet
Development

No branches or pull requests

3 participants