[Scip] Column generation method (binpacking example)
Gerald Gamrath
gamrath at zib.de
Fri Aug 19 19:06:38 MEST 2011
Hi Luigi,
> what i dont understand, is my when i print the master problem, i dont
> see the pricing variables i have added (i only see them in the
> solution, not in the problem definition)
This is because the original problem is not changed during the solving
process and the variables that are priced in are only added to the
transformed problem. Thus, in order to print out the problem, you should
use the method SCIPprintTransProblem().
> 2) second question:
> in my code, in pricerRedcostBinpacking, first i add the new pricing
> variable, and add it also to an existing constraint of the master
> problem with
>
> SCIP_CALL( SCIPaddPricedVar(scip, var, 1.0) );
>
> and
>
> for( v = 0; v < nconss; ++v ) {
> assert(SCIPconsIsEnabled(conss[consids[v]]));
> SCIPprintCons( scip, conss[consids[v]], NULL );
> SCIP_CALL( SCIPaddCoefSetppc(scip, conss[consids[v]], var) );
> SCIPprintCons( scip, conss[consids[v]], NULL );
> }
>
>
> but i ALSO add new variables (that are not new packings as in
> binpacking, but "auxiliary" variables) and new constraints that
> involve pricing variables and non other variables to the master problem
> in that case should i use SCIPaddVar and SCIPaddCons?
Yes, in this case, you should use SCIPaddVar() and SCIPaddCons().
> 3) can somebody explain be a little bit the meaning of SCIPconsIsEnabled.
> for example, in the for cycle above, why to check the constraint is
> enabled?
Constraints in SCIP can be locally (or globally) disabled, e.g. by
SCIPdelConsLocal(). In the binpacking example, the set covering
constraint which ensures that one item is assigned to at least one bin
is disabled whenever one packing containing this item is locally fixed
to one. This item is then also not respected in the pricing problem
anymore. At the lines that you mentioned, a variable was created for a
solution of the pricing problem (packing) and is added to the set
partitioning constraints which belong to items contained in the packing.
The item corresponding to a disabled constraint is not regarded in the
pricing problem and must thus not be contained in the packing,
therefore, all the constraints have to be enabled, which is just
asserted to ensure correctness.
Best,
Gerald
More information about the Scip
mailing list