Scippy

SCIP

Solving Constraint Integer Programs

Detailed Description

dualval primal heuristic

Author
Tobias Buchwald

This heuristic tries to find solutions by taking the LP or NLP, rounding solution values, fixing the variables to the rounded values and then changing some of the values.To determine which variable is changed we give each variable a ranking dependent on its dualvalue. We work with a transformed problem that is always feasible and has objective = 0 iff the original problem is also feasible. Thus we cannot expect to find really good solutions.

Definition in file heur_dualval.c.

#include "blockmemshell/memory.h"
#include "scip/type_expr.h"
#include "scip/cons_indicator.h"
#include "scip/cons_knapsack.h"
#include "scip/cons_linear.h"
#include "scip/cons_logicor.h"
#include "scip/cons_setppc.h"
#include "scip/cons_varbound.h"
#include "scip/heur_dualval.h"
#include "scip/pub_cons.h"
#include "scip/pub_event.h"
#include "scip/pub_heur.h"
#include "scip/pub_message.h"
#include "scip/pub_misc.h"
#include "scip/pub_misc_sort.h"
#include "scip/pub_nlp.h"
#include "scip/pub_sol.h"
#include "scip/pub_var.h"
#include "scip/scip_branch.h"
#include "scip/scip_cons.h"
#include "scip/scip_copy.h"
#include "scip/scip_event.h"
#include "scip/scip_general.h"
#include "scip/scip_heur.h"
#include "scip/scip_lp.h"
#include "scip/scip_mem.h"
#include "scip/scip_message.h"
#include "scip/scip_nlp.h"
#include "scip/scip_nlpi.h"
#include "scip/scip_numerics.h"
#include "scip/scip_param.h"
#include "scip/scip_prob.h"
#include "scip/scip_sol.h"
#include "scip/scip_solve.h"
#include "scip/scip_solvingstats.h"
#include "scip/scip_var.h"
#include <string.h>

Go to the source code of this file.

Macros

#define HEUR_NAME   "dualval"
 
#define HEUR_DESC   "primal heuristic using dual values"
 
#define HEUR_DISPCHAR   SCIP_HEURDISPCHAR_LNS
 
#define HEUR_PRIORITY   -10
 
#define HEUR_FREQ   -1
 
#define HEUR_FREQOFS   0
 
#define HEUR_MAXDEPTH   -1
 
#define HEUR_TIMING   SCIP_HEURTIMING_AFTERNODE
 
#define HEUR_USESSUBSCIP   TRUE
 
#define EVENTHDLR_NAME   "lpsol_dualval"
 
#define EVENTHDLR_DESC   "event handler for lp solution found"
 
#define DEFAULT_FORCEIMPROVEMENTS   FALSE
 
#define DEFAULT_ONLYCHEAPER   TRUE
 
#define DEFAULT_ONLYLEAVES   FALSE
 
#define DEFAULT_RELAXINDICATORS   FALSE
 
#define DEFAULT_RELAXCONTVARS   FALSE
 
#define DEFAULT_HEURVERBLEVEL   0
 
#define DEFAULT_NLPVERBLEVEL   0
 
#define DEFAULT_RANKVALUE   10
 
#define DEFAULT_MAXCALLS   25
 
#define DEFAULT_DYNAMICDEPTH   0
 
#define DEFAULT_MAXEQUALRANKS   50
 
#define DEFAULT_MINGAP   5.0
 
#define DEFAULT_LAMBDASLACK   1.0
 
#define DEFAULT_LAMBDAOBJ   0.0
 
#define BIG_VALUE   1E+10
 

Functions

static SCIP_DECL_EVENTINIT (eventInitLPsol)
 
static SCIP_DECL_EVENTEXIT (eventExitLPsol)
 
static SCIP_DECL_EVENTEXEC (eventExecLPsol)
 
static SCIP_RETCODE SCIPincludeEventHdlrLPsol (SCIP *scip, SCIP_HEURDATA *heurdata)
 
static SCIP_RETCODE releaseHashmapEntries (SCIP *scip, SCIP_HASHMAP *hashmap, SCIP_Bool isvarmap)
 
static SCIP_RETCODE releaseHashmapNLPRows (SCIP *scip, SCIP_HASHMAP *hashmap)
 
static SCIP_RETCODE addLinearConstraints (SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_Bool addcombconss, SCIP_Bool addcontconss, SCIP_HEURDATA *heurdata)
 
static SCIP_RETCODE addVarboundConstraints (SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_Bool addcombconss, SCIP_Bool addcontconss, SCIP_HEURDATA *heurdata)
 
static SCIP_RETCODE addLogicOrConstraints (SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_HEURDATA *heurdata)
 
static SCIP_RETCODE addSetppcConstraints (SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_HEURDATA *heurdata)
 
static SCIP_RETCODE addKnapsackConstraints (SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_HEURDATA *heurdata)
 
static SCIP_RETCODE addLinearConstraintsToNlp (SCIP *scip, SCIP_Bool addcombconss, SCIP_Bool addcontconss, SCIP_HEURDATA *heurdata)
 
static SCIP_RETCODE createSolFromSubScipSol (SCIP *scip, SCIP_HEUR *heur, SCIP_SOL **sol, SCIP_SOL *subsol)
 
static SCIP_RETCODE createSubSCIP (SCIP *scip, SCIP_HEURDATA *heurdata)
 
static SCIP_RETCODE freeSubSCIP (SCIP *scip, SCIP_HEURDATA *heurdata)
 
static SCIP_RETCODE createSolFromNLP (SCIP *scip, SCIP_HEUR *heur, SCIP_SOL **sol)
 
static SCIP_RETCODE fixDiscreteVars (SCIP *scip, SCIP_HEURDATA *heurdata, SCIP_SOL *refpoint, SCIP_SOL **transsol)
 
static SCIP_RETCODE freeMemory (SCIP *scip, SCIP_HEURDATA *heurdata, SCIP_SOL *transsol, SCIP_Real *absranks, SCIP_Real *ranks, SCIP_VAR **sortedvars, SCIP_Bool beforeswitching, SCIP_Bool clearswitchedvars)
 
static SCIP_RETCODE computeRanks (SCIP *scip, SCIP_HEURDATA *heurdata, SCIP_Real *absranks, SCIP_Real *ranks, SCIP_VAR **sortedvars)
 
static SCIP_Real maximalslack (SCIP *scip, SCIP_HEURDATA *heurdata)
 
static SCIP_RETCODE storeSolution (SCIP *scip, SCIP_HEUR *heur, SCIP_RESULT *result, SCIP_SOL *transsol, SCIP_SOL *bestsol)
 
SCIP_RETCODE SCIPapplyHeurDualval (SCIP *scip, SCIP_HEUR *heur, SCIP_RESULT *result, SCIP_SOL *refpoint)
 
static SCIP_DECL_HEURFREE (heurFreeDualval)
 
static SCIP_DECL_HEURINIT (heurInitDualval)
 
static SCIP_DECL_HEUREXIT (heurExitDualval)
 
static SCIP_DECL_HEURINITSOL (heurInitsolDualval)
 
static SCIP_DECL_HEUREXITSOL (heurExitsolDualval)
 
static SCIP_DECL_HEUREXEC (heurExecDualval)
 
SCIP_RETCODE SCIPincludeHeurDualval (SCIP *scip)
 

Macro Definition Documentation

◆ HEUR_NAME

#define HEUR_NAME   "dualval"

Definition at line 76 of file heur_dualval.c.

Referenced by SCIPincludeHeurDualval().

◆ HEUR_DESC

#define HEUR_DESC   "primal heuristic using dual values"

Definition at line 77 of file heur_dualval.c.

Referenced by SCIPincludeHeurDualval().

◆ HEUR_DISPCHAR

#define HEUR_DISPCHAR   SCIP_HEURDISPCHAR_LNS

Definition at line 78 of file heur_dualval.c.

Referenced by SCIPincludeHeurDualval().

◆ HEUR_PRIORITY

#define HEUR_PRIORITY   -10

Definition at line 79 of file heur_dualval.c.

Referenced by SCIPincludeHeurDualval().

◆ HEUR_FREQ

#define HEUR_FREQ   -1

Definition at line 80 of file heur_dualval.c.

Referenced by SCIPincludeHeurDualval().

◆ HEUR_FREQOFS

#define HEUR_FREQOFS   0

Definition at line 81 of file heur_dualval.c.

Referenced by SCIPincludeHeurDualval().

◆ HEUR_MAXDEPTH

#define HEUR_MAXDEPTH   -1

Definition at line 82 of file heur_dualval.c.

Referenced by SCIPincludeHeurDualval().

◆ HEUR_TIMING

◆ HEUR_USESSUBSCIP

#define HEUR_USESSUBSCIP   TRUE

does the heuristic use a secondary SCIP instance?

Definition at line 84 of file heur_dualval.c.

Referenced by SCIPincludeHeurDualval().

◆ EVENTHDLR_NAME

#define EVENTHDLR_NAME   "lpsol_dualval"

Definition at line 86 of file heur_dualval.c.

Referenced by SCIPincludeEventHdlrLPsol().

◆ EVENTHDLR_DESC

#define EVENTHDLR_DESC   "event handler for lp solution found"

Definition at line 87 of file heur_dualval.c.

Referenced by SCIPincludeEventHdlrLPsol().

◆ DEFAULT_FORCEIMPROVEMENTS

#define DEFAULT_FORCEIMPROVEMENTS   FALSE

exit if objective doesn't improve

Definition at line 91 of file heur_dualval.c.

Referenced by SCIPincludeHeurDualval().

◆ DEFAULT_ONLYCHEAPER

#define DEFAULT_ONLYCHEAPER   TRUE

add constraint to ensure that discrete vars are improving

Definition at line 92 of file heur_dualval.c.

Referenced by SCIPincludeHeurDualval().

◆ DEFAULT_ONLYLEAVES

#define DEFAULT_ONLYLEAVES   FALSE

disable the heuristic if it was not called at a leaf of the B&B tree

Definition at line 93 of file heur_dualval.c.

Referenced by SCIPincludeHeurDualval().

◆ DEFAULT_RELAXINDICATORS

#define DEFAULT_RELAXINDICATORS   FALSE

relax the indicator variables by introducing continuous copies

Definition at line 94 of file heur_dualval.c.

Referenced by SCIPincludeHeurDualval().

◆ DEFAULT_RELAXCONTVARS

#define DEFAULT_RELAXCONTVARS   FALSE

enable relaxation of continous variables

Definition at line 95 of file heur_dualval.c.

Referenced by SCIPincludeHeurDualval().

◆ DEFAULT_HEURVERBLEVEL

#define DEFAULT_HEURVERBLEVEL   0

verblevel of the heuristic, default is 0 to display nothing

Definition at line 98 of file heur_dualval.c.

Referenced by SCIPincludeHeurDualval().

◆ DEFAULT_NLPVERBLEVEL

#define DEFAULT_NLPVERBLEVEL   0

verblevel of the nlp solver, can be 0 or 1

Definition at line 99 of file heur_dualval.c.

Referenced by SCIPincludeHeurDualval().

◆ DEFAULT_RANKVALUE

#define DEFAULT_RANKVALUE   10

number of ranks that should be displayed when the heuristic is called

Definition at line 100 of file heur_dualval.c.

Referenced by SCIPincludeHeurDualval().

◆ DEFAULT_MAXCALLS

#define DEFAULT_MAXCALLS   25

maximal number of recursive calls of the heuristic (if dynamicdepth is off)

Definition at line 101 of file heur_dualval.c.

Referenced by SCIPincludeHeurDualval().

◆ DEFAULT_DYNAMICDEPTH

#define DEFAULT_DYNAMICDEPTH   0

says if and how the recursion depth is computed at runtime

Definition at line 102 of file heur_dualval.c.

Referenced by SCIPincludeHeurDualval().

◆ DEFAULT_MAXEQUALRANKS

#define DEFAULT_MAXEQUALRANKS   50

maximal number of variables that may have maximal rank, quit if there are more, turn off by setting -1

Definition at line 103 of file heur_dualval.c.

Referenced by SCIPincludeHeurDualval().

◆ DEFAULT_MINGAP

#define DEFAULT_MINGAP   5.0

minimal gap for which we still run the heuristic, if gap is less we return without doing anything

Definition at line 106 of file heur_dualval.c.

Referenced by SCIPincludeHeurDualval().

◆ DEFAULT_LAMBDASLACK

#define DEFAULT_LAMBDASLACK   1.0

value added to objective of slack variables, must not be zero

Definition at line 107 of file heur_dualval.c.

Referenced by SCIPincludeHeurDualval().

◆ DEFAULT_LAMBDAOBJ

#define DEFAULT_LAMBDAOBJ   0.0

scaling factor for the objective function

Definition at line 108 of file heur_dualval.c.

Referenced by SCIPincludeHeurDualval().

◆ BIG_VALUE

#define BIG_VALUE   1E+10

Definition at line 1553 of file heur_dualval.c.

Referenced by fixDiscreteVars().

Function Documentation

◆ SCIP_DECL_EVENTINIT()

static SCIP_DECL_EVENTINIT ( eventInitLPsol  )
static

initialization method of event handler (called after problem was transformed)

Definition at line 168 of file heur_dualval.c.

References NULL, SCIP_CALL, SCIP_EVENTTYPE_FIRSTLPSOLVED, SCIP_EVENTTYPE_LPSOLVED, SCIP_OKAY, and SCIPcatchEvent().

◆ SCIP_DECL_EVENTEXIT()

static SCIP_DECL_EVENTEXIT ( eventExitLPsol  )
static

deinitialization method of event handler (called before transformed problem is freed)

Definition at line 181 of file heur_dualval.c.

References NULL, SCIP_CALL, SCIP_EVENTTYPE_FIRSTLPSOLVED, SCIP_EVENTTYPE_LPSOLVED, SCIP_OKAY, and SCIPdropEvent().

◆ SCIP_DECL_EVENTEXEC()

◆ SCIPincludeEventHdlrLPsol()

static SCIP_RETCODE SCIPincludeEventHdlrLPsol ( SCIP scip,
SCIP_HEURDATA heurdata 
)
static

includes event handler for best solution found

Parameters
scipSCIP data structure
heurdataheuristic data

Definition at line 244 of file heur_dualval.c.

References EVENTHDLR_DESC, EVENTHDLR_NAME, NULL, SCIP_CALL, SCIP_OKAY, SCIPincludeEventhdlrBasic(), SCIPsetEventhdlrExit(), and SCIPsetEventhdlrInit().

Referenced by createSubSCIP().

◆ releaseHashmapEntries()

static SCIP_RETCODE releaseHashmapEntries ( SCIP scip,
SCIP_HASHMAP hashmap,
SCIP_Bool  isvarmap 
)
static

releases all variables or constraints from given hash map

Parameters
scipSCIP data structure
hashmaphashmap
isvarmapare the entries variables or constraints?

Definition at line 270 of file heur_dualval.c.

References NULL, SCIP_CALL, SCIP_OKAY, SCIPhashmapEntryGetImage(), SCIPhashmapGetEntry(), SCIPhashmapGetNEntries(), SCIPreleaseCons(), and SCIPreleaseVar().

Referenced by createSubSCIP(), and SCIP_DECL_HEUREXIT().

◆ releaseHashmapNLPRows()

static SCIP_RETCODE releaseHashmapNLPRows ( SCIP scip,
SCIP_HASHMAP hashmap 
)
static

releases all NLP rows from given hash map

Parameters
scipSCIP data structure
hashmaphashmap

Definition at line 313 of file heur_dualval.c.

References NULL, SCIP_CALL, SCIP_OKAY, SCIPhashmapEntryGetImage(), SCIPhashmapGetEntry(), SCIPhashmapGetNEntries(), and SCIPreleaseNlRow().

Referenced by SCIP_DECL_HEUREXIT().

◆ addLinearConstraints()

static SCIP_RETCODE addLinearConstraints ( SCIP scip,
SCIP_CONSHDLR conshdlr,
SCIP_Bool  addcombconss,
SCIP_Bool  addcontconss,
SCIP_HEURDATA heurdata 
)
static

adds linear constraints from a SCIP instance to its NLP

Parameters
scipSCIP data structure
conshdlrconstraint handler for linear constraints
addcombconsswhether to add combinatorial linear constraints to NLP
addcontconsswhether to add continuous linear constraints to NLP
heurdataheuristic data structure

Definition at line 345 of file heur_dualval.c.

References FALSE, NULL, SCIP_Bool, SCIP_CALL, SCIP_EXPRCURV_LINEAR, SCIP_OKAY, SCIP_VARTYPE_CONTINUOUS, SCIPaddNlRow(), SCIPconsGetName(), SCIPconshdlrGetConss(), SCIPconshdlrGetNActiveConss(), SCIPconsIsChecked(), SCIPconsIsEnabled(), SCIPcreateNlRow(), SCIPgetLhsLinear(), SCIPgetNVarsLinear(), SCIPgetRhsLinear(), SCIPgetValsLinear(), SCIPgetVarsLinear(), SCIPhashmapInsert(), SCIPisRelLE(), SCIPreleaseNlRow(), SCIPvarGetType(), and TRUE.

Referenced by addLinearConstraintsToNlp().

◆ addVarboundConstraints()

static SCIP_RETCODE addVarboundConstraints ( SCIP scip,
SCIP_CONSHDLR conshdlr,
SCIP_Bool  addcombconss,
SCIP_Bool  addcontconss,
SCIP_HEURDATA heurdata 
)
static

adds variable bound constraints from a SCIP instance to its NLP

Parameters
scipSCIP data structure
conshdlrconstraint handler for linear constraints
addcombconsswhether to add combinatorial linear constraints to NLP
addcontconsswhether to add continuous linear constraints to NLP
heurdataheuristic data structure

Definition at line 422 of file heur_dualval.c.

References NULL, SCIP_Bool, SCIP_CALL, SCIP_EXPRCURV_LINEAR, SCIP_OKAY, SCIP_Real, SCIP_VARTYPE_CONTINUOUS, SCIPaddNlRow(), SCIPconsGetName(), SCIPconshdlrGetConss(), SCIPconshdlrGetNActiveConss(), SCIPconsIsChecked(), SCIPconsIsEnabled(), SCIPcreateNlRow(), SCIPgetLhsVarbound(), SCIPgetRhsVarbound(), SCIPgetVarVarbound(), SCIPgetVbdcoefVarbound(), SCIPgetVbdvarVarbound(), SCIPhashmapInsert(), and SCIPvarGetType().

Referenced by addLinearConstraintsToNlp().

◆ addLogicOrConstraints()

static SCIP_RETCODE addLogicOrConstraints ( SCIP scip,
SCIP_CONSHDLR conshdlr,
SCIP_HEURDATA heurdata 
)
static

adds logic-or constraints to NLP

Parameters
scipSCIP data structure
conshdlrconstraint handler for linear constraints
heurdataheuristic data structure

Definition at line 480 of file heur_dualval.c.

References NULL, SCIP_CALL, SCIP_EXPRCURV_LINEAR, SCIP_OKAY, SCIP_Real, SCIPaddNlRow(), SCIPallocBufferArray, SCIPconsGetName(), SCIPconshdlrGetConss(), SCIPconshdlrGetNActiveConss(), SCIPconsIsChecked(), SCIPconsIsEnabled(), SCIPcreateNlRow(), SCIPfreeBufferArrayNull, SCIPgetNVarsLogicor(), SCIPgetVarsLogicor(), SCIPhashmapInsert(), SCIPinfinity(), and SCIPreallocBufferArray.

Referenced by addLinearConstraintsToNlp().

◆ addSetppcConstraints()

◆ addKnapsackConstraints()

static SCIP_RETCODE addKnapsackConstraints ( SCIP scip,
SCIP_CONSHDLR conshdlr,
SCIP_HEURDATA heurdata 
)
static

◆ addLinearConstraintsToNlp()

static SCIP_RETCODE addLinearConstraintsToNlp ( SCIP scip,
SCIP_Bool  addcombconss,
SCIP_Bool  addcontconss,
SCIP_HEURDATA heurdata 
)
static

adds combinatorial and/or continuous variants of linear constraints from a SCIP instance to its NLP

Parameters
scipSCIP data structure
addcombconsswhether to add combinatorial linear constraints to NLP
addcontconsswhether to add continuous linear constraints to NLP
heurdataheuristic data structure

Definition at line 711 of file heur_dualval.c.

References addKnapsackConstraints(), addLinearConstraints(), addLogicOrConstraints(), addSetppcConstraints(), addVarboundConstraints(), NULL, SCIP_CALL, SCIP_OKAY, and SCIPfindConshdlr().

Referenced by SCIPapplyHeurDualval().

◆ createSolFromSubScipSol()

static SCIP_RETCODE createSolFromSubScipSol ( SCIP scip,
SCIP_HEUR heur,
SCIP_SOL **  sol,
SCIP_SOL subsol 
)
static

creates a SCIP_SOL in our SCIP space out of the SCIP_SOL from a sub-SCIP

Parameters
scipSCIP data structure
heurheuristic data structure
solbuffer to store solution value; if pointing to NULL, a new solution is created, otherwise values in the given one are overwritten
subsolsolution of sub-SCIP

Definition at line 765 of file heur_dualval.c.

References NULL, REALABS, SCIP_CALL, SCIP_INVALID, SCIP_OKAY, SCIP_Real, SCIPcreateOrigSol(), SCIPdebugMsg, SCIPfreeSol(), SCIPgetNOrigVars(), SCIPgetOrigVars(), SCIPgetOrigVarsData(), SCIPgetProbvarSum(), SCIPgetSolVal(), SCIPhashmapGetImage(), SCIPheurGetData(), SCIPsetSolVal(), SCIPvarGetLbGlobal(), SCIPvarGetTransVar(), and SCIPvarIsBinary().

Referenced by storeSolution().

◆ createSubSCIP()

static SCIP_RETCODE createSubSCIP ( SCIP scip,
SCIP_HEURDATA heurdata 
)
static

creates copy of CIP from problem in SCIP

Parameters
scipSCIP data structure
heurdataheuristic data structure

Definition at line 856 of file heur_dualval.c.

References BMSclearMemoryArray, FALSE, NULL, REALABS, releaseHashmapEntries(), SCIP_Bool, SCIP_CALL, SCIP_INVALID, SCIP_MAXSTRLEN, SCIP_OKAY, SCIP_Real, SCIP_VARTYPE_BINARY, SCIP_VARTYPE_CONTINUOUS, SCIPaddCoefLinear(), SCIPaddCons(), SCIPaddVar(), SCIPallocBlockMemoryArray, SCIPblkmem(), SCIPcaptureCons(), SCIPcaptureVar(), SCIPchgVarLbGlobal(), SCIPchgVarObj(), SCIPchgVarType(), SCIPchgVarUbGlobal(), SCIPconsAddUpgradeLocks(), SCIPconsGetHdlr(), SCIPconsGetName(), SCIPconshdlrGetConss(), SCIPconshdlrGetNConss(), SCIPconsIsChecked(), SCIPconsIsDynamic(), SCIPconsIsEnforced(), SCIPconsIsInitial(), SCIPconsIsLocal(), SCIPconsIsPropagated(), SCIPconsIsRemovable(), SCIPconsIsSeparated(), SCIPconsIsStickingAtNode(), SCIPcopyConss(), SCIPcopyParamSettings(), SCIPcopyPlugins(), SCIPcopyVars(), SCIPcreate(), SCIPcreateConsIndicatorLinCons(), SCIPcreateConsLinear(), SCIPcreateProb(), SCIPcreateVar(), SCIPdebugMsg, SCIPdelCons(), SCIPfindConshdlr(), SCIPfloor(), SCIPgetBinaryVarIndicator(), SCIPgetLinearConsIndicator(), SCIPgetNConss(), SCIPgetNegatedVar(), SCIPgetNOrigConss(), SCIPgetNOrigVars(), SCIPgetOrigConss(), SCIPgetOrigVars(), SCIPgetProbName(), SCIPgetSlackVarIndicator(), SCIPgetTransformedCons(), SCIPgetVarsData(), SCIPhashmapCreate(), SCIPhashmapEntryGetImage(), SCIPhashmapEntryGetOrigin(), SCIPhashmapFree(), SCIPhashmapGetEntry(), SCIPhashmapGetImage(), SCIPhashmapGetNEntries(), SCIPhashmapInsert(), SCIPhashmapRemove(), SCIPhashmapRemoveAll(), SCIPincludeEventHdlrLPsol(), SCIPinfinity(), SCIPisFeasEQ(), SCIPreleaseCons(), SCIPreleaseVar(), SCIPsetIntParam(), SCIPsetRealParam(), SCIPsnprintf(), SCIPvarGetLbGlobal(), SCIPvarGetName(), SCIPvarGetObj(), SCIPvarGetProbindex(), SCIPvarGetTransVar(), SCIPvarGetUbGlobal(), SCIPvarIsActive(), SCIPvarIsIntegral(), SCIPvarIsNegated(), and TRUE.

Referenced by SCIP_DECL_HEURINIT(), and SCIPapplyHeurDualval().

◆ freeSubSCIP()

static SCIP_RETCODE freeSubSCIP ( SCIP scip,
SCIP_HEURDATA heurdata 
)
static

free sub-SCIP data structure

Parameters
scipSCIP data structure
heurdataheuristic data structure

Definition at line 1483 of file heur_dualval.c.

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

Referenced by SCIP_DECL_HEUREXIT().

◆ createSolFromNLP()

static SCIP_RETCODE createSolFromNLP ( SCIP scip,
SCIP_HEUR heur,
SCIP_SOL **  sol 
)
static

create a solution from the values of current nonlinear program

Parameters
scipSCIP data structure
heurheuristic data structure
solbuffer to store solution value; if pointing to NULL a new solution is created, otherwise values in the given one are overwritten

Definition at line 1504 of file heur_dualval.c.

References NULL, SCIP_CALL, SCIP_INVALID, SCIP_OKAY, SCIPcreateSol(), SCIPgetNOrigVars(), SCIPgetOrigVarsData(), SCIPheurGetData(), SCIPsetSolVal(), SCIPvarGetNLPSol(), SCIPvarGetTransVar(), and SCIPvarIsActive().

Referenced by SCIPapplyHeurDualval().

◆ fixDiscreteVars()

static SCIP_RETCODE fixDiscreteVars ( SCIP scip,
SCIP_HEURDATA heurdata,
SCIP_SOL refpoint,
SCIP_SOL **  transsol 
)
static

method to fix the (relaxed) discrete variables

Parameters
scipSCIP data structure
heurdataheuristic data structure
refpointpoint to take fixation of discrete variables from; if NULL, then LP solution is used
transsolpointer to new created solution with fixed values as solution value

Definition at line 1557 of file heur_dualval.c.

References BIG_VALUE, MAX, MIN, NULL, REALABS, SCIP_CALL, SCIP_LPSOLSTAT_OPTIMAL, SCIP_OKAY, SCIP_Real, SCIPchgLhsLinear(), SCIPchgRhsLinear(), SCIPchgVarLbGlobal(), SCIPchgVarUbGlobal(), SCIPcreateOrigSol(), SCIPfloor(), SCIPgetLPSolstat(), SCIPgetSolVal(), SCIPhashmapGetImage(), SCIPsetSolVal(), SCIPvarGetLbGlobal(), SCIPvarGetTransVar(), and SCIPvarGetUbGlobal().

Referenced by SCIPapplyHeurDualval().

◆ freeMemory()

static SCIP_RETCODE freeMemory ( SCIP scip,
SCIP_HEURDATA heurdata,
SCIP_SOL transsol,
SCIP_Real absranks,
SCIP_Real ranks,
SCIP_VAR **  sortedvars,
SCIP_Bool  beforeswitching,
SCIP_Bool  clearswitchedvars 
)
static

method to free memory before leaving the heuristic or jumping up in the recursion

Parameters
scipscip data structure
heurdataheuristic data structure
transsolsol that has to be freed
absranksarray of absolute rank values
ranksarray of rank values
sortedvarsarray of corresponding variables
beforeswitchingdid we call this method before or after switching variables?
clearswitchedvarssays if we should clear switchedvars or not

Definition at line 1635 of file heur_dualval.c.

References NULL, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPchgVarLbGlobal(), SCIPchgVarUbGlobal(), SCIPfreeBlockMemoryArray, SCIPfreeBufferArrayNull, SCIPfreeSol(), SCIPfreeTransform(), SCIPgetOrigVarsData(), SCIPhashmapGetImage(), SCIPhashmapRemoveAll(), SCIPvarGetLbGlobal(), SCIPvarGetProbindex(), and SCIPvarGetUbGlobal().

Referenced by SCIPapplyHeurDualval(), and storeSolution().

◆ computeRanks()

static SCIP_RETCODE computeRanks ( SCIP scip,
SCIP_HEURDATA heurdata,
SCIP_Real absranks,
SCIP_Real ranks,
SCIP_VAR **  sortedvars 
)
static

computes the ranks, saves them into an array and sorts the variables according to absolute ranks

Parameters
scipscip data structure
heurdataheuristic data structure
absranksarray of absolute rank values
ranksarray of rank values
sortedvarsarray of corresponding variables

Definition at line 1721 of file heur_dualval.c.

References NULL, REALABS, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPconshdlrGetConss(), SCIPconshdlrGetNConss(), SCIPfindConshdlr(), SCIPgetBinaryVarIndicator(), SCIPgetLinearConsIndicator(), SCIPgetTransformedCons(), SCIPhashmapGetImage(), SCIPisFeasEQ(), SCIPsortDownRealRealPtr(), SCIPvarGetLbGlobal(), SCIPvarGetNegatedVar(), SCIPvarGetTransVar(), SCIPvarGetUbGlobal(), and SCIPvarIsNegated().

Referenced by SCIPapplyHeurDualval().

◆ maximalslack()

static SCIP_Real maximalslack ( SCIP scip,
SCIP_HEURDATA heurdata 
)
static

compute maximal slack of a variable

Parameters
scipscip data structure
heurdataheuristic data structure

Definition at line 1851 of file heur_dualval.c.

References FALSE, NULL, SCIP_Bool, SCIP_Real, SCIP_VERBLEVEL_HIGH, SCIPgetBestSol(), SCIPgetNOrigVars(), SCIPgetOrigVars(), SCIPgetSolVal(), SCIPhashmapGetImage(), SCIPinfinity(), SCIPvarGetName(), SCIPvarGetNLPSol(), SCIPverbMessage(), and TRUE.

Referenced by SCIPapplyHeurDualval().

◆ storeSolution()

static SCIP_RETCODE storeSolution ( SCIP scip,
SCIP_HEUR heur,
SCIP_RESULT result,
SCIP_SOL transsol,
SCIP_SOL bestsol 
)
static

method called after a solution is found which is feasible in the original problem, stores it and cleans up

Parameters
scipSCIP data structure
heurheuristic data
resultpointer to store result of: did not run, solution found, no solution found, or fixing is infeasible (cutoff)
transsolsolution to fix variables
bestsolsolution we create a original scip solution from

Definition at line 1924 of file heur_dualval.c.

References createSolFromSubScipSol(), FALSE, freeMemory(), NULL, SCIP_Bool, SCIP_CALL, SCIP_DIDNOTFIND, SCIP_FOUNDSOL, SCIP_NLPSOLSTAT_FEASIBLE, SCIP_OKAY, SCIP_Real, SCIP_VERBLEVEL_HIGH, SCIPdebugMsg, SCIPfreeSol(), SCIPgetNLPSolstat(), SCIPheurGetData(), SCIPheurSetFreq(), SCIPinfinity(), SCIPsolGetOrigObj(), SCIPtrySolFree(), SCIPverbMessage(), and TRUE.

Referenced by SCIPapplyHeurDualval().

◆ SCIP_DECL_HEURFREE()

static SCIP_DECL_HEURFREE ( heurFreeDualval  )
static

destructor of primal heuristic to free user data (called when SCIP is exiting)

Definition at line 2520 of file heur_dualval.c.

References NULL, SCIP_OKAY, SCIPfreeBlockMemory, and SCIPheurGetData().

◆ SCIP_DECL_HEURINIT()

static SCIP_DECL_HEURINIT ( heurInitDualval  )
static

initialization method of primal heuristic (called after problem was transformed)

Definition at line 2537 of file heur_dualval.c.

References createSubSCIP(), HEUR_TIMING, NULL, SCIP_CALL, SCIP_HEURTIMING_DURINGLPLOOP, SCIP_OKAY, SCIPblkmem(), SCIPhashmapCreate(), SCIPheurGetData(), SCIPheurGetFreq(), SCIPheurGetFreqofs(), SCIPheurSetTimingmask(), and SCIPsetIntParam().

◆ SCIP_DECL_HEUREXIT()

static SCIP_DECL_HEUREXIT ( heurExitDualval  )
static

◆ SCIP_DECL_HEURINITSOL()

static SCIP_DECL_HEURINITSOL ( heurInitsolDualval  )
static

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

Definition at line 2712 of file heur_dualval.c.

References HEUR_TIMING, NULL, SCIP_HEURTIMING_DURINGLPLOOP, SCIP_OKAY, SCIPheurGetData(), SCIPheurGetFreq(), SCIPheurGetFreqofs(), and SCIPheurSetTimingmask().

◆ SCIP_DECL_HEUREXITSOL()

static SCIP_DECL_HEUREXITSOL ( heurExitsolDualval  )
static

solving process deinitialization method of primal heuristic (called before branch and bound process data is freed)

Definition at line 2740 of file heur_dualval.c.

References HEUR_TIMING, NULL, SCIP_OKAY, and SCIPheurSetTimingmask().

◆ SCIP_DECL_HEUREXEC()

static SCIP_DECL_HEUREXEC ( heurExecDualval  )
static