Scippy

    SCIP

    Solving Constraint Integer Programs

    conflictstore.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 conflictstore.h
    26 * @ingroup INTERNALAPI
    27 * @brief internal methods for storing conflicts
    28 * @author Jakob Witzig
    29 */
    30
    31/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
    32
    33#ifndef __SCIP_CONFLICTSTORE_H__
    34#define __SCIP_CONFLICTSTORE_H__
    35
    36
    37#include "scip/def.h"
    40#include "scip/type_retcode.h"
    41#include "scip/type_cons.h"
    42#include "scip/type_event.h"
    43#include "scip/type_conflict.h"
    44#include "scip/type_prob.h"
    45#include "scip/type_reopt.h"
    46#include "scip/type_set.h"
    47#include "scip/type_stat.h"
    48#include "scip/type_tree.h"
    49
    50#ifdef __cplusplus
    51extern "C" {
    52#endif
    53
    54/** creates separation storage */
    56 SCIP_CONFLICTSTORE** conflictstore, /**< pointer to store conflict store */
    57 SCIP_SET* set /**< global SCIP settings */
    58 );
    59
    60/** frees separation storage */
    62 SCIP_CONFLICTSTORE** conflictstore, /**< pointer to store conflict store */
    63 BMS_BLKMEM* blkmem, /**< block memory */
    64 SCIP_SET* set, /**< global SCIP settings */
    65 SCIP_STAT* stat, /**< dynamic SCIP statistics */
    66 SCIP_REOPT* reopt /**< reoptimization data */
    67 );
    68
    69/** clears conflict store */
    71 SCIP_CONFLICTSTORE* conflictstore, /**< conflict store */
    72 BMS_BLKMEM* blkmem, /**< block memory */
    73 SCIP_SET* set, /**< global SCIP settings */
    74 SCIP_STAT* stat, /**< dynamic SCIP statistics */
    75 SCIP_REOPT* reopt /**< reoptimization data */
    76 );
    77
    78/** cleans up conflict store */
    80 SCIP_CONFLICTSTORE* conflictstore, /**< conflict store */
    81 BMS_BLKMEM* blkmem, /**< block memory */
    82 SCIP_SET* set, /**< global SCIP settings */
    83 SCIP_STAT* stat, /**< dynamic SCIP statistics */
    84 SCIP_PROB* transprob, /**< transformed problem */
    85 SCIP_REOPT* reopt /**< reoptimization data */
    86 );
    87
    88/** adds a constraint to the pool of proof constraints based on dual rays
    89 *
    90 * @note this methods captures the constraint
    91 */
    93 SCIP_CONFLICTSTORE* conflictstore, /**< conflict store */
    94 SCIP_CONS* dualproof, /**< constraint based on a dual ray */
    95 BMS_BLKMEM* blkmem, /**< block memory */
    96 SCIP_SET* set, /**< global SCIP settings */
    97 SCIP_STAT* stat, /**< dynamic SCIP statistics */
    98 SCIP_PROB* transprob, /**< transformed problem */
    99 SCIP_REOPT* reopt, /**< reoptimization data */
    100 SCIP_Bool hasrelaxvar /**< does the dual proof contain at least one variable that exists in
    101 * the current relaxation only? */
    102 );
    103
    104/** adds a constraint to the pool of proof constraints based on dual solutions
    105 *
    106 * @note this methods captures the constraint
    107 */
    109 SCIP_CONFLICTSTORE* conflictstore, /**< conflict store */
    110 SCIP_CONS* dualproof, /**< constraint based on a dual solution */
    111 BMS_BLKMEM* blkmem, /**< block memory */
    112 SCIP_SET* set, /**< global SCIP settings */
    113 SCIP_STAT* stat, /**< dynamic SCIP statistics */
    114 SCIP_PROB* transprob, /**< transformed problem */
    115 SCIP_REOPT* reopt, /**< reoptimization data */
    116 SCIP_Real scale, /**< scaling factor that needs to be considered when updating the side */
    117 SCIP_Bool updateside, /**< should the side be updated if a new incumbent is found */
    118 SCIP_Bool hasrelaxvar /**< does the dual proof contain at least one variable that exists in
    119 * the current relaxation only? */
    120 );
    121
    122/** adds a conflict to the conflict store
    123 *
    124 * @note this method captures the constraint
    125 */
    127 SCIP_CONFLICTSTORE* conflictstore, /**< conflict store */
    128 BMS_BLKMEM* blkmem, /**< block memory */
    129 SCIP_SET* set, /**< global SCIP settings */
    130 SCIP_STAT* stat, /**< dynamic SCIP statistics */
    131 SCIP_TREE* tree, /**< branch and bound tree (or NULL for an original constraint) */
    132 SCIP_PROB* transprob, /**< transformed problem (or NULL for an original constraint) */
    133 SCIP_REOPT* reopt, /**< reoptimization data */
    134 SCIP_CONS* cons, /**< constraint representing the conflict */
    135 SCIP_CONFTYPE conftype, /**< type of the conflict */
    136 SCIP_Bool cutoffinvolved, /**< is a cutoff bound involved in this conflict */
    137 SCIP_Real primalbound /**< primal bound the conflict depend on (or -SCIPinfinity) */
    138 );
    139
    140/** upgrades an unchecked conflict in the conflict store
    141 *
    142 * @note this method releases oldcons and captures newcons
    143 */
    145 SCIP_CONFLICTSTORE* conflictstore, /**< conflict store */
    146 BMS_BLKMEM* blkmem, /**< block memory */
    147 SCIP_SET* set, /**< global SCIP settings */
    148 SCIP_CONS* oldcons, /**< underlying constraint to upgrade */
    149 SCIP_CONS* newcons /**< upgraded constraint to add */
    150 );
    151
    152/** deletes all conflicts depending on a cutoff bound larger than the given bound */
    154 SCIP_CONFLICTSTORE* conflictstore, /**< conflict store */
    155 SCIP_SET* set, /**< global SCIP settings */
    156 SCIP_STAT* stat, /**< dynamic SCIP statistics */
    157 BMS_BLKMEM* blkmem, /**< block memory */
    158 SCIP_PROB* transprob, /**< transformed problem*/
    159 SCIP_REOPT* reopt, /**< reoptimization data */
    160 SCIP_Real cutoffbound /**< current cutoff bound */
    161 );
    162
    163/** returns the maximal size of the conflict pool */
    165 SCIP_CONFLICTSTORE* conflictstore /**< conflict store */
    166 );
    167
    168/** returns the initial size of the conflict pool */
    170 SCIP_CONFLICTSTORE* conflictstore /**< conflict store */
    171 );
    172
    173/** returns the number of stored conflicts on the conflict pool
    174 *
    175 * @note the number of active conflicts can be less
    176 */
    178 SCIP_CONFLICTSTORE* conflictstore /**< conflict store */
    179 );
    180
    181/** returns all active conflicts stored in the conflict store */
    183 SCIP_CONFLICTSTORE* conflictstore, /**< conflict store */
    184 SCIP_CONS** conflicts, /**< array to store conflicts */
    185 int conflictsize, /**< size of the conflict array */
    186 int* nconflicts /**< pointer to store the number of conflicts */
    187 );
    188
    189/** transforms all original conflicts into transformed conflicts */
    191 SCIP_CONFLICTSTORE* conflictstore, /**< conflict store */
    192 BMS_BLKMEM* blkmem, /**< block memory */
    193 SCIP_SET* set, /**< global SCIP settings */
    194 SCIP_STAT* stat, /**< dynamic SCIP statistics */
    195 SCIP_TREE* tree, /**< branch and bound tree */
    196 SCIP_PROB* transprob, /**< transformed problem */
    197 SCIP_REOPT* reopt /**< reoptimization data */
    198 );
    199
    200/** returns the average number of non-zeros over all stored dual ray constraints */
    202 SCIP_CONFLICTSTORE* conflictstore /**< conflict store */
    203 );
    204
    205/** return the number of stored dualray constraints */
    207 SCIP_CONFLICTSTORE* conflictstore /**< conflict store */
    208 );
    209
    210/** returns the average number of non-zeros over all stored boundexceeding proofs */
    212 SCIP_CONFLICTSTORE* conflictstore /**< conflict store */
    213 );
    214
    215/** returns the number of all stored boundexceeding proofs */
    217 SCIP_CONFLICTSTORE* conflictstore /**< conflict store */
    218 );
    219
    220#ifdef __cplusplus
    221}
    222#endif
    223
    224#endif
    SCIP_RETCODE SCIPconflictstoreTransform(SCIP_CONFLICTSTORE *conflictstore, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_TREE *tree, SCIP_PROB *transprob, SCIP_REOPT *reopt)
    SCIP_RETCODE SCIPconflictstoreUpgradeConflict(SCIP_CONFLICTSTORE *conflictstore, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_CONS *oldcons, SCIP_CONS *newcons)
    SCIP_RETCODE SCIPconflictstoreAddDualraycons(SCIP_CONFLICTSTORE *conflictstore, SCIP_CONS *dualproof, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_REOPT *reopt, SCIP_Bool hasrelaxvar)
    int SCIPconflictstoreGetNDualInfProofs(SCIP_CONFLICTSTORE *conflictstore)
    SCIP_Real SCIPconflictstoreGetAvgNnzDualInfProofs(SCIP_CONFLICTSTORE *conflictstore)
    SCIP_RETCODE SCIPconflictstoreCleanNewIncumbent(SCIP_CONFLICTSTORE *conflictstore, SCIP_SET *set, SCIP_STAT *stat, BMS_BLKMEM *blkmem, SCIP_PROB *transprob, SCIP_REOPT *reopt, SCIP_Real cutoffbound)
    SCIP_RETCODE SCIPconflictstoreClear(SCIP_CONFLICTSTORE *conflictstore, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_REOPT *reopt)
    int SCIPconflictstoreGetMaxPoolSize(SCIP_CONFLICTSTORE *conflictstore)
    int SCIPconflictstoreGetNDualBndProofs(SCIP_CONFLICTSTORE *conflictstore)
    SCIP_RETCODE SCIPconflictstoreFree(SCIP_CONFLICTSTORE **conflictstore, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_REOPT *reopt)
    SCIP_RETCODE SCIPconflictstoreGetConflicts(SCIP_CONFLICTSTORE *conflictstore, SCIP_CONS **conflicts, int conflictsize, int *nconflicts)
    int SCIPconflictstoreGetNConflictsInStore(SCIP_CONFLICTSTORE *conflictstore)
    SCIP_RETCODE SCIPconflictstoreClean(SCIP_CONFLICTSTORE *conflictstore, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_REOPT *reopt)
    SCIP_Real SCIPconflictstoreGetAvgNnzDualBndProofs(SCIP_CONFLICTSTORE *conflictstore)
    SCIP_RETCODE SCIPconflictstoreAddDualsolcons(SCIP_CONFLICTSTORE *conflictstore, SCIP_CONS *dualproof, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_REOPT *reopt, SCIP_Real scale, SCIP_Bool updateside, SCIP_Bool hasrelaxvar)
    SCIP_RETCODE SCIPconflictstoreCreate(SCIP_CONFLICTSTORE **conflictstore, SCIP_SET *set)
    SCIP_RETCODE SCIPconflictstoreAddConflict(SCIP_CONFLICTSTORE *conflictstore, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_TREE *tree, SCIP_PROB *transprob, SCIP_REOPT *reopt, SCIP_CONS *cons, SCIP_CONFTYPE conftype, SCIP_Bool cutoffinvolved, SCIP_Real primalbound)
    int SCIPconflictstoreGetInitPoolSize(SCIP_CONFLICTSTORE *conflictstore)
    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
    Definition: heur_padm.c:135
    type definitions for conflict analysis
    enum SCIP_ConflictType SCIP_CONFTYPE
    Definition: type_conflict.h:68
    type definitions for conflict store
    type definitions for constraints and constraint handlers
    type definitions for managing events
    type definitions for storing and manipulating the main problem
    type definitions for collecting reoptimization information
    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
    type definitions for branch and bound tree