Scippy

    SCIP

    Solving Constraint Integer Programs

    struct_conflict.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 struct_conflict.h
    26 * @ingroup INTERNALAPI
    27 * @brief datastructures for conflict analysis
    28 * @author Tobias Achterberg
    29 */
    30
    31/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
    32
    33#ifndef __SCIP_STRUCT_CONFLICT_H__
    34#define __SCIP_STRUCT_CONFLICT_H__
    35
    36
    37#include "scip/def.h"
    38#include "scip/type_clock.h"
    39#include "scip/type_misc.h"
    40#include "scip/type_var.h"
    41#include "scip/type_conflict.h"
    42#include "lpi/type_lpi.h"
    43
    44#ifdef __cplusplus
    45extern "C" {
    46#endif
    47
    48/** conflict handler */
    50{
    51 char* name; /**< name of conflict handler */
    52 char* desc; /**< description of conflict handler */
    53 SCIP_DECL_CONFLICTCOPY((*conflictcopy)); /**< copy method of conflict handler or NULL if you don't want to copy your plugin into sub-SCIPs */
    54 SCIP_DECL_CONFLICTFREE((*conflictfree)); /**< destructor of conflict handler */
    55 SCIP_DECL_CONFLICTINIT((*conflictinit)); /**< initialize conflict handler */
    56 SCIP_DECL_CONFLICTEXIT((*conflictexit)); /**< deinitialize conflict handler */
    57 SCIP_DECL_CONFLICTINITSOL((*conflictinitsol));/**< solving process initialization method of conflict handler */
    58 SCIP_DECL_CONFLICTEXITSOL((*conflictexitsol));/**< solving process deinitialization method of conflict handler */
    59 SCIP_DECL_CONFLICTEXEC((*conflictexec)); /**< conflict processing method of conflict handler */
    60 SCIP_CONFLICTHDLRDATA* conflicthdlrdata; /**< conflict handler data */
    61 SCIP_CLOCK* setuptime; /**< time spend for setting up this conflict handler for the next stages */
    62 SCIP_CLOCK* conflicttime; /**< conflict handler execution time */
    63 int priority; /**< priority of the conflict handler */
    64 SCIP_Bool initialized; /**< is conflict handler initialized? */
    65};
    66
    67/** set of conflicting bound changes */
    69{
    70 SCIP_BDCHGINFO** bdchginfos; /**< bound change informations of the conflict set */
    71 SCIP_BDCHGINFO* confbdchginfo; /**< a bound change at the conflict depth */
    72 SCIP_Real* relaxedbds; /**< array of relaxed bounds which are efficient for a valid conflict */
    73 SCIP_Real confrelaxedbd; /**< relaxed bound belonging the the bound change at the conflict depth */
    74 int* sortvals; /**< aggregated var index/bound type values for sorting */
    75 int bdchginfossize; /**< size of bdchginfos array */
    76 int nbdchginfos; /**< number of bound change informations in the conflict set */
    77 int validdepth; /**< depth in the tree where the conflict set is valid */
    78 int insertdepth; /**< depth level where constraint should be added */
    79 int conflictdepth; /**< depth in the tree where the conflict set yields a conflict */
    80 int repropdepth; /**< depth at which the conflict set triggers a deduction */
    81 unsigned int repropagate:1; /**< should the conflict constraint trigger a repropagation? */
    82 unsigned int depthcalced:1; /**< are the conflict and repropagation depth calculated? */
    83 unsigned int sorted:1; /**< is the conflict set sorted */
    84 unsigned int usescutoffbound:1; /**< is the conflict based on the cutoff bound? */
    85 unsigned int hasrelaxonlyvar:1; /**< is one of the bound change informations using a relaxation-only variable */
    86 SCIP_CONFTYPE conflicttype; /**< conflict type: unknown, infeasible LP, bound exceeding LP, propagation */
    87};
    88
    89/** set of conflicting bound changes */
    91{
    93 int* inds;
    95 int nnz;
    96 int size;
    98 SCIP_CONFTYPE conflicttype; /**< conflict type: unknown, infeasible LP, bound exceeding LP */
    100};
    101
    102
    103/** conflict row of type lhs <= a^Tx, semi-sparse representation */
    105{
    107 int* inds;
    111 int nvars;
    112 int nnz;
    113 int size;
    118 unsigned int usescutoffbound:1; /**< is the conflict based on the cutoff bound? */
    119 unsigned int isbinary:1; /**< is the constraint binary? */
    120 SCIP_CONFTYPE conflicttype; /**< conflict type: unknown, resolution */
    121};
    122
    123
    124/** set of LP bound change */
    126{
    127 int* bdchginds; /**< array of column indices */
    128 SCIP_Real* bdchglbs; /**< array of lower bounds */
    129 SCIP_Real* bdchgubs; /**< array of upper bounds */
    130 int* bdchgcolinds; /**< array of ???????????? */
    131 SCIP_Bool* usedcols; /**< array to mark if a column is used */
    132 int nbdchgs; /**< number of stored LP bound changes */
    133};
    134
    135/** conflict analysis data structure */
    137{
    138 SCIP_Longint nglbchgbds; /**< total number of applied global bound changes */
    139 SCIP_Longint nappliedglbconss; /**< total number of conflict constraints added globally to the problem */
    140 SCIP_Longint nappliedglbresconss;/**< total number of resolution conflict constraints added globally to the problem */
    141 SCIP_Longint nappliedglbliterals;/**< total number of literals in globally applied conflict constraints */
    142 SCIP_Longint nlocchgbds; /**< total number of applied local bound changes */
    143 SCIP_Longint nappliedlocconss; /**< total number of conflict constraints added locally to the problem */
    144 SCIP_Longint nappliedlocliterals;/**< total number of literals in locally applied conflict constraints */
    145 SCIP_Longint npropcalls; /**< number of calls to propagation conflict analysis */
    146 SCIP_Longint npropsuccess; /**< number of calls yielding at least one conflict constraint */
    147 SCIP_Longint npropconfconss; /**< number of valid conflict constraints detected in propagation conflict analysis */
    148 SCIP_Longint npropconfliterals; /**< total number of literals in valid propagation conflict constraints */
    149 SCIP_Longint npropreconvconss; /**< number of reconvergence constraints detected in propagation conflict analysis */
    150 SCIP_Longint npropreconvliterals;/**< total number of literals in valid propagation reconvergence constraints */
    151 SCIP_Longint nrescalls; /**< number of calls to resolution conflict analysis */
    152 SCIP_Longint nressuccess; /**< number of calls yielding at least one conflict constraint */
    153 SCIP_Longint nreslargecoefs; /**< number of calls terminating because of large coefficients */
    154 SCIP_Longint nreslongconfs; /**< number of calls terminating because of long conflict rows */
    155 SCIP_Longint nresconfconss; /**< number of valid conflict constraints detected in resolution conflict analysis */
    156 SCIP_Longint nresconfvariables; /**< total number of variables in valid resolution conflict constraints */
    157 SCIP_Longint ninflpcalls; /**< number of calls to infeasible LP conflict analysis */
    158 SCIP_Longint ninflpsuccess; /**< number of calls yielding at least one conflict constraint */
    159 SCIP_Longint ninflpconfconss; /**< number of valid conflict constraints detected in infeasible LP conflict
    160 * analysis */
    161 SCIP_Longint ninflpconfliterals; /**< total number of literals in valid infeasible LP conflict constraints */
    162 SCIP_Longint ninflpreconvconss; /**< number of reconvergence constraints detected in infeasible LP conflict
    163 * analysis */
    164 SCIP_Longint ninflpreconvliterals; /**< total number of literals in valid infeasible LP reconvergence
    165 * constraints */
    166 SCIP_Longint ninflpiterations; /**< total number of LP iterations used in infeasible LP conflict analysis */
    167 SCIP_Longint nboundlpcalls; /**< number of calls to bound exceeding LP conflict analysis */
    168 SCIP_Longint nboundlpsuccess; /**< number of calls yielding at least one conflict constraint */
    169 SCIP_Longint nboundlpconfconss; /**< number of valid conflict constraints detected in bound exceeding LP
    170 * conflict analysis */
    171 SCIP_Longint nboundlpconfliterals; /**< total number of literals in valid bound exceeding LP conflict
    172 * constraints */
    173 SCIP_Longint nboundlpreconvconss;/**< number of reconvergence constraints detected in bound exceeding LP
    174 * conflict analysis */
    175 SCIP_Longint nboundlpreconvliterals; /**< total number of literals in valid bound exceeding LP reconvergence
    176 * constraints */
    177 SCIP_Longint nboundlpiterations; /**< total number of LP iterations used in bound exceeding LP conflict
    178 * analysis */
    179 SCIP_Longint nsbcalls; /**< number of calls to infeasible strong branching conflict analysis */
    180 SCIP_Longint nsbsuccess; /**< number of calls yielding at least one conflict constraint */
    181 SCIP_Longint nsbconfconss; /**< number of conflict constraints detected in strong branching conflict analysis */
    182 SCIP_Longint nsbconfliterals; /**< total number of literals in valid strong branching conflict constraints */
    183 SCIP_Longint nsbreconvconss; /**< number of reconvergence constraints detected in strong branch conflict analysis */
    184 SCIP_Longint nsbreconvliterals; /**< total number of literals in valid strong branching reconvergence constraints */
    185 SCIP_Longint nsbiterations; /**< total number of LP iterations used in strong branching conflict analysis */
    186 SCIP_Longint npseudocalls; /**< number of calls to pseudo solution conflict analysis */
    187 SCIP_Longint npseudosuccess; /**< number of calls yielding at least one conflict constraint */
    188 SCIP_Longint npseudoconfconss; /**< number of valid conflict constraints detected in pseudo sol conflict analysis */
    189 SCIP_Longint npseudoconfliterals;/**< total number of literals in valid pseudo solution conflict constraints */
    190 SCIP_Longint npseudoreconvconss; /**< number of reconvergence constraints detected in pseudo sol conflict analysis */
    191 SCIP_Longint npseudoreconvliterals;/**< total number of literals in valid pseudo solution reconvergence constraints */
    192 SCIP_Longint ndualproofsinfglobal;/**< number of globally added dual proof constraints derived from infeasible LP */
    193 SCIP_Longint ndualproofsinflocal;/**< number of locally added dual proof constraints derived from infeasible LP */
    194 SCIP_Longint ndualproofsinfsuccess;/**< number of successfully dual proof analysis calls for infeasible LPs */
    195 SCIP_Longint dualproofsinfnnonzeros;/**< number of non-zeros over all accepted dual proof constraints derived from infeasible LP */
    196 SCIP_Longint ndualproofsbndglobal;/**< number of globally added dual proof constraints derived from bound exceeding LP */
    197 SCIP_Longint ndualproofsbndlocal;/**< number of locally added dual proof constraints derived from bound exceeding LP */
    198 SCIP_Longint ndualproofsbndsuccess;/**< number of successfully dual proof analysis calls for bound exceeding LPs */
    199 SCIP_Longint dualproofsbndnnonzeros;/**< number of non-zeros over all accepted dual proof constraints derived from bound exceeding LPs */
    200
    201 SCIP_CLOCK* dIBclock; /**< time used for detect implied bounds */
    202
    203 SCIP_CLOCK* propanalyzetime; /**< time used for propagation conflict analysis */
    204 SCIP_CLOCK* resanalyzetime; /**< time used for resolution conflict analysis */
    205 SCIP_CLOCK* inflpanalyzetime; /**< time used for infeasible LP conflict analysis */
    206 SCIP_CLOCK* boundlpanalyzetime; /**< time used for bound exceeding LP conflict analysis */
    207 SCIP_CLOCK* sbanalyzetime; /**< time used for strong branching LP conflict analysis */
    208 SCIP_CLOCK* pseudoanalyzetime; /**< time used for pseudo solution conflict analysis */
    209 SCIP_PQUEUE* bdchgqueue; /**< unprocessed conflict bound changes */
    210 SCIP_PQUEUE* forcedbdchgqueue; /**< unprocessed conflict bound changes that must be resolved */
    211 SCIP_PQUEUE* resbdchgqueue; /**< unprocessed conflict bound changes used in generalized resolution*/
    212 SCIP_PQUEUE* continuousbdchgqueue;/**< unprocessed bound changes that are continuous */
    213 SCIP_PROOFSET* proofset; /**< proof sets found at the current node */
    214 SCIP_PROOFSET** proofsets; /**< proof sets found at the current node */
    215 SCIP_CONFLICTROW* conflictrow; /**< conflict row for the current conflict */
    216 SCIP_CONFLICTROW* resolvedconflictrow;/**< conflict row for for current the conflict */
    217 SCIP_CONFLICTROW* reasonrow; /**< reason row for the latest bound change */
    218 SCIP_CONFLICTROW* reducedreasonrow; /**< reason row for the latest bound change */
    219 SCIP_CONFLICTROW** conflictrows; /**< conflict rows found at the current node */
    220 SCIP_CONFLICTSET* conflictset; /**< bound changes resembling the current conflict set */
    221 SCIP_CONFLICTSET** conflictsets; /**< conflict sets found at the current node */
    222 SCIP_Real* conflictsetscores; /**< score values of the conflict sets found at the current node */
    223 SCIP_Real* conflictvarslbs; /**< maximal lower bounds of variables in the current resolution conflict */
    224 SCIP_Real* conflictvarsubs; /**< minimal upper bounds of variables in the current resolution conflict */
    225 SCIP_BDCHGINFO** tmpbdchginfos; /**< temporarily created bound change information data */
    226 int conflictprobnvars; /**< number of variables in the current problem where conflict analysis is used */
    227 int conflictsetssize; /**< size of conflictsets array */
    228 int nconflictsets; /**< number of available conflict sets (used slots in conflictsets array) */
    229 int proofsetssize; /**< size of proofsets array */
    230 int nproofsets; /**< number of available proof sets (used slots in proofsets array) */
    231 int tmpbdchginfossize; /**< size of tmpbdchginfos array */
    232 int ntmpbdchginfos; /**< number of temporary created bound change information data */
    233 int count; /**< conflict set counter to label binary conflict variables with */
    234 int nconflictrows; /**< number of available resolution sets */
    235 int conflictrowssize; /**< size of conflictrows array */
    236 SCIP_Bool bdchgonlyconfqueue; /**< if true we add bound changes only in graph conflict queues */
    237 SCIP_Bool bdchgonlyresqueue; /**< if true we add bound changes only in generalized resolution queues */
    238};
    239
    240#ifdef __cplusplus
    241}
    242#endif
    243
    244#endif
    common defines and data types used in all packages of SCIP
    #define SCIP_Longint
    Definition: def.h:141
    #define SCIP_Bool
    Definition: def.h:91
    #define SCIP_Real
    Definition: def.h:156
    SCIP_Real coefquotient
    unsigned int isbinary
    SCIP_CONFTYPE conflicttype
    unsigned int usescutoffbound
    unsigned int hasrelaxonlyvar
    SCIP_BDCHGINFO ** bdchginfos
    unsigned int repropagate
    unsigned int sorted
    SCIP_Real * relaxedbds
    SCIP_Real confrelaxedbd
    unsigned int depthcalced
    SCIP_CONFTYPE conflicttype
    SCIP_BDCHGINFO * confbdchginfo
    unsigned int usescutoffbound
    SCIP_Longint ninflpiterations
    SCIP_Real * conflictvarsubs
    SCIP_Real * conflictsetscores
    SCIP_Longint ndualproofsbndglobal
    SCIP_PROOFSET * proofset
    SCIP_Longint ndualproofsinfsuccess
    SCIP_Longint nappliedglbconss
    SCIP_Longint nsbiterations
    SCIP_Longint npropconfconss
    SCIP_Longint ninflpconfconss
    SCIP_Longint npseudoreconvliterals
    SCIP_CLOCK * dIBclock
    SCIP_CONFLICTROW ** conflictrows
    SCIP_Longint npseudosuccess
    SCIP_Longint ninflpconfliterals
    SCIP_PQUEUE * resbdchgqueue
    SCIP_Longint nsbsuccess
    SCIP_CLOCK * propanalyzetime
    SCIP_Longint nboundlpconfliterals
    SCIP_Longint nsbcalls
    SCIP_PROOFSET ** proofsets
    SCIP_Longint ndualproofsinflocal
    SCIP_Longint npseudoconfconss
    SCIP_Longint nboundlpcalls
    SCIP_PQUEUE * forcedbdchgqueue
    SCIP_Longint nappliedglbliterals
    SCIP_Longint nboundlpreconvliterals
    SCIP_CONFLICTSET ** conflictsets
    SCIP_Longint nresconfconss
    SCIP_Longint npseudocalls
    SCIP_Longint ninflpreconvconss
    SCIP_Longint nglbchgbds
    SCIP_Longint dualproofsbndnnonzeros
    SCIP_Bool bdchgonlyconfqueue
    SCIP_Longint nappliedglbresconss
    SCIP_Longint ninflpcalls
    SCIP_CLOCK * pseudoanalyzetime
    SCIP_Longint nsbconfliterals
    SCIP_CONFLICTROW * resolvedconflictrow
    SCIP_CLOCK * inflpanalyzetime
    SCIP_Longint nboundlpiterations
    SCIP_CONFLICTROW * reducedreasonrow
    SCIP_Longint npseudoreconvconss
    SCIP_Longint npseudoconfliterals
    SCIP_Longint nlocchgbds
    SCIP_Longint nreslongconfs
    SCIP_Longint nsbreconvconss
    SCIP_PQUEUE * bdchgqueue
    SCIP_Longint nsbreconvliterals
    SCIP_Longint npropsuccess
    SCIP_Longint ndualproofsinfglobal
    SCIP_Longint nresconfvariables
    SCIP_Longint nappliedlocconss
    SCIP_Longint nsbconfconss
    SCIP_Longint ninflpsuccess
    SCIP_CLOCK * sbanalyzetime
    SCIP_Longint npropcalls
    SCIP_Longint nboundlpreconvconss
    SCIP_CLOCK * resanalyzetime
    SCIP_PQUEUE * continuousbdchgqueue
    SCIP_Longint ndualproofsbndsuccess
    SCIP_Longint dualproofsinfnnonzeros
    SCIP_CONFLICTROW * conflictrow
    SCIP_Longint nboundlpconfconss
    SCIP_Longint npropreconvliterals
    SCIP_Bool bdchgonlyresqueue
    SCIP_CLOCK * boundlpanalyzetime
    SCIP_CONFLICTROW * reasonrow
    SCIP_Longint nrescalls
    SCIP_Longint nboundlpsuccess
    SCIP_BDCHGINFO ** tmpbdchginfos
    SCIP_Longint npropconfliterals
    SCIP_Longint ninflpreconvliterals
    SCIP_CONFLICTSET * conflictset
    SCIP_Real * conflictvarslbs
    SCIP_Longint nressuccess
    SCIP_Longint ndualproofsbndlocal
    SCIP_Longint nreslargecoefs
    SCIP_Longint nappliedlocliterals
    SCIP_Longint npropreconvconss
    SCIP_CONFLICTHDLRDATA * conflicthdlrdata
    SCIP_CLOCK * setuptime
    SCIP_DECL_CONFLICTINIT((*conflictinit))
    SCIP_DECL_CONFLICTINITSOL((*conflictinitsol))
    SCIP_DECL_CONFLICTFREE((*conflictfree))
    SCIP_DECL_CONFLICTEXEC((*conflictexec))
    SCIP_CLOCK * conflicttime
    SCIP_DECL_CONFLICTEXIT((*conflictexit))
    SCIP_DECL_CONFLICTCOPY((*conflictcopy))
    SCIP_DECL_CONFLICTEXITSOL((*conflictexitsol))
    SCIP_Real * bdchgubs
    SCIP_Bool * usedcols
    SCIP_Real * bdchglbs
    SCIP_Longint certificateline
    SCIP_Real * vals
    SCIP_CONFTYPE conflicttype
    type definitions for clocks and timing issues
    type definitions for conflict analysis
    enum SCIP_ConflictType SCIP_CONFTYPE
    Definition: type_conflict.h:68
    struct SCIP_ConflicthdlrData SCIP_CONFLICTHDLRDATA
    Definition: type_conflict.h:50
    type definitions for specific LP solvers interface
    type definitions for miscellaneous datastructures
    type definitions for problem variables