[SCIP] Help for Diagnosing Disabled Constraints in Branch-and-Price Model

Mahdi Mohammadi mo.mahdi1379 at gmail.com
Mon Dec 23 17:40:31 CET 2024


Dear SCIP Support Team,

I hope this email finds you well. I am reaching out regarding an issue I’ve
encountered in my branch-and-price implementation in SCIP. My
implementation is based on the bin packing project, and I have made minimal
modifications as my problem structure is nearly identical to the original
(see the attached PDF).

The issue arises in *pricing **problem*, some of my *Master
Problem constraints* are *unexpectedly disabled after a few iterations*.
This leads to their exclusion during the initialization of the pricing
problem and affects its correctness (see the attached PDF).
To investigate, I added a printf in the initPricing method where it compute
the dual variable of the master problem:
for (c = 0; c < n_edges; ++c) {
cons = conss[c];  assert(!strncmp(SCIPconshdlrGetName(SCIPconsGetHdlr(cons)),
"setppc", 6));
 if (!SCIPconsIsEnabled(cons)) {
           *printf("cons: %s was disabled\n", SCIPconsGetName(cons));*
          continue; }
...

      /* dual value in original SCIP */

      dual = isfarkas ? SCIPgetDualfarkasSetppc(scip, cons) :
SCIPgetDualsolSetppc(scip, cons);
...

 }
Using this, I found that two of the master problem constraints are disabled
and skipped during initialization. I have not modified the cons_samediff or
branchryanfoster logic, assuming they would work as expected given the
similarity to the bin packing problem.

Could you please help me identify the root cause of these constraints being
disabled and suggest a resolution? Is it because of cons_samediff  or
branchryanfoster?

Thank you for your time and expertise.

Best regards,
Mahdi

PS:
I have also attached a abstraction of initPricing method implementation
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.zib.de/pipermail/scip/attachments/20241223/e0c17421/attachment.html>
-------------- next part --------------
/** initializes the pricing problem for the given capacity */
static
SCIP_RETCODE initPricing(
   SCIP*                 scip,               /**< SCIP data structure */
   SCIP_PRICERDATA*      pricerdata,         /**< pricer data */
   SCIP_Bool             isfarkas,           /**< whether we perform Farkas pricing */
   SCIP*                 subscip,            /**< pricing SCIP data structure */
   SCIP_VAR**            vars                /**< variable array for the items */
   )
{
	// Initializing and allocating buffer

   /* create for each order, which is not assigned yet, a variable with objective coefficient */
   for( c = 0; c < n_edges; ++c )
   {
      cons = conss[c];

      /* check if each constraint is setppc constraint */
      assert( !strncmp( SCIPconshdlrGetName( SCIPconsGetHdlr(cons) ), "setppc", 6) );

      /* constraints which are (locally) disabled/redundant are not of
       * interest since the corresponding job is assigned to a packing
       */
      if (!SCIPconsIsEnabled(cons))
      {
	// Here I discovered the problem
          printf("cons: %s was disabled\n",SCIPconsGetName(cons));
          continue;
      }
         
      if( SCIPgetNFixedonesSetppc(scip, cons) == 1 )
      {
         /* disable constraint locally */
         SCIP_CALL( SCIPdelConsLocal(scip, cons) );
         continue;
      }

      /* dual value in original SCIP */
      dual = isfarkas ? SCIPgetDualfarkasSetppc(scip, cons) : SCIPgetDualsolSetppc(scip, cons);
      SCIP_CALL( SCIPcreateVarBasic(subscip, &var, SCIPconsGetName(cons), 0.0, 1.0, dual, SCIP_VARTYPE_BINARY) );
      SCIP_CALL( SCIPaddVar(subscip, var) );

      vals[nvars] = 1;
      vars[nvars] = var;
      nvars++;

      /* release variable */
      SCIP_CALL( SCIPreleaseVar(subscip, &var) );
   }
   /* create capacity constraint */
   SCIPcreateConsBasicLinear(subscip, &cons, "esum", nvars, vars, vals, capacity, capacity);

   SCIP_CALL( SCIPaddCons(subscip, cons) );
   SCIP_CALL( SCIPreleaseCons(subscip, &cons) );

   /* add constraint of the branching decisions */
   SCIP_CALL( addBranchingDecisionConss(scip, subscip, vars, pricerdata->conshdlr) );

   /* avoid to generate columns which are fixed to zero */
   SCIP_CALL( addFixedVarsConss(scip, subscip, vars, conss, n_edges) );
   
   return SCIP_OKAY;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Model-Attachment.pdf
Type: application/pdf
Size: 106781 bytes
Desc: not available
URL: <http://listserv.zib.de/pipermail/scip/attachments/20241223/e0c17421/attachment.pdf>


More information about the Scip mailing list