42#define CUTSEL_NAME "hybrid"
43#define CUTSEL_DESC "weighted sum of efficacy, dircutoffdist, objparal, and intsupport"
44#define CUTSEL_PRIORITY 8000
46#define RANDSEED 0x5EED
50#define DEFAULT_EFFICACYWEIGHT 1.0
51#define DEFAULT_DIRCUTOFFDISTWEIGHT 0.0
52#define DEFAULT_OBJPARALWEIGHT 0.1
53#define DEFAULT_INTSUPPORTWEIGHT 0.1
54#define DEFAULT_MINORTHO 0.90
55#define DEFAULT_MINORTHOROOT 0.90
102 if(
sol !=
NULL && dircutoffdistweight > 0.0 )
104 for(
i = 0;
i < ncuts; ++
i )
111 if( intsupportweight > 0.0 )
116 if( objparalweight > 0.0 )
119 objparallelism = 0.0;
125 score = dircutoffdistweight * efficacy;
130 score = dircutoffdistweight *
MAX(score, efficacy);
133 efficacy *= efficacyweight;
134 score += objparallelism + intsupport + efficacy;
140 if( randnumgen !=
NULL )
145 maxscore =
MAX(maxscore, score);
156 efficacyweight += dircutoffdistweight;
157 for(
i = 0;
i < ncuts; ++
i )
164 if( intsupportweight > 0.0 )
169 if( objparalweight > 0.0 )
172 objparallelism = 0.0;
176 score = objparallelism + intsupport + efficacy;
182 if( randnumgen !=
NULL )
187 maxscore =
MAX(maxscore, score);
213 bestscore = scores[0];
216 for(
i = 1;
i < ncuts; ++
i )
218 if( scores[
i] > bestscore )
221 bestscore = scores[
i];
248 for(
i = ncuts - 1;
i >= 0; --
i )
254 thismaxparall = scores[
i] >= goodscore ? goodmaxparall : maxparall;
256 if( thisparall > thismaxparall )
350 SCIP_Real minortho = cutseldata->minortho;
352 minortho = cutseldata->minorthoroot;
354 maxparall = 1.0 - minortho;
355 goodmaxparall =
MAX(0.5, 1.0 - minortho);
358 goodmaxparall, maxparall, cutseldata->dircutoffdistweight, cutseldata->efficacyweight,
359 cutseldata->objparalweight, cutseldata->intsupportweight, ncuts, nforcedcuts, maxnselectedcuts, nselectedcuts) );
398 "weight of efficacy in cut score calculation",
402 "cutselection/" CUTSEL_NAME "/dircutoffdistweight",
403 "weight of directed cutoff distance in cut score calculation",
408 "weight of objective parallelism in cut score calculation",
413 "weight of integral support in cut score calculation",
418 "minimal orthogonality for a cut to enter the LP",
423 "minimal orthogonality for a cut to enter the LP in the root node",
467 assert(forcedcuts !=
NULL || nforcedcuts == 0);
475 maxforcedscores =
scoring(
scip, forcedcuts, randnumgen, dircutoffdistweight, efficacyweight, objparalweight, intsupportweight, nforcedcuts,
NULL);
476 maxnonforcedscores =
scoring(
scip, cuts, randnumgen, dircutoffdistweight, efficacyweight, objparalweight, intsupportweight, ncuts, scores);
478 goodscore =
MAX(maxforcedscores, maxnonforcedscores);
481 badscore = goodscore * badscorefac;
482 goodscore *= goodscorefac;
499 selectedcut = cuts[0];
502 if( scores[0] < badscore )
508 if( *nselectedcuts == maxselectedcuts )
516 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
#define SCIP_STRINGEQ(name, reference, retcode)
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