[Scip] Collecting feasible solutions in SCIP
sheetal murkute
shvm11 at gmail.com
Fri May 25 18:24:48 MEST 2012
Hello,
I want to collect all the feasible solutions for MIP in SCIP. I want to
store these solution values (for the original
variables) either in file or in some class so that I can access these later.
I have written the code as follows. However, I do not know how to store all
these solutions to a file or
in my own array/class. Also when I display *nsols ( total number of counted
solutions), it displays "0".
************************************************************************************************************************
SCIP_CALL_EXC(SCIPsolve(scip));
SCIP_Bool valid;
int a, b;
SPARSESOLUTION ** feassols;
SCIP_VAR** curvars;
int* nsols;
int* nvars;
assert( scip != NULL );
a = SCIPgetNVars(scip);
nvars =&a;
curvars = SCIPgetVars(scip);
valid = FALSE;
b = SCIPgetNCountedSols(scip, &valid);
nsols = &b;
//SCIP_CALL( SCIPsetLongintParam( scip, "constraints/countsols/sollimit",
1000) );
SCIP_CALL( SCIPsetBoolParam( scip, "constraints/countsols/collect", TRUE) );
SCIPgetCountedSparseSolutions(scip, &curvars, nvars,&feassols,nsols);
cout << "total nuber of feasible solutions :" << *nsols<< endl;
*****************************************************************************************************************************************
Are the feasible solutions stored in SPARSESOLUTION ** feassols ?
I tried to display solutions as
SPARSESOLUTION * feas;
feas = *feassols;
for(i=0; i <= nvars; ++i)
cout << feas[i];
However, this gives segmentation fault.
************************************************************************************************************************************
Could you please help me with this?
--
Thanks with Best Regards,
Sheetal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listserv.zib.de/mailman/private/scip/attachments/20120525/e1c69a28/attachment.html
More information about the Scip
mailing list