ensemble cut selector
Definition in file cutsel_ensemble.c.
#include <assert.h>
#include "scip/scip_cutsel.h"
#include "scip/scip_cut.h"
#include "scip/scip_lp.h"
#include "scip/scip_randnumgen.h"
#include "scip/cutsel_ensemble.h"
Go to the source code of this file.
Functions | |
static SCIP_RETCODE | scoring (SCIP *scip, SCIP_ROW **cuts, SCIP_CUTSELDATA *cutseldata, SCIP_Real *scores, SCIP_Bool root, int ncuts) |
static void | selectBestCut (SCIP_ROW **cuts, SCIP_Real *scores, int ncuts) |
static int | filterWithParallelism (SCIP_ROW *cut, SCIP_ROW **cuts, SCIP_Real *scores, int ncuts, SCIP_Real maxparallel) |
static int | penaliseWithParallelism (SCIP *scip, SCIP_ROW *cut, SCIP_ROW **cuts, SCIP_Real *scores, int ncuts, SCIP_Real maxparallel, SCIP_Real paralpenalty) |
static int | filterWithDensity (SCIP *scip, SCIP_ROW **cuts, SCIP_Real maxdensity, int ncuts) |
static | SCIP_DECL_CUTSELCOPY (cutselCopyEnsemble) |
static | SCIP_DECL_CUTSELFREE (cutselFreeEnsemble) |
static | SCIP_DECL_CUTSELINIT (cutselInitEnsemble) |
static | SCIP_DECL_CUTSELEXIT (cutselExitEnsemble) |
static | SCIP_DECL_CUTSELSELECT (cutselSelectEnsemble) |
SCIP_RETCODE | SCIPincludeCutselEnsemble (SCIP *scip) |
SCIP_RETCODE | SCIPselectCutsEnsemble (SCIP *scip, SCIP_ROW **cuts, SCIP_ROW **forcedcuts, SCIP_CUTSELDATA *cutseldata, SCIP_Bool root, int ncuts, int nforcedcuts, int maxselectedcuts, int *nselectedcuts) |
#define CUTSEL_NAME "ensemble" |
Definition at line 45 of file cutsel_ensemble.c.
#define CUTSEL_DESC "weighted sum of many terms with optional filtering and penalties" |
Definition at line 46 of file cutsel_ensemble.c.
#define CUTSEL_PRIORITY 7000 |
Definition at line 47 of file cutsel_ensemble.c.
#define RANDSEED 0x5EED |
Definition at line 49 of file cutsel_ensemble.c.
#define DEFAULT_MINSCORE 0.0 |
minimum score s.t. a cut can be selected
Definition at line 51 of file cutsel_ensemble.c.
Referenced by SCIPincludeCutselEnsemble().
#define DEFAULT_EFFICACYWEIGHT 0.75 |
weight of normed-efficacy in score calculation
Definition at line 52 of file cutsel_ensemble.c.
#define DEFAULT_DIRCUTOFFDISTWEIGHT 0.0 |
weight of normed-directed cutoff distance in score calculation
Definition at line 53 of file cutsel_ensemble.c.
#define DEFAULT_OBJPARALWEIGHT 0.25 |
weight of objective parallelism in score calculation
Definition at line 54 of file cutsel_ensemble.c.
#define DEFAULT_INTSUPPORTWEIGHT 0.45 |
weight of integral support in cut score calculation
Definition at line 55 of file cutsel_ensemble.c.
#define DEFAULT_EXPIMPROVWEIGHT 0.1 |
weight of normed-expected improvement in cut score calculation
Definition at line 56 of file cutsel_ensemble.c.
Referenced by SCIPincludeCutselEnsemble().
#define DEFAULT_PSCOSTWEIGHT 0.75 |
weight of normalised pseudo-costs in cut score calculation
Definition at line 57 of file cutsel_ensemble.c.
#define DEFAULT_NLOCKSWEIGHT 0.25 |
weight of normalised number of locks in cut score calculation
Definition at line 58 of file cutsel_ensemble.c.
Referenced by SCIPincludeCutselEnsemble().
#define DEFAULT_MAXSPARSITYBONUS 0.5 |
score given to a cut with complete sparsity
Definition at line 59 of file cutsel_ensemble.c.
Referenced by SCIPincludeCutselEnsemble().
#define DEFAULT_SPARSITYENDBONUS 0.2 |
the density at which a cut no longer receives additional score
Definition at line 60 of file cutsel_ensemble.c.
Referenced by SCIPincludeCutselEnsemble().
#define DEFAULT_GOODNUMERICBONUS 0.0 |
bonus provided for good numerics
Definition at line 61 of file cutsel_ensemble.c.
Referenced by SCIPincludeCutselEnsemble().
#define DEFAULT_MAXCOEFRATIOBONUS 10000 |
maximum coefficient ratio of cut for which numeric bonus is given
Definition at line 62 of file cutsel_ensemble.c.
Referenced by SCIPincludeCutselEnsemble().
#define DEFAULT_PENALISELOCKS TRUE |
whether having less locks should be rewarded instead of more
Definition at line 63 of file cutsel_ensemble.c.
Referenced by SCIPincludeCutselEnsemble().
#define DEFAULT_PENALISEOBJPARAL TRUE |
whether objective parallelism should be penalised not rewarded
Definition at line 64 of file cutsel_ensemble.c.
Referenced by SCIPincludeCutselEnsemble().
#define DEFAULT_FILTERPARALCUTS FALSE |
should cuts be filtered so no two parallel cuts are added
Definition at line 65 of file cutsel_ensemble.c.
Referenced by SCIPincludeCutselEnsemble().
#define DEFAULT_MAXPARAL 0.95 |
threshold for when two cuts are considered parallel to each other
Definition at line 66 of file cutsel_ensemble.c.
Referenced by SCIPincludeCutselEnsemble().
#define DEFAULT_PENALISEPARALCUTS TRUE |
should two parallel cuts be penalised instead of outright filtered
Definition at line 67 of file cutsel_ensemble.c.
Referenced by SCIPincludeCutselEnsemble().
#define DEFAULT_PARALPENALTY 0.25 |
penalty for weaker of two parallel cuts if penalising parallel cuts
Definition at line 68 of file cutsel_ensemble.c.
Referenced by SCIPincludeCutselEnsemble().
#define DEFAULT_FILTERDENSECUTS TRUE |
should cuts over a given density threshold be filtered
Definition at line 69 of file cutsel_ensemble.c.
Referenced by SCIPincludeCutselEnsemble().
#define DEFAULT_MAXCUTDENSITY 0.425 |
max allowed cut density if filtering dense cuts
Definition at line 70 of file cutsel_ensemble.c.
Referenced by SCIPincludeCutselEnsemble().
#define DEFAULT_MAXNONZEROROOTROUND 4.5 |
max nonzeros per round (root). Gets multiplied by num LP cols
Definition at line 71 of file cutsel_ensemble.c.
Referenced by SCIPincludeCutselEnsemble().
#define DEFAULT_MAXNONZEROTREEROUND 9.5 |
max nonzeros per round (tree). Gets multiplied by num LP cols
Definition at line 72 of file cutsel_ensemble.c.
Referenced by SCIPincludeCutselEnsemble().
#define DEFAULT_MAXCUTS 200 |
maximum number of cuts that can be considered by this cut selector
Definition at line 73 of file cutsel_ensemble.c.
Referenced by SCIPincludeCutselEnsemble().
#define DEFAULT_MAXNUMVARS 50000 |
maximum number of variables that a problem can have while calling this cut selector
Definition at line 74 of file cutsel_ensemble.c.
Referenced by SCIPincludeCutselEnsemble().
|
static |
returns the maximum score of cuts; if scores is not NULL, then stores the individual score of each cut in scores
scip | SCIP data structure |
cuts | array with cuts to score |
cutseldata | cut selector data |
scores | array to store the score of cuts or NULL |
root | whether we are at the root node or not |
ncuts | number of cuts in cuts array |
Definition at line 117 of file cutsel_ensemble.c.
References ABS, density, i, LOG1P, MAX, NULL, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPallocBufferArray, SCIPcolGetPrimsol(), SCIPcolGetVar(), SCIPepsilon(), SCIPfreeBufferArray, SCIPgetBestSol(), SCIPgetCutEfficacy(), SCIPgetCutLPSolCutoffDistance(), SCIPgetNLPCols(), SCIPgetRowFeasibility(), SCIPgetRowMaxCoef(), SCIPgetRowMinCoef(), SCIPgetRowNumIntCols(), SCIPgetRowObjParallelism(), SCIPgetVarPseudocostScore(), SCIPisInfinity(), SCIPisSumLE(), SCIPrandomGetReal(), SCIProwGetCols(), SCIProwGetLhs(), SCIProwGetNNonz(), SCIProwGetNorm(), SCIProwGetRhs(), SCIProwGetVals(), SCIPsumepsilon(), SCIPvarGetNLocksDown(), SCIPvarGetNLocksUp(), sol, and SQR.
Referenced by SCIPselectCutsEnsemble().
move the cut with the highest score to the first position in the array; there must be at least one cut
cuts | array with cuts to perform selection algorithm |
scores | array with scores of cuts to perform selection algorithm |
ncuts | number of cuts in given array |
Definition at line 327 of file cutsel_ensemble.c.
References assert(), i, NULL, SCIP_Real, SCIPswapPointers(), and SCIPswapReals().
Referenced by SCIPselectCutsEnsemble().
|
static |
filters the given array of cuts to enforce a maximum parallelism constraint w.r.t the given cut; moves filtered cuts to the end of the array and returns number of selected cuts
cut | cut to filter orthogonality with |
cuts | array with cuts to perform selection algorithm |
scores | array with scores of cuts to perform selection algorithm |
ncuts | number of cuts in given array |
maxparallel | maximal parallelism for all cuts that are not good |
Definition at line 359 of file cutsel_ensemble.c.
References assert(), i, NULL, SCIP_Real, SCIProwGetParallelism(), SCIPswapPointers(), and SCIPswapReals().
Referenced by SCIPselectCutsEnsemble().
|
static |
penalises any cut too parallel to cut by reducing the parallel cut's score.
scip | SCIP data structure |
cut | cut to filter orthogonality with |
cuts | array with cuts to perform selection algorithm |
scores | array with scores of cuts to perform selection algorithm |
ncuts | number of cuts in given array |
maxparallel | maximal parallelism for all cuts that are not good |
paralpenalty | penalty for weaker of two parallel cuts if penalising parallel cuts |
Definition at line 390 of file cutsel_ensemble.c.
References assert(), i, NULL, SCIP_Real, SCIProwGetParallelism(), SCIPsumepsilon(), SCIPswapPointers(), and SCIPswapReals().
Referenced by SCIPselectCutsEnsemble().
filters the given array of cuts to enforce a maximum density constraint, Moves filtered cuts to the end of the array and returns number of selected cuts
scip | SCIP data structure |
cuts | array with cuts to perform selection algorithm |
maxdensity | maximum density s.t. a cut is not filtered |
ncuts | number of cuts in given array |
Definition at line 429 of file cutsel_ensemble.c.
References assert(), i, NULL, SCIP_Real, SCIPgetNLPCols(), SCIProwGetNNonz(), and SCIPswapPointers().
Referenced by SCIPselectCutsEnsemble().
|
static |
copy method for cut selector plugin (called when SCIP copies plugins)
Definition at line 466 of file cutsel_ensemble.c.
References assert(), CUTSEL_NAME, NULL, SCIP_CALL, SCIP_OKAY, SCIPcutselGetName(), and SCIPincludeCutselEnsemble().
|
static |
destructor of cut selector to free user data (called when SCIP is exiting) ! [SnippetCutselFreeEnsemble]
Definition at line 481 of file cutsel_ensemble.c.
References NULL, SCIP_OKAY, SCIPcutselGetData(), SCIPcutselSetData(), and SCIPfreeBlockMemory.
|
static |
! [SnippetCutselFreeEnsemble] initialization method of cut selector (called after problem was transformed)
Definition at line 497 of file cutsel_ensemble.c.
References assert(), NULL, RANDSEED, SCIP_CALL, SCIP_OKAY, SCIPcreateRandom(), SCIPcutselGetData(), and TRUE.
|
static |
deinitialization method of cut selector (called before transformed problem is freed)
Definition at line 511 of file cutsel_ensemble.c.
References assert(), NULL, SCIP_OKAY, SCIPcutselGetData(), and SCIPfreeRandom().
|
static |
cut selection method of cut selector
Definition at line 526 of file cutsel_ensemble.c.
References assert(), NULL, result, SCIP_CALL, SCIP_DIDNOTFIND, SCIP_OKAY, SCIP_SUCCESS, SCIPcutselGetData(), SCIPgetNVars(), and SCIPselectCutsEnsemble().