[SCIP] Missing variable

Ambros Gleixner gleixner at zib.de
Wed Mar 9 15:02:38 CET 2022


Hi Mahdi,

One thought: Could it be that some variables appear in none of the 
constraints?  In this case, SCIP would remove them during presolving.

Best,
Ambros


Am 04.03.22 um 00:22 schrieb Mahdi Noorizadegan:
> 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(intl=0; l<n; ++l) {
>          q[l].resize(n_d);
> i
> for(intd=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(intl = 0; l < n; ++l)
>      {
>          ActivityRoom1[l].resize(n_d  );
> for(intd = 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) );
>       }
> 
> 
> 
> _______________________________________________
> Scip mailing list
> Scip at zib.de
> https://listserv.zib.de/mailman/listinfo/scip


More information about the Scip mailing list