Detailed Description
generic branch-and-price strong branching heuristics
Definition in file branch_bpstrong.c.
#include <assert.h>
#include "branch_bpstrong.h"
#include "type_branchgcg.h"
#include "gcg.h"
#include "branch_orig.h"
#include <string.h>
#include "branch_relpsprob.h"
#include "cons_integralorig.h"
#include "cons_masterbranch.h"
#include "cons_origbranch.h"
#include "relax_gcg.h"
#include "pricer_gcg.h"
#include "scip/cons_linear.h"
#include "scip/scipdefplugins.h"
#include "scip/var.h"
Go to the source code of this file.
Data Structures | |
struct | GCG_BranchData |
struct | VarTuple |
struct | SCIP_BranchruleData |
Typedefs | |
typedef struct VarTuple | VarTuple |
Functions | |
static | SCIP_DECL_HASHGETKEY (hashGetKeyVars) |
static | SCIP_DECL_HASHKEYEQ (hashKeyEqVars) |
static | SCIP_DECL_HASHKEYVAL (hashKeyValVars) |
static int | calculateNCands (SCIP *scip, SCIP_BRANCHRULEDATA *branchruledata, SCIP_Real nodegap, int phase, int ncands) |
static int | assignUniqueBlockFlags (SCIP *scip, SCIP_VAR *branchcand) |
static SCIP_RETCODE | addBranchcandsToData (SCIP *scip, SCIP_BRANCHRULE *branchrule, SCIP_VAR **var1s, SCIP_VAR **var2s, int ncands) |
static int | score_compare_function (const void *index1, const void *index2) |
static int | geq_compare_function (const void *index1, const void *index2) |
static SCIP_RETCODE | newProbingNodeRyanfosterMaster (SCIP *scip, SCIP_BRANCHRULE *branchrule, SCIP_VAR *ovar1, SCIP_VAR *ovar2, int blocknr, SCIP_Bool same) |
static SCIP_RETCODE | executeStrongBranching (SCIP *scip, SCIP_BRANCHRULE *branchrule, SCIP_VAR *branchvar1, SCIP_VAR *branchvar2, SCIP_Real solval1, SCIP_Real solval2, int candinfo, SCIP_Bool pricing, int maxpricingrounds, SCIP_Real *up, SCIP_Real *down, SCIP_Bool *upvalid, SCIP_Bool *downvalid, SCIP_Bool *upinf, SCIP_Bool *downinf) |
static SCIP_Bool | isKAncestor (SCIP *scip, int ancestornodenr, SCIP_NODE *successornode, int k) |
static SCIP_Real | score_function (SCIP *scip, SCIP_BRANCHRULE *branchrule, SCIP_VAR *var1, SCIP_VAR *var2, SCIP_Real solval1, SCIP_Real solval2, int candinfo, SCIP_Bool useheuristic, SCIP_Bool usehistorical, SCIP_Bool usecolgen, SCIP_Real *score, SCIP_Bool *upinf, SCIP_Bool *downinf) |
static SCIP_RETCODE | selectCandidate (SCIP *scip, SCIP_BRANCHRULE *branchrule, SCIP_VAR **cand1s, SCIP_VAR **cand2s, int *candinfos, int ncands, SCIP_VAR **outcand1, SCIP_VAR **outcand2, int *outcandinfo, SCIP_Bool *bestupinf, SCIP_Bool *bestdowninf, SCIP_RESULT *result) |
static | SCIP_DECL_BRANCHFREE (branchFreeBPStrong) |
static | SCIP_DECL_BRANCHINIT (branchInitBPStrong) |
SCIP_RETCODE | SCIPincludeBranchruleBPStrong (SCIP *scip) |
SCIP_RETCODE | GCGbranchSelectCandidateStrongBranchingOrig (SCIP *scip, SCIP_BRANCHRULE *origbranchrule, SCIP_VAR **branchvar, SCIP_Bool *upinf, SCIP_Bool *downinf, SCIP_RESULT *result, SCIP_Bool *stillusestrong) |
SCIP_RETCODE | GCGbranchSelectCandidateStrongBranchingRyanfoster (SCIP *scip, SCIP_BRANCHRULE *rfbranchrule, SCIP_VAR **ovar1s, SCIP_VAR **ovar2s, int *nspricingblock, int npairs, SCIP_VAR **ovar1, SCIP_VAR **ovar2, int *pricingblock, SCIP_Bool *sameinf, SCIP_Bool *differinf, SCIP_RESULT *result, SCIP_Bool *stillusestrong) |
Variables | |
SCIP_BRANCHRULEDATA * | this_branchruledata |
Macro Definition Documentation
◆ BRANCHRULE_NAME
#define BRANCHRULE_NAME "bpstrong" |
name of branching rule
Definition at line 58 of file branch_bpstrong.c.
◆ BRANCHRULE_DESC
#define BRANCHRULE_DESC "strong branching for branch-and-price" |
short description of branching rule
Definition at line 59 of file branch_bpstrong.c.
◆ BRANCHRULE_PRIORITY
#define BRANCHRULE_PRIORITY -536870912 |
priority of this branching rule
Definition at line 60 of file branch_bpstrong.c.
◆ BRANCHRULE_MAXDEPTH
#define BRANCHRULE_MAXDEPTH 0 |
maximal depth level of the branching rule
Definition at line 61 of file branch_bpstrong.c.
◆ BRANCHRULE_MAXBOUNDDIST
#define BRANCHRULE_MAXBOUNDDIST 0.0 |
maximal relative distance from current node's dual bound to primal bound compared to best node's dual bound for applying branching
Definition at line 62 of file branch_bpstrong.c.
◆ DEFAULT_ENFORCEBYCONS
#define DEFAULT_ENFORCEBYCONS FALSE |
Definition at line 65 of file branch_bpstrong.c.
◆ DEFAULT_MOSTFRAC
#define DEFAULT_MOSTFRAC FALSE |
Definition at line 66 of file branch_bpstrong.c.
◆ DEFAULT_USEPSEUDO
#define DEFAULT_USEPSEUDO TRUE |
Definition at line 67 of file branch_bpstrong.c.
◆ DEFAULT_USEPSSTRONG
#define DEFAULT_USEPSSTRONG FALSE |
Definition at line 68 of file branch_bpstrong.c.
◆ DEFAULT_USESTRONG
#define DEFAULT_USESTRONG FALSE |
Definition at line 70 of file branch_bpstrong.c.
◆ DEFAULT_STRONGLITE
#define DEFAULT_STRONGLITE FALSE |
Definition at line 71 of file branch_bpstrong.c.
◆ DEFAULT_STRONGTRAIN
#define DEFAULT_STRONGTRAIN FALSE |
Definition at line 72 of file branch_bpstrong.c.
◆ DEFAULT_IMMEDIATEINF
#define DEFAULT_IMMEDIATEINF TRUE |
Definition at line 73 of file branch_bpstrong.c.
◆ DEFAULT_MAXSBLPITERS
#define DEFAULT_MAXSBLPITERS INT_MAX |
Definition at line 74 of file branch_bpstrong.c.
◆ DEFAULT_MAXSBPRICEROUNDS
#define DEFAULT_MAXSBPRICEROUNDS INT_MAX |
Definition at line 75 of file branch_bpstrong.c.
◆ DEFAULT_RFUSEPSEUDOCOSTS
#define DEFAULT_RFUSEPSEUDOCOSTS TRUE |
Definition at line 77 of file branch_bpstrong.c.
◆ DEFAULT_RFUSEMOSTFRAC
#define DEFAULT_RFUSEMOSTFRAC FALSE |
Definition at line 78 of file branch_bpstrong.c.
◆ DEFAULT_REEVALAGE
#define DEFAULT_REEVALAGE 1 |
Definition at line 80 of file branch_bpstrong.c.
◆ DEFAULT_MINCOLGENCANDS
#define DEFAULT_MINCOLGENCANDS 4 |
Definition at line 81 of file branch_bpstrong.c.
◆ DEFAULT_HISTWEIGHT
#define DEFAULT_HISTWEIGHT 0.5 |
Definition at line 82 of file branch_bpstrong.c.
◆ DEFAULT_MAXLOOKAHEAD
#define DEFAULT_MAXLOOKAHEAD 8 |
Definition at line 83 of file branch_bpstrong.c.
◆ DEFAULT_LOOKAHEADSCALES
#define DEFAULT_LOOKAHEADSCALES 0.5 |
Definition at line 84 of file branch_bpstrong.c.
◆ DEFAULT_MINPHASE0DEPTH
#define DEFAULT_MINPHASE0DEPTH 0 |
Definition at line 85 of file branch_bpstrong.c.
◆ DEFAULT_MAXPHASE1DEPTH
#define DEFAULT_MAXPHASE1DEPTH 4 |
Definition at line 86 of file branch_bpstrong.c.
◆ DEFAULT_MAXPHASE2DEPTH
#define DEFAULT_MAXPHASE2DEPTH 3 |
Definition at line 87 of file branch_bpstrong.c.
◆ DEFAULT_DEPTHLOGWEIGHT
#define DEFAULT_DEPTHLOGWEIGHT 0.5 |
Definition at line 88 of file branch_bpstrong.c.
◆ DEFAULT_DEPTHLOGBASE
#define DEFAULT_DEPTHLOGBASE 3.5 |
Definition at line 89 of file branch_bpstrong.c.
◆ DEFAULT_DEPTHLOGPHASE0FRAC
#define DEFAULT_DEPTHLOGPHASE0FRAC 0 |
Definition at line 90 of file branch_bpstrong.c.
◆ DEFAULT_DEPTHLOGPHASE2FRAC
#define DEFAULT_DEPTHLOGPHASE2FRAC 0.75 |
Definition at line 91 of file branch_bpstrong.c.
◆ DEFAULT_CLOSEPERCENTAGE
#define DEFAULT_CLOSEPERCENTAGE 0.90 |
Definition at line 93 of file branch_bpstrong.c.
◆ DEFAULT_MAXCONSECHEURCLOSE
#define DEFAULT_MAXCONSECHEURCLOSE 4 |
Definition at line 94 of file branch_bpstrong.c.
◆ DEFAULT_SBPSEUDOCOSTWEIGHT
#define DEFAULT_SBPSEUDOCOSTWEIGHT 1 |
Definition at line 96 of file branch_bpstrong.c.
◆ DEFAULT_PHASE1RELIABLE
#define DEFAULT_PHASE1RELIABLE INT_MAX |
Definition at line 98 of file branch_bpstrong.c.
◆ DEFAULT_PHASE2RELIABLE
#define DEFAULT_PHASE2RELIABLE INT_MAX |
Definition at line 99 of file branch_bpstrong.c.
◆ DEFAULT_FORCEP0
#define DEFAULT_FORCEP0 FALSE |
Definition at line 101 of file branch_bpstrong.c.
◆ ORIG
#define ORIG 0 |
Definition at line 103 of file branch_bpstrong.c.
◆ RYANFOSTER
#define RYANFOSTER 1 |
Definition at line 104 of file branch_bpstrong.c.
◆ GENERIC
#define GENERIC 2 |
Definition at line 105 of file branch_bpstrong.c.
◆ branchDeactiveMasterBPStrong
#define branchDeactiveMasterBPStrong NULL |
Definition at line 1463 of file branch_bpstrong.c.
◆ branchPropMasterBPStrong
#define branchPropMasterBPStrong NULL |
Definition at line 1464 of file branch_bpstrong.c.
◆ branchActiveMasterBPStrong
#define branchActiveMasterBPStrong NULL |
Definition at line 1465 of file branch_bpstrong.c.
◆ branchMasterSolvedBPStrong
#define branchMasterSolvedBPStrong NULL |
Definition at line 1466 of file branch_bpstrong.c.
◆ branchDataDeleteBPStrong
#define branchDataDeleteBPStrong NULL |
Definition at line 1467 of file branch_bpstrong.c.
◆ branchExeclpBPStrong
#define branchExeclpBPStrong NULL |
Definition at line 1469 of file branch_bpstrong.c.
◆ branchExecextBPStrong
#define branchExecextBPStrong NULL |
Definition at line 1470 of file branch_bpstrong.c.
◆ branchExecpsBPStrong
#define branchExecpsBPStrong NULL |
Definition at line 1471 of file branch_bpstrong.c.
Typedef Documentation
◆ VarTuple
Function Documentation
◆ SCIP_DECL_HASHGETKEY()
|
static |
gets the hash key of a variable tuple
Definition at line 236 of file branch_bpstrong.c.
◆ SCIP_DECL_HASHKEYEQ()
|
static |
returns TRUE iff both variable tuples contain the same variables (ignoring order)
Definition at line 249 of file branch_bpstrong.c.
References VarTuple::var1, and VarTuple::var2.
◆ SCIP_DECL_HASHKEYVAL()
|
static |
Definition at line 278 of file branch_bpstrong.c.
References VarTuple::var1, and VarTuple::var2.
◆ calculateNCands()
|
static |
- Parameters
-
scip scip data structure branchruledata strong branching branchruledata nodegap node gap in current focus node phase phase we are calculating this for ncands number of input candidates for the phase
Definition at line 302 of file branch_bpstrong.c.
Referenced by selectCandidate().
◆ assignUniqueBlockFlags()
|
static |
- Parameters
-
scip SCIP data structure branchcand branching candidate to be considered
Definition at line 347 of file branch_bpstrong.c.
References GCGgetNIdenticalBlocks(), GCGlinkingVarGetBlocks(), GCGlinkingVarGetNBlocks(), GCGoriginalVarIsLinking(), GCGvarGetBlock(), and GCGvarIsOriginal().
Referenced by selectCandidate().
◆ addBranchcandsToData()
|
static |
adds branching candidates to branchruledata to collect infos about it
- Parameters
-
scip SCIP data structure branchrule branching rule var1s first parts of branching candidates var2s second parts of branching candidates ncands number of priority branching candidates
Definition at line 406 of file branch_bpstrong.c.
References GCGgetMasterprob(), VarTuple::index, VarTuple::var1, and VarTuple::var2.
Referenced by selectCandidate().
◆ score_compare_function()
|
static |
- Parameters
-
index1 index in branchruledata->score of first element index2 index in branchruledata->score of first element
Definition at line 479 of file branch_bpstrong.c.
References this_branchruledata.
Referenced by selectCandidate().
◆ geq_compare_function()
|
static |
- Parameters
-
index1 first index index2 second index
Definition at line 488 of file branch_bpstrong.c.
Referenced by selectCandidate().
◆ newProbingNodeRyanfosterMaster()
|
static |
- Parameters
-
scip SCIP data structure branchrule branching rule ovar1 first original variable ovar2 second original variable blocknr number of the pricing block same do we want to create the same (TRUE) or differ (FALSE) branch?
Definition at line 500 of file branch_bpstrong.c.
References GCG_BranchData::blocknr, GCGgetMasterprob(), GCGoriginalVarGetPricingVar(), GCGpricingVarGetNOrigvars(), GCGpricingVarGetOrigvars(), GCGrelaxNewProbingnodeMasterCons(), GCGvarGetBlock(), GCGvarIsOriginal(), GCGvarIsPricing(), GCG_BranchData::pricecons, GCG_BranchData::same, GCG_BranchData::var1, and GCG_BranchData::var2.
Referenced by executeStrongBranching().
◆ executeStrongBranching()
|
static |
Definition at line 598 of file branch_bpstrong.c.
References GCGrelaxEndProbing(), GCGrelaxNewProbingnodeMaster(), GCGrelaxNewProbingnodeOrig(), GCGrelaxPerformProbing(), GCGrelaxPerformProbingWithPricing(), GCGrelaxStartProbing(), newProbingNodeRyanfosterMaster(), ORIG, and RYANFOSTER.
Referenced by score_function().
◆ isKAncestor()
|
static |
- Parameters
-
scip SCIP data structure ancestornodenr number of the supposed ancestor successornode the supposed successor k maximal allowed distance between the nodes
Definition at line 712 of file branch_bpstrong.c.
Referenced by score_function().
◆ score_function()
|
static |
- Parameters
-
scip SCIP data structure branchrule pointer to the branching rule var1 first var to be scored var2 second var to be scored solval1 the first var's current solution value solval2 the second var's current solution value candinfo additional integer information about the candidate useheuristic should heuristics be used instead of strong branching? usehistorical should historical data from phase 2 be used as heuristic? usecolgen should column generation be used during strong branching? score stores the computed score upinf stores whether the upbranch is infeasible downinf stores whether the downbranch is infeasible
Definition at line 738 of file branch_bpstrong.c.
References executeStrongBranching(), GCGgetMasterprob(), isKAncestor(), and ORIG.
Referenced by selectCandidate().
◆ selectCandidate()
|
static |
branching method for relaxation solutions
- Parameters
-
scip SCIP data structure branchrule pointer to the branching rule cand1s first variable candidates cand2s second variable candidates (each cand2 corresponds to exactly one cand1 and vice versa) candinfos additional information for each candidate ncands number of input candidates outcand1 pointer to store the pointer of the first selected variable outcand2 pointer to store the pointer of the second selected variable (if applicable) outcandinfo pointer to store additional (integer) info bestupinf pointer to store whether strong branching detected infeasibility in the upbranch bestdowninf pointer to store whether strong branching detected infeasibility in the downbranch result pointer to store the result of the branching call
Definition at line 880 of file branch_bpstrong.c.
References addBranchcandsToData(), assignUniqueBlockFlags(), BRANCHRULE_NAME, calculateNCands(), GCGgetMasterprob(), geq_compare_function(), ORIG, RYANFOSTER, score_compare_function(), score_function(), VarTuple::var1, and VarTuple::var2.
Referenced by GCGbranchSelectCandidateStrongBranchingOrig(), and GCGbranchSelectCandidateStrongBranchingRyanfoster().
◆ SCIP_DECL_BRANCHFREE()
|
static |
free remaining allocated memory
Definition at line 1475 of file branch_bpstrong.c.
◆ SCIP_DECL_BRANCHINIT()
|
static |
initialization method of branching rule (called after problem was transformed)
Definition at line 1513 of file branch_bpstrong.c.
References branchActiveMasterBPStrong, branchDataDeleteBPStrong, branchDeactiveMasterBPStrong, branchMasterSolvedBPStrong, branchPropMasterBPStrong, GCGmasterGetOrigprob(), GCGrelaxIncludeBranchrule(), RYANFOSTER, and this_branchruledata.
◆ SCIPincludeBranchruleBPStrong()
SCIP_RETCODE SCIPincludeBranchruleBPStrong | ( | SCIP * | scip | ) |
creates the b&p strong-branching branching rule and includes it in SCIP
- Parameters
-
scip SCIP data structure
Definition at line 1619 of file branch_bpstrong.c.
References BRANCHRULE_DESC, BRANCHRULE_MAXBOUNDDIST, BRANCHRULE_MAXDEPTH, BRANCHRULE_NAME, BRANCHRULE_PRIORITY, DEFAULT_CLOSEPERCENTAGE, DEFAULT_DEPTHLOGBASE, DEFAULT_DEPTHLOGPHASE0FRAC, DEFAULT_DEPTHLOGPHASE2FRAC, DEFAULT_DEPTHLOGWEIGHT, DEFAULT_FORCEP0, DEFAULT_HISTWEIGHT, DEFAULT_IMMEDIATEINF, DEFAULT_LOOKAHEADSCALES, DEFAULT_MAXCONSECHEURCLOSE, DEFAULT_MAXLOOKAHEAD, DEFAULT_MAXPHASE1DEPTH, DEFAULT_MAXPHASE2DEPTH, DEFAULT_MAXSBLPITERS, DEFAULT_MAXSBPRICEROUNDS, DEFAULT_MINCOLGENCANDS, DEFAULT_MINPHASE0DEPTH, DEFAULT_PHASE1RELIABLE, DEFAULT_PHASE2RELIABLE, DEFAULT_REEVALAGE, DEFAULT_RFUSEMOSTFRAC, DEFAULT_RFUSEPSEUDOCOSTS, DEFAULT_SBPSEUDOCOSTWEIGHT, DEFAULT_STRONGLITE, DEFAULT_STRONGTRAIN, GCGconsIntegralorigAddBranchrule(), and GCGmasterGetOrigprob().
Referenced by GCGincludeMasterPlugins().
◆ GCGbranchSelectCandidateStrongBranchingOrig()
SCIP_RETCODE GCGbranchSelectCandidateStrongBranchingOrig | ( | SCIP * | scip, |
SCIP_BRANCHRULE * | origbranchrule, | ||
SCIP_VAR ** | branchvar, | ||
SCIP_Bool * | upinf, | ||
SCIP_Bool * | downinf, | ||
SCIP_RESULT * | result, | ||
SCIP_Bool * | stillusestrong | ||
) |
- Parameters
-
scip SCIP data structure origbranchrule pointer storing original branching rule branchvar pointer to store output var pointer upinf pointer to store whether strong branching detected infeasibility in the upbranch downinf pointer to store whether strong branching detected infeasibility in the downbranch result pointer to store result stillusestrong pointer to store whether strong branching has reached a permanent stopping condition for orig
Definition at line 1757 of file branch_bpstrong.c.
References BRANCHRULE_NAME, GCGgetMasterprob(), ORIG, and selectCandidate().
Referenced by branchExtern().
◆ GCGbranchSelectCandidateStrongBranchingRyanfoster()
SCIP_RETCODE GCGbranchSelectCandidateStrongBranchingRyanfoster | ( | SCIP * | scip, |
SCIP_BRANCHRULE * | rfbranchrule, | ||
SCIP_VAR ** | ovar1s, | ||
SCIP_VAR ** | ovar2s, | ||
int * | nspricingblock, | ||
int | npairs, | ||
SCIP_VAR ** | ovar1, | ||
SCIP_VAR ** | ovar2, | ||
int * | pricingblock, | ||
SCIP_Bool * | sameinf, | ||
SCIP_Bool * | differinf, | ||
SCIP_RESULT * | result, | ||
SCIP_Bool * | stillusestrong | ||
) |
interface method for Ryan-Foster branching to strong branching heuristics
- Parameters
-
scip original SCIP data structure rfbranchrule Ryan-Foster branchrule ovar1s first elements of candidate pairs ovar2s second elements of candidate pairs nspricingblock pricing block numbers corresponding to input pairs npairs number of input pairs ovar1 pointer to store output var 1 pointer ovar2 pointer to store output var 2 pointer pricingblock pointer to store output pricing block number sameinf pointer to store whether strong branching detected infeasibility in the same branch differinf pointer to store whether strong branching detected infeasibility in the differ branch result pointer to store result stillusestrong pointer to store whether strong branching has reached a permanent stopping condition for Ryan-Foster
Definition at line 1812 of file branch_bpstrong.c.
References BRANCHRULE_NAME, GCGgetMasterprob(), RYANFOSTER, and selectCandidate().
Referenced by SCIP_DECL_BRANCHEXECLP().
Variable Documentation
◆ this_branchruledata
SCIP_BRANCHRULEDATA* this_branchruledata |
Definition at line 228 of file branch_bpstrong.c.
Referenced by SCIP_DECL_BRANCHINIT(), and score_compare_function().