branch_relpsprob.c
Go to the documentation of this file.
40 * - NEW! probing is done according to reliability values per candidate depending on tree size and probing rounds
44/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
77#define DEFAULT_CONFLENGTHWEIGHT 0.0001 /**< weight in score calculations for conflict length score*/
81#define DEFAULT_MINRELIABLE 1.0 /**< minimal value for minimum pseudo cost size to regard pseudo cost value as reliable */
82#define DEFAULT_MAXRELIABLE 8.0 /**< maximal value for minimum pseudo cost size to regard pseudo cost value as reliable */
83#define DEFAULT_ITERQUOT 0.5 /**< maximal fraction of branching LP iterations compared to normal iters */
85#define DEFAULT_MAXLOOKAHEAD 8 /**< maximal number of further variables evaluated without better score */
86#define DEFAULT_INITCAND 100 /**< maximal number of candidates initialized with strong branching per node */
87#define DEFAULT_MAXBDCHGS 20 /**< maximal number of bound tightenings before the node is immediately reevaluated (-1: unlimited) */
88#define DEFAULT_MINBDCHGS 1 /**< minimal number of bound tightenings before the node is reevaluated */
103 SCIP_Real minreliable; /**< minimal value for minimum pseudo cost size to regard pseudo cost value as reliable */
104 SCIP_Real maxreliable; /**< maximal value for minimum pseudo cost size to regard pseudo cost value as reliable */
105 SCIP_Real iterquot; /**< maximal fraction of branching LP iterations compared to normal iters */
110 int maxbdchgs; /**< maximal number of bound tightenings before the node is immediately reevaluated (-1: unlimited) */
114 int ninfprobings; /**< counter to store the number of probings which led to an infeasible branch */
117 int nresolvesminbdchgs; /**< counter to store how often node is reevaluated due to min bdchgs */
118 int nresolvesinfcands; /**< counter to store how often node is reevaluated since candidate with inf branch is chosen */
144 * all variables are put into a hashmap and arrays containig current lower and upper bounds are created
218 SCIP_Bool infrounding, /**< is the bdchg valid due to an infeasible rounding of the given var */
395/* calculates variable bounds for an up-branch and a down-branch, supposig a LP or pseudo solution is given */
473/** applies probing of a single variable in the given direction, and stores evaluation in given arrays */
531 SCIPdebugMessage("applying probing on variable <%s> == %u [%g,%g] (nlocks=%d/%d, impls=%d/%d, clqs=%d/%d)\n",
604 SCIP_Bool* downvalid, /**< stores whether the returned down value is a valid dual bound, or NULL;
608 SCIP_Bool* downinf, /**< pointer to store whether the downwards branch is infeasible, or NULL */
709 SCIP_CALL( addBdchg(origprob, bdchgdata, probingvar, newbound, SCIP_BOUNDTYPE_LOWER, TRUE, nbdchgs, &cutoff) );
730 SCIP_CALL( addBdchg(origprob, bdchgdata, probingvar, newbound, SCIP_BOUNDTYPE_UPPER, TRUE, nbdchgs, &cutoff) );
756 /* new bounds of the variable is the union of the propagated bounds of the left and right case */
764 SCIP_CALL( addBdchg(origprob, bdchgdata, vars[j], newlb, SCIP_BOUNDTYPE_LOWER, FALSE, nbdchgs, &cutoff) );
765 SCIP_CALL( addBdchg(origprob, bdchgdata, vars[j], newub, SCIP_BOUNDTYPE_UPPER, FALSE, nbdchgs, &cutoff) );
773 assert(SCIPvarGetType(vars[j]) == SCIP_VARTYPE_BINARY || SCIPvarGetType(vars[j]) == SCIP_VARTYPE_INTEGER);
781 SCIP_CALL( addBdchg(origprob, bdchgdata, vars[j], newlb, SCIP_BOUNDTYPE_LOWER, FALSE, nbdchgs, &cutoff) );
786 SCIP_CALL( addBdchg(origprob, bdchgdata, vars[j], newub, SCIP_BOUNDTYPE_UPPER, FALSE, nbdchgs, &cutoff) );
865 SCIP_CALL( SCIPallocBlockMemoryArray(scip, &branchruledata->nvarprobings, branchruledata->maxvars) );
866 SCIP_CALL( SCIPallocBlockMemoryArray(scip, &branchruledata->nvarbranchings, branchruledata->maxvars) );
895 SCIP_CALL( SCIPreallocBlockMemoryArray(scip, &branchruledata->nvarprobings, branchruledata->maxvars,
897 SCIP_CALL( SCIPreallocBlockMemoryArray(scip, &branchruledata->nvarbranchings, branchruledata->maxvars,
1006 SCIPdebugMessage("execrelpsprob method called\n relpsprob\n relpsprob\n relpsprob\n relpsprob\n relpsprob\n relpsprob\n relpsprob\n relpsprob\n");
1069 /* get maximal number of candidates to initialize with strong branching; if the current solutions is not basic,
1083 SCIP_CALL( SCIPallocBufferArray(origprob, &initcands, maxninitcands+1) ); /* allocate one additional slot for convenience */
1093 /* search for the best pseudo cost candidate, while remembering unreliable candidates in a sorted buffer */
1116 score = calcScore(origprob, branchruledata, conflictscore, avgconflictscore, conflengthscore, avgconflengthscore,
1164 SCIPvarGetName(branchcands[c]), SCIPvarGetLbLocal(branchcands[c]), SCIPvarGetUbLocal(branchcands[c]),
1168 SCIP_CALL( getVarProbingbranch(gcg, branchcands[c], bdchgdata, branchruledata->uselp, &branchruledata->nlpiterations,
1181 "(node %"SCIP_LONGINT_FORMAT") error in strong branching call for variable <%s> with solution %g\n",
1253 score = calcScore(origprob, branchruledata, conflictscore, avgconflictscore, conflengthscore, avgconflengthscore,
1254 inferencescore, avginferencescore, cutoffscore, avgcutoffscore, pscostscore, avgpscostscore, frac);
1279 SCIPdebugMessage(" -> variable <%s> (solval=%g, down=%g (%+g), up=%g (%+g), score=%g/ %g/%g %g/%g -> %g)\n",
1304 /* if the best pseudo cost candidate is better than the best uninitialized strong branching candidate,
1323 /* no candidate was initialized, and the best score is the one of the first candidate in the initialization
1356 SCIPdebugMessage(" -> best: <%s> (strongbranch = %ud)\n", SCIPvarGetName(branchcands[bestcand]), bestisstrongbranch);
1391/** solving process initialization method of branching rule (called when branch and bound process is about to begin) */
1418/** solving process deinitialization method of branching rule (called before branch and bound process data is freed) */
1431 branchruledata->nbranchings, branchruledata->nresolvesinfcands, branchruledata->nresolvesminbdchgs );
1472 SCIP_CALL( SCIPincludeBranchruleBasic(masterprob, &branchrule, BRANCHRULE_NAME, BRANCHRULE_DESC, BRANCHRULE_PRIORITY,
1485 &branchruledata->conflictweight, TRUE, DEFAULT_CONFLICTWEIGHT, SCIP_REAL_MIN, SCIP_REAL_MAX, NULL, NULL) );
1489 &branchruledata->conflengthweight, TRUE, DEFAULT_CONFLENGTHWEIGHT, SCIP_REAL_MIN, SCIP_REAL_MAX, NULL, NULL) );
1493 &branchruledata->inferenceweight, TRUE, DEFAULT_INFERENCEWEIGHT, SCIP_REAL_MIN, SCIP_REAL_MAX, NULL, NULL) );
1497 &branchruledata->cutoffweight, TRUE, DEFAULT_CUTOFFWEIGHT, SCIP_REAL_MIN, SCIP_REAL_MAX, NULL, NULL) );
1501 &branchruledata->pscostweight, TRUE, DEFAULT_PSCOSTWEIGHT, SCIP_REAL_MIN, SCIP_REAL_MAX, NULL, NULL) );
1528 "maximal number of bound tightenings before the node is immediately reevaluated (-1: unlimited)",
1571 SCIP_CALL( execRelpsprob(gcg, branchrule, branchcands, branchcandssol, nbranchcands, nvars, result, branchvar) );
static SCIP_RETCODE applyProbing(GCG *gcg, SCIP_VAR **vars, int nvars, SCIP_VAR *probingvar, SCIP_Bool probingdir, SCIP_Bool solvelp, SCIP_Longint *nlpiterations, SCIP_Real *proplbs, SCIP_Real *propubs, SCIP_Real *lpobjvalue, SCIP_Bool *lpsolved, SCIP_Bool *lperror, SCIP_Bool *cutoff)
Definition: branch_relpsprob.c:475
static SCIP_RETCODE incNVarProbings(SCIP *scip, SCIP_BRANCHRULE *branchrule, SCIP_VAR *var)
Definition: branch_relpsprob.c:947
static SCIP_Real calcScore(SCIP *scip, SCIP_BRANCHRULEDATA *branchruledata, SCIP_Real conflictscore, SCIP_Real avgconflictscore, SCIP_Real conflengthscore, SCIP_Real avgconflengthscore, SCIP_Real inferencescore, SCIP_Real avginferencescore, SCIP_Real cutoffscore, SCIP_Real avgcutoffscore, SCIP_Real pscostscore, SCIP_Real avgpscostscore, SCIP_Real frac)
Definition: branch_relpsprob.c:358
static SCIP_RETCODE calculateBounds(SCIP *scip, SCIP_VAR *branchvar, SCIP_Real *downlb, SCIP_Real *downub, SCIP_Real *uplb, SCIP_Real *upub)
Definition: branch_relpsprob.c:397
SCIP_RETCODE GCGgetRelpsprobBranchVar(GCG *gcg, SCIP_VAR **branchcands, SCIP_Real *branchcandssol, int nbranchcands, int nvars, SCIP_RESULT *result, SCIP_VAR **branchvar)
Definition: branch_relpsprob.c:1547
static SCIP_RETCODE addBdchg(SCIP *scip, BDCHGDATA *bdchgdata, SCIP_VAR *var, SCIP_Real newbound, SCIP_BOUNDTYPE boundtype, SCIP_Bool infrounding, int *nbdchgs, SCIP_Bool *infeasible)
Definition: branch_relpsprob.c:212
SCIP_RETCODE GCGincludeBranchruleRelpsprob(GCG *gcg)
Definition: branch_relpsprob.c:1453
static SCIP_DECL_BRANCHINITSOL(branchInitsolRelpsprob)
Definition: branch_relpsprob.c:1393
static SCIP_RETCODE incNVarBranchings(SCIP *scip, SCIP_BRANCHRULE *branchrule, SCIP_VAR *var)
Definition: branch_relpsprob.c:918
static SCIP_RETCODE freeBdchgData(SCIP *scip, BDCHGDATA *bdchgdata)
Definition: branch_relpsprob.c:187
static SCIP_RETCODE getVarProbingbranch(GCG *gcg, SCIP_VAR *probingvar, BDCHGDATA *bdchgdata, SCIP_Bool solvelp, SCIP_Longint *nlpiterations, SCIP_Real *down, SCIP_Real *up, SCIP_Bool *downvalid, SCIP_Bool *upvalid, SCIP_Bool *downinf, SCIP_Bool *upinf, SCIP_Bool *lperror, int *nbdchgs)
Definition: branch_relpsprob.c:596
static SCIP_RETCODE addBranchcandsToData(SCIP *scip, SCIP_BRANCHRULE *branchrule, SCIP_VAR **branchcands, int nbranchcands)
Definition: branch_relpsprob.c:841
static SCIP_RETCODE createBdchgData(SCIP *scip, BDCHGDATA **bdchgdata, SCIP_VAR **vars, int nvars)
Definition: branch_relpsprob.c:147
static SCIP_DECL_BRANCHEXITSOL(branchExitsolRelpsprob)
Definition: branch_relpsprob.c:1420
static SCIP_DECL_BRANCHFREE(branchFreeRelpsprob)
Definition: branch_relpsprob.c:1375
static SCIP_RETCODE execRelpsprob(GCG *gcg, SCIP_BRANCHRULE *branchrule, SCIP_VAR **branchcands, SCIP_Real *branchcandssol, int nbranchcands, int nvars, SCIP_RESULT *result, SCIP_VAR **branchvar)
Definition: branch_relpsprob.c:977
static SCIP_RETCODE applyBdchgs(SCIP *scip, BDCHGDATA *bdchgdata, SCIP_NODE *node)
Definition: branch_relpsprob.c:297
reliable pseudo costs branching rule
constraint handler for the integrality constraint
#define SCIP_Longint
#define SCIP_REAL_MAX
#define SCIP_Bool
#define MIN(x, y)
#define SCIP_Real
#define MAX(x, y)
#define SCIP_LONGINT_FORMAT
#define SCIP_REAL_MIN
#define SCIP_CALL(x)
#define TRUE
#define FALSE
GCG interface methods.
SCIP_Bool SCIPisStopped(SCIP *scip)
SCIP_RETCODE SCIPgetVarsData(SCIP *scip, SCIP_VAR ***vars, int *nvars, int *nbinvars, int *nintvars, int *nimplvars, int *ncontvars)
void SCIPhashmapFree(SCIP_HASHMAP **hashmap)
void * SCIPhashmapGetImage(SCIP_HASHMAP *hashmap, void *origin)
SCIP_RETCODE SCIPhashmapInsert(SCIP_HASHMAP *hashmap, void *origin, void *image)
SCIP_RETCODE SCIPhashmapCreate(SCIP_HASHMAP **hashmap, BMS_BLKMEM *blkmem, int mapsize)
SCIP_Bool SCIPhashmapExists(SCIP_HASHMAP *hashmap, void *origin)
SCIP_Real SCIPgetLocalLowerbound(SCIP *scip)
void SCIPverbMessage(SCIP *scip, SCIP_VERBLEVEL msgverblevel, FILE *file, const char *formatstr,...)
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)
SCIP_BRANCHRULE * SCIPfindBranchrule(SCIP *scip, const char *name)
SCIP_RETCODE SCIPincludeBranchruleBasic(SCIP *scip, SCIP_BRANCHRULE **branchruleptr, const char *name, const char *desc, int priority, int maxdepth, SCIP_Real maxbounddist, SCIP_BRANCHRULEDATA *branchruledata)
SCIP_BRANCHRULEDATA * SCIPbranchruleGetData(SCIP_BRANCHRULE *branchrule)
SCIP_RETCODE SCIPsetBranchruleFree(SCIP *scip, SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHFREE((*branchfree)))
SCIP_RETCODE SCIPsetBranchruleExitsol(SCIP *scip, SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHEXITSOL((*branchexitsol)))
void SCIPbranchruleSetData(SCIP_BRANCHRULE *branchrule, SCIP_BRANCHRULEDATA *branchruledata)
SCIP_RETCODE SCIPsetBranchruleInitsol(SCIP *scip, SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHINITSOL((*branchinitsol)))
SCIP_Real SCIPgetBranchScore(SCIP *scip, SCIP_VAR *var, SCIP_Real downgain, SCIP_Real upgain)
SCIP_Bool SCIPisLPSolBasic(SCIP *scip)
#define SCIPfreeBuffer(scip, ptr)
BMS_BLKMEM * SCIPblkmem(SCIP *scip)
int SCIPcalcMemGrowSize(SCIP *scip, int num)
#define SCIPallocBufferArray(scip, ptr, num)
#define SCIPreallocBufferArray(scip, ptr, num)
#define SCIPallocMemory(scip, ptr)
#define SCIPfreeBufferArray(scip, ptr)
#define SCIPduplicateBufferArray(scip, ptr, source, num)
#define SCIPfreeMemory(scip, ptr)
#define SCIPallocBlockMemoryArray(scip, ptr, num)
#define SCIPallocBuffer(scip, ptr)
#define SCIPreallocBlockMemoryArray(scip, ptr, oldnum, newnum)
#define SCIPfreeBlockMemoryArrayNull(scip, ptr, num)
SCIP_RETCODE SCIPchgVarUbProbing(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound)
SCIP_RETCODE SCIPchgVarLbProbing(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound)
SCIP_RETCODE SCIPpropagateProbing(SCIP *scip, int maxproprounds, SCIP_Bool *cutoff, SCIP_Longint *ndomredsfound)
SCIP_Real SCIPgetAvgInferenceScore(SCIP *scip)
SCIP_Real SCIPgetAvgConflictlengthScore(SCIP *scip)
SCIP_Longint SCIPgetNNodes(SCIP *scip)
SCIP_Real SCIPgetAvgConflictScore(SCIP *scip)
SCIP_Real SCIPgetAvgPseudocostScore(SCIP *scip)
SCIP_Real SCIPgetCutoffbound(SCIP *scip)
SCIP_Longint SCIPgetNLPIterations(SCIP *scip)
SCIP_Real SCIPgetAvgCutoffScore(SCIP *scip)
SCIP_Real SCIPgetSolvingTime(SCIP *scip)
SCIP_Bool SCIPisUbBetter(SCIP *scip, SCIP_Real newub, SCIP_Real oldlb, SCIP_Real oldub)
SCIP_Real SCIPinfinity(SCIP *scip)
SCIP_Bool SCIPisGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisFeasEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisLbBetter(SCIP *scip, SCIP_Real newlb, SCIP_Real oldlb, SCIP_Real oldub)
SCIP_Real SCIPfeasCeil(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Real SCIPfloor(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPfeasFloor(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisFeasLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisFeasNegative(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisFeasIntegral(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPfeastol(SCIP *scip)
SCIP_Bool SCIPisSumGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisFeasGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisSumGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_NODE * SCIPgetCurrentNode(SCIP *scip)
SCIP_Real SCIPgetVarPseudocostCountCurrentRun(SCIP *scip, SCIP_VAR *var, SCIP_BRANCHDIR dir)
SCIP_Real SCIPgetVarAvgInferenceScore(SCIP *scip, SCIP_VAR *var)
int SCIPvarGetNImpls(SCIP_VAR *var, SCIP_Bool varfixing)
SCIP_Real SCIPvarGetUbLocal(SCIP_VAR *var)
int SCIPvarGetNLocksDown(SCIP_VAR *var)
SCIP_RETCODE SCIPchgVarUbNode(SCIP *scip, SCIP_NODE *node, SCIP_VAR *var, SCIP_Real newbound)
SCIP_VARTYPE SCIPvarGetType(SCIP_VAR *var)
const char * SCIPvarGetName(SCIP_VAR *var)
SCIP_RETCODE SCIPreleaseVar(SCIP *scip, SCIP_VAR **var)
SCIP_Real SCIPgetVarConflictlengthScore(SCIP *scip, SCIP_VAR *var)
SCIP_Real SCIPgetVarSol(SCIP *scip, SCIP_VAR *var)
int SCIPvarGetNCliques(SCIP_VAR *var, SCIP_Bool varfixing)
SCIP_Real SCIPvarGetLbLocal(SCIP_VAR *var)
SCIP_RETCODE SCIPupdateVarPseudocost(SCIP *scip, SCIP_VAR *var, SCIP_Real solvaldelta, SCIP_Real objdelta, SCIP_Real weight)
SCIP_Real SCIPgetVarConflictScore(SCIP *scip, SCIP_VAR *var)
SCIP_Real SCIPgetVarAvgCutoffScore(SCIP *scip, SCIP_VAR *var)
SCIP_RETCODE SCIPchgVarLbNode(SCIP *scip, SCIP_NODE *node, SCIP_VAR *var, SCIP_Real newbound)
int SCIPvarGetNLocksUp(SCIP_VAR *var)
SCIP_RETCODE SCIPcaptureVar(SCIP *scip, SCIP_VAR *var)
SCIP_Real SCIPgetVarPseudocostScore(SCIP *scip, SCIP_VAR *var, SCIP_Real solval)
#define NULL
Definition: class_conspartition.cpp:44
GCG variable pricer.
#define SCIPdebugMessage
SCIP_RETCODE GCGrelaxNewProbingnodeMaster(GCG *gcg)
Definition: relax_gcg.c:4508
SCIP_RETCODE GCGrelaxStartProbing(GCG *gcg, SCIP_HEUR *probingheur)
Definition: relax_gcg.c:4390
SCIP_RETCODE GCGrelaxNewProbingnodeOrig(GCG *gcg)
Definition: relax_gcg.c:4459
SCIP_RETCODE GCGrelaxPerformProbingWithPricing(GCG *gcg, int maxpricerounds, SCIP_Longint *nlpiterations, int *npricerounds, SCIP_Real *lpobjvalue, SCIP_Bool *lpsolved, SCIP_Bool *lperror, SCIP_Bool *cutoff)
Definition: relax_gcg.c:4775
GCG relaxator.
Definition: branch_relpsprob.c:129
Definition: struct_gcg.h:55
Definition: branch_bpstrong.c:128
SCIP_BRANCHDIR_DOWNWARDS
SCIP_BRANCHDIR_UPWARDS
SCIP_BOUNDTYPE_UPPER
SCIP_BOUNDTYPE_LOWER
enum SCIP_BoundType SCIP_BOUNDTYPE
SCIP_VERBLEVEL_HIGH
SCIP_DIDNOTRUN
SCIP_CUTOFF
SCIP_REDUCEDDOM
SCIP_CONSADDED
enum SCIP_Result SCIP_RESULT
SCIP_OKAY
enum SCIP_Retcode SCIP_RETCODE
SCIP_VARTYPE_INTEGER
SCIP_VARTYPE_BINARY