[SCIP] Setting solutions of a primal heuristic
Ambros Gleixner
gleixner at zib.de
Tue Oct 24 15:32:45 CEST 2017
Hi Michael,
I am not sure this is the case here, but if you add the heuristic during
the solving process, then the feasibility check is performed with
respect to the transformed and presolved model. There, variable bounds
might have been tightened (guaranteeing that one optimal solution
remains) and so your solution might be "infeasible".
Could this be the case?
Best,
Ambros
On 24.10.2017 11:28, Michael Kahr wrote:
> Dear SCIPers,
>
> I am working on a branch-and-cut model, and want to provide SCIP also
> with heuristic solutions, which works fine for an initial starting
> solution and for some problem instances during the solving stage
> (however, not for all). Thereby, I use a class inherited from ObjHeur to
> call my heuristic which delivers solutions in the original problem space.
>
> If I understood this thread correctly:
>
> http://listserv.zib.de/pipermail/scip/2013-August/001620.html
>
> the right procedure is to create a solution object in the original
> problem space which is done by
>
> SCIP_SOL *heur_sol;
> SCIP_CALL ( SCIPcreateOrigSol ( scip, &heur_sol, NULL ) );.
>
>
> I then set the variable values obtained by the heuristc (h_x) to scip
> variables (x) and try to add the solution by
>
> SCIP_CALL( SCIPsetSolVals( scip, heur_sol, nvars, x, h_x ) );
> SCIP_CALL( SCIPtrySolFree( scip, &heur_sol, true, true, true, true,
> true, &success) );
>
> However, as stated at the begin this does not work for all instances and
> SCIP complains about violations of variable bounds and constraints, e.g.,
>
> "solution violates original bounds of variable <t_x[3]> [1,1] solution
> value <0>"
>
> "[linear] <SET_LINK_NODE[49]>: -<t_x[49]>[B] +<t_l[1031]>[B] >= 0;
> violation: left hand side is violated by 1"
>
>
> What am I doing wrong here? Note that the solutions are valid before I
> pass them to SCIPtrySolFree(), which is checked by SCIPcheckSolOrig().
>
>
> Thank you in advance, best,
>
> Michael
>
> _______________________________________________
> Scip mailing list
> Scip at zib.de
> https://listserv.zib.de/mailman/listinfo/scip
--
Ambros Gleixner, Zuse Institute Berlin, http://www.zib.de/gleixner
More information about the Scip
mailing list