[SCIP] Check if solution is optimal?
Stefan Vigerske
stefan at math.hu-berlin.de
Mon Jun 18 00:02:28 CEST 2018
Hi,
you can use SCIPgetStatus(scip) to check why SCIP has finished.
If this return SCIP_STATUS_OPTIMAL, then the best solution is optimal.
Other status codes are here:
http://scip.zib.de/doc-5.0.1/html/type__stat_8h.php#a30465694b6ab6a27960f09122bbee249
But if SCIP runs until the timelimit, then because SCIP hasn't proven
optimality of the best known solution within the timelimit, so you'll
not get SCIP_STATUS_OPTIMAL.
Stefan
On 06/17/2018 11:15 PM, Øystein Schønning-Johansen wrote:
> Hi!
>
> I've just started to use SCIP, and so far I like it. I'm coding in the C
> API.
> I have several problems and some of them take a long time to solve. 24
> hours and more to solve to optimal solution.
>
> Since I want to break the search before this, and live with suboptimal
> solution, I add the following:
>
> SCIP_CALL( SCIPsetRealParam(mip, "limits/time", 3600 ));
>
> ... such that the solver runs for an hour. However, how can I then check if
> the solution sound in this solution is optimal or not? Is there an API call
> for that, of can I check the gap in some way?
>
> SCIPsolIsOptimal(scip,sol); ??
>
> Thanks,
> -Øystein
>
>
>
> _______________________________________________
> Scip mailing list
> Scip at zib.de
> https://listserv.zib.de/mailman/listinfo/scip
>
More information about the Scip
mailing list