Scippy

    SCIP

    Solving Constraint Integer Programs

    prop.h
    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-2025 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 prop.h
    26 * @ingroup INTERNALAPI
    27 * @brief internal methods for propagators
    28 * @author Tobias Achterberg
    29 */
    30
    31/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
    32
    33#ifndef __SCIP_PROP_H__
    34#define __SCIP_PROP_H__
    35
    36
    37#include "scip/def.h"
    39#include "scip/type_retcode.h"
    40#include "scip/type_result.h"
    41#include "scip/type_set.h"
    42#include "scip/type_stat.h"
    43#include "scip/type_lp.h"
    44#include "scip/type_message.h"
    45#include "scip/type_var.h"
    46#include "scip/type_prop.h"
    47#include "scip/pub_prop.h"
    48
    49#ifdef __cplusplus
    50extern "C" {
    51#endif
    52
    53/** copies the given propagator to a new scip */
    55 SCIP_PROP* prop, /**< propagator */
    56 SCIP_SET* set /**< SCIP_SET of SCIP to copy to */
    57 );
    58
    59/** creates a propagator */
    61 SCIP_PROP** prop, /**< pointer to propagator data structure */
    62 SCIP_SET* set, /**< global SCIP settings */
    63 SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
    64 BMS_BLKMEM* blkmem, /**< block memory for parameter settings */
    65 const char* name, /**< name of propagator */
    66 const char* desc, /**< description of propagator */
    67 int priority, /**< priority of propagator (>= 0: before, < 0: after constraint handlers) */
    68 int freq, /**< frequency for calling propagator */
    69 SCIP_Bool delay, /**< should propagator be delayed, if other propagators found reductions? */
    70 SCIP_PROPTIMING timingmask, /**< positions in the node solving loop where propagator should be executed */
    71 int presolpriority, /**< priority of the propagator (>= 0: before, < 0: after constraint handlers) */
    72 int presolmaxrounds, /**< maximal number of presolving rounds the propagator participates in (-1: no limit) */
    73 SCIP_PRESOLTIMING presoltiming, /**< timing mask of the propagator's presolving method */
    74 SCIP_DECL_PROPCOPY ((*propcopy)), /**< copy method of propagator or NULL if you don't want to copy your plugin into sub-SCIPs */
    75 SCIP_DECL_PROPFREE ((*propfree)), /**< destructor of propagator */
    76 SCIP_DECL_PROPINIT ((*propinit)), /**< initialize propagator */
    77 SCIP_DECL_PROPEXIT ((*propexit)), /**< deinitialize propagator */
    78 SCIP_DECL_PROPINITPRE ((*propinitpre)), /**< presolving initialization method of propagator */
    79 SCIP_DECL_PROPEXITPRE ((*propexitpre)), /**< presolving deinitialization method of propagator */
    80 SCIP_DECL_PROPINITSOL ((*propinitsol)), /**< solving process initialization method of propagator */
    81 SCIP_DECL_PROPEXITSOL ((*propexitsol)), /**< solving process deinitialization method of propagator */
    82 SCIP_DECL_PROPPRESOL ((*proppresol)), /**< presolving method */
    83 SCIP_DECL_PROPEXEC ((*propexec)), /**< execution method of propagator */
    84 SCIP_DECL_PROPRESPROP ((*propresprop)), /**< propagation conflict resolving method */
    85 SCIP_PROPDATA* propdata /**< propagator data */
    86 );
    87
    88/** calls destructor and frees memory of propagator */
    90 SCIP_PROP** prop, /**< pointer to propagator data structure */
    91 SCIP_SET* set /**< global SCIP settings */
    92 );
    93
    94/** initializes propagator */
    96 SCIP_PROP* prop, /**< propagator */
    97 SCIP_SET* set /**< global SCIP settings */
    98 );
    99
    100/** calls exit method of propagator */
    102 SCIP_PROP* prop, /**< propagator */
    103 SCIP_SET* set /**< global SCIP settings */
    104 );
    105
    106/** informs propagator that the presolving process is being started */
    108 SCIP_PROP* prop, /**< propagator */
    109 SCIP_SET* set /**< global SCIP settings */
    110 );
    111
    112/** informs propagator that the presolving is finished */
    114 SCIP_PROP* prop, /**< propagator */
    115 SCIP_SET* set /**< global SCIP settings */
    116 );
    117
    118/** informs propagator that the branch and bound process is being started */
    120 SCIP_PROP* prop, /**< propagator */
    121 SCIP_SET* set /**< global SCIP settings */
    122 );
    123
    124/** informs propagator that the branch and bound process data is being freed */
    126 SCIP_PROP* prop, /**< propagator */
    127 SCIP_SET* set, /**< global SCIP settings */
    128 SCIP_Bool restart /**< was this exit solve call triggered by a restart? */
    129 );
    130
    131/** executes presolving method of propagator */
    133 SCIP_PROP* prop, /**< propagator */
    134 SCIP_SET* set, /**< global SCIP settings */
    135 SCIP_PRESOLTIMING timing, /**< current presolving timing */
    136 int nrounds, /**< number of presolving rounds already done */
    137 int* nfixedvars, /**< pointer to total number of variables fixed of all presolvers */
    138 int* naggrvars, /**< pointer to total number of variables aggregated of all presolvers */
    139 int* nchgvartypes, /**< pointer to total number of variable type changes of all presolvers */
    140 int* nchgbds, /**< pointer to total number of variable bounds tightened of all presolvers */
    141 int* naddholes, /**< pointer to total number of domain holes added of all presolvers */
    142 int* ndelconss, /**< pointer to total number of deleted constraints of all presolvers */
    143 int* naddconss, /**< pointer to total number of added constraints of all presolvers */
    144 int* nupgdconss, /**< pointer to total number of upgraded constraints of all presolvers */
    145 int* nchgcoefs, /**< pointer to total number of changed coefficients of all presolvers */
    146 int* nchgsides, /**< pointer to total number of changed left/right hand sides of all presolvers */
    147 SCIP_RESULT* result /**< pointer to store the result of the callback method */
    148 );
    149
    150/** calls execution method of propagator */
    152 SCIP_PROP* prop, /**< propagator */
    153 SCIP_SET* set, /**< global SCIP settings */
    154 SCIP_STAT* stat, /**< dynamic problem statistics */
    155 int depth, /**< depth of current node */
    156 SCIP_Bool execdelayed, /**< execute propagator even if it is marked to be delayed */
    157 SCIP_Bool instrongbranching, /**< are we currently doing strong branching? */
    158 SCIP_PROPTIMING proptiming, /**< current point in the node solving process */
    159 SCIP_RESULT* result /**< pointer to store the result of the callback method */
    160 );
    161
    162/** resolves the given conflicting bound, that was deduced by the given propagator, by putting all "reason" bounds
    163 * leading to the deduction into the conflict queue with calls to SCIPaddConflictLb(), SCIPaddConflictUb(), SCIPaddConflictBd(),
    164 * SCIPaddConflictRelaxedLb(), SCIPaddConflictRelaxedUb(), SCIPaddConflictRelaxedBd(), or SCIPaddConflictBinvar();
    165 *
    166 * @note it is sufficient to explain the relaxed bound change
    167 */
    169 SCIP_PROP* prop, /**< propagator */
    170 SCIP_SET* set, /**< global SCIP settings */
    171 SCIP_VAR* infervar, /**< variable whose bound was deduced by the constraint */
    172 int inferinfo, /**< user inference information attached to the bound change */
    173 SCIP_BOUNDTYPE inferboundtype, /**< bound that was deduced (lower or upper bound) */
    174 SCIP_BDCHGIDX* bdchgidx, /**< bound change index, representing the point of time where change took place */
    175 SCIP_Real relaxedbd, /**< the relaxed bound */
    176 SCIP_RESULT* result /**< pointer to store the result of the callback method */
    177 );
    178
    179/** sets priority of propagator */
    181 SCIP_PROP* prop, /**< propagator */
    182 SCIP_SET* set, /**< global SCIP settings */
    183 int priority /**< new priority of the propagator */
    184 );
    185
    186/** sets presolving priority of propagator */
    188 SCIP_PROP* prop, /**< propagator */
    189 SCIP_SET* set, /**< global SCIP settings */
    190 int presolpriority /**< new priority of the propagator */
    191 );
    192
    193/** sets copy method of propagator */
    194void SCIPpropSetCopy(
    195 SCIP_PROP* prop, /**< propagator */
    196 SCIP_DECL_PROPCOPY ((*propcopy)) /**< copy method of propagator or NULL if you don't want to copy your plugin into sub-SCIPs */
    197 );
    198
    199/** sets destructor method of propagator */
    200void SCIPpropSetFree(
    201 SCIP_PROP* prop, /**< propagator */
    202 SCIP_DECL_PROPFREE ((*propfree)) /**< destructor of propagator */
    203 );
    204
    205/** sets initialization method of propagator */
    206void SCIPpropSetInit(
    207 SCIP_PROP* prop, /**< propagator */
    208 SCIP_DECL_PROPINIT ((*propinit)) /**< initialize propagator */
    209 );
    210
    211/** sets deinitialization method of propagator */
    212void SCIPpropSetExit(
    213 SCIP_PROP* prop, /**< propagator */
    214 SCIP_DECL_PROPEXIT ((*propexit)) /**< deinitialize propagator */
    215 );
    216
    217/** sets solving process initialization method of propagator */
    219 SCIP_PROP* prop, /**< propagator */
    220 SCIP_DECL_PROPINITSOL((*propinitsol)) /**< solving process initialization method of propagator */
    221 );
    222
    223/** sets solving process deinitialization method of propagator */
    225 SCIP_PROP* prop, /**< propagator */
    226 SCIP_DECL_PROPEXITSOL ((*propexitsol)) /**< solving process deinitialization method of propagator */
    227 );
    228
    229/** sets preprocessing initialization method of propagator */
    231 SCIP_PROP* prop, /**< propagator */
    232 SCIP_DECL_PROPINITPRE((*propinitpre)) /**< preprocessing initialization method of propagator */
    233 );
    234
    235/** sets preprocessing deinitialization method of propagator */
    237 SCIP_PROP* prop, /**< propagator */
    238 SCIP_DECL_PROPEXITPRE((*propexitpre)) /**< preprocessing deinitialization method of propagator */
    239 );
    240
    241/** sets presolving method of propagator */
    243 SCIP_PROP* prop, /**< propagator */
    244 SCIP_DECL_PROPPRESOL ((*proppresol)), /**< presolving method */
    245 int presolpriority, /**< presolving priority of the propagator (>= 0: before, < 0: after constraint handlers) */
    246 int presolmaxrounds, /**< maximal number of presolving rounds the propagator participates in (-1: no limit) */
    247 SCIP_PRESOLTIMING presoltiming /**< timing mask of the propagator's presolving method */
    248 );
    249
    250/** sets propagation conflict resolving callback of propagator */
    252 SCIP_PROP* prop, /**< propagator */
    253 SCIP_DECL_PROPRESPROP ((*propresprop)) /**< propagation conflict resolving callback */
    254 );
    255
    256/** enables or disables all clocks of \p prop, depending on the value of the flag */
    258 SCIP_PROP* prop, /**< the propagator for which all clocks should be enabled or disabled */
    259 SCIP_Bool enable /**< should the clocks of the propagator be enabled? */
    260 );
    261
    262#ifdef __cplusplus
    263}
    264#endif
    265
    266#endif
    common defines and data types used in all packages of SCIP
    #define SCIP_Bool
    Definition: def.h:91
    #define SCIP_Real
    Definition: def.h:156
    memory allocation routines
    struct BMS_BlkMem BMS_BLKMEM
    Definition: memory.h:437
    void SCIPpropSetPriority(SCIP_PROP *prop, SCIP_SET *set, int priority)
    Definition: prop.c:991
    SCIP_RETCODE SCIPpropInitsol(SCIP_PROP *prop, SCIP_SET *set)
    Definition: prop.c:471
    SCIP_RETCODE SCIPpropInit(SCIP_PROP *prop, SCIP_SET *set)
    Definition: prop.c:315
    void SCIPpropSetResprop(SCIP_PROP *prop, SCIP_DECL_PROPRESPROP((*propresprop)))
    Definition: prop.c:930
    void SCIPpropSetExitsol(SCIP_PROP *prop, SCIP_DECL_PROPEXITSOL((*propexitsol)))
    Definition: prop.c:867
    void SCIPpropSetFree(SCIP_PROP *prop, SCIP_DECL_PROPFREE((*propfree)))
    Definition: prop.c:823
    SCIP_RETCODE SCIPpropCreate(SCIP_PROP **prop, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, const char *name, const char *desc, int priority, int freq, SCIP_Bool delay, SCIP_PROPTIMING timingmask, int presolpriority, int presolmaxrounds, SCIP_PRESOLTIMING presoltiming, SCIP_DECL_PROPCOPY((*propcopy)), SCIP_DECL_PROPFREE((*propfree)), SCIP_DECL_PROPINIT((*propinit)), SCIP_DECL_PROPEXIT((*propexit)), SCIP_DECL_PROPINITPRE((*propinitpre)), SCIP_DECL_PROPEXITPRE((*propexitpre)), SCIP_DECL_PROPINITSOL((*propinitsol)), SCIP_DECL_PROPEXITSOL((*propexitsol)), SCIP_DECL_PROPPRESOL((*proppresol)), SCIP_DECL_PROPEXEC((*propexec)), SCIP_DECL_PROPRESPROP((*propresprop)), SCIP_PROPDATA *propdata)
    Definition: prop.c:243
    SCIP_RETCODE SCIPpropCopyInclude(SCIP_PROP *prop, SCIP_SET *set)
    Definition: prop.c:100
    SCIP_RETCODE SCIPpropExitpre(SCIP_PROP *prop, SCIP_SET *set)
    Definition: prop.c:447
    SCIP_RETCODE SCIPpropExit(SCIP_PROP *prop, SCIP_SET *set)
    Definition: prop.c:381
    void SCIPpropEnableOrDisableClocks(SCIP_PROP *prop, SCIP_Bool enable)
    Definition: prop.c:1029
    void SCIPpropSetExitpre(SCIP_PROP *prop, SCIP_DECL_PROPEXITPRE((*propexitpre)))
    Definition: prop.c:889
    SCIP_RETCODE SCIPpropResolvePropagation(SCIP_PROP *prop, SCIP_SET *set, SCIP_VAR *infervar, int inferinfo, SCIP_BOUNDTYPE inferboundtype, SCIP_BDCHGIDX *bdchgidx, SCIP_Real relaxedbd, SCIP_RESULT *result)
    Definition: prop.c:739
    SCIP_RETCODE SCIPpropExitsol(SCIP_PROP *prop, SCIP_SET *set, SCIP_Bool restart)
    Definition: prop.c:495
    void SCIPpropSetInitsol(SCIP_PROP *prop, SCIP_DECL_PROPINITSOL((*propinitsol)))
    Definition: prop.c:856
    void SCIPpropSetExit(SCIP_PROP *prop, SCIP_DECL_PROPEXIT((*propexit)))
    Definition: prop.c:845
    void SCIPpropSetPresolPriority(SCIP_PROP *prop, SCIP_SET *set, int presolpriority)
    Definition: prop.c:1005
    void SCIPpropSetInitpre(SCIP_PROP *prop, SCIP_DECL_PROPINITPRE((*propinitpre)))
    Definition: prop.c:878
    SCIP_RETCODE SCIPpropPresol(SCIP_PROP *prop, SCIP_SET *set, SCIP_PRESOLTIMING timing, int nrounds, int *nfixedvars, int *naggrvars, int *nchgvartypes, int *nchgbds, int *naddholes, int *ndelconss, int *naddconss, int *nupgdconss, int *nchgcoefs, int *nchgsides, SCIP_RESULT *result)
    Definition: prop.c:520
    SCIP_RETCODE SCIPpropExec(SCIP_PROP *prop, SCIP_SET *set, SCIP_STAT *stat, int depth, SCIP_Bool execdelayed, SCIP_Bool instrongbranching, SCIP_PROPTIMING proptiming, SCIP_RESULT *result)
    Definition: prop.c:646
    SCIP_RETCODE SCIPpropInitpre(SCIP_PROP *prop, SCIP_SET *set)
    Definition: prop.c:411
    void SCIPpropSetInit(SCIP_PROP *prop, SCIP_DECL_PROPINIT((*propinit)))
    Definition: prop.c:834
    SCIP_RETCODE SCIPpropFree(SCIP_PROP **prop, SCIP_SET *set)
    Definition: prop.c:285
    SCIP_RETCODE SCIPpropSetPresol(SCIP_PROP *prop, SCIP_DECL_PROPPRESOL((*proppresol)), int presolpriority, int presolmaxrounds, SCIP_PRESOLTIMING presoltiming)
    Definition: prop.c:900
    void SCIPpropSetCopy(SCIP_PROP *prop, SCIP_DECL_PROPCOPY((*propcopy)))
    Definition: prop.c:812
    public methods for propagators
    Definition: heur_padm.c:135
    type definitions for LP management
    enum SCIP_BoundType SCIP_BOUNDTYPE
    Definition: type_lp.h:60
    type definitions for message output methods
    type definitions for propagators
    #define SCIP_DECL_PROPCOPY(x)
    Definition: type_prop.h:61
    #define SCIP_DECL_PROPEXITPRE(x)
    Definition: type_prop.h:114
    #define SCIP_DECL_PROPINITSOL(x)
    Definition: type_prop.h:129
    #define SCIP_DECL_PROPINIT(x)
    Definition: type_prop.h:77
    #define SCIP_DECL_PROPFREE(x)
    Definition: type_prop.h:69
    #define SCIP_DECL_PROPEXITSOL(x)
    Definition: type_prop.h:141
    #define SCIP_DECL_PROPEXIT(x)
    Definition: type_prop.h:85
    #define SCIP_DECL_PROPPRESOL(x)
    Definition: type_prop.h:193
    #define SCIP_DECL_PROPINITPRE(x)
    Definition: type_prop.h:99
    #define SCIP_DECL_PROPRESPROP(x)
    Definition: type_prop.h:258
    struct SCIP_PropData SCIP_PROPDATA
    Definition: type_prop.h:52
    #define SCIP_DECL_PROPEXEC(x)
    Definition: type_prop.h:217
    result codes for SCIP callback methods
    enum SCIP_Result SCIP_RESULT
    Definition: type_result.h:61
    type definitions for return codes for SCIP methods
    enum SCIP_Retcode SCIP_RETCODE
    Definition: type_retcode.h:63
    type definitions for global SCIP settings
    type definitions for problem statistics
    unsigned int SCIP_PROPTIMING
    Definition: type_timing.h:75
    unsigned int SCIP_PRESOLTIMING
    Definition: type_timing.h:61
    type definitions for problem variables