[Scip] Collecting feasible solutions in SCIP - (reading the values of continuous variable)

Stefan Heinz heinz at zib.de
Wed Jul 4 20:33:06 MEST 2012


Hi,

On 06/30/2012 06:19 PM, sheetal murkute wrote:
> Hello,
>
> I want to collect feasible solutions for MIP in SCIP.
> I have used the method SCIPgetCountedSparseSolutions(). When I print the
> variable values using
> SPARSESOLUTION*** structure elements (lbvalues and ubvalues), I could print
> the values of only the variables
> that are bounded to integral values.
The sparse solution stores only the values for none continuous 
variables. Basically the sparse solutions are all the fixing of integer 
variables such that for the remaining continuous at least one feasible 
assignment exist.
> However, I want to collect values of all the variables (continuous and
> integral) for each feasible solution.
> How can I get these values?
>
> Do I need to solve the problem again for each feasible solution by changing
> the variable- bounds of integral variables
> to the values that I get by the method SCIPgetCountedSparseSolutions() ?
Yes that is the way to do it.
> Which methods can I use
> for copying the problem for each feasible solution and changing the
> variable bounds?
There is no need to copy the problem. You basically reset your problem 
into the problem stage by freeing the transformed problem 
SCIPfreeTransform().
http://scip.zib.de/doc/html/scip_8h.html#a9c2399c2334680cd8ad14a1a5ac31622
Then you fix the integer variables via SCIPfixVar()
http://scip.zib.de/doc/html/scip_8h.html#ab29ea185d867f9878e688fec44f2536f
Then call SCIPsolve() and you get everything you need for one solution. 
After that you free the transformed problem via SCIPfreeTransform() 
again and do it again with the next solution and so on.

>
> Is there any other way for this that could take less time?
Currently not.

Stefan
>
>
>
>
> _______________________________________________
> Scip mailing list
> Scip at zib.de
> http://listserv.zib.de/mailman/listinfo/scip




More information about the Scip mailing list