Scippy

    SCIP

    Solving Constraint Integer Programs

    pricer.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 pricer.h
    26 * @ingroup INTERNALAPI
    27 * @brief internal methods for variable pricers
    28 * @author Tobias Achterberg
    29 */
    30
    31/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
    32
    33#ifndef __SCIP_PRICER_H__
    34#define __SCIP_PRICER_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_lp.h"
    43#include "scip/type_message.h"
    44#include "scip/type_prob.h"
    46#include "scip/type_pricer.h"
    47#include "scip/pub_pricer.h"
    48
    49#ifdef __cplusplus
    50extern "C" {
    51#endif
    52
    53
    54/** copies the given pricer to a new scip */
    56 SCIP_PRICER* pricer, /**< pricer */
    57 SCIP_SET* set, /**< SCIP_SET of SCIP to copy to */
    58 SCIP_Bool* valid /**< was the copying process valid? */
    59 );
    60
    61/** creates a variable pricer */
    63 SCIP_PRICER** pricer, /**< pointer to variable pricer data structure */
    64 SCIP_SET* set, /**< global SCIP settings */
    65 SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
    66 BMS_BLKMEM* blkmem, /**< block memory for parameter settings */
    67 const char* name, /**< name of variable pricer */
    68 const char* desc, /**< description of variable pricer */
    69 int priority, /**< priority of the variable pricer */
    70 SCIP_Bool delay, /**< should the pricer be delayed until no other pricers or already existing
    71 * problem variables with negative reduced costs are found */
    72 SCIP_DECL_PRICERCOPY ((*pricercopy)), /**< copy method of pricer or NULL if you don't want to copy your plugin into sub-SCIPs */
    73 SCIP_DECL_PRICERFREE ((*pricerfree)), /**< destructor of variable pricer */
    74 SCIP_DECL_PRICERINIT ((*pricerinit)), /**< initialize variable pricer */
    75 SCIP_DECL_PRICEREXIT ((*pricerexit)), /**< deinitialize variable pricer */
    76 SCIP_DECL_PRICERINITSOL((*pricerinitsol)),/**< solving process initialization method of variable pricer */
    77 SCIP_DECL_PRICEREXITSOL((*pricerexitsol)),/**< solving process deinitialization method of variable pricer */
    78 SCIP_DECL_PRICERREDCOST((*pricerredcost)),/**< reduced cost pricing method of variable pricer for feasible LPs */
    79 SCIP_DECL_PRICERFARKAS((*pricerfarkas)), /**< Farkas pricing method of variable pricer for infeasible LPs */
    80 SCIP_PRICERDATA* pricerdata /**< variable pricer data */
    81 );
    82
    83/** calls destructor and frees memory of variable pricer */
    85 SCIP_PRICER** pricer, /**< pointer to variable pricer data structure */
    86 SCIP_SET* set /**< global SCIP settings */
    87 );
    88
    89/** initializes variable pricer */
    91 SCIP_PRICER* pricer, /**< variable pricer */
    92 SCIP_SET* set /**< global SCIP settings */
    93 );
    94
    95/** calls exit method of variable pricer */
    97 SCIP_PRICER* pricer, /**< variable pricer */
    98 SCIP_SET* set /**< global SCIP settings */
    99 );
    100
    101/** informs variable pricer that the branch and bound process is being started */
    103 SCIP_PRICER* pricer, /**< variable pricer */
    104 SCIP_SET* set /**< global SCIP settings */
    105 );
    106
    107/** informs variable pricer that the branch and bound process data is being freed */
    109 SCIP_PRICER* pricer, /**< variable pricer */
    110 SCIP_SET* set /**< global SCIP settings */
    111 );
    112
    113/** activates pricer such that it is called in LP solving loop */
    115 SCIP_PRICER* pricer, /**< variable pricer */
    116 SCIP_SET* set /**< global SCIP settings */
    117 );
    118
    119/** deactivates pricer such that it is no longer called in LP solving loop */
    121 SCIP_PRICER* pricer, /**< variable pricer */
    122 SCIP_SET* set /**< global SCIP settings */
    123 );
    124
    125/** enables or disables all clocks of \p pricer, depending on the value of the flag */
    127 SCIP_PRICER* pricer, /**< the pricer for which all clocks should be enabled or disabled */
    128 SCIP_Bool enable /**< should the clocks of the pricer be enabled? */
    129 );
    130
    131/** calls reduced cost pricing method of variable pricer */
    133 SCIP_PRICER* pricer, /**< variable pricer */
    134 SCIP_SET* set, /**< global SCIP settings */
    135 SCIP_PROB* prob, /**< transformed problem */
    136 SCIP_Real* lowerbound, /**< local lower bound computed by the pricer */
    137 SCIP_Bool* stopearly, /**< should pricing be stopped, although new variables were added? */
    138 SCIP_RESULT* result /**< result of the pricing process */
    139 );
    140
    141/** calls Farkas pricing method of variable pricer */
    143 SCIP_PRICER* pricer, /**< variable pricer */
    144 SCIP_SET* set, /**< global SCIP settings */
    145 SCIP_PROB* prob, /**< transformed problem */
    146 SCIP_RESULT* result /**< result of the pricing process */
    147 );
    148
    149/** depending on the LP's solution status, calls reduced cost or Farkas pricing method of variable pricer */
    151 SCIP_PRICER* pricer, /**< variable pricer */
    152 SCIP_SET* set, /**< global SCIP settings */
    153 SCIP_PROB* prob, /**< transformed problem */
    154 SCIP_LP* lp, /**< LP data */
    155 SCIP_PRICESTORE* pricestore, /**< pricing storage */
    156 SCIP_Real* lowerbound, /**< local lower bound computed by the pricer */
    157 SCIP_Bool* stopearly, /**< should pricing be stopped, although new variables were added? */
    158 SCIP_RESULT* result /**< result of the pricing process */
    159 );
    160
    161/** sets priority of variable pricer */
    163 SCIP_PRICER* pricer, /**< variable pricer */
    164 SCIP_SET* set, /**< global SCIP settings */
    165 int priority /**< new priority of the variable pricer */
    166 );
    167
    168/** sets copy callback of pricer */
    170 SCIP_PRICER* pricer, /**< variable pricer */
    171 SCIP_DECL_PRICERCOPY ((*pricercopy)) /**< copy callback of pricer */
    172 );
    173
    174/** sets destructor callback of pricer */
    176 SCIP_PRICER* pricer, /**< pricer */
    177 SCIP_DECL_PRICERFREE ((*pricerfree)) /**< destructor of pricer */
    178 );
    179
    180/** sets initialization callback of pricer */
    182 SCIP_PRICER* pricer, /**< pricer */
    183 SCIP_DECL_PRICERINIT ((*pricerinit)) /**< initialize pricer */
    184 );
    185
    186/** sets deinitialization callback of pricer */
    188 SCIP_PRICER* pricer, /**< pricer */
    189 SCIP_DECL_PRICEREXIT ((*pricerexit)) /**< deinitialize pricer */
    190 );
    191
    192/** sets solving process initialization callback of pricer */
    194 SCIP_PRICER* pricer, /**< pricer */
    195 SCIP_DECL_PRICERINITSOL ((*pricerinitsol))/**< solving process initialization callback of pricer */
    196 );
    197
    198/** sets solving process deinitialization callback of pricer */
    200 SCIP_PRICER* pricer, /**< pricer */
    201 SCIP_DECL_PRICEREXITSOL ((*pricerexitsol))/**< solving process deinitialization callback of pricer */
    202 );
    203
    204#ifdef __cplusplus
    205}
    206#endif
    207
    208#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 SCIPpricerSetInit(SCIP_PRICER *pricer, SCIP_DECL_PRICERINIT((*pricerinit)))
    Definition: pricer.c:565
    void SCIPpricerSetExitsol(SCIP_PRICER *pricer, SCIP_DECL_PRICEREXITSOL((*pricerexitsol)))
    Definition: pricer.c:598
    void SCIPpricerSetExit(SCIP_PRICER *pricer, SCIP_DECL_PRICEREXIT((*pricerexit)))
    Definition: pricer.c:576
    SCIP_RETCODE SCIPpricerFarkas(SCIP_PRICER *pricer, SCIP_SET *set, SCIP_PROB *prob, SCIP_RESULT *result)
    Definition: pricer.c:440
    SCIP_RETCODE SCIPpricerDeactivate(SCIP_PRICER *pricer, SCIP_SET *set)
    Definition: pricer.c:377
    void SCIPpricerSetCopy(SCIP_PRICER *pricer, SCIP_DECL_PRICERCOPY((*pricercopy)))
    Definition: pricer.c:543
    SCIP_RETCODE SCIPpricerCreate(SCIP_PRICER **pricer, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, const char *name, const char *desc, int priority, SCIP_Bool delay, SCIP_DECL_PRICERCOPY((*pricercopy)), SCIP_DECL_PRICERFREE((*pricerfree)), SCIP_DECL_PRICERINIT((*pricerinit)), SCIP_DECL_PRICEREXIT((*pricerexit)), SCIP_DECL_PRICERINITSOL((*pricerinitsol)), SCIP_DECL_PRICEREXITSOL((*pricerexitsol)), SCIP_DECL_PRICERREDCOST((*pricerredcost)), SCIP_DECL_PRICERFARKAS((*pricerfarkas)), SCIP_PRICERDATA *pricerdata)
    Definition: pricer.c:174
    SCIP_RETCODE SCIPpricerInitsol(SCIP_PRICER *pricer, SCIP_SET *set)
    Definition: pricer.c:306
    void SCIPpricerSetInitsol(SCIP_PRICER *pricer, SCIP_DECL_PRICERINITSOL((*pricerinitsol)))
    Definition: pricer.c:587
    SCIP_RETCODE SCIPpricerActivate(SCIP_PRICER *pricer, SCIP_SET *set)
    Definition: pricer.c:354
    SCIP_RETCODE SCIPpricerCopyInclude(SCIP_PRICER *pricer, SCIP_SET *set, SCIP_Bool *valid)
    Definition: pricer.c:87
    SCIP_RETCODE SCIPpricerExec(SCIP_PRICER *pricer, SCIP_SET *set, SCIP_PROB *prob, SCIP_LP *lp, SCIP_PRICESTORE *pricestore, SCIP_Real *lowerbound, SCIP_Bool *stopearly, SCIP_RESULT *result)
    Definition: pricer.c:483
    SCIP_RETCODE SCIPpricerExit(SCIP_PRICER *pricer, SCIP_SET *set)
    Definition: pricer.c:275
    void SCIPpricerEnableOrDisableClocks(SCIP_PRICER *pricer, SCIP_Bool enable)
    Definition: pricer.c:703
    void SCIPpricerSetPriority(SCIP_PRICER *pricer, SCIP_SET *set, int priority)
    Definition: pricer.c:649
    SCIP_RETCODE SCIPpricerRedcost(SCIP_PRICER *pricer, SCIP_SET *set, SCIP_PROB *prob, SCIP_Real *lowerbound, SCIP_Bool *stopearly, SCIP_RESULT *result)
    Definition: pricer.c:396
    SCIP_RETCODE SCIPpricerExitsol(SCIP_PRICER *pricer, SCIP_SET *set)
    Definition: pricer.c:330
    SCIP_RETCODE SCIPpricerInit(SCIP_PRICER *pricer, SCIP_SET *set)
    Definition: pricer.c:235
    SCIP_RETCODE SCIPpricerFree(SCIP_PRICER **pricer, SCIP_SET *set)
    Definition: pricer.c:208
    void SCIPpricerSetFree(SCIP_PRICER *pricer, SCIP_DECL_PRICERFREE((*pricerfree)))
    Definition: pricer.c:554
    SCIP_DECL_PRICERINIT(ObjPricerVRP::scip_init)
    Definition: pricer_vrp.cpp:83
    SCIP_DECL_PRICERREDCOST(ObjPricerVRP::scip_redcost)
    Definition: pricer_vrp.cpp:225
    SCIP_DECL_PRICERFARKAS(ObjPricerVRP::scip_farkas)
    Definition: pricer_vrp.cpp:246
    public methods for variable pricers
    Definition: heur_padm.c:135
    type definitions for LP management
    type definitions for message output methods
    type definitions for variable pricers
    #define SCIP_DECL_PRICERFREE(x)
    Definition: type_pricer.h:63
    #define SCIP_DECL_PRICEREXIT(x)
    Definition: type_pricer.h:79
    #define SCIP_DECL_PRICEREXITSOL(x)
    Definition: type_pricer.h:101
    #define SCIP_DECL_PRICERINITSOL(x)
    Definition: type_pricer.h:90
    struct SCIP_PricerData SCIP_PRICERDATA
    Definition: type_pricer.h:45
    #define SCIP_DECL_PRICERCOPY(x)
    Definition: type_pricer.h:55
    type definitions for storing priced variables
    type definitions for storing and manipulating the main problem
    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