[Scip] Column generation method (binpacking example)

Luigi Malagò luigi.malago at gmail.com
Fri Aug 19 15:30:04 MEST 2011


Hi list,

1) this is my question. i'm studying the binpacking example provided in the
documentation, since i have to implement a column generation
method to a problem which is similar in principle to binpacking.

right now i'm going through the function
SCIP_DECL_PRICERREDCOST(pricerRedcostBinpacking)

i added the following code, after the pricing problem has been solved and
before adding to the master the new variable

--------------------------------------------------------------------------
sol = SCIPgetBestSol(subscip);
addvar = FALSE;

SCIP_CALL( SCIPprintOrigProblem(scip, NULL, NULL, FALSE) );
SCIP_CALL( SCIPprintBestSol(scip, NULL, FALSE) );
SCIP_CALL( SCIPprintBestSol(subscip, NULL, FALSE) );

if( sol != NULL )

........
--------------------------------------------------------------------------

what i observe is the following:
when i print the BestSol of the master problem from one iteration to the
next,
the solution changes, since new variables are added, and the enter the
solution. this is as expected
at each iteration the pricing solution is different, and a new variable is
aded to the problem. this is as expected

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)

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?

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?

thanks alot,
luigi malagò

-
Luigi Malagò, Ph.D. Student
AIRLab - Artificial Intelligence and Robotics Laboratory
Dipartimento di Elettronica e Informazione
Politecnico di Milano, Italy
Office:    +39 02 2399 4031
Lab:       +39 02 2399 9606
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listserv.zib.de/mailman/private/scip/attachments/20110819/cf8d0b34/attachment.html


More information about the Scip mailing list