[Scip] Problems with SCIPcopy() and SCIPcopyProb()

Daniel Karch karch at math.tu-berlin.de
Tue Dec 20 11:17:58 MET 2011


Hi,

I need to use SCIPcopy() to copy a problem instance, and I implemented the
scip_copy() callback in my ProbData class
just like in the TSP example, i.e. I get copies of all the variables via
SCIPgetVarCopy().
Now the RENS heuristic complains:

src/scip/scip.c:1422: SCIPcopyVars: Assertion `SCIPgetNIntVars(sourcescip)
+ SCIPgetNBinVars(sourcescip) <= SCIPgetNIntVars(targetscip) +
SCIPgetNBinVars(targetscip) && SCIPgetNIntVars(targetscip) +
SCIPgetNBinVars(targetscip) <= SCIPgetNIntVars(sourcescip) +
SCIPgetNBinVars(sourcescip) + nfixedbinvars + nfixedintvars' failed.

I get

SCIPgetNIntVars(sourcescip) + SCIPgetNBinVars(sourcescip) + nfixedbinvars +
nfixedintvars == 25093

and

SCIPgetNIntVars(targetscip) + SCIPgetNBinVars(targetscip) == 27366

After the presolving, the problem has 2273 binary variables, which is
exactly the difference here.
I figured out that the problem occurs in scip.c, l. 1966:

/* create problem in the target SCIP and copying the source problem data */
SCIP_CALL( SCIPcopyProb(sourcescip, targetscip, localvarmap, localconsmap,
global, name) );

/* copy all active variables */
SCIP_CALL( SCIPcopyVars(sourcescip, targetscip, localvarmap, localconsmap,
global) );

The call to SCIPcopyProb() calls my scip_copy() callback and copies all the
variables, and the subsequent call to SCIPcopyVars() copies the active
variables *again*.
Now I don't really know what to do. The TSP example is the only one I am
aware of that implements the scip_copy() callback in the ProbData class,
and I did it just like it is
done there.

Any suggestions?

Thanks in advance

  Daniel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listserv.zib.de/mailman/private/scip/attachments/20111220/fb85dc63/attachment.html


More information about the Scip mailing list