Scippy

SCIP

Solving Constraint Integer Programs

reopt.c File Reference

Detailed Description

data structures and methods for collecting reoptimization information

Author
Jakob Witzig

Definition in file reopt.c.

#include <assert.h>
#include <string.h>
#include "scip/def.h"
#include "scip/mem.h"
#include "scip/event.h"
#include "scip/scip.h"
#include "scip/set.h"
#include "scip/sol.h"
#include "scip/var.h"
#include "scip/misc.h"
#include "scip/reopt.h"
#include "scip/tree.h"
#include "scip/primal.h"
#include "scip/prob.h"
#include "scip/cons.h"
#include "scip/cons_logicor.h"
#include "scip/clock.h"
#include "scip/heur_reoptsols.h"
#include "blockmemshell/memory.h"

Go to the source code of this file.

Macros

#define DEFAULT_MEM_VARAFTERDUAL   10
 
#define DEFAULT_MEM_VAR   10
 
#define DEFAULT_MEM_NODES   1000
 
#define DEFAULT_MEM_RUN   200
 
#define DEFAULT_MEM_DUALCONS   10
 
#define EVENTHDLR_NAME   "Reopt"
 
#define EVENTHDLR_DESC   "node event handler for reoptimization"
 

Functions

static SCIP_DECL_EVENTEXEC (eventExecReopt)
 
static SCIP_DECL_EVENTINITSOL (eventInitsolReopt)
 
static SCIP_DECL_EVENTEXITSOL (eventExitsolReopt)
 
static SCIP_RETCODE ensureSolsSize (SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, int num, int runidx)
 
static SCIP_RETCODE ensureRunSize (SCIP_REOPT *reopt, int num, BMS_BLKMEM *blkmem)
 
static SCIP_RETCODE reopttreeCheckMemory (SCIP_REOPTTREE *reopttree, BMS_BLKMEM *blkmem)
 
static SCIP_RETCODE reoptnodeCheckMemory (SCIP_REOPTNODE *reoptnode, BMS_BLKMEM *blkmem, int var_mem, int child_mem, int conss_mem)
 
static int soltreeNInducedSols (SCIP_SOLNODE *solnode)
 
static SCIP_Real reoptSimilarity (SCIP_REOPT *reopt, SCIP_SET *set, int obj1_id, int obj2_id, SCIP_VAR **transvars, int ntransvars)
 
static SCIP_RETCODE reoptnodeDelete (SCIP_REOPTNODE **reoptnode, BMS_BLKMEM *blkmem)
 
static SCIP_RETCODE reoptnodeReset (SCIP_REOPTNODE *reoptnode, SCIP_SET *set, BMS_BLKMEM *blkmem)
 
static SCIP_RETCODE reopttreeDeleteNode (SCIP_REOPTTREE *reopttree, SCIP_SET *set, BMS_BLKMEM *blkmem, unsigned int id, SCIP_Bool softreset)
 
static SCIP_RETCODE createSolTree (SCIP_SOLTREE *soltree, BMS_BLKMEM *blkmem)
 
static SCIP_RETCODE soltreefreeNode (SCIP_REOPT *reopt, SCIP_SET *set, SCIP_PRIMAL *primal, BMS_BLKMEM *blkmem, SCIP_SOLNODE **solnode)
 
static SCIP_RETCODE freeSolTree (SCIP_REOPT *reopt, SCIP_SET *set, SCIP_PRIMAL *origprimal, BMS_BLKMEM *blkmem)
 
static SCIP_RETCODE solnodeAddChild (BMS_BLKMEM *blkmem, SCIP_SOLNODE *father, SCIP_Bool rchild, SCIP_Bool lchild)
 
static SCIP_RETCODE soltreeAddSol (SCIP_REOPT *reopt, SCIP_SET *set, SCIP_STAT *stat, SCIP_PRIMAL *origprimal, BMS_BLKMEM *blkmem, SCIP_VAR **vars, SCIP_SOL *sol, SCIP_SOLNODE **solnode, int nvars, SCIP_Bool bestsol, SCIP_Bool *added)
 
static void soltreeResetMarks (SCIP_SOLNODE *node)
 
static SCIP_RETCODE createReoptnode (SCIP_REOPTTREE *reopttree, SCIP_SET *set, BMS_BLKMEM *blkmem, unsigned int id)
 
static SCIP_RETCODE createReopttree (SCIP_REOPTTREE *reopttree, SCIP_SET *set, BMS_BLKMEM *blkmem)
 
static SCIP_RETCODE clearReoptnodes (SCIP_REOPTTREE *reopttree, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_Bool softreset)
 
static SCIP_RETCODE freeReoptTree (SCIP_REOPTTREE *reopttree, SCIP_SET *set, BMS_BLKMEM *blkmem)
 
static SCIP_RETCODE checkMemDualCons (SCIP_REOPT *reopt, BMS_BLKMEM *blkmem, int size)
 
static SCIP_RETCODE checkMemGlbCons (SCIP_REOPT *reopt, BMS_BLKMEM *blkmem, int mem)
 
static SCIP_RETCODE updateConstraintPropagation (SCIP_REOPT *reopt, BMS_BLKMEM *blkmem, SCIP_NODE *node, unsigned int id, SCIP_Bool *transintoorig)
 
static SCIP_RETCODE saveAfterDualBranchings (SCIP_REOPT *reopt, BMS_BLKMEM *blkmem, SCIP_NODE *node, unsigned int id, SCIP_Bool *transintoorig)
 
static SCIP_RETCODE transformIntoOrig (SCIP_REOPT *reopt, unsigned int id)
 
static SCIP_RETCODE getLastSavedNode (SCIP_REOPT *reopt, SCIP_SET *set, SCIP_NODE *node, SCIP_NODE **parent, unsigned int *parentid, int *nbndchgs)
 
static SCIP_RETCODE reoptAddChild (SCIP_REOPTTREE *reopttree, BMS_BLKMEM *blkmem, unsigned int parentid, unsigned int childid)
 
static SCIP_RETCODE moveChildrenUp (SCIP_REOPT *reopt, BMS_BLKMEM *blkmem, unsigned int nodeid, unsigned int parentid)
 
static SCIP_RETCODE deleteChildrenBelow (SCIP_REOPTTREE *reopttree, SCIP_SET *set, BMS_BLKMEM *blkmem, unsigned int id, SCIP_Bool delnodeitself, SCIP_Bool exitsolve)
 
static SCIP_RETCODE shrinkNode (SCIP_REOPT *reopt, SCIP_SET *set, SCIP_NODE *node, unsigned int id, SCIP_Bool *shrank, BMS_BLKMEM *blkmem)
 
static SCIP_RETCODE changeReopttypeOfSubtree (SCIP_REOPTTREE *reopttree, unsigned int id, SCIP_REOPTTYPE reopttype)
 
static SCIP_RETCODE reoptnodeUpdateDualConss (SCIP_REOPTNODE *reoptnode, BMS_BLKMEM *blkmem)
 
static SCIP_RETCODE reoptCheckLocalRestart (SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_NODE *node, SCIP_VAR **transvars, int ntransvars, SCIP_Bool *localrestart)
 
static SCIP_RETCODE saveAncestorBranchings (SCIP_REOPTTREE *reopttree, BMS_BLKMEM *blkmem, SCIP_NODE *node, SCIP_NODE *parent, unsigned int id, unsigned int parentid)
 
static SCIP_RETCODE saveLocalConssData (SCIP_REOPTTREE *reopttree, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_NODE *node, unsigned int id)
 
static SCIP_RETCODE collectDualInformation (SCIP_REOPT *reopt, BMS_BLKMEM *blkmem, SCIP_NODE *node, unsigned int id, SCIP_REOPTTYPE reopttype)
 
static SCIP_RETCODE addNode (SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_NODE *node, SCIP_REOPTTYPE reopttype, SCIP_Bool saveafterdual, SCIP_Bool isrootnode, SCIP_Real lowerbound)
 
static void deleteLastDualBndchgs (SCIP_REOPT *reopt)
 
static SCIP_RETCODE reoptnodeResetDualConss (SCIP_REOPTNODE *reoptnode, BMS_BLKMEM *blkmem)
 
static SCIP_RETCODE saveGlobalCons (SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_NODE *node, REOPT_CONSTYPE consttype)
 
static SCIP_RETCODE reoptMoveIDs (SCIP_REOPTTREE *reopttree, BMS_BLKMEM *blkmem, unsigned int id1, unsigned int id2)
 
static SCIP_RETCODE changeAncestorBranchings (SCIP_REOPT *reopt, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_TREE *tree, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_CLIQUETABLE *cliquetable, BMS_BLKMEM *blkmem, SCIP_NODE *node, unsigned int id, SCIP_Bool afterdualintobranching)
 
static SCIP_RETCODE addSplitcons (SCIP_REOPT *reopt, SCIP *scip, SCIP_SET *set, SCIP_STAT *stat, BMS_BLKMEM *blkmem, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_TREE *tree, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_CLIQUETABLE *cliquetable, SCIP_NODE *node, unsigned int id)
 
static SCIP_RETCODE fixBounds (SCIP_REOPT *reopt, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_TREE *tree, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_CLIQUETABLE *cliquetable, BMS_BLKMEM *blkmem, SCIP_NODE *node, unsigned int id, SCIP_Bool updatedualconss)
 
static SCIP_RETCODE fixInterdiction (SCIP_REOPT *reopt, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_TREE *tree, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_CLIQUETABLE *cliquetable, BMS_BLKMEM *blkmem, SCIP_NODE *node, unsigned int id, SCIP_VAR **vars, SCIP_Real *vals, int nvars, int negbndchg)
 
static SCIP_RETCODE addLocalConss (SCIP *scip, SCIP_REOPT *reopt, SCIP_SET *set, SCIP_STAT *stat, BMS_BLKMEM *blkmem, SCIP_NODE *node, unsigned int id)
 
static void resetStats (SCIP_REOPT *reopt)
 
static SCIP_RETCODE dryBranch (SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_Bool *runagain, unsigned int id)
 
static int reopttreeGetNNodes (SCIP_REOPTTREE *reopttree, unsigned int id)
 
static int reoptGetNLeaves (SCIP_REOPT *reopt, unsigned int id)
 
static SCIP_RETCODE reoptGetLeaves (SCIP_REOPT *reopt, unsigned int id, unsigned int *leaves, int leavessize, int *nleaves)
 
static SCIP_RETCODE reoptResetTree (SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_Bool softreset)
 
static SCIP_RETCODE reoptRestart (SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem)
 
static SCIP_RETCODE reoptSaveNewObj (SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_VAR **transvars, int ntransvars)
 
static void permuteRandom (SCIP_VAR **vars, SCIP_Real *vals, int nvars, unsigned int *randseed)
 
int SCIPreoptGetNRestartsGlobal (SCIP_REOPT *reopt)
 
int SCIPreoptGetNRestartsLocal (SCIP_REOPT *reopt)
 
int SCIPreoptGetNTotalRestartsLocal (SCIP_REOPT *reopt)
 
int SCIPreoptGetFirstRestarts (SCIP_REOPT *reopt)
 
int SCIPreoptGetLastRestarts (SCIP_REOPT *reopt)
 
int SCIPreoptGetNFeasNodes (SCIP_REOPT *reopt)
 
int SCIPreoptGetNTotalFeasNodes (SCIP_REOPT *reopt)
 
int SCIPreoptGetNPrunedNodes (SCIP_REOPT *reopt)
 
int SCIPreoptGetNTotalPrunedNodes (SCIP_REOPT *reopt)
 
int SCIPreoptGetNCutoffReoptnodes (SCIP_REOPT *reopt)
 
int SCIPreoptGetNTotalCutoffReoptnodes (SCIP_REOPT *reopt)
 
int SCIPreoptGetNInfNodes (SCIP_REOPT *reopt)
 
int SCIPreoptGetNTotalInfNodes (SCIP_REOPT *reopt)
 
int SCIPreoptGetNInfSubtrees (SCIP_REOPT *reopt)
 
SCIP_RETCODE SCIPreoptCreate (SCIP_REOPT **reopt, SCIP_SET *set, BMS_BLKMEM *blkmem)
 
SCIP_RETCODE SCIPreoptFree (SCIP_REOPT **reopt, SCIP_SET *set, SCIP_PRIMAL *origprimal, BMS_BLKMEM *blkmem)
 
int SCIPreoptGetNAddedConss (SCIP_REOPT *reopt, SCIP_NODE *node)
 
SCIP_RETCODE SCIPreoptAddSol (SCIP_REOPT *reopt, SCIP_SET *set, SCIP_STAT *stat, SCIP_PRIMAL *origprimal, BMS_BLKMEM *blkmem, SCIP_SOL *sol, SCIP_Bool bestsol, SCIP_Bool *added, SCIP_VAR **vars, int nvars, int run)
 
SCIP_RETCODE SCIPreoptAddOptSol (SCIP_REOPT *reopt, SCIP_SOL *sol, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PRIMAL *origprimal)
 
SCIP_RETCODE SCIPreoptAddRun (SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_VAR **transvars, int ntransvars, int size)
 
int SCIPreoptGetNCheckedSols (SCIP_REOPT *reopt)
 
void SCIPreoptSetNCheckedSols (SCIP_REOPT *reopt, int ncheckedsols)
 
int SCIPreoptGetNImprovingSols (SCIP_REOPT *reopt)
 
void SCIPreoptSetNImprovingSols (SCIP_REOPT *reopt, int nimprovingsols)
 
int SCIPreoptGetNSolsRun (SCIP_REOPT *reopt, int run)
 
int SCIPreoptGetNSols (SCIP_REOPT *reopt)
 
SCIP_RETCODE SCIPreoptGetSolsRun (SCIP_REOPT *reopt, int run, SCIP_SOL **sols, int solssize, int *nsols)
 
int SCIPreoptGetNSavedSols (SCIP_REOPT *reopt)
 
SCIP_RETCODE SCIPreoptCheckRestart (SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_NODE *node, SCIP_VAR **transvars, int ntransvars, SCIP_Bool *restart)
 
SCIP_Real SCIPreoptGetSimToPrevious (SCIP_REOPT *reopt)
 
SCIP_Real SCIPreoptGetSimToFirst (SCIP_REOPT *reopt)
 
SCIP_Real SCIPreoptGetSimilarity (SCIP_REOPT *reopt, SCIP_SET *set, int run1, int run2, SCIP_VAR **transvars, int ntransvars)
 
SCIP_SOLSCIPreoptGetLastBestSol (SCIP_REOPT *reopt)
 
SCIP_REOPTNODESCIPreoptGetReoptnode (SCIP_REOPT *reopt, unsigned int id)
 
SCIP_Real SCIPreoptGetOldObjCoef (SCIP_REOPT *reopt, int run, int idx)
 
SCIP_SOLSCIPreoptGetBestSolRun (SCIP_REOPT *reopt, int run)
 
void SCIPreoptResetSolMarks (SCIP_REOPT *reopt)
 
int SCIPreoptGetNNodes (SCIP_REOPT *reopt, SCIP_NODE *node)
 
int SCIPreoptnodeGetNVars (SCIP_REOPTNODE *reoptnode)
 
int SCIPreoptnodeGetNConss (SCIP_REOPTNODE *reoptnode)
 
int SCIPreoptnodeGetNDualBoundChgs (SCIP_REOPTNODE *reoptnode)
 
int SCIPreoptnodeGetNChildren (SCIP_REOPTNODE *reoptnode)
 
SCIP_Real SCIPreoptnodeGetLowerbound (SCIP_REOPTNODE *reoptnode)
 
SCIP_REOPTTYPE SCIPreoptnodeGetType (SCIP_REOPTNODE *reoptnode)
 
void SCIPreoptnodeGetSplitCons (SCIP_REOPTNODE *reoptnode, SCIP_VAR **vars, SCIP_Real *vals, REOPT_CONSTYPE *constype, int conssize, int *nvars)
 
void SCIPreoptnodeGetConss (SCIP_REOPTNODE *reoptnode, SCIP_VAR ***vars, SCIP_Real **vals, int mem, int *nconss, int *nvars)
 
void SCIPreoptnodeSetParentID (SCIP_REOPTNODE *reoptnode, unsigned int parentid)
 
int SCIPreoptGetNLeaves (SCIP_REOPT *reopt, SCIP_NODE *node)
 
SCIP_RETCODE SCIPreoptAddInfNode (SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_NODE *node)
 
SCIP_RETCODE SCIPreoptCheckCutoff (SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_NODE *node, SCIP_EVENTTYPE eventtype, SCIP_LPSOLSTAT lpsolstat, SCIP_Bool isrootnode, SCIP_Bool isfocusnode, SCIP_Real lowerbound, int effectiverootdepth)
 
SCIP_RETCODE SCIPreoptAddDualBndchg (SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_NODE *node, SCIP_VAR *var, SCIP_Real newval, SCIP_Real oldval)
 
int SCIPreoptGetNDualBndchgs (SCIP_REOPT *reopt, SCIP_NODE *node)
 
SCIP_RETCODE SCIPreoptGetChildIDs (SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_NODE *node, unsigned int *childs, int childssize, int *nchilds)
 
SCIP_RETCODE SCIPreoptGetLeaves (SCIP_REOPT *reopt, SCIP_NODE *node, unsigned int *leaves, int leavessize, int *nleaves)
 
SCIP_RETCODE SCIPreoptSaveOpenNodes (SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_NODE **leaves, int nleaves, SCIP_NODE **childs, int nchilds, SCIP_NODE **siblings, int nsiblings)
 
SCIP_RETCODE SCIPreoptApplyCompression (SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_REOPTNODE **representatives, int nrepresentatives, SCIP_Bool *success)
 
SCIP_RETCODE SCIPreoptSplitRoot (SCIP_REOPT *reopt, SCIP_TREE *tree, SCIP_SET *set, BMS_BLKMEM *blkmem, unsigned int randseed, int *ncreatedchilds, int *naddedconss)
 
SCIP_RETCODE SCIPreoptResetDualBndchgs (SCIP_REOPT *reopt, SCIP_NODE *node, BMS_BLKMEM *blkmem)
 
void SCIPreoptnodeGetPath (SCIP_REOPT *reopt, SCIP_REOPTNODE *reoptnode, SCIP_VAR **vars, SCIP_Real *vals, SCIP_BOUNDTYPE *boundtypes, int varssize, int *nbndchgs, int *nbndchgsafterdual)
 
SCIP_RETCODE SCIPreoptDeleteNode (SCIP_REOPT *reopt, SCIP_SET *set, unsigned int id, BMS_BLKMEM *blkmem)
 
SCIP_RETCODE SCIPreoptApply (SCIP_REOPT *reopt, SCIP *scip, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_TREE *tree, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_CLIQUETABLE *cliquetable, BMS_BLKMEM *blkmem, unsigned int randseed, SCIP_REOPTNODE *reoptnode, unsigned int id, SCIP_Real estimate, SCIP_NODE **childnodes, int *ncreatedchilds, int *naddedconss, int childnodessize, SCIP_Bool *success)
 
SCIP_Real SCIPreoptGetSavingtime (SCIP_REOPT *reopt)
 
SCIP_RETCODE SCIPreoptAddGlbCons (SCIP_REOPT *reopt, SCIP_VAR **vars, SCIP_Real *vals, int nvars, BMS_BLKMEM *blkmem)
 
SCIP_RETCODE SCIPreoptApplyGlbConss (SCIP *scip, SCIP_REOPT *reopt, SCIP_SET *set, SCIP_STAT *stat, BMS_BLKMEM *blkmem)
 
SCIP_Bool SCIPreoptGetSolveLP (SCIP_REOPT *reopt, SCIP_SET *set, SCIP_NODE *node)
 
void SCIPreoptnodeInit (SCIP_REOPTNODE *reoptnode, SCIP_SET *set)
 
SCIP_RETCODE SCIPreoptnodeReset (SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_REOPTNODE *reoptnode)
 
SCIP_RETCODE SCIPreoptnodeDelete (SCIP_REOPTNODE **reoptnode, BMS_BLKMEM *blkmem)
 
SCIP_RETCODE SCIPreoptnodeAddBndchg (SCIP_REOPTNODE *reoptnode, BMS_BLKMEM *blkmem, SCIP_VAR *var, SCIP_Real val, SCIP_BOUNDTYPE boundtype)
 
SCIP_RETCODE SCIPreoptnodeAddCons (SCIP_REOPTNODE *reoptnode, BMS_BLKMEM *blkmem, SCIP_VAR **consvars, SCIP_Real *consvals, int nvars, REOPT_CONSTYPE constype)
 

Macro Definition Documentation

#define DEFAULT_MEM_VARAFTERDUAL   10

Definition at line 43 of file reopt.c.

Referenced by saveAfterDualBranchings().

#define DEFAULT_MEM_VAR   10

Definition at line 44 of file reopt.c.

Referenced by saveAncestorBranchings().

#define DEFAULT_MEM_NODES   1000

Definition at line 45 of file reopt.c.

Referenced by createReopttree().

#define DEFAULT_MEM_RUN   200

Definition at line 46 of file reopt.c.

Referenced by createSolTree(), and SCIPreoptCreate().

#define DEFAULT_MEM_DUALCONS   10

Definition at line 47 of file reopt.c.

Referenced by SCIPreoptAddDualBndchg().

#define EVENTHDLR_NAME   "Reopt"
#define EVENTHDLR_DESC   "node event handler for reoptimization"

Definition at line 51 of file reopt.c.

Referenced by SCIPreoptCreate().

Function Documentation

static SCIP_DECL_EVENTINITSOL ( eventInitsolReopt  )
static

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

Definition at line 90 of file reopt.c.

References EVENTHDLR_NAME, NULL, SCIP_CALL, SCIP_EVENTTYPE_GBDCHANGED, SCIP_OKAY, SCIP_VARTYPE_BINARY, SCIPcatchVarEvent(), SCIPeventhdlrGetName(), SCIPgetNVars(), SCIPgetVars(), SCIPisReoptEnabled(), and SCIPvarGetType().

static SCIP_DECL_EVENTEXITSOL ( eventExitsolReopt  )
static

solving process deinitialization method of event handler (called before branch and bound process data is freed)

Definition at line 116 of file reopt.c.

References EVENTHDLR_NAME, NULL, SCIP_CALL, SCIP_EVENTTYPE_GBDCHANGED, SCIP_OKAY, SCIP_VARTYPE_BINARY, SCIPdropVarEvent(), SCIPeventhdlrGetName(), SCIPgetNVars(), SCIPgetVars(), SCIPisReoptEnabled(), and SCIPvarGetType().

static SCIP_RETCODE ensureSolsSize ( SCIP_REOPT reopt,
SCIP_SET set,
BMS_BLKMEM blkmem,
int  num,
int  runidx 
)
static

ensures, that sols[pos] array can store at least num entries

Parameters
reoptreoptimization data structure
setglobal SCIP settings
blkmemblock memory
numminimum number of entries to store
runidxrun index for which the memory should checked

Definition at line 148 of file reopt.c.

References BMSreallocBlockMemoryArray, SCIP_ALLOC, SCIP_OKAY, SCIPsetCalcMemGrowSize(), SCIP_SolTree::sols, SCIP_SolTree::solssize, and SCIP_Reopt::soltree.

Referenced by SCIPreoptAddSol().

static SCIP_RETCODE ensureRunSize ( SCIP_REOPT reopt,
int  num,
BMS_BLKMEM blkmem 
)
static

ensures, that sols array can store at least num entries

Parameters
reoptreoptimization data structure
numminimum number of entries to store
blkmemblock memory

Definition at line 175 of file reopt.c.

References BMSreallocBlockMemoryArray, BMSreallocMemoryArray, SCIP_SolTree::nsols, NULL, SCIP_Reopt::objs, SCIP_Reopt::prevbestsols, SCIP_Reopt::runsize, SCIP_ALLOC, SCIP_OKAY, SCIP_SolTree::sols, SCIP_SolTree::solssize, and SCIP_Reopt::soltree.

Referenced by reoptSaveNewObj(), and SCIPreoptAddRun().

static SCIP_RETCODE reopttreeCheckMemory ( SCIP_REOPTTREE reopttree,
BMS_BLKMEM blkmem 
)
static

check the memory of the reoptimization tree and if necessary reallocate

Parameters
reopttreereoptimization tree
blkmemblock memory

Definition at line 211 of file reopt.c.

References BMSreallocBlockMemoryArray, SCIP_ReoptTree::nreoptnodes, NULL, SCIP_ReoptTree::openids, SCIP_ReoptTree::reoptnodes, SCIP_ReoptTree::reoptnodessize, SCIP_ALLOC, SCIP_CALL, SCIP_OKAY, SCIPqueueInsert(), and SCIPqueueIsEmpty().

Referenced by addNode(), and SCIPreoptSplitRoot().

static SCIP_RETCODE reoptnodeCheckMemory ( SCIP_REOPTNODE reoptnode,
BMS_BLKMEM blkmem,
int  var_mem,
int  child_mem,
int  conss_mem 
)
static
static int soltreeNInducedSols ( SCIP_SOLNODE solnode)
static

returns the number of stored solutions in the subtree induced by solnode

Parameters
solnodenode within the solution tree

Definition at line 316 of file reopt.c.

References SCIP_SolNode::father, SCIP_SolNode::lchild, NULL, and SCIP_SolNode::rchild.

Referenced by SCIPreoptGetNSavedSols().

static SCIP_Real reoptSimilarity ( SCIP_REOPT reopt,
SCIP_SET set,
int  obj1_id,
int  obj2_id,
SCIP_VAR **  transvars,
int  ntransvars 
)
static

returns the similarity of the objective functions of two given iterations

Parameters
reoptreoptimization data
setglobal SCIP settings
obj1_idid of one objective function
obj2_idid of the other objective function
transvarstransformed problem variables
ntransvarsnumber of transformed problem variables

Definition at line 339 of file reopt.c.

References FALSE, MIN, NULL, SCIP_Reopt::objs, SCIP_Bool, SCIP_Real, SCIPsetIsFeasLT(), SCIPvarGetLbLocal(), SCIPvarGetProbindex(), SCIPvarGetUbLocal(), SCIPvarIsActive(), SCIPvarIsOriginal(), and TRUE.

Referenced by reoptSaveNewObj(), and SCIPreoptGetSimilarity().

static SCIP_RETCODE reoptnodeDelete ( SCIP_REOPTNODE **  reoptnode,
BMS_BLKMEM blkmem 
)
static

delete the given reoptimization node

Parameters
reoptnodenode of the reoptimization tree
blkmemblock memory

Definition at line 399 of file reopt.c.

References BMSfreeBlockMemory, BMSfreeBlockMemoryArray, NULL, and SCIP_OKAY.

Referenced by reopttreeDeleteNode(), and SCIPreoptnodeDelete().

static SCIP_RETCODE reopttreeDeleteNode ( SCIP_REOPTTREE reopttree,
SCIP_SET set,
BMS_BLKMEM blkmem,
unsigned int  id,
SCIP_Bool  softreset 
)
static

delete the node stored at position nodeID of the reoptimization tree

Parameters
reopttreereoptimization tree
setglobal SCIP settings
blkmemblock memory
idid of a node
softresetdelete at the end of the solving process

Definition at line 576 of file reopt.c.

References SCIP_ReoptNode::childids, SCIP_ReoptNode::conss, SCIP_ReoptNode::nchilds, SCIP_ReoptNode::nconss, SCIP_ReoptTree::nreoptnodes, NULL, reoptnodeDelete(), reoptnodeReset(), SCIP_ReoptTree::reoptnodes, SCIP_CALL, and SCIP_OKAY.

Referenced by clearReoptnodes(), deleteChildrenBelow(), dryBranch(), SCIPreoptDeleteNode(), and shrinkNode().

static SCIP_RETCODE createSolTree ( SCIP_SOLTREE soltree,
BMS_BLKMEM blkmem 
)
static
static SCIP_RETCODE soltreefreeNode ( SCIP_REOPT reopt,
SCIP_SET set,
SCIP_PRIMAL primal,
BMS_BLKMEM blkmem,
SCIP_SOLNODE **  solnode 
)
static

free the given solution node

Parameters
reoptreoptimization data
setglobal SCIP settings
primalthe primal
blkmemblock memory
solnodenode within the solution tree

Definition at line 640 of file reopt.c.

References BMSfreeBlockMemoryNull, NULL, SCIP_CALL, SCIP_OKAY, SCIP_STAGE_INIT, SCIP_STAGE_PROBLEM, and SCIPsolFree().

Referenced by freeSolTree().

static SCIP_RETCODE freeSolTree ( SCIP_REOPT reopt,
SCIP_SET set,
SCIP_PRIMAL origprimal,
BMS_BLKMEM blkmem 
)
static

free the solution tree

Parameters
reoptreoptimization data
setglobal SCIP settings
origprimalthe origprimal
blkmemblock memory

Definition at line 683 of file reopt.c.

References BMSfreeBlockMemoryArray, BMSfreeMemory, SCIP_SolTree::nsols, NULL, SCIP_SolTree::root, SCIP_Reopt::runsize, SCIP_CALL, SCIP_OKAY, SCIP_SolTree::sols, SCIP_SolTree::solssize, SCIP_Reopt::soltree, and soltreefreeNode().

Referenced by SCIPreoptFree().

static SCIP_RETCODE solnodeAddChild ( BMS_BLKMEM blkmem,
SCIP_SOLNODE father,
SCIP_Bool  rchild,
SCIP_Bool  lchild 
)
static

creates and adds a solution node to the solution tree

Parameters
blkmemblock memory
fatherfather of the node to add
rchild0-branch?
lchild1-branch?

Definition at line 710 of file reopt.c.

References BMSallocBlockMemory, FALSE, SCIP_SolNode::father, SCIP_SolNode::lchild, NULL, SCIP_SolNode::rchild, SCIP_ALLOC, SCIP_OKAY, SCIP_SolNode::sol, and SCIP_SolNode::updated.

Referenced by soltreeAddSol().

static SCIP_RETCODE soltreeAddSol ( SCIP_REOPT reopt,
SCIP_SET set,
SCIP_STAT stat,
SCIP_PRIMAL origprimal,
BMS_BLKMEM blkmem,
SCIP_VAR **  vars,
SCIP_SOL sol,
SCIP_SOLNODE **  solnode,
int  nvars,
SCIP_Bool  bestsol,
SCIP_Bool added 
)
static

add a solution to the solution tree

Parameters
reoptreoptimization data
setglobal SCIP settings
statdynamic problem statistics
origprimalorig primal
blkmemblock memory
varsarray of original variables
solsolution to add
solnodecurrent solution node
nvarsnumber of variables
bestsolis the solution an optimal (best found) solution
addedpointer to store the result

Definition at line 740 of file reopt.c.

References FALSE, SCIP_SolNode::lchild, NULL, SCIP_Reopt::prevbestsols, SCIP_SolNode::rchild, SCIP_SolTree::root, SCIP_Reopt::run, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPsetIsFeasEQ(), SCIPsolCopy(), SCIPsolGetVal(), SCIPvarIsIntegral(), SCIP_SolNode::sol, solnodeAddChild(), SCIP_Reopt::soltree, and TRUE.

Referenced by SCIPreoptAddSol().

static void soltreeResetMarks ( SCIP_SOLNODE node)
static

reset all marks 'updated' to FALSE

Parameters
nodenode within the solution tree

Definition at line 837 of file reopt.c.

References FALSE, SCIP_SolNode::father, SCIP_SolNode::lchild, NULL, SCIP_SolNode::rchild, SCIP_SolNode::sol, and SCIP_SolNode::updated.

Referenced by SCIPreoptResetSolMarks().

static SCIP_RETCODE clearReoptnodes ( SCIP_REOPTTREE reopttree,
SCIP_SET set,
BMS_BLKMEM blkmem,
SCIP_Bool  softreset 
)
static

clears the reopttree, e.g., to restart and solve the next problem from scratch

Parameters
reopttreereoptimization tree
setglobal SCIP settings
blkmemblock memory
softresetdelete nodes before exit the solving process

Definition at line 967 of file reopt.c.

References SCIP_ReoptTree::nreoptnodes, NULL, SCIP_ReoptNode::nvars, SCIP_ReoptTree::openids, SCIP_ReoptTree::reoptnodes, SCIP_ReoptTree::reoptnodessize, reopttreeDeleteNode(), SCIP_CALL, SCIP_OKAY, SCIPqueueClear(), SCIPqueueInsert(), and SCIPqueueNElems().

Referenced by freeReoptTree(), and reoptResetTree().

static SCIP_RETCODE freeReoptTree ( SCIP_REOPTTREE reopttree,
SCIP_SET set,
BMS_BLKMEM blkmem 
)
static

free the reoptimization tree

Parameters
reopttreereoptimization tree data
setglobal SCIP settings
blkmemblock memory

Definition at line 1005 of file reopt.c.

References BMSfreeBlockMemoryArray, BMSfreeMemory, clearReoptnodes(), FALSE, NULL, SCIP_ReoptTree::openids, SCIP_ReoptTree::reoptnodes, SCIP_ReoptTree::reoptnodessize, SCIP_CALL, SCIP_OKAY, and SCIPqueueFree().

Referenced by SCIPreoptFree().

static SCIP_RETCODE checkMemDualCons ( SCIP_REOPT reopt,
BMS_BLKMEM blkmem,
int  size 
)
static

check memory for the constraint to handle bound changes based on dual information

Parameters
reoptreoptimization data structure
blkmemblock memory
sizesize which need to be allocated

Definition at line 1029 of file reopt.c.

References BMSallocBlockMemory, BMSallocBlockMemoryArray, BMSreallocBlockMemoryArray, SCIP_Reopt::dualcons, NULL, LogicOrData::nvars, SCIP_ALLOC, SCIP_OKAY, LogicOrData::vals, LogicOrData::vars, and LogicOrData::varssize.

Referenced by collectDualInformation(), and SCIPreoptAddDualBndchg().

static SCIP_RETCODE checkMemGlbCons ( SCIP_REOPT reopt,
BMS_BLKMEM blkmem,
int  mem 
)
static

check the memory to store global constraints

Parameters
reoptreoptimization data structure
blkmemblock memory
memmemory which has to be allocated

Definition at line 1069 of file reopt.c.

References SCIP_Reopt::allocmemglbconss, BMSallocBlockMemoryArray, BMSreallocBlockMemoryArray, SCIP_Reopt::glbconss, SCIP_Reopt::nglbconss, NULL, SCIP_ALLOC, and SCIP_OKAY.

Referenced by saveGlobalCons(), and SCIPreoptAddGlbCons().

static SCIP_RETCODE updateConstraintPropagation ( SCIP_REOPT reopt,
BMS_BLKMEM blkmem,
SCIP_NODE node,
unsigned int  id,
SCIP_Bool transintoorig 
)
static

update the bound changes made by constraint propagations during current iteration; stop saving the bound changes if we reach a branching decision based on a dual information.

Parameters
reoptreoptimization data structure
blkmemblock memory
nodenode of the search tree
idid of the node
transintoorigtransform variables into originals

Definition at line 1102 of file reopt.c.

References NULL, SCIP_ReoptNode::nvars, reoptnodeCheckMemory(), SCIP_ReoptTree::reoptnodes, SCIP_Reopt::reopttree, SCIP_CALL, SCIP_OKAY, SCIPnodeGetConsProps(), SCIPnodeGetNDomchg(), TRUE, SCIP_ReoptNode::varbounds, SCIP_ReoptNode::varboundtypes, SCIP_ReoptNode::vars, and SCIP_ReoptNode::varssize.

Referenced by addNode().

static SCIP_RETCODE saveAfterDualBranchings ( SCIP_REOPT reopt,
BMS_BLKMEM blkmem,
SCIP_NODE node,
unsigned int  id,
SCIP_Bool transintoorig 
)
static

save bound changes made after the first bound change based on dual information, e.g., mode by strong branching

This method is can be used during reoptimization. if we want to reconstruct a node containing dual bound changes we have to split the node into the original one and at least one node representing the pruned part. all bound changes, i.e., (constraint) propagation, made after the first bound change based on dual information are still valid for the original node after changing the objective function. thus, we can store them for the following iterations.

It should be noted, that these bound change will be found by (constraint) propagation methods anyway after changing the objective function. do not saving these information and find them again might be useful for conflict analysis.

Parameters
reoptreoptimization data structure
blkmemblock memory
nodenode of the search tree
idid of the node
transintoorigtransform variables into originals

Definition at line 1157 of file reopt.c.

References SCIP_ReoptNode::afterdualvarbounds, SCIP_ReoptNode::afterdualvarboundtypes, SCIP_ReoptNode::afterdualvars, SCIP_ReoptNode::afterdualvarssize, BMSallocBlockMemoryArray, BMSreallocBlockMemoryArray, DEFAULT_MEM_VARAFTERDUAL, SCIP_ReoptNode::nafterdualvars, NULL, SCIP_ReoptTree::reoptnodes, SCIP_Reopt::reopttree, SCIP_ALLOC, SCIP_OKAY, SCIPdebugMessage, SCIPnodeGetBdChgsAfterDual(), and TRUE.

Referenced by addNode().

static SCIP_RETCODE transformIntoOrig ( SCIP_REOPT reopt,
unsigned int  id 
)
static

transform variable and bounds back to the original space

Parameters
reoptreoptimization data structure
idid of the node

Definition at line 1236 of file reopt.c.

References SCIP_ReoptNode::afterdualvarbounds, SCIP_ReoptNode::afterdualvars, SCIP_ReoptNode::nafterdualvars, NULL, SCIP_ReoptNode::nvars, SCIP_ReoptTree::reoptnodes, SCIP_Reopt::reopttree, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPvarGetOrigvarSum(), SCIPvarIsOriginal(), SCIP_ReoptNode::varbounds, and SCIP_ReoptNode::vars.

Referenced by addNode().

static SCIP_RETCODE getLastSavedNode ( SCIP_REOPT reopt,
SCIP_SET set,
SCIP_NODE node,
SCIP_NODE **  parent,
unsigned int *  parentid,
int *  nbndchgs 
)
static

search the next node along the root path that was saved by reoptimization

Parameters
reoptreoptimization data structure
setglobal SCIP settings
nodenode of the search tree
parentparent node within the search tree
parentidid of the parent node
nbndchgsnumber of bound changes

Definition at line 1286 of file reopt.c.

References NULL, SCIP_ReoptTree::reoptnodes, SCIP_ReoptTree::reoptnodessize, SCIP_Reopt::reopttree, SCIP_OKAY, SCIP_REOPTTYPE_TRANSIT, SCIPnodeGetDepth(), SCIPnodeGetNDomchg(), SCIPnodeGetParent(), SCIPnodeGetReoptID(), and SCIPnodeGetReopttype().

Referenced by addNode(), and shrinkNode().

static SCIP_RETCODE reoptAddChild ( SCIP_REOPTTREE reopttree,
BMS_BLKMEM blkmem,
unsigned int  parentid,
unsigned int  childid 
)
static

adds the id childid to the array of child nodes of parentid

Parameters
reopttreereoptimization tree
blkmemblock memory
parentidid of the parent node
childidid of the child node

Definition at line 1335 of file reopt.c.

References SCIP_ReoptNode::allocchildmem, SCIP_ReoptNode::childids, SCIP_ReoptNode::nchilds, NULL, reoptnodeCheckMemory(), SCIP_ReoptTree::reoptnodes, SCIP_ReoptTree::reoptnodessize, SCIP_CALL, SCIP_OKAY, and SCIPdebugMessage.

Referenced by addNode(), moveChildrenUp(), SCIPreoptApplyCompression(), and SCIPreoptSplitRoot().

static SCIP_RETCODE moveChildrenUp ( SCIP_REOPT reopt,
BMS_BLKMEM blkmem,
unsigned int  nodeid,
unsigned int  parentid 
)
static

move all children to the next node (along the root path) stored in the reoptimization tree

Parameters
reoptreoptimization data structure
blkmemblock memory
nodeidid of the node
parentidid of the parent node

Definition at line 1367 of file reopt.c.

References SCIP_ReoptNode::childids, SCIP_ReoptNode::nchilds, NULL, SCIP_ReoptNode::nvars, SCIP_ReoptNode::parentID, reoptAddChild(), reoptnodeCheckMemory(), SCIP_ReoptTree::reoptnodes, SCIP_Reopt::reopttree, SCIP_CALL, SCIP_OKAY, SCIP_ReoptNode::varbounds, SCIP_ReoptNode::varboundtypes, SCIP_ReoptNode::vars, and SCIP_ReoptNode::varssize.

Referenced by shrinkNode().

static SCIP_RETCODE deleteChildrenBelow ( SCIP_REOPTTREE reopttree,
SCIP_SET set,
BMS_BLKMEM blkmem,
unsigned int  id,
SCIP_Bool  delnodeitself,
SCIP_Bool  exitsolve 
)
static

delete all nodes in the subtree induced by nodeID

Parameters
reopttreereoptimization tree
setglobal SCIP settings
blkmemblock memory
idid of the node
delnodeitselfshould the node deleted after deleting the induced subtree?
exitsolvewill the solving process end after deletion

Definition at line 1426 of file reopt.c.

References SCIP_ReoptNode::childids, SCIP_ReoptNode::nchilds, NULL, SCIP_ReoptTree::openids, SCIP_ReoptTree::reoptnodes, reopttreeDeleteNode(), SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, SCIPqueueInsert(), and TRUE.

Referenced by addNode(), dryBranch(), and reoptCheckLocalRestart().

static SCIP_RETCODE shrinkNode ( SCIP_REOPT reopt,
SCIP_SET set,
SCIP_NODE node,
unsigned int  id,
SCIP_Bool shrank,
BMS_BLKMEM blkmem 
)
static

replaces a reoptimization nodes by its stored child nodes

Parameters
reoptreoptimization data structure
setglobal SCIP settings
nodenode of the search tree
idid of the node
shrankpointer to store if the node was shrank
blkmemblock memory

Definition at line 1472 of file reopt.c.

References SCIP_ReoptNode::childids, getLastSavedNode(), moveChildrenUp(), SCIP_ReoptNode::nchilds, NULL, SCIP_ReoptTree::openids, SCIP_ReoptTree::reoptnodes, SCIP_Reopt::reopttree, reopttreeDeleteNode(), SCIP_CALL, SCIP_OKAY, SCIP_REOPTTYPE_NONE, SCIPdebugMessage, SCIPnodeGetNumber(), SCIPnodeSetReopttype(), SCIPqueueInsert(), and TRUE.

Referenced by addNode().

static SCIP_RETCODE changeReopttypeOfSubtree ( SCIP_REOPTTREE reopttree,
unsigned int  id,
SCIP_REOPTTYPE  reopttype 
)
static

change all reopttypes in the subtree induced by nodeID

Parameters
reopttreereopttree
idid of the node
reopttypereopttype

Definition at line 1541 of file reopt.c.

References SCIP_ReoptNode::childids, SCIP_ReoptNode::nchilds, NULL, SCIP_ReoptTree::reoptnodes, SCIP_ReoptNode::reopttype, SCIP_CALL, SCIP_OKAY, SCIP_REOPTTYPE_INFSUBTREE, and SCIP_REOPTTYPE_STRBRANCHED.

Referenced by addNode().

static SCIP_RETCODE reoptnodeUpdateDualConss ( SCIP_REOPTNODE reoptnode,
BMS_BLKMEM blkmem 
)
static

delete the constraint handling dual information for the current iteration and replace it with the dual constraint for the next iteration

Parameters
reoptnodereoptimization node
blkmemblock memory

Definition at line 1586 of file reopt.c.

References BMSfreeBlockMemory, BMSfreeBlockMemoryArray, SCIP_ReoptNode::dualconscur, SCIP_ReoptNode::dualconsnex, SCIP_ReoptNode::dualfixing, NULL, SCIP_OKAY, SCIPdebugMessage, LogicOrData::vals, LogicOrData::vars, and LogicOrData::varssize.

Referenced by fixBounds(), reoptCheckLocalRestart(), SCIPreoptApply(), and SCIPreoptSplitRoot().

static SCIP_RETCODE reoptCheckLocalRestart ( SCIP_REOPT reopt,
SCIP_SET set,
BMS_BLKMEM blkmem,
SCIP_NODE node,
SCIP_VAR **  transvars,
int  ntransvars,
SCIP_Bool localrestart 
)
static

calculates a (local) similarity of a given node and returns if the subproblem should be solved from scratch

Parameters
reoptreoptimization data structure
setglobal SCIP settings
blkmemblock memory
nodenode of the search tree
transvarstransformed variables
ntransvarsnumber of transformed variables
localrestartpointer to store if we want to restart solving the (sub)problem

Definition at line 1617 of file reopt.c.

References deleteChildrenBelow(), FALSE, SCIP_Reopt::nlocrestarts, SCIP_Reopt::ntotallocrestarts, NULL, SCIP_ReoptTree::reoptnodes, reoptnodeUpdateDualConss(), SCIP_Reopt::reopttree, SCIP_Reopt::run, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPdebugMessage, SCIPnodeGetDepth(), SCIPnodeGetReoptID(), SCIPreoptGetOldObjCoef(), SCIPsetIsFeasLT(), SCIPsetIsLT(), SCIPvarGetLbLocal(), SCIPvarGetProbindex(), SCIPvarGetUbLocal(), and TRUE.

Referenced by SCIPreoptCheckRestart().

static SCIP_RETCODE saveAncestorBranchings ( SCIP_REOPTTREE reopttree,
BMS_BLKMEM blkmem,
SCIP_NODE node,
SCIP_NODE parent,
unsigned int  id,
unsigned int  parentid 
)
static

save ancestor branching information up to the next stored node

Parameters
reopttreereoptimization tree
blkmemblock memory
nodenode of the branch and bound tree
parentparent node
idid of the node
parentidid of the parent node

Definition at line 1706 of file reopt.c.

References DEFAULT_MEM_VAR, NULL, SCIP_ReoptNode::nvars, reoptnodeCheckMemory(), SCIP_ReoptTree::reoptnodes, SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, SCIPnodeGetAncestorBranchingsPart(), SCIP_ReoptNode::varbounds, SCIP_ReoptNode::varboundtypes, SCIP_ReoptNode::vars, and SCIP_ReoptNode::varssize.

Referenced by addNode().

static SCIP_RETCODE collectDualInformation ( SCIP_REOPT reopt,
BMS_BLKMEM blkmem,
SCIP_NODE node,
unsigned int  id,
SCIP_REOPTTYPE  reopttype 
)
static

collect all bound changes based on dual information

If the bound changes are global, all information are already stored because they were caught by the event handler. otherwise, we have to use SCIPnodeGetDualBoundchgs.

Afterwards, we check if the constraint will be added in the next iteration or after splitting the node.

Parameters
reoptreoptimization data structure
blkmemblock memory
nodenode of the search tree
idid of the node
reopttypereopttype

Definition at line 1883 of file reopt.c.

References BMSallocBlockMemory, BMSduplicateBlockMemoryArray, checkMemDualCons(), LogicOrData::constype, SCIP_Reopt::currentnode, SCIP_Reopt::dualcons, SCIP_ReoptNode::dualconscur, SCIP_ReoptNode::dualconsnex, SCIP_ReoptNode::dualfixing, FALSE, NULL, LogicOrData::nvars, REOPT_CONSTYPE_INFSUBTREE, REOPT_CONSTYPE_STRBRANCHED, SCIP_ReoptTree::reoptnodes, SCIP_Reopt::reopttree, SCIP_ALLOC, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIP_REOPTTYPE_STRBRANCHED, SCIPdebugMessage, SCIPnodeGetDualBoundchgs(), SCIPnodeGetNDualBndchgs(), SCIPnodeGetNumber(), SCIPvarGetOrigvarSum(), SCIPvarIsOriginal(), TRUE, LogicOrData::vals, LogicOrData::vars, and LogicOrData::varssize.

Referenced by addNode().

static SCIP_RETCODE addNode ( SCIP_REOPT reopt,
SCIP_SET set,
BMS_BLKMEM blkmem,
SCIP_NODE node,
SCIP_REOPTTYPE  reopttype,
SCIP_Bool  saveafterdual,
SCIP_Bool  isrootnode,
SCIP_Real  lowerbound 
)
static

adds a node of the branch and bound tree to the reoptimization tree

Parameters
reoptreoptimization data structure
setglobal SCIP settings
blkmemblock memory
nodecurrent node
reopttypereason for storing the node
saveafterdualsave branching decisions after the first dual
isrootnodenode is the root node
lowerboundlower bound of the node

Definition at line 2002 of file reopt.c.

References SCIP_ReoptNode::afterdualvarbounds, SCIP_ReoptNode::afterdualvarboundtypes, SCIP_ReoptNode::afterdualvars, SCIP_ReoptNode::allocchildmem, changeReopttypeOfSubtree(), SCIP_ReoptNode::childids, collectDualInformation(), createReoptnode(), SCIP_Reopt::currentnode, deleteChildrenBelow(), SCIP_Reopt::dualcons, SCIP_ReoptNode::dualfixing, FALSE, getLastSavedNode(), SCIP_ReoptNode::lowerbound, SCIP_ReoptNode::nafterdualvars, SCIP_ReoptNode::nchilds, SCIP_ReoptNode::nconss, SCIP_ReoptTree::ncutoffreoptnodes, SCIP_ReoptTree::nfeasnodes, SCIP_ReoptTree::nprunednodes, SCIP_ReoptTree::ntotalcutoffreoptnodes, SCIP_ReoptTree::ntotalfeasnodes, SCIP_ReoptTree::ntotalprunednodes, NULL, LogicOrData::nvars, SCIP_ReoptNode::nvars, SCIP_ReoptTree::openids, SCIP_ReoptNode::parentID, REALABS, reoptAddChild(), reoptnodeCheckMemory(), SCIP_ReoptTree::reoptnodes, SCIP_Reopt::reopttree, reopttreeCheckMemory(), SCIP_ReoptNode::reopttype, saveAfterDualBranchings(), saveAncestorBranchings(), saveLocalConssData(), SCIP_Reopt::savingtime, SCIP_Bool, SCIP_BOUNDTYPE_LOWER, SCIP_CALL, SCIP_OKAY, SCIP_REOPTTYPE_FEASIBLE, SCIP_REOPTTYPE_INFSUBTREE, SCIP_REOPTTYPE_LEAF, SCIP_REOPTTYPE_LOGICORNODE, SCIP_REOPTTYPE_NONE, SCIP_REOPTTYPE_PRUNED, SCIP_REOPTTYPE_STRBRANCHED, SCIP_REOPTTYPE_TRANSIT, SCIPclockStart(), SCIPclockStop(), SCIPdebugMessage, SCIPnodeGetDepth(), SCIPnodeGetNAddedConss(), SCIPnodeGetNumber(), SCIPnodeGetReoptID(), SCIPnodeSetReoptID(), SCIPnodeSetReopttype(), SCIPqueueRemove(), SCIPreoptResetDualBndchgs(), SCIPsetInfinity(), SCIPsetIsEQ(), SCIPvarGetName(), shrinkNode(), transformIntoOrig(), TRUE, updateConstraintPropagation(), SCIP_ReoptNode::varbounds, SCIP_ReoptNode::varboundtypes, and SCIP_ReoptNode::vars.

Referenced by SCIPreoptCheckCutoff(), and SCIPreoptSaveOpenNodes().

static void deleteLastDualBndchgs ( SCIP_REOPT reopt)
static

delete the stored information about dual bound changes of the last focused node

Parameters
reoptreoptimization data structure

Definition at line 2496 of file reopt.c.

References SCIP_Reopt::currentnode, SCIP_Reopt::dualcons, NULL, LogicOrData::nvars, and SCIPdebugMessage.

Referenced by SCIPreoptCheckCutoff().

static SCIP_RETCODE reoptnodeResetDualConss ( SCIP_REOPTNODE reoptnode,
BMS_BLKMEM blkmem 
)
static

delete the stored constraints that dual information at the given reoptimization node

Parameters
reoptnodereoptimization node
blkmemblock memory

Definition at line 2513 of file reopt.c.

References BMSfreeBlockMemory, BMSfreeBlockMemoryArray, SCIP_ReoptNode::dualconscur, SCIP_ReoptNode::dualconsnex, SCIP_ReoptNode::dualfixing, FALSE, NULL, SCIP_OKAY, SCIPdebugMessage, LogicOrData::vals, LogicOrData::vars, and LogicOrData::varssize.

Referenced by SCIPreoptResetDualBndchgs().

static SCIP_RETCODE saveGlobalCons ( SCIP_REOPT reopt,
SCIP_SET set,
BMS_BLKMEM blkmem,
SCIP_NODE node,
REOPT_CONSTYPE  consttype 
)
static

generate a global constraint to separate an infeasible subtree

Parameters
reoptreoptimization data structure
setglobal SCIP settings
blkmemblock memory
nodenode of the search tree
consttypereopttype of the constraint

Definition at line 2548 of file reopt.c.

References BMSallocBlockMemory, BMSallocBlockMemoryArray, BMSreallocBlockMemoryArray, checkMemGlbCons(), LogicOrData::constype, SCIP_Reopt::glbconss, SCIP_Reopt::nglbconss, NULL, REOPT_CONSTYPE_INFSUBTREE, SCIP_ALLOC, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPnodeGetAncestorBranchings(), SCIPnodeGetDepth(), SCIPsetAllocBufferArray, SCIPsetFreeBufferArray, SCIPsetIsFeasEQ(), SCIPvarGetOrigvarSum(), LogicOrData::vals, LogicOrData::vars, and LogicOrData::varssize.

Referenced by SCIPreoptAddInfNode().

static SCIP_RETCODE reoptMoveIDs ( SCIP_REOPTTREE reopttree,
BMS_BLKMEM blkmem,
unsigned int  id1,
unsigned int  id2 
)
static

move all id of child nodes from reoptimization node stored at id1 to the node stored at id2

Parameters
reopttreereopttree
blkmemblock memory
id1source id
id2target id

Definition at line 2624 of file reopt.c.

References SCIP_ReoptNode::allocchildmem, SCIP_ReoptNode::childids, SCIP_ReoptNode::nchilds, NULL, reoptnodeCheckMemory(), SCIP_ReoptTree::reoptnodes, SCIP_CALL, SCIP_OKAY, and SCIPdebugMessage.

Referenced by SCIPreoptSplitRoot().

static SCIP_RETCODE changeAncestorBranchings ( SCIP_REOPT reopt,
SCIP_SET set,
SCIP_STAT stat,
SCIP_PROB transprob,
SCIP_PROB origprob,
SCIP_TREE tree,
SCIP_LP lp,
SCIP_BRANCHCAND branchcand,
SCIP_EVENTQUEUE eventqueue,
SCIP_CLIQUETABLE cliquetable,
BMS_BLKMEM blkmem,
SCIP_NODE node,
unsigned int  id,
SCIP_Bool  afterdualintobranching 
)
static

change all bound changes along the root path

Parameters
reoptreoptimization data structure
setglobal SCIP settings
statdynamic problem statistics
transprobtransformed problem
origproboriginal problem
treesearch tree
lpcurrent LP
branchcandbranching candidates
eventqueueevent queue
cliquetableclique table
blkmemblock memory
nodenode of the branch and bound tree
idid of stored node
afterdualintobranchingapply and convert bound changes made after the first based on dual information into branchings

Definition at line 2676 of file reopt.c.

References SCIP_ReoptNode::afterdualvarbounds, SCIP_ReoptNode::afterdualvarboundtypes, SCIP_ReoptNode::afterdualvars, SCIP_ReoptNode::afterdualvarssize, BMSfreeBlockMemoryArray, FALSE, SCIP_ReoptNode::nafterdualvars, NULL, SCIP_ReoptNode::nvars, reoptnodeCheckMemory(), SCIP_ReoptTree::reoptnodes, SCIP_Reopt::reopttree, SCIP_Bool, SCIP_BOUNDTYPE_LOWER, SCIP_BOUNDTYPE_UPPER, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIP_VARSTATUS_MULTAGGR, SCIPdebugMessage, SCIPnodeAddBoundchg(), SCIPsetIsFeasGE(), SCIPsetIsFeasLE(), SCIPsetIsGT(), SCIPsetIsLT(), SCIPvarAdjustLb(), SCIPvarAdjustUb(), SCIPvarGetLbLocal(), SCIPvarGetName(), SCIPvarGetProbvarBound(), SCIPvarGetStatus(), SCIPvarGetUbLocal(), SCIPvarIsOriginal(), SCIPvarIsTransformed(), TRUE, SCIP_ReoptNode::varbounds, SCIP_ReoptNode::varboundtypes, and SCIP_ReoptNode::vars.

Referenced by SCIPreoptApply().

static SCIP_RETCODE addSplitcons ( SCIP_REOPT reopt,
SCIP scip,
SCIP_SET set,
SCIP_STAT stat,
BMS_BLKMEM blkmem,
SCIP_PROB transprob,
SCIP_PROB origprob,
SCIP_TREE tree,
SCIP_LP lp,
SCIP_BRANCHCAND branchcand,
SCIP_EVENTQUEUE eventqueue,
SCIP_CLIQUETABLE cliquetable,
SCIP_NODE node,
unsigned int  id 
)
static

add a constraint to ensure that at least one variable bound gets different

Parameters
reoptreoptimization data structure
scipSCIP data structure
setglobal SCIP settings
statdynamic problem statistics
blkmemblock memory
transprobtransformed problem
origproboriginal problem
treesearch tree
lpcurrent LP
branchcandbranching candidates
eventqueueevent queue
cliquetableclique table data structure
nodenode corresponding to the pruned part
idid of stored node

Definition at line 2848 of file reopt.c.

References LogicOrData::constype, SCIP_ReoptNode::dualconscur, SCIP_ReoptNode::dualfixing, FALSE, NULL, LogicOrData::nvars, REOPT_CONSTYPE_INFSUBTREE, REOPT_CONSTYPE_STRBRANCHED, SCIP_ReoptTree::reoptnodes, SCIP_Reopt::reopttree, SCIP_BOUNDTYPE_LOWER, SCIP_BOUNDTYPE_UPPER, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIP_VARSTATUS_MULTAGGR, SCIPaddConsNode(), SCIPallocBufferArray, SCIPcreateConsLogicor(), SCIPdebugMessage, SCIPdebugPrintCons, SCIPfreeBufferArray, SCIPnodeAddBoundchg(), SCIPnodeGetNumber(), SCIPreleaseCons(), SCIPsetIsFeasEQ(), SCIPsetIsFeasGE(), SCIPsetIsFeasLE(), SCIPsetIsGT(), SCIPsetIsLT(), SCIPvarAdjustLb(), SCIPvarAdjustUb(), SCIPvarGetLbLocal(), SCIPvarGetName(), SCIPvarGetProbvarBound(), SCIPvarGetStatus(), SCIPvarGetUbLocal(), SCIPvarIsNegated(), SCIPvarIsOriginal(), SCIPvarIsTransformed(), SCIPvarNegate(), TRUE, LogicOrData::vals, and LogicOrData::vars.

Referenced by SCIPreoptApply().

static SCIP_RETCODE fixBounds ( SCIP_REOPT reopt,
SCIP_SET set,
SCIP_STAT stat,
SCIP_PROB transprob,
SCIP_PROB origprob,
SCIP_TREE tree,
SCIP_LP lp,
SCIP_BRANCHCAND branchcand,
SCIP_EVENTQUEUE eventqueue,
SCIP_CLIQUETABLE cliquetable,
BMS_BLKMEM blkmem,
SCIP_NODE node,
unsigned int  id,
SCIP_Bool  updatedualconss 
)
static

fix all bounds ad stored in dualconscur at the given node node_fix

Parameters
reoptreoptimization data structure
setglobal SCIP settings
statdynamic problem statistics
transprobtransformed problem
origproboriginal problem
treesearch tree
lpcurrent LP
branchcandbranching candidates
eventqueueevent queue
cliquetableclique table
blkmemblock memory
nodenode corresponding to the fixed part
idid of stored node
updatedualconssupdate constraint representing dual bound changes

Definition at line 2992 of file reopt.c.

References SCIP_ReoptNode::dualconscur, SCIP_ReoptNode::dualfixing, FALSE, NULL, LogicOrData::nvars, SCIP_ReoptNode::nvars, reoptnodeCheckMemory(), SCIP_ReoptTree::reoptnodes, reoptnodeUpdateDualConss(), SCIP_Reopt::reopttree, SCIP_Bool, SCIP_BOUNDTYPE_LOWER, SCIP_BOUNDTYPE_UPPER, SCIP_CALL, SCIP_INVALIDDATA, SCIP_OKAY, SCIP_Real, SCIPdebugMessage, SCIPerrorMessage, SCIPnodeAddBoundchg(), SCIPsetIsFeasEQ(), SCIPsetIsFeasGE(), SCIPsetIsFeasLE(), SCIPsetIsGT(), SCIPsetIsLT(), SCIPvarAdjustLb(), SCIPvarAdjustUb(), SCIPvarGetLbLocal(), SCIPvarGetName(), SCIPvarGetOrigvarSum(), SCIPvarGetProbvarBound(), SCIPvarGetUbLocal(), SCIPvarIsOriginal(), SCIPvarIsTransformedOrigvar(), TRUE, LogicOrData::vals, SCIP_ReoptNode::varbounds, SCIP_ReoptNode::varboundtypes, LogicOrData::vars, and SCIP_ReoptNode::vars.

Referenced by SCIPreoptApply().

static SCIP_RETCODE fixInterdiction ( SCIP_REOPT reopt,
SCIP_SET set,
SCIP_STAT stat,
SCIP_PROB transprob,
SCIP_PROB origprob,
SCIP_TREE tree,
SCIP_LP lp,
SCIP_BRANCHCAND branchcand,
SCIP_EVENTQUEUE eventqueue,
SCIP_CLIQUETABLE cliquetable,
BMS_BLKMEM blkmem,
SCIP_NODE node,
unsigned int  id,
SCIP_VAR **  vars,
SCIP_Real vals,
int  nvars,
int  negbndchg 
)
static

fix all bounds corresponding to dual bound changes in a previous iteration in the fashion of interdiction branching; keep the first negbndchg-1 bound changes as stored in dualconscur and negate the negbndchg-th bound.

Parameters
reoptreoptimization data structure
setglobal SCIP settings
statdynamic problem statistics
transprobtransformed problem
origproboriginal problem
treesearch tree
lpcurrent LP
branchcandbranching candidates
eventqueueevent queue
cliquetableclique table
blkmemblock memory
nodechild node
idid of the node
varsvariables in permuted order
valsbounds in permuted order
nvarsnumber of variables
negbndchgindex of the variable that should negated

Definition at line 3112 of file reopt.c.

References SCIP_ReoptNode::dualfixing, FALSE, MIN, NULL, SCIP_ReoptTree::reoptnodes, SCIP_Reopt::reopttree, SCIP_BOUNDTYPE_LOWER, SCIP_BOUNDTYPE_UPPER, SCIP_CALL, SCIP_INVALIDDATA, SCIP_OKAY, SCIP_Real, SCIPdebugMessage, SCIPerrorMessage, SCIPnodeAddBoundchg(), SCIPsetIsFeasEQ(), SCIPsetIsFeasGE(), SCIPsetIsFeasLE(), SCIPsetIsGT(), SCIPsetIsLT(), SCIPvarAdjustLb(), SCIPvarAdjustUb(), SCIPvarGetLbLocal(), SCIPvarGetName(), SCIPvarGetProbvarBound(), SCIPvarGetUbLocal(), and SCIPvarIsTransformedOrigvar().

Referenced by SCIPreoptApply().

static SCIP_RETCODE addLocalConss ( SCIP scip,
SCIP_REOPT reopt,
SCIP_SET set,
SCIP_STAT stat,
BMS_BLKMEM blkmem,
SCIP_NODE node,
unsigned int  id 
)
static
static void resetStats ( SCIP_REOPT reopt)
static

reset the internal statistics at the beginning of a new iteration

Parameters
reoptreoptimization data structure

Definition at line 3304 of file reopt.c.

References SCIP_Reopt::currentnode, SCIP_Reopt::lastbranched, SCIP_Reopt::lastseennode, SCIP_ReoptTree::ncutoffreoptnodes, SCIP_ReoptTree::nfeasnodes, SCIP_ReoptTree::ninfnodes, SCIP_ReoptTree::nprunednodes, NULL, and SCIP_Reopt::reopttree.

Referenced by SCIPreoptAddRun().

static SCIP_RETCODE dryBranch ( SCIP_REOPT reopt,
SCIP_SET set,
BMS_BLKMEM blkmem,
SCIP_Bool runagain,
unsigned int  id 
)
static

check the stored bound changes of all child nodes for redundancy and infeasibility

Due to strongbranching initialization at node stored at id it can happen, that some bound changes stored in the child nodes of the reoptimization node stored at id become redundant or make the subproblem infeasible. in this method we remove all redundant bound changes and delete infeasible child nodes.

Parameters
reoptreoptimization data structure
setglobal SCIP settings
blkmemblock memory
runagainpointer to store of this method should run again
idid of stored node

Definition at line 3328 of file reopt.c.

References SCIP_ReoptNode::childids, deleteChildrenBelow(), FALSE, SCIP_ReoptNode::nchilds, SCIP_ReoptNode::nconss, NULL, SCIP_ReoptNode::nvars, reoptnodeCheckMemory(), SCIP_ReoptTree::reoptnodes, SCIP_Reopt::reopttree, reopttreeDeleteNode(), SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPdebugMessage, SCIPsetAllocBufferArray, SCIPsetFreeBufferArray, SCIPsetIsFeasEQ(), SCIPvarGetLbLocal(), SCIPvarGetName(), SCIPvarGetProbvarBound(), SCIPvarGetUbLocal(), TRUE, SCIP_ReoptNode::varbounds, SCIP_ReoptNode::varboundtypes, and SCIP_ReoptNode::vars.

Referenced by SCIPreoptGetChildIDs().

static int reopttreeGetNNodes ( SCIP_REOPTTREE reopttree,
unsigned int  id 
)
static

return the number of all nodes in the subtree induced by the reoptimization node stored at id

Parameters
reopttreereopttree
idid of stored node

Definition at line 3546 of file reopt.c.

References SCIP_ReoptNode::childids, SCIP_ReoptNode::nchilds, NULL, and SCIP_ReoptTree::reoptnodes.

Referenced by SCIPreoptGetNNodes().

static int reoptGetNLeaves ( SCIP_REOPT reopt,
unsigned int  id 
)
static

returns the number of leaf nodes of the induced subtree

Parameters
reoptreoptimization data structure
idid of stored node

Definition at line 3565 of file reopt.c.

References SCIP_ReoptNode::childids, SCIP_ReoptNode::nchilds, NULL, SCIP_ReoptTree::reoptnodes, and SCIP_Reopt::reopttree.

Referenced by SCIPreoptGetNLeaves().

static SCIP_RETCODE reoptGetLeaves ( SCIP_REOPT reopt,
unsigned int  id,
unsigned int *  leaves,
int  leavessize,
int *  nleaves 
)
static

returns all leaves of the subtree induced by the node stored at id

Parameters
reoptreoptimization data structure
idid of stored node
leavesarray of leave nodes
leavessizesize of leaves array
nleavespointer to store the number of leave nodes

Definition at line 3596 of file reopt.c.

References SCIP_ReoptNode::childids, SCIP_ReoptNode::nchilds, NULL, SCIP_ReoptTree::reoptnodes, SCIP_Reopt::reopttree, SCIP_CALL, and SCIP_OKAY.

Referenced by SCIPreoptGetLeaves().

static SCIP_RETCODE reoptResetTree ( SCIP_REOPT reopt,
SCIP_SET set,
BMS_BLKMEM blkmem,
SCIP_Bool  softreset 
)
static

after restarting the reoptimization and an after compressing the search tree we have to delete all stored information

Parameters
reoptreoptimization data structure
setglobal SCIP settings
blkmemblock memory
softresetmark the nodes to overwriteable (TRUE) or delete them completely (FALSE)

Definition at line 3643 of file reopt.c.

References clearReoptnodes(), SCIP_Reopt::currentnode, SCIP_Reopt::dualcons, SCIP_ReoptTree::nreoptnodes, NULL, LogicOrData::nvars, SCIP_Reopt::reopttree, SCIP_CALL, and SCIP_OKAY.

Referenced by reoptRestart(), and SCIPreoptApplyCompression().

static SCIP_RETCODE reoptRestart ( SCIP_REOPT reopt,
SCIP_SET set,
BMS_BLKMEM blkmem 
)
static

restart the reoptimization by removing all stored information about nodes and increase the number of restarts

Parameters
reoptreoptimization data structure
setglobal SCIP settings
blkmemblock memory

Definition at line 3669 of file reopt.c.

References createReoptnode(), FALSE, SCIP_Reopt::firstrestart, SCIP_Reopt::lastrestart, SCIP_Reopt::nglbrestarts, SCIP_ReoptTree::nreoptnodes, NULL, reoptResetTree(), SCIP_Reopt::reopttree, SCIP_Reopt::run, SCIP_CALL, and SCIP_OKAY.

Referenced by SCIPreoptCheckRestart().

static SCIP_RETCODE reoptSaveNewObj ( SCIP_REOPT reopt,
SCIP_SET set,
BMS_BLKMEM blkmem,
SCIP_VAR **  transvars,
int  ntransvars 
)
static

save the new objective function

Parameters
reoptreoptimization data
setglobal SCIP settings
blkmemblock memory
transvarstransformed problem variables
ntransvarsnumber of transformed problem variables

Definition at line 3699 of file reopt.c.

References BMSallocMemoryArray, ensureRunSize(), SCIP_Reopt::firstobj, NULL, SCIP_Reopt::objs, reoptSimilarity(), SCIP_Reopt::run, SCIP_ALLOC, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIP_VERBLEVEL_MINIMAL, SCIPdebugMessage, SCIPsetIsFeasLT(), SCIPvarGetLbGlobal(), SCIPvarGetObj(), SCIPvarGetProbindex(), SCIPvarGetUbGlobal(), SCIPvarIsActive(), SCIPvarIsOriginal(), SCIPverbMessage(), SCIP_Reopt::simtofirstobj, and SCIP_Reopt::simtolastobj.

Referenced by SCIPreoptAddRun().

static void permuteRandom ( SCIP_VAR **  vars,
SCIP_Real vals,
int  nvars,
unsigned int *  randseed 
)
static

permute the variable and bound array randomly

Parameters
varsvariable array to permute
valsbound array to permute in the same order
nvarsnumber of variables
randseedseed value for the random generator

Definition at line 3773 of file reopt.c.

References SCIP_Real, and SCIPgetRandomInt().

Referenced by SCIPreoptApply(), and SCIPreoptSplitRoot().

int SCIPreoptGetNRestartsGlobal ( SCIP_REOPT reopt)

returns the number of global restarts

Parameters
reoptreoptimization data structure

Definition at line 3836 of file reopt.c.

References SCIP_Reopt::nglbrestarts, and NULL.

Referenced by SCIPprintReoptStatistics().

int SCIPreoptGetNRestartsLocal ( SCIP_REOPT reopt)

returns the number of local restarts in the current run

Parameters
reoptreoptimization data structure

Definition at line 3846 of file reopt.c.

References SCIP_Reopt::nlocrestarts, and NULL.

int SCIPreoptGetNTotalRestartsLocal ( SCIP_REOPT reopt)

returns the number of local restarts over all runs

Parameters
reoptreoptimization data structure

Definition at line 3856 of file reopt.c.

References SCIP_Reopt::ntotallocrestarts, and NULL.

Referenced by SCIPprintReoptStatistics().

int SCIPreoptGetFirstRestarts ( SCIP_REOPT reopt)

returns the number of iteration with the first global restarts

Parameters
reoptreoptimization data structure

Definition at line 3866 of file reopt.c.

References SCIP_Reopt::firstrestart, and NULL.

Referenced by SCIPprintReoptStatistics().

int SCIPreoptGetLastRestarts ( SCIP_REOPT reopt)

returns the number of iteration with the last global restarts

Parameters
reoptreoptimization data structure

Definition at line 3876 of file reopt.c.

References SCIP_Reopt::lastrestart, and NULL.

Referenced by SCIPprintReoptStatistics().

int SCIPreoptGetNFeasNodes ( SCIP_REOPT reopt)

returns the number of stored nodes providing an improving feasible LP solution in the current run

Parameters
reoptreoptimization data structure

Definition at line 3886 of file reopt.c.

References SCIP_ReoptTree::nfeasnodes, NULL, and SCIP_Reopt::reopttree.

int SCIPreoptGetNTotalFeasNodes ( SCIP_REOPT reopt)

returns the number of stored nodes providing an improving feasible LP solution over all runs

Parameters
reoptreoptimization data structure

Definition at line 3896 of file reopt.c.

References SCIP_ReoptTree::ntotalfeasnodes, NULL, and SCIP_Reopt::reopttree.

Referenced by SCIPprintReoptStatistics().

int SCIPreoptGetNPrunedNodes ( SCIP_REOPT reopt)

returns the number of stored nodes that exceeded the cutoff bound in the current run

Parameters
reoptreoptimization data structure

Definition at line 3906 of file reopt.c.

References SCIP_ReoptTree::nprunednodes, NULL, and SCIP_Reopt::reopttree.

int SCIPreoptGetNTotalPrunedNodes ( SCIP_REOPT reopt)

returns the number of stored nodes that exceeded the cutoff bound over all runs

Parameters
reoptreoptimization data structure

Definition at line 3916 of file reopt.c.

References SCIP_ReoptTree::ntotalprunednodes, NULL, and SCIP_Reopt::reopttree.

Referenced by SCIPprintReoptStatistics().

int SCIPreoptGetNCutoffReoptnodes ( SCIP_REOPT reopt)

rerturns the number of reoptimized nodes that were cutoff in the same iteration in the current run

Parameters
reoptreoptimization data structure

Definition at line 3926 of file reopt.c.

References SCIP_ReoptTree::ncutoffreoptnodes, NULL, and SCIP_Reopt::reopttree.

int SCIPreoptGetNTotalCutoffReoptnodes ( SCIP_REOPT reopt)

rerturns the number of reoptimized nodes that were cutoff in the same iteration over all runs

Parameters
reoptreoptimization data structure

Definition at line 3936 of file reopt.c.

References SCIP_ReoptTree::ntotalcutoffreoptnodes, NULL, and SCIP_Reopt::reopttree.

Referenced by SCIPprintReoptStatistics().

int SCIPreoptGetNInfNodes ( SCIP_REOPT reopt)

returns the number of stored nodes with an infeasible LP in the current run

Parameters
reoptreoptimization data structure

Definition at line 3946 of file reopt.c.

References SCIP_ReoptTree::ninfnodes, NULL, and SCIP_Reopt::reopttree.

int SCIPreoptGetNTotalInfNodes ( SCIP_REOPT reopt)

returns the number of stored nodes with an infeasible LP over all runs

Parameters
reoptreoptimization data structure

Definition at line 3956 of file reopt.c.

References SCIP_ReoptTree::ntotalinfnodes, NULL, and SCIP_Reopt::reopttree.

Referenced by SCIPprintReoptStatistics().

int SCIPreoptGetNInfSubtrees ( SCIP_REOPT reopt)

returns the number of found infeasible subtrees

Parameters
reoptreoptimization data structure

Definition at line 3966 of file reopt.c.

References SCIP_ReoptTree::ninfsubtrees, NULL, and SCIP_Reopt::reopttree.

Referenced by SCIPprintReoptStatistics().

SCIP_RETCODE SCIPreoptCreate ( SCIP_REOPT **  reopt,
SCIP_SET set,
BMS_BLKMEM blkmem 
)

constructor for the reoptimization data

Parameters
reoptpointer to reoptimization data structure
setglobal SCIP settings
blkmemblock memory

Definition at line 3977 of file reopt.c.

References BMSallocBlockMemoryArray, BMSallocMemory, BMSallocMemoryArray, createReopttree(), createSolTree(), DEFAULT_MEM_RUN, EVENTHDLR_DESC, EVENTHDLR_NAME, NULL, SCIP_ALLOC, SCIP_CALL, SCIP_CLOCKTYPE_DEFAULT, SCIP_OKAY, SCIPclockCreate(), SCIPeventhdlrCreate(), and SCIPsetIncludeEventhdlr().

Referenced by SCIPenableReoptimization().

SCIP_RETCODE SCIPreoptFree ( SCIP_REOPT **  reopt,
SCIP_SET set,
SCIP_PRIMAL origprimal,
BMS_BLKMEM blkmem 
)

frees reoptimization data

Parameters
reoptreoptimization data structure
setglobal SCIP settings
origprimaloriginal primal
blkmemblock memory

Definition at line 4042 of file reopt.c.

References BMSfreeBlockMemory, BMSfreeBlockMemoryArray, BMSfreeMemory, BMSfreeMemoryArray, freeReoptTree(), freeSolTree(), NULL, SCIP_CALL, SCIP_OKAY, SCIP_STAGE_INIT, SCIP_STAGE_PROBLEM, and SCIPclockFree().

Referenced by SCIPenableReoptimization(), and SCIPfreeProb().

int SCIPreoptGetNAddedConss ( SCIP_REOPT reopt,
SCIP_NODE node 
)

returns the number of constraints added by the reoptimization plug-in

Parameters
reoptreoptimization data structure
nodenode of the search tree

Definition at line 4131 of file reopt.c.

References MAX, SCIP_ReoptNode::nconss, NULL, SCIP_ReoptTree::reoptnodes, SCIP_Reopt::reopttree, SCIPnodeGetDepth(), SCIPnodeGetNAddedConss(), and SCIPnodeGetReoptID().

Referenced by SCIPreoptCheckCutoff().

SCIP_RETCODE SCIPreoptAddSol ( SCIP_REOPT reopt,
SCIP_SET set,
SCIP_STAT stat,
SCIP_PRIMAL origprimal,
BMS_BLKMEM blkmem,
SCIP_SOL sol,
SCIP_Bool  bestsol,
SCIP_Bool added,
SCIP_VAR **  vars,
int  nvars,
int  run 
)

add a solution to the solution tree

Parameters
reoptreoptimization data
setglobal SCIP settings
statdynamic problem statistics
origprimaloriginal primal
blkmemblock memory
solsolution to add
bestsolis the current solution an optimal solution?
addedpointer to store the information if the soltion was added
varsvariable array
nvarsnumber of variables
runnumber of the current run (1,2,...)

Definition at line 4155 of file reopt.c.

References ensureSolsSize(), SCIP_Reopt::noptsolsbyreoptsol, SCIP_SolTree::nsols, NULL, SCIP_CALL, SCIP_OKAY, SCIPheurGetName(), SCIPsolGetHeur(), SCIP_SolTree::sols, SCIP_Reopt::soltree, and soltreeAddSol().

Referenced by SCIPsolve().

SCIP_RETCODE SCIPreoptAddOptSol ( SCIP_REOPT reopt,
SCIP_SOL sol,
BMS_BLKMEM blkmem,
SCIP_SET set,
SCIP_STAT stat,
SCIP_PRIMAL origprimal 
)

we want to store the optimal solution of each run in a separate array

Parameters
reoptreoptimization data structure
solsolution to add
blkmemblock memory
setglobal SCIP settings
statdynamic problem statistics
origprimaloriginal primal

Definition at line 4208 of file reopt.c.

References NULL, SCIP_Reopt::prevbestsols, SCIP_Reopt::run, SCIP_CALL, SCIP_OKAY, and SCIPsolCopy().

Referenced by SCIPsolve().

SCIP_RETCODE SCIPreoptAddRun ( SCIP_REOPT reopt,
SCIP_SET set,
BMS_BLKMEM blkmem,
SCIP_VAR **  transvars,
int  ntransvars,
int  size 
)

add a new iteration after changing the objective function

Parameters
reoptreoptimization data sturcture
setglobal SCIP settings
blkmemblock memory
transvarstransformed variables
ntransvarsnumber of transformed variables
sizenumber of expected solutions

Definition at line 4234 of file reopt.c.

References BMSallocBlockMemoryArray, ensureRunSize(), NULL, reoptSaveNewObj(), resetStats(), SCIP_Reopt::run, SCIP_ALLOC, SCIP_CALL, SCIP_OKAY, SCIP_SolTree::sols, SCIP_SolTree::solssize, and SCIP_Reopt::soltree.

Referenced by SCIPsolve().

int SCIPreoptGetNCheckedSols ( SCIP_REOPT reopt)

get the number of checked during the reoptimization process

Parameters
reoptreoptimization data structure

Definition at line 4266 of file reopt.c.

References SCIP_Reopt::ncheckedsols, and NULL.

Referenced by SCIPprintReoptStatistics().

void SCIPreoptSetNCheckedSols ( SCIP_REOPT reopt,
int  ncheckedsols 
)

update the number of checked during the reoptimization process

Parameters
reoptreoptimization data structure
ncheckedsolsnumber of updated solutions

Definition at line 4276 of file reopt.c.

References SCIP_Reopt::ncheckedsols, and NULL.

int SCIPreoptGetNImprovingSols ( SCIP_REOPT reopt)

get the number of checked during the reoptimization process

Parameters
reoptreoptimization data structure

Definition at line 4287 of file reopt.c.

References SCIP_Reopt::nimprovingsols, and NULL.

Referenced by SCIPprintReoptStatistics().

void SCIPreoptSetNImprovingSols ( SCIP_REOPT reopt,
int  nimprovingsols 
)

update the number of checked during the reoptimization process

Parameters
reoptreoptimization data structure
nimprovingsolsnumber of improving solutions

Definition at line 4297 of file reopt.c.

References SCIP_Reopt::nimprovingsols, and NULL.

int SCIPreoptGetNSolsRun ( SCIP_REOPT reopt,
int  run 
)

returns number of solution of a given run

Parameters
reoptreoptimization data structure
runnumber of the run (1,2,..)

Definition at line 4308 of file reopt.c.

References SCIP_SolTree::nsols, NULL, SCIP_SolTree::sols, and SCIP_Reopt::soltree.

int SCIPreoptGetNSols ( SCIP_REOPT reopt)

returns number of all solutions of all runs

Parameters
reoptreoptimization data structure

Definition at line 4323 of file reopt.c.

References SCIP_SolTree::nsols, NULL, SCIP_Reopt::run, and SCIP_Reopt::soltree.

SCIP_RETCODE SCIPreoptGetSolsRun ( SCIP_REOPT reopt,
int  run,
SCIP_SOL **  sols,
int  solssize,
int *  nsols 
)

return the stored solutions of a given run

Parameters
reoptreoptimization data structure
runnumber of the run (1,2,...)
solsarray of solutions to fill
solssizelength of the array
nsolspointer to store the number of added solutions

Definition at line 4339 of file reopt.c.

References SCIP_SolTree::nsols, NULL, SCIP_OKAY, SCIP_SolNode::sol, SCIP_SolTree::sols, SCIP_Reopt::soltree, TRUE, and SCIP_SolNode::updated.

Referenced by SCIPgetReopSolsRun().

int SCIPreoptGetNSavedSols ( SCIP_REOPT reopt)

returns the number of saved solutions overall runs

Parameters
reoptreoptimization data structure

Definition at line 4381 of file reopt.c.

References SCIP_SolNode::lchild, NULL, SCIP_SolNode::rchild, SCIP_SolTree::root, SCIP_Reopt::soltree, and soltreeNInducedSols().

SCIP_RETCODE SCIPreoptCheckRestart ( SCIP_REOPT reopt,
SCIP_SET set,
BMS_BLKMEM blkmem,
SCIP_NODE node,
SCIP_VAR **  transvars,
int  ntransvars,
SCIP_Bool restart 
)

check if the reoptimization process should be (locally) restarted.

First, we check whether the current node is the root node, e.g., node == NULL. in this case, we do not need to calculate the similarity again. we trigger a restart if

  1. the objective function has changed too much
  2. the number of stored nodes is exceeded
  3. the last n optimal solutions were found by heur_reoptsols (in this case, the stored tree was only needed to prove the optimality and this can be probably faster by solving from scratch)

If the current node is different to the root node we calculate the local similarity, i.e., exclude all variable that are already fixed by bounding.

Parameters
reoptreoptimization data structure
setglobal SCIP settings
blkmemblock memory
nodecurrent node of the branch and bound tree (or NULL)
transvarstransformed problem variables
ntransvarsnumber of transformed problem variables
restartpointer to store if the reoptimization process should be restarted

Definition at line 4408 of file reopt.c.

References FALSE, SCIP_Reopt::noptsolsbyreoptsol, SCIP_ReoptTree::nreoptnodes, NULL, reoptCheckLocalRestart(), reoptRestart(), SCIP_Reopt::reopttree, SCIP_Reopt::run, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPdebugMessage, SCIPsetIsFeasLT(), SCIP_Reopt::simtolastobj, and TRUE.

Referenced by SCIPcheckReoptRestart(), and SCIPsolve().

SCIP_Real SCIPreoptGetSimToPrevious ( SCIP_REOPT reopt)

returns the similarity to the previous objective function, if no exist return -2.0

Parameters
reoptreoptimization data structure

Definition at line 4471 of file reopt.c.

References NULL, and SCIP_Reopt::simtolastobj.

Referenced by SCIPgetReoptSimilarity().

SCIP_Real SCIPreoptGetSimToFirst ( SCIP_REOPT reopt)

returns the similarity to the first objective different to the zero-function function, if no exist return -2.0

Parameters
reoptreoptimization data structure

Definition at line 4480 of file reopt.c.

References NULL, and SCIP_Reopt::simtofirstobj.

SCIP_Real SCIPreoptGetSimilarity ( SCIP_REOPT reopt,
SCIP_SET set,
int  run1,
int  run2,
SCIP_VAR **  transvars,
int  ntransvars 
)

return the similarity between two of objective functions of two given runs

Parameters
reoptreoptimization data structure
setglobal SCIP settings
run1number of the first run
run2number of the second run
transvarsoriginal problem variables
ntransvarsnumber of original problem variables

Definition at line 4489 of file reopt.c.

References NULL, and reoptSimilarity().

Referenced by SCIPgetReoptSimilarity().

SCIP_SOL* SCIPreoptGetLastBestSol ( SCIP_REOPT reopt)

returns the best solution of the last run

Parameters
reoptreoptimization data structure

Definition at line 4508 of file reopt.c.

References NULL, SCIP_Reopt::prevbestsols, and SCIP_Reopt::run.

Referenced by SCIPgetReoptLastOptSol().

SCIP_REOPTNODE* SCIPreoptGetReoptnode ( SCIP_REOPT reopt,
unsigned int  id 
)

returns the node of the reoptimization tree corresponding to the unique id

Parameters
reoptreoptimization data structure
idunique id

Definition at line 4524 of file reopt.c.

References NULL, SCIP_ReoptTree::reoptnodes, and SCIP_Reopt::reopttree.

Referenced by SCIPgetReoptnode().

SCIP_Real SCIPreoptGetOldObjCoef ( SCIP_REOPT reopt,
int  run,
int  idx 
)

returns the coefficient of variable with index idx in run run

Parameters
reoptreoptimization data structure
runnumber of the run (1,2,...)
idxindex of variable

Definition at line 4538 of file reopt.c.

References NULL, and SCIP_Reopt::objs.

Referenced by reoptCheckLocalRestart(), and SCIPgetReoptOldObjCoef().

SCIP_SOL* SCIPreoptGetBestSolRun ( SCIP_REOPT reopt,
int  run 
)

return the best solution of a given run.

Note
the return solution is part of the original space.
Parameters
reoptreoptimization data structure
runnumber of the run (1,2,...)

Definition at line 4554 of file reopt.c.

References NULL, and SCIP_Reopt::prevbestsols.

void SCIPreoptResetSolMarks ( SCIP_REOPT reopt)

reset marks of stored solutions to not updated

Parameters
reoptreoptimization data structure

Definition at line 4566 of file reopt.c.

References SCIP_SolNode::lchild, NULL, SCIP_SolNode::rchild, SCIP_SolTree::root, SCIP_Reopt::soltree, and soltreeResetMarks().

Referenced by SCIPresetReoptSolMarks().

int SCIPreoptGetNNodes ( SCIP_REOPT reopt,
SCIP_NODE node 
)

returns the number of stored nodes in the subtree induced by node

Parameters
reoptreoptimization data structure
nodenode of the search tree

Definition at line 4581 of file reopt.c.

References SCIP_ReoptTree::nreoptnodes, NULL, SCIP_Reopt::reopttree, reopttreeGetNNodes(), SCIPnodeGetDepth(), and SCIPnodeGetReoptID().

Referenced by compressReoptTree(), and SCIPgetNReoptnodes().

int SCIPreoptnodeGetNVars ( SCIP_REOPTNODE reoptnode)

In debug mode, the following methods are implemented as function calls to ensure type validity. In optimized mode, the methods are implemented as defines to improve performance. However, we want to have them in the library anyways, so we have to undef the defines.returns the number of bound changes stored in the reopttree at ID id

Parameters
reoptnodenode of the roepttree

Definition at line 4621 of file reopt.c.

References SCIP_ReoptNode::nafterdualvars, NULL, and SCIP_ReoptNode::nvars.

Referenced by constructCompression().

int SCIPreoptnodeGetNConss ( SCIP_REOPTNODE reoptnode)

returns the number of bound changes at the node stored at ID id

Parameters
reoptnodenode of the reoptimization tree

Definition at line 4631 of file reopt.c.

References SCIP_ReoptNode::nconss, and NULL.

Referenced by constructCompression().

int SCIPreoptnodeGetNDualBoundChgs ( SCIP_REOPTNODE reoptnode)

returns the number of stored bound changes based on dual information in the reopttree at ID id

Parameters
reoptnodenode of the reoptimization tree

Definition at line 4641 of file reopt.c.

References SCIP_ReoptNode::dualconscur, NULL, and LogicOrData::nvars.

int SCIPreoptnodeGetNChildren ( SCIP_REOPTNODE reoptnode)

returns the number of child nodes of reoptnode

Parameters
reoptnodenode of the reoptimizzation tree

Definition at line 4654 of file reopt.c.

References SCIP_ReoptNode::nchilds, and NULL.

Referenced by Exec(), and SCIPreoptimizeNode().

SCIP_Real SCIPreoptnodeGetLowerbound ( SCIP_REOPTNODE reoptnode)

return the lower bound stored at ID id

Parameters
reoptnodenode of the reoptimization tree

Definition at line 4664 of file reopt.c.

References SCIP_ReoptNode::lowerbound, and NULL.

Referenced by constructCompression(), and sortIDs().

SCIP_REOPTTYPE SCIPreoptnodeGetType ( SCIP_REOPTNODE reoptnode)

returns the type of the reoptnode

Parameters
reoptnodenode of the reoptimization tree

Definition at line 4674 of file reopt.c.

References NULL, and SCIP_ReoptNode::reopttype.

Referenced by Exec().

void SCIPreoptnodeGetSplitCons ( SCIP_REOPTNODE reoptnode,
SCIP_VAR **  vars,
SCIP_Real vals,
REOPT_CONSTYPE constype,
int  conssize,
int *  nvars 
)

create the constraint which splits the node stored at ID id on the basis of the stored dual information.

Parameters
reoptnodenode of the reoptimization tree
varsarray to store the variables of the constraint
valsarray to store the coefficients of the variables
constypetype of the constraint
conssizesize of the arrays
nvarspointer to store the size of the constraints

Definition at line 4686 of file reopt.c.

References LogicOrData::constype, SCIP_ReoptNode::dualconscur, NULL, LogicOrData::nvars, LogicOrData::vals, and LogicOrData::vars.

void SCIPreoptnodeGetConss ( SCIP_REOPTNODE reoptnode,
SCIP_VAR ***  vars,
SCIP_Real **  vals,
int  mem,
int *  nconss,
int *  nvars 
)

returns all added constraints at ID id

Parameters
reoptnodenode of the reoptimization tree
vars2-dim array of variables
vals2-dim array of values
memallocated memory for constraints
nconsspointer to store the number of constraints
nvarspointer to store the number of variables

Definition at line 4718 of file reopt.c.

References SCIP_ReoptNode::conss, SCIP_ReoptNode::nconss, NULL, LogicOrData::nvars, LogicOrData::vals, and LogicOrData::vars.

Referenced by constructCompression().

void SCIPreoptnodeSetParentID ( SCIP_REOPTNODE reoptnode,
unsigned int  parentid 
)

set the parent id

Parameters
reoptnodenode of the reopttree
parentidid of the parent node

Definition at line 4754 of file reopt.c.

References NULL, and SCIP_ReoptNode::parentID.

Referenced by applyCompression().

int SCIPreoptGetNLeaves ( SCIP_REOPT reopt,
SCIP_NODE node 
)

returns the number of leaf nodes of the subtree induced by node (of the whole tree if node == NULL)

Parameters
reoptreoptimization data structure
nodenode of the search tree (or NULL)

Definition at line 4766 of file reopt.c.

References SCIP_ReoptNode::childids, SCIP_ReoptNode::nchilds, NULL, reoptGetNLeaves(), SCIP_ReoptTree::reoptnodes, SCIP_Reopt::reopttree, SCIPnodeGetDepth(), and SCIPnodeGetReoptID().

Referenced by SCIPcomprExec(), and SCIPgetNReoptLeaves().

SCIP_RETCODE SCIPreoptAddInfNode ( SCIP_REOPT reopt,
SCIP_SET set,
BMS_BLKMEM blkmem,
SCIP_NODE node 
)

save information that given node is infeasible

Parameters
reoptreoptimization data structure
setglobal SCIP settings
blkmemblock memory
nodenode of the search tree

Definition at line 4801 of file reopt.c.

References SCIP_ReoptTree::ninfnodes, SCIP_ReoptTree::ntotalinfnodes, NULL, REOPT_CONSTYPE_INFSUBTREE, SCIP_Reopt::reopttree, saveGlobalCons(), SCIP_CALL, and SCIP_OKAY.

Referenced by SCIPreoptCheckCutoff().

SCIP_RETCODE SCIPreoptCheckCutoff ( SCIP_REOPT reopt,
SCIP_SET set,
BMS_BLKMEM blkmem,
SCIP_NODE node,
SCIP_EVENTTYPE  eventtype,
SCIP_LPSOLSTAT  lpsolstat,
SCIP_Bool  isrootnode,
SCIP_Bool  isfocusnode,
SCIP_Real  lowerbound,
int  effectiverootdepth 
)
SCIP_RETCODE SCIPreoptAddDualBndchg ( SCIP_REOPT reopt,
SCIP_SET set,
BMS_BLKMEM blkmem,
SCIP_NODE node,
SCIP_VAR var,
SCIP_Real  newval,
SCIP_Real  oldval 
)

store bound change based on dual information

Parameters
reoptreoptimization data structure
setglobal SCIP settings
blkmemblock memory
nodenode of the search tree
varvariables
newvalnew bound
oldvalold bound

Definition at line 5073 of file reopt.c.

References checkMemDualCons(), SCIP_Reopt::currentnode, DEFAULT_MEM_DUALCONS, SCIP_Reopt::dualcons, NULL, LogicOrData::nvars, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPdebugMessage, SCIPnodeGetNumber(), SCIPsetIsFeasEQ(), SCIPvarGetName(), SCIPvarGetOrigvarSum(), SCIPvarIsOriginal(), LogicOrData::vals, LogicOrData::vars, and LogicOrData::varssize.

Referenced by SCIPaddReoptDualBndchg(), and SCIPreoptCheckCutoff().

int SCIPreoptGetNDualBndchgs ( SCIP_REOPT reopt,
SCIP_NODE node 
)

returns the number of bound changes based on dual information

Parameters
reoptreoptimization data structure
nodenode of the search tree

Definition at line 5138 of file reopt.c.

References SCIP_Reopt::currentnode, SCIP_Reopt::dualcons, NULL, LogicOrData::nvars, and SCIPnodeGetNumber().

Referenced by SCIPreoptCheckCutoff().

SCIP_RETCODE SCIPreoptGetChildIDs ( SCIP_REOPT reopt,
SCIP_SET set,
BMS_BLKMEM blkmem,
SCIP_NODE node,
unsigned int *  childs,
int  childssize,
int *  nchilds 
)

returns the child nodes of node that need to be reoptimized next or NULL if node is a leaf

Parameters
reoptreoptimization data structure
setglobal SCIP settings
blkmemblock memory
nodenode of the search tree
childsarray to store the child ids
childssizesize of the childs array
nchildspointer to store the number of child nodes

Definition at line 5158 of file reopt.c.

References SCIP_ReoptNode::childids, dryBranch(), SCIP_ReoptNode::nchilds, NULL, SCIP_ReoptTree::reoptnodes, SCIP_Reopt::reopttree, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIPnodeGetDepth(), SCIPnodeGetReoptID(), and TRUE.

Referenced by SCIPgetReoptChildIDs().

SCIP_RETCODE SCIPreoptGetLeaves ( SCIP_REOPT reopt,
SCIP_NODE node,
unsigned int *  leaves,
int  leavessize,
int *  nleaves 
)

returns all leaves of the subtree induced by node

Parameters
reoptreoptimization data
nodenode of the search tree
leavesarray to the the ids
leavessizesize of leaves array
nleavespointer to store the number of leav node

Definition at line 5211 of file reopt.c.

References SCIP_ReoptNode::childids, SCIP_ReoptNode::nchilds, NULL, reoptGetLeaves(), SCIP_ReoptTree::reoptnodes, SCIP_Reopt::reopttree, SCIP_CALL, SCIP_OKAY, and SCIPnodeGetReoptID().

Referenced by SCIPgetReoptLeaveIDs().

SCIP_RETCODE SCIPreoptSaveOpenNodes ( SCIP_REOPT reopt,
SCIP_SET set,
BMS_BLKMEM blkmem,
SCIP_NODE **  leaves,
int  nleaves,
SCIP_NODE **  childs,
int  nchilds,
SCIP_NODE **  siblings,
int  nsiblings 
)

add all unprocessed nodes to the reoptimization tree

Parameters
reoptreoptimization data structure
setglobal SCIP settings
blkmemblock memory
leavesarray of open leave nodes
nleavesnumber of open leave nodes
childsarray of open children nodes
nchildsnumber of open leave nodes
siblingsarray of open sibling nodes
nsiblingsnumber of open leave nodes

Definition at line 5271 of file reopt.c.

References addNode(), FALSE, NULL, SCIP_CALL, SCIP_OKAY, SCIP_REOPTTYPE_PRUNED, SCIPdebugMessage, and SCIPnodeGetLowerbound().

Referenced by SCIPsolve().

SCIP_RETCODE SCIPreoptApplyCompression ( SCIP_REOPT reopt,
SCIP_SET set,
BMS_BLKMEM blkmem,
SCIP_REOPTNODE **  representatives,
int  nrepresentatives,
SCIP_Bool success 
)
SCIP_RETCODE SCIPreoptSplitRoot ( SCIP_REOPT reopt,
SCIP_TREE tree,
SCIP_SET set,
BMS_BLKMEM blkmem,
unsigned int  randseed,
int *  ncreatedchilds,
int *  naddedconss 
)
SCIP_RETCODE SCIPreoptResetDualBndchgs ( SCIP_REOPT reopt,
SCIP_NODE node,
BMS_BLKMEM blkmem 
)

reset the stored information abound bound changes based on dual information

Parameters
reoptreoptimization data structure
nodenode of the search tree
blkmemblock memory

Definition at line 5639 of file reopt.c.

References NULL, reoptnodeResetDualConss(), SCIP_ReoptTree::reoptnodes, SCIP_Reopt::reopttree, SCIP_CALL, SCIP_OKAY, SCIPnodeGetDepth(), and SCIPnodeGetReoptID().

Referenced by addNode(), SCIPreoptCheckCutoff(), and SCIPresetReoptnodeDualcons().

void SCIPreoptnodeGetPath ( SCIP_REOPT reopt,
SCIP_REOPTNODE reoptnode,
SCIP_VAR **  vars,
SCIP_Real vals,
SCIP_BOUNDTYPE boundtypes,
int  varssize,
int *  nbndchgs,
int *  nbndchgsafterdual 
)

return the branching path stored of the given node in the reoptimization tree

Parameters
reoptreoptimization data structure
reoptnodenode of the reoptimization tree
varsarray for variables
valsarray for values
boundtypesarray for bound types
varssizesize of arrays vars, vals, and boundtypes
nbndchgspointer to store the number of bound changes
nbndchgsafterdualpointer to store the number of bound changes applied after the first dual reduction at the given node

Definition at line 5664 of file reopt.c.

References SCIP_ReoptNode::afterdualvarbounds, SCIP_ReoptNode::afterdualvarboundtypes, SCIP_ReoptNode::afterdualvars, SCIP_ReoptNode::nafterdualvars, NULL, SCIP_ReoptNode::nvars, SCIP_ReoptNode::parentID, SCIP_ReoptTree::reoptnodes, SCIP_Reopt::reopttree, SCIPreoptnodeGetPath(), SCIP_ReoptNode::varbounds, SCIP_ReoptNode::varboundtypes, and SCIP_ReoptNode::vars.

Referenced by SCIPgetReoptnodePath(), and SCIPreoptnodeGetPath().

SCIP_RETCODE SCIPreoptDeleteNode ( SCIP_REOPT reopt,
SCIP_SET set,
unsigned int  id,
BMS_BLKMEM blkmem 
)

delete a node stored in the reoptimization tree

Parameters
reoptreoptimization data structure
setglobal SCIP settings
idid of a stored node
blkmemblock memory

Definition at line 5719 of file reopt.c.

References NULL, SCIP_ReoptTree::reoptnodes, SCIP_Reopt::reopttree, reopttreeDeleteNode(), SCIP_CALL, SCIP_OKAY, and TRUE.

SCIP_RETCODE SCIPreoptApply ( SCIP_REOPT reopt,
SCIP scip,
SCIP_SET set,
SCIP_STAT stat,
SCIP_PROB transprob,
SCIP_PROB origprob,
SCIP_TREE tree,
SCIP_LP lp,
SCIP_BRANCHCAND branchcand,
SCIP_EVENTQUEUE eventqueue,
SCIP_CLIQUETABLE cliquetable,
BMS_BLKMEM blkmem,
unsigned int  randseed,
SCIP_REOPTNODE reoptnode,
unsigned int  id,
SCIP_Real  estimate,
SCIP_NODE **  childnodes,
int *  ncreatedchilds,
int *  naddedconss,
int  childnodessize,
SCIP_Bool success 
)

reactivate the given reoptnode and split them into several nodes if necessary

Parameters
reoptreoptimization data structure
scipSCIP data structure
setglobal SCIP settings
statdynamic problem statistics
transprobtransformed problem
origproboriginal problem
treebranching tree
lpcurrent LP
branchcandbranching candidate
eventqueueevent queue
cliquetableclique table
blkmemblock memory
randseedseed value for random generator
reoptnodenode of the reoptimization tree to reactivate
idid of the node to reactivate
estimateestimate of the child nodes that should be created
childnodesarray to store the created child nodes
ncreatedchildspointer to store number of created child nodes
naddedconsspointer to store number of generated constraints
childnodessizeavailable size of childnodes array
successpointer store the result

Definition at line 5738 of file reopt.c.

References addLocalConss(), addSplitcons(), changeAncestorBranchings(), LogicOrData::constype, SCIP_ReoptNode::dualconscur, SCIP_ReoptNode::dualfixing, FALSE, fixBounds(), fixInterdiction(), SCIP_ReoptNode::lowerbound, SCIP_ReoptNode::nafterdualvars, SCIP_ReoptNode::nconss, NULL, LogicOrData::nvars, permuteRandom(), REALABS, REOPT_CONSTYPE_INFSUBTREE, REOPT_CONSTYPE_STRBRANCHED, SCIP_ReoptTree::reoptnodes, reoptnodeUpdateDualConss(), SCIP_Reopt::reopttree, SCIP_ReoptNode::reopttype, SCIP_CALL, SCIP_INVALIDDATA, SCIP_OKAY, SCIP_Real, SCIP_REOPTTYPE_INFSUBTREE, SCIP_REOPTTYPE_LOGICORNODE, SCIP_REOPTTYPE_NONE, SCIP_REOPTTYPE_STRBRANCHED, SCIP_REOPTTYPE_TRANSIT, SCIPdebugMessage, SCIPnodeCreateChild(), SCIPnodeGetLowerbound(), SCIPnodeGetNumber(), SCIPnodeSetEstimate(), SCIPnodeSetReoptID(), SCIPnodeSetReopttype(), SCIPsetIsInfinity(), SCIPsetIsRelGE(), TRUE, LogicOrData::vals, LogicOrData::vars, and LogicOrData::varssize.

Referenced by SCIPapplyReopt().

SCIP_Real SCIPreoptGetSavingtime ( SCIP_REOPT reopt)

returns the time needed to store the nodes for reoptimization

Parameters
reoptreoptimization data structure

Definition at line 6126 of file reopt.c.

References NULL, SCIP_Reopt::savingtime, and SCIPclockGetTime().

Referenced by SCIPprintReoptStatistics().

SCIP_RETCODE SCIPreoptAddGlbCons ( SCIP_REOPT reopt,
SCIP_VAR **  vars,
SCIP_Real vals,
int  nvars,
BMS_BLKMEM blkmem 
)

store a global constraint that should be added at the beginning of the next iteration

Parameters
reoptreoptimization data structure
varsarray to store the variables of the constraint
valsarray to store the coefficients of the variables
nvarspointer to store the size of the constraints
blkmemblock memory

Definition at line 6136 of file reopt.c.

References SCIP_Reopt::allocmemglbconss, BMSallocBlockMemory, BMSduplicateBlockMemoryArray, checkMemGlbCons(), SCIP_Reopt::glbconss, SCIP_Reopt::nglbconss, NULL, LogicOrData::nvars, SCIP_ALLOC, SCIP_CALL, SCIP_OKAY, LogicOrData::vals, LogicOrData::vars, and LogicOrData::varssize.

SCIP_RETCODE SCIPreoptApplyGlbConss ( SCIP scip,
SCIP_REOPT reopt,
SCIP_SET set,
SCIP_STAT stat,
BMS_BLKMEM blkmem 
)

add the stored constraints globally to the problem

Parameters
scipSCIP data structure
reoptreoptimization data structure
setglobal SCIP settings
statdynamic problem statistics
blkmemblock memory

Definition at line 6173 of file reopt.c.

References FALSE, SCIP_Reopt::glbconss, SCIP_Reopt::nglbconss, NULL, LogicOrData::nvars, SCIP_CALL, SCIP_OKAY, SCIPaddCons(), SCIPallocBufferArray, SCIPcreateConsLogicor(), SCIPdebugMessage, SCIPdebugPrintCons, SCIPfreeBlockMemoryArrayNull, SCIPfreeBlockMemoryNull, SCIPfreeBufferArray, SCIPreleaseCons(), SCIPsetIsFeasEQ(), SCIPvarGetTransVar(), SCIPvarNegate(), TRUE, LogicOrData::vals, and LogicOrData::vars.

Referenced by SCIPsolve().

SCIP_Bool SCIPreoptGetSolveLP ( SCIP_REOPT reopt,
SCIP_SET set,
SCIP_NODE node 
)

check if the LP of the given node should be solved or not

Parameters
reoptreoptimization data structure
setglobal SCIP settings
nodenode of the current search tree

Definition at line 6252 of file reopt.c.

References FALSE, SCIP_ReoptNode::nchilds, NULL, SCIP_ReoptNode::nvars, SCIP_ReoptTree::reoptnodes, SCIP_Reopt::reopttree, SCIPnodeGetDepth(), SCIPnodeGetReoptID(), SCIPnodeGetReopttype(), SCIPsetIsGT(), SCIP_Reopt::simtolastobj, and TRUE.

Referenced by solveNode().

SCIP_RETCODE SCIPreoptnodeReset ( SCIP_REOPT reopt,
SCIP_SET set,
BMS_BLKMEM blkmem,
SCIP_REOPTNODE reoptnode 
)

reset the given reoptimization node

Parameters
reoptreoptimization data structure
setglobal SCIP settings
blkmemblock memory
reoptnodereoptimization node

Definition at line 6328 of file reopt.c.

References NULL, reoptnodeReset(), SCIP_CALL, and SCIP_OKAY.

Referenced by SCIPresetRepresentation().

SCIP_RETCODE SCIPreoptnodeDelete ( SCIP_REOPTNODE **  reoptnode,
BMS_BLKMEM blkmem 
)

delete the given reoptimization node

Parameters
reoptnodepointer of reoptnode
blkmemblock memory

Definition at line 6346 of file reopt.c.

References NULL, reoptnodeDelete(), SCIP_CALL, and SCIP_OKAY.

Referenced by SCIPdeleteReoptnode(), and SCIPfreeRepresentation().

SCIP_RETCODE SCIPreoptnodeAddBndchg ( SCIP_REOPTNODE reoptnode,
BMS_BLKMEM blkmem,
SCIP_VAR var,
SCIP_Real  val,
SCIP_BOUNDTYPE  boundtype 
)

add a variable to a given reoptnode

Parameters
reoptnodenode of the reopttree
blkmemblock memory
varvariable to add
valvalue of the variable
boundtypeboundtype of the variable

Definition at line 6360 of file reopt.c.

References NULL, SCIP_ReoptNode::nvars, reoptnodeCheckMemory(), SCIP_CALL, SCIP_OKAY, SCIP_ReoptNode::varbounds, SCIP_ReoptNode::varboundtypes, and SCIP_ReoptNode::vars.

Referenced by SCIPaddReoptnodeBndchg(), SCIPreoptApplyCompression(), and SCIPreoptnodeAddCons().

SCIP_RETCODE SCIPreoptnodeAddCons ( SCIP_REOPTNODE reoptnode,
BMS_BLKMEM blkmem,
SCIP_VAR **  consvars,
SCIP_Real consvals,
int  nvars,
REOPT_CONSTYPE  constype 
)

add a constraint to a given reoptnode

Parameters
reoptnodenode of the reopttree
blkmemblock memory
consvarsvariables which are part of the constraint
consvalsvalues of the variables
nvarsnumber of variables
constypetype of the constraint

Definition at line 6387 of file reopt.c.

References BMSallocBlockMemory, BMSduplicateBlockMemoryArray, SCIP_ReoptNode::conss, LogicOrData::constype, SCIP_ReoptNode::nconss, NULL, LogicOrData::nvars, reoptnodeCheckMemory(), SCIP_ALLOC, SCIP_BOUNDTYPE_LOWER, SCIP_BOUNDTYPE_UPPER, SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, SCIPreoptnodeAddBndchg(), LogicOrData::vals, LogicOrData::vars, and LogicOrData::varssize.

Referenced by SCIPaddReoptnodeCons(), and SCIPreoptApplyCompression().