SCIP

    Solving Constraint Integer Programs

    heur_conflictdiving.c
    Go to the documentation of this file.
    1/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
    2/* */
    3/* This file is part of the program and library */
    4/* SCIP --- Solving Constraint Integer Programs */
    5/* */
    6/* Copyright (c) 2002-2026 Zuse Institute Berlin (ZIB) */
    7/* */
    8/* Licensed under the Apache License, Version 2.0 (the "License"); */
    9/* you may not use this file except in compliance with the License. */
    10/* You may obtain a copy of the License at */
    11/* */
    12/* http://www.apache.org/licenses/LICENSE-2.0 */
    13/* */
    14/* Unless required by applicable law or agreed to in writing, software */
    15/* distributed under the License is distributed on an "AS IS" BASIS, */
    16/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
    17/* See the License for the specific language governing permissions and */
    18/* limitations under the License. */
    19/* */
    20/* You should have received a copy of the Apache-2.0 license */
    21/* along with SCIP; see the file LICENSE. If not visit scipopt.org. */
    22/* */
    23/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
    24
    25/**@file heur_conflictdiving.c
    26 * @ingroup DEFPLUGINS_HEUR
    27 * @brief LP diving heuristic that chooses fixings w.r.t. conflict locks
    28 * @author Jakob Witzig
    29 */
    30
    31/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
    32
    34#include "scip/heuristics.h"
    35#include "scip/pub_heur.h"
    36#include "scip/pub_message.h"
    37#include "scip/pub_misc.h"
    38#include "scip/pub_var.h"
    39#include "scip/scip_heur.h"
    40#include "scip/scip_mem.h"
    41#include "scip/scip_numerics.h"
    42#include "scip/scip_param.h"
    43#include "scip/scip_sol.h"
    45
    46
    47#define HEUR_NAME "conflictdiving"
    48#define HEUR_DESC "LP diving heuristic that chooses fixings w.r.t. conflict locks"
    49#define HEUR_DISPCHAR SCIP_HEURDISPCHAR_DIVING
    50#define HEUR_PRIORITY -1000100
    51#define HEUR_FREQ 10
    52#define HEUR_FREQOFS 0
    53#define HEUR_MAXDEPTH -1
    54#define HEUR_TIMING SCIP_HEURTIMING_AFTERLPPLUNGE
    55#define HEUR_USESSUBSCIP FALSE /**< does the heuristic use a secondary SCIP instance? */
    56#define DIVESET_DIVETYPES SCIP_DIVETYPE_INTEGRALITY | SCIP_DIVETYPE_SOS1VARIABLE /**< bit mask that represents all supported dive types */
    57#define DIVESET_ISPUBLIC FALSE /**< is this dive set publicly available (ie., can be used by other primal heuristics?) */
    58#define DEFAULT_RANDSEED 151 /**< default random seed */
    59
    60/*
    61 * Default parameter settings
    62 */
    63
    64#define DEFAULT_MINRELDEPTH 0.0 /**< minimal relative depth to start diving */
    65#define DEFAULT_MAXRELDEPTH 1.0 /**< maximal relative depth to start diving */
    66#define DEFAULT_MAXLPITERQUOT 0.05 /**< maximal fraction of diving LP iterations compared to node LP iterations */
    67#define DEFAULT_MAXLPITEROFS 1000 /**< additional number of allowed LP iterations */
    68#define DEFAULT_MAXDIVEUBQUOT 0.8 /**< maximal quotient (curlowerbound - lowerbound)/(cutoffbound - lowerbound)
    69 * where diving is performed (0.0: no limit) */
    70#define DEFAULT_MAXDIVEAVGQUOT 0.0 /**< maximal quotient (curlowerbound - lowerbound)/(avglowerbound - lowerbound)
    71 * where diving is performed (0.0: no limit) */
    72#define DEFAULT_MAXDIVEUBQUOTNOSOL 0.1 /**< maximal UBQUOT when no solution was found yet (0.0: no limit) */
    73#define DEFAULT_MAXDIVEAVGQUOTNOSOL 0.0 /**< maximal AVGQUOT when no solution was found yet (0.0: no limit) */
    74#define DEFAULT_BACKTRACK TRUE /**< use one level of backtracking if infeasibility is encountered? */
    75#define DEFAULT_LPRESOLVEDOMCHGQUOT 0.15/**< percentage of immediate domain changes during probing to trigger LP resolve */
    76#define DEFAULT_LPSOLVEFREQ 0 /**< LP solve frequency for diving heuristics */
    77#define DEFAULT_ONLYLPBRANCHCANDS FALSE /**< should only LP branching candidates be considered instead of the slower but
    78 * more general constraint handler diving variable selection? */
    79#define DEFAULT_LOCKWEIGHT 0.75 /**< weight used in a convex combination of conflict and variable locks */
    80#define DEFAULT_LIKECOEF FALSE /**< perform rounding like coefficient diving */
    81#define DEFAULT_MAXVIOL TRUE /**< prefer rounding direction with most violation */
    82#define DEFAULT_MINCONFLICTLOCKS 5 /**< threshold for penalizing the score */
    83
    84/* locally defined heuristic data */
    85struct SCIP_HeurData
    86{
    87 SCIP_SOL* sol; /**< working solution */
    88 SCIP_Real lockweight; /**< weight factor to combine conflict and variable locks */
    89 SCIP_Bool likecoefdiving; /**< use the same rounding strategy like coefficent diving */
    90 SCIP_Bool maxviol; /**< rounding into potentially infeasible direction */
    91 int minconflictlocks; /**< threshold for penalizing the score */
    92};
    93
    94/*
    95 * Callback methods
    96 */
    97
    98/** copy method for primal heuristic plugins (called when SCIP copies plugins) */
    99static
    100SCIP_DECL_HEURCOPY(heurCopyConflictdiving)
    101{ /*lint --e{715}*/
    102 assert(scip != NULL);
    103 assert(heur != NULL);
    104
    106
    107 /* call inclusion method of constraint handler */
    109
    110 return SCIP_OKAY;
    111}
    112
    113/** destructor of primal heuristic to free user data (called when SCIP is exiting) */
    114static
    115SCIP_DECL_HEURFREE(heurFreeConflictdiving) /*lint --e{715}*/
    116{ /*lint --e{715}*/
    117 SCIP_HEURDATA* heurdata;
    118
    119 assert(heur != NULL);
    120 assert(scip != NULL);
    121
    123
    124 /* free heuristic data */
    125 heurdata = SCIPheurGetData(heur);
    126 assert(heurdata != NULL);
    127
    128 SCIPfreeBlockMemory(scip, &heurdata);
    129 SCIPheurSetData(heur, NULL);
    130
    131 return SCIP_OKAY;
    132}
    133
    134
    135/** initialization method of primal heuristic (called after problem was transformed) */
    136static
    137SCIP_DECL_HEURINIT(heurInitConflictdiving) /*lint --e{715}*/
    138{ /*lint --e{715}*/
    139 SCIP_HEURDATA* heurdata;
    140
    141 assert(heur != NULL);
    142
    144
    145 /* get heuristic data */
    146 heurdata = SCIPheurGetData(heur);
    147 assert(heurdata != NULL);
    148
    149 /* create working solution */
    150 SCIP_CALL( SCIPcreateSol(scip, &heurdata->sol, heur) );
    151
    152 return SCIP_OKAY;
    153}
    154
    155
    156/** deinitialization method of primal heuristic (called before transformed problem is freed) */
    157static
    158SCIP_DECL_HEUREXIT(heurExitConflictdiving) /*lint --e{715}*/
    159{ /*lint --e{715}*/
    160 SCIP_HEURDATA* heurdata;
    161
    162 assert(heur != NULL);
    163
    165
    166 /* get heuristic data */
    167 heurdata = SCIPheurGetData(heur);
    168 assert(heurdata != NULL);
    169
    170 /* free working solution */
    171 SCIP_CALL( SCIPfreeSol(scip, &heurdata->sol) );
    172
    173 return SCIP_OKAY;
    174}
    175
    176/** execution method of primal heuristic */
    177static
    178SCIP_DECL_HEUREXEC(heurExecConflictdiving) /*lint --e{715}*/
    179{ /*lint --e{715}*/
    180 SCIP_HEURDATA* heurdata;
    181 SCIP_DIVESET* diveset;
    182
    183 heurdata = SCIPheurGetData(heur);
    184 assert(heurdata != NULL);
    185
    186 assert(SCIPheurGetNDivesets(heur) > 0);
    187 assert(SCIPheurGetDivesets(heur) != NULL);
    188 diveset = SCIPheurGetDivesets(heur)[0];
    189 assert(diveset != NULL);
    190
    191 *result = SCIP_DELAYED;
    192
    193 /* don't run if no conflict constraints where found */
    195 return SCIP_OKAY;
    196
    197 SCIP_CALL( SCIPperformGenericDivingAlgorithm(scip, diveset, heurdata->sol, heur, result, nodeinfeasible, -1L, -1, -1.0, SCIP_DIVECONTEXT_SINGLE) );
    198
    199 return SCIP_OKAY;
    200}
    201
    202#define MIN_RAND 1e-06
    203#define MAX_RAND 1e-05
    204
    205/** calculate score variant 1: use rounding strategy like coefficent diving */
    206static
    208 SCIP* scip, /**< SCIP data structure */
    209 SCIP_HEURDATA* heurdata, /**< heuristic data */
    210 SCIP_RANDNUMGEN* rng, /**< random number generator of the diveset */
    211 SCIP_DIVETYPE divetype, /**< divetype of the heuristic */
    212 SCIP_VAR* cand, /**< diving candidate */
    213 SCIP_Real candsol, /**< diving candidate solution */
    214 SCIP_Real candsfrac, /**< fractionality of the candidate solution */
    215 SCIP_Real* score, /**< pointer to store the score */
    216 SCIP_Bool* roundup /**< pointer to store whether the candidate should be rounded upwards */
    217 )
    218{
    219 SCIP_Real upweight;
    220 SCIP_Real downweight;
    221 SCIP_Bool mayrounddown;
    222 SCIP_Bool mayroundup;
    223 int nconflictlocksdown;
    224 int nconflictlocksup;
    225 int nlocksdown;
    226 int nlocksup;
    227
    228 /* get conflict locks */
    229 nconflictlocksup = SCIPvarGetNLocksUpType(cand, SCIP_LOCKTYPE_CONFLICT);
    230 nconflictlocksdown = SCIPvarGetNLocksDownType(cand, SCIP_LOCKTYPE_CONFLICT);
    231
    232 /* get variable locks */
    235
    236 /* combine conflict and variable locks */
    237 upweight = heurdata->lockweight * nconflictlocksup + (1.0 - heurdata->lockweight) * nlocksup;
    238 downweight = heurdata->lockweight * nconflictlocksdown + (1.0 - heurdata->lockweight) * nlocksdown;
    239
    240 /* check whether there exists a direction w/o any locks */
    241 mayrounddown = SCIPisZero(scip, upweight);
    242 mayroundup = SCIPisZero(scip, downweight);
    243
    244 if( mayrounddown || mayroundup )
    245 {
    246 /* choose rounding direction:
    247 * - if variable may be rounded in both directions, round corresponding to the fractionality
    248 * - otherwise, round in the infeasible direction
    249 */
    250 if( mayrounddown && mayroundup )
    251 {
    252 assert(divetype != SCIP_DIVETYPE_SOS1VARIABLE || heurdata->lockweight > 0);
    253
    254 /* try to avoid variability; decide randomly if the LP solution can contain some noise */
    255 if( SCIPisEQ(scip, candsfrac, 0.5) )
    256 *roundup = (SCIPrandomGetInt(rng, 0, 1) == 0);
    257 else
    258 *roundup = (candsfrac > 0.5);
    259 }
    260 else
    261 *roundup = mayrounddown;
    262 }
    263 else
    264 {
    265 /* the candidate may not be rounded */
    266 *roundup = (SCIPisGT(scip, downweight, upweight) || (SCIPisEQ(scip, downweight, upweight) && candsfrac > 0.5));
    267 }
    268
    269 if( *roundup )
    270 {
    271 switch( divetype )
    272 {
    274 candsfrac = 1.0 - candsfrac;
    275 break;
    277 if( SCIPisFeasPositive(scip, candsol) )
    278 candsfrac = 1.0 - candsfrac;
    279 break;
    280 default:
    281 SCIPerrorMessage("Error: Unsupported diving type\n");
    282 SCIPABORT();
    283 return SCIP_INVALIDDATA; /*lint !e527*/
    284 } /*lint !e788*/
    285
    286 /* add some noise to avoid ties */
    287 *score = upweight + SCIPrandomGetReal(rng, MIN_RAND, MAX_RAND);
    288 }
    289 else
    290 {
    291 if( divetype == SCIP_DIVETYPE_SOS1VARIABLE && SCIPisFeasNegative(scip, candsol) )
    292 candsfrac = 1.0 - candsfrac;
    293
    294 /* add some noise to avoid ties */
    295 *score = downweight + SCIPrandomGetReal(rng, MIN_RAND, MAX_RAND);
    296 }
    297
    298 /* penalize too small fractions */
    299 if( SCIPisEQ(scip, candsfrac, 0.01) )
    300 {
    301 /* try to avoid variability; decide randomly if the LP solution can contain some noise.
    302 * use a 1:SCIP_PROBINGSCORE_PENALTYRATIO chance for scaling the score
    303 */
    305 (*score) *= 0.01;
    306 }
    307 else if( candsfrac < 0.01 )
    308 (*score) *= 0.1;
    309
    310 /* prefer decisions on binary variables */
    311 if( !SCIPvarIsBinary(cand) )
    312 *score = -1.0 / *score;
    313
    314 return SCIP_OKAY;
    315}
    316
    317/** calculate score variant 2: use a rounding strategy that tends towards infeasibility */
    318static
    320 SCIP* scip, /**< SCIP data structure */
    321 SCIP_HEURDATA* heurdata, /**< heuristic data */
    322 SCIP_RANDNUMGEN* rng, /**< random number generator of the diveset */
    323 SCIP_DIVETYPE divetype, /**< divetype of the heuristic */
    324 SCIP_VAR* cand, /**< diving candidate */
    325 SCIP_Real candsol, /**< diving candidate solution */
    326 SCIP_Real candsfrac, /**< fractionality of the candidate solution */
    327 SCIP_Real* score, /**< pointer to store the score */
    328 SCIP_Bool* roundup /**< pointer to store whether the candidate should be rounded upwards */
    329 )
    330{
    331 SCIP_Real conflictlocksum;
    332 SCIP_Real upweight;
    333 SCIP_Real downweight;
    334 SCIP_Bool mayrounddown;
    335 SCIP_Bool mayroundup;
    336 int nlocksup;
    337 int nlocksdown;
    338 int nconflictlocksup;
    339 int nconflictlocksdown;
    340
    341 assert(scip != NULL);
    342 assert(heurdata != NULL);
    343 assert(rng != NULL);
    344
    345 /* get conflict locks */
    346 nconflictlocksup = SCIPvarGetNLocksUpType(cand, SCIP_LOCKTYPE_CONFLICT);
    347 nconflictlocksdown = SCIPvarGetNLocksDownType(cand, SCIP_LOCKTYPE_CONFLICT);
    348 conflictlocksum = nconflictlocksup + nconflictlocksdown;
    349
    350 /* get variable locks */
    353
    354 /* combine conflict and variable locks */
    355 upweight = heurdata->lockweight * nconflictlocksup + (1.0 - heurdata->lockweight) * nlocksup;
    356 downweight = heurdata->lockweight * nconflictlocksdown + (1.0 - heurdata->lockweight) * nlocksdown;
    357
    358 /* check whether there exists a rounding direction w/o any locks */
    359 mayrounddown = SCIPisZero(scip, upweight);
    360 mayroundup = SCIPisZero(scip, downweight);
    361
    362 /* variable can be rounded in exactly one direction and we try to go into the feasible direction */
    363 if( mayrounddown || mayroundup )
    364 {
    365 /* choose rounding direction:
    366 * - if variable may be rounded in both directions, round corresponding to the fractionality
    367 * - otherwise, round in the feasible direction
    368 */
    369 if( mayrounddown && mayroundup )
    370 {
    371 assert(divetype != SCIP_DIVETYPE_SOS1VARIABLE || heurdata->lockweight > 0);
    372
    373 /* try to avoid variability; decide randomly if the LP solution can contain some noise */
    374 if( SCIPisEQ(scip, candsfrac, 0.5) )
    375 *roundup = (SCIPrandomGetInt(rng, 0, 1) == 0);
    376 else
    377 *roundup = (candsfrac > 0.5);
    378 }
    379 else
    380 *roundup = mayroundup;
    381 }
    382 else
    383 {
    384 assert(!mayrounddown);
    385
    386 /* both rounding directions have a different amount of locks */
    387 if( !SCIPisEQ(scip, upweight, downweight) )
    388 {
    389 *roundup = (heurdata->maxviol ? SCIPisGT(scip, upweight, downweight) : SCIPisLT(scip, upweight, downweight));
    390 }
    391 /* break ties with lp fractionality != 0.5 */
    392 else if( !SCIPisEQ(scip, candsfrac, 0.5) )
    393 {
    394 *roundup = (candsfrac > 0.5);
    395 }
    396 /* break tie randomly */
    397 else
    398 {
    399 *roundup = (SCIPrandomGetInt(rng, 0, 1) == 1);
    400 }
    401 }
    402
    403 if( *roundup )
    404 {
    405 switch( divetype )
    406 {
    408 candsfrac = 1.0 - candsfrac;
    409 break;
    411 if( SCIPisFeasPositive(scip, candsol) )
    412 candsfrac = 1.0 - candsfrac;
    413 break;
    414 default:
    415 SCIPerrorMessage("Error: Unsupported diving type\n");
    416 SCIPABORT();
    417 return SCIP_INVALIDDATA; /*lint !e527*/
    418 } /*lint !e788*/
    419
    420 /* add some noise to avoid ties */
    421 *score = upweight + SCIPrandomGetReal(rng, MIN_RAND, MAX_RAND);
    422 }
    423 else
    424 {
    425 if( divetype == SCIP_DIVETYPE_SOS1VARIABLE && SCIPisFeasNegative(scip, candsol) )
    426 candsfrac = 1.0 - candsfrac;
    427
    428 /* add some noise to avoid ties */
    429 *score = downweight + SCIPrandomGetReal(rng, MIN_RAND, MAX_RAND);
    430 }
    431
    432 /* penalize too few conflict locks */
    433 if( conflictlocksum > 0 && conflictlocksum < heurdata->minconflictlocks )
    434 (*score) *= 0.1;
    435
    436 /* penalize if no conflict locks exist at all */
    437 if( conflictlocksum == 0 )
    438 (*score) *= 0.01;
    439
    440 /* penalize too small fractions */
    441 if( SCIPisEQ(scip, candsfrac, 0.01) )
    442 {
    443 /* try to avoid variability; decide randomly if the LP solution can contain some noise.
    444 * use a 1:SCIP_PROBINGSCORE_PENALTYRATIO chance for scaling the score
    445 */
    447 (*score) *= 0.01;
    448 }
    449 else if( candsfrac < 0.01 )
    450 (*score) *= 0.01;
    451
    452 /* prefer decisions on binary variables */
    453 if( !SCIPvarIsBinary(cand) )
    454 *score = -1.0 / *score;
    455
    456 return SCIP_OKAY;
    457}
    458
    459
    460/** returns a score for the given candidate -- the best candidate maximizes the diving score */
    461static
    462SCIP_DECL_DIVESETGETSCORE(divesetGetScoreConflictdiving)
    463{
    464 SCIP_HEUR* heur;
    465 SCIP_HEURDATA* heurdata;
    466 SCIP_RANDNUMGEN* rng;
    467
    468 rng = SCIPdivesetGetRandnumgen(diveset);
    469 assert(rng != NULL);
    470
    471 heur = SCIPdivesetGetHeur(diveset);
    472 assert(heur != NULL);
    473
    474 heurdata = SCIPheurGetData(heur);
    475 assert(heurdata != NULL);
    476
    477 if( heurdata->likecoefdiving )
    478 {
    479 SCIP_CALL( getScoreLikeCoefdiving(scip, heurdata, rng, divetype, cand, candsol, candsfrac, score, roundup) );
    480 }
    481 else
    482 {
    483 SCIP_CALL( getScore(scip, heurdata, rng, divetype, cand, candsol, candsfrac, score, roundup) );
    484 }
    485
    486 /* check, if candidate is new best candidate: prefer unroundable candidates in any case */
    487 assert( (0.0 < candsfrac && candsfrac < 1.0) || SCIPvarIsBinary(cand) || divetype == SCIP_DIVETYPE_SOS1VARIABLE );
    488
    489 return SCIP_OKAY;
    490}
    491
    492/*
    493 * heuristic specific interface methods
    494 */
    495
    496#define divesetAvailableConflictdiving NULL
    497
    498/** creates the conflictdiving heuristic and includes it in SCIP */
    500 SCIP* scip /**< SCIP data structure */
    501 )
    502{
    503 SCIP_HEURDATA* heurdata;
    504 SCIP_HEUR* heur;
    505
    506 /* create conflictdiving primal heuristic data */
    507 SCIP_CALL( SCIPallocBlockMemory(scip, &heurdata) );
    508
    509 /* include primal heuristic */
    511 HEUR_FREQOFS, HEUR_MAXDEPTH, HEUR_TIMING, HEUR_USESSUBSCIP, heurExecConflictdiving, heurdata) );
    512
    513 assert(heur != NULL);
    514
    515 /* primal heuristic is safe to use in exact solving mode */
    516 SCIPheurMarkExact(heur);
    517
    518 /* set non-NULL pointers to callback methods */
    519 SCIP_CALL( SCIPsetHeurCopy(scip, heur, heurCopyConflictdiving) );
    520 SCIP_CALL( SCIPsetHeurFree(scip, heur, heurFreeConflictdiving) );
    521 SCIP_CALL( SCIPsetHeurInit(scip, heur, heurInitConflictdiving) );
    522 SCIP_CALL( SCIPsetHeurExit(scip, heur, heurExitConflictdiving) );
    523
    524 /* create a diveset (this will automatically install some additional parameters for the heuristic)*/
    528 DIVESET_ISPUBLIC, DIVESET_DIVETYPES, divesetGetScoreConflictdiving, divesetAvailableConflictdiving) );
    529
    530 SCIP_CALL( SCIPaddBoolParam(scip, "heuristics/" HEUR_NAME "/maxviol", "try to maximize the violation",
    531 &heurdata->maxviol, TRUE, DEFAULT_MAXVIOL, NULL, NULL) );
    532
    533 SCIP_CALL( SCIPaddBoolParam(scip, "heuristics/" HEUR_NAME "/likecoef",
    534 "perform rounding like coefficient diving",
    535 &heurdata->likecoefdiving, TRUE, DEFAULT_LIKECOEF, NULL, NULL) );
    536
    537 SCIP_CALL( SCIPaddIntParam(scip, "heuristics/" HEUR_NAME "/minconflictlocks",
    538 "minimal number of conflict locks per variable",
    539 &heurdata->minconflictlocks, TRUE, DEFAULT_MINCONFLICTLOCKS, 0, INT_MAX, NULL, NULL) );
    540
    541 SCIP_CALL( SCIPaddRealParam(scip, "heuristics/" HEUR_NAME "/lockweight",
    542 "weight used in a convex combination of conflict and variable locks",
    543 &heurdata->lockweight, TRUE, DEFAULT_LOCKWEIGHT, 0.0, 1.0, NULL, NULL) );
    544
    545 return SCIP_OKAY;
    546}
    #define NULL
    Definition: def.h:257
    #define SCIP_PROBINGSCORE_PENALTYRATIO
    Definition: def.h:312
    #define SCIP_Bool
    Definition: def.h:100
    #define SCIP_STRINGEQ(name, reference, retcode)
    Definition: def.h:454
    #define SCIP_Real
    Definition: def.h:165
    #define TRUE
    Definition: def.h:102
    #define SCIPABORT()
    Definition: def.h:336
    #define SCIP_CALL(x)
    Definition: def.h:364
    SCIP_RETCODE SCIPaddIntParam(SCIP *scip, const char *name, const char *desc, int *valueptr, SCIP_Bool isadvanced, int defaultvalue, int minvalue, int maxvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
    Definition: scip_param.c:83
    SCIP_RETCODE SCIPaddRealParam(SCIP *scip, const char *name, const char *desc, SCIP_Real *valueptr, SCIP_Bool isadvanced, SCIP_Real defaultvalue, SCIP_Real minvalue, SCIP_Real maxvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
    Definition: scip_param.c:139
    SCIP_RETCODE SCIPaddBoolParam(SCIP *scip, const char *name, const char *desc, SCIP_Bool *valueptr, SCIP_Bool isadvanced, SCIP_Bool defaultvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
    Definition: scip_param.c:57
    SCIP_RETCODE SCIPcreateDiveset(SCIP *scip, SCIP_DIVESET **diveset, SCIP_HEUR *heur, const char *name, SCIP_Real minreldepth, SCIP_Real maxreldepth, SCIP_Real maxlpiterquot, SCIP_Real maxdiveubquot, SCIP_Real maxdiveavgquot, SCIP_Real maxdiveubquotnosol, SCIP_Real maxdiveavgquotnosol, SCIP_Real lpresolvedomchgquot, int lpsolvefreq, int maxlpiterofs, unsigned int initialseed, SCIP_Bool backtrack, SCIP_Bool onlylpbranchcands, SCIP_Bool ispublic, SCIP_Bool specificsos1score, SCIP_DECL_DIVESETGETSCORE((*divesetgetscore)), SCIP_DECL_DIVESETAVAILABLE((*divesetavailable)))
    Definition: scip_heur.c:323
    SCIP_RANDNUMGEN * SCIPdivesetGetRandnumgen(SCIP_DIVESET *diveset)
    Definition: heur.c:720
    SCIP_RETCODE SCIPsetHeurCopy(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEURCOPY((*heurcopy)))
    Definition: scip_heur.c:167
    SCIP_HEURDATA * SCIPheurGetData(SCIP_HEUR *heur)
    Definition: heur.c:1368
    SCIP_RETCODE SCIPincludeHeurBasic(SCIP *scip, SCIP_HEUR **heur, const char *name, const char *desc, char dispchar, int priority, int freq, int freqofs, int maxdepth, SCIP_HEURTIMING timingmask, SCIP_Bool usessubscip, SCIP_DECL_HEUREXEC((*heurexec)), SCIP_HEURDATA *heurdata)
    Definition: scip_heur.c:122
    SCIP_RETCODE SCIPsetHeurFree(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEURFREE((*heurfree)))
    Definition: scip_heur.c:183
    SCIP_RETCODE SCIPsetHeurExit(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEUREXIT((*heurexit)))
    Definition: scip_heur.c:215
    int SCIPheurGetNDivesets(SCIP_HEUR *heur)
    Definition: heur.c:1675
    void SCIPheurMarkExact(SCIP_HEUR *heur)
    Definition: heur.c:1457
    SCIP_RETCODE SCIPsetHeurInit(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEURINIT((*heurinit)))
    Definition: scip_heur.c:199
    const char * SCIPheurGetName(SCIP_HEUR *heur)
    Definition: heur.c:1467
    SCIP_DIVESET ** SCIPheurGetDivesets(SCIP_HEUR *heur)
    Definition: heur.c:1665
    void SCIPheurSetData(SCIP_HEUR *heur, SCIP_HEURDATA *heurdata)
    Definition: heur.c:1378
    #define SCIPfreeBlockMemory(scip, ptr)
    Definition: scip_mem.h:108
    #define SCIPallocBlockMemory(scip, ptr)
    Definition: scip_mem.h:89
    SCIP_RETCODE SCIPcreateSol(SCIP *scip, SCIP_SOL **sol, SCIP_HEUR *heur)
    Definition: scip_sol.c:514
    SCIP_RETCODE SCIPfreeSol(SCIP *scip, SCIP_SOL **sol)
    Definition: scip_sol.c:1250
    SCIP_Longint SCIPgetNConflictConssFound(SCIP *scip)
    SCIP_RETCODE SCIPperformGenericDivingAlgorithm(SCIP *scip, SCIP_DIVESET *diveset, SCIP_SOL *worksol, SCIP_HEUR *heur, SCIP_RESULT *result, SCIP_Bool nodeinfeasible, SCIP_Longint iterlim, int nodelimit, SCIP_Real lpresolvedomchgquot, SCIP_DIVECONTEXT divecontext)
    Definition: heuristics.c:221
    SCIP_Bool SCIPisFeasNegative(SCIP *scip, SCIP_Real val)
    SCIP_Bool SCIPisGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
    SCIP_Bool SCIPisEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
    SCIP_Bool SCIPisZero(SCIP *scip, SCIP_Real val)
    SCIP_Bool SCIPisLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
    SCIP_Bool SCIPisFeasPositive(SCIP *scip, SCIP_Real val)
    SCIP_Bool SCIPvarIsBinary(SCIP_VAR *var)
    Definition: var.c:23510
    int SCIPvarGetNLocksUpType(SCIP_VAR *var, SCIP_LOCKTYPE locktype)
    Definition: var.c:4380
    int SCIPvarGetNLocksDownType(SCIP_VAR *var, SCIP_LOCKTYPE locktype)
    Definition: var.c:4322
    SCIP_Real SCIPrandomGetReal(SCIP_RANDNUMGEN *randnumgen, SCIP_Real minrandval, SCIP_Real maxrandval)
    Definition: misc.c:10245
    int SCIPrandomGetInt(SCIP_RANDNUMGEN *randnumgen, int minrandval, int maxrandval)
    Definition: misc.c:10223
    SCIP_HEUR * SCIPdivesetGetHeur(SCIP_DIVESET *diveset)
    Definition: heur.c:416
    #define DEFAULT_ONLYLPBRANCHCANDS
    #define DEFAULT_MAXDIVEUBQUOT
    #define DEFAULT_LPRESOLVEDOMCHGQUOT
    static SCIP_DECL_HEUREXIT(heurExitConflictdiving)
    static SCIP_DECL_HEUREXEC(heurExecConflictdiving)
    #define divesetAvailableConflictdiving
    #define HEUR_TIMING
    static SCIP_RETCODE getScore(SCIP *scip, SCIP_HEURDATA *heurdata, SCIP_RANDNUMGEN *rng, SCIP_DIVETYPE divetype, SCIP_VAR *cand, SCIP_Real candsol, SCIP_Real candsfrac, SCIP_Real *score, SCIP_Bool *roundup)
    #define DEFAULT_MAXLPITERQUOT
    #define HEUR_FREQOFS
    #define HEUR_DESC
    #define DEFAULT_MAXVIOL
    static SCIP_DECL_HEURFREE(heurFreeConflictdiving)
    #define DEFAULT_MAXDIVEAVGQUOT
    #define DEFAULT_LPSOLVEFREQ
    #define DEFAULT_BACKTRACK
    #define DEFAULT_MAXDIVEUBQUOTNOSOL
    #define HEUR_DISPCHAR
    #define HEUR_MAXDEPTH
    #define HEUR_PRIORITY
    #define DEFAULT_MAXRELDEPTH
    #define DEFAULT_MAXLPITEROFS
    #define DEFAULT_MAXDIVEAVGQUOTNOSOL
    #define HEUR_NAME
    static SCIP_DECL_HEURINIT(heurInitConflictdiving)
    SCIP_RETCODE SCIPincludeHeurConflictdiving(SCIP *scip)
    #define DEFAULT_LIKECOEF
    static SCIP_DECL_HEURCOPY(heurCopyConflictdiving)
    #define MAX_RAND
    #define DEFAULT_RANDSEED
    #define DEFAULT_LOCKWEIGHT
    #define DEFAULT_MINCONFLICTLOCKS
    #define DIVESET_DIVETYPES
    #define DIVESET_ISPUBLIC
    #define HEUR_FREQ
    #define MIN_RAND
    #define DEFAULT_MINRELDEPTH
    static SCIP_RETCODE getScoreLikeCoefdiving(SCIP *scip, SCIP_HEURDATA *heurdata, SCIP_RANDNUMGEN *rng, SCIP_DIVETYPE divetype, SCIP_VAR *cand, SCIP_Real candsol, SCIP_Real candsfrac, SCIP_Real *score, SCIP_Bool *roundup)
    #define HEUR_USESSUBSCIP
    static SCIP_DECL_DIVESETGETSCORE(divesetGetScoreConflictdiving)
    LP diving heuristic that chooses fixings w.r.t. conflict locks.
    methods commonly used by primal heuristics
    public methods for primal heuristics
    public methods for message output
    #define SCIPerrorMessage
    Definition: pub_message.h:64
    public data structures and miscellaneous methods
    public methods for problem variables
    public methods for primal heuristic plugins and divesets
    public methods for memory management
    public methods for numerical tolerances
    public methods for SCIP parameter handling
    public methods for solutions
    public methods for querying solving statistics
    SCIP_SOL * sol
    Definition: struct_heur.h:71
    struct SCIP_HeurData SCIP_HEURDATA
    Definition: type_heur.h:77
    unsigned int SCIP_DIVETYPE
    Definition: type_heur.h:63
    #define SCIP_DIVETYPE_SOS1VARIABLE
    Definition: type_heur.h:61
    #define SCIP_DIVETYPE_INTEGRALITY
    Definition: type_heur.h:60
    @ SCIP_DIVECONTEXT_SINGLE
    Definition: type_heur.h:69
    @ SCIP_DELAYED
    Definition: type_result.h:43
    @ SCIP_INVALIDDATA
    Definition: type_retcode.h:52
    @ SCIP_OKAY
    Definition: type_retcode.h:42
    @ SCIP_INVALIDCALL
    Definition: type_retcode.h:51
    enum SCIP_Retcode SCIP_RETCODE
    Definition: type_retcode.h:63
    @ SCIP_LOCKTYPE_CONFLICT
    Definition: type_var.h:142
    @ SCIP_LOCKTYPE_MODEL
    Definition: type_var.h:141