Scippy

    SCIP

    Solving Constraint Integer Programs

    Detailed Description

    NLP diving heuristic that chooses fixings w.r.t. the fractionalities.

    Author
    Timo Berthold
    Stefan Vigerske

    Definition in file heur_nlpdiving.c.

    #include "blockmemshell/memory.h"
    #include "scip/heur_nlpdiving.h"
    #include "scip/heur_subnlp.h"
    #include "scip/heur_undercover.h"
    #include "scip/pub_event.h"
    #include "scip/pub_heur.h"
    #include "scip/pub_message.h"
    #include "scip/pub_misc.h"
    #include "scip/pub_sol.h"
    #include "scip/pub_var.h"
    #include "scip/scip_branch.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_nodesel.h"
    #include "scip/scip_numerics.h"
    #include "scip/scip_param.h"
    #include "scip/scip_prob.h"
    #include "scip/scip_probing.h"
    #include "scip/scip_randnumgen.h"
    #include "scip/scip_sol.h"
    #include "scip/scip_solve.h"
    #include "scip/scip_solvingstats.h"
    #include "scip/scip_timing.h"
    #include "scip/scip_tree.h"
    #include "scip/scip_var.h"
    #include <string.h>

    Go to the source code of this file.

    Macros

    #define HEUR_NAME   "nlpdiving"
     
    #define HEUR_DESC   "NLP diving heuristic that chooses fixings w.r.t. the fractionalities"
     
    #define HEUR_DISPCHAR   SCIP_HEURDISPCHAR_DIVING
     
    #define HEUR_PRIORITY   -1003010
     
    #define HEUR_FREQ   10
     
    #define HEUR_FREQOFS   3
     
    #define HEUR_MAXDEPTH   -1
     
    #define HEUR_TIMING   SCIP_HEURTIMING_AFTERLPPLUNGE
     
    #define HEUR_USESSUBSCIP   FALSE
     
    #define EVENTHDLR_NAME   "Nlpdiving"
     
    #define EVENTHDLR_DESC   "bound change event handler for " HEUR_NAME " heuristic"
     
    #define DEFAULT_MINRELDEPTH   0.0
     
    #define DEFAULT_MAXRELDEPTH   1.0
     
    #define DEFAULT_MAXNLPITERABS   200
     
    #define DEFAULT_MAXNLPITERREL   10
     
    #define DEFAULT_MAXDIVEUBQUOT   0.8
     
    #define DEFAULT_MAXDIVEAVGQUOT   0.0
     
    #define DEFAULT_MAXDIVEUBQUOTNOSOL   0.1
     
    #define DEFAULT_MAXDIVEAVGQUOTNOSOL   0.0
     
    #define DEFAULT_MINSUCCQUOT   0.1
     
    #define DEFAULT_MAXFEASNLPS   10
     
    #define DEFAULT_FIXQUOT   0.2
     
    #define DEFAULT_BACKTRACK   TRUE
     
    #define DEFAULT_LP   FALSE
     
    #define DEFAULT_PREFERLPFRACS   FALSE
     
    #define DEFAULT_PREFERCOVER   TRUE
     
    #define DEFAULT_SOLVESUBMIP   FALSE
     
    #define DEFAULT_NLPSTART   's'
     
    #define DEFAULT_VARSELRULE   'd'
     
    #define DEFAULT_NLPFASTFAIL   TRUE
     
    #define DEFAULT_RANDSEED   97
     
    #define MINNLPITER   10
     

    Functions

    static SCIP_RETCODE getNLPFracVars (SCIP *scip, SCIP_HEURDATA *heurdata, SCIP_VAR ***nlpcands, SCIP_Real **nlpcandssol, SCIP_Real **nlpcandsfrac, int *nnlpcands)
     
    static SCIP_RETCODE chooseFracVar (SCIP *scip, SCIP_HEURDATA *heurdata, SCIP_VAR **nlpcands, SCIP_Real *nlpcandssol, SCIP_Real *nlpcandsfrac, int nnlpcands, SCIP_HASHMAP *varincover, SCIP_Bool covercomputed, int *bestcand, SCIP_Bool *bestcandmayround, SCIP_Bool *bestcandroundup)
     
    static SCIP_RETCODE chooseVeclenVar (SCIP *scip, SCIP_HEURDATA *heurdata, SCIP_VAR **nlpcands, SCIP_Real *nlpcandssol, SCIP_Real *nlpcandsfrac, int nnlpcands, SCIP_HASHMAP *varincover, SCIP_Bool covercomputed, int *bestcand, SCIP_Bool *bestcandmayround, SCIP_Bool *bestcandroundup)
     
    static SCIP_RETCODE chooseCoefVar (SCIP *scip, SCIP_HEURDATA *heurdata, SCIP_VAR **nlpcands, SCIP_Real *nlpcandssol, SCIP_Real *nlpcandsfrac, int nnlpcands, SCIP_HASHMAP *varincover, SCIP_Bool covercomputed, int *bestcand, SCIP_Bool *bestcandmayround, SCIP_Bool *bestcandroundup)
     
    static void calcPscostQuot (SCIP *scip, SCIP_HEURDATA *heurdata, SCIP_VAR *var, SCIP_Real primsol, SCIP_Real frac, int rounddir, SCIP_Real *pscostquot, SCIP_Bool *roundup, SCIP_Bool prefvar)
     
    static SCIP_RETCODE choosePscostVar (SCIP *scip, SCIP_HEURDATA *heurdata, SCIP_VAR **nlpcands, SCIP_Real *nlpcandssol, SCIP_Real *nlpcandsfrac, int nnlpcands, SCIP_HASHMAP *varincover, SCIP_Bool covercomputed, int *bestcand, SCIP_Bool *bestcandmayround, SCIP_Bool *bestcandroundup)
     
    static SCIP_RETCODE chooseGuidedVar (SCIP *scip, SCIP_HEURDATA *heurdata, SCIP_VAR **nlpcands, SCIP_Real *nlpcandssol, SCIP_Real *nlpcandsfrac, int nnlpcands, SCIP_SOL *bestsol, SCIP_HASHMAP *varincover, SCIP_Bool covercomputed, int *bestcand, SCIP_Bool *bestcandmayround, SCIP_Bool *bestcandroundup)
     
    static SCIP_RETCODE chooseDoubleVar (SCIP *scip, SCIP_HEURDATA *heurdata, SCIP_VAR **pseudocands, SCIP_Real *pseudocandsnlpsol, SCIP_Real *pseudocandslpsol, int npseudocands, SCIP_HASHMAP *varincover, SCIP_Bool covercomputed, int *bestcand, SCIP_Real *bestboundval, SCIP_Bool *bestcandmayround, SCIP_Bool *bestcandroundup)
     
    static SCIP_RETCODE createNewSol (SCIP *scip, SCIP *subscip, SCIP_HEUR *heur, SCIP_HASHMAP *varmap, SCIP_SOL *subsol, SCIP_Bool *success)
     
    static SCIP_RETCODE doSolveSubMIP (SCIP *scip, SCIP *subscip, SCIP_HEUR *heur, SCIP_VAR **covervars, int ncovervars, SCIP_Bool *success)
     
    static SCIP_RETCODE solveSubMIP (SCIP *scip, SCIP_HEUR *heur, SCIP_VAR **covervars, int ncovervars, SCIP_Bool *success)
     
    static SCIP_DECL_EVENTEXEC (eventExecNlpdiving)
     
    static SCIP_DECL_HEURCOPY (heurCopyNlpdiving)
     
    static SCIP_DECL_HEURFREE (heurFreeNlpdiving)
     
    static SCIP_DECL_HEURINIT (heurInitNlpdiving)
     
    static SCIP_DECL_HEUREXIT (heurExitNlpdiving)
     
    static SCIP_DECL_HEURINITSOL (heurInitsolNlpdiving)
     
    static SCIP_DECL_HEUREXITSOL (heurExitsolNlpdiving)
     
    static SCIP_DECL_HEUREXEC (heurExecNlpdiving)
     
    SCIP_RETCODE SCIPincludeHeurNlpdiving (SCIP *scip)
     

    Macro Definition Documentation

    ◆ HEUR_NAME

    #define HEUR_NAME   "nlpdiving"

    Definition at line 68 of file heur_nlpdiving.c.

    ◆ HEUR_DESC

    #define HEUR_DESC   "NLP diving heuristic that chooses fixings w.r.t. the fractionalities"

    Definition at line 69 of file heur_nlpdiving.c.

    ◆ HEUR_DISPCHAR

    #define HEUR_DISPCHAR   SCIP_HEURDISPCHAR_DIVING

    Definition at line 70 of file heur_nlpdiving.c.

    ◆ HEUR_PRIORITY

    #define HEUR_PRIORITY   -1003010

    Definition at line 71 of file heur_nlpdiving.c.

    ◆ HEUR_FREQ

    #define HEUR_FREQ   10

    Definition at line 72 of file heur_nlpdiving.c.

    ◆ HEUR_FREQOFS

    #define HEUR_FREQOFS   3

    Definition at line 73 of file heur_nlpdiving.c.

    ◆ HEUR_MAXDEPTH

    #define HEUR_MAXDEPTH   -1

    Definition at line 74 of file heur_nlpdiving.c.

    ◆ HEUR_TIMING

    #define HEUR_TIMING   SCIP_HEURTIMING_AFTERLPPLUNGE

    Definition at line 75 of file heur_nlpdiving.c.

    ◆ HEUR_USESSUBSCIP

    #define HEUR_USESSUBSCIP   FALSE

    does the heuristic use a secondary SCIP instance?

    Definition at line 76 of file heur_nlpdiving.c.

    ◆ EVENTHDLR_NAME

    #define EVENTHDLR_NAME   "Nlpdiving"

    Definition at line 79 of file heur_nlpdiving.c.

    ◆ EVENTHDLR_DESC

    #define EVENTHDLR_DESC   "bound change event handler for " HEUR_NAME " heuristic"

    Definition at line 80 of file heur_nlpdiving.c.

    ◆ DEFAULT_MINRELDEPTH

    #define DEFAULT_MINRELDEPTH   0.0

    minimal relative depth to start diving

    Definition at line 87 of file heur_nlpdiving.c.

    ◆ DEFAULT_MAXRELDEPTH

    #define DEFAULT_MAXRELDEPTH   1.0

    maximal relative depth to start diving

    Definition at line 88 of file heur_nlpdiving.c.

    ◆ DEFAULT_MAXNLPITERABS

    #define DEFAULT_MAXNLPITERABS   200

    minimial absolute number of allowed NLP iterations

    Definition at line 89 of file heur_nlpdiving.c.

    ◆ DEFAULT_MAXNLPITERREL

    #define DEFAULT_MAXNLPITERREL   10

    additional allowed number of NLP iterations relative to successfully found solutions

    Definition at line 90 of file heur_nlpdiving.c.

    ◆ DEFAULT_MAXDIVEUBQUOT

    #define DEFAULT_MAXDIVEUBQUOT   0.8

    maximal quotient (curlowerbound - lowerbound)/(cutoffbound - lowerbound) where diving is performed (0.0: no limit)

    Definition at line 92 of file heur_nlpdiving.c.

    ◆ DEFAULT_MAXDIVEAVGQUOT

    #define DEFAULT_MAXDIVEAVGQUOT   0.0

    maximal quotient (curlowerbound - lowerbound)/(avglowerbound - lowerbound) where diving is performed (0.0: no limit)

    Definition at line 94 of file heur_nlpdiving.c.

    ◆ DEFAULT_MAXDIVEUBQUOTNOSOL

    #define DEFAULT_MAXDIVEUBQUOTNOSOL   0.1

    maximal UBQUOT when no solution was found yet (0.0: no limit)

    Definition at line 95 of file heur_nlpdiving.c.

    ◆ DEFAULT_MAXDIVEAVGQUOTNOSOL

    #define DEFAULT_MAXDIVEAVGQUOTNOSOL   0.0

    maximal AVGQUOT when no solution was found yet (0.0: no limit)

    Definition at line 96 of file heur_nlpdiving.c.

    ◆ DEFAULT_MINSUCCQUOT

    #define DEFAULT_MINSUCCQUOT   0.1

    heuristic will not run if less then this percentage of calls succeeded (0.0: no limit)

    Definition at line 97 of file heur_nlpdiving.c.

    ◆ DEFAULT_MAXFEASNLPS

    #define DEFAULT_MAXFEASNLPS   10

    maximal number of NLPs with feasible solution to solve during one dive

    Definition at line 98 of file heur_nlpdiving.c.

    ◆ DEFAULT_FIXQUOT

    #define DEFAULT_FIXQUOT   0.2

    percentage of fractional variables that should be fixed before the next NLP solve

    Definition at line 99 of file heur_nlpdiving.c.

    ◆ DEFAULT_BACKTRACK

    #define DEFAULT_BACKTRACK   TRUE

    use one level of backtracking if infeasibility is encountered?

    Definition at line 100 of file heur_nlpdiving.c.

    ◆ DEFAULT_LP

    #define DEFAULT_LP   FALSE

    should the LP relaxation be solved before the NLP relaxation?

    Definition at line 101 of file heur_nlpdiving.c.

    ◆ DEFAULT_PREFERLPFRACS

    #define DEFAULT_PREFERLPFRACS   FALSE

    prefer variables that are also fractional in LP solution?

    Definition at line 102 of file heur_nlpdiving.c.

    ◆ DEFAULT_PREFERCOVER

    #define DEFAULT_PREFERCOVER   TRUE

    should variables in a minimal cover be preferred?

    Definition at line 103 of file heur_nlpdiving.c.

    ◆ DEFAULT_SOLVESUBMIP

    #define DEFAULT_SOLVESUBMIP   FALSE

    should a sub-MIP be solved if all cover variables are fixed?

    Definition at line 104 of file heur_nlpdiving.c.

    ◆ DEFAULT_NLPSTART

    #define DEFAULT_NLPSTART   's'

    which point should be used as starting point for the NLP solver?

    Definition at line 105 of file heur_nlpdiving.c.

    ◆ DEFAULT_VARSELRULE

    #define DEFAULT_VARSELRULE   'd'

    which variable selection should be used? ('f'ractionality, 'c'oefficient, 'p'seudocost, 'g'uided, 'd'ouble)

    Definition at line 108 of file heur_nlpdiving.c.

    ◆ DEFAULT_NLPFASTFAIL

    #define DEFAULT_NLPFASTFAIL   TRUE

    should the NLP solver stop early if it converges slow?

    Definition at line 109 of file heur_nlpdiving.c.

    ◆ DEFAULT_RANDSEED

    #define DEFAULT_RANDSEED   97

    initial random seed

    Definition at line 110 of file heur_nlpdiving.c.

    ◆ MINNLPITER

    #define MINNLPITER   10

    minimal number of NLP iterations allowed in each NLP solving call

    Definition at line 112 of file heur_nlpdiving.c.

    Function Documentation

    ◆ getNLPFracVars()

    static SCIP_RETCODE getNLPFracVars ( SCIP scip,
    SCIP_HEURDATA heurdata,
    SCIP_VAR ***  nlpcands,
    SCIP_Real **  nlpcandssol,
    SCIP_Real **  nlpcandsfrac,
    int *  nnlpcands 
    )
    static

    gets fractional variables of last NLP solution along with solution values and fractionalities

    Returns
    SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
    Precondition
    This method can be called if SCIP is in one of the following stages:
    Parameters
    scipSCIP data structure
    heurdataheuristic data structure
    nlpcandspointer to store the array of NLP fractional variables, or NULL
    nlpcandssolpointer to store the array of NLP fractional variables solution values, or NULL
    nlpcandsfracpointer to store the array of NLP fractional variables fractionalities, or NULL
    nnlpcandspointer to store the number of NLP fractional variables , or NULL

    Definition at line 171 of file heur_nlpdiving.c.

    References NULL, SCIP_CALL, SCIP_LPSOLSTAT_OPTIMAL, SCIP_OKAY, SCIP_Real, SCIPfeastol(), SCIPgetLPSolstat(), SCIPgetNLPFracVars(), SCIPgetSolVal(), SCIPisFeasIntegral(), SCIPsetSolVal(), SCIPvarGetLbLocal(), and SCIPvarGetUbLocal().

    Referenced by SCIP_DECL_HEUREXEC().

    ◆ chooseFracVar()

    static SCIP_RETCODE chooseFracVar ( SCIP scip,
    SCIP_HEURDATA heurdata,
    SCIP_VAR **  nlpcands,
    SCIP_Real nlpcandssol,
    SCIP_Real nlpcandsfrac,
    int  nnlpcands,
    SCIP_HASHMAP varincover,
    SCIP_Bool  covercomputed,
    int *  bestcand,
    SCIP_Bool bestcandmayround,
    SCIP_Bool bestcandroundup 
    )
    static

    finds best candidate variable w.r.t. fractionality:

    • prefer variables that may not be rounded without destroying NLP feasibility:
      • of these variables, round least fractional variable in corresponding direction
    • if all remaining fractional variables may be rounded without destroying NLP feasibility:
      • round variable with least increasing objective value
    • binary variables are prefered
    • variables in a minimal cover or variables that are also fractional in an optimal LP solution might also be prefered if a correpsonding parameter is set
    Parameters
    sciporiginal SCIP data structure
    heurdataheuristic data structure
    nlpcandsarray of NLP fractional variables
    nlpcandssolarray of NLP fractional variables solution values
    nlpcandsfracarray of NLP fractional variables fractionalities
    nnlpcandsnumber of NLP fractional variables
    varincoverhash map for variables
    covercomputedhas a minimal cover been computed?
    bestcandpointer to store the index of the best candidate variable
    bestcandmayroundpointer to store whether best candidate is trivially roundable
    bestcandrounduppointer to store whether best candidate should be rounded up

    Definition at line 246 of file heur_nlpdiving.c.

    References FALSE, NULL, SCIP_Bool, SCIP_INVALID, SCIP_OKAY, SCIP_PROBINGSCORE_PENALTYRATIO, SCIP_Real, SCIPhashmapExists(), SCIPinfinity(), SCIPisEQ(), SCIPisGT(), SCIPisLT(), SCIPrandomGetInt(), SCIPvarGetLbLocal(), SCIPvarGetObj(), SCIPvarGetUbLocal(), SCIPvarIsBinary(), SCIPvarMayRoundDown(), SCIPvarMayRoundUp(), and TRUE.

    Referenced by SCIP_DECL_HEUREXEC().

    ◆ chooseVeclenVar()

    static SCIP_RETCODE chooseVeclenVar ( SCIP scip,
    SCIP_HEURDATA heurdata,
    SCIP_VAR **  nlpcands,
    SCIP_Real nlpcandssol,
    SCIP_Real nlpcandsfrac,
    int  nnlpcands,
    SCIP_HASHMAP varincover,
    SCIP_Bool  covercomputed,
    int *  bestcand,
    SCIP_Bool bestcandmayround,
    SCIP_Bool bestcandroundup 
    )
    static

    finds best candidate variable w.r.t. vector length:

    • round variable with a small ratio between the increase in the objective and the locking numbers
    • binary variables are prefered
    • variables in a minimal cover or variables that are also fractional in an optimal LP solution might also be prefered if a corresponding parameter is set
    Parameters
    sciporiginal SCIP data structure
    heurdataheuristic data structure
    nlpcandsarray of NLP fractional variables
    nlpcandssolarray of NLP fractional variables solution values
    nlpcandsfracarray of NLP fractional variables fractionalities
    nnlpcandsnumber of NLP fractional variables
    varincoverhash map for variables
    covercomputedhas a minimal cover been computed?
    bestcandpointer to store the index of the best candidate variable
    bestcandmayroundpointer to store whether best candidate is trivially roundable
    bestcandrounduppointer to store whether best candidate should be rounded up

    Definition at line 422 of file heur_nlpdiving.c.

    References NULL, SCIP_Bool, SCIP_LOCKTYPE_MODEL, SCIP_OKAY, SCIP_Real, SCIP_REAL_MAX, SCIP_VARTYPE_BINARY, SCIPhashmapExists(), SCIPisGT(), SCIPisLT(), SCIPsumepsilon(), SCIPvarGetLbLocal(), SCIPvarGetNLocksDownType(), SCIPvarGetNLocksUpType(), SCIPvarGetObj(), SCIPvarGetType(), SCIPvarGetUbLocal(), SCIPvarIsImpliedIntegral(), SCIPvarMayRoundDown(), SCIPvarMayRoundUp(), and TRUE.

    Referenced by SCIP_DECL_HEUREXEC().

    ◆ chooseCoefVar()

    static SCIP_RETCODE chooseCoefVar ( SCIP scip,
    SCIP_HEURDATA heurdata,
    SCIP_VAR **  nlpcands,
    SCIP_Real nlpcandssol,
    SCIP_Real nlpcandsfrac,
    int  nnlpcands,
    SCIP_HASHMAP varincover,
    SCIP_Bool  covercomputed,
    int *  bestcand,
    SCIP_Bool bestcandmayround,
    SCIP_Bool bestcandroundup 
    )
    static

    finds best candidate variable w.r.t. locking numbers:

    • prefer variables that may not be rounded without destroying LP feasibility:
      • of these variables, round variable with least number of locks in corresponding direction
    • if all remaining fractional variables may be rounded without destroying LP feasibility:
      • round variable with least number of locks in opposite of its feasible rounding direction
    • binary variables are prefered
    • variables in a minimal cover or variables that are also fractional in an optimal LP solution might also be prefered if a correpsonding parameter is set
    Parameters
    sciporiginal SCIP data structure
    heurdataheuristic data structure
    nlpcandsarray of NLP fractional variables
    nlpcandssolarray of NLP fractional variables solution values
    nlpcandsfracarray of NLP fractional variables fractionalities
    nnlpcandsnumber of NLP fractional variables
    varincoverhash map for variables
    covercomputedhas a minimal cover been computed?
    bestcandpointer to store the index of the best candidate variable
    bestcandmayroundpointer to store whether best candidate is trivially roundable
    bestcandrounduppointer to store whether best candidate should be rounded up

    Definition at line 516 of file heur_nlpdiving.c.

    References FALSE, NULL, SCIP_Bool, SCIP_INVALID, SCIP_LOCKTYPE_MODEL, SCIP_OKAY, SCIP_PROBINGSCORE_PENALTYRATIO, SCIP_Real, SCIPhashmapExists(), SCIPisEQ(), SCIPisGT(), SCIPisLT(), SCIPrandomGetInt(), SCIPvarGetLbLocal(), SCIPvarGetNLocksDownType(), SCIPvarGetNLocksUpType(), SCIPvarGetUbLocal(), SCIPvarIsBinary(), SCIPvarMayRoundDown(), SCIPvarMayRoundUp(), and TRUE.

    Referenced by SCIP_DECL_HEUREXEC().

    ◆ calcPscostQuot()

    static void calcPscostQuot ( SCIP scip,
    SCIP_HEURDATA heurdata,
    SCIP_VAR var,
    SCIP_Real  primsol,
    SCIP_Real  frac,
    int  rounddir,
    SCIP_Real pscostquot,
    SCIP_Bool roundup,
    SCIP_Bool  prefvar 
    )
    static

    calculates the pseudocost score for a given variable w.r.t. a given solution value and a given rounding direction

    Parameters
    scipSCIP data structure
    heurdataheuristic data structure
    varproblem variable
    primsolprimal solution of variable
    fracfractionality of variable
    rounddir-1: round down, +1: round up, 0: select due to pseudo cost values
    pscostquotpointer to store pseudo cost quotient
    rounduppointer to store whether the variable should be rounded up
    prefvarshould this variable be preferred because it is in a minimal cover?

    Definition at line 701 of file heur_nlpdiving.c.

    References FALSE, MAX, MIN, NULL, SCIP_Real, SCIPfeasFloor(), SCIPgetVarPseudocostVal(), SCIPisEQ(), SCIPisGT(), SCIPisLT(), SCIPrandomGetInt(), SCIPvarGetRootSol(), SCIPvarIsBinary(), and TRUE.

    Referenced by choosePscostVar().

    ◆ choosePscostVar()

    static SCIP_RETCODE choosePscostVar ( SCIP scip,
    SCIP_HEURDATA heurdata,
    SCIP_VAR **  nlpcands,
    SCIP_Real nlpcandssol,
    SCIP_Real nlpcandsfrac,
    int  nnlpcands,
    SCIP_HASHMAP varincover,
    SCIP_Bool  covercomputed,
    int *  bestcand,
    SCIP_Bool bestcandmayround,
    SCIP_Bool bestcandroundup 
    )
    static

    finds best candidate variable w.r.t. pseudo costs:

    • prefer variables that may not be rounded without destroying LP feasibility:
      • of these variables, round variable with largest rel. difference of pseudo cost values in corresponding direction
    • if all remaining fractional variables may be rounded without destroying LP feasibility:
      • round variable in the objective value direction
    • binary variables are prefered
    • variables in a minimal cover or variables that are also fractional in an optimal LP solution might also be prefered if a correpsonding parameter is set
    Parameters
    sciporiginal SCIP data structure
    heurdataheuristic data structure
    nlpcandsarray of NLP fractional variables
    nlpcandssolarray of NLP fractional variables solution values
    nlpcandsfracarray of NLP fractional variables fractionalities
    nnlpcandsnumber of NLP fractional variables
    varincoverhash map for variables
    covercomputedhas a minimal cover been computed?
    bestcandpointer to store the index of the best candidate variable
    bestcandmayroundpointer to store whether best candidate is trivially roundable
    bestcandrounduppointer to store whether best candidate should be rounded up

    Definition at line 781 of file heur_nlpdiving.c.

    References ABS, calcPscostQuot(), FALSE, NULL, SCIP_Bool, SCIP_INVALID, SCIP_OKAY, SCIP_Real, SCIPhashmapExists(), SCIPisGT(), SCIPisInfinity(), SCIPisLT(), SCIPvarGetLbLocal(), SCIPvarGetUbLocal(), SCIPvarMayRoundDown(), SCIPvarMayRoundUp(), and TRUE.

    Referenced by SCIP_DECL_HEUREXEC().

    ◆ chooseGuidedVar()

    static SCIP_RETCODE chooseGuidedVar ( SCIP scip,
    SCIP_HEURDATA heurdata,
    SCIP_VAR **  nlpcands,
    SCIP_Real nlpcandssol,
    SCIP_Real nlpcandsfrac,
    int  nnlpcands,
    SCIP_SOL bestsol,
    SCIP_HASHMAP varincover,
    SCIP_Bool  covercomputed,
    int *  bestcand,
    SCIP_Bool bestcandmayround,
    SCIP_Bool bestcandroundup 
    )
    static

    finds best candidate variable w.r.t. the incumbent solution:

    • prefer variables that may not be rounded without destroying LP feasibility:
      • of these variables, round a variable to its value in direction of incumbent solution, and choose the variable that is closest to its rounded value
    • if all remaining fractional variables may be rounded without destroying LP feasibility:
      • round variable in direction that destroys LP feasibility (other direction is checked by SCIProundSol())
      • round variable with least increasing objective value
    • binary variables are prefered
    • variables in a minimal cover or variables that are also fractional in an optimal LP solution might also be prefered if a correpsonding parameter is set
    Parameters
    sciporiginal SCIP data structure
    heurdataheuristic data structure
    nlpcandsarray of NLP fractional variables
    nlpcandssolarray of NLP fractional variables solution values
    nlpcandsfracarray of NLP fractional variables fractionalities
    nnlpcandsnumber of NLP fractional variables
    bestsolincumbent solution
    varincoverhash map for variables
    covercomputedhas a minimal cover been computed?
    bestcandpointer to store the index of the best candidate variable
    bestcandmayroundpointer to store whether best candidate is trivially roundable
    bestcandrounduppointer to store whether best candidate should be rounded up

    Definition at line 903 of file heur_nlpdiving.c.

    References FALSE, NULL, SCIP_Bool, SCIP_INVALID, SCIP_OKAY, SCIP_PROBINGSCORE_PENALTYRATIO, SCIP_Real, SCIPgetSolVal(), SCIPhashmapExists(), SCIPinfinity(), SCIPisEQ(), SCIPisGT(), SCIPisLT(), SCIPrandomGetInt(), SCIPvarGetLbLocal(), SCIPvarGetObj(), SCIPvarGetUbLocal(), SCIPvarIsBinary(), SCIPvarMayRoundDown(), SCIPvarMayRoundUp(), and TRUE.

    Referenced by SCIP_DECL_HEUREXEC().

    ◆ chooseDoubleVar()

    static SCIP_RETCODE chooseDoubleVar ( SCIP scip,
    SCIP_HEURDATA heurdata,
    SCIP_VAR **  pseudocands,
    SCIP_Real pseudocandsnlpsol,
    SCIP_Real pseudocandslpsol,
    int  npseudocands,
    SCIP_HASHMAP varincover,
    SCIP_Bool  covercomputed,
    int *  bestcand,
    SCIP_Real bestboundval,
    SCIP_Bool bestcandmayround,
    SCIP_Bool bestcandroundup 
    )
    static

    finds best candidate variable w.r.t. both, the LP and the NLP solution:

    • choose a variable for which the sum of the distances from the relaxations' solutions to a common integer value is minimal
    • binary variables are prefered
    • variables in a minimal cover might be prefered if a corresponding parameter is set
    Parameters
    sciporiginal SCIP data structure
    heurdataheuristic data structure
    pseudocandsarray of non-fixed variables
    pseudocandsnlpsolarray of NLP solution values
    pseudocandslpsolarray of LP solution values
    npseudocandsnumber of NLP fractional variables
    varincoverhash map for variables
    covercomputedhas a minimal cover been computed?
    bestcandpointer to store the index of the best candidate variable
    bestboundvalpointer to store the bound, the best candidate should be rounded to
    bestcandmayroundpointer to store whether best candidate is trivially roundable
    bestcandrounduppointer to store whether best candidate should be rounded up

    Definition at line 1075 of file heur_nlpdiving.c.

    References ABS, FALSE, MAX, MIN, NULL, SCIP_Bool, SCIP_INVALID, SCIP_OKAY, SCIP_PROBINGSCORE_PENALTYRATIO, SCIP_Real, SCIPfeasCeil(), SCIPfeasFloor(), SCIPhashmapExists(), SCIPisEQ(), SCIPisFeasEQ(), SCIPisFeasIntegral(), SCIPisGT(), SCIPisLE(), SCIPisLT(), SCIPrandomGetInt(), SCIPvarGetLbLocal(), SCIPvarGetUbLocal(), SCIPvarIsBinary(), SCIPvarMayRoundDown(), SCIPvarMayRoundUp(), and TRUE.

    Referenced by SCIP_DECL_HEUREXEC().

    ◆ createNewSol()

    static SCIP_RETCODE createNewSol ( SCIP scip,
    SCIP subscip,
    SCIP_HEUR heur,
    SCIP_HASHMAP varmap,
    SCIP_SOL subsol,
    SCIP_Bool success 
    )
    static

    creates a new solution for the original problem by copying the solution of the subproblem

    Parameters
    sciporiginal SCIP data structure
    subscipSCIP structure of the subproblem
    heurheuristic structure
    varmaphash map for variables
    subsolsolution of the subproblem
    successused to store whether new solution was found or not

    Definition at line 1226 of file heur_nlpdiving.c.

    References FALSE, MAX, MIN, NULL, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPallocBufferArray, SCIPcreateSol(), SCIPfreeBufferArray, SCIPgetSolVal(), SCIPgetVarsData(), SCIPhashmapGetImage(), SCIPsetSolVals(), SCIPtrySolFree(), SCIPvarGetLbLocal(), SCIPvarGetUbLocal(), and TRUE.

    Referenced by doSolveSubMIP().

    ◆ doSolveSubMIP()

    static SCIP_RETCODE doSolveSubMIP ( SCIP scip,
    SCIP subscip,
    SCIP_HEUR heur,
    SCIP_VAR **  covervars,
    int  ncovervars,
    SCIP_Bool success 
    )
    static

    ◆ solveSubMIP()

    static SCIP_RETCODE solveSubMIP ( SCIP scip,
    SCIP_HEUR heur,
    SCIP_VAR **  covervars,
    int  ncovervars,
    SCIP_Bool success 
    )
    static

    solves subproblem and passes best feasible solution to original SCIP instance

    Parameters
    scipSCIP data structure of the original problem
    heurheuristic data structure
    covervarsvariables in the cover, should be fixed locally
    ncovervarsnumber of variables in the cover
    successpointer to store whether a solution was found

    Definition at line 1412 of file heur_nlpdiving.c.

    References doSolveSubMIP(), SCIP_CALL, SCIP_OKAY, SCIPcheckCopyLimits(), SCIPcreate(), and SCIPfree().

    Referenced by SCIP_DECL_HEUREXEC().

    ◆ SCIP_DECL_EVENTEXEC()

    ◆ SCIP_DECL_HEURCOPY()

    static SCIP_DECL_HEURCOPY ( heurCopyNlpdiving  )
    static

    copy method for primal heuristic plugins (called when SCIP copies plugins)

    Definition at line 1514 of file heur_nlpdiving.c.

    References HEUR_NAME, NULL, SCIP_CALL, SCIP_OKAY, SCIPheurGetName(), and SCIPincludeHeurNlpdiving().

    ◆ SCIP_DECL_HEURFREE()

    static SCIP_DECL_HEURFREE ( heurFreeNlpdiving  )
    static

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

    Definition at line 1528 of file heur_nlpdiving.c.

    References HEUR_NAME, NULL, SCIP_OKAY, SCIPfreeBlockMemory, SCIPheurGetData(), SCIPheurGetName(), and SCIPheurSetData().

    ◆ SCIP_DECL_HEURINIT()

    static SCIP_DECL_HEURINIT ( heurInitNlpdiving  )
    static

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

    Definition at line 1548 of file heur_nlpdiving.c.

    References DEFAULT_RANDSEED, HEUR_NAME, NULL, SCIP_CALL, SCIP_OKAY, SCIPcreateRandom(), SCIPcreateSol(), SCIPheurGetData(), SCIPheurGetName(), SCIPstatistic, and TRUE.

    ◆ SCIP_DECL_HEUREXIT()

    static SCIP_DECL_HEUREXIT ( heurExitNlpdiving  )
    static

    ◆ SCIP_DECL_HEURINITSOL()

    static SCIP_DECL_HEURINITSOL ( heurInitsolNlpdiving  )
    static

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

    Definition at line 1616 of file heur_nlpdiving.c.

    References NULL, SCIP_HEURTIMING_NONE, SCIP_OKAY, SCIPgetNNlpis(), SCIPheurGetData(), SCIPheurGetTimingmask(), SCIPheurSetTimingmask(), and SCIPisNLPConstructed().

    ◆ SCIP_DECL_HEUREXITSOL()

    static SCIP_DECL_HEUREXITSOL ( heurExitsolNlpdiving  )
    static

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

    Definition at line 1639 of file heur_nlpdiving.c.

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

    ◆ SCIP_DECL_HEUREXEC()

    static SCIP_DECL_HEUREXEC ( heurExecNlpdiving  )
    static

    execution method of primal heuristic

    Definition at line 1658 of file heur_nlpdiving.c.

    References chooseCoefVar(), chooseDoubleVar(), chooseFracVar(), chooseGuidedVar(), choosePscostVar(), chooseVeclenVar(), FALSE, getNLPFracVars(), HEUR_NAME, MAX, MIN, MINNLPITER, SCIP_NlpStatistics::niterations, NULL, SCIP_Bool, SCIP_CALL, SCIP_DELAYED, SCIP_DIDNOTFIND, SCIP_DIDNOTRUN, SCIP_EVENTTYPE_BOUNDCHANGED, SCIP_FOUNDSOL, SCIP_INVALID, SCIP_INVALIDDATA, SCIP_Longint, SCIP_LONGINT_FORMAT, SCIP_LPSOLSTAT_INFEASIBLE, SCIP_LPSOLSTAT_NOTSOLVED, SCIP_LPSOLSTAT_OBJLIMIT, SCIP_LPSOLSTAT_OPTIMAL, SCIP_MAXTREEDEPTH, SCIP_NLPPARAM_FASTFAIL_AGGRESSIVE, SCIP_NLPPARAM_FASTFAIL_CONSERVATIVE, SCIP_NLPSOLSTAT_FEASIBLE, SCIP_NLPSOLSTAT_LOCINFEASIBLE, SCIP_NLPSOLSTAT_UNKNOWN, SCIP_NLPTERMSTAT_LICENSEERROR, SCIP_NLPTERMSTAT_NUMERICERROR, SCIP_OKAY, SCIP_Real, SCIP_VARTYPE_CONTINUOUS, SCIP_VERBLEVEL_MINIMAL, SCIPallocBufferArray, SCIPbacktrackProbing(), SCIPblkmem(), SCIPcatchVarEvent(), SCIPceil(), SCIPchgVarLbProbing(), SCIPchgVarUbProbing(), SCIPcomputeCoverUndercover(), SCIPcreateNLPSol(), SCIPcreateSolCopy(), SCIPdebugMsg, SCIPdebugMsgPrint, SCIPdropVarEvent(), SCIPenableVarHistory(), SCIPendProbing(), SCIPerrorMessage, SCIPfeasCeil(), SCIPfeasFloor(), SCIPfrac(), SCIPfreeBufferArray, SCIPfreeSol(), SCIPgetAvgLowerbound(), SCIPgetBestSol(), SCIPgetCutoffbound(), SCIPgetDepth(), SCIPgetDualbound(), SCIPgetLastDivenode(), SCIPgetLocalLowerbound(), SCIPgetLowerbound(), SCIPgetLPObjval(), SCIPgetLPSolstat(), SCIPgetMaxDepth(), SCIPgetMemExternEstim(), SCIPgetMemUsed(), SCIPgetNContImplVars(), SCIPgetNContVars(), SCIPgetNLPBranchCands(), SCIPgetNLPObjval(), SCIPgetNLPSolstat(), SCIPgetNLPStatistics(), SCIPgetNLPTermstat(), SCIPgetNNlpis(), SCIPgetNNodes(), SCIPgetNSols(), SCIPgetNSolsFound(), SCIPgetNVars(), SCIPgetProbingDepth(), SCIPgetPseudoBranchCands(), SCIPgetRealParam(), SCIPgetSolOrigObj(), SCIPgetSolVals(), SCIPgetSolvingTime(), SCIPgetUpperbound(), SCIPhashmapCreate(), SCIPhashmapExists(), SCIPhashmapFree(), SCIPhashmapInsertInt(), SCIPheurGetData(), SCIPheurGetName(), SCIPheurGetNBestSolsFound(), SCIPheurGetNCalls(), SCIPheurGetNSolsFound(), SCIPinfinity(), SCIPisFeasEQ(), SCIPisFeasGE(), SCIPisFeasGT(), SCIPisFeasIntegral(), SCIPisFeasLT(), SCIPisGT(), SCIPisInfinity(), SCIPisLbBetter(), SCIPisLPSolBasic(), SCIPisLT(), SCIPisNLPConstructed(), SCIPisObjIntegral(), SCIPisStopped(), SCIPisUbBetter(), SCIPlinkNLPSol(), SCIPnewProbingNode(), SCIPpropagateProbing(), SCIPretransformObj(), SCIProundSol(), SCIPsetNLPInitialGuessSol(), SCIPsolIsOriginal(), SCIPsolveNLP, SCIPsolveProbingLP(), SCIPstartProbing(), SCIPstatistic, SCIPtrySol(), SCIPunlinkSol(), SCIPupdateVarPseudocost(), SCIPvarGetLbLocal(), SCIPvarGetName(), SCIPvarGetNLPSol(), SCIPvarGetType(), SCIPvarGetUbLocal(), SCIPverbMessage(), solveSubMIP(), and TRUE.