Scippy

SCIP

Solving Constraint Integer Programs

type_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-2016 Konrad-Zuse-Zentrum */
7 /* fuer Informationstechnik Berlin */
8 /* */
9 /* SCIP is distributed under the terms of the ZIB Academic License. */
10 /* */
11 /* You should have received a copy of the ZIB Academic License */
12 /* along with SCIP; see the file COPYING. If not email to scip@zib.de. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file type_pricer.h
17  * @ingroup TYPEDEFINITIONS
18  * @brief type definitions for variable pricers
19  * @author Tobias Achterberg
20  */
21 
22 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
23 
24 #ifndef __SCIP_TYPE_PRICER_H__
25 #define __SCIP_TYPE_PRICER_H__
26 
27 #include "scip/def.h"
28 #include "scip/type_retcode.h"
29 #include "scip/type_scip.h"
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
35 typedef struct SCIP_Pricer SCIP_PRICER; /**< variable pricer data */
36 typedef struct SCIP_PricerData SCIP_PRICERDATA; /**< locally defined variable pricer data */
37 
38 
39 /** copy method for pricer plugins (called when SCIP copies plugins)
40  *
41  * input:
42  * - scip : SCIP main data structure
43  * - pricer : the variable pricer itself
44  * - valid : was the copying process valid?
45  */
46 #define SCIP_DECL_PRICERCOPY(x) SCIP_RETCODE x (SCIP* scip, SCIP_PRICER* pricer, SCIP_Bool* valid)
47 
48 /** destructor of variable pricer to free user data (called when SCIP is exiting)
49  *
50  * input:
51  * - scip : SCIP main data structure
52  * - pricer : the variable pricer itself
53  */
54 #define SCIP_DECL_PRICERFREE(x) SCIP_RETCODE x (SCIP* scip, SCIP_PRICER* pricer)
55 
56 /** initialization method of variable pricer (called after problem was transformed and pricer is active)
57  *
58  * input:
59  * - scip : SCIP main data structure
60  * - pricer : the variable pricer itself
61  */
62 #define SCIP_DECL_PRICERINIT(x) SCIP_RETCODE x (SCIP* scip, SCIP_PRICER* pricer)
63 
64 /** deinitialization method of variable pricer (called before transformed problem is freed and pricer is active)
65  *
66  * input:
67  * - scip : SCIP main data structure
68  * - pricer : the variable pricer itself
69  */
70 #define SCIP_DECL_PRICEREXIT(x) SCIP_RETCODE x (SCIP* scip, SCIP_PRICER* pricer)
71 
72 /** solving process initialization method of variable pricer (called when branch and bound process is about to begin)
73  *
74  * This method is called when the presolving was finished and the branch and bound process is about to begin.
75  * The variable pricer may use this call to initialize its branch and bound specific data.
76  *
77  * input:
78  * - scip : SCIP main data structure
79  * - pricer : the variable pricer itself
80  */
81 #define SCIP_DECL_PRICERINITSOL(x) SCIP_RETCODE x (SCIP* scip, SCIP_PRICER* pricer)
82 
83 /** solving process deinitialization method of variable pricer (called before branch and bound process data is freed)
84  *
85  * This method is called before the branch and bound process is freed.
86  * The variable pricer should use this call to clean up its branch and bound data.
87  *
88  * input:
89  * - scip : SCIP main data structure
90  * - pricer : the variable pricer itself
91  */
92 #define SCIP_DECL_PRICEREXITSOL(x) SCIP_RETCODE x (SCIP* scip, SCIP_PRICER* pricer)
93 
94 /** reduced cost pricing method of variable pricer for feasible LPs
95  *
96  * Searches for variables that can contribute to improve the current LP's solution value.
97  * In standard branch-and-price, these are variables with negative dual feasibility, that is negative
98  * reduced costs for non-negative variables, positive reduced costs for non-positive variables,
99  * and non-zero reduced costs for variables that can be negative and positive.
100  *
101  * The method is called in the LP solving loop after an LP was proven to be feasible.
102  *
103  * Whenever the pricer finds a variable with negative dual feasibility, it should call SCIPcreateVar()
104  * and SCIPaddPricedVar() to add the variable to the problem. Furthermore, it should call the appropriate
105  * methods of the constraint handlers to add the necessary variable entries to the constraints.
106  *
107  * In the usual case that the pricer either adds a new variable or ensures that there are no further variables with
108  * negative dual feasibility, the result pointer should be set to SCIP_SUCCESS. Only if the pricer aborts pricing
109  * without creating a new variable, but there might exist additional variables with negative dual feasibility, the
110  * result pointer should be set to SCIP_DIDNOTRUN. In this case, which sometimes is referred to as "early branching",
111  * the lp solution will not be used as a lower bound. The pricer can, however, store a valid lower bound in the
112  * lowerbound pointer. If you use your own branching rule (e.g., to branch on constraints), make sure that it is able
113  * to branch on pseudo solutions. Otherwise, SCIP will use its default branching rules (which all branch on
114  * variables). This could disturb the pricing problem or branching might not even be possible, e.g., if all yet created
115  * variables have already been fixed.
116  *
117  * input:
118  * - scip : SCIP main data structure
119  * - pricer : the variable pricer itself
120  * - lowerbound : pointer to store a lower bound found by the pricer
121  * - stopearly : should pricing be stopped, although new variables were added? (doing early branching)
122  * - result : pointer to store the result of the pricer call
123  *
124  * possible return values for *result:
125  * - SCIP_SUCCESS : at least one improving variable was found, or it is ensured that no such variable exists
126  * - SCIP_DIDNOTRUN : the pricing process was aborted by the pricer, there is no guarantee that the current LP solution is
127  * optimal
128  *
129  */
130 #define SCIP_DECL_PRICERREDCOST(x) SCIP_RETCODE x (SCIP* scip, SCIP_PRICER* pricer, SCIP_Real* lowerbound, SCIP_Bool* stopearly, SCIP_RESULT* result)
131 
132 /** Farkas pricing method of variable pricer for infeasible LPs
133  *
134  * Searches for variables that can contribute to the feasibility of the current LP.
135  * In standard branch-and-price, these are variables with positive Farkas values:
136  *
137  * The LP was proven infeasible, so we have an infeasibility proof by the dual Farkas multipliers y.
138  * With the values of y, an implicit inequality y^T A x >= y^T b is associated, with b given
139  * by the sides of the LP rows and the sign of y:
140  * - if y_i is positive, b_i is the left hand side of the row,
141  * - if y_i is negative, b_i is the right hand side of the row.
142  *
143  * y is chosen in a way, such that the valid inequality y^T A x >= y^T b is violated by all x,
144  * especially by the (for this inequality least infeasible solution) x' defined by
145  * x'_i := ub_i, if y^T A_i >= 0
146  * x'_i := lb_i, if y^T A_i < 0.
147  * Pricing in this case means to add variables i with positive Farkas value, i.e. y^T A_i x'_i > 0.
148  *
149  * The method is called in the LP solving loop after an LP was proven to be infeasible.
150  *
151  * Whenever the pricer finds a variable with positive Farkas value, it should call SCIPcreateVar()
152  * and SCIPaddPricedVar() to add the variable to the problem. Furthermore, it should call the appropriate
153  * methods of the constraint handlers to add the necessary variable entries to the constraints.
154  *
155  * input:
156  * - scip : SCIP main data structure
157  * - pricer : the variable pricer itself
158  * - result : pointer to store the result of the pricer call
159  *
160  * possible return values for *result:
161  * - SCIP_SUCCESS : at least one variable was found, which can contribute to the feasibility of the current LP,
162  * or it is ensured that no such variable exists
163  * - SCIP_DIDNOTRUN : the pricing process was aborted by the pricer, there is no guarantee that the current LP is indeed infeasible
164  */
165 #define SCIP_DECL_PRICERFARKAS(x) SCIP_RETCODE x (SCIP* scip, SCIP_PRICER* pricer, SCIP_RESULT* result)
166 
167 #ifdef __cplusplus
168 }
169 #endif
170 
171 #endif
type definitions for return codes for SCIP methods
type definitions for SCIP&#39;s main datastructure
struct SCIP_PricerData SCIP_PRICERDATA
Definition: type_pricer.h:36
common defines and data types used in all packages of SCIP