68#define SEPA_NAME "disjunctive"
69#define SEPA_DESC "disjunctive cut separator"
70#define SEPA_PRIORITY 10
72#define SEPA_MAXBOUNDDIST 0.0
74#define SEPA_USESSUBSCIP FALSE
75#define SEPA_DELAY TRUE
77#define DEFAULT_MAXRANK 20
78#define DEFAULT_MAXRANKINTEGRAL -1
79#define DEFAULT_MAXWEIGHTRANGE 1e+03
80#define DEFAULT_STRENGTHEN TRUE
82#define DEFAULT_MAXDEPTH -1
83#define DEFAULT_MAXROUNDS 25
84#define DEFAULT_MAXROUNDSROOT 100
85#define DEFAULT_MAXINVCUTS 50
86#define DEFAULT_MAXINVCUTSROOT 250
87#define DEFAULT_MAXCONFSDELAY 100000
89#define MAKECONTINTEGRAL FALSE
131 for (
r = 0;
r < nrows; ++
r)
135 val =
REALABS(binvrow[
r] * rowsmaxval[
r]);
141 for (
r = 0;
r < nrows; ++
r)
146 val =
REALABS(binvrow[
r] * rowsmaxval[
r]);
148 if ( rank > maxrank &&
SCIPisGT(
scip, val * maxweightrange, maxweight) )
184 for (
c = 0;
c < ncols; ++
c)
191 simplexcoefs[(*nonbasicnumber)++] = coef[
c];
195 for (
r = 0;
r < nrows; ++
r)
205 simplexcoefs[(*nonbasicnumber)++] = binvrow[
r];
247 int nonbasicnumber = 0;
263 *madeintegral =
FALSE;
276 cutlhs = sgn * cutlhs1 * cutlhs2;
279 for (
c = 0;
c < ncols; ++
c)
297 mval = (cutlhs2 * simplexcoefs1[nonbasicnumber] - cutlhs1 * simplexcoefs2[nonbasicnumber]) / (cutlhs2 * bound1 + cutlhs1 * bound2);
301 cutcoefs[ind] =
MIN(sgn * cutlhs2 * (simplexcoefs1[nonbasicnumber] - mvalfloor * bound1), sgn * cutlhs1 * (simplexcoefs2[nonbasicnumber] + mvalceil * bound2));
302 assert(
SCIPisFeasLE(
scip, cutcoefs[ind],
MAX(sgn * cutlhs2 * simplexcoefs1[nonbasicnumber], sgn * cutlhs1 * simplexcoefs2[nonbasicnumber])) );
305 cutcoefs[ind] =
MAX(sgn * cutlhs2 * simplexcoefs1[nonbasicnumber], sgn * cutlhs1 * simplexcoefs2[nonbasicnumber]);
307 cutlhs += cutcoefs[ind] * lb;
321 mval = (cutlhs2 * simplexcoefs1[nonbasicnumber] - cutlhs1 * simplexcoefs2[nonbasicnumber]) / (cutlhs2 * bound1 + cutlhs1 * bound2);
325 cutcoefs[ind] =
MAX(sgn * cutlhs2 * (simplexcoefs1[nonbasicnumber] + mvalfloor * bound1), sgn * cutlhs1 * (simplexcoefs2[nonbasicnumber] - mvalceil * bound2));
326 assert(
SCIPisFeasLE(
scip, -cutcoefs[ind], -
MIN(sgn * cutlhs2 * simplexcoefs1[nonbasicnumber], sgn * cutlhs1 * simplexcoefs2[nonbasicnumber])) );
329 cutcoefs[ind] =
MIN(sgn * cutlhs2 * simplexcoefs1[nonbasicnumber], sgn * cutlhs1 * simplexcoefs2[nonbasicnumber]);
331 cutlhs += cutcoefs[ind] * ub;
342 for (
r = 0;
r < nrows; ++
r)
359 cutcoef =
MAX(sgn * cutlhs2 * simplexcoefs1[nonbasicnumber], sgn * cutlhs1 * simplexcoefs2[nonbasicnumber]);
360 cutlhs -= cutcoef * rhsrow;
368 cutcoef =
MIN(sgn * cutlhs2 * simplexcoefs1[nonbasicnumber], sgn * cutlhs1 * simplexcoefs2[nonbasicnumber]);
369 cutlhs -= cutcoef * lhsrow;
377 for (
c = 0;
c < rownnonz; ++
c)
388 cutcoefs[ind] -= cutcoef * rowvals[
c];
400 for (
c = 0;
c < ncols; ++
c)
509 int* fixings1 =
NULL;
510 int* fixings2 =
NULL;
511 int* basisind =
NULL;
512 int* basisrow =
NULL;
514 int* edgearray =
NULL;
556 if ( ncols == 0 || nrows == 0 )
568 if ( conshdlr ==
NULL )
590 if( conflictgraph ==
NULL )
603 sepadata->lastncutsfound = ncutsfound;
610 for (j = 0; j < ncols; ++j)
617 for (j = 0; j < nrows; ++j)
639 for (j = 0; j < nsos1vars; ++j)
654 for (
i = 0;
i < nsucc; ++
i)
664 fixings1[nrelevantedges] = j;
665 fixings2[nrelevantedges] = succind;
666 edgearray[nrelevantedges] = nrelevantedges;
674 if ( nrelevantedges > 0)
689 maxcuts =
MIN(
sepadata->maxinvcutsroot, nrelevantedges);
691 maxcuts =
MIN(
sepadata->maxinvcuts, nrelevantedges);
710 for (j = 0; j < nrows; ++j)
731 for (
i = 0;
i < nnonz; ++
i)
742 rowsmaxval[j] =
MAX(max, 1.0);
746 for (j = 0; j < ncols; ++j)
754 for (
i = 0;
i < maxcuts; ++
i)
770 edgenumber = edgearray[
i];
787 if ( varrank[ind] < 0 )
789 cutrank =
MAX(cutrank, varrank[ind]);
813 if ( varrank[ind] < 0 )
815 cutrank =
MAX(cutrank, varrank[ind]);
825 SCIP_CALL(
generateDisjCutSOS1(
scip, sepa,
depth, rows, nrows, cols, ncols, ndisjcuts,
MAKECONTINTEGRAL,
sepadata->strengthen, cutlhs1, cutlhs2, bound1, bound2, simplexcoefs1, simplexcoefs2, cutcoefs, &row, &madeintegral) );
833 if ( ( madeintegral && (
sepadata->maxrankintegral == -1 || cutrank <= sepadata->maxrankintegral ) )
834 || ( ! madeintegral && (
sepadata->maxrank == -1 || cutrank <= sepadata->maxrank ) ) )
918 "strengthen cut if integer variables are present.",
922 "node depth of separating bipartite disjunctive cuts (-1: no limit)",
926 "maximal number of separation rounds per iteration in a branching node (-1: no limit)",
930 "maximal number of separation rounds in the root node (-1: no limit)",
934 "maximal number of cuts investigated per iteration in a branching node",
938 "maximal number of cuts investigated per iteration in the root node",
942 "delay separation if number of conflict graph edges is larger than predefined value (-1: no limit)",
946 "maximal rank of a disj. cut that could not be scaled to integral coefficients (-1: unlimited)",
950 "maximal rank of a disj. cut that could be scaled to integral coefficients (-1: unlimited)",
954 "maximal valid range max(|weights|)/min(|weights|) of row weights",
#define DEFAULT_MAXROUNDSROOT
#define DEFAULT_MAXROUNDS
#define DEFAULT_STRENGTHEN
constraint handler for SOS type 1 constraints
#define SCIP_STRINGEQ(name, reference, retcode)
#define SCIP_LONGINT_FORMAT
SCIP_DIGRAPH * SCIPgetConflictgraphSOS1(SCIP_CONSHDLR *conshdlr)
int SCIPgetNSOS1Vars(SCIP_CONSHDLR *conshdlr)
SCIP_VAR * SCIPnodeGetVarSOS1(SCIP_DIGRAPH *conflictgraph, int node)
int SCIPdigraphGetNSuccessors(SCIP_DIGRAPH *digraph, int node)
int SCIPdigraphGetNArcs(SCIP_DIGRAPH *digraph)
int * SCIPdigraphGetSuccessors(SCIP_DIGRAPH *digraph, int node)
SCIP_Bool SCIPisStopped(SCIP *scip)
SCIP_RETCODE SCIPaddIntParam(SCIP *scip, const char *name, const char *desc, int *valueptr, SCIP_Bool isadvanced, int defaultvalue, int minvalue, int maxvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
SCIP_RETCODE SCIPaddRealParam(SCIP *scip, const char *name, const char *desc, SCIP_Real *valueptr, SCIP_Bool isadvanced, SCIP_Real defaultvalue, SCIP_Real minvalue, SCIP_Real maxvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
SCIP_RETCODE SCIPaddBoolParam(SCIP *scip, const char *name, const char *desc, SCIP_Bool *valueptr, SCIP_Bool isadvanced, SCIP_Bool defaultvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
int SCIPcolGetLPPos(SCIP_COL *col)
SCIP_VAR * SCIPcolGetVar(SCIP_COL *col)
SCIP_Bool SCIPcolIsIntegral(SCIP_COL *col)
SCIP_Real SCIPcolGetLb(SCIP_COL *col)
SCIP_Real SCIPcolGetPrimsol(SCIP_COL *col)
SCIP_Real SCIPcolGetUb(SCIP_COL *col)
SCIP_BASESTAT SCIPcolGetBasisStatus(SCIP_COL *col)
int SCIPconshdlrGetNConss(SCIP_CONSHDLR *conshdlr)
SCIP_CONSHDLR * SCIPfindConshdlr(SCIP *scip, const char *name)
SCIP_Bool SCIPisCutEfficacious(SCIP *scip, SCIP_SOL *sol, SCIP_ROW *cut)
SCIP_RETCODE SCIPaddRow(SCIP *scip, SCIP_ROW *row, SCIP_Bool forcecut, SCIP_Bool *infeasible)
SCIP_RETCODE SCIPgetLPBasisInd(SCIP *scip, int *basisind)
SCIP_RETCODE SCIPgetLPColsData(SCIP *scip, SCIP_COL ***cols, int *ncols)
SCIP_RETCODE SCIPgetLPRowsData(SCIP *scip, SCIP_ROW ***rows, int *nrows)
SCIP_RETCODE SCIPgetLPBInvARow(SCIP *scip, int r, SCIP_Real *binvrow, SCIP_Real *coefs, int *inds, int *ninds)
SCIP_LPSOLSTAT SCIPgetLPSolstat(SCIP *scip)
SCIP_Bool SCIPisLPSolBasic(SCIP *scip)
SCIP_RETCODE SCIPgetLPBInvRow(SCIP *scip, int r, SCIP_Real *coefs, int *inds, int *ninds)
#define SCIPallocBufferArray(scip, ptr, num)
#define SCIPfreeBlockMemory(scip, ptr)
#define SCIPfreeBufferArrayNull(scip, ptr)
#define SCIPallocBlockMemory(scip, ptr)
SCIP_Real SCIProwGetLhs(SCIP_ROW *row)
SCIP_RETCODE SCIPcacheRowExtensions(SCIP *scip, SCIP_ROW *row)
int SCIProwGetNNonz(SCIP_ROW *row)
SCIP_COL ** SCIProwGetCols(SCIP_ROW *row)
SCIP_Real SCIPgetRowLPActivity(SCIP *scip, SCIP_ROW *row)
SCIP_Real SCIProwGetRhs(SCIP_ROW *row)
SCIP_RETCODE SCIPflushRowExtensions(SCIP *scip, SCIP_ROW *row)
SCIP_RETCODE SCIPmakeRowIntegral(SCIP *scip, SCIP_ROW *row, SCIP_Real mindelta, SCIP_Real maxdelta, SCIP_Longint maxdnom, SCIP_Real maxscale, SCIP_Bool usecontvars, SCIP_Bool *success)
SCIP_RETCODE SCIPaddVarToRow(SCIP *scip, SCIP_ROW *row, SCIP_VAR *var, SCIP_Real val)
SCIP_RETCODE SCIPprintRow(SCIP *scip, SCIP_ROW *row, FILE *file)
SCIP_RETCODE SCIPreleaseRow(SCIP *scip, SCIP_ROW **row)
SCIP_RETCODE SCIPcreateEmptyRowSepa(SCIP *scip, SCIP_ROW **row, SCIP_SEPA *sepa, const char *name, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool removable)
int SCIProwGetRank(SCIP_ROW *row)
void SCIProwChgRank(SCIP_ROW *row, int rank)
SCIP_Real SCIProwGetConstant(SCIP_ROW *row)
SCIP_Bool SCIProwIsInLP(SCIP_ROW *row)
SCIP_Real * SCIProwGetVals(SCIP_ROW *row)
SCIP_BASESTAT SCIProwGetBasisStatus(SCIP_ROW *row)
SCIP_RETCODE SCIPincludeSepaBasic(SCIP *scip, SCIP_SEPA **sepa, const char *name, const char *desc, int priority, int freq, SCIP_Real maxbounddist, SCIP_Bool usessubscip, SCIP_Bool delay, SCIP_DECL_SEPAEXECLP((*sepaexeclp)), SCIP_DECL_SEPAEXECSOL((*sepaexecsol)), SCIP_SEPADATA *sepadata)
SCIP_RETCODE SCIPsetSepaFree(SCIP *scip, SCIP_SEPA *sepa,)
const char * SCIPsepaGetName(SCIP_SEPA *sepa)
int SCIPsepaGetNCallsAtNode(SCIP_SEPA *sepa)
SCIP_Bool SCIPsepaWasLPDelayed(SCIP_SEPA *sepa)
SCIP_RETCODE SCIPsetSepaInitsol(SCIP *scip, SCIP_SEPA *sepa,)
SCIP_SEPADATA * SCIPsepaGetData(SCIP_SEPA *sepa)
SCIP_RETCODE SCIPsetSepaCopy(SCIP *scip, SCIP_SEPA *sepa,)
SCIP_Real SCIPgetSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var)
SCIP_Longint SCIPgetNLPs(SCIP *scip)
int SCIPgetNCutsFound(SCIP *scip)
SCIP_Real SCIPinfinity(SCIP *scip)
SCIP_Bool SCIPisFeasZero(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPfloor(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisInfinity(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisFeasLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisNegative(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPceil(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisFeasGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Real SCIPepsilon(SCIP *scip)
SCIP_Real SCIPsumepsilon(SCIP *scip)
SCIP_Bool SCIPisFeasPositive(SCIP *scip, SCIP_Real val)
SCIP_COL * SCIPvarGetCol(SCIP_VAR *var)
SCIP_Bool SCIPvarIsActive(SCIP_VAR *var)
SCIP_RETCODE SCIPincludeSepaDisjunctive(SCIP *scip)
void SCIPsortDownRealInt(SCIP_Real *realarray, int *intarray, int len)
int SCIPsnprintf(char *t, int len, const char *s,...)
assert(minobj< SCIPgetCutoffbound(scip))
memory allocation routines
public methods for managing constraints
public methods for LP management
public methods for message output
public data structures and miscellaneous methods
methods for sorting joint arrays of various types
public methods for separators
public methods for problem variables
public methods for constraint handler plugins and constraints
public methods for cuts and aggregation rows
public methods for the LP relaxation, rows and columns
public methods for memory management
public methods for message handling
public methods for numerical tolerances
public methods for SCIP parameter handling
public methods for separator plugins
public methods for solutions
public methods for querying solving statistics
public methods for the branch-and-bound tree
#define SEPA_MAXBOUNDDIST
#define DEFAULT_MAXINVCUTS
#define DEFAULT_MAXWEIGHTRANGE
#define DEFAULT_MAXINVCUTSROOT
#define DEFAULT_MAXRANKINTEGRAL
#define DEFAULT_MAXCONFSDELAY
SCIPsepaSetData(sepa, NULL)
static SCIP_RETCODE getSimplexCoefficients(SCIP *scip, SCIP_ROW **rows, int nrows, SCIP_COL **cols, int ncols, SCIP_Real *coef, SCIP_Real *binvrow, SCIP_Real *simplexcoefs, int *nonbasicnumber)
static SCIP_RETCODE generateDisjCutSOS1(SCIP *scip, SCIP_SEPA *sepa, int depth, SCIP_ROW **rows, int nrows, SCIP_COL **cols, int ncols, int ndisjcuts, SCIP_Bool scale, SCIP_Bool strengthen, SCIP_Real cutlhs1, SCIP_Real cutlhs2, SCIP_Real bound1, SCIP_Real bound2, SCIP_Real *simplexcoefs1, SCIP_Real *simplexcoefs2, SCIP_Real *cutcoefs, SCIP_ROW **row, SCIP_Bool *madeintegral)
static int getVarRank(SCIP *scip, SCIP_Real *binvrow, SCIP_Real *rowsmaxval, SCIP_Real maxweightrange, SCIP_ROW **rows, int nrows)
disjunctive cut separator
struct SCIP_Conshdlr SCIP_CONSHDLR
struct SCIP_Digraph SCIP_DIGRAPH
enum SCIP_Retcode SCIP_RETCODE
struct SCIP_SepaData SCIP_SEPADATA
#define SCIP_DECL_SEPAEXECLP(x)
#define SCIP_DECL_SEPAFREE(x)
#define SCIP_DECL_SEPAEXITSOL(x)
struct SCIP_Sepa SCIP_SEPA
#define SCIP_DECL_SEPACOPY(x)