44#define CUTSEL_NAME "hybrid"
45#define CUTSEL_DESC "weighted sum of efficacy, dircutoffdist, objparal, and intsupport"
46#define CUTSEL_PRIORITY 8000
48#define RANDSEED 0x5EED
52#define DEFAULT_EFFICACYWEIGHT 1.0
53#define DEFAULT_DIRCUTOFFDISTWEIGHT 0.0
54#define DEFAULT_OBJPARALWEIGHT 0.1
55#define DEFAULT_INTSUPPORTWEIGHT 0.1
56#define DEFAULT_MINORTHO 0.90
57#define DEFAULT_MINORTHOROOT 0.90
104 if(
sol !=
NULL && dircutoffdistweight > 0.0 )
106 for(
i = 0;
i < ncuts; ++
i )
113 if( intsupportweight > 0.0 )
118 if( objparalweight > 0.0 )
121 objparallelism = 0.0;
127 score = dircutoffdistweight * efficacy;
132 score = dircutoffdistweight *
MAX(score, efficacy);
135 efficacy *= efficacyweight;
136 score += objparallelism + intsupport + efficacy;
142 if( randnumgen !=
NULL )
147 maxscore =
MAX(maxscore, score);
158 efficacyweight += dircutoffdistweight;
159 for(
i = 0;
i < ncuts; ++
i )
166 if( intsupportweight > 0.0 )
171 if( objparalweight > 0.0 )
174 objparallelism = 0.0;
178 score = objparallelism + intsupport + efficacy;
184 if( randnumgen !=
NULL )
189 maxscore =
MAX(maxscore, score);
215 bestscore = scores[0];
218 for(
i = 1;
i < ncuts; ++
i )
220 if( scores[
i] > bestscore )
223 bestscore = scores[
i];
250 for(
i = ncuts - 1;
i >= 0; --
i )
256 thismaxparall = scores[
i] >= goodscore ? goodmaxparall : maxparall;
258 if( thisparall > thismaxparall )
351 SCIP_Real minortho = cutseldata->minortho;
353 minortho = cutseldata->minorthoroot;
355 maxparall = 1.0 - minortho;
356 goodmaxparall =
MAX(0.5, 1.0 - minortho);
359 goodmaxparall, maxparall, cutseldata->dircutoffdistweight, cutseldata->efficacyweight,
360 cutseldata->objparalweight, cutseldata->intsupportweight, ncuts, nforcedcuts, maxnselectedcuts, nselectedcuts) );
399 "weight of efficacy in cut score calculation",
403 "cutselection/" CUTSEL_NAME "/dircutoffdistweight",
404 "weight of directed cutoff distance in cut score calculation",
409 "weight of objective parallelism in cut score calculation",
414 "weight of integral support in cut score calculation",
419 "minimal orthogonality for a cut to enter the LP",
424 "minimal orthogonality for a cut to enter the LP in the root node",
468 assert(forcedcuts !=
NULL || nforcedcuts == 0);
476 maxforcedscores =
scoring(
scip, forcedcuts, randnumgen, dircutoffdistweight, efficacyweight, objparalweight, intsupportweight, nforcedcuts,
NULL);
477 maxnonforcedscores =
scoring(
scip, cuts, randnumgen, dircutoffdistweight, efficacyweight, objparalweight, intsupportweight, ncuts, scores);
479 goodscore =
MAX(maxforcedscores, maxnonforcedscores);
482 badscore = goodscore * badscorefac;
483 goodscore *= goodscorefac;
500 selectedcut = cuts[0];
503 if( scores[0] < badscore )
509 if( *nselectedcuts == maxselectedcuts )
517 ncuts =
filterWithParallelism(selectedcut, cuts, scores, ncuts, goodscore, goodmaxparall, maxparall);
#define DEFAULT_EFFICACYWEIGHT
#define DEFAULT_INTSUPPORTWEIGHT
#define DEFAULT_OBJPARALWEIGHT
#define DEFAULT_DIRCUTOFFDISTWEIGHT
static int filterWithParallelism(SCIP_ROW *cut, SCIP_ROW **cuts, SCIP_Real *scores, int ncuts, SCIP_Real goodscore, SCIP_Real goodmaxparall, SCIP_Real maxparall)
static SCIP_Real scoring(SCIP *scip, SCIP_ROW **cuts, SCIP_RANDNUMGEN *randnumgen, SCIP_Real dircutoffdistweight, SCIP_Real efficacyweight, SCIP_Real objparalweight, SCIP_Real intsupportweight, int ncuts, SCIP_Real *scores)
static void selectBestCut(SCIP_ROW **cuts, SCIP_Real *scores, int ncuts)
#define DEFAULT_MINORTHOROOT
SCIP_RETCODE SCIPselectCutsHybrid(SCIP *scip, SCIP_ROW **cuts, SCIP_ROW **forcedcuts, SCIP_RANDNUMGEN *randnumgen, SCIP_Real goodscorefac, SCIP_Real badscorefac, SCIP_Real goodmaxparall, SCIP_Real maxparall, SCIP_Real dircutoffdistweight, SCIP_Real efficacyweight, SCIP_Real objparalweight, SCIP_Real intsupportweight, int ncuts, int nforcedcuts, int maxselectedcuts, int *nselectedcuts)
SCIP_RETCODE SCIPincludeCutselHybrid(SCIP *scip)
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)
void SCIPswapPointers(void **pointer1, void **pointer2)
void SCIPswapReals(SCIP_Real *value1, SCIP_Real *value2)
SCIP_Real SCIPgetCutEfficacy(SCIP *scip, SCIP_SOL *sol, SCIP_ROW *cut)
SCIP_Real SCIPgetCutLPSolCutoffDistance(SCIP *scip, SCIP_SOL *sol, SCIP_ROW *cut)
SCIP_RETCODE SCIPsetCutselInit(SCIP *scip, SCIP_CUTSEL *cutsel,)
SCIP_RETCODE SCIPincludeCutselBasic(SCIP *scip, SCIP_CUTSEL **cutsel, const char *name, const char *desc, int priority, SCIP_DECL_CUTSELSELECT((*cutselselect)), SCIP_CUTSELDATA *cutseldata)
SCIP_RETCODE SCIPsetCutselCopy(SCIP *scip, SCIP_CUTSEL *cutsel,)
SCIP_RETCODE SCIPsetCutselExit(SCIP *scip, SCIP_CUTSEL *cutsel,)
SCIP_CUTSELDATA * SCIPcutselGetData(SCIP_CUTSEL *cutsel)
void SCIPcutselSetData(SCIP_CUTSEL *cutsel, SCIP_CUTSELDATA *cutseldata)
const char * SCIPcutselGetName(SCIP_CUTSEL *cutsel)
SCIP_RETCODE SCIPsetCutselFree(SCIP *scip, SCIP_CUTSEL *cutsel,)
#define SCIPallocBufferArray(scip, ptr, num)
#define SCIPfreeBufferArray(scip, ptr)
#define SCIPfreeBlockMemory(scip, ptr)
#define SCIPallocBlockMemory(scip, ptr)
SCIP_Real SCIProwGetParallelism(SCIP_ROW *row1, SCIP_ROW *row2, char orthofunc)
int SCIProwGetNNonz(SCIP_ROW *row)
SCIP_Bool SCIProwIsInGlobalCutpool(SCIP_ROW *row)
SCIP_Bool SCIProwIsLocal(SCIP_ROW *row)
SCIP_Real SCIPgetRowObjParallelism(SCIP *scip, SCIP_ROW *row)
int SCIPgetRowNumIntCols(SCIP *scip, SCIP_ROW *row)
SCIP_SOL * SCIPgetBestSol(SCIP *scip)
SCIP_Real SCIPrandomGetReal(SCIP_RANDNUMGEN *randnumgen, SCIP_Real minrandval, SCIP_Real maxrandval)
SCIPfreeRandom(scip, &heurdata->randnumgen)
SCIPcreateRandom(scip, &heurdata->randnumgen, DEFAULT_RANDSEED, TRUE))
assert(minobj< SCIPgetCutoffbound(scip))
#define BMSclearMemory(ptr)
public methods for cuts and aggregation rows
public methods for cut selector plugins
public methods for the LP relaxation, rows and columns
public methods for random numbers
#define SCIP_DECL_CUTSELEXIT(x)
#define SCIP_DECL_CUTSELSELECT(x)
#define SCIP_DECL_CUTSELFREE(x)
struct SCIP_Cutsel SCIP_CUTSEL
struct SCIP_CutselData SCIP_CUTSELDATA
#define SCIP_DECL_CUTSELINIT(x)
#define SCIP_DECL_CUTSELCOPY(x)
struct SCIP_RandNumGen SCIP_RANDNUMGEN
enum SCIP_Retcode SCIP_RETCODE