Skip to content
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* SCIP --- Solving Constraint Integer Programs */
/* */
/* Copyright (C) 2002-2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* SCIP is distributed under the terms of the ZIB Academic License. */
/* */
/* You should have received a copy of the ZIB Academic License */
/* along with SCIP; see the file COPYING. If not visit scipopt.org. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**@file bitencode.h
* @brief packing single and dual bit values
* @author Thorsten Koch
* @author Tobias Achterberg
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_BITENCODE_H__
#define __SCIP_BITENCODE_H__
#ifdef __cplusplus
extern "C" {
#endif
typedef unsigned int SCIP_SINGLEPACKET; /**< storing single bits in packed format */
#define SCIP_SINGLEPACKETSIZE (sizeof(SCIP_SINGLEPACKET)*8) /**< each entry needs one bit of information */
typedef unsigned int SCIP_DUALPACKET; /**< storing bit pairs in packed format */
#define SCIP_DUALPACKETSIZE (sizeof(SCIP_DUALPACKET)*4) /**< each entry needs two bits of information */
/** encode a single bit vector into packed format */
void SCIPencodeSingleBit(
const int* inp, /**< unpacked input vector */
SCIP_SINGLEPACKET* out, /**< buffer to store the packed vector */
int count /**< number of elements */
);
/** decode a packed single bit vector into unpacked format */
void SCIPdecodeSingleBit(
const SCIP_SINGLEPACKET* inp, /**< packed input vector */
int* out, /**< buffer to store unpacked vector */
int count /**< number of elements */
);
/** encode a dual bit vector into packed format */
void SCIPencodeDualBit(
const int* inp, /**< unpacked input vector */
SCIP_DUALPACKET* out, /**< buffer to store the packed vector */
int count /**< number of elements */
);
/** decode a packed dual bit vector into unpacked format */
void SCIPdecodeDualBit(
const SCIP_DUALPACKET* inp, /**< packed input vector */
int* out, /**< buffer to store unpacked vector */
int count /**< number of elements */
);
#ifdef __cplusplus
}
#endif
#endif
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* SCIP --- Solving Constraint Integer Programs */
/* */
/* Copyright (C) 2002-2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* SCIP is distributed under the terms of the ZIB Academic License. */
/* */
/* You should have received a copy of the ZIB Academic License */
/* along with SCIP; see the file COPYING. If not visit scipopt.org. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**@file boundstore.h
* @ingroup PARALLEL
* @brief the interface of the boundstore structure
* @author Leona Gottwald
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#include "scip/def.h"
#include "scip/type_syncstore.h"
#include "scip/type_scip.h"
#include "scip/type_lp.h"
#include "scip/type_retcode.h"
#ifndef __SCIP_BOUNDSTORE_H__
#define __SCIP_BOUNDSTORE_H__
/** create bound store data structure */
SCIP_EXPORT
SCIP_RETCODE SCIPboundstoreCreate(
SCIP* scip, /**< scip main datastructure */
SCIP_BOUNDSTORE** boundstore, /**< pointer to store the bound store datastructure */
int nvars /**< number of variables for which bounds may be stored */
);
/** free bound store data structure */
SCIP_EXPORT
void SCIPboundstoreFree(
SCIP* scip, /**< scip main datastructure */
SCIP_BOUNDSTORE** boundstore /**< pointer to the bound store datastructure */
);
/** add bound change to bound store data structure */
SCIP_EXPORT
SCIP_RETCODE SCIPboundstoreAdd(
SCIP* scip, /**< scip main datastructure */
SCIP_BOUNDSTORE* boundstore, /**< the bound store datastructure */
int varidx, /**< variable index of bound change, must be smaller than the
* number of variables given during creation of bound store */
SCIP_Real newbound, /**< bound value of variable */
SCIP_BOUNDTYPE boundtype /**< type of new bound */
);
/** add all bound changes of source to target */
SCIP_EXPORT
SCIP_RETCODE SCIPboundstoreMerge(
SCIP* scip, /**< scip main datastructure for target boundstore */
SCIP_BOUNDSTORE* target, /**< the bound store datastructure where the bounds get merged in */
SCIP_BOUNDSTORE* source /**< the bound store datastructure from which the bounds get merged in */
);
/** remove all boundchanges from bound store */
SCIP_EXPORT
void SCIPboundstoreClear(
SCIP_BOUNDSTORE* boundstore /**< the bound store datastructure */
);
/** gets variable index of the i'th stored boundchange */
SCIP_EXPORT
int SCIPboundstoreGetChgVaridx(
SCIP_BOUNDSTORE* boundstore, /**< the bound store datastructure */
int i /**< the index of the bound change */
);
/** gets the type of the i'th stored boundchange */
SCIP_EXPORT
SCIP_BOUNDTYPE SCIPboundstoreGetChgType(
SCIP_BOUNDSTORE* boundstore, /**< the bound store datastructure */
int i /**< the index of the bound change */
);
/** gets the bound value of the i'th stored boundchange */
SCIP_EXPORT
SCIP_Real SCIPboundstoreGetChgVal(
SCIP_BOUNDSTORE* boundstore, /**< the bound store datastructure */
int i /**< the index of the bound change */
);
/** gets the number of stored bound changes */
SCIP_EXPORT
int SCIPboundstoreGetNChgs(
SCIP_BOUNDSTORE* boundstore /**< the bound store datastructure */
);
#endif
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* SCIP --- Solving Constraint Integer Programs */
/* */
/* Copyright (C) 2002-2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* SCIP is distributed under the terms of the ZIB Academic License. */
/* */
/* You should have received a copy of the ZIB Academic License */
/* along with SCIP; see the file COPYING. If not visit scipopt.org. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**@file branch.h
* @ingroup INTERNALAPI
* @brief internal methods for branching rules and branching candidate storage
* @author Tobias Achterberg
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_BRANCH_H__
#define __SCIP_BRANCH_H__
#include "blockmemshell/memory.h"
#include "scip/def.h"
#include "scip/type_branch.h"
#include "scip/type_event.h"
#include "scip/type_lp.h"
#include "scip/type_message.h"
#include "scip/type_prob.h"
#include "scip/type_reopt.h"
#include "scip/type_result.h"
#include "scip/type_retcode.h"
#include "scip/type_scip.h"
#include "scip/type_sepastore.h"
#include "scip/type_set.h"
#include "scip/type_stat.h"
#include "scip/type_tree.h"
#include "scip/type_var.h"
#ifdef __cplusplus
extern "C" {
#endif
/*
* branching candidate storage methods
*/
/** creates a branching candidate storage */
SCIP_RETCODE SCIPbranchcandCreate(
SCIP_BRANCHCAND** branchcand /**< pointer to store branching candidate storage */
);
/** frees branching candidate storage */
SCIP_RETCODE SCIPbranchcandFree(
SCIP_BRANCHCAND** branchcand /**< pointer to store branching candidate storage */
);
/** invalidates branching candidates storage */
void SCIPbranchcandInvalidate(
SCIP_BRANCHCAND* branchcand /**< pointer to store branching candidate storage */
);
/** gets branching candidates for LP solution branching (fractional variables) */
SCIP_RETCODE SCIPbranchcandGetLPCands(
SCIP_BRANCHCAND* branchcand, /**< branching candidate storage */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< problem statistics */
SCIP_LP* lp, /**< current LP data */
SCIP_VAR*** lpcands, /**< pointer to store the array of LP branching candidates, or NULL */
SCIP_Real** lpcandssol, /**< pointer to store the array of LP candidate solution values, or NULL */
SCIP_Real** lpcandsfrac, /**< pointer to store the array of LP candidate fractionalities, or NULL */
int* nlpcands, /**< pointer to store the number of LP branching candidates, or NULL */
int* npriolpcands, /**< pointer to store the number of candidates with maximal priority, or NULL */
int* nfracimplvars /**< pointer to store the number of implicit fractional variables, or NULL */
);
/** gets external branching candidates */
SCIP_RETCODE SCIPbranchcandGetExternCands(
SCIP_BRANCHCAND* branchcand, /**< branching candidate storage */
SCIP_VAR*** externcands, /**< pointer to store the array of external branching candidates, or NULL */
SCIP_Real** externcandssol, /**< pointer to store the array of external candidate solution values, or NULL */
SCIP_Real** externcandsscore, /**< pointer to store the array of external candidate scores, or NULL */
int* nexterncands, /**< pointer to store the number of external branching candidates, or NULL */
int* nprioexterncands, /**< pointer to store the number of candidates with maximal priority, or NULL */
int* nprioexternbins, /**< pointer to store the number of binary candidates with maximal priority, or NULL */
int* nprioexternints, /**< pointer to store the number of integer candidates with maximal priority, or NULL */
int* nprioexternimpls /**< pointer to store the number of implicit integer candidates with maximal priority,
* or NULL */
);
/** gets maximal branching priority of LP branching candidates */
int SCIPbranchcandGetLPMaxPrio(
SCIP_BRANCHCAND* branchcand /**< branching candidate storage */
);
/** gets number of LP branching candidates with maximal branch priority */
int SCIPbranchcandGetNPrioLPCands(
SCIP_BRANCHCAND* branchcand /**< branching candidate storage */
);
/** gets maximal branching priority of external branching candidates */
int SCIPbranchcandGetExternMaxPrio(
SCIP_BRANCHCAND* branchcand /**< branching candidate storage */
);
/** gets number of external branching candidates */
int SCIPbranchcandGetNExternCands(
SCIP_BRANCHCAND* branchcand /**< branching candidate storage */
);
/** gets number of external branching candidates with maximal branch priority */
int SCIPbranchcandGetNPrioExternCands(
SCIP_BRANCHCAND* branchcand /**< branching candidate storage */
);
/** gets number of binary external branching candidates with maximal branch priority */
int SCIPbranchcandGetNPrioExternBins(
SCIP_BRANCHCAND* branchcand /**< branching candidate storage */
);
/** gets number of integer external branching candidates with maximal branch priority */
int SCIPbranchcandGetNPrioExternInts(
SCIP_BRANCHCAND* branchcand /**< branching candidate storage */
);
/** gets number of implicit integer external branching candidates with maximal branch priority */
int SCIPbranchcandGetNPrioExternImpls(
SCIP_BRANCHCAND* branchcand /**< branching candidate storage */
);
/** gets number of continuous external branching candidates with maximal branch priority */
int SCIPbranchcandGetNPrioExternConts(
SCIP_BRANCHCAND* branchcand /**< branching candidate storage */
);
/** insert variable, its score and its solution value into the external branching candidate storage
* the absolute difference of the current lower and upper bounds of the variable must be at least epsilon
*/
SCIP_RETCODE SCIPbranchcandAddExternCand(
SCIP_BRANCHCAND* branchcand, /**< branching candidate storage */
SCIP_SET* set, /**< global SCIP settings */
SCIP_VAR* var, /**< variable to insert */
SCIP_Real score, /**< score of external candidate, e.g. infeasibility */
SCIP_Real solval /**< value of the variable in the current solution */
);
/** removes all external candidates from the storage for external branching */
void SCIPbranchcandClearExternCands(
SCIP_BRANCHCAND* branchcand /**< branching candidate storage */
);
/** checks whether the given variable is contained in the candidate storage for external branching */
SCIP_Bool SCIPbranchcandContainsExternCand(
SCIP_BRANCHCAND* branchcand, /**< branching candidate storage */
SCIP_VAR* var /**< variable to look for */
);
/** gets branching candidates for pseudo solution branching (non-fixed variables) */
SCIP_RETCODE SCIPbranchcandGetPseudoCands(
SCIP_BRANCHCAND* branchcand, /**< branching candidate storage */
SCIP_SET* set, /**< global SCIP settings */
SCIP_PROB* prob, /**< problem data */
SCIP_VAR*** pseudocands, /**< pointer to store the array of pseudo branching candidates, or NULL */
int* npseudocands, /**< pointer to store the number of pseudo branching candidates, or NULL */
int* npriopseudocands /**< pointer to store the number of candidates with maximal priority, or NULL */
);
/** gets number of branching candidates for pseudo solution branching (non-fixed variables) */
int SCIPbranchcandGetNPseudoCands(
SCIP_BRANCHCAND* branchcand /**< branching candidate storage */
);
/** gets number of branching candidates with maximal branch priority for pseudo solution branching */
int SCIPbranchcandGetNPrioPseudoCands(
SCIP_BRANCHCAND* branchcand /**< branching candidate storage */
);
/** gets number of binary branching candidates with maximal branch priority for pseudo solution branching */
int SCIPbranchcandGetNPrioPseudoBins(
SCIP_BRANCHCAND* branchcand /**< branching candidate storage */
);
/** gets number of integer branching candidates with maximal branch priority for pseudo solution branching */
int SCIPbranchcandGetNPrioPseudoInts(
SCIP_BRANCHCAND* branchcand /**< branching candidate storage */
);
/** gets number of implicit integer branching candidates with maximal branch priority for pseudo solution branching */
int SCIPbranchcandGetNPrioPseudoImpls(
SCIP_BRANCHCAND* branchcand /**< branching candidate storage */
);
/** removes variable from branching candidate list */
SCIP_RETCODE SCIPbranchcandRemoveVar(
SCIP_BRANCHCAND* branchcand, /**< branching candidate storage */
SCIP_VAR* var /**< variable that changed its bounds */
);
/** updates branching candidate list for a given variable */
SCIP_RETCODE SCIPbranchcandUpdateVar(
SCIP_BRANCHCAND* branchcand, /**< branching candidate storage */
SCIP_SET* set, /**< global SCIP settings */
SCIP_VAR* var /**< variable that changed its bounds */
);
/** updates branching priority of the given variable and update the pseudo candidate array if needed */
SCIP_RETCODE SCIPbranchcandUpdateVarBranchPriority(
SCIP_BRANCHCAND* branchcand, /**< branching candidate storage */
SCIP_SET* set, /**< global SCIP settings */
SCIP_VAR* var, /**< variable that changed its bounds */
int branchpriority /**< branch priority of the variable */
);
/*
* branching rules
*/
/** copies the given branchrule to a new scip */
SCIP_RETCODE SCIPbranchruleCopyInclude(
SCIP_BRANCHRULE* branchrule, /**< branchrule */
SCIP_SET* set /**< SCIP_SET of SCIP to copy to */
);
/** creates a branching rule */
SCIP_RETCODE SCIPbranchruleCreate(
SCIP_BRANCHRULE** branchrule, /**< pointer to store branching rule */
SCIP_SET* set, /**< global SCIP settings */
SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
BMS_BLKMEM* blkmem, /**< block memory for parameter settings */
const char* name, /**< name of branching rule */
const char* desc, /**< description of branching rule */
int priority, /**< priority of the branching rule */
int maxdepth, /**< maximal depth level, up to which this branching rule should be used (or -1) */
SCIP_Real maxbounddist, /**< maximal relative distance from current node's dual bound to primal bound
* compared to best node's dual bound for applying branching rule
* (0.0: only on current best node, 1.0: on all nodes) */
SCIP_DECL_BRANCHCOPY ((*branchcopy)), /**< copy method of branching rule */
SCIP_DECL_BRANCHFREE ((*branchfree)), /**< destructor of branching rule */
SCIP_DECL_BRANCHINIT ((*branchinit)), /**< initialize branching rule */
SCIP_DECL_BRANCHEXIT ((*branchexit)), /**< deinitialize branching rule */
SCIP_DECL_BRANCHINITSOL((*branchinitsol)),/**< solving process initialization method of branching rule */
SCIP_DECL_BRANCHEXITSOL((*branchexitsol)),/**< solving process deinitialization method of branching rule */
SCIP_DECL_BRANCHEXECLP((*branchexeclp)), /**< branching execution method for fractional LP solutions */
SCIP_DECL_BRANCHEXECEXT((*branchexecext)),/**< branching execution method for external solutions */
SCIP_DECL_BRANCHEXECPS((*branchexecps)), /**< branching execution method for not completely fixed pseudo solutions */
SCIP_BRANCHRULEDATA* branchruledata /**< branching rule data */
);
/** frees memory of branching rule */
SCIP_RETCODE SCIPbranchruleFree(
SCIP_BRANCHRULE** branchrule, /**< pointer to branching rule data structure */
SCIP_SET* set /**< global SCIP settings */
);
/** initializes branching rule */
SCIP_RETCODE SCIPbranchruleInit(
SCIP_BRANCHRULE* branchrule, /**< branching rule */
SCIP_SET* set /**< global SCIP settings */
);
/** deinitializes branching rule */
SCIP_RETCODE SCIPbranchruleExit(
SCIP_BRANCHRULE* branchrule, /**< branching rule */
SCIP_SET* set /**< global SCIP settings */
);
/** informs branching rule that the branch and bound process is being started */
SCIP_RETCODE SCIPbranchruleInitsol(
SCIP_BRANCHRULE* branchrule, /**< branching rule */
SCIP_SET* set /**< global SCIP settings */
);
/** informs branching rule that the branch and bound process data is being freed */
SCIP_RETCODE SCIPbranchruleExitsol(
SCIP_BRANCHRULE* branchrule, /**< branching rule */
SCIP_SET* set /**< global SCIP settings */
);
/** executes branching rule for fractional LP solution */
SCIP_RETCODE SCIPbranchruleExecLPSol(
SCIP_BRANCHRULE* branchrule, /**< branching rule */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< problem statistics */
SCIP_TREE* tree, /**< branch and bound tree */
SCIP_SEPASTORE* sepastore, /**< separation storage */
SCIP_Real cutoffbound, /**< global upper cutoff bound */
SCIP_Bool allowaddcons, /**< should adding constraints be allowed to avoid a branching? */
SCIP_RESULT* result /**< pointer to store the result of the callback method */
);
/** executes branching rule for external branching candidates */
SCIP_RETCODE SCIPbranchruleExecExternSol(
SCIP_BRANCHRULE* branchrule, /**< branching rule */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< problem statistics */
SCIP_TREE* tree, /**< branch and bound tree */
SCIP_SEPASTORE* sepastore, /**< separation storage */
SCIP_Real cutoffbound, /**< global upper cutoff bound */
SCIP_Bool allowaddcons, /**< should adding constraints be allowed to avoid a branching? */
SCIP_RESULT* result /**< pointer to store the result of the callback method */
);
/** executes branching rule for not completely fixed pseudo solution */
SCIP_RETCODE SCIPbranchruleExecPseudoSol(
SCIP_BRANCHRULE* branchrule, /**< branching rule */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< problem statistics */
SCIP_TREE* tree, /**< branch and bound tree */
SCIP_Real cutoffbound, /**< global upper cutoff bound */
SCIP_Bool allowaddcons, /**< should adding constraints be allowed to avoid a branching? */
SCIP_RESULT* result /**< pointer to store the result of the callback method */
);
/** sets priority of branching rule */
void SCIPbranchruleSetPriority(
SCIP_BRANCHRULE* branchrule, /**< branching rule */
SCIP_SET* set, /**< global SCIP settings */
int priority /**< new priority of the branching rule */
);
/** sets maximal depth level, up to which this branching rule should be used (-1 for no limit) */
void SCIPbranchruleSetMaxdepth(
SCIP_BRANCHRULE* branchrule, /**< branching rule */
int maxdepth /**< new maxdepth of the branching rule */
);
/** sets maximal relative distance from current node's dual bound to primal bound for applying branching rule */
void SCIPbranchruleSetMaxbounddist(
SCIP_BRANCHRULE* branchrule, /**< branching rule */
SCIP_Real maxbounddist /**< new maxbounddist of the branching rule */
);
/** sets copy method of branching rule */
void SCIPbranchruleSetCopy(
SCIP_BRANCHRULE* branchrule, /**< branching rule */
SCIP_DECL_BRANCHCOPY ((*branchcopy)) /**< copy method of branching rule or NULL if you don't want to copy your plugin into sub-SCIPs */
);
/** sets destructor method of branching rule */
void SCIPbranchruleSetFree(
SCIP_BRANCHRULE* branchrule, /**< branching rule */
SCIP_DECL_BRANCHFREE ((*branchfree)) /**< destructor of branching rule */
);
/** sets initialization method of branching rule */
void SCIPbranchruleSetInit(
SCIP_BRANCHRULE* branchrule, /**< branching rule */
SCIP_DECL_BRANCHINIT ((*branchinit)) /**< initialize branching rule */
);
/** sets deinitialization method of branching rule */
void SCIPbranchruleSetExit(
SCIP_BRANCHRULE* branchrule, /**< branching rule */
SCIP_DECL_BRANCHEXIT ((*branchexit)) /**< deinitialize branching rule */
);
/** sets solving process initialization method of branching rule */
void SCIPbranchruleSetInitsol(
SCIP_BRANCHRULE* branchrule, /**< branching rule */
SCIP_DECL_BRANCHINITSOL((*branchinitsol)) /**< solving process initialization method of branching rule */
);
/** sets solving process deinitialization method of branching rule */
void SCIPbranchruleSetExitsol(
SCIP_BRANCHRULE* branchrule, /**< branching rule */
SCIP_DECL_BRANCHEXITSOL((*branchexitsol)) /**< solving process deinitialization method of branching rule */
);
/** sets branching execution method for fractional LP solutions */
void SCIPbranchruleSetExecLp(
SCIP_BRANCHRULE* branchrule, /**< branching rule */
SCIP_DECL_BRANCHEXECLP((*branchexeclp)) /**< branching execution method for fractional LP solutions */
);
/** sets branching execution method for external candidates */
void SCIPbranchruleSetExecExt(
SCIP_BRANCHRULE* branchrule, /**< branching rule */
SCIP_DECL_BRANCHEXECEXT((*branchexecext)) /**< branching execution method for external candidates */
);
/** sets branching execution method for not completely fixed pseudo solutions */
void SCIPbranchruleSetExecPs(
SCIP_BRANCHRULE* branchrule, /**< branching rule */
SCIP_DECL_BRANCHEXECPS((*branchexecps)) /**< branching execution method for not completely fixed pseudo solutions */
);
/** enables or disables all clocks of \p branchrule, depending on the value of the flag */
void SCIPbranchruleEnableOrDisableClocks(
SCIP_BRANCHRULE* branchrule, /**< the branching rule for which all clocks should be enabled or disabled */
SCIP_Bool enable /**< should the clocks of the branching rule be enabled? */
);
/*
* branching methods
*/
/** calculates the branching score out of the gain predictions for a binary branching */
SCIP_Real SCIPbranchGetScore(
SCIP_SET* set, /**< global SCIP settings */
SCIP_VAR* var, /**< variable, of which the branching factor should be applied, or NULL */
SCIP_Real downgain, /**< prediction of objective gain for rounding downwards */
SCIP_Real upgain /**< prediction of objective gain for rounding upwards */
);
/** calculates the branching score out of the gain predictions for a branching with arbitrary many children */
SCIP_Real SCIPbranchGetScoreMultiple(
SCIP_SET* set, /**< global SCIP settings */
SCIP_VAR* var, /**< variable, of which the branching factor should be applied, or NULL */
int nchildren, /**< number of children that the branching will create */
SCIP_Real* gains /**< prediction of objective gain for each child */
);
/** computes a branching point for a (not necessarily discrete) variable
* a suggested branching point is first projected onto the box
* if no point is suggested, then the value in the current LP or pseudo solution is used
* if this value is at infinity, then 0.0 projected onto the bounds and then moved inside the interval is used
* for a discrete variable, it is ensured that the returned value is fractional
* for a continuous variable, the parameter branching/clamp defines how far a branching point need to be from the bounds of a variable
* the latter is only applied if no point has been suggested, or the suggested point is not inside the variable's interval
*/
SCIP_Real SCIPbranchGetBranchingPoint(
SCIP_SET* set, /**< global SCIP settings */
SCIP_TREE* tree, /**< branch and bound tree */
SCIP_VAR* var, /**< variable, of which the branching point should be computed */
SCIP_Real suggestion /**< suggestion for branching point, or SCIP_INVALID if no suggestion */
);
/** 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
*/
SCIP_RETCODE SCIPbranchExecLP(
BMS_BLKMEM* blkmem, /**< block memory for parameter settings */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< problem statistics */
SCIP_PROB* transprob, /**< transformed problem after presolve */
SCIP_PROB* origprob, /**< original problem */
SCIP_TREE* tree, /**< branch and bound tree */
SCIP_REOPT* reopt, /**< reoptimization data structure */
SCIP_LP* lp, /**< current LP data */
SCIP_SEPASTORE* sepastore, /**< separation storage */
SCIP_BRANCHCAND* branchcand, /**< branching candidate storage */
SCIP_EVENTQUEUE* eventqueue, /**< event queue */
SCIP_Real cutoffbound, /**< global upper cutoff bound */
SCIP_Bool allowaddcons, /**< should adding constraints be allowed to avoid a branching? */
SCIP_RESULT* result /**< pointer to store the result of the branching */
);
/** calls branching rules to branch on an external solution; if no external branching candidates exist, the result is SCIP_DIDNOTRUN */
SCIP_RETCODE SCIPbranchExecExtern(
BMS_BLKMEM* blkmem, /**< block memory for parameter settings */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< problem statistics */
SCIP_PROB* transprob, /**< transformed problem after presolve */
SCIP_PROB* origprob, /**< original problem */
SCIP_TREE* tree, /**< branch and bound tree */
SCIP_REOPT* reopt, /**< reoptimization data structure */
SCIP_LP* lp, /**< current LP data */
SCIP_SEPASTORE* sepastore, /**< separation storage */
SCIP_BRANCHCAND* branchcand, /**< branching candidate storage */
SCIP_EVENTQUEUE* eventqueue, /**< event queue */
SCIP_Real cutoffbound, /**< global upper cutoff bound */
SCIP_Bool allowaddcons, /**< should adding constraints be allowed to avoid a branching? */
SCIP_RESULT* result /**< pointer to store the result of the branching */
);
/** calls branching rules to branch on a pseudo solution; if no unfixed variables exist, the result is SCIP_DIDNOTRUN */
SCIP_RETCODE SCIPbranchExecPseudo(
BMS_BLKMEM* blkmem, /**< block memory for parameter settings */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< problem statistics */
SCIP_PROB* transprob, /**< transformed problem after presolve */
SCIP_PROB* origprob, /**< original problem */
SCIP_TREE* tree, /**< branch and bound tree */
SCIP_REOPT* reopt, /**< reoptimization data structure */
SCIP_LP* lp, /**< current LP data */
SCIP_BRANCHCAND* branchcand, /**< branching candidate storage */
SCIP_EVENTQUEUE* eventqueue, /**< event queue */
SCIP_Real cutoffbound, /**< global upper cutoff bound */
SCIP_Bool allowaddcons, /**< should adding constraints be allowed to avoid a branching? */
SCIP_RESULT* result /**< pointer to store the result of the branching */
);
#ifdef __cplusplus
}
#endif
#endif
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* SCIP --- Solving Constraint Integer Programs */
/* */
/* Copyright (C) 2002-2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* SCIP is distributed under the terms of the ZIB Academic License. */
/* */
/* You should have received a copy of the ZIB Academic License */
/* along with SCIP; see the file COPYING. If not visit scipopt.org. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**@file branch_allfullstrong.h
* @ingroup BRANCHINGRULES
* @brief all variables full strong LP branching rule
* @author Tobias Achterberg
* @author Gerald Gamrath
*
* The all variables full strong branching rule applies strong branching to every non-fixed variable
* at the current node of the branch-and-bound search. The rule selects the candidate
* which will cause the highest gain of the dual bound in the created sub-tree among all branching variables.
*
* For calculating the gain, a look-ahead is performed by solving the child node LPs which will result
* from branching on a variable.
*
* For a more mathematical description and a comparison between the strong branching rule and other branching rules
* in SCIP, we refer to
*
* @par
* Tobias Achterberg@n
* Constraint Integer Programming@n
* PhD Thesis, Technische Universität Berlin, 2007@n
*
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_BRANCH_ALLFULLSTRONG_H__
#define __SCIP_BRANCH_ALLFULLSTRONG_H__
#include "scip/def.h"
#include "scip/type_result.h"
#include "scip/type_retcode.h"
#include "scip/type_scip.h"
#include "scip/type_var.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* Selects a variable from a set of candidates by strong branching
*
* @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
* SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
*
* @note The variables in the lpcands array must have a fractional value in the current LP solution
*/
SCIP_EXPORT
SCIP_RETCODE SCIPselectVarPseudoStrongBranching(
SCIP* scip, /**< original SCIP data structure */
SCIP_VAR** pseudocands, /**< branching candidates */
SCIP_Bool* skipdown, /**< should down branchings be skipped? */
SCIP_Bool* skipup, /**< should up branchings be skipped? */
int npseudocands, /**< number of branching candidates */
int npriopseudocands, /**< number of priority branching candidates */
int* bestpseudocand, /**< best candidate for branching */
SCIP_Real* bestdown, /**< objective value of the down branch for bestcand */
SCIP_Real* bestup, /**< objective value of the up branch for bestcand */
SCIP_Real* bestscore, /**< score for bestcand */
SCIP_Bool* bestdownvalid, /**< is bestdown a valid dual bound for the down branch? */
SCIP_Bool* bestupvalid, /**< is bestup a valid dual bound for the up branch? */
SCIP_Real* provedbound, /**< proved dual bound for current subtree */
SCIP_RESULT* result /**< result pointer */
);
/** creates the all variables full strong LP branching rule and includes it in SCIP */
SCIP_EXPORT
SCIP_RETCODE SCIPincludeBranchruleAllfullstrong(
SCIP* scip /**< SCIP data structure */
);
#ifdef __cplusplus
}
#endif
#endif
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* SCIP --- Solving Constraint Integer Programs */
/* */
/* Copyright (C) 2002-2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* SCIP is distributed under the terms of the ZIB Academic License. */
/* */
/* You should have received a copy of the ZIB Academic License */
/* along with SCIP; see the file COPYING. If not visit scipopt.org. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**@file branch_cloud.h
* @ingroup BRANCHINGRULES
* @brief cloud branching rule
* @author Timo Berthold
* @author Domenico Salvagnin
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_BRANCH_CLOUD_H__
#define __SCIP_BRANCH_CLOUD_H__
#include "scip/def.h"
#include "scip/type_retcode.h"
#include "scip/type_scip.h"
#ifdef __cplusplus
extern "C" {
#endif
/** creates the cloud branching rule and includes it in SCIP
*
* @ingroup BranchingRuleIncludes
*/
SCIP_EXPORT
SCIP_RETCODE SCIPincludeBranchruleCloud(
SCIP* scip /**< SCIP data structure */
);
#ifdef __cplusplus
}
#endif
#endif
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* SCIP --- Solving Constraint Integer Programs */
/* */
/* Copyright (C) 2002-2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* SCIP is distributed under the terms of the ZIB Academic License. */
/* */
/* You should have received a copy of the ZIB Academic License */
/* along with SCIP; see the file COPYING. If not visit scipopt.org. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**@file branch_distribution.h
* @ingroup BRANCHINGRULES
* @brief probability based branching rule based on an article by J. Pryor and J.W. Chinneck
* @author Gregor Hendel
*
* The distribution branching rule selects a variable based on its impact on row activity distributions. More formally,
* let \f$ a(x) = a_1 x_1 + \dots + a_n x_n \leq b \f$ be a row of the LP. Let further \f$ l_i, u_i \in R\f$ denote the
* (finite) lower and upper bound, respectively, of the \f$ i \f$-th variable \f$x_i\f$.
* Viewing every variable \f$x_i \f$ as (continuously) uniformly distributed within its bounds, we can approximately
* understand the row activity \f$a(x)\f$ as a gaussian random variate with mean value \f$ \mu = E[a(x)] = \sum_i a_i\frac{l_i + u_i}{2}\f$
* and variance \f$ \sigma^2 = \sum_i a_i^2 \sigma_i^2 \f$, with \f$ \sigma_i^2 = \frac{(u_i - l_i)^2}{12}\f$ for
* continuous and \f$ \sigma_i^2 = \frac{(u_i - l_i + 1)^2 - 1}{12}\f$ for discrete variables.
* With these two parameters, we can calculate the probability to satisfy the row in terms of the cumulative distribution
* of the standard normal distribution: \f$ P(a(x) \leq b) = \Phi(\frac{b - \mu}{\sigma})\f$.
*
* The impact of a variable on the probability to satisfy a constraint after branching can be estimated by altering
* the variable contribution to the sums described above. In order to keep the tree size small,
* variables are preferred which decrease the probability
* to satisfy a row because it is more likely to create infeasible subproblems.
*
* The selection of the branching variable is subject to the parameter @p scoreparam. For both branching directions,
* an individual score is calculated. Available options for scoring methods are:
* - @b d: select a branching variable with largest difference in satisfaction probability after branching
* - @b l: lowest cumulative probability amongst all variables on all rows (after branching).
* - @b h: highest cumulative probability amongst all variables on all rows (after branching).
* - @b v: highest number of votes for lowering row probability for all rows a variable appears in.
* - @b w: highest number of votes for increasing row probability for all rows a variable appears in.
*
* If the parameter @p usescipscore is set to @a TRUE, a single branching score is calculated from the respective
* up and down scores as defined by the SCIP branching score function (see advanced branching parameter @p scorefunc),
* otherwise, the variable with the single highest score is selected, and the maximizing direction is assigned
* higher branching priority.
*
* The original idea of probability based branching schemes appeared in:
*
* J. Pryor and J.W. Chinneck:@n
* Faster Integer-Feasibility in Mixed-Integer Linear Programs by Branching to Force Change@n
* Computers and Operations Research, vol. 38, 2011, p. 1143–1152@n
* (http://www.sce.carleton.ca/faculty/chinneck/docs/PryorChinneck.pdf)
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_BRANCH_DISTRIBUTION_H__
#define __SCIP_BRANCH_DISTRIBUTION_H__
#include "scip/def.h"
#include "scip/type_lp.h"
#include "scip/type_retcode.h"
#include "scip/type_scip.h"
#include "scip/type_var.h"
#ifdef __cplusplus
extern "C" {
#endif
/** creates the distribution branching rule and includes it in SCIP
*
* @ingroup BranchingRuleIncludes
*/
SCIP_EXPORT
SCIP_RETCODE SCIPincludeBranchruleDistribution(
SCIP* scip /**< SCIP data structure */
);
/**@addtogroup BRANCHINGRULES
*
* @{
*/
/** calculate the variable's distribution parameters (mean and variance) for the bounds specified in the arguments.
* special treatment of infinite bounds necessary */
SCIP_EXPORT
void SCIPvarCalcDistributionParameters(
SCIP* scip, /**< SCIP data structure */
SCIP_Real varlb, /**< variable lower bound */
SCIP_Real varub, /**< variable upper bound */
SCIP_VARTYPE vartype, /**< type of the variable */
SCIP_Real* mean, /**< pointer to store mean value */
SCIP_Real* variance /**< pointer to store the variance of the variable uniform distribution */
);
/** calculates the cumulative distribution P(-infinity <= x <= value) that a normally distributed
* random variable x takes a value between -infinity and parameter \p value.
*
* The distribution is given by the respective mean and deviation. This implementation
* uses the error function erf().
*/
SCIP_EXPORT
SCIP_Real SCIPcalcCumulativeDistribution(
SCIP* scip, /**< current SCIP */
SCIP_Real mean, /**< the mean value of the distribution */
SCIP_Real variance, /**< the square of the deviation of the distribution */
SCIP_Real value /**< the upper limit of the calculated distribution integral */
);
/** calculates the probability of satisfying an LP-row under the assumption
* of uniformly distributed variable values.
*
* For inequalities, we use the cumulative distribution function of the standard normal
* distribution PHI(rhs - mu/sqrt(sigma2)) to calculate the probability
* for a right hand side row with mean activity mu and variance sigma2 to be satisfied.
* Similarly, 1 - PHI(lhs - mu/sqrt(sigma2)) is the probability to satisfy a left hand side row.
* For equations (lhs==rhs), we use the centeredness measure p = min(PHI(lhs'), 1-PHI(lhs'))/max(PHI(lhs'), 1 - PHI(lhs')),
* where lhs' = lhs - mu / sqrt(sigma2).
*/
SCIP_EXPORT
SCIP_Real SCIProwCalcProbability(
SCIP* scip, /**< current scip */
SCIP_ROW* row, /**< the row */
SCIP_Real mu, /**< the mean value of the row distribution */
SCIP_Real sigma2, /**< the variance of the row distribution */
int rowinfinitiesdown, /**< the number of variables with infinite bounds to DECREASE activity */
int rowinfinitiesup /**< the number of variables with infinite bounds to INCREASE activity */
);
/** update the up- and downscore of a single variable after calculating the impact of branching on a
* particular row, depending on the chosen score parameter
*/
SCIP_EXPORT
SCIP_RETCODE SCIPupdateDistributionScore(
SCIP* scip, /**< current SCIP pointer */
SCIP_Real currentprob, /**< the current probability */
SCIP_Real newprobup, /**< the new probability if branched upwards */
SCIP_Real newprobdown, /**< the new probability if branched downwards */
SCIP_Real* upscore, /**< pointer to store the new score for branching up */
SCIP_Real* downscore, /**< pointer to store the new score for branching down */
char scoreparam /**< parameter to determine the way the score is calculated */
);
/** @} */
#ifdef __cplusplus
}
#endif
#endif
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* SCIP --- Solving Constraint Integer Programs */
/* */
/* Copyright (C) 2002-2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* SCIP is distributed under the terms of the ZIB Academic License. */
/* */
/* You should have received a copy of the ZIB Academic License */
/* along with SCIP; see the file COPYING. If not visit scipopt.org. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**@file branch_fullstrong.h
* @ingroup BRANCHINGRULES
* @brief full strong LP branching rule
* @author Tobias Achterberg
*
* The full strong branching rule applies strong branching to every fractional variable of the LP solution
* at the current node of the branch-and-bound search. The rule selects the candidate
* which will cause the highest gain of the dual bound in the created sub-tree among all branching variables.
*
* For calculating the gain, a look-ahead is performed by solving the child node LPs which will result
* from branching on a variable.
*
* For a more mathematical description and a comparison between the strong branching rule and other branching rules
* in SCIP, we refer to
*
* @par
* Tobias Achterberg@n
* Constraint Integer Programming@n
* PhD Thesis, Technische Universität Berlin, 2007@n
*
*
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_BRANCH_FULLSTRONG_H__
#define __SCIP_BRANCH_FULLSTRONG_H__
#include "scip/def.h"
#include "scip/type_result.h"
#include "scip/type_retcode.h"
#include "scip/type_scip.h"
#include "scip/type_var.h"
#ifdef __cplusplus
extern "C" {
#endif
/** creates the full strong LP branching rule and includes it in SCIP
*
* @ingroup BranchingRuleIncludes
*/
SCIP_EXPORT
SCIP_RETCODE SCIPincludeBranchruleFullstrong(
SCIP* scip /**< SCIP data structure */
);
/**@addtogroup BRANCHINGRULES
*
* @{
*/
/**
* Selects a variable from a set of candidates by strong branching
*
* @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
* SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
*
* @note The variables in the lpcands array must have a fractional value in the current LP solution
*/
SCIP_EXPORT
SCIP_RETCODE SCIPselectVarStrongBranching(
SCIP* scip, /**< original SCIP data structure */
SCIP_VAR** lpcands, /**< branching candidates */
SCIP_Real* lpcandssol, /**< solution values of the branching candidates */
SCIP_Real* lpcandsfrac, /**< fractional values of the branching candidates */
SCIP_Bool* skipdown, /**< should down branchings be skipped? */
SCIP_Bool* skipup, /**< should up branchings be skipped? */
int nlpcands, /**< number of branching candidates */
int npriolpcands, /**< number of priority branching candidates */
int ncomplete, /**< number of branching candidates without skip */
int* start, /**< starting index in lpcands */
int maxproprounds, /**< maximum number of propagation rounds to be performed during strong
* branching before solving the LP (-1: no limit, -2: parameter settings) */
SCIP_Bool probingbounds, /**< should valid bounds be identified in a probing-like fashion during
* strong branching (only with propagation)? */
SCIP_Bool forcestrongbranch, /**< should strong branching be applied even if there is just a single candidate? */
int* bestcand, /**< best candidate for branching */
SCIP_Real* bestdown, /**< objective value of the down branch for bestcand */
SCIP_Real* bestup, /**< objective value of the up branch for bestcand */
SCIP_Real* bestscore, /**< score for bestcand */
SCIP_Bool* bestdownvalid, /**< is bestdown a valid dual bound for the down branch? */
SCIP_Bool* bestupvalid, /**< is bestup a valid dual bound for the up branch? */
SCIP_Real* provedbound, /**< proved dual bound for current subtree */
SCIP_RESULT* result /**< result pointer */
);
/** @} */
#ifdef __cplusplus
}
#endif
#endif
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* SCIP --- Solving Constraint Integer Programs */
/* */
/* Copyright (C) 2002-2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* SCIP is distributed under the terms of the ZIB Academic License. */
/* */
/* You should have received a copy of the ZIB Academic License */
/* along with SCIP; see the file COPYING. If not visit scipopt.org. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**@file branch_inference.h
* @ingroup BRANCHINGRULES
* @brief inference history branching rule
* @author Tobias Achterberg
* @author Timo Berthold
* @author Stefan Heinz
*
* The inference history branching rule is based on the average number of deductions obtained after
* branching this variable upwards and downwards.
* Variables which cause many problem reductions are preferred since they are more likely to drive
* the created sub-tree towards infeasibility.
* Inference history of the variables is updated during the branch-and-bound search.
*
* For a more detailed description and a comparison between the inference rule and other branching rules
* in SCIP, we refer to
*
* @par
* Tobias Achterberg@n
* Constraint Integer Programming@n
* PhD Thesis, Technische Universität Berlin, 2007@n
*
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_BRANCH_INFERENCE_H__
#define __SCIP_BRANCH_INFERENCE_H__
#include "scip/def.h"
#include "scip/type_retcode.h"
#include "scip/type_scip.h"
#ifdef __cplusplus
extern "C" {
#endif
/** creates the inference history branching rule and includes it in SCIP
*
* @ingroup BranchingRuleIncludes
*/
SCIP_EXPORT
SCIP_RETCODE SCIPincludeBranchruleInference(
SCIP* scip /**< SCIP data structure */
);
#ifdef __cplusplus
}
#endif
#endif
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* SCIP --- Solving Constraint Integer Programs */
/* */
/* Copyright (C) 2002-2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* SCIP is distributed under the terms of the ZIB Academic License. */
/* */
/* You should have received a copy of the ZIB Academic License */
/* along with SCIP; see the file COPYING. If not visit scipopt.org. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**@file branch_leastinf.h
* @ingroup BRANCHINGRULES
* @brief least infeasible LP branching rule
* @author Tobias Achterberg
*
* The least infeasible branching rule selects a candidate variable $j$ with fractional solution value \f$ \hat{x}_j\f$
* which maximizes
* \f[
* \max \left\{ \lceil \hat{x}_j \rceil - \hat{x}_j, \hat{x}_j - \lfloor \hat{x}_j \rfloor \right\}.
* \f]
* i. e., a variable which already is closest to being integral among all branching candidates.
*
* The least infeasible rule and many other branching rules of SCIP are explained and compared in
*
* @par
* Tobias Achterberg@n
* Constraint Integer Programming@n
* PhD Thesis, Technische Universität Berlin, 2007@n
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_BRANCH_LEASTINF_H__
#define __SCIP_BRANCH_LEASTINF_H__
#include "scip/def.h"
#include "scip/type_retcode.h"
#include "scip/type_scip.h"
#ifdef __cplusplus
extern "C" {
#endif
/** creates the least infeasible LP branching rule and includes it in SCIP
*
* @ingroup BranchingRuleIncludes
*/
SCIP_EXPORT
SCIP_RETCODE SCIPincludeBranchruleLeastinf(
SCIP* scip /**< SCIP data structure */
);
#ifdef __cplusplus
}
#endif
#endif
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* SCIP --- Solving Constraint Integer Programs */
/* */
/* Copyright (C) 2002-2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* SCIP is distributed under the terms of the ZIB Academic License. */
/* */
/* You should have received a copy of the ZIB Academic License */
/* along with SCIP; see the file COPYING. If not visit scipopt.org. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**@file branch_lookahead.h
* @ingroup BRANCHINGRULES
* @brief lookahead LP branching rule
* @author Christoph Schubert
* @author Gerald Gamrath
*
* The (multi-level) lookahead branching rule applies strong branching to every fractional value of the LP solution
* at the current node of the branch-and-bound tree, as well as recursivly to every temporary child problem created by this
* strong branching. The rule selects the candidate with the best proven dual bound.
*
* The branching rule was motivated by the following technical report:
*
* @par
* Wasu Glankwamdee and Jeff Linderoth@n
* Lookahead Branching for Mixed Integer Programming@n
* Technical Report 06T-004, Department of Industrial and Systems Engineering, Lehigh University.
*
* For a more mathematical description and a comparison between lookahead branching and other branching rules
* in SCIP, we refer to
*
* @par
* Christoph Schubert@n
* Multi-Level Lookahead Branching@n
* Master Thesis, Technische Universität Berlin, 2017@n
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_BRANCH_LOOKAHEAD_H__
#define __SCIP_BRANCH_LOOKAHEAD_H__
#include "scip/def.h"
#include "scip/type_retcode.h"
#include "scip/type_scip.h"
#ifdef __cplusplus
extern "C" {
#endif
/** creates the lookahead branching rule and includes it in SCIP */
SCIP_EXPORT
SCIP_RETCODE SCIPincludeBranchruleLookahead(
SCIP* scip /**< SCIP data structure */
);
#ifdef __cplusplus
}
#endif
#endif
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* SCIP --- Solving Constraint Integer Programs */
/* */
/* Copyright (C) 2002-2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* SCIP is distributed under the terms of the ZIB Academic License. */
/* */
/* You should have received a copy of the ZIB Academic License */
/* along with SCIP; see the file COPYING. If not visit scipopt.org. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**@file branch_mostinf.h
* @ingroup BRANCHINGRULES
* @brief most infeasible LP branching rule
* @author Tobias Achterberg
*
* The most infeasible branching rule selects a candidate variable $j$ with fractional solution value \f$ \hat{x}_j\f$
* which maximizes
* \f[
* \min \left\{ \lceil \hat{x}_j \rceil - \hat{x}_j, \hat{x}_j - \lfloor \hat{x}_j \rfloor \right\}.
* \f]
* i. e., a variable which still is farthest from taking an integer value among all branching candidates.
*
* The most infeasible branching rule and many other branching rules of SCIP are explained and compared in
*
* @par
* Tobias Achterberg@n
* Constraint Integer Programming@n
* PhD Thesis, Technische Universität Berlin, 2007@n
*
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_BRANCH_MOSTINF_H__
#define __SCIP_BRANCH_MOSTINF_H__
#include "scip/def.h"
#include "scip/type_retcode.h"
#include "scip/type_scip.h"
#ifdef __cplusplus
extern "C" {
#endif
/** creates the most infeasible LP branching rule and includes it in SCIP
*
* @ingroup BranchingRuleIncludes
*/
SCIP_EXPORT
SCIP_RETCODE SCIPincludeBranchruleMostinf(
SCIP* scip /**< SCIP data structure */
);
#ifdef __cplusplus
}
#endif
#endif
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* SCIP --- Solving Constraint Integer Programs */
/* */
/* Copyright (C) 2002-2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* SCIP is distributed under the terms of the ZIB Academic License. */
/* */
/* You should have received a copy of the ZIB Academic License */
/* along with SCIP; see the file COPYING. If not visit scipopt.org. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**@file branch_multaggr.h
* @ingroup BRANCHINGRULES
* @brief fullstrong branching on fractional and multi-aggregated variables
* @author Anna Melchiori
* @author Gerald Gamrath
*
* This branching rule uses all fractional binary and integer variables as candidates,
* as well as fractional multiaggregated binary and integer variables. Although not
* directly contained in the presolved problem anymore, the multi-aggregation provides
* an affine linear sum of integer variables, on which branching can be performed.
*
* For more details, see
* G.Gamrath, A.Melchiori, T.Berthold, A.M.Gleixner, D.Salvagnin: Branching on Multi-aggregated Variables
* (http://dx.doi.org/10.1007/978-3-319-18008-3_10)
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_BRANCH_MULTAGGR_H__
#define __SCIP_BRANCH_MULTAGGR_H__
#include "scip/def.h"
#include "scip/type_retcode.h"
#include "scip/type_scip.h"
#ifdef __cplusplus
extern "C" {
#endif
/** creates the multi-aggregated branching rule and includes it in SCIP
*
* @ingroup BranchingRuleIncludes
*/
SCIP_EXPORT
SCIP_RETCODE SCIPincludeBranchruleMultAggr(
SCIP* scip /**< SCIP data structure */
);
#ifdef __cplusplus
}
#endif
#endif
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* SCIP --- Solving Constraint Integer Programs */
/* */
/* Copyright (C) 2002-2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* SCIP is distributed under the terms of the ZIB Academic License. */
/* */
/* You should have received a copy of the ZIB Academic License */
/* along with SCIP; see the file COPYING. If not visit scipopt.org. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**@file branch_nodereopt.h
* @ingroup BRANCHINGRULES
* @brief nodereopt branching rule
* @author Jakob Witzig
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_BRANCH_NODEREOPT_H__
#define __SCIP_BRANCH_NODEREOPT_H__
#include "scip/def.h"
#include "scip/type_retcode.h"
#include "scip/type_scip.h"
#ifdef __cplusplus
extern "C" {
#endif
/** creates the nodereopt branching rule and includes it in SCIP
*
* @ingroup BranchingRuleIncludes
*/
SCIP_EXPORT
SCIP_RETCODE SCIPincludeBranchruleNodereopt(
SCIP* scip /**< SCIP data structure */
);
#ifdef __cplusplus
}
#endif
#endif
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* SCIP --- Solving Constraint Integer Programs */
/* */
/* Copyright (C) 2002-2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* SCIP is distributed under the terms of the ZIB Academic License. */
/* */
/* You should have received a copy of the ZIB Academic License */
/* along with SCIP; see the file COPYING. If not visit scipopt.org. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**@file branch_pscost.h
* @ingroup BRANCHINGRULES
* @brief pseudo costs branching rule
* @author Tobias Achterberg
*
* The pseudo costs branching rule selects the branching variable with respect to the so-called pseudo costs
* of the variables. Pseudo costs measure the average gain per unit in the objective function when the variable
* was branched on upwards or downwards, resp. The required information is updated at every node of
* the solving process.
*
* The selected variable maximizes the expected gain of the dual bound in the created subtree.
*
* For a more mathematical description and a comparison between the pseudo costs branching rule
* and other branching rules in SCIP, we refer to
*
* @par
* Tobias Achterberg@n
* Constraint Integer Programming@n
* PhD Thesis, Technische Universität Berlin, 2007@n
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_BRANCH_PSCOST_H__
#define __SCIP_BRANCH_PSCOST_H__
#include "scip/def.h"
#include "scip/type_retcode.h"
#include "scip/type_scip.h"
#include "scip/type_var.h"
#ifdef __cplusplus
extern "C" {
#endif
/** creates the pseudo cost branching rule and includes it in SCIP
*
* @ingroup BranchingRuleIncludes
*/
SCIP_EXPORT
SCIP_RETCODE SCIPincludeBranchrulePscost(
SCIP* scip /**< SCIP data structure */
);
/**@addtogroup BRANCHINGRULES
*
* @{
*/
/** selects a branching variable, due to pseudo cost, from the given candidate array and returns this variable together
* with a branching point */
SCIP_EXPORT
SCIP_RETCODE SCIPselectBranchVarPscost(
SCIP* scip, /**< SCIP data structure */
SCIP_VAR** branchcands, /**< branching candidates */
SCIP_Real* branchcandssol, /**< solution value for the branching candidates */
SCIP_Real* branchcandsscore, /**< array of candidate scores */
int nbranchcands, /**< number of branching candidates */
SCIP_VAR** var, /**< pointer to store the variable to branch on, or NULL if none */
SCIP_Real* brpoint /**< pointer to store the branching point for the branching variable, will be fractional for a discrete variable */
);
/** @} */
#ifdef __cplusplus
}
#endif
#endif
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* SCIP --- Solving Constraint Integer Programs */
/* */
/* Copyright (C) 2002-2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* SCIP is distributed under the terms of the ZIB Academic License. */
/* */
/* You should have received a copy of the ZIB Academic License */
/* along with SCIP; see the file COPYING. If not visit scipopt.org. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**@file branch_random.h
* @ingroup BRANCHINGRULES
* @brief random variable branching rule
* @author Tobias Achterberg
*
* The random branching rule randomly selects a candidate variable from the set of candidate variables.
*
* The random branching rule and many other branching rules of SCIP are explained and compared in
*
* @par
* Tobias Achterberg@n
* Constraint Integer Programming@n
* PhD Thesis, Technische Universität Berlin, 2007@n
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_BRANCH_RANDOM_H__
#define __SCIP_BRANCH_RANDOM_H__
#include "scip/def.h"
#include "scip/type_retcode.h"
#include "scip/type_scip.h"
#ifdef __cplusplus
extern "C" {
#endif
/** creates the random branching rule and includes it in SCIP
*
* @ingroup BranchingRuleIncludes
*/
SCIP_EXPORT
SCIP_RETCODE SCIPincludeBranchruleRandom(
SCIP* scip /**< SCIP data structure */
);
#ifdef __cplusplus
}
#endif
#endif
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* SCIP --- Solving Constraint Integer Programs */
/* */
/* Copyright (C) 2002-2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* SCIP is distributed under the terms of the ZIB Academic License. */
/* */
/* You should have received a copy of the ZIB Academic License */
/* along with SCIP; see the file COPYING. If not visit scipopt.org. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**@file branch_relpscost.h
* @ingroup BRANCHINGRULES
* @brief reliable pseudo costs branching rule
* @author Tobias Achterberg
*
* The reliable pseudo costs branching rule uses the notion of pseudo costs to measure the expected
* gain in the dual bound when branching on a particular variable.
* The pseudo cost information is collected during the branch-and-bound search in the same manner as for
* the pseudo costs branching rule.
*
* The reliable pseudo costs branching rule, however, uses a limited number of look-ahead LP-iterations
* at the beginning of the search in order to obtain better pseudo cost estimates and make branching decisions in a
* sense more "reliable" at an early stage of the search,
* at the price of a higher computational cost at the beginning of the search.
*
* For a more mathematical description and a comparison between the reliable pseudo costs rule and other branching rules
* in SCIP, we refer to
*
* @par
* Tobias Achterberg@n
* Constraint Integer Programming@n
* PhD Thesis, Technische Universität Berlin, 2007@n
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_BRANCH_RELPSCOST_H__
#define __SCIP_BRANCH_RELPSCOST_H__
#include "scip/def.h"
#include "scip/type_result.h"
#include "scip/type_retcode.h"
#include "scip/type_scip.h"
#include "scip/type_var.h"
#ifdef __cplusplus
extern "C" {
#endif
/** creates the reliable pseudo cost branching rule and includes it in SCIP
*
* @ingroup BranchingRuleIncludes
*/
SCIP_EXPORT
SCIP_RETCODE SCIPincludeBranchruleRelpscost(
SCIP* scip /**< SCIP data structure */
);
/**@addtogroup BRANCHINGRULES
*
* @{
*/
/** execution reliability pseudo cost branching with the given branching candidates */
SCIP_EXPORT
SCIP_RETCODE SCIPexecRelpscostBranching(
SCIP* scip, /**< SCIP data structure */
SCIP_VAR** branchcands, /**< branching candidates */
SCIP_Real* branchcandssol, /**< solution value for the branching candidates */
SCIP_Real* branchcandsfrac, /**< fractional part of the branching candidates */
int nbranchcands, /**< number of branching candidates */
SCIP_Bool executebranching, /**< perform a branching step after probing */
SCIP_RESULT* result /**< pointer to the result of the execution */
);
/** @} */
#ifdef __cplusplus
}
#endif
#endif
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* SCIP --- Solving Constraint Integer Programs */
/* */
/* Copyright (C) 2002-2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* SCIP is distributed under the terms of the ZIB Academic License. */
/* */
/* You should have received a copy of the ZIB Academic License */
/* along with SCIP; see the file COPYING. If not visit scipopt.org. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**@file branch_vanillafullstrong.h
* @ingroup BRANCHINGRULES
* @brief vanilla full strong LP branching rule
* @author Tobias Achterberg
* @author Maxime Gasse
*
* The vanilla full strong branching rule is a purged implementation of full strong branching, for academic purposes.
* It implements full strong branching with the following specific features:
* - no cutoff or domain reduction: only branching.
* - idempotent (optional): leave SCIP, as much as possible, in the same state before / after the strong branching
* calls. Basically, do not update any statistic.
* - donotbranch (optional): do no perform branching. So that the brancher can be called as an oracle only (on which
* variable would you branch ? But do not branch please).
* - scoreall (optional): continue scoring variables, even if infeasibility is detected along the way.
* - collectscores (optional): store the candidate scores from the last call, which can then be retrieved by calling
* SCIPgetVanillafullstrongData().
* - integralcands (optional): get candidates from SCIPgetPseudoBranchCands() instead of SCIPgetLPBranchCands(), i.e.,
* consider all non-fixed variables as branching candidates, not only fractional ones.
*
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_BRANCH_VANILLAFULLSTRONG_H__
#define __SCIP_BRANCH_VANILLAFULLSTRONG_H__
#include "scip/def.h"
#include "scip/type_result.h"
#include "scip/type_retcode.h"
#include "scip/type_scip.h"
#include "scip/type_var.h"
#ifdef __cplusplus
extern "C" {
#endif
/** creates the vanilla full strong branching rule and includes it in SCIP
*
* @ingroup BranchingRuleIncludes
*/
SCIP_EXPORT
SCIP_RETCODE SCIPincludeBranchruleVanillafullstrong(
SCIP* scip /**< SCIP data structure */
);
/** recovers candidate variables and their scores from last vanilla full strong branching call */
SCIP_EXPORT
SCIP_RETCODE SCIPgetVanillafullstrongData(
SCIP* scip, /**< SCIP data structure */
SCIP_VAR*** cands, /**< pointer to store candidate variables; or NULL */
SCIP_Real** candscores, /**< pointer to store candidate scores; or NULL */
int* ncands, /**< pointer to store number of candidates; or NULL */
int* npriocands, /**< pointer to store number of priority candidates; or NULL */
int* bestcand /**< pointer to store best branching candidate; or NULL */
);
#ifdef __cplusplus
}
#endif
#endif
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* SCIP --- Solving Constraint Integer Programs */
/* */
/* Copyright (C) 2002-2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* SCIP is distributed under the terms of the ZIB Academic License. */
/* */
/* You should have received a copy of the ZIB Academic License */
/* along with SCIP; see the file COPYING. If not visit scipopt.org. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**@file branch_xyz.h
* @ingroup BRANCHINGRULES
* @brief xyz branching rule
* @author Tobias Achterberg
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_BRANCH_XYZ_H__
#define __SCIP_BRANCH_XYZ_H__
#include "scip/scip.h"
#ifdef __cplusplus
extern "C" {
#endif
/** creates the xyz branching rule and includes it in SCIP
*
* @ingroup BranchingRuleIncludes
*/
SCIP_EXPORT
SCIP_RETCODE SCIPincludeBranchruleXyz(
SCIP* scip /**< SCIP data structure */
);
/**@addtogroup BRANCHINGRULES
*
* @{
*/
/* TODO place other public methods in this group to facilitate navigation through the documentation */
/** @} */
#ifdef __cplusplus
}
#endif
#endif
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* SCIP --- Solving Constraint Integer Programs */
/* */
/* Copyright (C) 2002-2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* SCIP is distributed under the terms of the ZIB Academic License. */
/* */
/* You should have received a copy of the ZIB Academic License */
/* along with SCIP; see the file COPYING. If not visit scipopt.org. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**@file clock.h
* @ingroup INTERNALAPI
* @brief internal methods for clocks and timing issues
* @author Tobias Achterberg
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_CLOCK_H__
#define __SCIP_CLOCK_H__
#include "scip/def.h"
#include "scip/type_retcode.h"
#include "scip/type_set.h"
#include "scip/type_clock.h"
#ifdef __cplusplus
extern "C" {
#endif
/** creates a clock and initializes it */
SCIP_RETCODE SCIPclockCreate(
SCIP_CLOCK** clck, /**< pointer to clock timer */
SCIP_CLOCKTYPE clocktype /**< type of clock */
);
/** frees a clock */
void SCIPclockFree(
SCIP_CLOCK** clck /**< pointer to clock timer */
);
/** initializes and resets a clock */
void SCIPclockInit(
SCIP_CLOCK* clck, /**< clock timer */
SCIP_CLOCKTYPE clocktype /**< type of clock */
);
/** completely stop the clock and reset the clock's counter to zero */
void SCIPclockReset(
SCIP_CLOCK* clck /**< clock timer */
);
/** enables the clock */
void SCIPclockEnable(
SCIP_CLOCK* clck /**< clock timer */
);
/** disables and resets the clock */
void SCIPclockDisable(
SCIP_CLOCK* clck /**< clock timer */
);
/** enables or disables \p clck, depending on the value of the flag */
void SCIPclockEnableOrDisable(
SCIP_CLOCK* clck, /**< the clock to be disabled/enabled */
SCIP_Bool enable /**< should the clock be enabled? */
);
/** sets the type of the clock, overriding the default clock type, and resets the clock */
void SCIPclockSetType(
SCIP_CLOCK* clck, /**< clock timer */
SCIP_CLOCKTYPE clocktype /**< type of clock */
);
/** starts measurement of time in the given clock, update the clock's type if it is bound to the default type */
void SCIPclockStart(
SCIP_CLOCK* clck, /**< clock timer */
SCIP_SET* set /**< global SCIP settings */
);
/** stops measurement of time in the given clock */
void SCIPclockStop(
SCIP_CLOCK* clck, /**< clock timer */
SCIP_SET* set /**< global SCIP settings */
);
/** returns whether the clock is currently running */
SCIP_Bool SCIPclockIsRunning(
SCIP_CLOCK* clck /**< clock timer */
);
/** gets the used time of this clock in seconds */
SCIP_Real SCIPclockGetTime(
SCIP_CLOCK* clck /**< clock timer */
);
/** gets the last validated time of this clock in seconds */
SCIP_Real SCIPclockGetLastTime(
SCIP_CLOCK* clck /**< clock timer */
);
/** sets the used time of this clock in seconds */
void SCIPclockSetTime(
SCIP_CLOCK* clck, /**< clock timer */
SCIP_Real sec /**< time in seconds to set the clock's timer to */
);
/** gets current time of day in seconds (standard time zone) */
SCIP_Real SCIPclockGetTimeOfDay(
void
);
#ifdef __cplusplus
}
#endif
#endif
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* SCIP --- Solving Constraint Integer Programs */
/* */
/* Copyright (C) 2002-2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* SCIP is distributed under the terms of the ZIB Academic License. */
/* */
/* You should have received a copy of the ZIB Academic License */
/* along with SCIP; see the file COPYING. If not visit scipopt.org. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**@file compr.h
* @ingroup INTERNALAPI
* @brief internal methods for tree compressions
* @author Jakob Witzig
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_COMPR_H__
#define __SCIP_COMPR_H__
#include "scip/def.h"
#include "blockmemshell/memory.h"
#include "scip/type_reopt.h"
#include "scip/type_retcode.h"
#include "scip/type_result.h"
#include "scip/type_set.h"
#include "scip/type_compr.h"
#include "scip/pub_compr.h"
#ifdef __cplusplus
extern "C" {
#endif
/** copies the given tree compression to a new scip */
SCIP_RETCODE SCIPcomprCopyInclude(
SCIP_COMPR* compr, /**< tree compression */
SCIP_SET* set /**< SCIP_SET of SCIP to copy to */
);
/** creates a tree compression */
SCIP_RETCODE SCIPcomprCreate(
SCIP_COMPR** compr, /**< pointer to tree compression data structure */
SCIP_SET* set, /**< global SCIP settings */
SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
BMS_BLKMEM* blkmem, /**< block memory for parameter settings */
const char* name, /**< name of tree compression */
const char* desc, /**< description of tree compression */
int priority, /**< priority of the tree compression */
int minnnodes, /**< minimal number of nodes for calling compression */
SCIP_DECL_COMPRCOPY ((*comprcopy)), /**< copy method of tree compression or NULL if you don't want to copy
* your plugin into sub-SCIPs */
SCIP_DECL_COMPRFREE ((*comprfree)), /**< destructor of tree compression */
SCIP_DECL_COMPRINIT ((*comprinit)), /**< initialize tree compression */
SCIP_DECL_COMPREXIT ((*comprexit)), /**< deinitialize tree compression */
SCIP_DECL_COMPRINITSOL ((*comprinitsol)), /**< solving process initialization method of tree compression */
SCIP_DECL_COMPREXITSOL ((*comprexitsol)), /**< solving process deinitialization method of tree compression */
SCIP_DECL_COMPREXEC ((*comprexec)), /**< execution method of tree compression */
SCIP_COMPRDATA* comprdata /**< tree compression data */
);
/** calls destructor and frees memory of tree compression */
SCIP_RETCODE SCIPcomprFree(
SCIP_COMPR** compr, /**< pointer to tree compression data structure */
SCIP_SET* set /**< global SCIP settings */
);
/** initializes tree compression */
SCIP_RETCODE SCIPcomprInit(
SCIP_COMPR* compr, /**< tree compression */
SCIP_SET* set /**< global SCIP settings */
);
/** calls exit method of tree compression */
SCIP_RETCODE SCIPcomprExit(
SCIP_COMPR* compr, /**< tree compression */
SCIP_SET* set /**< global SCIP settings */
);
/** informs tree compression that the branch and bound process is being started */
SCIP_RETCODE SCIPcomprInitsol(
SCIP_COMPR* compr, /**< tree compression */
SCIP_SET* set /**< global SCIP settings */
);
/** informs tree compression that the branch and bound process data is being freed */
SCIP_RETCODE SCIPcomprExitsol(
SCIP_COMPR* compr, /**< tree compression */
SCIP_SET* set /**< global SCIP settings */
);
/** calls execution method of tree compression */
SCIP_RETCODE SCIPcomprExec(
SCIP_COMPR* compr, /**< tree compression */
SCIP_SET* set, /**< global SCIP settings */
SCIP_REOPT* reopt, /**< reoptimization data structure */
SCIP_RESULT* result /**< pointer to store the result of the callback method */
);
/** sets priority of tree compression */
void SCIPcomprSetPriority(
SCIP_COMPR* compr, /**< tree compression */
SCIP_SET* set, /**< global SCIP settings */
int priority /**< new priority of the tree compression */
);
/** sets copy callback of tree compression */
void SCIPcomprSetCopy(
SCIP_COMPR* compr, /**< tree compression */
SCIP_DECL_COMPRCOPY ((*comprcopy)) /**< copy callback of tree compression or NULL if you don't want to copy your plugin into sub-SCIPs */
);
/** sets destructor callback of tree compression */
void SCIPcomprSetFree(
SCIP_COMPR* compr, /**< tree compression */
SCIP_DECL_COMPRFREE ((*comprfree)) /**< destructor of tree compression */
);
/** sets initialization callback of tree compression */
void SCIPcomprSetInit(
SCIP_COMPR* compr, /**< tree compression */
SCIP_DECL_COMPRINIT ((*comprinit)) /**< initialize tree compression */
);
/** sets deinitialization callback of tree compression */
void SCIPcomprSetExit(
SCIP_COMPR* compr, /**< tree compression */
SCIP_DECL_COMPREXIT ((*comprexit)) /**< deinitialize tree compression */
);
/** sets solving process initialization callback of tree compression */
void SCIPcomprSetInitsol(
SCIP_COMPR* compr, /**< tree compression */
SCIP_DECL_COMPRINITSOL ((*comprinitsol)) /**< solving process initialization callback of tree compression */
);
/** sets solving process deinitialization callback of tree compression */
void SCIPcomprSetExitsol(
SCIP_COMPR* compr, /**< tree compression */
SCIP_DECL_COMPREXITSOL ((*comprexitsol)) /**< solving process deinitialization callback of tree compression */
);
/** should the compression be executed at the given depth, frequency, timing, ... */
SCIP_EXPORT
SCIP_Bool SCIPcomprShouldBeExecuted(
SCIP_COMPR* compr, /**< tree compression */
int depth, /**< depth of current node */
int nnodes /**< number of open nodes */
);
#ifdef __cplusplus
}
#endif
#endif