Solving Constraint Integer Programs

branch_relpscost.c File Reference

Detailed Description

reliable pseudo costs branching rule

Tobias Achterberg
Timo Berthold
Gerald Gamrath

Definition in file branch_relpscost.c.

#include "blockmemshell/memory.h"
#include "scip/branch_relpscost.h"
#include "scip/cons_and.h"
#include "scip/pub_branch.h"
#include "scip/pub_cons.h"
#include "scip/pub_message.h"
#include "scip/pub_misc.h"
#include "scip/pub_sol.h"
#include "scip/pub_tree.h"
#include "scip/pub_var.h"
#include "scip/scip_branch.h"
#include "scip/scip_cons.h"
#include "scip/scip_general.h"
#include "scip/scip_lp.h"
#include "scip/scip_mem.h"
#include "scip/scip_message.h"
#include "scip/scip_nlp.h"
#include "scip/scip_numerics.h"
#include "scip/scip_param.h"
#include "scip/scip_prob.h"
#include "scip/scip_randnumgen.h"
#include "scip/scip_sol.h"
#include "scip/scip_solvingstats.h"
#include "scip/scip_tree.h"
#include "scip/scip_var.h"
#include <string.h>

Go to the source code of this file.


#define BRANCHRULE_NAME   "relpscost"
#define BRANCHRULE_DESC   "reliability branching on pseudo cost values"
#define DEFAULT_SBITEROFS   100000
#define DEFAULT_INITCAND   100


static SCIP_RETCODE binvarGetActiveProbindex (SCIP *scip, SCIP_VAR *var, int *probindex)
static SCIP_RETCODE countNonlinearities (SCIP *scip, int *nlcount, int nlcountsize, int *nlcountmax)
static SCIP_RETCODE branchruledataEnsureNlcount (SCIP *scip, SCIP_BRANCHRULEDATA *branchruledata)
static SCIP_Real calcNlscore (SCIP *scip, int *nlcount, int nlcountmax, int probindex)
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 nlscore, SCIP_Real frac)
static SCIP_RETCODE addBdchg (SCIP *scip, int **bdchginds, SCIP_BOUNDTYPE **bdchgtypes, SCIP_Real **bdchgbounds, int *nbdchgs, int ind, SCIP_BOUNDTYPE type, SCIP_Real bound)
static void freeBdchgs (SCIP *scip, int **bdchginds, SCIP_BOUNDTYPE **bdchgtypes, SCIP_Real **bdchgbounds, int *nbdchgs)
static SCIP_RETCODE applyBdchgs (SCIP *scip, SCIP_VAR **vars, int *bdchginds, SCIP_BOUNDTYPE *bdchgtypes, SCIP_Real *bdchgbounds, int nbdchgs, SCIP_RESULT *result)
static SCIP_RETCODE execRelpscost (SCIP *scip, SCIP_BRANCHRULE *branchrule, SCIP_VAR **branchcands, SCIP_Real *branchcandssol, SCIP_Real *branchcandsfrac, int nbranchcands, SCIP_Bool executebranch, SCIP_RESULT *result)
static SCIP_DECL_BRANCHCOPY (branchCopyRelpscost)
static SCIP_DECL_BRANCHFREE (branchFreeRelpscost)
static SCIP_DECL_BRANCHINITSOL (branchInitsolRelpscost)
static SCIP_DECL_BRANCHEXITSOL (branchExitsolRelpscost)
static SCIP_DECL_BRANCHEXECLP (branchExeclpRelpscost)
SCIP_RETCODE SCIPincludeBranchruleRelpscost (SCIP *scip)
SCIP_RETCODE SCIPexecRelpscostBranching (SCIP *scip, SCIP_VAR **branchcands, SCIP_Real *branchcandssol, SCIP_Real *branchcandsfrac, int nbranchcands, SCIP_Bool executebranching, SCIP_RESULT *result)

Macro Definition Documentation


#define BRANCHRULE_NAME   "relpscost"

Definition at line 52 of file branch_relpscost.c.

Referenced by applyBdchgs(), and SCIPexecRelpscostBranching().


#define BRANCHRULE_DESC   "reliability branching on pseudo cost values"

Definition at line 53 of file branch_relpscost.c.



Definition at line 54 of file branch_relpscost.c.



Definition at line 55 of file branch_relpscost.c.



Definition at line 56 of file branch_relpscost.c.



weight in score calculations for conflict score

Definition at line 58 of file branch_relpscost.c.



weight in score calculations for conflict length score

Definition at line 59 of file branch_relpscost.c.



weight in score calculations for inference score

Definition at line 60 of file branch_relpscost.c.



weight in score calculations for cutoff score

Definition at line 61 of file branch_relpscost.c.



weight in score calculations for pseudo cost score

Definition at line 62 of file branch_relpscost.c.



weight in score calculations for nlcount score

Definition at line 63 of file branch_relpscost.c.



minimal value for minimum pseudo cost size to regard pseudo cost value as reliable

Definition at line 64 of file branch_relpscost.c.



maximal value for minimum pseudo cost size to regard pseudo cost value as reliable

Definition at line 65 of file branch_relpscost.c.



maximal fraction of strong branching LP iterations compared to normal iterations

Definition at line 66 of file branch_relpscost.c.


#define DEFAULT_SBITEROFS   100000

additional number of allowed strong branching LP iterations

Definition at line 67 of file branch_relpscost.c.



maximal number of further variables evaluated without better score

Definition at line 68 of file branch_relpscost.c.


#define DEFAULT_INITCAND   100

maximal number of candidates initialized with strong branching per node

Definition at line 69 of file branch_relpscost.c.



iteration limit for strong branching initialization of pseudo cost entries (0: auto)

Definition at line 70 of file branch_relpscost.c.



maximal number of bound tightenings before the node is reevaluated (-1: unlimited)

Definition at line 71 of file branch_relpscost.c.



maximum number of propagation rounds to be performed during strong branching before solving the LP (-1: no limit, -2: parameter settings)

Definition at line 72 of file branch_relpscost.c.



should valid bounds be identified in a probing-like fashion during strong branching (only with propagation)?

Definition at line 75 of file branch_relpscost.c.



should reliability be based on relative errors?

Definition at line 78 of file branch_relpscost.c.



lowest tolerance beneath which relative errors are reliable

Definition at line 79 of file branch_relpscost.c.



highest tolerance beneath which relative errors are reliable

Definition at line 80 of file branch_relpscost.c.



should the strong branching decision be based on a hypothesis test?

Definition at line 81 of file branch_relpscost.c.



should the confidence level be adjusted dynamically?

Definition at line 82 of file branch_relpscost.c.



should strong branching result be considered for pseudo costs if the other direction was infeasible?

Definition at line 83 of file branch_relpscost.c.



should the scoring function use only local cutoff and inference information obtained for strong branching candidates?

Definition at line 84 of file branch_relpscost.c.



The confidence level for statistical methods, between 0 (Min) and 4 (Max).

Definition at line 85 of file branch_relpscost.c.



should branching rule skip candidates that have a low probability to be better than the best strong-branching or pseudo-candidate?

Definition at line 86 of file branch_relpscost.c.



start random seed for random number generation

Definition at line 89 of file branch_relpscost.c.



should slight perturbation of scores be used to break ties in the prior scores?

Definition at line 90 of file branch_relpscost.c.



should smaller weights be used for pseudo cost updates after hitting the LP iteration limit?

Definition at line 91 of file branch_relpscost.c.



should the weights of the branching rule be adjusted dynamically during solving based infeasible and objective leaf counters?

Definition at line 92 of file branch_relpscost.c.

Function Documentation

◆ binvarGetActiveProbindex()

static SCIP_RETCODE binvarGetActiveProbindex ( SCIP scip,
int *  probindex 

! [SnippetCodeStyleStaticAsserts] return probindex of variable or corresponding active variable (if negated or aggregated) or -1 (if multiaggregated)

! [SnippetCodeStyleStaticAsserts]

scipSCIP data structure
varbinary variable
probindexbuffer to store probindex

Definition at line 145 of file branch_relpscost.c.

References countNonlinearities(), NULL, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_VARSTATUS_FIXED, SCIPgetBinvarRepresentative(), SCIPvarGetNegationVar(), SCIPvarGetProbindex(), SCIPvarGetStatus(), SCIPvarIsActive(), SCIPvarIsBinary(), and SCIPvarIsNegated().

Referenced by countNonlinearities().

◆ countNonlinearities()

static SCIP_RETCODE countNonlinearities ( SCIP scip,
int *  nlcount,
int  nlcountsize,
int *  nlcountmax 

! [SnippetCodeStyleDeclaration] counts number of nonlinear constraints in which each variable appears

! [SnippetCodeStyleDeclaration]

! [SnippetCodeStyleIfFor]

! [SnippetCodeStyleIfFor]

scipSCIP data structure
nlcountpointer to array for storing count values
nlcountsizebuffer for storing length of nlcount array
nlcountmaxbuffer for storing maximum value in nlcount array

Definition at line 183 of file branch_relpscost.c.

References binvarGetActiveProbindex(), BMSclearMemoryArray, branchruledataEnsureNlcount(), NULL, SCIP_CALL, SCIP_OKAY, SCIP_VARSTATUS_FIXED, SCIPconshdlrGetConss(), SCIPconshdlrGetNActiveConss(), SCIPfindConshdlr(), SCIPgetNLPVarsNonlinearity(), SCIPgetNNLPVars(), SCIPgetNVarsAnd(), SCIPgetResultantAnd(), SCIPgetVarsAnd(), SCIPgetVarsData(), SCIPisNLPConstructed(), and SCIPvarGetStatus().

Referenced by binvarGetActiveProbindex(), and branchruledataEnsureNlcount().

◆ branchruledataEnsureNlcount()

static SCIP_RETCODE branchruledataEnsureNlcount ( SCIP scip,
scipSCIP data structure
branchruledatabranching rule data

Definition at line 273 of file branch_relpscost.c.

References BMSclearMemoryArray, calcNlscore(), countNonlinearities(), NULL, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPallocBlockMemoryArray, SCIPfreeBlockMemoryArrayNull, SCIPgetNVars(), and SCIPreallocBlockMemoryArray.

Referenced by countNonlinearities(), and execRelpscost().

◆ calcNlscore()

static SCIP_Real calcNlscore ( SCIP scip,
int *  nlcount,
int  nlcountmax,
int  probindex 

calculates nlscore value between 0 and 1

scipSCIP data structure
nlcountarray to store count values
nlcountmaxmaximum value in nlcount array
probindexindex of branching candidate

Definition at line 320 of file branch_relpscost.c.

References calcScore(), NULL, SCIP_Real, and SCIPgetNVars().

Referenced by branchruledataEnsureNlcount(), and execRelpscost().

◆ calcScore()

static SCIP_Real calcScore ( SCIP scip,
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  nlscore,
SCIP_Real  frac 

calculates an overall score value for the given individual score values

scipSCIP data structure
branchruledatabranching rule data
conflictscoreconflict score of current variable
avgconflictscoreaverage conflict score
conflengthscoreconflict length score of current variable
avgconflengthscoreaverage conflict length score
inferencescoreinference score of current variable
avginferencescoreaverage inference score
cutoffscorecutoff score of current variable
avgcutoffscoreaverage cutoff score
pscostscorepscost score of current variable
avgpscostscoreaverage pscost score
nlscorenonlinear score of current variable between 0 and 1
fracfractional value of variable in current solution

Definition at line 347 of file branch_relpscost.c.

References addBdchg(), MIN, NULL, SCIP_Real, SCIPfeastol(), SCIPgetNInfeasibleLeaves(), and SCIPgetNObjlimLeaves().

Referenced by calcNlscore(), and execRelpscost().

◆ addBdchg()

static SCIP_RETCODE addBdchg ( SCIP scip,
int **  bdchginds,
SCIP_BOUNDTYPE **  bdchgtypes,
SCIP_Real **  bdchgbounds,
int *  nbdchgs,
int  ind,
SCIP_Real  bound 

adds given index and direction to bound change arrays

scipSCIP data structure
bdchgindspointer to bound change index array
bdchgtypespointer to bound change types array
bdchgboundspointer to bound change new bounds array
nbdchgspointer to number of bound changes
indindex to store in bound change index array
typetype of the bound change to store in bound change type array
boundnew bound to store in bound change new bounds array

Definition at line 393 of file branch_relpscost.c.

References bound, freeBdchgs(), NULL, SCIP_CALL, SCIP_OKAY, and SCIPreallocBufferArray.

Referenced by calcScore(), and execRelpscost().

◆ freeBdchgs()

static void freeBdchgs ( SCIP scip,
int **  bdchginds,
SCIP_BOUNDTYPE **  bdchgtypes,
SCIP_Real **  bdchgbounds,
int *  nbdchgs 

frees bound change arrays

scipSCIP data structure
bdchgindspointer to bound change index array
bdchgtypespointer to bound change types array
bdchgboundspointer to bound change new bounds array
nbdchgspointer to number of bound changes

Definition at line 426 of file branch_relpscost.c.

References applyBdchgs(), NULL, and SCIPfreeBufferArrayNull.

Referenced by addBdchg(), and execRelpscost().

◆ applyBdchgs()

static SCIP_RETCODE applyBdchgs ( SCIP scip,
SCIP_VAR **  vars,
int *  bdchginds,
SCIP_BOUNDTYPE bdchgtypes,
SCIP_Real bdchgbounds,
int  nbdchgs,

applies bound changes stored in bound change arrays

scipSCIP data structure
varsproblem variables
bdchgindsbound change index array
bdchgtypesbound change types array
bdchgboundsbound change new bound array
nbdchgsnumber of bound changes
resultresult pointer

Definition at line 447 of file branch_relpscost.c.

References BRANCHRULE_NAME, execRelpscost(), NULL, SCIP_Bool, SCIP_BOUNDTYPE_LOWER, SCIP_BOUNDTYPE_UPPER, SCIP_CALL, SCIP_CUTOFF, SCIP_OKAY, SCIPbranchruleGetData(), SCIPdebugMsg, SCIPfindBranchrule(), SCIPtightenVarLb(), SCIPtightenVarUb(), SCIPvarGetLbLocal(), SCIPvarGetName(), SCIPvarGetUbLocal(), and TRUE.

Referenced by execRelpscost(), and freeBdchgs().

◆ execRelpscost()

static SCIP_RETCODE execRelpscost ( SCIP scip,
SCIP_VAR **  branchcands,
SCIP_Real branchcandssol,
SCIP_Real branchcandsfrac,
int  nbranchcands,
SCIP_Bool  executebranch,

execute reliability pseudo cost branching

scipSCIP data structure
branchrulebranching rule
branchcandsbranching candidates
branchcandssolsolution value for the branching candidates
branchcandsfracfractional part of the branching candidates
nbranchcandsnumber of branching candidates
executebranchexecute a branching step or run probing only
resultpointer to the result of the execution

Definition at line 524 of file branch_relpscost.c.

References addBdchg(), applyBdchgs(), branchruledataEnsureNlcount(), calcNlscore(), calcScore(), FALSE, freeBdchgs(), MAX, MIN, NULL, SCIP_Bool, SCIP_BOUNDTYPE_LOWER, SCIP_BOUNDTYPE_UPPER, SCIP_BRANCHDIR_DOWNWARDS, SCIP_BRANCHDIR_UPWARDS, SCIP_BRANCHED, SCIP_CALL, SCIP_CONFIDENCELEVEL_HIGH, SCIP_CONFIDENCELEVEL_LOW, SCIP_CONFIDENCELEVEL_MAX, SCIP_CONFIDENCELEVEL_MEDIUM, SCIP_CONFIDENCELEVEL_MIN, SCIP_CONSADDED, SCIP_CUTOFF, SCIP_DECL_BRANCHCOPY(), SCIP_DIDNOTRUN, SCIP_INVALID, SCIP_Longint, SCIP_LONGINT_FORMAT, SCIP_LPSOLSTAT_INFEASIBLE, SCIP_LPSOLSTAT_ITERLIMIT, SCIP_LPSOLSTAT_OBJLIMIT, SCIP_LPSOLSTAT_OPTIMAL, SCIP_OKAY, SCIP_Real, SCIP_REDUCEDDOM, SCIP_VERBLEVEL_HIGH, SCIPallColsInLP(), SCIPallocBlockMemoryArray, SCIPallocBufferArray, SCIPbranchruleGetData(), SCIPbranchVarVal(), SCIPdebug, SCIPdebugMsg, SCIPendStrongbranch(), SCIPfeasCeil(), SCIPfeasFloor(), SCIPfreeBlockMemoryArray, SCIPfreeBufferArray, SCIPgetAvgConflictlengthScore(), SCIPgetAvgConflictScore(), SCIPgetAvgCutoffScore(), SCIPgetAvgInferenceScore(), SCIPgetAvgPseudocostScore(), SCIPgetBestSol(), SCIPgetBranchScore(), SCIPgetCurrentNode(), SCIPgetCutoffbound(), SCIPgetLastStrongbranchLPSolStat(), SCIPgetLPObjval(), SCIPgetLPSolstat(), SCIPgetNDualResolveLPIterations(), SCIPgetNDualResolveLPs(), SCIPgetNNodeInitLPIterations(), SCIPgetNNodeInitLPs(), SCIPgetNNodeLPIterations(), SCIPgetNNodes(), SCIPgetNodeLowerbound(), SCIPgetNRootStrongbranchLPIterations(), SCIPgetNStrongbranchLPIterations(), SCIPgetNVars(), SCIPgetVarAvgCutoffScore(), SCIPgetVarAvgInferenceScore(), SCIPgetVarConflictlengthScore(), SCIPgetVarConflictScore(), SCIPgetVarPseudocostCountCurrentRun(), SCIPgetVarPseudocostCurrentRun(), SCIPgetVarPseudocostScore(), SCIPgetVarPseudocostScoreCurrentRun(), SCIPgetVars(), SCIPgetVarStrongbranchFrac(), SCIPgetVarStrongbranchLast(), SCIPgetVarStrongbranchNode(), SCIPgetVarStrongbranchWithPropagation(), SCIPhasCurrentNodeLP(), SCIPinfinity(), SCIPisExactSolve(), SCIPisFeasIntegral(), SCIPisGE(), SCIPisGT(), SCIPisLPSolBasic(), SCIPisLT(), SCIPisStopped(), SCIPisSumGE(), SCIPisSumGT(), SCIPisVarPscostRelerrorReliable(), SCIPnodeGetLowerbound(), SCIPpscostThresholdProbabilityTest(), SCIPrandomGetReal(), SCIPsignificantVarPscostDifference(), SCIPsolGetIndex(), SCIPstartStrongbranch(), SCIPupdateNodeLowerbound(), SCIPupdateVarPseudocost(), SCIPvarGetLbLocal(), SCIPvarGetName(), SCIPvarGetProbindex(), SCIPvarGetUbLocal(), SCIPverbMessage(), and TRUE.

Referenced by applyBdchgs(), and SCIPexecRelpscostBranching().


static SCIP_DECL_BRANCHCOPY ( branchCopyRelpscost  )

copy method for branchrule plugins (called when SCIP copies plugins)

Definition at line 1477 of file branch_relpscost.c.

Referenced by execRelpscost().


static SCIP_DECL_BRANCHFREE ( branchFreeRelpscost  )

destructor of branching rule to free user data (called when SCIP is exiting)

Definition at line 1491 of file branch_relpscost.c.


static SCIP_DECL_BRANCHINITSOL ( branchInitsolRelpscost  )

solving process initialization method of branching rule (called when branch and bound process is about to begin)

Definition at line 1506 of file branch_relpscost.c.


static SCIP_DECL_BRANCHEXITSOL ( branchExitsolRelpscost  )

solving process deinitialization method of branching rule (called before branch and bound process data is freed)

Definition at line 1527 of file branch_relpscost.c.


static SCIP_DECL_BRANCHEXECLP ( branchExeclpRelpscost  )

branching execution method for fractional LP solutions

Definition at line 1544 of file branch_relpscost.c.