Getting output after solver timeout reached

Hello all, I have recently started using Couenne to solve MINLPs and have now encountered problems where I don’t obtain a solution in a reasonable amount of time. I am wondering if I can get set a time limit and obtain the best feasible solution for my problem. Right now if I set a time limit of say 10 minutes, when I try to access the values of the solution I get an error because the problem wasn’t solved globally in the time period.

When running the solver I see two things, first I see
Couenne: new cutoff value 2.4950000000e+01

Then,
Cbc0010I After 1600 nodes, 437 on tree, 1e+50 best solution, best possible 23.235597

At the end I see
Lower bound: 23.2862
Upper bound: 24.95 (gap: 6.85%)
So the upper bound matches the cutoff value. Is there a way to get the values of the variables that would provide me the upper bound value? So that even if I timeout and don’t get the best answer I still have something.

Thanks

1 Like

Are you using Couenne through JuMP? If so, the recommended way to query solutions is to check that a primal solution indeed exists.

Normally, if a solver has found a feasible solution (even if it was not able to prove global optimality), it should let you query it. In your case, you want to check that primal_status(model) == FEASIBLE_POINT.

If, for some reason, the solver log suggests that a feasible solution has been found, but the above check fails, there may be an issue in either Couenne itself or its wrapper.

Can you provide a reproducible example? (you can have a look here for guidelines on how to do that)

1 Like

If you’re calling through AmplNLWriter, then it depends on whether Couenne writes a .sol file before existing, and what the contents of that are.

Can you post the results of calling solution_summary after optimize!? That should tell us what happened.

optimize!(model)
solution_summary(model)
1 Like