Scippy

SCIP

Solving Constraint Integer Programs

branch_pscost.c File Reference

Detailed Description

pseudo costs branching rule

Author
Tobias Achterberg
Stefan Vigerske

Definition in file branch_pscost.c.

#include <assert.h>
#include <string.h>
#include "scip/branch_pscost.h"

Go to the source code of this file.

Macros

#define BRANCHRULE_NAME   "pscost"
 
#define BRANCHRULE_DESC   "branching on pseudo cost values"
 
#define BRANCHRULE_PRIORITY   2000
 
#define BRANCHRULE_MAXDEPTH   -1
 
#define BRANCHRULE_MAXBOUNDDIST   1.0
 
#define BRANCHRULE_STRATEGIES   "cdsu"
 
#define BRANCHRULE_STRATEGY_DEFAULT   'u'
 
#define BRANCHRULE_SCOREMINWEIGHT_DEFAULT   0.8
 
#define BRANCHRULE_SCOREMAXWEIGHT_DEFAULT   1.3
 
#define BRANCHRULE_SCORESUMWEIGHT_DEFAULT   0.1
 
#define BRANCHRULE_NCHILDREN_DEFAULT   2
 
#define BRANCHRULE_NARYMAXDEPTH_DEFAULT   -1
 
#define BRANCHRULE_NARYMINWIDTH_DEFAULT   0.001
 
#define BRANCHRULE_NARYWIDTHFAC_DEFAULT   2.0
 
#define WEIGHTEDSCORING(data, min, max, sum)   ((data)->scoreminweight * (min) + (data)->scoremaxweight * (max) + (data)->scoresumweight * (sum))
 

Functions

static SCIP_RETCODE updateBestCandidate (SCIP *scip, SCIP_BRANCHRULEDATA *branchruledata, SCIP_VAR **bestvar, SCIP_Real *bestbrpoint, SCIP_Real *bestscore, SCIP_VAR *cand, SCIP_Real candscoremin, SCIP_Real candscoremax, SCIP_Real candscoresum, SCIP_Real candsol)
 
static SCIP_RETCODE selectBranchVar (SCIP *scip, SCIP_BRANCHRULE *branchrule, SCIP_VAR **cands, SCIP_Real *candssol, SCIP_Real *candsscore, int ncands, SCIP_VAR **brvar, SCIP_Real *brpoint)
 
static SCIP_DECL_BRANCHCOPY (branchCopyPscost)
 
static SCIP_DECL_BRANCHFREE (branchFreePscost)
 
static SCIP_DECL_BRANCHEXECLP (branchExeclpPscost)
 
static SCIP_DECL_BRANCHEXECEXT (branchExecextPscost)
 
SCIP_RETCODE SCIPincludeBranchrulePscost (SCIP *scip)
 
SCIP_RETCODE SCIPselectBranchVarPscost (SCIP *scip, SCIP_VAR **branchcands, SCIP_Real *branchcandssol, SCIP_Real *branchcandsscore, int nbranchcands, SCIP_VAR **var, SCIP_Real *brpoint)
 

Macro Definition Documentation

#define BRANCHRULE_NAME   "pscost"
#define BRANCHRULE_DESC   "branching on pseudo cost values"

Definition at line 30 of file branch_pscost.c.

Referenced by SCIPincludeBranchrulePscost().

#define BRANCHRULE_PRIORITY   2000

Definition at line 31 of file branch_pscost.c.

Referenced by SCIPincludeBranchrulePscost().

#define BRANCHRULE_MAXDEPTH   -1

Definition at line 32 of file branch_pscost.c.

Referenced by SCIPincludeBranchrulePscost().

#define BRANCHRULE_MAXBOUNDDIST   1.0

Definition at line 33 of file branch_pscost.c.

Referenced by SCIPincludeBranchrulePscost().

#define BRANCHRULE_STRATEGIES   "cdsu"

possible pseudo cost multiplication strategies for branching on external candidates

Definition at line 35 of file branch_pscost.c.

Referenced by SCIPincludeBranchrulePscost().

#define BRANCHRULE_STRATEGY_DEFAULT   'u'

default pseudo cost multiplication strategy

Definition at line 36 of file branch_pscost.c.

Referenced by SCIPincludeBranchrulePscost().

#define BRANCHRULE_SCOREMINWEIGHT_DEFAULT   0.8

default weight for minimum of scores of a branching candidate

Definition at line 37 of file branch_pscost.c.

Referenced by SCIPincludeBranchrulePscost().

#define BRANCHRULE_SCOREMAXWEIGHT_DEFAULT   1.3

default weight for maximum of scores of a branching candidate

Definition at line 38 of file branch_pscost.c.

Referenced by SCIPincludeBranchrulePscost().

#define BRANCHRULE_SCORESUMWEIGHT_DEFAULT   0.1

default weight for sum of scores of a branching candidate

Definition at line 39 of file branch_pscost.c.

Referenced by SCIPincludeBranchrulePscost().

#define BRANCHRULE_NCHILDREN_DEFAULT   2

default number of children in n-ary branching

Definition at line 40 of file branch_pscost.c.

Referenced by SCIPincludeBranchrulePscost().

#define BRANCHRULE_NARYMAXDEPTH_DEFAULT   -1

default maximal depth where to do n-ary branching

Definition at line 41 of file branch_pscost.c.

Referenced by SCIPincludeBranchrulePscost().

#define BRANCHRULE_NARYMINWIDTH_DEFAULT   0.001

default minimal domain width in children when doing n-ary branching

Definition at line 42 of file branch_pscost.c.

Referenced by SCIPincludeBranchrulePscost().

#define BRANCHRULE_NARYWIDTHFAC_DEFAULT   2.0

default factor of domain width in n-ary branching

Definition at line 43 of file branch_pscost.c.

Referenced by SCIPincludeBranchrulePscost().

#define WEIGHTEDSCORING (   data,
  min,
  max,
  sum 
)    ((data)->scoreminweight * (min) + (data)->scoremaxweight * (max) + (data)->scoresumweight * (sum))

Definition at line 45 of file branch_pscost.c.

Referenced by updateBestCandidate().

Function Documentation

static SCIP_RETCODE updateBestCandidate ( SCIP scip,
SCIP_BRANCHRULEDATA branchruledata,
SCIP_VAR **  bestvar,
SCIP_Real bestbrpoint,
SCIP_Real bestscore,
SCIP_VAR cand,
SCIP_Real  candscoremin,
SCIP_Real  candscoremax,
SCIP_Real  candscoresum,
SCIP_Real  candsol 
)
static

checks if a given branching candidate is better than a previous one and updates the best branching candidate accordingly

Parameters
scipSCIP data structure
branchruledatabranching rule data
bestvarbest branching candidate
bestbrpointbranching point for best branching candidate
bestscorescore of best branching candidate
candbranching candidate to consider
candscoreminminimal score of branching candidate
candscoremaxmaximal score of branching candidate
candscoresumsum of scores of branching candidate
candsolproposed branching point of branching candidate

Definition at line 70 of file branch_pscost.c.

References FALSE, NULL, REALABS, SCIP_Bool, SCIP_CALL, SCIP_INVALID, SCIP_INVALIDDATA, SCIP_OKAY, SCIP_Real, SCIP_VARSTATUS_MULTAGGR, SCIP_VARTYPE_CONTINUOUS, SCIPABORT, SCIPadjustedVarLb(), SCIPadjustedVarUb(), SCIPcomputeVarLbLocal(), SCIPcomputeVarUbLocal(), SCIPdebugMessage, SCIPerrorMessage, SCIPgetBranchingPoint(), SCIPgetBranchScore(), SCIPgetSolVal(), SCIPgetVarPseudocostVal(), SCIPinfinity(), SCIPisEQ(), SCIPisFeasGE(), SCIPisFeasLE(), SCIPisHugeValue(), SCIPisInfinity(), SCIPisIntegral(), SCIPisNegative(), SCIPisSumEQ(), SCIPisSumGT(), SCIPvarGetLbLocal(), SCIPvarGetMultaggrNVars(), SCIPvarGetMultaggrScalars(), SCIPvarGetMultaggrVars(), SCIPvarGetName(), SCIPvarGetProbvar(), SCIPvarGetStatus(), SCIPvarGetType(), SCIPvarGetUbLocal(), SCIPvarIsActive(), TRUE, and WEIGHTEDSCORING.

Referenced by selectBranchVar().

static SCIP_RETCODE selectBranchVar ( SCIP scip,
SCIP_BRANCHRULE branchrule,
SCIP_VAR **  cands,
SCIP_Real candssol,
SCIP_Real candsscore,
int  ncands,
SCIP_VAR **  brvar,
SCIP_Real brpoint 
)
static

selects the branching variable from given candidate array

Parameters
scipSCIP data structure
branchrulebranching rule
candsarray of branching candidates
candssolarray of candidate solution values
candsscorearray of candidate scores
ncandsthe number of candidates
brvarpointer to store the selected branching candidate or NULL if none
brpointpointer to store branching point of selected branching variable

Definition at line 356 of file branch_pscost.c.

References NULL, REALABS, SCIP_BRANCHERROR, SCIP_CALL, SCIP_INVALID, SCIP_OKAY, SCIP_Real, SCIPABORT, SCIPallocBufferArray, SCIPbranchruleGetData(), SCIPduplicateBufferArray, SCIPerrorMessage, SCIPfreeBufferArray, SCIPisEQ(), SCIPisInfinity(), SCIPsortPtrInt(), SCIPvarCompare(), SCIPvarGetLbLocal(), SCIPvarGetUbLocal(), and updateBestCandidate().

Referenced by SCIP_DECL_BRANCHEXECEXT(), and SCIPselectBranchVarPscost().

static SCIP_DECL_BRANCHCOPY ( branchCopyPscost  )
static

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

Definition at line 464 of file branch_pscost.c.

References BRANCHRULE_NAME, NULL, SCIP_CALL, SCIP_OKAY, SCIPbranchruleGetName(), and SCIPincludeBranchrulePscost().

static SCIP_DECL_BRANCHFREE ( branchFreePscost  )
static

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

Definition at line 478 of file branch_pscost.c.

References NULL, SCIP_OKAY, SCIPbranchruleGetData(), SCIPbranchruleSetData(), and SCIPfreeMemory.

static SCIP_DECL_BRANCHEXECLP ( branchExeclpPscost  )
static
SCIP_RETCODE SCIPselectBranchVarPscost ( SCIP scip,
SCIP_VAR **  branchcands,
SCIP_Real branchcandssol,
SCIP_Real branchcandsscore,
int  nbranchcands,
SCIP_VAR **  var,
SCIP_Real brpoint 
)

selects a branching variable, due to pseudo cost, from the given candidate array and returns this variable together with a branching point

Parameters
scipSCIP data structure
branchcandsbranching candidates
branchcandssolsolution value for the branching candidates
branchcandsscorearray of candidate scores
nbranchcandsnumber of branching candidates
varpointer to store the variable to branch on, or NULL if none
brpointpointer to store the branching point for the branching variable, will be fractional for a discrete variable

Definition at line 692 of file branch_pscost.c.

References BRANCHRULE_NAME, NULL, SCIP_CALL, SCIP_OKAY, SCIPfindBranchrule(), and selectBranchVar().