[Scip] adding new variables in primal heuristic

Kati Wolter wolter at zib.de
Fri Aug 7 09:53:25 MEST 2009


Hi Sandro,

my first idea was to do it just like this:

- create the variable: SCIPcreateVar()
- add it to SCIP: SCIPaddVar()
- add it to the constraints: SCIPaddCoefLinear() or whatever is
appropriate for you

- create a solution: SCIPcreateSol()
- set the solution values of all variables including your new one:
SCIPsetSolVal()
- test the solution and add it to SCIP: SCIPtrySolFree()

The Coloring-example of SCIP (also a pricing problem) includes a
heuristic "heur_init.c" which does exactly what I have just described.
I'm not completely sure, whether I missed something here. Thus, please
give it a try and in case it doesn't work, write me an email.

Best regards
Kati

Sandro Pirkwieser schrieb:
> Hi all,
>
> I seek a way to add new variables in a primal heuristic to actually
> enable SCIP to use the newly found solution. Since I did not find
> something in the documentation I guess it is not that common.
> Is it perhaps necessary to store the variables, adding them in the next
> pricing round, and in a second call to the heuristic finally returning
> the solution? Though, by doing so one could get in conflict with the
> branching decisions I assume (since the new variables would have to be
> added in some sort of node independent way).
>
> Best regards,
> Sandro Pirkwieser
> _______________________________________________
> Scip mailing list
> Scip at zib.de
> http://listserv.zib.de/mailman/listinfo/scip
>   



More information about the Scip mailing list