[Scip] Could a global cut be discarded ?

nikolaj@crt.umontreal.ca nikolaj at crt.umontreal.ca
Thu Jul 2 00:49:32 MEST 2009


Hello everybody,

Thanks for your precious help last time.

In a branch and cut, I add several global cuts in a separator. For one
graph, I've found that after I add one global cut, it was discovered again
two times. When I print the added cuts with SCIPprintRow I get exactly the
same cut. Could a global cut be discarded or else where did I go wrong?

Here is how I add the global cut (in the method scip_execlp) :

------------------------------------
SCIP_ROW* cut;
std::ostringstream namebuf;

assert(sepa != NULL);
assert(strcmp(SCIPsepaGetName(sepa), this->scip_name_) == 0);
assert(scip != NULL);
assert(result != NULL);

*result = SCIP_DIDNOTRUN;

//only call separator, if an optimal LP solution is at hand
if( SCIPgetLPSolstat(scip) != SCIP_LPSOLSTAT_OPTIMAL ) {
  return SCIP_OKAY;
}

*result = SCIP_DIDNOTFIND;

//main loop
//omitted here

//create cut
namebuf.str("");
namebuf << "generalized_odd_cut";
SCIP_CALL_EXC( SCIPcreateEmptyRow(scip, &cut, namebuf.str().c_str(), 1.0,
SCIPinfinity(scip),FALSE, FALSE, FALSE) );
SCIP_CALL_EXC( SCIPcacheRowExtensions(scip, cut) );

//populate cut
//loops omitted here, I add variables in the cut with:
SCIP_CALL_EXC( SCIPaddVarToRow(scip, cut, model_->y_[*u_iter][*v_iter][k],
1.0) );

SCIP_CALL_EXC( SCIPflushRowExtensions(scip, cut) );
SCIP_CALL_EXC( SCIPaddCut(scip, NULL, cut, TRUE) );
SCIP_CALL_EXC( SCIPaddPoolCut(scip, cut) );

SCIPprintRow(scip,cut,NULL);

*result = SCIP_SEPARATED;

SCIP_CALL_EXC( SCIPreleaseRow(scip, &cut) );
------------------------------------


Any help would be much appreciated.

Best regards,

Nikolaj





More information about the Scip mailing list