[SCIP] Missing variable
Mahdi Noorizadegan
m.noorizadegan at gmail.com
Fri Mar 4 00:22:33 CET 2022
Hi Scipers,
I am writing a branch and price model using VRP example as template.
I have two vectors of variables and two constraints defined in the master problem and new variables are added in the pricer.
I can see both variables in the lp file created in the master problem but some variables are missing in the lp file created in pricer.
Below are the definitions for variables (partly lost in the pricer) and the constraint.
What could be the problem and how can I fix it?
I would appreciate it if you could help me to fix this.
Best,
Mahdi
vector<vector<SCIP_VAR* > >q( n );
for (int l=0; l<n; ++l) {
q[l].resize(n_d);
i
for (int d=0; d<n_d; ++d) {
SCIP_VAR* var;
(void) SCIPsnprintf(var_name, 255, "q_%d_%d”, l,d);
SCIP_CALL( SCIPcreateVar(scip,
&var, // returns new index
var_name, // name
0.0, // lower bound
1.0, // upper bound
0, // objective
SCIP_VARTYPE_INTEGER, // variable type
true, // initial
false, // forget the rest ...
NULL, NULL, NULL, NULL, NULL) );
SCIP_CALL( SCIPaddVar(scip, var) );
q[l][d] = var;
}
}
vector<vector<SCIP_CONS*> > AR(n);
for (int l = 0; l < n; ++l)
{
ActivityRoom1[l].resize(n_d );
for (int d = 0; d < n_d; ++d)
{
SCIP_CONS* con;
(void) SCIPsnprintf(con_name, 255, “AR%d_%d", l,d);
SCIP_CALL( SCIPcreateConsLinear(scip, &con, con_name, 0, 0, 0,
-SCIPinfinity(scip), /* lhs */
0, /* rhs */
true, /* initial */
false, /* separate */
true, /* enforce */
true, /* check */
true, /* propagate */
false, /* local */
true, /* modifiable */
false, /* dynamic */
false, /* removable */
false) ); /* stickingatnode */
SCIP_CALL( SCIPaddCons(scip, con) );
AR[l][d] = con;
SCIP_CALL( SCIPaddCoefLinear(scip, con, q[l][d] , -1.0) );
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.zib.de/pipermail/scip/attachments/20220303/2beb6780/attachment.html>
More information about the Scip
mailing list