Closed ChristopherHamkins closed 2 years ago
If I explicitly also add the limits to the single solution decision builder in method makePermutationDecisionBuilder(Solver solver) like this:
SearchLimit limits = solver.MakeLimit(timeLimit_ms, long.MaxValue, long.MaxValue, long.MaxValue, true, true);
DecisionBuilder singleSolutionDecisionBuilder = solver.MakeSolveOnce(restDecisionBuilder, limits);
The time limit is respected.
Reusing the same limits
object in
DecisionBuilder singleSolutionDecisionBuilder = solver.MakeSolveOnce(restDecisionBuilder, limits);
and in
solver.NewSearch(decisionBuilder, limits);
also leads to the time limit not being respected.
What version of OR-Tools and what language are you using? Version: 9.0.9048 (also present in 6.7.4973) Language: C#
Which solver are you using Routing Solver
What operating system Windows 10
What did you do? I have a problem that timeout is not respected when using multiple-phase decision builders and the solution can't be found because of massive backtracking.
Steps to reproduce the behavior:
This is a minimal code that demonstrates the problem:
I execute it like this for the test:
Execute the Main method. This is the output:
What did you expect to see In the last section, instead of running to 54222 ms, the solver should have stopped searching when 1000 ms was reached and report NO_MORE_SOLUTIONS:
What did you see instead? The solver kept searching until the entire search tree was visited and required 54222 s.
Make sure you include information that can help us debug (full error message, model Proto).
Anything else we should know about your project / environment