Scippy

SCIP

Solving Constraint Integer Programs

Detailed Description

methods for branching on LP solutions, relaxation solutions, and pseudo solutions

See also
Public Variable methods contains some typical variable branching score functions

Functions

SCIP_RETCODE SCIPgetLPBranchCands (SCIP *scip, SCIP_VAR ***lpcands, SCIP_Real **lpcandssol, SCIP_Real **lpcandsfrac, int *nlpcands, int *npriolpcands, int *nfracimplvars)
 
int SCIPgetNLPBranchCands (SCIP *scip)
 
int SCIPgetNPrioLPBranchCands (SCIP *scip)
 
SCIP_RETCODE SCIPgetExternBranchCands (SCIP *scip, SCIP_VAR ***externcands, SCIP_Real **externcandssol, SCIP_Real **externcandsscore, int *nexterncands, int *nprioexterncands, int *nprioexternbins, int *nprioexternints, int *nprioexternimpls)
 
int SCIPgetNExternBranchCands (SCIP *scip)
 
int SCIPgetNPrioExternBranchCands (SCIP *scip)
 
int SCIPgetNPrioExternBranchBins (SCIP *scip)
 
int SCIPgetNPrioExternBranchInts (SCIP *scip)
 
int SCIPgetNPrioExternBranchImpls (SCIP *scip)
 
int SCIPgetNPrioExternBranchConts (SCIP *scip)
 
SCIP_RETCODE SCIPaddExternBranchCand (SCIP *scip, SCIP_VAR *var, SCIP_Real score, SCIP_Real solval)
 
void SCIPclearExternBranchCands (SCIP *scip)
 
SCIP_Bool SCIPcontainsExternBranchCand (SCIP *scip, SCIP_VAR *var)
 
SCIP_RETCODE SCIPgetPseudoBranchCands (SCIP *scip, SCIP_VAR ***pseudocands, int *npseudocands, int *npriopseudocands)
 
int SCIPgetNPseudoBranchCands (SCIP *scip)
 
int SCIPgetNPrioPseudoBranchCands (SCIP *scip)
 
int SCIPgetNPrioPseudoBranchBins (SCIP *scip)
 
int SCIPgetNPrioPseudoBranchInts (SCIP *scip)
 
int SCIPgetNPrioPseudoBranchImpls (SCIP *scip)
 
SCIP_Real SCIPgetBranchScore (SCIP *scip, SCIP_VAR *var, SCIP_Real downgain, SCIP_Real upgain)
 
SCIP_Real SCIPgetBranchScoreMultiple (SCIP *scip, SCIP_VAR *var, int nchildren, SCIP_Real *gains)
 
SCIP_Real SCIPgetBranchingPoint (SCIP *scip, SCIP_VAR *var, SCIP_Real suggestion)
 
SCIP_Real SCIPcalcNodeselPriority (SCIP *scip, SCIP_VAR *var, SCIP_BRANCHDIR branchdir, SCIP_Real targetvalue)
 
SCIP_Real SCIPcalcChildEstimate (SCIP *scip, SCIP_VAR *var, SCIP_Real targetvalue)
 
SCIP_RETCODE SCIPcreateChild (SCIP *scip, SCIP_NODE **node, SCIP_Real nodeselprio, SCIP_Real estimate)
 
SCIP_RETCODE SCIPbranchVar (SCIP *scip, SCIP_VAR *var, SCIP_NODE **downchild, SCIP_NODE **eqchild, SCIP_NODE **upchild)
 
SCIP_RETCODE SCIPbranchVarHole (SCIP *scip, SCIP_VAR *var, SCIP_Real left, SCIP_Real right, SCIP_NODE **downchild, SCIP_NODE **upchild)
 
SCIP_RETCODE SCIPbranchVarVal (SCIP *scip, SCIP_VAR *var, SCIP_Real val, SCIP_NODE **downchild, SCIP_NODE **eqchild, SCIP_NODE **upchild)
 
SCIP_RETCODE SCIPbranchVarValNary (SCIP *scip, SCIP_VAR *var, SCIP_Real val, int n, SCIP_Real minwidth, SCIP_Real widthfactor, int *nchildren)
 
SCIP_RETCODE SCIPbranchLP (SCIP *scip, SCIP_RESULT *result)
 
SCIP_RETCODE SCIPbranchExtern (SCIP *scip, SCIP_RESULT *result)
 
SCIP_RETCODE SCIPbranchPseudo (SCIP *scip, SCIP_RESULT *result)
 

Function Documentation

◆ SCIPgetLPBranchCands()

SCIP_RETCODE SCIPgetLPBranchCands ( SCIP scip,
SCIP_VAR ***  lpcands,
SCIP_Real **  lpcandssol,
SCIP_Real **  lpcandsfrac,
int *  nlpcands,
int *  npriolpcands,
int *  nfracimplvars 
)

gets branching candidates for LP solution branching (fractional variables) along with solution values, fractionalities, and number of branching candidates; The number of branching candidates does NOT account for fractional implicit integer variables which should not be used for branching decisions.

Fractional implicit integer variables are stored at the positions *nlpcands to *nlpcands + *nfracimplvars - 1

branching rules should always select the branching candidate among the first npriolpcands of the candidate list

Returns
SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
Precondition
This method can be called if scip is in one of the following stages:

See SCIP_STAGE for a complete list of all possible solving stages.

Parameters
scipSCIP data structure
lpcandspointer to store the array of LP branching candidates, or NULL
lpcandssolpointer to store the array of LP candidate solution values, or NULL
lpcandsfracpointer to store the array of LP candidate fractionalities, or NULL
nlpcandspointer to store the number of LP branching candidates, or NULL
npriolpcandspointer to store the number of candidates with maximal priority, or NULL
nfracimplvarspointer to store the number of fractional implicit integer variables, or NULL

Definition at line 36301 of file scip.c.

References Scip::branchcand, checkStage(), FALSE, Scip::lp, SCIP_CALL, SCIP_INVALIDDATA, SCIP_LPSOLSTAT_OPTIMAL, SCIP_LPSOLSTAT_UNBOUNDEDRAY, SCIP_OKAY, SCIPbranchcandGetLPCands(), SCIPerrorMessage, SCIPlpGetSolstat(), Scip::set, Scip::stat, and TRUE.

Referenced by performLPRandRounding(), performLPSimpleRounding(), SCIP_DECL_BRANCHEXECLP(), SCIP_DECL_HEUREXEC(), SCIP_DECL_SEPAEXECLP(), SCIPperformGenericDivingAlgorithm(), SCIPvisualUpdateChild(), and selectVarMultAggrBranching().

◆ SCIPgetNLPBranchCands()

int SCIPgetNLPBranchCands ( SCIP scip)

gets number of branching candidates for LP solution branching (number of fractional variables)

Returns
the number of branching candidates for LP solution branching (number of fractional variables).
Precondition
This method can be called if scip is in one of the following stages:

See SCIP_STAGE for a complete list of all possible solving stages.

Parameters
scipSCIP data structure

Definition at line 36334 of file scip.c.

References Scip::branchcand, checkStage(), FALSE, Scip::lp, NULL, SCIP_CALL_ABORT, SCIP_LPSOLSTAT_OPTIMAL, SCIP_LPSOLSTAT_UNBOUNDEDRAY, SCIP_OKAY, SCIPABORT, SCIPbranchcandGetLPCands(), SCIPerrorMessage, SCIPlpGetSolstat(), Scip::set, Scip::stat, and TRUE.

Referenced by SCIP_DECL_BRANCHEXECLP(), SCIP_DECL_CONSENFOLP(), SCIP_DECL_CONSSEPALP(), SCIP_DECL_DISPOUTPUT(), SCIP_DECL_HEUREXEC(), SCIP_DECL_SEPAEXECLP(), and SCIPapplyHeurDualval().

◆ SCIPgetNPrioLPBranchCands()

int SCIPgetNPrioLPBranchCands ( SCIP scip)

gets number of branching candidates with maximal priority for LP solution branching

Returns
the number of branching candidates with maximal priority for LP solution branching.
Precondition
This method can be called if scip is in one of the following stages:

See SCIP_STAGE for a complete list of all possible solving stages.

Parameters
scipSCIP data structure

Definition at line 36372 of file scip.c.

References Scip::branchcand, checkStage(), FALSE, Scip::lp, NULL, SCIP_CALL_ABORT, SCIP_LPSOLSTAT_OPTIMAL, SCIP_LPSOLSTAT_UNBOUNDEDRAY, SCIP_OKAY, SCIPABORT, SCIPbranchcandGetLPCands(), SCIPerrorMessage, SCIPlpGetSolstat(), Scip::set, Scip::stat, and TRUE.

◆ SCIPgetExternBranchCands()

SCIP_RETCODE SCIPgetExternBranchCands ( SCIP scip,
SCIP_VAR ***  externcands,
SCIP_Real **  externcandssol,
SCIP_Real **  externcandsscore,
int *  nexterncands,
int *  nprioexterncands,
int *  nprioexternbins,
int *  nprioexternints,
int *  nprioexternimpls 
)

gets external branching candidates along with solution values, scores, and number of branching candidates; these branching candidates can be used by relaxations or nonlinear constraint handlers; branching rules should always select the branching candidate among the first nprioexterncands of the candidate list

Returns
SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
Precondition
This method can be called if scip is in one of the following stages:

See SCIP_STAGE for a complete list of all possible solving stages.

Note
Candidate variables with maximal priority are ordered: binaries first, then integers, implicit integers and continuous last.
Parameters
scipSCIP data structure
externcandspointer to store the array of extern branching candidates, or NULL
externcandssolpointer to store the array of extern candidate solution values, or NULL
externcandsscorepointer to store the array of extern candidate scores, or NULL
nexterncandspointer to store the number of extern branching candidates, or NULL
nprioexterncandspointer to store the number of candidates with maximal priority, or NULL
nprioexternbinspointer to store the number of binary candidates with maximal priority, or NULL
nprioexternintspointer to store the number of integer candidates with maximal priority, or NULL
nprioexternimplspointer to store the number of implicit integer candidates with maximal priority, or NULL

Definition at line 36417 of file scip.c.

References Scip::branchcand, checkStage(), FALSE, NULL, SCIP_CALL, SCIP_OKAY, SCIPbranchcandGetExternCands(), and TRUE.

Referenced by SCIP_DECL_BRANCHEXECEXT().

◆ SCIPgetNExternBranchCands()

int SCIPgetNExternBranchCands ( SCIP scip)

gets number of external branching candidates

Returns
the number of external branching candidates.
Precondition
This method can be called if scip is in one of the following stages:

See SCIP_STAGE for a complete list of all possible solving stages.

Parameters
scipSCIP data structure

Definition at line 36449 of file scip.c.

References Scip::branchcand, checkStage(), FALSE, NULL, SCIP_CALL_ABORT, SCIPbranchcandGetNExternCands(), and TRUE.

Referenced by SCIP_DECL_DISPOUTPUT().

◆ SCIPgetNPrioExternBranchCands()

int SCIPgetNPrioExternBranchCands ( SCIP scip)

gets number of external branching candidates with maximal branch priority

Returns
the number of external branching candidates with maximal branch priority.
Precondition
This method can be called if scip is in one of the following stages:

See SCIP_STAGE for a complete list of all possible solving stages.

Parameters
scipSCIP data structure

Definition at line 36469 of file scip.c.

References Scip::branchcand, checkStage(), FALSE, NULL, SCIP_CALL_ABORT, SCIPbranchcandGetNPrioExternCands(), and TRUE.

◆ SCIPgetNPrioExternBranchBins()

int SCIPgetNPrioExternBranchBins ( SCIP scip)

gets number of binary external branching candidates with maximal branch priority

Returns
the number of binary external branching candidates with maximal branch priority.
Precondition
This method can be called if scip is in one of the following stages:

See SCIP_STAGE for a complete list of all possible solving stages.

Parameters
scipSCIP data structure

Definition at line 36489 of file scip.c.

References Scip::branchcand, checkStage(), FALSE, NULL, SCIP_CALL_ABORT, SCIPbranchcandGetNPrioExternBins(), and TRUE.

◆ SCIPgetNPrioExternBranchInts()

int SCIPgetNPrioExternBranchInts ( SCIP scip)

gets number of integer external branching candidates with maximal branch priority

Returns
the number of integer external branching candidates with maximal branch priority.
Precondition
This method can be called if scip is in one of the following stages:

See SCIP_STAGE for a complete list of all possible solving stages.

Parameters
scipSCIP data structure

Definition at line 36510 of file scip.c.

References Scip::branchcand, checkStage(), FALSE, NULL, SCIP_CALL_ABORT, SCIPbranchcandGetNPrioExternInts(), and TRUE.

◆ SCIPgetNPrioExternBranchImpls()

int SCIPgetNPrioExternBranchImpls ( SCIP scip)

gets number of implicit integer external branching candidates with maximal branch priority

Returns
the number of implicit integer external branching candidates with maximal branch priority.
Precondition
This method can be called if scip is in one of the following stages:

See SCIP_STAGE for a complete list of all possible solving stages.

Parameters
scipSCIP data structure

Definition at line 36530 of file scip.c.

References Scip::branchcand, checkStage(), FALSE, NULL, SCIP_CALL_ABORT, SCIPbranchcandGetNPrioExternImpls(), and TRUE.

◆ SCIPgetNPrioExternBranchConts()

int SCIPgetNPrioExternBranchConts ( SCIP scip)

gets number of continuous external branching candidates with maximal branch priority

Returns
the number of continuous external branching candidates with maximal branch priority.
Precondition
This method can be called if scip is in one of the following stages:

See SCIP_STAGE for a complete list of all possible solving stages.

Parameters
scipSCIP data structure

Definition at line 36550 of file scip.c.

References Scip::branchcand, checkStage(), FALSE, NULL, SCIP_CALL_ABORT, SCIPbranchcandGetNPrioExternConts(), and TRUE.

◆ SCIPaddExternBranchCand()

SCIP_RETCODE SCIPaddExternBranchCand ( SCIP scip,
SCIP_VAR var,
SCIP_Real  score,
SCIP_Real  solval 
)

insert variable, its score and its solution value into the external branching candidate storage the relative difference of the current lower and upper bounds of a continuous variable must be at least epsilon

Returns
SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
Precondition
This method can be called if scip is in one of the following stages:

See SCIP_STAGE for a complete list of all possible solving stages.

Parameters
scipSCIP data structure
varvariable to insert
scorescore of external candidate, e.g. infeasibility
solvalvalue of the variable in the current solution

Definition at line 36572 of file scip.c.

References Scip::branchcand, checkStage(), FALSE, NULL, SCIP_Var::scip, SCIP_CALL, SCIP_OKAY, SCIPbranchcandAddExternCand(), Scip::set, and TRUE.

Referenced by collectBranchingCands(), registerBranchingCandidates(), registerBranchingCandidatesCentrality(), registerBranchingCandidatesGap(), registerBranchingCandidatesViolation(), registerBranchingVariables(), registerLargeRelaxValueVariableForBranching(), SCIP_DECL_CONSENFOPS(), and SCIP_DECL_CONSENFORELAX().

◆ SCIPclearExternBranchCands()

void SCIPclearExternBranchCands ( SCIP scip)

removes all external candidates from the storage for external branching

Precondition
This method can be called if scip is in one of the following stages:

See SCIP_STAGE for a complete list of all possible solving stages.

Parameters
scipSCIP data structure

Definition at line 36596 of file scip.c.

References Scip::branchcand, checkStage(), FALSE, NULL, SCIP_CALL_ABORT, SCIPbranchcandClearExternCands(), and TRUE.

◆ SCIPcontainsExternBranchCand()

SCIP_Bool SCIPcontainsExternBranchCand ( SCIP scip,
SCIP_VAR var 
)

checks whether the given variable is contained in the candidate storage for external branching

Returns
whether the given variable is contained in the candidate storage for external branching.
Precondition
This method can be called if scip is in one of the following stages:

See SCIP_STAGE for a complete list of all possible solving stages.

Parameters
scipSCIP data structure
varvariable to look for

Definition at line 36616 of file scip.c.

References Scip::branchcand, checkStage(), FALSE, NULL, SCIP_Var::scip, SCIP_CALL_ABORT, SCIPbranchcandContainsExternCand(), and TRUE.

◆ SCIPgetPseudoBranchCands()

SCIP_RETCODE SCIPgetPseudoBranchCands ( SCIP scip,
SCIP_VAR ***  pseudocands,
int *  npseudocands,
int *  npriopseudocands 
)

gets branching candidates for pseudo solution branching (non-fixed variables) along with the number of candidates

Returns
SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
Precondition
This method can be called if scip is in one of the following stages:

See SCIP_STAGE for a complete list of all possible solving stages.

Parameters
scipSCIP data structure
pseudocandspointer to store the array of pseudo branching candidates, or NULL
npseudocandspointer to store the number of pseudo branching candidates, or NULL
npriopseudocandspointer to store the number of candidates with maximal priority, or NULL

Definition at line 36640 of file scip.c.

References Scip::branchcand, checkStage(), FALSE, SCIP_CALL, SCIP_OKAY, SCIPbranchcandGetPseudoCands(), Scip::set, Scip::transprob, and TRUE.

Referenced by branch(), countSparseSol(), SCIP_DECL_BRANCHEXECLP(), SCIP_DECL_BRANCHEXECPS(), and SCIP_DECL_HEUREXEC().

◆ SCIPgetNPseudoBranchCands()

int SCIPgetNPseudoBranchCands ( SCIP scip)

gets number of branching candidates for pseudo solution branching (non-fixed variables)

Returns
the number branching candidates for pseudo solution branching (non-fixed variables).
Precondition
This method can be called if scip is in one of the following stages:

See SCIP_STAGE for a complete list of all possible solving stages.

Parameters
scipSCIP data structure

Definition at line 36665 of file scip.c.

References Scip::branchcand, checkStage(), FALSE, SCIP_CALL_ABORT, SCIPbranchcandGetNPseudoCands(), and TRUE.

Referenced by applyBoundHeur(), applyVbounds(), applyVboundsFixings(), checkFeasSubtree(), checkSolution(), countSparseSol(), enforceConstraint(), SCIP_DECL_HEUREXEC(), and SCIPapplyHeurDualval().

◆ SCIPgetNPrioPseudoBranchCands()

int SCIPgetNPrioPseudoBranchCands ( SCIP scip)

gets number of branching candidates with maximal branch priority for pseudo solution branching

Returns
the number of branching candidates with maximal branch priority for pseudo solution branching.
Precondition
This method can be called if scip is in one of the following stages:

See SCIP_STAGE for a complete list of all possible solving stages.

Parameters
scipSCIP data structure

Definition at line 36684 of file scip.c.

References Scip::branchcand, checkStage(), FALSE, SCIP_CALL_ABORT, SCIPbranchcandGetNPrioPseudoCands(), and TRUE.

◆ SCIPgetNPrioPseudoBranchBins()

int SCIPgetNPrioPseudoBranchBins ( SCIP scip)

gets number of binary branching candidates with maximal branch priority for pseudo solution branching

Returns
the number of binary branching candidates with maximal branch priority for pseudo solution branching.
Precondition
This method can be called if scip is in one of the following stages:

See SCIP_STAGE for a complete list of all possible solving stages.

Parameters
scipSCIP data structure

Definition at line 36702 of file scip.c.

References Scip::branchcand, checkStage(), FALSE, SCIP_CALL_ABORT, SCIPbranchcandGetNPrioPseudoBins(), and TRUE.

Referenced by fixVariable().

◆ SCIPgetNPrioPseudoBranchInts()

int SCIPgetNPrioPseudoBranchInts ( SCIP scip)

gets number of integer branching candidates with maximal branch priority for pseudo solution branching

Returns
the number of integer branching candidates with maximal branch priority for pseudo solution branching.
Precondition
This method can be called if scip is in one of the following stages:

See SCIP_STAGE for a complete list of all possible solving stages.

Parameters
scipSCIP data structure

Definition at line 36720 of file scip.c.

References Scip::branchcand, checkStage(), FALSE, SCIP_CALL_ABORT, SCIPbranchcandGetNPrioPseudoInts(), and TRUE.

◆ SCIPgetNPrioPseudoBranchImpls()

int SCIPgetNPrioPseudoBranchImpls ( SCIP scip)

gets number of implicit integer branching candidates with maximal branch priority for pseudo solution branching

Returns
the number of implicit integer branching candidates with maximal branch priority for pseudo solution branching.
Precondition
This method can be called if scip is in one of the following stages:

See SCIP_STAGE for a complete list of all possible solving stages.

Parameters
scipSCIP data structure

Definition at line 36738 of file scip.c.

References Scip::branchcand, checkStage(), FALSE, SCIP_CALL_ABORT, SCIPbranchcandGetNPrioPseudoImpls(), and TRUE.

◆ SCIPgetBranchScore()

SCIP_Real SCIPgetBranchScore ( SCIP scip,
SCIP_VAR var,
SCIP_Real  downgain,
SCIP_Real  upgain 
)

calculates the branching score out of the gain predictions for a binary branching

Returns
the branching score out of the gain predictions for a binary branching.
Precondition
This method can be called if scip is in one of the following stages:

See SCIP_STAGE for a complete list of all possible solving stages.

Parameters
scipSCIP data structure
varvariable, of which the branching factor should be applied, or NULL
downgainprediction of objective gain for rounding downwards
upgainprediction of objective gain for rounding upwards

Definition at line 36756 of file scip.c.

References checkStage(), FALSE, NULL, SCIP_Var::scip, SCIP_CALL_ABORT, SCIPbranchGetScore(), Scip::set, and TRUE.

Referenced by execRelpscost(), getNActiveConsScore(), SCIP_DECL_BRANCHEXECLP(), SCIPselectVarPseudoStrongBranching(), SCIPselectVarStrongBranching(), selectVarMultAggrBranching(), and updateBestCandidate().

◆ SCIPgetBranchScoreMultiple()

SCIP_Real SCIPgetBranchScoreMultiple ( SCIP scip,
SCIP_VAR var,
int  nchildren,
SCIP_Real gains 
)

calculates the branching score out of the gain predictions for a branching with arbitrary many children

Returns
the branching score out of the gain predictions for a branching with arbitrary many children.
Precondition
This method can be called if scip is in one of the following stages:

See SCIP_STAGE for a complete list of all possible solving stages.

Parameters
scipSCIP data structure
varvariable, of which the branching factor should be applied, or NULL
nchildrennumber of children that the branching will create
gainsprediction of objective gain for each child

Definition at line 36779 of file scip.c.

References checkStage(), FALSE, SCIP_Var::scip, SCIP_CALL_ABORT, SCIPbranchGetScoreMultiple(), Scip::set, and TRUE.

Referenced by SCIPselectVarPseudoStrongBranching().

◆ SCIPgetBranchingPoint()

SCIP_Real SCIPgetBranchingPoint ( SCIP scip,
SCIP_VAR var,
SCIP_Real  suggestion 
)

computes a branching point for a continuous or discrete variable

See also
SCIPbranchGetBranchingPoint
Returns
the branching point for a continuous or discrete variable.
Precondition
This method can be called if scip is in one of the following stages:

See SCIP_STAGE for a complete list of all possible solving stages.

Parameters
scipSCIP data structure
varvariable, of which the branching point should be computed
suggestionsuggestion for branching point, or SCIP_INVALID if no suggestion

Definition at line 36804 of file scip.c.

References checkStage(), FALSE, SCIP_Var::scip, SCIP_CALL_ABORT, SCIPbranchGetBranchingPoint(), Scip::set, Scip::tree, and TRUE.

Referenced by performBranching(), SCIP_DECL_BRANCHEXECEXT(), and updateBestCandidate().

◆ SCIPcalcNodeselPriority()

SCIP_Real SCIPcalcNodeselPriority ( SCIP scip,
SCIP_VAR var,
SCIP_BRANCHDIR  branchdir,
SCIP_Real  targetvalue 
)

calculates the node selection priority for moving the given variable's LP value to the given target value; this node selection priority can be given to the SCIPcreateChild() call

Returns
the node selection priority for moving the given variable's LP value to the given target value.
Precondition
This method can be called if scip is in one of the following stages:

See SCIP_STAGE for a complete list of all possible solving stages.

Parameters
scipSCIP data structure
varvariable on which the branching is applied
branchdirtype of branching that was performed: upwards, downwards, or fixed; fixed should only be used, when both bounds changed
targetvaluenew value of the variable in the child node

Definition at line 36827 of file scip.c.

References checkStage(), FALSE, SCIP_Var::scip, SCIP_CALL_ABORT, SCIPtreeCalcNodeselPriority(), Scip::set, Scip::stat, Scip::tree, and TRUE.

Referenced by branchBalancedCardinality(), branchUnbalancedCardinality(), createNAryBranch(), enforceConflictgraph(), enforceConssSOS1(), and enforceSOS2().

◆ SCIPcalcChildEstimate()

SCIP_Real SCIPcalcChildEstimate ( SCIP scip,
SCIP_VAR var,
SCIP_Real  targetvalue 
)

calculates an estimate for the objective of the best feasible solution contained in the subtree after applying the given branching; this estimate can be given to the SCIPcreateChild() call

Returns
the estimate for the objective of the best feasible solution contained in the subtree after applying the given branching.
Precondition
This method can be called if scip is in one of the following stages:

See SCIP_STAGE for a complete list of all possible solving stages.

Parameters
scipSCIP data structure
varvariable on which the branching is applied
targetvaluenew value of the variable in the child node

Definition at line 36854 of file scip.c.

References checkStage(), FALSE, SCIP_Var::scip, SCIP_CALL_ABORT, SCIPtreeCalcChildEstimate(), Scip::set, Scip::stat, Scip::tree, and TRUE.

Referenced by branchBalancedCardinality(), branchUnbalancedCardinality(), createNAryBranch(), enforceConflictgraph(), enforceConssSOS1(), enforceIndicators(), enforceSOS2(), and performBranching().

◆ SCIPcreateChild()

SCIP_RETCODE SCIPcreateChild ( SCIP scip,
SCIP_NODE **  node,
SCIP_Real  nodeselprio,
SCIP_Real  estimate 
)

creates a child node of the focus node

Returns
SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
Precondition
This method can be called if scip is in one of the following stages:

See SCIP_STAGE for a complete list of all possible solving stages.

Parameters
scipSCIP data structure
nodepointer to node data structure
nodeselprionode selection priority of new node
estimateestimate for(transformed) objective value of best feasible solution in subtree

Definition at line 36877 of file scip.c.

References checkStage(), FALSE, Scip::mem, NULL, SCIP_Mem::probmem, SCIP_CALL, SCIP_OKAY, SCIPnodeCreateChild(), Scip::set, Scip::stat, Scip::tree, and TRUE.

Referenced by branchBalancedCardinality(), branchCons(), branchUnbalancedCardinality(), createNAryBranch(), enforceConflictgraph(), enforceConssSOS1(), enforceConstraint(), enforceIndicators(), enforceSOS2(), performBranching(), and SCIP_DECL_BRANCHEXECLP().

◆ SCIPbranchVar()

SCIP_RETCODE SCIPbranchVar ( SCIP scip,
SCIP_VAR var,
SCIP_NODE **  downchild,
SCIP_NODE **  eqchild,
SCIP_NODE **  upchild 
)

branches on a non-continuous variable v using the current LP or pseudo solution; if solution value x' is fractional, two child nodes will be created (x <= floor(x'), x >= ceil(x')), if solution value is integral, the x' is equal to lower or upper bound of the branching variable and the bounds of v are finite, then two child nodes will be created (x <= x'', x >= x''+1 with x'' = floor((lb + ub)/2)), otherwise (up to) three child nodes will be created (x <= x'-1, x == x', x >= x'+1)

Returns
SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
Precondition
This method can be called if scip is in one of the following stages:

See SCIP_STAGE for a complete list of all possible solving stages.

Parameters
scipSCIP data structure
varvariable to branch on
downchildpointer to return the left child with variable rounded down, or NULL
eqchildpointer to return the middle child with variable fixed, or NULL
upchildpointer to return the right child with variable rounded up, or NULL

Definition at line 36910 of file scip.c.

References Scip::branchcand, checkStage(), Scip::eventqueue, FALSE, Scip::lp, Scip::mem, Scip::origprob, SCIP_Mem::probmem, Scip::reopt, SCIP_Var::scip, SCIP_CALL, SCIP_INVALID, SCIP_INVALIDDATA, SCIP_OKAY, SCIP_VARTYPE_CONTINUOUS, SCIPerrorMessage, SCIPsetIsEQ(), SCIPtreeBranchVar(), SCIPvarGetLbLocal(), SCIPvarGetName(), SCIPvarGetType(), SCIPvarGetUbLocal(), Scip::set, Scip::stat, Scip::transprob, Scip::tree, and TRUE.

Referenced by performBranching(), SCIP_DECL_BRANCHEXECLP(), and SCIP_DECL_BRANCHEXECPS().

◆ SCIPbranchVarHole()

SCIP_RETCODE SCIPbranchVarHole ( SCIP scip,
SCIP_VAR var,
SCIP_Real  left,
SCIP_Real  right,
SCIP_NODE **  downchild,
SCIP_NODE **  upchild 
)

branches a variable x using a given domain hole; two child nodes (x <= left, x >= right) are created

Returns
SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
Precondition
This method can be called if scip is in one of the following stages:

See SCIP_STAGE for a complete list of all possible solving stages.

Parameters
scipSCIP data structure
varvariable to branch on
leftleft side of the domain hole
rightright side of the domain hole
downchildpointer to return the left child (x <= left), or NULL
upchildpointer to return the right child (x >= right), or NULL

Definition at line 36951 of file scip.c.

References Scip::branchcand, checkStage(), Scip::eventqueue, FALSE, Scip::lp, Scip::mem, Scip::origprob, SCIP_Mem::probmem, Scip::reopt, SCIP_Var::scip, SCIP_CALL, SCIP_OKAY, SCIPtreeBranchVarHole(), Scip::set, Scip::stat, Scip::transprob, Scip::tree, and TRUE.

Referenced by applyAlternativeBoundsBranching().

◆ SCIPbranchVarVal()

SCIP_RETCODE SCIPbranchVarVal ( SCIP scip,
SCIP_VAR var,
SCIP_Real  val,
SCIP_NODE **  downchild,
SCIP_NODE **  eqchild,
SCIP_NODE **  upchild 
)

branches on a variable x using a given value x'; for continuous variables with relative domain width larger epsilon, x' must not be one of the bounds; two child nodes (x <= x', x >= x') are created; for integer variables, if solution value x' is fractional, two child nodes are created (x <= floor(x'), x >= ceil(x')), if x' is integral, three child nodes are created (x <= x'-1, x == x', x >= x'+1)

Returns
SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
Precondition
This method can be called if scip is in one of the following stages:

See SCIP_STAGE for a complete list of all possible solving stages.

Parameters
scipSCIP data structure
varvariable to branch on
valvalue to branch on
downchildpointer to return the left child with variable rounded down, or NULL
eqchildpointer to return the middle child with variable fixed, or NULL
upchildpointer to return the right child with variable rounded up, or NULL

Definition at line 36986 of file scip.c.

References Scip::branchcand, checkStage(), Scip::eventqueue, FALSE, Scip::lp, Scip::mem, Scip::origprob, SCIP_Mem::probmem, Scip::reopt, SCIP_Var::scip, SCIP_CALL, SCIP_INVALIDDATA, SCIP_OKAY, SCIP_VARTYPE_CONTINUOUS, SCIPerrorMessage, SCIPisInfinity(), SCIPisLT(), SCIPisRelEQ(), SCIPsetIsEQ(), SCIPtreeBranchVar(), SCIPvarGetLbLocal(), SCIPvarGetName(), SCIPvarGetType(), SCIPvarGetUbLocal(), Scip::set, Scip::stat, Scip::transprob, Scip::tree, and TRUE.

Referenced by branch(), execRelpscost(), performBranching(), and SCIP_DECL_BRANCHEXECEXT().

◆ SCIPbranchVarValNary()

SCIP_RETCODE SCIPbranchVarValNary ( SCIP scip,
SCIP_VAR var,
SCIP_Real  val,
int  n,
SCIP_Real  minwidth,
SCIP_Real  widthfactor,
int *  nchildren 
)

n-ary branching on a variable x using a given value

Branches on variable x such that up to n/2 children are created on each side of the usual branching value. The branching value is selected as in SCIPbranchVarVal(). The parameters minwidth and widthfactor determine the domain width of the branching variable in the child nodes. If n is odd, one child with domain width 'width' and having the branching value in the middle is created. Otherwise, two children with domain width 'width' and being left and right of the branching value are created. Next further nodes to the left and right are created, where width is multiplied by widthfactor with increasing distance from the first nodes. The initial width is calculated such that n/2 nodes are created to the left and to the right of the branching value. If this value is below minwidth, the initial width is set to minwidth, which may result in creating less than n nodes.

Giving a large value for widthfactor results in creating children with small domain when close to the branching value and large domain when closer to the current variable bounds. That is, setting widthfactor to a very large value and n to 3 results in a ternary branching where the branching variable is mostly fixed in the middle child. Setting widthfactor to 1.0 results in children where the branching variable always has the same domain width (except for one child if the branching value is not in the middle).

Returns
SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
Precondition
This method can be called if scip is in one of the following stages:

See SCIP_STAGE for a complete list of all possible solving stages.

Parameters
scipSCIP data structure
varvariable to branch on
valvalue to branch on
nattempted number of children to be created, must be >= 2
minwidthminimal domain width in children
widthfactormultiplier for children domain width with increasing distance from val, must be >= 1.0
nchildrenpointer to store number of created children, or NULL

Definition at line 37049 of file scip.c.

References Scip::branchcand, checkStage(), Scip::eventqueue, FALSE, Scip::lp, Scip::mem, Scip::origprob, SCIP_Mem::probmem, Scip::reopt, SCIP_Var::scip, SCIP_CALL, SCIP_INVALIDDATA, SCIP_OKAY, SCIP_VARTYPE_CONTINUOUS, SCIPerrorMessage, SCIPisInfinity(), SCIPisLT(), SCIPisRelEQ(), SCIPsetIsEQ(), SCIPtreeBranchVarNary(), SCIPvarGetLbLocal(), SCIPvarGetName(), SCIPvarGetType(), SCIPvarGetUbLocal(), Scip::set, Scip::stat, Scip::transprob, Scip::tree, and TRUE.

Referenced by SCIP_DECL_BRANCHEXECEXT().

◆ SCIPbranchLP()

SCIP_RETCODE SCIPbranchLP ( SCIP scip,
SCIP_RESULT result 
)

calls branching rules to branch on an LP solution; if no fractional variables exist, the result is SCIP_DIDNOTRUN; if the branch priority of an unfixed variable is larger than the maximal branch priority of the fractional variables, pseudo solution branching is applied on the unfixed variables with maximal branch priority

Returns
SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
Precondition
This method can be called if scip is in one of the following stages:

See SCIP_STAGE for a complete list of all possible solving stages.

Parameters
scipSCIP data structure
resultpointer to store the result of the branching (s. branch.h)

Definition at line 37094 of file scip.c.

References Scip::branchcand, checkStage(), SCIP_Primal::cutoffbound, Scip::eventqueue, FALSE, Scip::lp, Scip::mem, Scip::origprob, Scip::primal, SCIP_Mem::probmem, Scip::reopt, SCIP_CALL, SCIP_OKAY, SCIPbranchExecLP(), Scip::sepastore, Scip::set, Scip::stat, Scip::transprob, Scip::tree, and TRUE.

Referenced by SCIP_DECL_CONSENFOLP().

◆ SCIPbranchExtern()

SCIP_RETCODE SCIPbranchExtern ( SCIP scip,
SCIP_RESULT result 
)

calls branching rules to branch on a external candidates; if no such candidates exist, the result is SCIP_DIDNOTRUN

Returns
SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
Precondition
This method can be called if scip is in one of the following stages:

See SCIP_STAGE for a complete list of all possible solving stages.

Parameters
scipSCIP data structure
resultpointer to store the result of the branching (s. branch.h)

Definition at line 37118 of file scip.c.

References Scip::branchcand, checkStage(), SCIP_Primal::cutoffbound, Scip::eventqueue, FALSE, Scip::lp, Scip::mem, Scip::origprob, Scip::primal, SCIP_Mem::probmem, Scip::reopt, SCIP_CALL, SCIP_OKAY, SCIPbranchExecExtern(), Scip::sepastore, Scip::set, Scip::stat, Scip::transprob, Scip::tree, and TRUE.

Referenced by SCIP_DECL_CONSENFORELAX().

◆ SCIPbranchPseudo()

SCIP_RETCODE SCIPbranchPseudo ( SCIP scip,
SCIP_RESULT result 
)

calls branching rules to branch on a pseudo solution; if no unfixed variables exist, the result is SCIP_DIDNOTRUN

Returns
SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
Precondition
This method can be called if scip is in one of the following stages:

See SCIP_STAGE for a complete list of all possible solving stages.

Parameters
scipSCIP data structure
resultpointer to store the result of the branching (s. branch.h)

Definition at line 37142 of file scip.c.

References Scip::branchcand, checkStage(), SCIP_Primal::cutoffbound, Scip::eventqueue, FALSE, Scip::lp, Scip::mem, Scip::origprob, Scip::primal, SCIP_Mem::probmem, Scip::reopt, SCIP_CALL, SCIP_OKAY, SCIPbranchExecPseudo(), Scip::set, Scip::stat, Scip::transprob, Scip::tree, and TRUE.