[Scip] Computing primal solution after fixing
Gregor Hendel
hendel at zib.de
Thu Oct 23 11:55:22 CEST 2014
Dear Demetrio,
You do not have to change variable types by yourself. This is what the
LP relaxation already does for you. The optimization problem
formulation that you enter to SCIP should contain the variable types
that you expect from any feasible solution, i.e., 0/1-variables should
be declared to be of binary type at the creation time of your model.
I recommend you to have a look at How to Add relaxation handlers
<http://scip.zib.de/doc/html/RELAX.php> in the SCIP documentation, and
base your dynamic programming algorithm on the Relaxation handler
interface. The basic idea of a customized relaxation handler is that you
may, at each node, solve your own relaxation of the local node's
problem. You may use the data structures provided by the LP relaxation
as a starting point, only copy the relevant constraints/rows, and apply
your algorithm. If you do not intend to solve node LP relaxations at
all, you can set the lp/solvefreq parameter to -1.
Hope this helps,
Gregor
Am 23.10.2014 um 10:54 schrieb Demetrio Laganà:
> Dear SCIP list,
> I have a NonLinear 0/1 Programming problem modeled with SCIP callable
> library. I need to use a continuous relaxation of such a problem in a
> dynamic programming algorithm that requires to solve it at each status
> by fixing some variables to be binary and other to be equal to 1,
> moreover some constraints belonging to the continuous relaxation must
> be dropped and new constraints added progressively, as well as the
> dynamic system progresses. I have look at the way to fix to 1 some
> continuous variables through SCIPfix Var(), but I don't know how to
> change the type of some continuous variables to be
> binary(SCIP_VARTYPE_BINARY instead of SCIP_VARTYPE_CONTINUOUS).
> Finally, I don't know how to drop o make inactive some constraints in
> a given state of the dynamic programming algortihm. Is there a way to
> do this without clearing the model and re-create it at each status?
> Thank you in advance
> Regards
> Demetrio Laganà
>
>
> 2014-10-23 0:58 GMT+02:00 Gerald Gamrath <gamrath at zib.de
> <mailto:gamrath at zib.de>>:
>
> Dear Andrea,
>
> in SCIP a rounding heuristic basically does the following:
> 1) get the current LP solution
> 2) round all fractional variables to an integer value
> 3) check the resulting solution.
>
> How step 2 is performed influences the probability to find
> feasible solutions and also the running time, that's why there are
> multiple heuristics of this kind in SCIP.
>
> So you are right, no further LPs are solved by the heuristic.
>
> If you want to fix some variables, then optimize the resulting LP,
> fix again, solve the LP, and iterate until you found an integer
> feasible solution, you should have a look at the diving heuristics
> in SCIP, which all use this scheme.
>
> Best,
> Gerald
>
>
> Am 22.10.2014 um 19:04 schrieb Andrea Taverna:
>
> Dear all,
>
> I'm a bit confused on how to implement a "rounding" heuristic.
>
> I'm working on a column generation algorithm.
> Basically my heuristic fixes some fractional binary variables
> to 0/1 by calling SCIPsetSolVal.
>
> What should I do after those fixings to get a feasible solution?
>
> >From the examples, e.g. the TSP one, it seems that no LP
> solver is called explicitly on the working copy of the LP
> solution to generate a feasible solution . There are just
> calls to functions like SCIPtrySol or SCIProundSol.
>
> So, if I understand correctly, SCIP reoptimizes in some way
> the working copy of the LP solution to obtain the actual
> heuristic solution. Is that so?
>
> TIA
>
> Andrea
> _______________________________________________
> Scip mailing list
> Scip at zib.de <mailto:Scip at zib.de>
> http://listserv.zib.de/mailman/listinfo/scip
>
>
> _______________________________________________
> Scip mailing list
> Scip at zib.de <mailto:Scip at zib.de>
> http://listserv.zib.de/mailman/listinfo/scip
>
>
>
>
> _______________________________________________
> Scip mailing list
> Scip at zib.de
> http://listserv.zib.de/mailman/listinfo/scip
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.zib.de/pipermail/scip/attachments/20141023/edfca9dd/attachment.html>
More information about the Scip
mailing list