8000 MPSolver gets stuck and does not respect time limit when dealing with high numerical values · Issue #4484 · google/or-tools · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
MPSolver gets stuck and does not respect time limit when dealing with high numerical values #4484
Open
@Fredrik2002

Description

@Fredrik2002

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)

Metadata

Metadata

Assignees

Labels

Solver: Linear SolverRelated to all Linear Solver (GLOP, BOP, CBC etc...)Solver: SCIPSCIP Solver related issue

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0