SCIP Doxygen Documentation
Loading...
Searching...
No Matches
xternal.c
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-2026 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 xternal.c
26 * @brief main document page
27 * @author Tobias Achterberg
28 * @author Timo Berthold
29 * @author Tristan Gally
30 * @author Gerald Gamrath
31 * @author Stefan Heinz
32 * @author Gregor Hendel
33 * @author Mathias Kinder
34 * @author Marc Pfetsch
35 * @author Stefan Vigerske
36 * @author Robert Waniek
37 * @author Kati Wolter
38 * @author Michael Winkler
39 */
40
41/*--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
42
43/** @mainpage Overview
44 *
45 * @section WHATISSCIP What is SCIP?
46 *
47 * \SCIP is a framework to solve constraint integer programs (CIPs) and mixed-integer nonlinear programs. In particular,
48 *
49 * - \SCIP incorporates a mixed-integer programming (MIP) solver as well as
50 * - an LP based mixed-integer nonlinear programming (MINLP) solver, and
51 * - is a framework for branch-cut-and-price.
52 *
53 * Since version 10, \SCIP can optionally be configured to solve mixed-integer linear programs in a numerically exact
54 * solving mode and produce certificates that can be independently verified, see \ref EXACT "How to use the numerically exact solving mode" for details.
55 *
56 * See the web site of <a href="http://scipopt.org">\SCIP</a> for more information about licensing and how to download \SCIP.
57 *
58 * <b style="color: blue">If you are new to SCIP and don't know where to start you should have a look at the
59 * @ref GETTINGSTARTED "first steps walkthrough"
60 * .</b>
61 *
62 * @section TABLEOFCONTENTS Structure of this manual
63 *
64 * This manual gives an accessible introduction to the functionality of the SCIP code in the following chapters
65 *
66 * Setup and news
67 * - @subpage INSTALL
68 * - @subpage FAQ
69 * - @subpage CHG
70 *
71 * Tutorials and guides
72 * - @subpage GETTINGSTARTED
73 * - @subpage SHELL
74 * - @subpage PROGRAMMING "Important programming concepts for working with(in) SCIP"
75 * - @subpage START
76 * - @subpage DOC
77 * - @subpage HOWTOADD "Detailed guides for adding user plugins"
78 * - @subpage HOWTOUSESECTION "Detailed guides for advanced SCIP topics"
79 *
80 * Examples and applications
81 * - @subpage EXAMPLES "Coding examples in C and C++ in the source code distribution"
82 * - @subpage APPLICATIONS "Extensions of SCIP for specific applications"
83 *
84 * References
85 * - @subpage WHATPROBLEMS "Supported types of optimization problems"
86 * - @subpage FILEREADERS "Readable file formats"
87 * - @subpage INTERFACES
88 * - @subpage PARAMETERS
89 * - @subpage AUTHORS "SCIP Authors"
90 * - @subpage LICENSE
91 * - @subpage EXTERNALDOC "Links to external documentation"
92 *
93 *
94 * @section QUICKSTART Quickstart
95 *
96 * Let's consider the following minimal example in LP format. A 4-variable problem with a single, general integer
97 * variable and three linear constraints
98 *
99 * \verbinclude simple.lp
100 *
101 * Saving this file as "simple.lp" allows to read it into SCIP and solve it by calling the scip binary with the `-f` flag to solve the problem from the provided file and exit.
102 *
103 * ```
104 * scip -f simple.lp
105 * ```
106 * reads and optimizes this model in no time:
107 *
108 * \verbinclude output.log
109 *
110 * @version 10.1.0
111 *
112 * \image html scippy.png
113 */
114
115/*--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
116
117/** @page LPI Available implementations of the LP solver interface
118 *
119 * SCIP provides a range of different interfaces to LP solvers:
120 *
121 * LPI name | LP solver
122 * ---------|----------
123 * `spx` | SoPlex
124 * `cpx` | IBM ILOG CPLEX
125 * `xprs` | FICO XPress
126 * `grb` | Gurobi (version at least 7.0.2 required)
127 * `clp` | COIN-OR CLP (interface currently sometimes produces wrong results)
128 * `glop` | Google Glop (contained in OR-tools)
129 * `msk` | Mosek (version at least 7.0.0 required)
130 * `qsopt` | QSopt (experimental)
131 * `highs` | HiGHS (beta, sometimes failing)
132 * `none` | disables LP solving entirely (not recommended; only for technical reasons)
133 */
134
135/*--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
136
137/** @page LPIEXACT Available implementations of the numerically exact LP solver interface
138 *
139 * SCIP provides the following interfaces to exact LP solvers:
140 *
141 * LPI name | LP solver
142 * ---------|----------
143 * `spx` | SoPlex
144 * `qsoptex`| QSopt_ex (experimental)
145 * `none` | no exact LP solver linked
146 */
147
148/*--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
149
150/** @page NLPISOLVERS Available implementations of the NLP solver interface
151 *
152 * SCIP implements the NLP solver interface for the solvers <a href="https://conopt.com">CONOPT</a>, <a href="https://github.com/coin-or/Ipopt">IPOPT</a>, <a
153 * href="https://worhp.de/">WORHP</a>, and <a href="http://www.mcs.anl.gov/~leyffer/solvers.html">FilterSQP</a>. In
154 * contrast to the implementations of the LP solver interface, SCIP can be compiled with multiple NLP solvers and selects
155 * the solver with the highest priority at the beginning of the solving process.
156 * Currently, the priorities are, in descending order: CONOPT, Ipopt, WORHP/IP, FilterSQP, WORHP/SQP.
157 *
158 * If more than one solver is available, then it is possible to solve all NLPs during the solving process with all
159 * available NLP solvers by setting the parameter `nlpi/all/priority` to the highest value.
160 * In this case, SCIP uses the solution from a solver that provides the best objective value. Other possible use
161 * cases for the availability of multiple solvers have not been implemented yet.
162 *
163 * In the @ref MAKE "GNU make" based build system, building the implementations of the interface for CONOPT, FilterSQP, IPOPT, and
164 * WORHP can be enabled by specifying `CONOPT=true`, `FILTERSQP=true`, `IPOPT=true`, and `WORHP=true`, respectively, as argument to the
165 * `make` call.
166 * In the @ref CMAKE "CMAKE" based build system, building the implementation of the interface for CONOPT, IPOPT and WORHP can be
167 * enabled by specifying `CONOPT=on`, `IPOPT=on` and `WORHP=on`, respectively, as argument to the `cmake` call.
168 *
169 * @section NLPISOLVERS_CONOPT CONOPT
170 *
171 * <b>CONOPT</b> is a feasible path solver based on advanced active set methods. Originally developed by ARKI Consulting
172 * & Development A/S in Denmark, CONOPT was acquired by GAMS in 2024. It is free for academic uses and is available at
173 * <a href="https://www.conopt.com">https://www.conopt.com</a>.
174 *
175 * @section NLPISOLVERS_IPOPT IPOPT
176 *
177 * <b>IPOPT</b> implements a primal-dual interior point method and uses line searches based on filter methods. It has
178 * been developed by Andreas W&auml;chter and Carl Laird and is available under the Eclipse Public License on <a
179 * href="https://www.coin-or.org/">COIN-OR</a>.
180 *
181 * @section NLPISOLVERS_WORHP WORHP
182 *
183 * <b>WORHP</b> implements a sequential quadratic programming method and a penalty-interior point algorithm. It is
184 * developed at the <a href="https://www.uni-bremen.de/en/">University of Bremen</a> and is free for academic
185 * purposes.
186 *
187 * @section NLPISOLVERS_FILTERSQP FilterSQP
188 *
189 * <b>FilterSQP</b> implements a sequential quadratic programming method. It has been developed by Roger Fletcher
190 * and Sven Leyffer. It is not publicly available, but may be obtained from Sven Leyffer on request.
191 */
192
193/*--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
194
195/**@page GETTINGSTARTED First Steps Walkthrough
196 *
197 * @section GETTINGSTARTED_BLACKBOX Use SCIP to solve a problem
198 *
199 * @subsection GETTINGSTARTED_BLACKBOX_WHY Why SCIP?
200 *
201 * Charlotte lectures at a university and she wants her students to get in touch with solving constraint integer programs (CIPs).
202 * She would like to use SCIP for this purpose because it allows the students to look at the full source code
203 * and SCIP comes with a permissive open source \ref LICENSE "license".
204 * Also, her advisor told her that there are various \ref INTERFACES "interfaces" to SCIP.
205 *
206 * @subsection GETTINGSTARTED_BLACKBOX_PROBLEMS What Kinds Of Problems?
207 *
208 * As a first step she checks \ref WHATPROBLEMS "what types of problems" \SCIP can solve and
209 * \ref FILEREADERS "what are readable formats", and is happy to find MIPs to be among them.
210 *
211 * @subsection GETTINGSTARTED_BLACKBOX_INSTALL Setup
212 *
213 * Charlotte now needs to \ref INSTALL "install SCIP".
214 * She works on a recent computer with a windows system and already has the <a href="https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads">Visual C++ Redistributable Packages</a> and <a href="https://github.com/oneapi-src/oneTBB">TBB</a> installed.
215 *
216 * Having these prerequisites in place, Charlotte downloads the 64-bit windows exectuable from the <a href="https://scipopt.org/index.php#download">download page</a> and installs it without a problem.
217 * They also read about the <a href="http://www.pokutta.com/blog/pages/scip/scip-teaching.html"> dockerized SCIP container</a> which she wants
218 * to recommend to her students, in case they are unable to install SCIP on their own machines.
219 *
220 * @subsection GETTINGSTARTED_BLACKBOX_SOLVE Solve A First Problem
221 *
222 * To test her installation and get a first feeling for SCIP, Charlotte follows the steps described in the \ref QUICKSTART "quickstart" section to solve a first simple lp problem.
223 *
224 * She has just solved a problem, using SCIP in the command-based mode, by passing a command to the scip call via the `-c` flag.
225 * These commands can also be typed into the interactive shell, that one uses by just calling the binary `scip`.
226 *
227 * After the first solution process worked like a charm, Charlotte downloads a more complicated problem file from the <a href="https://miplib.zib.de/instance_details_enlight_hard.html">MIPLIB 2017</a> page
228 * and follows the \ref SHELL_AFTERINSTALL "interactive shell tutorial".
229 * There, she already learns quite a lot about the solving process and how to work with the interactive shell.
230 *
231 * @subsection GETTINGSTARTED_BLACKBOX_HELP Getting Help
232 *
233 * Feeling happy about having already solved some instances and having worked in interactive mode, Charlotte is curious on what more options SCIP has.
234 * She types `scip -h` to find out.
235 *
236 * She feels confident to being able to understand and use some of the other options, like `-l` to write the output to a logfile, or `-b` to pass a file containing the commands to be executed by scip.
237 * There are some commands that do not yet make a lot of sense to her, but she doesn't worry about it for now.
238 * She will familiarize herself with it over time and with experience.
239 *
240 * @section GETTINGSTARTED_DEVELOP Develop A Custom Plugin
241 *
242 * Alex is a researcher in Charlotte's group and is working on problems that have a very special structure that he hopes to be able to exploit in the solving process.
243 *
244 * Alex heard Charlotte talk about SCIP.
245 * She explained that SCIP is plugin-based, that is, different components (plugins) are implemented using a generic interface and that it is very easy to write your own plugins, like constraint handlers, heuristics etc.
246 * So Alex decides to give it a go and dive into SCIP.
247 *
248 * @subsection GETTINGSTARTED_DEVELOP_PREREQUISITES Prerequisites And Setup
249 *
250 * After some time of using SCIP, he feels confident enough to dig into the source code and decides to write his own plugin.
251 * Alex likes to use his linux machine for developing code, because in his experience compilation is easiest there.
252 *
253 * He starts by downloading the latest <a href="http://scipopt.org/#download">source code tarball</a>,
254 * unpacking it and compiling via \ref CMAKE "cmake", typing `mkdir build; cd build; cmake ..; make`.
255 *
256 * @subsection GETTINGSTARTED_DEVELOP_HELP Getting help
257 *
258 * Before writing any code, he quickly scans over the contents of the \ref PROGRAMMING "Programming with SCIP" page,
259 * so that he knows about some of the pitfalls, best practices and mechanisms.
260 * If a problem comes up later or he gets stuck, he knows what to look out for and where to find help.
261 *
262 * Whenever Alex gets stuck inside the code, he makes use of the extensive documentation to \ref DOC "search for interface functions".
263 *
264 * @subsection GETTINGSTARTED_DEVELOP_EXAMPLE Writing An Example
265 *
266 * Alex is now ready to write his very first example, he creates a new folder `MinEx` under `examples` and puts two files in there:
267 * `CMakeLists.txt`:
268 * ```
269 * cmake_minimum_required(VERSION 3.11)
270 *
271 * project(minex)
272 * find_package(SCIP REQUIRED)
273 * include_directories(${SCIP_INCLUDE_DIRS})
274 *
275 * add_executable(minex
276 * src/cmain.c)
277 *
278 * target_link_libraries(minex ${SCIP_LIBRARIES})
279 *
280 * if( TARGET examples )
281 * add_dependencies( examples minex )
282 * endif()
283 * ```
284 *
285 * and `cmain.c` in a subfolder `src`:
286 * ```
287 * #include <string.h>
288 * #include <scip/scip.h>
289 *
290 * int main( int argc, char** argv )
291 * {
292 * SCIP* scip = NULL;
293 * SCIP_CALL( SCIPcreate(&scip) ); // initialize SCIP
294 * SCIPinfoMessage(scip, NULL, "Hello world.\n"); // output greeting
295 * SCIP_CALL( SCIPfree(&scip) ); // free SCIP
296 * BMScheckEmptyMemory();
297 * return 0;
298 * }
299 * ```
300 *
301 * This is a minimal example that just prints "Hello world." and exits.
302 * Alex compiles and runs it via cmake with the following command:
303 * ```
304 * mkdir build; cd build; cmake .. -DSCIP_DIR=../../build/; make; ./minex
305 * ```
306 *
307 * After having successfully written this minimal example, Alex follows the instructions to \ref START "start a new project" to start his actual project and extend this most basic code.
308 *
309 * @subsection GETTINGSTARTED_DEVELOP_CONSTRAINTHANDLER Writing A Plugin
310 *
311 * Alex now needs a custom constraint handler in his project, for that he will write a custom plugin.
312 * He looks up the instructions in the \ref HOWTOADD "How to add..." page and is
313 * very happy to find \ref CONS "a page with a detailed description" what he has to do.
314 *
315 * Furthermore he found exercises for implementing plugins for the example of the
316 * linear ordering problem. The corresponding code framework
317 * (<a href="https://scipopt.org/workshop2018/pyscipopt-exercises.tgz">Python</a> or
318 * <a href="https://scipopt.org/workshop2018/exercise.pdf">C/C++</a>)
319 * could form a good starting point for a new project as well.
320 *
321 * @subsection GETTINGSTARTED_DEVELOP_REOPTMIZATION Using Functionality In A Plugin
322 *
323 * After implementing his own constraint handler Alex realizes that he needs to use repotimization in his project.
324 * He looks up the \ref HOWTOUSESECTION "How to use..." section and finds some more information about \ref REOPT "how to use reoptimization".
325 *
326 */
327
328/**@page INSTALL Installing SCIP
329 *
330 * There are two options to get a running SCIP on your system.
331 * You can either use one of the installers or you can compile it yourself.
332 *
333 * Which one you choose depends on your use case and your level of expertise.
334 * If you just want to use SCIP as a black box solver you should use an installer with a precompiled binary from the <a href="http://scipopt.org/#download">download section</a>.
335 * This is highly recommended for new users.
336 * If you are just curious and want to try it out you can use the <a href="http://www.pokutta.com/blog/pages/scip/scip-teaching.html"> dockerized SCIP container</a>.
337 *
338 * However, if you want to develop your own plugin for SCIP, you have to compile SCIP or the SCIPOptSuite from source code, which are available as a tarball from the <a href="http://scipopt.org/#download">download page</a>.
339 * Note that you might need some level of experience to be able to do this, this is described in the following.
340 *
341 * SCIP lets you choose freely between its own, manually maintained Makefile system
342 * or the CMake cross platform build system generator. For new users, we strongly
343 * recommend to use CMake, if available on their targeted platform.
344 *
345 * Be aware that generated libraries and binaries of both systems might be different and incompatible.
346 *
347 * - @subpage md_INSTALL "Installation instructions"
348 * - @subpage LPI "Available implementations of the LP solver interface"
349 * - @subpage LPIEXACT "Available implementations of the exact LP solver interface"
350 * - @subpage NLPISOLVERS "Available implementations of the NLP solver interface"
351 * - @subpage INSTALL_APPLICATIONS_EXAMPLES "Installation of applications and examples"
352 */
353
354/**@page PROGRAMMING Programming with SCIP
355 *
356 * - @subpage CODE "Coding style guidelines"
357 * - @subpage SRCORGA "Organization of source code"
358 * - @subpage OBJ "Creating, capturing, releasing, and adding data objects"
359 * - @subpage MEMORY "Using the memory functions of SCIP"
360 * - @subpage DEBUG "Debugging"
361 * - @subpage STAGES "SCIP stages"
362 */
363
364/**@page HOWTOADD How to add ...
365 *
366 * Below you find for most plugin types a detailed description of how to implement and add them to \SCIP.
367 *
368 * - @subpage CONS "Constraint handlers"
369 * - @subpage PRICER "Variable pricers"
370 * - @subpage PRESOL "Presolvers"
371 * - @subpage SEPA "Separators"
372 * - @subpage PROP "Propagators"
373 * - @subpage BRANCH "Branching rules"
374 * - @subpage CUTSEL "Cut selectors"
375 * - @subpage NODESEL "Node selectors"
376 * - @subpage HEUR "Primal heuristics"
377 * - @subpage IISFINDER "IIS finders"
378 * - @subpage DIVINGHEUR "Diving heuristics"
379 * - @subpage RELAX "Relaxation handlers"
380 * - @subpage READER "File readers"
381 * - @subpage DIALOG "Dialogs"
382 * - @subpage DISP "Display columns"
383 * - @subpage EVENT "Event handler"
384 * - @subpage EXPRHDLR "Expression handlers"
385 * - @subpage NLHDLR "Nonlinear handlers"
386 * - @subpage NLPI "Interfaces to NLP solvers"
387 * - @subpage EXPRINT "Interfaces to expression interpreters"
388 * - @subpage PARAM "additional user parameters"
389 * - @subpage TABLE "Statistics tables"
390 * - @subpage BENDER "Benders' decomposition"
391 * + @subpage BENDERSCUT "Benders' decomposition cuts"
392 */
393
394/**@page HOWTOUSESECTION How to use ...
395 *
396 * - @subpage TEST "How to run automated tests with SCIP"
397 * - @subpage EXACT "How to use the numerically exact solving mode"
398 * - @subpage CONF "How to use conflict analysis"
399 * - @subpage COUNTER "How to use SCIP to count feasible solutions"
400 * - @subpage REOPT "How to use reoptimization in SCIP"
401 * - @subpage CONCSCIP "How to use the concurrent solving mode in SCIP"
402 * - @subpage MINUCIIS "How to deduce reasons for infeasibility in SCIP"
403 * - @subpage DECOMP "How to provide a problem decomposition"
404 * - @subpage BENDDECF "How to use the Benders' decomposition framework"
405 * - @subpage TRAINESTIMATION "How to train custom tree size estimation for SCIP"
406 * - @subpage SYMMETRY "How to use symmetry handling in SCIP"
407 * - @subpage PROBINGDIVING "How to use probing and diving mode"
408 */
409
410/**@page AUTHORS SCIP Authors
411 *
412 * A list of all current and former developers as well as contributors can
413 * be found on the
414 * <a class="el" href="http://scipopt.org/#developers">Main Web Page</a>.
415 *
416 */
417
418/**@page EXTERNALDOC Links to external documentation
419 *
420 * <a class="el" href="https://www.cgudapati.com/integer-programming/2019/12/15/Getting-Started-With-SCIP-Optimization-Suite.html">Getting Started with SCIP optimization in C++: A toy example</a> by Chaitanya Gudapati.
421 *
422 */
423
424/**@page CHG Release notes and changes between different versions of SCIP
425 *
426 * New features, peformance improvements, and interface changes between different versions of SCIP are documented in the
427 * release notes:
428 *
429 * - \subpage RN10 "SCIP 10"
430 * - \subpage RN9 "SCIP 9"
431 * - \subpage RN8 "SCIP 8"
432 * - \subpage RN7 "SCIP 7.0"
433 * - \subpage RN6 "SCIP 6.0"
434 * - \subpage RN5 "SCIP 5.0"
435 * - \subpage RN4 "SCIP 4.0"
436 * - \subpage RN3_2 "SCIP 3.2"
437 * - \subpage RN3_1 "SCIP 3.1"
438 * - \subpage RN3_0 "SCIP 3.0"
439 * - \subpage RN2_1 "SCIP 2.1"
440 * - \subpage RN2_0 "SCIP 2.0"
441 * - \subpage RN1_2 "SCIP 1.2"
442 * - \subpage RN1_1 "SCIP 1.1"
443 * - \subpage RN1_0 "SCIP 1.0"
444 * - \subpage RN0_9 "SCIP 0.9"
445 * - \subpage RN0_8 "SCIP 0.8"
446 * - \subpage RN0_7 "SCIP 0.7"
447 *
448 */
449
450/**@page WHATPROBLEMS What types of optimization problems does SCIP solve?
451 *
452 * As a stand-alone solver, \SCIP can solve mixed-integer nonlinear programs \b (MINLPs), to which it applies
453 * an LP based spatial branch-and-cut algorithm. This method is guaranteed to solve bounded MINLPs
454 * within a given numerical tolerance in a finite amount of time. In particular, \SCIP is a stand-alone
455 * solver for mixed-integer linear programs \b (MIPs).
456 *
457 * As a framework, \SCIP also provides the tools to solve constraint optimization problems defined over
458 * integer and continuous variables. Therefore, the design of \SCIP
459 * supports the easy integration of constraints of arbitrary type into the solver.
460 * More precisely, \SCIP can handle the class of constraint integer programs \b (CIPs), which are constraint optimization problems
461 * that become linear programs (LPs) after the integer variables are fixed.
462 *
463 * @section PROBLEMCLASSES Some important subclasses of CIP and MINLP
464 *
465 * The following table gives a non-exhaustive list of common types of mathematical optimization problems that can be solved
466 * through \SCIP itself or one of its extensions. Some recommendations are given on how to compile \SCIP for a
467 * certain problem class and how make best use of \SCIP. The file format column gives some common file
468 * formats for every class. Note that since some of the mentioned problem classes are more general than others (like
469 * every LP is a MIP is an MINLP), the formats for the superclass should always work just as fine, although they
470 * may be less common for the class at hand.
471 *
472 * Please see also the pages on \ref EXAMPLES "SCIP Examples" and \ref APPLICATIONS "SCIP Applications" to learn more on how
473 * to extend \SCIP for a particular MIP, MINLP, or CIP application.
474 * All examples and applications use the C or C++ APIs of \SCIP. Please have a look at \ref INTERFACES "SCIP interfaces"
475 * to see how to use \SCIP from within other programming languages.
476 *
477 * <table class="types">
478 * <caption align="top">Some problem classes that can be solved by \SCIP</caption>
479 * <tr style="border-bottom: medium solid black;">
480 * <th>Problem class</th>
481 * <th>Mathematical problem description</th>
482 * <th>Supported file formats</th>
483 * <th>Recommendations</th>
484 * </tr>
485 * <tr>
486 * <td>Mixed-integer linear program (MIP)</td>
487 * <td>\f{align*}{
488 * \text{min} \quad& c^T x \\
489 * \text{s.t.} \quad& Ax \geq b \\
490 * &l_{j} \leq x_{j} \leq u_{j} && \forall j \in \mathcal{N} \\
491 * &x_{j} \in \mathbb{Z} && \forall j \in \mathcal{I}
492 * \f}
493 * </td>
494 * <td>
495 * <ul>
496 * <li>\ref reader_cip.h "CIP"</li>
497 * <li>\ref reader_mps.h "MPS"</li>
498 * <li>\ref reader_lp.h "LP"</li>
499 * <li>\ref reader_zpl.h "ZPL"</li>
500 * </ul>
501 * </td>
502 * <td>
503 * <ul>
504 * <li>\SCIP requires an external LP solver to solve LP relaxations, which needs to be specified
505 * at compilation time. By default, it uses SoPlex (<code>LPS=spx</code>). See \ref MAKE for a
506 * list of available LP solver interfaces and how to use them inside \SCIP.</li>
507 * <li>Compile with Zimpl support (<code>ZIMPL=true</code>) to read in Zimpl models directly.</li>
508 * <li>\SCIP comes with many different parameters. Use the provided emphasis settings (see \ref SHELL "this tutorial")
509 * to change many parameters at once and boost the performance.</li>
510 * <li>Test instances are available at <code>check/instances/MIP/</code>.</li>
511 * </ul>
512 * </td>
513 * </tr>
514 * <tr>
515 * <td>Mixed-integer nonlinear program (MINLP)</td>
516 * <td>\f{align*}{
517 * \text{min} \quad& f(x) \\
518 * \text{s.t.} \quad& g_{i}(x) \leq 0 && \forall i \in \mathcal{M} \\
519 * &l_{j} \leq x_{j} \leq u_{j} && \forall j \in \mathcal{N} \\
520 * &x_{j} \in \mathbb{Z} && \forall j \in \mathcal{I}
521 * \f}
522 * </td>
523 * <td>
524 * <ul>
525 * <li>\ref reader_cip.h "CIP"</li>
526 * <li>\ref reader_gms.h "GMS"</li>
527 * <li>\ref reader_osil.h "OSiL"</li>
528 * <li>\ref reader_pip.h "PIP"</li>
529 * <li>\ref reader_zpl.h "ZPL"</li>
530 * <li>For MIQCPS:
531 * <ul>
532 * <li>\ref reader_lp.h "LP"</li>
533 * <li>\ref reader_mps.h "MPS"</li>
534 * </ul>
535 * </li>
536 * </ul>
537 * </td>
538 * <td>
539 * <ul>
540 * <li>Compile with <code>CONOPT=true</code> for better performance.</li>
541 * <li>Compile with <code>IPOPT=true</code> for better performance.</li>
542 * <li>Compile with <code>WORHP=true</code> for better performance.</li>
543 * <li>Compile with <code>FILTERSQP=true</code> for better performance.</li>
544 * <li>See <a href="FAQ\FILEEXT#minlptypes"> Which kind of MINLPs are supported by \SCIP? </a> in the FAQ.</li>
545 * <li>There is an interface for the modelling language AMPL, see \ref INTERFACES.</li>
546 * <li>Mixed-integer quadratically constrained programs (MIQCP) can also be formulated in the file formats
547 * <ul>
548 * <li>\ref reader_lp.h "LP", and</li>
549 * <li>\ref reader_mps.h "MPS".</li>
550 * </ul>
551 * </li>
552 * <li>Test instances are available at <code>check/instances/MINLP/</code>.</li>
553 * </ul>
554 * </td>
555 * </tr>
556 * <tr>
557 * <td>Constraint Integer Program (CIP)</td>
558 * <td>\f{align*}{
559 * \text{min} \quad& c^T x + d^T y \\
560 * \text{s.t.} \quad& C_i(x,y) = \text{true} && \forall i \in \mathcal{M} \\
561 * & x \in \mathbb{Z}^{p}, y \in \mathbb{R}^{n - p}
562 * \f}
563 * where \f$\forall i \in\mathcal{M}, \forall x^* \in \mathbb{Z}^{p},\f$ \f$ \{ y : C_i(x^*, y) = \text{true} \} \f$ is a polyhedron.
564 * </td>
565 * <td>
566 * <ul>
567 * <li>\ref reader_cip.h "CIP"</li>
568 * <li>\ref reader_fzn.h "FlatZinc"</li>
569 * </ul>
570 * </td>
571 * <td>
572 * <ul>
573 * <li>\SCIP supports a limited number of general constraints; see \ref CONS "How to add constraint handlers"
574 * to learn how to extend the \SCIP framework to a given CIP.</li>
575 * <li>Use the emphasis setting <code>set emphasis cpsolver</code> to completely disable LP solves and
576 * use depth-first search with periodic restarts, see also
577 * <a href="FAQ\FILEEXT#scipascpsolver"> Can I use \SCIP as a pure CP solver? </a> in the FAQ.</li>
578 * <li>Test instances are available at <code>check/instances/CP</code>.</li>
579 * </ul>
580 * </td>
581 * <tr>
582 * <td>Convex MINLP</td>
583 * <td>Like MINLP, \f$f\f$ and all \f$g_i\f$ are \b convex.</td>
584 * <td>see MINLP formats</td>
585 * <td>
586 * <ul>
587 * <li>See the comments for MINLP.</li>
588 * <li>In addition, use <code>constraints/nonlinear/assumeconvex = TRUE</code> to inform \SCIP about a convex
589 * problem in cases where the automated detection is not strong enough.</li>
590 * <li>Test instances are available at <code>check/instances/MINLP/circle.lp</code>.</li>
591 * </ul>
592 * </td>
593 * </tr>
594 * <tr>
595 * <td>Linear program (LP)</td>
596 * <td>\f{align*}{
597 * \text{min} \quad& c^T x \\
598 * \text{s.t.} \quad& Ax \geq b \\
599 * & x_{j} \geq 0 && \forall j \in \mathcal{N}
600 * \f}
601 * </td>
602 * <td>see MIP formats</td>
603 * <td>See <a href="FAQ\FILEEXT#scipaslpsolver">Can I use \SCIP as a pure LP solver</a> in the FAQ.</td>
604 * </tr>
605 * <tr>
606 * <td>Pseudoboolean optimization</td>
607 * <td>\f{align*}{
608 * \text{min} \quad& c^T x \\
609 * \text{s.t.} \quad& \sum_{k=0}^p a_{ik} \cdot \prod_{j \in \mathcal{N}_{ik}} x_j \leq b_i && \forall i \in \mathcal{M} \\
610 * &x_{j} \in \{0,1\} && \forall j \in \mathcal{N}
611 * \f}
612 * </td>
613 * <td>
614 * <ul>
615 * <li>\ref reader_wbo.h "WBO"</li>
616 * <li>\ref reader_opb.h "OPB"</li>
617 * </ul>
618 * </td>
619 * <td>
620 * <ul>
621 * <li>Test instances are available at <code>check/instances/PseudoBoolean/</code>.</li>
622 * </ul>
623 * </td>
624 * </tr>
625 * <tr>
626 * <td>Satisfiability (SAT) and variants</td>
627 * <td>\f{align*}{
628 * \text{min} \quad& 0 \\
629 * \text{s.t.} \quad&\bigvee\limits_{j \in B_i} x_j \vee \bigvee\limits_{j \in \bar{B}_i} \neg x_j = \text{true} && \forall i \in \mathcal{M}\\
630 * &x_{j} \in \{\text{false},\text{true}\} && \forall j \in \mathcal{N}
631 * \f}
632 * </td>
633 * <td>
634 * <ul>
635 * <li>\ref reader_cnf.h "CNF"</li>
636 * </ul>
637 * </td>
638 * <td>
639 * <ul>
640 * <li>Use the emphasis setting <code>set emphasis cpsolver</code> to completely disable LP solves and
641 * use depth-first search with periodic restarts, see also
642 * <a href="FAQ\FILEEXT#scipascpsolver"> Can I use \SCIP as a pure CP/SAT solver? </a> in the FAQ.</li>
643 * <li>Test instances are available at <code>check/instances/SAT/</code>.</li>
644 * </ul>
645 * </td>
646 * </tr>
647 * <tr>
648 * <td>Multicriteria optimization</td>
649 * <td>\f{align*}{
650 * \text{min} \quad &(c_1^T x,\ldots,c_k^T x) \\
651 * \text{s.t. } \quad& Ax \geq b \\
652 * &x \in \mathbb{K}^n
653 * \f}
654 * where \f$\mathbb{K}\f$ is either \f$\mathbb{Z}\f$ or \f$\mathbb{R}\f$.
655 * </td>
656 * <td colspan="3"> see the <a href="http://polyscip.zib.de/">PolySCIP web page</a></td>
657 * </tr>
658 * <tr>
659 * <td>Mixed-integer semidefinite program (MISDP)</td>
660 * <td>\f{align*}{
661 * \text{inf} \quad \thinspace & b^T y \\
662 * \text{s.t.} \quad & \sum_{j=1}^m A_j\, y_j - A_0 \succeq 0 \\
663 * & y_j \in \mathbb{Z} && \forall\, j \in \mathcal{I}
664 * \f}
665 * </td>
666 * <td colspan="3"> see the <a href="http://www.opt.tu-darmstadt.de/scipsdp/">SCIP-SDP web page</a></td>
667 * </tr>
668 * </table>
669 *
670 *
671 */
672
673/*--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
674
675/**@page CODE Coding style guidelines
676 *
677 * We follow the following coding style guidelines and recommend them for all developers.
678 *
679 * @section CODESPACING Spacing:
680 *
681 * - Indentation is 3 spaces. No tabs anywhere in the code.
682 * - Every opening parenthesis requires an additional indentation of 3 spaces.
683 *
684 * @refsnippet{src/scip/branch_relpscost.c,SnippetCodeStyleParenIndent}
685 *
686 * - Spaces around all operators.
687 * - Spaces around the arguments inside an if/for/while-statement, as well as inside macros (e.g., SCIP_CALL).
688 * - No spaces between control structure keywords like "if", "for", "while", "switch" and the corresponding brackets.
689 * - No spaces between a function name and the parenthesis in both the definition and function calls.
690 * - Braces are on a new line and not indented.
691 * - Braces in if/for-statements should only be omitted if they enclose a single line.
692 *
693 * @refsnippet{src/scip/branch_relpscost.c,SnippetCodeStyleIfFor}
694 *
695 * - In function declarations, every parameter is on a new line. The name of the parameter starts at column 26,
696 * the comment starts at column 46 (if column-count starts with 1).
697 * - Maximal line length is 120 characters.
698 * - Always only one declaration in a line.
699 * - Joint declaration and initialization is possible at the top-level of a function and in the header of loops.
700 *
701 * @refsnippet{src/scip/cuts.c,SnippetCodeStyleInLoopDeclaration}
702 *
703 * - Variable names should be all lower case.
704 *
705 * @refsnippet{src/scip/branch_relpscost.c,SnippetCodeStyleDeclaration}
706 *
707 * - Blank lines are inserted where it improves readability.
708 * - Multiple blank lines are used to structure the code where single blank lines are insufficient,
709 * e.g., between differrent sections of the code.
710 *
711 * @refsnippet{src/scip/heur_xyz.c,SnippetCodeStyleBlanks}
712 *
713 * @section CODENAMING Naming:
714 *
715 * - Use assert() to show preconditions for the parameters, invariants, and postconditions.
716 * - Make all functions that are not used outside the module 'static'.
717 * - Naming should start with a lower case letter.
718 *
719 * @refsnippet{src/scip/branch_relpscost.c,SnippetCodeStyleStaticAsserts}
720 *
721 * - All global functions start with "SCIP". In the usual naming scheme this is followed by the object and a function name
722 * like in SCIPlpAddRow(). Functions return TRUE or FALSE should be named like SCIPisFeasEQ().
723 *
724 * @refsnippet{src/scip/scip_numerics.h,SnippetCodeStyleNaming}
725 *
726 * - For each structure there is a typedef with the name in all upper case.
727 * - Defines should be named all upper case.
728 *
729 * @refsnippet{src/scip/type_set.h,SnippetCodeStyleExample}
730 *
731 * @section CODEDOC Documentation:
732 *
733 * - Document functions, parameters, and variables in a doxygen conformed way.
734 * - Please do not leave code in comments that has been commented out, don't use `#if
735 * 0`. Instead put the code within defines `#ifdef SCIP_DISABLED_CODE` and add an explanation.
736 * - Todos need double stars to be registered by doxygen.
737 * - When documenting functions, the first brief description starts with lower case and is separated by semi-colons, if necessary
738 * The longer description starts capitalized and consists of complete sentences.
739 * If the documentation consists of multiple lines, the comment end must be on a new line.
740 *
741 * @refsnippet{src/scip/scip_datastructures.h,SnippetCodeStyleComment}
742 *
743 *
744 * @section XEMACS Customize (x)emacs
745 *
746 * If you are using (x)emacs, you can use the following customization for the c++-mode. These settings satisfy the
747 * coding guidelines of \SCIP.
748 *
749 * \include codestyle/emacs_scip_codestyle.el
750 *
751 *
752 * @section ECLIPSE Customize eclipse
753 *
754 * Eclipse user can use the profile below. This profile does not match the \SCIP coding guideline completely.
755 *
756 * \include codestyle/eclipse_scip_codestyle.xml
757 */
758
759/*--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
760
761/**@page START How to start a new project
762 *
763 * Once you succeeded installing \SCIP together with an LP-solver on your system,
764 * you have a powerful tool for solving MIPs, MIQCPs,
765 * MINLPs, etc... at hand. \SCIP can also be customized to the type of problems you
766 * are working on by additional plugins.
767 * Instructions on how to write a new plugin and include it in \SCIP can be found in the corresponding
768 * \ref HOWTOADD "How to add ... pages".
769 *
770 * \SCIP can also be used for writing your own branch-and-cut or branch-and-cut-and-price code. \SCIP already
771 * provides a number of existing code examples which we suggest as both reference and starting point
772 * for these kinds of projects.
773 * Below, you find some hints of how to start such a project.
774 *
775 * @section START_CHOICE Choose an example project
776 *
777 * The example should be chosen depending on the programming language (<b>C</b> or <b>C++</b>) and the purpose
778 * (<b>branch-and-cut</b> or <b>branch-and-cut-and-price</b>) of your project.
779 * <br>
780 * We suggest the use of one of the following examples:
781 * - The \ref VRP_MAIN "Vehicle Routing Problem Example" is a <b>branch-and-cut-and-price</b> (column generation)-code
782 * in <b>C++</b>.
783 * - The \ref BINPACKING_MAIN "Binpacking Example"
784 * and the \ref COLORING_MAIN "Coloring application" are
785 * <b>branch-and-cut-and-price</b> (column generation)-codes in <b>C</b>.
786 * - The \ref TSP_MAIN "TSP example"
787 * is a <b>branch-and-cut</b>-code in <b>C++</b>.
788 * - The \ref LOP_MAIN "LOP example"
789 * is a <b>branch-and-cut</b>-code in <b>C</b>.
790 *
791 * More examples can be found in the \ref EXAMPLES "list of Examples".
792 *
793 * - Copy one of the examples in the <code>examples</code> directory (in the \SCIP root
794 * directory). For instance, type
795 * \verbatim
796 cp -r examples/Binpacking/ ../SCIPProject/ ; cd ../SCIPProject
797 \endverbatim
798 * from the \SCIP root directory for copying the content of the <code>Binpacking</code>-example into a fresh
799 * directory named SCIPProject in the parent directory of the \SCIP root directory and jumping to
800 * the new SCIPProject directory rightafter.
801 *
802 * @section START_CMAKE Building with CMake
803 *
804 * It is recommended for all new users to use the CMake build system configuration, if available on their platform.
805 *
806 * - Open the <code>CMakeLists</code> (some examples projects have a subdirectory "check" for testing) via
807 * \verbatim
808 kate CMakeLists.txt & kate check/CMakeLists.txt # if check/CMakeLists.txt is available
809 \endverbatim
810 * and replace all instances of the copied project's name (e.g. <code>binpacking</code>) with your project name.
811 * - Create a new subdirectory, jump to the new directory and use cmake specifying your \SCIP directory. For instance, type
812 * \verbatim
813 mkdir Release ; cd Release ; cmake .. -DSCIP_DIR=../scip/Release
814 \endverbatim
815 * and compile using the <code>make</code> command. For the CMake equivalents of all the flags that can be used in \SCIP, see \ref CMAKE.
816 *
817 *
818 * @section START_MAKE Building with the Makefile system
819 *
820 * If CMake should be unavailable on your targeted platform, try the classic Makefile system of SCIP.
821 *
822 * - Open the <code>Makefile</code> via
823 * \verbatim
824 kate Makefile
825 \endverbatim
826 * and edit the following variables at the top to have a compilable code:
827 *
828 * - specify a correct path to the \SCIP root (<code>SCIPDIR</code>)
829 * - rename the targets name (<code>MAINNAME</code>)
830 * - adjust the source file names (<code>MAINOBJ</code>).
831 * .
832 * - Once you have edited the makefile, you can use all the flags that can be used in \SCIP to
833 * compile your code, see \ref MAKE.
834 *
835 */
836
837/**@page EXAMPLES Example projects
838 *
839 * \SCIP contains several examples that demonstrate its usage. They are contained in the &quot;examples&quot; directory
840 * in the source code distribution.
841 *
842 * <table>
843 * <tr>
844 * <td colspan="2">
845 * <b>
846 * Callable library
847 * </b>
848 * </td>
849 * </tr>
850 * <tr>
851 * <td>
852 * @subpage CALLABLELIBRARY_MAIN "Callable Library Example"
853 * </td>
854 * <td>
855 * An example showing how to setup constraints (esp. nonlinear ones) when using \SCIP as callable library.
856 * </td>
857 * </tr>
858 * <tr>
859 * <td>
860 * @subpage MIPSOLVER_MAIN "MIP solver"
861 * </td>
862 * <td>
863 * A minimal implementation for using \SCIP included into another source code
864 * </td>
865 * </tr>
866 * <tr>
867 * <td>
868 * @subpage QUEENS_MAIN "The n-Queens Problem"
869 * </td>
870 * <td>
871 * Using SCIP's callable library for solving the n-queens problem.
872 * </td>
873 * </tr>
874 * <tr>
875 * <td colspan="2">
876 * <b>
877 * Extending SCIP by custom plugins
878 * </b>
879 * </td>
880 * </tr>
881 * <tr>
882 * <td>
883 * @subpage EVENTHDLR_MAIN "Event handler"
884 * </td>
885 * <td>
886 * A small example illustrating the use of an event handler.
887 * </td>
888 * </tr>
889 * <tr>
890 * <td>
891 * @subpage GMI_MAIN "Gomory mixed integer cut example"
892 * </td>
893 * <td>
894 * An example about Gomory mixed-integer cuts.
895 * </td>
896 * </tr>
897 * <tr>
898 * <td>
899 * @subpage RELAXATOR_MAIN "Relaxator example"
900 * </td>
901 * <td>
902 * An example about using custom relaxators.
903 * </td>
904 * </tr>
905 * <tr>
906 * <td>
907 * @subpage LJ_MAIN "Nonlinear Handler"
908 * </td>
909 * <td>
910 * An example illustrating the use of a nonlinear handler to improve SCIP's handling of a nonlinearity that appears in Lennard-Jones Cluster Problems.
911 * </td>
912 * </tr>
913 * <tr>
914 * <td colspan="2">
915 * <b>
916 * Branch-and-cut
917 * </b>
918 * </td>
919 * </tr>
920 * <tr>
921 * <td>
922 * @subpage SUDOKU_MAIN "Sudoku example"
923 * </td>
924 * <td>
925 * An example solving sudokus.
926 * </td>
927 * </tr>
928 * <tr>
929 * <td>
930 * @subpage LOP_MAIN "Linear Ordering"
931 * </td>
932 * <td>
933 * An example for implementing a constraint handler.
934 * </td>
935 * </tr>
936 * <tr>
937 * <td>
938 * @subpage TSP_MAIN "The TSP example"
939 * </td>
940 * <td>
941 * A short implementations of a constraint handler, two easy combinatorial heuristics, a file reader, etc. which
942 * demonstrate the usage of \SCIP as a branch-and-cut-framework for solving traveling salesman problem instances.
943 * </td>
944 * </tr>
945 * <tr>
946 * <td colspan="2">
947 * <b>
948 * Branch-and-price
949 * </b>
950 * </td>
951 * </tr>
952 * <tr>
953 * <td>
954 * @subpage BINPACKING_MAIN "Binpacking"
955 * </td>
956 * <td>
957 * An implementation of the column generation approach for the binpacking problem. It includes a customized reader,
958 * Ryan/Foster branching rule, (global) problem data, variable data, and constraint handler.
959 * </td>
960 * </tr>
961 * <tr>
962 * <td>
963 * @subpage VRP_MAIN "Vehicle Routing"
964 * </td>
965 * <td>
966 * A solver for a simple capacity-constrained vehicle routing problem, which is based on pricing tours via a dynamic
967 * programming algorithm.
968 * </td>
969 * </tr>
970 * <tr>
971 * <td colspan="2">
972 * <b>
973 * Benders' decomposition
974 * </b>
975 * </td>
976 * </tr>
977 * <tr>
978 * <td>
979 * @subpage SCFLP_MAIN "Stochastic capacitated facility location problem"
980 * </td>
981 * <td>
982 * A stochastic programming problem that demonstrates the use of the Benders' decomposition framework within SCIP.
983 * </td>
984 * </tr>
985 * </table>
986 */
987
988/** @page APPLICATIONS Application projects
989 *
990 * There are several extensions of \SCIP for particular applications included in the release. They are contained in the &quot;applications&quot; directory
991 * in the source code distribution.
992 *
993 * <table>
994 * <tr>
995 * <td>
996 * @subpage COLORING_MAIN
997 * </td>
998 * <td>
999 * An implementation of the column generation approach for graph coloring of Mehrotra and Trick.
1000 * </td>
1001 * </tr>
1002 * <tr>
1003 * <td>
1004 * @subpage CYCLECLUSTERING_MAIN
1005 * </td>
1006 * <td>
1007 * Branch-and-cut implementation of a graph partitioning problem used for Markov state models.
1008 * </td>
1009 * </tr>
1010 * <tr>
1011 * <td>
1012 * @subpage MINIISC_MAIN
1013 * </td>
1014 * <td>
1015 * A solver that computes irreducible infeasible subsystems using Benders decomposition
1016 * </td>
1017 * </tr>
1018 * <tr>
1019 * <td>
1020 * @subpage PBSOLVER_MAIN
1021 * </td>
1022 * <td>
1023 * A solver for pseudoboolean problems in OPB or WBO format. It complies by default with the technical regulations of
1024 * PB competition. Therefore, it includes a message handler to produce a valid general log and for optimization
1025 * problems an event handler to signal achievements of best primal solutions.
1026 * </td>
1027 * </tr>
1028 * <tr>
1029 * <td>
1030 * @subpage RINGPACKING_MAIN "Ringpacking"
1031 * </td>
1032 * <td>
1033 * An implementation of the column generation approach for the Ringpacking Problem. It includes a customized reader,
1034 * (global) problem data, variable data, and constraint handler.
1035 * </td>
1036 * </tr>
1037 * <tr>
1038 * <td>
1039 * @subpage SCHEDULER_MAIN
1040 * </td>
1041 * <td>
1042 * A solver for scheduling problems.
1043 * </td>
1044 * </tr>
1045 * </table>
1046 *
1047 */
1048
1049
1050/**@page SHELL Tutorial: the interactive shell
1051 *
1052 * If you are using \SCIP as a black box solver, here you will find some tips and tricks what you can do.
1053 *
1054 * @section TUTORIAL_OPTIMIZE Read and optimize a problem instance
1055 *
1056 * @subsection SHELL_PREREQUISITES "Prerequisites"
1057 *
1058 * First of all, we need a \SCIP binary and an example problem file to work with.
1059 * For installation we refer you to the \ref INSTALL section.
1060 *
1061 * Therefore, you can either download the \SCIP standard distribution (which includes problem files) and compile it on your own or you can download a
1062 * precompiled binary and an example problem separately. \SCIP can read files in LP, MPS, ZPL, WBO, FZN, PIP, OSiL, and
1063 * other formats (see \ref FILEREADERS).
1064 *
1065 * If you want to download the source code of the \SCIP standard distribution, we recommend to go to the <a
1066 * href="https://scipopt.org/#download">SCIP download section</a>, download the latest release,
1067 * inflate the tarball (e.g., with "tar xzf scipoptsuite-[version].tgz"), and follow the instructions
1068 * in the INSTALL file. The instance stein27, which will serve as an example in this tutorial, can be found under
1069 * scipoptsuite-[version]/scip-[version]/check/instances/MIP/stein27.fzn.
1070 * Alternatively you can download an instance file from the <a href="https://miplib.zib.de/tag_benchmark.html">MIPLIB 2017 page</a>.
1071 *
1072 * If you want to download a precompiled binary, go to the <a href="http://scipopt.org/#download">SCIP download
1073 * section</a> and download an appropriate binary for your operating system. The \SCIP source code distribution already comes with
1074 * the example instance used throughout this tutorial. To follow this tutorial with a precompiled binary, we recommend downloading the instance
1075 * <a href="http://miplib2010.zib.de/miplib3/miplib3/stein27.mps.gz">stein27</a> from
1076 * the <a href="http://miplib2010.zib.de/miplib3/miplib.html">MIPLIB 3.0</a> homepage.
1077 *
1078 * @subsection SHELL_AFTERINSTALL "After installation"
1079 *
1080 * Now start your binary, without any arguments. This opens the interactive shell, which should look somehow like this:
1081 *
1082 * @snippet shelltutorial/shelltutorialannotated.tmp SnippetVersion
1083 *
1084 * First of all "help" shows you a list of all available shell commands. Brackets indicate a submenu with further options.
1085 *
1086 * @snippet shelltutorial/shelltutorialannotated.tmp SnippetHelp
1087 *
1088 * Okay, let's solve the example instance... use "read check/instances/MIP/stein27.fzn" (or the problem file of your choice) to parse the instance file, "optimize" to solve it and "display
1089 * solution" to show the nonzero variables of the best found solution.
1090 *
1091 * @snippet shelltutorial/shelltutorialannotated.tmp SnippetOpt1
1092 *
1093 * What do we see here? After "optimize", SCIP first goes into presolving. Not much is happening for this instance, just
1094 * the linear constraints get upgraded to more specific types. Each round of presolving will be displayed in a single
1095 * line, with a short summary at the end. Then, we see the actual solving process. The table output of the branch-and-cut
1096 * solving process is very detailed during the root node. Afterwards, a new line is displayed every 100th node.
1097 * Furthermore, every new incumbent solution triggers a new table row, starting with a character to indicate the
1098 * heuristic that found the solution. Which letter represents which heuristic can be seen with the
1099 * "display heuristics" command, see \ref TUTORIAL_STATISTICS for an example.
1100 *
1101 * After some lines the root node processing is finished. From now on, we will see an output line every hundredth node or
1102 * whenever a new incumbent is found. After some more nodes, the "dualbound" starts
1103 * moving, too. At one point, both will be the same, and the solving process terminates, showing us some wrap-up
1104 * information.
1105 *
1106 * The exact performance may of course vary among different architectures and operating systems. Do not be worried if
1107 * your installation needs more or less time or nodes to solve. Also, this instance has more than 2000 different optimal
1108 * solutions. The optimal objective value always has to be 18, but the solution vector may differ. If you are interested
1109 * in this behavior, which is called "performance variability", you may have a look at the MIPLIB2010 paper.
1110 *
1111 * @section TUTORIAL_FILEIO Writing problems and solutions to a file
1112
1113 * \SCIP can also write information to files. E.g., we could store the incumbent solution to a file, or output the
1114 * problem instance in another file format (the LP format is much more human readable than the MPS format, for example).
1115 * Since stein27.fzn has many constraints with the same name, which would result in an unusable LP file, we write out
1116 * the problem with generic variable and constraint names (x1, x2, x3, ...; c1, c2, c3, ...) here.
1117 *
1118 * @snippet shelltutorial/shelltutorialannotated.tmp SnippetWriteSolutions
1119 *
1120 * Passing starting solutions can increase the solving performance so that \SCIP does not need to construct an initial feasible solution
1121 * by itself. After reading the problem instance, use the "read" command again, this time with a file containing solution information.
1122 * Solutions can be specified in a raw or xml-format and must have the file extension ".sol", see the documentation of the
1123 * \ref reader_sol.h "solution reader of SCIP" for further information.
1124 *
1125 * Customized settings are not written or read with the "write" and "read" commands, but with the three commands
1126 *
1127 * @snippet shelltutorial/shelltutorialannotated.tmp SnippetSaveSettingsOverview
1128 *
1129 * See the section on parameters \ref TUTORIAL_PARAMETERS for more information.
1130 *
1131 * @section TUTORIAL_STATISTICS Displaying detailed solving statistics
1132 *
1133 * We might want to have some more information now. Which of the heuristics found solutions? Which plugins
1134 * were called during the solutions process and how much time did they spend?
1135 * Information on certain plugin types (e.g., heuristics, branching rules, separators) is displayed via
1136 * "display <plugin-type>", information on the solution process via "display statistics", and "display problem"
1137 * shows the current instance.
1138 *
1139 * @snippet shelltutorial/shelltutorialannotated.tmp SnippetDisplayStatistics
1140 *
1141 * The statistics obtained via "display statistics" are quite comprehensive,
1142 * thus, we just explain a few lines here. Information is grouped by the plugin type. For the primal heuristics,
1143 * the execution time in seconds is shown as well as the number of calls to the heuristic, and its success regarding
1144 * the number of (best) solutions found by that heuristic. Appropriate statistics are also shown for presolvers, constraint handlers,
1145 * separators, propagators, the search tree, etc. User-written plugins will appear automatically in these statistics,
1146 * after they were included into \SCIP.
1147 *
1148 * @section TUTORIAL_PARAMETERS Changing parameters from the interactive shell
1149 *
1150 * Now, we can start playing around with parameters. The primal heuristics Rounding and shifting seem to be quite successful on this instance,
1151 * wondering what happens if we disable them? Or what happens, if we are even more rigorous and disable all heuristics?
1152 * Or if we do the opposite and use aggressive heuristics?
1153 *
1154 * @snippet shelltutorial/shelltutorialannotated.tmp SnippetSetSettings
1155 *
1156 * We can navigate through the menus step-by-step and get a list of available options and submenus. Therefore, we select
1157 * "set" to change settings, "heuristics" to change settings of primal heuristics, and "shifting" for that particular
1158 * heuristic. Then we see a list of parameters (and yet another submenu for advanced parameters), and disable this
1159 * heuristic by setting its calling frequency to -1. If we already know the path to a certain setting, we can directly
1160 * type it (as for the rounding heuristic in the above example). Note that we do not have to use the full names, but we
1161 * may use short versions, as long as they are unique.
1162 *
1163 * To solve a problem a second time, we have to read it in again before starting the optimization process.
1164 *
1165 * @snippet shelltutorial/shelltutorialannotated.tmp SnippetOpt2
1166 *
1167 * Okay, what happened here? First, we reset all parameters to their default values, using "set default". Next, we
1168 * loaded some meta-parameter settings (also see <a href="FAQ.php#howtochangebehaviour">the FAQ</a>), to apply primal heuristics
1169 * more aggressively. \SCIP shows us, which single parameters it changed therefore. Additionally, for pedagogical purposes,
1170 * we set the node limit to 200. Now, the optimal solution is already found at the root node, by a heuristic which is
1171 * deactivated by default. Then, after node 200, the user defined node limit is reached which interrupts the solving
1172 * process, We see that now in the short status report, primal and dual bound are different, thus, the problem is not solved
1173 * yet. Nevertheless, we could access statistics, see the current incumbent solution, change parameters and so on.
1174 * Entering "optimize" we continue the solving process from the point on at which it has been interrupted.
1175 *
1176 * Once you found a non-default parameter setting that you wish to save and use in the future, use either the command
1177 *
1178 * @snippet shelltutorial/shelltutorialannotated.tmp SnippetSaveSettingsFull
1179 *
1180 * to save <b>all</b> parameter values to the specified file, or
1181 *
1182 * @snippet shelltutorial/shelltutorialannotated.tmp SnippetSaveSettingsDiff
1183 *
1184 * in order to save only the nondefault parameters. The latter has several advantages, you can, e.g., combine parameter
1185 * settings from multiple settings files stored by the latter command, as long as they only affect mutually exclusive
1186 * parameter values.
1187 *
1188 * For loading a previously stored settings file, use the "load" command:
1189 *
1190 * @snippet shelltutorial/shelltutorialannotated.tmp SnippetLoadSettings
1191 *
1192 * Special attention should be drawn to the reserved settings file name "scip.set"; whenever the \SCIP interactive shell
1193 * is started from a working directory that contains a settings file with the name "scip.set", it will be automatically
1194 * replace the default settings.
1195 *
1196 * For using special settings for automated tests as described in \ref TEST, save your custom settings in a subdirectory
1197 * "SCIP_HOME/settings".
1198 *
1199 *
1200 * We hope this tutorial gave you an overview of what is possible using the \SCIP interactive shell. Please also read our
1201 * \ref FAQ, in particular the section "Using SCIP as a standalone MIP/MINLP-Solver".
1202 *
1203 */
1204
1205/*--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
1206
1207/**@page DOC How to search the documentation and source files structure for public interface functions
1208 *
1209 * If you are looking for a function in order to perform a specific task, the public \ref PUBLICAPI "SCIP C-API" is the place to look.
1210 * - It contains interface functions for all SCIP structs, both in the solver core or in one of the plugins.
1211 * - Plugins are mostly independent from each other, so to use them it is usually enough to browse the \ref PUBLICCOREAPI "Core API".
1212 * - If you want to add your own plugins, see the \ref HOWTOADD pages for exhaustive information for each plugin type.
1213 * - If you are learning SCIP with a concrete project in mind, looking at the available \ref EXAMPLES page may help you
1214 * getting started.
1215 * - See also \ref START "How to start a new project"
1216 *
1217 * Header file names of SCIP obey a consistent naming scheme: Type definitions and related objects such as enums are found in headers starting with "type_",
1218 * such as \ref type_var.h , which contains enums and type definitions related to \ref PublicVariableMethods "SCIP problem variables".
1219 * Definitions of the actual structs can be found in separate header files starting with "struct_".
1220 * All function definitions of the public SCIP API are split across header files starting with "pub_" such as \ref pub_cons.h
1221 * or headers starting with "scip_" such as \ref scip_cons.h .
1222 * The latter headers starting with "scip_" contain more complex functions, which always receive a scip pointer as first argument.
1223 * Those functions may affect several individual components controlled by SCIP. Such a function is SCIPbranchVar(), which
1224 * affects the search tree, which is controlled by SCIP itself and not meant to be accessed by user plugins.
1225 *
1226 * It should be sufficient to include scip/scip.h and scip/scipdefplugins.h for having all
1227 * needed functionality available in a project.
1228 *
1229 * If, for example, you are looking for information on how to create a problem instance, here are some steps you can take:
1230 *
1231 * 1. Browse the SCIP Core API and follow the path \ref PUBLICAPI > \ref PUBLICCOREAPI > \ref PublicProblemMethods > \ref GlobalProblemMethods > SCIPcreateProb()
1232 * 2. Here you can find information on the function's return value, preconditions, postconditions, parameters, as well as related functions.
1233 * 3. If you are unsure of how to use some of the parameters, it is worth looking for a basic version of the function.
1234 * This and other related functions may be found by either browsing neighboring functions and groups in the navigation tree to the left, or in the
1235 * 'References' and 'Referenced by' section of the function documentation. In this case, you can find `SCIPcreateProbBasic()`.
1236 *
1237 * The opposite case is that you already know the name of a function as, e.g., SCIPbranchVar().
1238 *
1239 * 1. Type the name of the function into the search bar to find the function documentation.
1240 * 2. In addition, you can find related functions by browsing the neighboring functions of the same group.
1241 * 3. In this example, you may now learn about SCIPgetNLPBranchCands() to query all integer
1242 * variables with fractional LP solution value, which are good candidates for classical branching on variables.
1243 *
1244 * Note that the \ref INTERNALAPI "private SCIP API" contains more complex functions and data structures that fill specialized roles and
1245 * is only for developers.
1246 * Those functions are **not** exported to the library and are therefore **not available in user projects** using the \ref PUBLICAPI "public SCIP API".
1247 */
1248
1249/*--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
1250
1251/**@page CONS How to add constraint handlers
1252 *
1253 * A constraint handler defines the semantics and the algorithms to process constraints of a certain class. A single
1254 * constraint handler is responsible for all constraints belonging to its constraint class. For example, there is
1255 * one \ref cons_knapsack.h "knapsack constraint handler" that ensures solutions are only accepted if they satisfy all
1256 * knapsack constraints in the model. \n A complete list of all constraint handlers contained in this release can be
1257 * found \ref CONSHDLRS "here".
1258 *
1259 * We now explain how users can add their own constraint handlers.
1260 * For an example, look into the subtour constraint handler (examples/TSP/src/ConshdlrSubtour.cpp) of the
1261 * \ref TSP_MAIN project.
1262 * The example is written in C++ and uses the C++ wrapper classes.
1263 * However, we will explain the implementation of a constraint handler using the C interface.
1264 * It is very easy to transfer the C explanation to C++; whenever a function should be implemented using the
1265 * SCIP_DECL_CONS... notion, reimplement the corresponding virtual member method of the abstract scip::ObjConshdlr
1266 * base class.
1267 *
1268 * Additional documentation for the callbacks of a constraint handler can be found in the file
1269 * type_cons.h.
1270 *
1271 * Here is what you have to do (assuming your constraint handler should be named "subtour"):
1272 * -# Copy the template files src/scip/cons_xyz.c and src/scip/cons_xyz.h into files "cons_subtour.c"
1273 * and "cons_subtour.h".
1274 * \n
1275 * Make sure to adjust your build system such that these files are compiled and linked to your project. \n
1276 * If you are adding a new default plugin, this means updating the `src/CMakeLists.txt` and `Makefile` files in the SCIP distribution.
1277 * -# Use `SCIPincludeConshdlrSubtour()` in order to include the constraint handler into your SCIP instance,
1278 * e.g., in the main file of your project (see, e.g., src/cppmain.cpp in the TSP example). \n
1279 * If you are adding a new default plugin, this include function must be added to `src/scipdefplugins.c`.
1280 * -# Open the new files with a text editor and replace all occurrences of "xyz" by "subtour".
1281 * -# Adjust the \ref CONS_PROPERTIES "properties of the constraint handler".
1282 * -# Define the \ref CONS_DATA "constraint data and the constraint handler data". This is optional.
1283 * -# Implement the \ref CONS_INTERFACE "interface functions".
1284 * -# Implement the \ref CONS_FUNDAMENTALCALLBACKS "fundamental callbacks".
1285 * -# Implement the \ref CONS_ADDITIONALCALLBACKS "additional callbacks". This is optional.
1286 *
1287 *
1288 * @section CONS_PROPERTIES Properties of a Constraint Handler
1289 *
1290 * At the top of the new file "cons_subtour.c" you can find the constraint handler properties.
1291 * These are given as compiler defines. Some of them are optional, as, e.g., separation-related properties,
1292 * which only have to be defined if the constraint handler supports the related callbacks.
1293 * In the C++ wrapper class, you have to provide the constraint handler properties by calling the constructor
1294 * of the abstract base class scip::ObjConshdlr from within your constructor (see the TSP example).
1295 * The properties you have to set have the following meaning:
1296 *
1297 * @subsection CONS_FUNDAMENTALPROPERTIES Fundamental Constraint Handler properties
1298 *
1299 * \par CONSHDLR_NAME: the name of the constraint handler.
1300 * This name is used in the interactive shell to address the constraint handler.
1301 * Additionally, if you are searching for a constraint handler with SCIPfindConshdlr(), this name is looked up.
1302 * Names have to be unique: no two constraint handlers may have the same name.
1303 *
1304 * \par CONSHDLR_DESC: the description of the constraint handler.
1305 * This string is printed as a description of the constraint handler in the interactive shell of SCIP.
1306 *
1307 * \par CONSHDLR_ENFOPRIORITY: the priority of the constraint handler for constraint enforcing.
1308 * Like the separation priority, the enforcement priorities define the order in which the different constraint handlers
1309 * are called in the constraint enforcement step of the subproblem processing.
1310 * The constraint enforcement is called after the price-and-cut loop is executed (in the case that the LP is solved
1311 * at the current subproblem).
1312 * \n
1313 * The integrality constraint handler has an enforcement priority of 0.
1314 * That means, if a constraint handler has negative enforcement priority, it only has to deal with integral solutions
1315 * in its enforcement functions, because for fractional solutions, the integrality constraint handler would have
1316 * created a branching, thereby aborting the enforcement step.
1317 * If you want to implement a constraint-depending branching rule (for example, SOS branching on special ordered
1318 * set constraints), you have to assign a positive enforcement priority to your constraint handler.
1319 * In this case, you have to be able to deal with fractional solutions.
1320 * \n
1321 * See \ref CONSENFOLP and \ref CONSENFOPS for further details of the separation callback.
1322 *
1323 * \par CONSHDLR_CHECKPRIORITY: the priority of the constraint handler for checking feasibility.
1324 * Like the separation priority, the checking priorities define the order in which the different constraint handlers
1325 * are called to check the feasibility of a given primal solution candidate.
1326 * The integrality constraint handler has a checking priority of 0.
1327 * That means, constraint handlers with negative checking priorities only have to deal with integral solutions.
1328 *
1329 * \par CONSHDLR_EAGERFREQ: the default frequency for using all instead of only the useful constraints in separation, propagation and enforcement.
1330 * If \em constraint \em aging is activated, some constraints that were not useful in the past for propagation or
1331 * separation are marked to be \em obsolete.
1332 * Usually, the obsolete constraints are not presented to the separation and propagation functions of the constraint
1333 * handlers, such that the constraint handlers only process the non-obsolete constraints.
1334 * However, every n'th call, with n being the EAGERFREQ of the constraint handler, all constraints are presented to the
1335 * separation and propagation functions of the constraint handler.
1336 * This gives obsolete constraints the chance of becoming non-obsolete again.
1337 * \n
1338 * If the eager evaluation frequency is set to -1, obsolete constraints are never presented to the separation and
1339 * propagation functions.
1340 * A frequency of 0 means, that obsolete constraints are only used in the first call of each function.
1341 *
1342 * \par CONSHDLR_NEEDSCONS: indicates whether the constraint handler should be skipped, if no constraints are available.
1343 * Usually, a constraint handler is only executed if there are constraints of its corresponding class in the model.
1344 * For those constraint handlers, the NEEDSCONS flag should be set to TRUE.
1345 * However, some constraint handlers must be called without having a constraint of the class in the model, because
1346 * the constraint is only implicitly available.
1347 * For example, the integrality constraint handler has the NEEDSCONS flag set to FALSE, because there is no explicit
1348 * integrality constraint in the model.
1349 * The integrality conditions are attached to the variables, and the integrality constraint handler has to check
1350 * all variables that are marked to be integer for integral values.
1351 *
1352 * @subsection CONS_ADDITIONALPROPERTIES Optional Constraint Handler properties
1353 *
1354 * The following properties are optional and only need to be defined if the constraint handlers support
1355 * separation, presolving, propagation, and/or upgrade functionality.
1356 *
1357 * \par LINCONSUPGD_PRIORITY: priority of the constraint handler for upgrading of linear constraints
1358 * This property is only needed if a certain linear constraint can be upgraded to a more specific one. In one of
1359 * the first presolving rounds SCIP tries to upgrade linear constraints to more specialized constraints, such as
1360 * knapsack constraints. The upgrading calls are processed in the order of decreasing priority.
1361 *
1362 * \par NONLINCONSUPGD_PRIORITY: priority of the constraint handler for upgrading of nonlinear constraints
1363 * This property has the same effect as the LINCONSUPGD_PRIORITY parameter, see above, and should be set whenever
1364 * an upgrade functionality from a general nonlinear constraint to the more specific one is defined.
1365 *
1366 * \par CONSHDLR_SEPAFREQ: the default frequency for separating cuts.
1367 * The separation frequency defines the depth levels at which the constraint handler's separation functions \ref CONSSEPALP
1368 * and \ref CONSSEPASOL are called.
1369 * For example, a separation frequency of 7 means, that the separation callback is executed for subproblems that are
1370 * in depth 0, 7, 14, ... of the branching tree.
1371 * A separation frequency of 0 means, that the separation function is only called at the root node.
1372 * A separation frequency of -1 disables the separation function of the constraint handler.
1373 * \n
1374 * The separation frequency can be adjusted by the user.
1375 * This property of the constraint handler only defines the default value of the frequency.
1376 * If you want to have a more flexible control of when to execute the separation algorithm, you have to assign
1377 * a separation frequency of 1 and implement a check at the beginning of your separation algorithm whether you really
1378 * want to execute the separator or not.
1379 * If you do not want to execute the function, set the result code to SCIP_DIDNOTRUN.
1380 *
1381 * \par CONSHDLR_SEPAPRIORITY: the priority of the constraint handler for separation. (optional: to be set only if the constraint handler supports separation)
1382 * In each separation round during the price-and-cut loop of the subproblem processing or during the separation loop
1383 * of the primal solution separation, the separators and separation functions of the constraint handlers are called in
1384 * a predefined order, which is given by the priorities of the separators and the separation priorities of the
1385 * constraint handlers.
1386 * First, the separators with non-negative priority are called in the order of decreasing priority.
1387 * Next, the separation functions of the different constraint handlers are called in the order of decreasing separation
1388 * priority.
1389 * Finally, the separators with negative priority are called in the order of decreasing priority.
1390 * \n
1391 * The separation priority of the constraint handler should be set according to the complexity of the cut separation
1392 * algorithm and the impact of the resulting cuts:
1393 * Constraint handlers that provide fast algorithms that usually have a high impact (i.e., cut off a large portion of
1394 * the LP relaxation) should have a high priority.
1395 * See \ref CONSSEPALP and \ref CONSSEPASOL for further details of the separation callbacks.
1396 *
1397 * \par CONSHDLR_DELAYSEPA: the default for whether the separation function should be delayed, if other separators found cuts.
1398 * If the constraint handler's separation function is marked to be delayed, it is only executed after no other separator
1399 * or constraint handler found a cut during the price-and-cut loop.
1400 * If the separation function of the constraint handler is very expensive, you may want to mark it to be delayed until all
1401 * cheap separation methods have been executed.
1402 *
1403 * \par CONSHDLR_PROPFREQ: the default frequency for propagating domains.
1404 * This default frequency has the same meaning as the CONSHDLR_SEPAFREQ with respect to the domain propagation
1405 * callback of the constraint handler.
1406 * A propagation frequency of 0 means that propagation is only applied in preprocessing and at the root node.
1407 * A propagation frequency of -1 disables the propagation function of the constraint handler.
1408 *
1409 * \par CONSHDLR_DELAYPROP: the default for whether the propagation function should be delayed, if other propagators found reductions.
1410 * This property is analogous to the DELAYSEPA flag, but deals with the propagation function of the constraint handler.
1411 *
1412 * \par CONSHDLR_PROP_TIMING: the propagation timing mask of the constraint handler.
1413 * SCIP calls the domain propagation routines at different places in the node processing loop.
1414 * This property indicates at which places the propagation routine of the constraint handler is called.
1415 * Possible values are defined in type_timing.h and can be concatenated, e.g., as in SCIP_PROPTIMING_ALWAYS.
1416 *
1417 * \par CONSHDLR_PRESOLTIMING: the timing of the constraint handler's presolving function (FAST, MEDIUM, or EXHAUSTIVE).
1418 * Every presolving round starts with the FAST presolving timing. MEDIUM presolving functions are only called, if FAST presolvers did not find
1419 * enough reductions in this round so far, and EXHAUSTIVE presolving steps are only performed if all presolvers called before
1420 * in this round were unsuccessful.
1421 * Presolving functions should be assigned a timing based on how expensive they are, e.g., presolvers that provide fast algorithms that
1422 * usually have a high impact (i.e., remove lots of variables or tighten bounds of many variables) should have a timing FAST.
1423 * If a presolving function implements different algorithms of different complexity, it may also get multiple timings and check the timing
1424 * internally in the \ref CONSPRESOL callback to decide which algorithms to run.
1425 *
1426 * \par CONSHDLR_MAXPREROUNDS: the default maximal number of presolving rounds the constraint handler participates in.
1427 * The preprocessing is executed in rounds.
1428 * If enough changes have been applied to the model, an additional preprocessing round is performed.
1429 * The MAXPREROUNDS parameter of a constraint handler denotes the maximal number of preprocessing rounds the constraint
1430 * handler participates in.
1431 * A value of -1 means that there is no limit on the number of rounds.
1432 * A value of 0 means the preprocessing callback of the constraint handler is disabled.
1433 *
1434 *
1435 *
1436 * @section CONS_DATA Constraint Data and Constraint Handler Data
1437 *
1438 * Below the header "Data structures" you can find two structs called "struct SCIP_ConsData" and
1439 * "struct SCIP_ConshdlrData".
1440 * If you are using C++, you only need to define the "struct SCIP_ConsData".
1441 * The constraint handler data must be implemented as member variables of your constraint handler class.
1442 * \n
1443 * The constraint data are the information that is needed to define a single constraint of the constraint handler's
1444 * constraint class.
1445 * For example, the data of a knapsack constraint would consist of a list of variables, a list of weights, and
1446 * the capacity of the knapsack.
1447 * The data of a subtour constraint consists of the graph on which the problem is defined.
1448 * In the graph, each edge should be linked to the corresponding binary problem variable.
1449 * \n
1450 * The constraint handler data are additional variables, that belong to the constraint handler itself and which are
1451 * not specific to a single constraint.
1452 * For example, you can use these data to store parameters of the constraint handler or statistical information.
1453 * The constraint handler data are optional.
1454 * You can leave the struct empty.
1455 *
1456 *
1457 * @section CONS_INTERFACE Interface Functions
1458 *
1459 * At the bottom of "cons_subtour.c" you can find three interface functions, that also appear in "cons_subtour.h".
1460 * These are SCIPincludeConshdlrSubtour(), SCIPcreateConsSubtour(), and SCIPcreateConsSubtourBasic().
1461 * \n
1462 * The function SCIPincludeConshdlrSubtour() only has to be adjusted slightly.
1463 * It is responsible for notifying SCIP of the presence of the constraint handler by calling the function
1464 * SCIPincludeConshdlr().
1465 * It is called by the user, if (s)he wants to include the constraint handler, i.e., if (s)he wants to make
1466 * the constraint handler available to the model, and looks like this:
1467 * \dontinclude src/scip/cons_knapsack.c
1468 * -# If you are using constraint handler data, you have to <b>allocate the memory for the data</b> at this point.
1469 * You also have to initialize the fields in struct SCIP_ConshdlrData afterwards.
1470 *
1471 * \skip SCIP_RETCODE SCIPincludeConshdlrKnapsack(
1472 * \until SCIPallocBlockMemory
1473 *
1474 * -# Now, <b>SCIP gets notified</b> of the presence of the constraint handler together with its \ref CONS_FUNDAMENTALCALLBACKS "basic callbacks".
1475 *
1476 * \skip SCIPincludeConshdlrBasic
1477 * \until assert
1478 *
1479 * -# All \ref CONS_ADDITIONALCALLBACKS "additional callbacks" are added via their setter functions.
1480 *
1481 * \skip SCIPsetConshdlrCopy
1482 * \until SCIPsetConshdlrExit
1483 *
1484 * -# If the constraint handler is a specialization of a general linear or nonlinear constraint, we want to include an
1485 * <b>automatic upgrading mechanism</b> by calling the interface function
1486 *
1487 * \skip SCIPfindConshdlr
1488 * \until SCIPincludeLinconsUpgrade
1489 * or
1490 * \code
1491 * SCIP_CALL( SCIPincludeNonlinconsUpgrade(scip, nonlinconsUpgdSubtour, NULL, NONLINCONSUPGD_PRIORITY, TRUE, CONSHDLR_NAME) );
1492 * \endcode
1493 *
1494 * in the nonlinear case. See also cons_nonlinear.h for further information about the general upgrade procedure in the nonlinear case.
1495 * -# You may also add <b>user parameters</b> for your constraint handler.
1496 * Some parameters which are important to play with are added to every constraint automatically, as, e.g.,
1497 * propagation or separation frequency.
1498 * \skip SCIPaddIntParam
1499 * \until DEFAULT_SEPACARDFREQ
1500 * \skip SCIP_OKAY
1501 * \until }
1502 *
1503 *
1504 * The functions SCIPcreateConsSubtour() and SCIPcreateConsSubtourBasic() are called to create a single constraint of the constraint
1505 * handler's constraint class.
1506 * It should allocate and fill the constraint data, and call SCIPcreateCons().
1507 * Take a look at the following example from the \ref cons_knapsack.h "knapsack constraint handler":
1508 *
1509 * @refsnippet{src/scip/cons_knapsack.c,SnippetConsCreationKnapsack}
1510 *
1511 * In this example, consdataCreate() is a local function that allocates memory for the given consdata
1512 * and fills the data with the given <code>vars</code> array. For allocating memory for the constraint data, you
1513 * can use SCIP memory allocation:
1514 * \code
1515 * SCIP_CALL( SCIPallocBlockMemory(scip, consdata) );
1516 * \endcode
1517 *
1518 *
1519 * @section CONS_CALLBACKS Callbacks of Constraint handlers
1520 *
1521 * Besides the various functions which you will implement inside your constraint handler there exists a number
1522 * of <b> callbacks </b> associated with your constraint handler. Callbacks can be regarded as
1523 * tasks which your constraint handler is able to provide to the solver. They are grouped into two
1524 * categories:
1525 *
1526 * \ref CONS_FUNDAMENTALCALLBACKS "Fundamental Callbacks" are mandatory to implement
1527 * such that your code will work. For example, every constraint handler has to provide the
1528 * functionality to state whether all of its constraints are
1529 * fulfilled by a given variable assignment. Hence, the \ref CONSCHECK "CONSCHECK" callback is
1530 * one of the fundamental (or \a basic) callbacks of a constraint handler.
1531 *
1532 * Callbacks which are not necessarily implemented are grouped together as
1533 * \ref CONS_ADDITIONALCALLBACKS "additional callbacks". Such callbacks can be used to allocate and free memory
1534 * at different stages of the solving process. Although not mandatory, it might be useful to implement
1535 * some of these callbacks, e.g., to extend your constraint handler by a
1536 * \ref CONSSEPALP "separation" or \ref CONSPRESOL "presolving" functionality.
1537 *
1538 * All callbacks should be passed to SCIP during the SCIPinclude<PLUGINTYPE><PLUGINNAME> function
1539 * (e.g., SCIPincludeConshdlrKnapsack() for the \ref cons_knapsack.h "knapsack constraint handler").
1540 * Since SCIP version 3.0, two ways of setting callbacks can be used, either via SCIPincludeConshdlr()
1541 * (all at once, as it always was), or via SCIPincludeConshdlrBasic() and setter functions for additional callbacks.
1542 * Since the basic inclusion functions are very unlikely to change and will thus
1543 * make your code more stable towards future versions of SCIP with more callbacks,
1544 * we recommend the latter choice, as explained in the \ref CONS_INTERFACE "interface" section.
1545 *
1546 * @section CONS_FUNDAMENTALCALLBACKS Fundamental Callbacks
1547 *
1548 * By implementing the fundamental callbacks, you define the semantics of the constraint class the constraint handler
1549 * deals with.
1550 * If these functions are implemented, the resulting code is already correct and finds the optimal solution to the
1551 * given problem instance.
1552 * However, it might be very slow because the additional features, like cut separation and domain propagation, are
1553 * missing.
1554 * In the C++ wrapper class scip::ObjConshdlr, the fundamental callbacks are virtual abstract member functions.
1555 * You have to implement them in order to be able to construct an object of your constraint handler class.
1556 *
1557 * There are three fundamental callbacks that are all dealing with the feasibility of a given solution.
1558 * They are called at different places in the algorithm and have slightly different meaning.
1559 * However, it is usually reasonable to implement a single local function that is called by all of the three callback
1560 * functions with slightly modified parameters.
1561 * The fourth function provides dual information that is used for example in preprocessing.
1562 *
1563 * Additional documentation for the callbacks can be found in type_cons.h.
1564 *
1565 * @subsection CONSCHECK
1566 *
1567 * The CONSCHECK callback gets a primal solution candidate in a SCIP_SOL* data structure
1568 * and has to check this solution for global feasibility.
1569 * It has to return a result SCIP_FEASIBLE, if the solution satisfies all the constraints of the constraint handler,
1570 * and a result SCIP_INFEASIBLE if there is at least one constraint that is violated.
1571 *
1572 * If the solution is not NULL, SCIP should also be informed about the constraint violation with a call to
1573 * SCIPupdateSolConsViolation() and additionally SCIPupdateSolLPRowViolation() for every row of the constraint's current
1574 * representation in the LP relaxation, if any such rows exist.
1575 * As a convenience function, SCIPupdateSolLPConsViolation() can be used if the constraint
1576 * is represented completely by a set of LP rows, meaning that the current constraint violation is equal to the maximum
1577 * of the contraint violations of the corresponding LP rows.
1578 *
1579 * The callback is used by primal heuristics to check a constructed solution for feasibility.
1580 * That means, the constraint handler has to deal with arbitrary solutions that do not necessarily satisfy the bounds
1581 * and constraints of the local subproblem.
1582 *
1583 * The value of a variable \em var in the given solution \em sol can be accessed by calling
1584 * \code
1585 * SCIPgetSolVal(scip, sol, var)
1586 * \endcode
1587 *
1588 * For example, the \ref cons_knapsack.h "knapsack constraint handler" loops over its constraints and
1589 * calculates the scalar product \f$w^T x\f$ of weights \f$w\f$ with the solution vector \f$x\f$.
1590 * This scalar product is compared with the capacity of the knapsack constraint.
1591 * If it exceeds the capacity, the CONSCHECK function is immediately aborted with the result SCIP_INFEASIBLE.
1592 * If all knapsack constraints are satisfied, a result SCIP_FEASIBLE is returned.
1593 *
1594 * @subsection CONSENFOLP
1595 *
1596 * The CONSENFOLP function is called after the price-and-cut loop was finished and an LP solution is available.
1597 * Like the CHECK call, the ENFOLP function should return a result SCIP_FEASIBLE, if the solution satisfies all the
1598 * constraints.
1599 * However, the behavior should be different, if the solution violates some of the associated constraints.
1600 * The constraint handler may return a result SCIP_INFEASIBLE in this situation, but this is not the best what
1601 * one can do.
1602 * The ENFOLP function has the possibility of \em resolving the infeasibility by
1603 * - stating that the current subproblem is infeasible (result SCIP_CUTOFF),
1604 * - adding an additional constraint that resolves the infeasibility (result SCIP_CONSADDED),
1605 * - reducing the domain of a variable (result SCIP_REDUCEDDOM),
1606 * - adding a cutting plane (result SCIP_SEPARATED),
1607 * - tightening the LP primal feasibility tolerance and requesting to solve the LP again (result SCIP_SOLVELP),
1608 * - performing a branching (result SCIP_BRANCHED).
1609 *
1610 * Note that in case SCIP_CONSADDED, the added constraints must be created with flag initial=TRUE.
1611 *
1612 * However, the solution is not given as a SCIP_SOL* data structure.
1613 *
1614 * The value of a variable <code>var</code> in the LP solution can be accessed by calling
1615 * \code
1616 * SCIPgetVarSol(scip, var)
1617 * \endcode
1618 * or by
1619 * \code
1620 * SCIPgetSolVal(scip, NULL, var)
1621 * \endcode
1622 * By using the latter function, you can have a single local function to check a solution for feasibility by passing
1623 * the given <code>sol</code> to the CONSCHECK call and by passing a NULL pointer as <code>sol</code> to
1624 * the CONSENFOLP and CONSENFOPS calls.
1625 *
1626 *
1627 * @subsection CONSENFOPS
1628 *
1629 * The CONSENFOPS callback is similar to the CONSENFOLP callback, but deals with \em pseudo \em solutions instead
1630 * of LP solutions.
1631 *
1632 * If the LP was not solved at the current subproblem (either because the user did not want to solve it, or because
1633 * numerical difficulties in the LP solving process were detected) no LP solution is available.
1634 * In this situation, the pseudo solution is used instead.
1635 * In this solution, the variables are set to the local bound which is best with respect to the objective function.
1636 * You can think of the pseudo solution as solution to the LP relaxation with all constraints except the bounds
1637 * being removed.
1638 *
1639 * Like the ENFOLP callback, the ENFOPS callback has to check whether the pseudo solution satisfies all the constraints
1640 * of the constraint handler.
1641 * The pseudo solution can be accessed by the same functions as the LP solution (SCIP knows, if the LP was solved at the
1642 * current subproblem, and returns either the LP solution or the pseudo solution).
1643 *
1644 * Unlike the ENFOLP callback, the ENFOPS callback must not add cuts and cannot return the result SCIP_SEPARATED.
1645 * It is, however, possible to force the solving of the LP by returning the result SCIP_SOLVELP.
1646 * For example, the infeasibility of a linear constraint that contains continuous variables cannot be resolved,
1647 * if all integer variables in the constraint are already fixed.
1648 * In this case, the LP has to be solved in order to get a solution that satisfies the linear constraint.
1649 *
1650 * @subsection CONSENFORELAX
1651 *
1652 * The CONSENFORELAX callback is similar to the CONSENFOLP and CONSENFOPS callbacks, but deals with relaxation solutions.
1653 *
1654 * If the best bound computed by a relaxator that includes the whole LP is strictly better than the bound of the LP itself,
1655 * the corresponding relaxation solution will get enforced. Therefore the CONSENFORELAX callback will only be called for
1656 * solutions that satisfy all active LP-constraints.
1657 *
1658 * Like the ENFOLP and ENFOPS callbacks, the ENFORELAX callback has to check whether the solution given in sol satisfies
1659 * all the constraints of the constraint handler. Since the callback is only called for relaxators including the whole LP,
1660 * cuts may be added with a result of SCIP_SEPARATED, like in the ENFOLP callback. It is also possible to return
1661 * SCIP_SOLVELP if the relaxation solution is invalid for some reason and the LP should be solved instead.
1662 *
1663 * Note that the CONSENFORELAX callback is only relevant if relaxators are used. Since the basic distribution of the
1664 * SCIP Optimization Suite does not contain any relaxators, this callback can be ignored unless any relaxators are added
1665 * via user-plugins.
1666 *
1667 * @subsection CONSLOCK
1668 *
1669 * The CONSLOCK callback provides dual information for a single constraint.
1670 * It has to tell SCIP, which variables are existing in the given constraint, and in which way modifications of these
1671 * variables may affect the feasibility of the constraint.
1672 *
1673 * For each variable that is affected by the constraint, the callback should call SCIPaddVarLocks():
1674 * - If the constraint may become violated by decreasing the value of a variable, it should call
1675 * SCIPaddVarLocks(scip, var, nlockspos, nlocksneg), saying that rounding down is potentially rendering the
1676 * (positive) constraint infeasible and rounding up is potentially rendering the negation of the constraint
1677 * infeasible.
1678 * - If the constraint may become violated by increasing the value of a variable, it should call
1679 * SCIPaddVarLocks(scip, var, nlocksneg, nlockspos), saying that rounding up is potentially rendering the
1680 * constraint's negation infeasible and rounding down is potentially rendering the constraint itself
1681 * infeasible.
1682 * - If the constraint may become violated by changing the variable in any direction, it should call
1683 * SCIPaddVarLocks(scip, var, nlockspos + nlocksneg, nlockspos + nlocksneg).
1684 *
1685 * <b>Note:</b> You do not have to worry about nlockspos and nlocksneg. These integer values are given as
1686 * parameter of the CONSLOCK callback (see type_cons.h). Just use these variables in the above described
1687 * fashion <b>without</b> adding or subtracting anything to them. In case of the knapsack constraints this
1688 * function looks like this.
1689 *
1690 * @refsnippet{src/scip/cons_knapsack.c,SnippetConsLockKnapsack}
1691 *
1692 * To give same more intuition, consider the linear constraint \f$3x -5y +2z \leq 7\f$ as an example.
1693 * The CONSLOCK callback of the linear constraint handler should call
1694 * SCIPaddVarLocks(scip, x, nlocksneg, nlockspos), SCIPaddVarLocks(scip, y, nlockspos, nlocksneg),
1695 * and SCIPaddVarLocks(scip, z, nlocksneg, nlockspos) to tell SCIP, that rounding up of \f$x\f$
1696 * and \f$z\f$ and rounding down of \f$y\f$ can destroy the feasibility of the constraint, while rounding
1697 * down of \f$x\f$ and \f$z\f$ and rounding up of \f$y\f$ can destroy the feasibility of the
1698 * constraint's negation \f$3x -5y +2z > 7\f$.
1699 * \n
1700 * A linear constraint \f$2 \leq 3x -5y +2z \leq 7\f$ should call
1701 * SCIPaddVarLocks(scip, ..., nlockspos + nlocksneg, nlockspos + nlocksneg) on all variables,
1702 * since rounding in both directions of each variable can destroy both the feasibility of the
1703 * constraint and it's negation \f$3x -5y +2z < 2\f$ or \f$3x -5y +2z > 7\f$.
1704 *
1705 *
1706 * @section CONS_ADDITIONALCALLBACKS Additional Callbacks
1707 *
1708 * The additional callbacks do not need to be implemented in every case, but provide useful functionality
1709 * for many applications. They can be added to your constraint handler via setter functions, see
1710 * \ref CONS_INTERFACE "here".
1711 *
1712 * @subsection CONSFREE
1713 *
1714 * If you are using constraint handler data, you have to implement this function in order to free the
1715 * constraint handler data. This can be done by the following procedure (which is taken from the
1716 * \ref cons_knapsack.h "knapsack constraint handler"):
1717 *
1718 * @refsnippet{src/scip/cons_knapsack.c,SnippetConsFreeKnapsack}
1719 *
1720 * If you have allocated memory for fields in your constraint handler data, remember to free this memory
1721 * before freeing the constraint handler data itself.
1722 * If you are using the C++ wrapper class, this function is not available.
1723 * Instead, just use the destructor of your class to free the member variables of your class.
1724 *
1725 * @subsection CONSHDLRCOPY
1726 *
1727 * The CONSHDLRCOPY callback is executed when the SCIP instance is copied, e.g. to solve a sub-SCIP. By defining this
1728 * callback as <code>NULL</code> the user disables the inclusion of the specified constraint handler into all copied SCIP
1729 * instances. This may deteriorate the performance of primal heuristics solving sub-SCIPs, since these constitute only
1730 * relaxations of the original problem if constraint handlers are missing.
1731 *
1732 * A usual implementation just
1733 * calls the interface function which includes the constraint handler to the model. For example, this callback is
1734 * implemented for the \ref cons_knapsack.c "knapsack constraint handler" as follows:
1735 *
1736 * @refsnippet{src/scip/cons_knapsack.c,SnippetConsCopyKnapsack}
1737 *
1738 * <b>Note:</b> If you implement this callback, take care when setting the valid pointer.
1739 *
1740 * A problem copy is called valid if it is valid in both the primal and the dual sense, i.e., if
1741 *
1742 * - it is a relaxation of the source problem
1743 * - it does not enlarge the feasible region.
1744 *
1745 * A constraint handler may choose to not copy a constraint and still declare the resulting copy as valid. It must ensure
1746 * the feasibility of any solution to the problem copy in the original (source) space.
1747 *
1748 * <b>Note:</b> If you implement this callback and the constraint handler needs constraints (see CONSHDLR_NEEDSCONS),
1749 * then you also need to implement the callback \ref CONSCOPY.
1750 *
1751 * @subsection CONSINIT
1752 *
1753 * The CONSINIT callback is executed after the problem is transformed.
1754 * The constraint handler may, e.g., use this call to replace the original variables in its constraints by transformed
1755 * variables, or to initialize its statistical constraint handler data.
1756 *
1757 * @subsection CONSEXIT
1758 *
1759 * The CONSEXIT callback is executed before the transformed problem is freed.
1760 * In this function, the constraint handler should free all resources that were allocated for the solving process.
1761 *
1762 * @subsection CONSINITPRE
1763 *
1764 * The CONSINITPRE callback is executed before the preprocessing is started, even if presolving is turned off.
1765 * The constraint handler may use this call to initialize its presolving data, or to modify its constraints
1766 * before the presolving process begins.
1767 * Necessary constraint modifications that have to be performed even if presolving is turned off should be done here
1768 * or in the presolving deinitialization call.
1769 *
1770 * @subsection CONSEXITPRE
1771 *
1772 * The CONSEXITPRE callback is executed after the preprocessing has been finished, even if presolving is turned off.
1773 * The constraint handler may use this call e.g. to clean up its presolving data, or to finally modify its constraints
1774 * before the branch-and-bound process begins.
1775 * Necessary constraint modifications that have to be performed even if presolving is turned off should be done here
1776 * or in the presolving initialization call.
1777 * Besides necessary modifications and clean up, no time consuming operations should be done.
1778 *
1779 * @subsection CONSINITSOL
1780 *
1781 * The CONSINITSOL callback is executed when the presolving is finished and the branch-and-bound process is about to
1782 * begin.
1783 * The constraint handler may use this call to initialize its branch-and-bound specific data.
1784 *
1785 * @subsection CONSEXITSOL
1786 *
1787 * The CONSEXITSOL callback is executed before the branch-and-bound process is freed.
1788 * The constraint handler should use this call to clean up its branch-and-bound data, in particular to release
1789 * all LP rows that it has created or captured.
1790 *
1791 * @subsection CONSDELETE
1792 *
1793 * The CONSDELETE callback is executed if a constraint should be freed.
1794 * You can think of it as the destructor of a single constraint.
1795 * In the callback, you have to free the given constraint data.
1796 * The CONSDELETE callback is therefore the counterpart of the SCIPcreateCons...() interface function and the CONSTRANS
1797 * function.
1798 *
1799 * @subsection CONSTRANS
1800 *
1801 * The CONSTRANS function is called for each constraint of the constraint handler, when the user starts the solving
1802 * process.
1803 * It has to copy the original constraint data of the constraint to the memory for the transformed problem.
1804 * You can think of it as a copy constructor for a single constraint.
1805 *
1806 * The original model is copied in order to protect it from transformations that are applied during the solving process,
1807 * in particular during preprocessing.
1808 * Preprocessing and solving always operates on the transformed problem.
1809 * If the solving process data are freed, the original data still exist and the user can, e.g., modify the problem and
1810 * restart the solving process.
1811 *
1812 * If you do not implement the CONSTRANS function, a transformed constraint is created with the same flags and the
1813 * same constraint data pointer.
1814 * That means, the transformed constraint points to the original constraint data.
1815 * This is okay, as long as the constraint data is not changed during the solving process.
1816 * If you want to implement preprocessing functions or other functions that modify the constraint data, you have to
1817 * implement the CONSTRANS function and create a copy of the constraint data.
1818 *
1819 * Here is an example, which is taken from the \ref cons_knapsack.h "knapsack constraint handler":
1820 *
1821 * @refsnippet{src/scip/cons_knapsack.c,SnippetConsTransKnapsack}
1822 *
1823 * @subsection CONSINITLP
1824 *
1825 * The CONSINITLP callback is executed before the first LP relaxation is solved.
1826 * It should add the LP relaxations of all "initial" constraints to the LP. The function should scan the constraints
1827 * array for constraints that are marked initial via calls to SCIPconsIsInitial() and put the LP relaxation
1828 * of all initial constraints to the LP with calls to SCIPaddRow().
1829 *
1830 * @subsection CONSSEPALP
1831 *
1832 * The CONSSEPALP callback is executed during the price-and-cut loop of the subproblem processing.
1833 * It should try to generate cutting planes for the constraints of the constraint handler in order to separate
1834 * the current LP solution.
1835 * The function is called in the LP solution loop, which means that a valid LP solution exists.
1836 *
1837 * Usually, a separation callback searches and produces cuts, that are added with a call to SCIPaddRow().
1838 * If the cut should be remembered in the global cut pool, it may also call SCIPaddPoolCut().
1839 * If the cut is constructed via multiple calls to SCIPaddVarToRow(), then performance can be improved by calling
1840 * SCIPcacheRowExtensions() before these additions and SCIPflushRowExtensions() after.
1841 * However, the callback may also produce domain reductions or add other constraints.
1842 *
1843 * The CONSSEPALP callback has the following options:
1844 * - detecting that the node is infeasible in the variables' bounds and can be cut off (result SCIP_CUTOFF)
1845 * - adding an additional constraint (result SCIP_CONSADDED)
1846 * - reducing a variable's domain (result SCIP_REDUCEDDOM)
1847 * - adding a cutting plane to the LP (result SCIP_SEPARATED)
1848 * - stating that the separator searched, but did not find domain reductions, cutting planes, or cut constraints
1849 * (result SCIP_DIDNOTFIND)
1850 * - stating that the separator was skipped (result SCIP_DIDNOTRUN)
1851 * - stating that the separator was skipped, but should be called again (result SCIP_DELAYED)
1852 * - stating that a new separation round should be started without calling the remaining separator functions (result SCIP_NEWROUND)
1853 *
1854 * Please see also the @ref CONS_ADDITIONALPROPERTIES section to learn about the properties
1855 * CONSHDLR_SEPAFREQ, CONSHDLR_SEPAPRIORITY, and CONSHDLR_DELAYSEPA, which influence the behaviour of SCIP
1856 * calling CONSSEPALP.
1857 *
1858 * @subsection CONSSEPASOL
1859 *
1860 * The CONSSEPASOL callback is executed during separation loop on arbitrary primal solutions.
1861 * It should try to generate cutting planes for the constraints of the constraint handler in order to separate
1862 * the given primal solution.
1863 * The function is not called in the LP solution loop, which means that there is no valid LP solution.
1864 *
1865 * Usually, a separation callback searches and produces cuts, that are added with a call to SCIPaddRow().
1866 * If the cut should be remembered in the global cut pool, it may also call SCIPaddPoolCut().
1867 * If the cut is constructed via multiple calls to SCIPaddVarToRow(), then performance can be improved by calling
1868 * SCIPcacheRowExtensions() before these additions and SCIPflushRowExtensions() after.
1869 * However, the callback may also produce domain reductions or add other constraints.
1870 *
1871 * The CONSSEPASOL callback has the following options:
1872 * - detecting that the node is infeasible in the variables' bounds and can be cut off (result SCIP_CUTOFF)
1873 * - adding an additional constraint (result SCIP_CONSADDED)
1874 * - reducing a variable's domain (result SCIP_REDUCEDDOM)
1875 * - adding a cutting plane to the LP (result SCIP_SEPARATED)
1876 * - stating that the separator searched, but did not find domain reductions, cutting planes, or cut constraints
1877 * (result SCIP_DIDNOTFIND)
1878 * - stating that the separator was skipped (result SCIP_DIDNOTRUN)
1879 * - stating that the separator was skipped, but should be called again (result SCIP_DELAYED)
1880 * - stating that a new separation round should be started without calling the remaining separator functions (result SCIP_NEWROUND)
1881 *
1882 * Please see also the @ref CONS_ADDITIONALPROPERTIES section to learn about the properties
1883 * CONSHDLR_SEPAFREQ, CONSHDLR_SEPAPRIORITY, and CONSHDLR_DELAYSEPA, which influence the behaviour of SCIP
1884 * calling CONSSEPASOL.
1885 *
1886 * @subsection CONSPROP
1887 *
1888 * The CONSPROP callback is called during the subproblem processing.
1889 * It should propagate the constraints, which means that it should infer reductions in the variables' local bounds
1890 * from the current local bounds.
1891 * This technique, which is the main workhorse of constraint programming, is called "node preprocessing" in the
1892 * Integer Programming community.
1893 *
1894 * The CONSPROP callback has the following options:
1895 * - detecting that the node is infeasible in the variables' bounds and can be cut off (result SCIP_CUTOFF)
1896 * - reducing a variable's domain (result SCIP_REDUCEDDOM)
1897 * - stating that the propagator searched, but did not find domain reductions, cutting planes, or cut constraints
1898 * (result SCIP_DIDNOTFIND)
1899 * - stating that the propagator was skipped (result SCIP_DIDNOTRUN)
1900 * - stating that the propagator was skipped, but should be called again (result SCIP_DELAYED)
1901 *
1902 * Please see also the @ref CONS_ADDITIONALPROPERTIES section to learn about the properties
1903 * CONSHDLR_PROPFREQ, CONSHDLR_DELAYPROP, and CONSHDLR_PROP_TIMING, which influence the behaviour of SCIP
1904 * calling CONSPROP.
1905 *
1906 * @subsection CONSRESPROP
1907 *
1908 * If the constraint handler should support \ref CONF "conflict analysis", it has to supply a CONSRESPROP function.
1909 * It also should call SCIPinferVarLbCons() or SCIPinferVarUbCons() in domain propagation instead of SCIPchgVarLb() or
1910 * SCIPchgVarUb() in order to deduce bound changes on variables.
1911 * In the SCIPinferVarLbCons() and SCIPinferVarUbCons() calls, the handler provides the constraint that deduced the
1912 * variable's bound change, and an integer value <code>inferinfo</code> that can be arbitrarily chosen.
1913 *
1914 * The propagation conflict resolving function CONSRESPROP must then be implemented to provide the "reasons" for the bound
1915 * changes, i.e., the bounds of variables at the time of the propagation, which forced the constraint to set the
1916 * conflict variable's bound to its current value. It can use the <code>inferinfo</code> tag to identify its own propagation rule
1917 * and thus identify the "reason" bounds. The bounds that form the reason of the assignment must then be provided by
1918 * calls to SCIPaddConflictLb() and SCIPaddConflictUb() in the propagation conflict resolving function.
1919 *
1920 * <b>Note:</b> The fact that <code>inferinfo</code> is an integer, as opposed to an arbitrary data object, is a compromise between space and speed. Sometimes a propagator would
1921 * need more information to efficiently infer the original propagation steps that lead to the conflict. This would,
1922 * however, require too much space. In the extreme, the original propagation steps have to be repeated.
1923 *
1924 * For example, the \ref cons_logicor.h "logicor constraint" \f$c = x \vee y \vee z\f$ fixes variable \f$z\f$ to TRUE (i.e., changes the lower
1925 * bound of \f$z\f$ to 1.0), if both, \f$x\f$ and \f$y\f$, are assigned to FALSE (i.e., if the upper bounds of these
1926 * variables are 0.0). It uses <code>SCIPinferVarLbCons(scip, z, 1.0, c, 0)</code> to apply this assignment (an
1927 * inference information tag is not needed by the constraint handler and is set to 0). In the conflict analysis, the
1928 * constraint handler may be asked to resolve the lower bound change on \f$z\f$ with constraint \f$c\f$, that was
1929 * applied at a time given by a bound change index "bdchgidx". With a call to <code>SCIPgetVarLbAtIndex(z,
1930 * bdchgidx)</code>, the handler can find out, that the lower bound of variable \f$z\f$ was set to 1.0 at the given
1931 * point of time, and should call <code>SCIPaddConflictUb(scip, x, bdchgidx)</code> and <code>SCIPaddConflictUb(scip, y,
1932 * bdchgidx)</code> to tell SCIP, that the upper bounds of \f$x\f$ and \f$y\f$ at this point of time were the reason for
1933 * the deduction of the lower bound of \f$z\f$.
1934 *
1935 * If conflict analysis should not be supported, the function has to set the result code to SCIP_DIDNOTFIND. Although
1936 * this is a viable approach to circumvent the implementation of the usually rather complex conflict resolving function, it
1937 * will make the conflict analysis less effective. We suggest to first omit the conflict resolving function and check how
1938 * effective the \ref CONSPROP "propagation function" is. If it produces a lot of propagations for your application, you definitely should
1939 * consider implementing the conflict resolving function.
1940 *
1941 * @subsection CONSPRESOL
1942 *
1943 * The CONSPRESOL callback is called during preprocessing.
1944 * It should try to tighten the domains of the variables, tighten the coefficients of the constraints of the constraint
1945 * handler, delete redundant constraints, aggregate and fix variables if possible, and upgrade constraints to more
1946 * specific types.
1947 *
1948 * If the CONSPRESOL callback applies changes to the constraint data, you also have to implement the \ref CONSTRANS callback
1949 * in order to copy the constraint data to the transformed problem space and protect the original problem from the
1950 * preprocessing changes.
1951 *
1952 * To inform SCIP that the presolving function found a reduction the result pointer has to be set in a proper way.
1953 * The following options are possible:
1954 *
1955 * - SCIP_UNBOUNDED : at least one variable is not bounded by any constraint in objective direction
1956 * - SCIP_CUTOFF : at least one constraint is infeasible in the variable's bounds
1957 * - SCIP_SUCCESS : the presolver found a reduction
1958 * - SCIP_DIDNOTFIND : the presolver searched, but did not find a presolving change
1959 * - SCIP_DIDNOTRUN : the presolver was skipped
1960 * - SCIP_DELAYED : the presolver was skipped, but should be called again
1961 *
1962 * Please see also the @ref CONS_ADDITIONALPROPERTIES section to learn about the properties
1963 * CONSHDLR_PRESOLTIMING and CONSHDLR_MAXPREROUNDS, which influence the behaviour of SCIP
1964 * calling CONSPRESOL.
1965 *
1966 * @subsection CONSACTIVE
1967 *
1968 * The CONSACTIVE callback is called each time a constraint of the constraint handler is activated.
1969 * For example, if a constraint is added locally to a subproblem, the CONSACTIVE callback is called whenever the
1970 * search enters the subtree where the constraint exists.
1971 *
1972 * @subsection CONSDEACTIVE
1973 *
1974 * The CONSDEACTIVE callback is called each time a constraint of the constraint handler is deactivated.
1975 * For example, if a constraint is added locally to a subproblem, the CONSDEACTIVE callback is called whenever the
1976 * search leaves the subtree where the constraint exists.
1977 *
1978 * @subsection CONSENABLE
1979 *
1980 * The CONSENABLE callback is called each time a constraint of the constraint handler is enabled.
1981 * Constraints might be active without being enabled. In this case, only the feasibility checks are executed,
1982 * but domain propagation and separation is skipped.
1983 *
1984 * @subsection CONSDISABLE
1985 *
1986 * The CONSDISABLE callback is called each time a constraint of the constraint handler is disabled.
1987 *
1988 * @subsection CONSPRINT
1989 *
1990 * The CONSPRINT callback is called, when the user asks SCIP to display the problem to the screen
1991 * or save the problem into a file. This is, however, only the case if the user requested the CIP format.
1992 * For more details about reading and writing with SCIP we refer to the \ref READER "file readers". In this
1993 * callback the constraint handler should display the data of the constraint in an appropriate form.
1994 * The output format that is defined by the CONSPRINT callbacks is called CIP format.
1995 * In later versions of SCIP, the constraint handlers should also be able to parse (i.e., read) constraints
1996 * which are given in CIP format.
1997 *
1998 * @subsection CONSCOPY
1999 *
2000 * The CONSCOPY callback is used whenever constraints should be copied from one SCIP instance into another SCIP
2001 * instance. This function comes with the necessary parameters to do so, most importantly with a mapping of the variables of the
2002 * source SCIP instance to the corresponding variables of the target SCIP instance, and a mapping for the constraints
2003 * in the same way. For a complete list of all arguments of this callback see type_cons.h.
2004 *
2005 * To get the corresponding target variable of a given source variable, you can use the variable map directly:
2006 *
2007 * \code
2008 * targetvar = (SCIP_VAR*) SCIPhashmapGetImage(varmap, sourcevar);
2009 * \endcode
2010 *
2011 * We recommend, however, to use the function SCIPgetVarCopy() which gets besides others the variable map and the constraint map as input
2012 * and returns the requested target variable. The advantage of using SCIPgetVarCopy() is that in the case
2013 * the required variable does not yet exist, it is created and added to the copy automatically:
2014 *
2015 * \code
2016 * SCIP_CALL( SCIPgetVarCopy(sourcescip, scip, sourcevar, &targetvar, varmap, consmap, global) );
2017 * \endcode
2018 *
2019 * Finally, the result pointer <code>valid</code> has to be set to TRUE if (and only if!) the copy process was successful.
2020 *
2021 * <b>Note:</b> Be careful when setting the valid pointer.
2022 * A problem copy is called valid if it is valid in both the primal and the dual sense, i.e., if
2023 *
2024 * - it is a relaxation of the source problem
2025 * - it does not enlarge the feasible region.
2026 *
2027 * A constraint handler may choose to not copy a constraint and still declare the resulting copy as valid. Therefore, it must ensure
2028 * the feasibility of any solution to the problem copy in the original (source) space.
2029 *
2030 * For an example implementation we refer to cons_linear.h. Additional documentation and the complete list of all
2031 * parameters can be found in the file in type_cons.h.
2032 *
2033 * @subsection CONSPARSE
2034 *
2035 * This function is the counterpart to CONSPRINT. The ideal idea is that a constraint handler is able to parse the output
2036 * which it generated via the CONSPRINT function and creates the corresponding constraint. If the parsing was successfully
2037 * the result pointer success should be set to TRUE. An example implementation can be found in the \ref cons_linear.h
2038 * "linear constraint handler".
2039 *
2040 * @subsection CONSDELVARS
2041 *
2042 * This function should iterate over the given constraints and delete all variables that were marked for deletion by SCIPdelVar().
2043 * Variable deletion is especially interesting for branch-cut-and-price applications. If your constraint handler allows
2044 * the addition of variables during the solving process (see "modifiable" attribute of constraints), then you might also want to
2045 * implement this callback. This would allow you to not only create variables during solving, but also remove them dynamically
2046 * from the problem to reduce memory consumption in case they are no longer necessary.
2047 * During presolving, SCIP may also find that some variables are not needed anymore and then try
2048 * to delete them. Thus, if you do not implement this callback, the constraint handler should capture its variables via
2049 * SCIPcaptureVar() to prevent SCIP from erroneously deleting them.
2050 *
2051 * Additional documentation and the complete list of all parameters can be found in the file type_cons.h.
2052 *
2053 * @subsection CONSGETVARS
2054 *
2055 * The CONSGETVARS callback of a constraint handler can be implemented to give access to the constraint variables
2056 * as array, independently from the internal data structure of the constraint. The buffer array
2057 * is already passed, together with its length. Consider implementing @ref CONSGETNVARS, too, to have
2058 * information about the number of variables in this constraint.
2059 *
2060 * @subsection CONSGETNVARS
2061 *
2062 * This callback can be implemented to return the number of variables involved into a particular constraint.
2063 * In order to have access to the variable pointers, consider implementing @ref CONSGETVARS.
2064 *
2065 * @refsnippet{src/scip/cons_linear.c,Callback for the number of variables}
2066 *
2067 * @subsection CONSGETDIVEBDCHGS
2068 *
2069 * This callback is used inside the various diving heuristics of SCIP and does not affect the normal branching
2070 * of the actual search.
2071 * The constraint handler can provide this callback to render a current working solution (even more) infeasible by
2072 * suggesting one or several variable bound changes.
2073 *
2074 * @section CONS_FURTHERINFO Further documentation
2075 *
2076 * Further documentation can be found in @ref type_cons.h for callback descriptions and a complete
2077 * list of all callback parameters, or in @ref scip.h
2078 * for globally available functions.
2079 */
2080
2081/*--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
2082
2083/**@page PRICER How to add variable pricers
2084 *
2085 * A pricer performs the dynamic generation of new variables in a column generation algorithm.
2086 * It is an algorithmic representation of a (usually exponential) number of variables.
2087 * The \ref PRICERREDCOST and \ref PRICERFARKAS functions are called after each LP solve to generate additional
2088 * variables which may improve the objective value or decrease the LP infeasibility, respectively.
2089 * \n
2090 * A complete list of all pricers contained in this release can be found \ref PRICERS "here".
2091 *
2092 * If the pricer finds one or more variables with negative reduced costs or negative Farkas value, it should
2093 * call SCIPcreateVar() and SCIPaddPricedVar() to create and add the variable to the problem. Additionally,
2094 * the pricer has to add the variable to all constraints in which it appears. Therefore, a pricer needs to
2095 * know the constraints of the model and their meaning. Note that all constraints for which additional variables
2096 * are generated by a pricer have to be flagged as "modifiable" in the SCIPcreateCons() call.
2097 *
2098 * We now explain how users can add their own pricers.
2099 * For example, look into the variable pricer for the binpacking problem (examples/Binpacking/src/pricer_binpacking.c) of the
2100 * Binpacking example project.
2101 * The example is written in C. C++ users can easily adapt the code by using the scip::scip::ObjPricer wrapper base class and
2102 * implement the scip_...() virtual methods instead of the SCIP_DECL_PRICER... callbacks.
2103 *
2104 * Additional documentation for the callbacks of a pricer can be found in the file
2105 * type_pricer.h.
2106 *
2107 * Notice that if your pricer cannot cope with variable bounds other than 0 and infinity, you have to mark
2108 * all constraints containing priced variables as modifiable, and you may have to disable reduced cost
2109 * strengthening by setting propagating/rootredcost/freq to -1.
2110 *
2111 * Here is what you have to do to implement a pricer:
2112 * -# Copy the template files src/scip/pricer_xyz.c and src/scip/pricer_xyz.h into files "pricer_mypricer.c"
2113 * and "pricer_mypricer.h".
2114 * \n
2115 * Make sure to adjust your build system such that these files are compiled and linked to your project. \n
2116 * If you are adding a new default plugin, this means updating the `src/CMakeLists.txt` and `Makefile` files in the SCIP distribution.
2117 * -# Use `SCIPincludePricerMypricer()` in order to include the pricer into your SCIP instance,
2118 * e.g., in the main file of your project (see, e.g., src/cmain.c in the Binpacking example). \n
2119 * If you are adding a new default plugin, this include function must be added to `src/scipdefplugins.c`.
2120 * -# Open the new files with a text editor and replace all occurrences of "xyz" by "mypricer".
2121 * -# Adjust the properties of the pricer (see \ref PRICER_PROPERTIES).
2122 * -# Define the pricer data (see \ref PRICER_DATA). This is optional.
2123 * -# Implement the interface functions (see \ref PRICER_INTERFACE).
2124 * -# Implement the fundamental callbacks (see \ref PRICER_FUNDAMENTALCALLBACKS).
2125 * -# Implement the additional callbacks (see \ref PRICER_ADDITIONALCALLBACKS). This is optional.
2126 *
2127 *
2128 * @section PRICER_PROPERTIES Properties of a Pricer
2129 *
2130 * At the top of the new file "pricer_mypricer.c" you can find the pricer properties.
2131 * These are given as compiler defines.
2132 * In the C++ wrapper class, you have to provide the pricer properties by calling the constructor
2133 * of the abstract base class scip::ObjPricer from within your constructor.
2134 * The properties you have to set have the following meaning:
2135 *
2136 * \par PRICER_NAME: the name of the pricer.
2137 * This name is used in the interactive shell to address the pricer.
2138 * Additionally, if you are searching for a pricer with SCIPfindPricer(), this name is looked up.
2139 * Names have to be unique: no two pricers may have the same name.
2140 *
2141 * \par PRICER_DESC: the description of the pricer.
2142 * This string is printed as a description of the pricer in the interactive shell.
2143 *
2144 * \par PRICER_PRIORITY: the priority of the pricer.
2145 * In each pricing round during the price-and-cut loop of the subproblem processing, the included pricers are
2146 * called in a predefined order, which is given by the priorities of the pricers.
2147 * The higher the priority, the earlier the pricer is called.
2148 * Usually, you will have only one pricer in your application and the priority is therefore irrelevant.
2149 *
2150 * \par PRICER_DELAY: the default for whether the pricer should be delayed, if other variables with negative reduced
2151 * costs have already been found in the current pricing round.
2152 * Variables may be declared to be "removable" in the SCIPcreateVar() call. This means that SCIP may remove the variable
2153 * from the LP if it was inactive (i.e., sitting at zero) for a number of LP solves. Nevertheless, after the removal of the
2154 * column from the LP, the variable still exists, and SCIP can calculate reduced costs and add it to the LP again if
2155 * necessary.
2156 * \n
2157 * If the PRICER_DELAY flag is set to TRUE (which is the common setting), all those existing variables with negative reduced costs
2158 * are added to the LP, and the LP is resolved before the pricer is called. Thus, the pricer can assume that all existing variables
2159 * have non-negative reduced costs if the \ref PRICERREDCOST function is called or non-positive Farkas value if the \ref PRICERFARKAS
2160 * function is called.
2161 * \n
2162 * In some applications, this inner pricing loop on the already existing variables can significantly slow down the solving process,
2163 * since it may lead to the addition of only very few variables in each pricing round. If this is an issue in your application,
2164 * you should consider setting the PRICER_DELAY flag to FALSE. You must, however, be aware of the fact that there may be already
2165 * existing variables with negative reduced costs. For example, this may lead to the issue that your pricer generates the same
2166 * variable twice. In some models, this is not critical because an optimal solution would choose only one of the two identical
2167 * variables anyway, but for other models this can lead to wrong results because the duplication of a variable essentially doubles
2168 * the upper bound of the variable.
2169 *
2170 *
2171 * @section PRICER_DATA Pricer Data
2172 *
2173 * Below the header "Data structures" you can find a struct which is called "struct SCIP_PricerData".
2174 * In this data structure, you can store the data of your pricer. For example, it may be convenient to store pointers to the
2175 * constraints of the problem instance here, because the pricer has to add variables to those constraints.
2176 * If you are using C++, you can add pricer data, as usual, as object variables to your class.
2177 * \n
2178 * Defining pricer data is optional. You can leave the struct empty.
2179 *
2180 *
2181 * @section PRICER_INTERFACE Interface Functions
2182 *
2183 * At the bottom of "pricer_mypricer.c" you can find the interface function SCIPincludePricerMypricer(), which also appears in "pricer_mypricer.h".
2184 * It is called by the user, if (s)he wants to include the pricer, i.e., if (s)he wants to solve a model for which variables should
2185 * be generated by this pricer.
2186 *
2187 * This function only has to be adjusted slightly.
2188 * It is responsible for notifying SCIP of the presence of the pricer. For this, you can either call SCIPincludePricer(),
2189 * or SCIPincludePricerBasic() since SCIP version 3.0. In the latter variant, \ref PRICER_ADDITIONALCALLBACKS "additional callbacks"
2190 * must be added via setter functions as, e.g., SCIPsetPricerCopy(). We recommend this latter variant because
2191 * it is more stable towards future SCIP versions which might have more callbacks, whereas source code using the first
2192 * variant must be manually adjusted with every SCIP release containing new callbacks for pricers in order to compile.
2193 *
2194 *
2195 * In addition, the pricer has to be activated before the solution process starts, like it is done
2196 * in the pricer of the Coloring application (applications/Coloring/src/reader_col.c) by calling
2197 * \code
2198 * SCIP_CALL( SCIPactivatePricer(scip, SCIPfindPricer(scip, "coloring")) );
2199 * \endcode
2200 *
2201 * If you are using pricer data, you have to allocate the memory for the data at this point.
2202 * You can do this by calling:
2203 * \code
2204 * SCIP_CALL( SCIPallocBlockMemory(scip, &pricerdata) );
2205 * \endcode
2206 * You also have to initialize the fields in struct SCIP_PricerData afterwards.
2207 *
2208 * You may also add user parameters for your pricer, see the function SCIPincludePricerColoring() in the pricer of the Coloring application
2209 * for an example of how to add user parameters.
2210 *
2211 *
2212 * @section PRICER_FUNDAMENTALCALLBACKS Fundamental Callbacks of a Pricer
2213 *
2214 * The fundamental callbacks have to be implemented in order to obtain an operational algorithm.
2215 * They are passed together with the pricer itself to SCIP using SCIPincludePricer() or SCIPincludePricerBasic(),
2216 * see @ref PRICER_INTERFACE.
2217 *
2218 * In the case of a pricer, there are two fundamental callbacks, namely the @ref PRICERREDCOST and the
2219 * @ref PRICERFARKAS callbacks, which both search for new variables and add them to the problem.
2220 * These functions have to be implemented for every pricer; the other callbacks are optional.
2221 * In the C++ wrapper class scip::ObjPricer, the scip_redcost() method (which corresponds to the PRICERREDCOST callback)
2222 * is a virtual abstract member function. You have to implement it in order to be able to construct an object of your
2223 * pricer class.
2224 *
2225 * Additional documentation for the callbacks can be found in type_pricer.h.
2226 *
2227 * @subsection PRICERREDCOST
2228 *
2229 * The PRICERREDCOST callback is called inside the price-and-cut loop of the subproblem solving process if the current LP relaxation
2230 * is feasible.
2231 * It should search for additional variables that can contribute to improve the current LP's solution value.
2232 * In standard branch-and-price, these are variables with negative dual feasibility, that is negative
2233 * reduced costs for non-negative variables, positive reduced costs for non-positive variables,
2234 * and non-zero reduced costs for variables that can be negative and positive.
2235 *
2236 * Whenever the pricer finds a variable with negative dual feasibility, it should call SCIPcreateVar()
2237 * and SCIPaddPricedVar() to add the variable to the problem. Furthermore, it should call the appropriate
2238 * functions of the constraint handlers to add the necessary variable entries to the constraints, see pub_cons.h.
2239 *
2240 * In the usual case that the pricer either adds a new variable or ensures that there are no further variables with negative dual feasibility,
2241 * the result pointer should be set to SCIP_SUCCESS. Only if the pricer aborts pricing without creating a new variable, but
2242 * there might exist additional variables with negative dual feasibility, the result pointer should be set to SCIP_DIDNOTRUN.
2243 * In this case, which sometimes is referred to as "early branching", the LP solution will not be used as a lower bound.
2244 * The pricer can, however, store a valid lower bound in the <code>lowerbound</code> pointer.
2245 *
2246 * Pricers usually need the dual LP solution as input for the pricing algorithm.
2247 * Since SCIP does not know the semantics of the individual constraints in the problem, the dual solution
2248 * has to be provided by the constraint handlers.
2249 * For example, the \ref cons_setppc.h "setppc constraint handler", which deals with set partitioning, packing, and covering constraints, provides
2250 * the function SCIPgetDualsolSetppc() to access the dual solution value for a single constraint.
2251 * Similarly, the dual solution of a linear constraint can be queried with the function SCIPgetDualsolLinear() of cons_linear.h.
2252 * The reduced costs of the existing variables can be accessed with the function SCIPgetVarRedcost().
2253 *
2254 * @subsection PRICERFARKAS
2255 *
2256 * If the current LP relaxation is infeasible, it is the task of the pricer to generate additional variables that can
2257 * potentially render the LP feasible again. In standard branch-and-price, these are variables with positive Farkas values,
2258 * and the PRICERFARKAS function should identify those variables.
2259 *
2260 * If the LP was proven to be infeasible, we have an infeasibility proof by the dual Farkas multipliers \f$y\f$.
2261 * With the values of \f$y\f$, an implicit inequality \f$y^T A x \ge y^T b\f$ is associated, with \f$b\f$ given
2262 * by the sides of the LP rows and the sign of \f$y\f$:
2263 * - if \f$y_i\f$ is positive, \f$b_i\f$ is the left hand side of the row,
2264 * - if \f$y_i\f$ is negative, \f$b_i\f$ is the right hand side of the row.
2265 *
2266 * \f$y\f$ is chosen in a way, such that the valid inequality \f$y^T A x \ge y^T b\f$ is violated by all \f$x\f$,
2267 * especially by the (for this inequality least infeasible solution) \f$x'\f$ defined by
2268 * - \f$x'_i := ub_i\f$, if \f$y^T A_i \ge 0\f$
2269 * - \f$x'_i := lb_i\f$, if \f$y^T A_i < 0\f$.
2270 * Pricing in this case means to add variables \f$i\f$ with positive Farkas value, i.e., \f$y^T A_i x'_i > 0\f$.
2271 *
2272 * To apply Farkas pricing, the pricer needs to know the Farkas values of the constraints. Like the dual solution values for
2273 * feasible LP solutions, the dual Farkas values for infeasible solutions can be obtained by constraint handler interface
2274 * functions such as the SCIPgetDualfarkasLinear() function of the linear constraint handler.
2275 * The Farkas values for the bounds of the variables can be accessed with SCIPgetVarFarkasCoef().
2276 *
2277 * It is useful to note that Farkas pricing is the same as the regular pricing with a zero objective function.
2278 * Therefore, a typical implementation of a pricer would consist of a generic pricing algorithm that gets a dual solution and an
2279 * objective function vector as input and generates variables by calling SCIPcreateVar() and SCIPaddPricedVar().
2280 * The PRICERREDCOST callback would call this function with the regular objective function and the regular dual solution vector,
2281 * while the PRICERFARKAS callback would call this function with a zero objective function and the Farkas vector.
2282 * From a practical point of view, it is usually the simplest approach to provide just one Boolean flag to the generic pricing
2283 * algorithm in order to identify whether it is reduced cost or Farkas pricing. Then, the algorithm would just call the appropriate
2284 * functions to access the dual solution or objective function, depending on the Boolean flag.
2285 *
2286 * @section PRICER_ADDITIONALCALLBACKS Additional Callbacks of a Pricer
2287 *
2288 * The additional callbacks do not need to be implemented in every case.
2289 * However, some of them have to be implemented for most applications. They can either be passed directly with
2290 * SCIPincludePricer() to SCIP or via specific <b>setter functions</b> after a call of SCIPincludePricerBasic(),
2291 * see also @ref PRICER_INTERFACE.
2292 *
2293 * @subsection PRICERFREE
2294 *
2295 * If you are using pricer data, you have to implement this function in order to free the pricer data.
2296 * This can be done by the procedure described in stp/src/pricer_stp.c,
2297 * see https://scipjack.zib.de/.
2298 *
2299 * If you have allocated memory for fields in your pricer data, remember to free this memory
2300 * before freeing the pricer data itself.
2301 * If you are using the C++ wrapper class, this function is not available.
2302 * Instead, just use the destructor of your class to free the member variables of your class.
2303 *
2304 * @subsection PRICERCOPY
2305 *
2306 * The PRICERCOPY callback is executed when the SCIP instance is copied, e.g. to solve a sub-SCIP. By defining this
2307 * callback as <code>NULL</code> the user disables the inclusion of the pricer into all copied SCIP
2308 * instances. This means that primal heuristics will work on a sub-SCIP that contains only a part of the variables
2309 * and no variables are priced in during the solving process of the sub-SCIP. Therefore, primal solutions found in the
2310 * copied problem are typically still valid for the original problem and used for its solving process,
2311 * but dual reductions cannot be transferred to the original problem.
2312 *
2313 * <b>Note:</b> If you implement this callback, be careful when setting the valid pointer. The valid pointer should be
2314 * set to TRUE if (and only if!) you can make sure that all necessary data of the pricer are copied
2315 * correctly. If the complete problem is validly copied, i.e. if the copy functions of all problem defining plugins
2316 * (constraint handlers and pricers) return <code>*valid = TRUE</code>, then dual reductions found for the copied problem can be
2317 * transferred to the original SCIP instance. Thus, if the valid pointer is wrongly set to TRUE, it might happen that
2318 * optimal solutions are cut off.
2319 *
2320 * @subsection PRICERINIT
2321 *
2322 * The PRICERINIT callback is executed after the problem is transformed.
2323 * The pricer may, e.g., use this call to replace the original constraints stored in its pricer data by transformed
2324 * constraints, or to initialize other elements of its pricer data.
2325 *
2326 * @subsection PRICEREXIT
2327 *
2328 * The PRICEREXIT callback is executed before the transformed problem is freed.
2329 * In this function, the pricer should free all resources that have been allocated for the solving process in PRICERINIT.
2330 *
2331 * @subsection PRICERINITSOL
2332 *
2333 * The PRICERINITSOL callback is executed when the presolving is finished and the branch-and-bound process is about to begin.
2334 * The pricer may use this call to initialize its branch-and-bound specific data.
2335 *
2336 * @subsection PRICEREXITSOL
2337 *
2338 * The PRICEREXITSOL callback is executed before the branch-and-bound process is freed.
2339 * The pricer should use this call to clean up its branch-and-bound data, which was allocated in PRICERINITSOL.
2340 *
2341 * @section PRICER_REMARKS Further remarks
2342 *
2343 * If you use your own branching rule (e.g., to branch on constraints), make sure that it is able to branch on \a "pseudo solutions".
2344 * Otherwise, SCIP will use its default branching rules, if necessary (which all branch on variables). This
2345 * could disturb the pricing problem or branching might not even be possible, e.g., if all variables created thus far have already been fixed.
2346 *
2347 * Note that if the original problem is a maximization problem, SCIP will transform the problem into a minimization
2348 * problem by multiplying the objective function by -1. The pricer has to take care of this by multiplying
2349 * the original objective function value of all variables created during the solving process by -1.
2350 *
2351 * In some cases, bounds on variables are implicitly enforced by constraints of the problem and the objective function.
2352 * Therefore, these bounds do not need to be added to the LP explicitly, which has the advantage that the pricing routine does not need to
2353 * care about the corresponding dual values.
2354 * We call these bounds lazy bounds, they may be set by SCIPchgVarLbLazy() and SCIPchgVarUbLazy() for upper or lower bounds, respectively.
2355 * If the lazy bound equals the local bound, the corresponding bound is not put into the LP.
2356 * In diving mode, lazy bounds are explicitly put into the LP, because changing the objective (which is only possible in diving)
2357 * might reverse the implicitly given bounds. When diving is finished, the bounds are again removed from the LP.
2358 */
2359
2360/*--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
2361
2362/**@page PRESOL How to add presolvers
2363 *
2364 * Presolvers are used to reduce the size of the model by removing irrelevant information like redundant constraints,
2365 * to strengthen the LP relaxation by exploiting integrality information, and to extract useful information in the
2366 * presolving step.
2367 * Constraint based presolving is done in the CONSPRESOL callbacks of the constraint handlers, see \ref CONSPRESOL.
2368 * Some propagation steps can already be applied in presolving via the PROPRESOL callbacks of propagators, see \ref PROPPRESOL.
2369 * The presolver plugins complement these by additional, usually optimality based, presolving reductions.
2370 * \n
2371 * A complete list of all presolvers contained in this release can be found \ref PRESOLVERS "here".
2372 *
2373 * We now explain how users can add their own presolvers.
2374 * Take the trivial presolver (src/scip/presol_trivial.c) as an example.
2375 * As all other default plugins, it is written in C. C++ users can easily adapt the code by using the scip::ObjPresol wrapper
2376 * base class and implement the scip_...() virtual methods instead of the SCIP_DECL_PRESOL... callbacks.
2377 *
2378 * Additional documentation for the callbacks of a presolver, in particular for their input parameters,
2379 * can be found in the file type_presol.h.
2380 *
2381 * Here is what you have to do to implement a presolver:
2382 * -# Copy the template files src/scip/presol_xyz.c and src/scip/presol_xyz.h into files named "presol_mypresolver.c"
2383 * and "presol_mypresolver.h".
2384 * \n
2385 * Make sure to adjust your build system such that these files are compiled and linked to your project. \n
2386 * If you are adding a new default plugin, this means updating the `src/CMakeLists.txt` and `Makefile` files in the SCIP distribution.
2387 * -# Use `SCIPincludePresolMypresolver()` in order to include the presolver into your SCIP instance,
2388 * e.g., in the main file of your project (see, e.g., src/cmain.c in the Binpacking example). \n
2389 * If you are adding a new default plugin, this include function must be added to `src/scipdefplugins.c`.
2390 * -# Open the new files with a text editor and replace all occurrences of "xyz" by "mypresolver".
2391 * -# Adjust the properties of the presolver (see \ref PRESOL_PROPERTIES).
2392 * -# Define the presolver data (see \ref PRESOL_DATA). This is optional.
2393 * -# Implement the interface functions (see \ref PRESOL_INTERFACE).
2394 * -# Implement the fundamental callbacks (see \ref PRESOL_FUNDAMENTALCALLBACKS).
2395 * -# Implement the additional callbacks (see \ref PRESOL_ADDITIONALCALLBACKS). This is optional.
2396 *
2397 *
2398 * @section PRESOL_PROPERTIES Properties of a Presolver
2399 *
2400 * At the top of the new file "presol_mypresolver.c", you can find the presolver properties.
2401 * These are given as compiler defines.
2402 * In the C++ wrapper class, you have to provide the presolver properties by calling the constructor
2403 * of the abstract base class scip::ObjPresol from within your constructor.
2404 * The properties you have to set have the following meaning:
2405 *
2406 * \par PRESOL_NAME: the name of the presolver.
2407 * This name is used in the interactive shell to address the presolver.
2408 * Additionally, if you are searching for a presolver with SCIPfindPresol(), this name is looked up.
2409 * Names have to be <b>unique</b>: no two presolvers may have the same name.
2410 *
2411 * \par PRESOL_DESC: the description of the presolver.
2412 * This string is printed as a description of the presolver in the interactive shell.
2413 *
2414 * \par PRESOL_TIMING: the default timing of the presolver.
2415 * There are three presolving timings: FAST, MEDIUM, and EXHAUSTIVE.
2416 * Every presolving round starts with the FAST presolvers. MEDIUM presolvers are only called, if FAST presolvers did not find
2417 * enough reductions in this round so far, and EXHAUSTIVE presolving steps are only performed if all presolvers called before
2418 * in this round were unsuccessful.
2419 * Presolvers should be assigned a timing based on how expensive they are, e.g., presolvers that provide fast algorithms that
2420 * usually have a high impact (i.e., remove lots of variables or tighten bounds of many variables) should have a timing FAST.
2421 * If a presolver implements different algorithms of different complexity, it may also get multiple timings and check the timing
2422 * internally in the \ref PRESOLEXEC callback to decide which algorithms to run.
2423 *
2424 * \par PRESOL_PRIORITY: the priority of the presolver.
2425 * Within a presolving round, when calling all presolvers and presolving functions of propagators and constraint handlers
2426 * with a given timing, those are called in
2427 * a predefined order, which is given by the priorities of the presolvers and the check priorities of the
2428 * constraint handlers, see \ref CONS_PROPERTIES.
2429 * First, the presolvers with non-negative priority are called in the order of decreasing priority.
2430 * Next, the presolving functions of the different constraint handlers are called in the order of decreasing check
2431 * priority.
2432 * Finally, the presolvers with negative priority are called in the order of decreasing priority.
2433 * \n
2434 * Again, presolvers that provide fast algorithms that usually have a high impact (i.e., remove lots of variables or tighten
2435 * bounds of many variables) should have a high priority.
2436 * An easy way to list the timings and
2437 * priorities of all presolvers, propagators, and constraint handlers is to type "display presolvers", "display propagators",
2438 * and "display conshdlrs" in the interactive shell of SCIP.
2439 *
2440 * \par PRESOL_MAXROUNDS: the default maximal number of rounds the presolver participates in.
2441 * The presolving is conducted in rounds: the presolvers and presolving functions of the constraint handlers
2442 * are called iteratively until no more reductions have been found or some other abort criterion applies.
2443 * The "maxrounds" parameter of a presolver imposes a limit on the number of presolving rounds in which the
2444 * presolver is called. The PRESOL_MAXROUNDS property specifies the default value for this parameter.
2445 * A value of -1 represents an unlimited number of rounds.
2446 *
2447 *
2448 * @section PRESOL_DATA Presolver Data
2449 *
2450 * Below the header "Data structures" you can find a struct which is called "struct SCIP_PresolData".
2451 * In this data structure, you can store the data of your presolver. For example, you should store the adjustable parameters
2452 * of the presolver in this data structure.
2453 * If you are using C++, you can add presolver data as usual as object variables to your class.
2454 * \n
2455 * Defining presolver data is optional. You can leave this struct empty.
2456 *
2457 *
2458 * @section PRESOL_INTERFACE Interface Functions
2459 *
2460 * At the bottom of "presol_mypresolver.c", you can find the interface function SCIPincludePresolMypresolver(),
2461 * which also appears in "presol_mypresolver.h"
2462 * SCIPincludePresolMypresolver() is called by the user, if (s)he wants to include the presolver,
2463 * i.e., if (s)he wants to use the presolver in his/her application.
2464 *
2465 * This function only has to be adjusted slightly.
2466 * It is responsible for notifying SCIP of the presence of the presolver. For this, you can either call SCIPincludePresol(),
2467 * or SCIPincludePresolBasic() since SCIP version 3.0. In the latter variant, \ref PRESOL_ADDITIONALCALLBACKS "additional callbacks"
2468 * must be added via setter functions as, e.g., SCIPsetPresolCopy(). We recommend this latter variant because
2469 * it is more stable towards future SCIP versions which might have more callbacks, whereas source code using the first
2470 * variant must be manually adjusted with every SCIP release containing new callbacks for presolvers in order to compile.
2471 *
2472 * If you are using presolver data, you have to allocate the memory for the data at this point.
2473 * You can do this by calling:
2474 * \code
2475 * SCIP_CALL( SCIPallocBlockMemory(scip, &presoldata) );
2476 * \endcode
2477 * You also have to initialize the fields in struct SCIP_PresolData afterwards. For freeing the
2478 * presolver data, see \ref PRESOLFREE.
2479 *
2480 * You may also add user parameters for your presolver, see \ref PARAM for how to add user parameters and
2481 * the function SCIPincludePresolTrivial() in src/scip/presol_trivial.c for an example.
2482 *
2483 *
2484 * @section PRESOL_FUNDAMENTALCALLBACKS Fundamental Callbacks of a Presolver
2485 *
2486 * The fundamental callbacks of the plugins are the ones that have to be implemented in order to obtain
2487 * an operational algorithm.
2488 * They are passed together with the presolver itself to SCIP using SCIPincludePresol() or SCIPincludePresolBasic(),
2489 * see @ref PRESOL_INTERFACE.
2490 *
2491 * Presolver plugins have only one fundamental callback, namely the @ref PRESOLEXEC function.
2492 * This function has to be implemented for every presolver; the other callbacks are optional.
2493 * In the C++ wrapper class scip::ObjPresol, the scip_exec() method (which corresponds to the PRESOLEXEC callback) is a virtual
2494 * abstract member function.
2495 * You have to implement it in order to be able to construct an object of your presolver class.
2496 *
2497 * Additional documentation for the callbacks, in particular to their input parameters,
2498 * can be found in type_presol.h.
2499 *
2500 * @subsection PRESOLEXEC
2501 *
2502 * The PRESOLEXEC callback is called inside the presolving loop and should perform the actual presolving reductions.
2503 * It should inspect the problem instance at hand and simplify it by tightening bounds of variables, aggregating or fixing
2504 * variables, changing the type of variables, modifying the graph that represents the instance of your application, and
2505 * the like.
2506 *
2507 * Typical functions called by a presolver are, for example, SCIPchgVarType(), SCIPfixVar(), SCIPaggregateVars(), SCIPtightenVarLb(),
2508 * and SCIPtightenVarUb().
2509 *
2510 *
2511 * @section PRESOL_ADDITIONALCALLBACKS Additional Callbacks of a Presolver
2512 *
2513 * The additional callbacks do not need to be implemented in every case. However, some of them have to be
2514 * implemented for most applications, they can be used, for example, to initialize and free private data.
2515 * Additional callbacks can either be passed directly with SCIPincludePresol() to SCIP or via specific
2516 * <b>setter functions</b> after a call of SCIPincludePresolBasic(), see also @ref PRESOL_INTERFACE.
2517 *
2518 * @subsection PRESOLFREE
2519 *
2520 * If you are using presolver data (see \ref PRESOL_DATA and \ref PRESOL_INTERFACE), you have to implement this function in order to free the presolver data.
2521 * This can be done by the following procedure:
2522 *
2523 * @refsnippet{src/scip/presol_boundshift.c,SnippetPresolFreeBoundshift}
2524 *
2525 * If you have allocated memory for fields in your presolver data, remember to free this memory
2526 * before freeing the presolver data itself.
2527 * If you are using the C++ wrapper class, this function is not available.
2528 * Instead, just use the destructor of your class to free the member variables of your class.
2529 *
2530 * @subsection PRESOLINIT
2531 *
2532 * The PRESOLINIT callback is executed after the problem is transformed.
2533 * The presolver may, e.g., use this call to initialize its presolver data.
2534 * The difference between the original and the transformed problem is explained in
2535 * "What is this thing with the original and the transformed problem about?" on \ref FAQ.
2536 *
2537 * @subsection PRESOLCOPY
2538 *
2539 * The PRESOLCOPY callback is executed when a SCIP instance is copied, e.g. to
2540 * solve a sub-SCIP. By
2541 * defining this callback as
2542 * <code>NULL</code> the user disables the execution of the specified
2543 * presolver for all copied SCIP instances. This may deteriorate the performance
2544 * of primal heuristics using sub-SCIPs.
2545 *
2546 * @subsection PRESOLEXIT
2547 *
2548 * The PRESOLEXIT callback is executed before the transformed problem is freed.
2549 * In this function, the presolver should free all resources that have been allocated for the solving process in PRESOLINIT.
2550 *
2551 * @subsection PRESOLINITPRE
2552 *
2553 * The PRESOLINITPRE callback is executed when the presolving is about to begin.
2554 * The presolver may use this call to initialize its presolving data which only need to exist during the presolving stage.
2555 *
2556 * @subsection PRESOLEXITPRE
2557 *
2558 * The PRESOLEXITPRE callback is executed after presolving finishes and before the branch-and-bound process begins.
2559 * The presolver should use this call to clean up its presolving data, which was allocated in PRESOLINITPRE.
2560 */
2561
2562/*--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
2563
2564/**@page SEPA How to add separators
2565 *
2566 * Separators are used to generate cutting planes that strengthen the LP relaxation of the problem formulation, but are
2567 * not required for a completeness and correctness of the model.
2568 * In contrast, constraint-based cutting planes, the second type of cutting planes in SCIP, are separated in the CONSSEPALP and
2569 * CONSSEPASOL callbacks of the constraint handlers, see \ref CONSSEPALP and \ref CONSSEPASOL. These cuts are
2570 * valid inequalities or even facets of the polyhedron described by a single constraint or a subset of the constraints of
2571 * a single constraint class. See also
2572 * "When should I implement a constraint handler, when should I implement a separator?" on \ref FAQ.
2573 * \n
2574 * A complete list of all separators contained in this release can be found \ref SEPARATORS "here".
2575 *
2576 * We now explain how users can add their own separators.
2577 * Take the separator for the class of Gomory mixed integer inequalities (src/scip/sepa_gomory.c) as an example.
2578 * As all other default plugins, it is written in C. C++ users can easily adapt the code by using the scip::ObjSepa wrapper
2579 * base class and implement the scip_...() virtual methods instead of the SCIP_DECL_SEPA... callbacks.
2580 *
2581 * Additional documentation for the callbacks of a separator, in particular for the input parameters,
2582 * can be found in the file type_sepa.h.
2583 *
2584 * Here is what you have to do to implement a separator:
2585 * -# Copy the template files src/scip/sepa_xyz.c and src/scip/sepa_xyz.h into files "sepa_myseparator.c"
2586 * and "sepa_myseparator.h".
2587 \n
2588 * Make sure to adjust your build system such that these files are compiled and linked to your project. \n
2589 * If you are adding a new default plugin, this means updating the `src/CMakeLists.txt` and `Makefile` files in the SCIP distribution.
2590 * -# Use `SCIPincludeSepaMyseparator()` in order to include the separator into your SCIP instance,
2591 * e.g., in the main file of your project (see, e.g., src/cmain.c in the Binpacking example). \n
2592 * If you are adding a new default plugin, this include function must be added to `src/scipdefplugins.c`.
2593 * -# Open the new files with a text editor and replace all occurrences of "xyz" by "myseparator".
2594 * -# Adjust the properties of the separator (see \ref SEPA_PROPERTIES).
2595 * -# Define the separator data (see \ref SEPA_DATA). This is optional.
2596 * -# Implement the interface functions (see \ref SEPA_INTERFACE).
2597 * -# Implement the fundamental callbacks (see \ref SEPA_FUNDAMENTALCALLBACKS).
2598 * -# Implement the additional callbacks (see \ref SEPA_ADDITIONALCALLBACKS). This is optional.
2599 *
2600 *
2601 * @section SEPA_PROPERTIES Properties of a Separator
2602 *
2603 * At the top of the new file "sepa_myseparator.c", you can find the separator properties.
2604 * These are given as compiler defines.
2605 * In the C++ wrapper class, you have to provide the separator properties by calling the constructor
2606 * of the abstract base class scip::ObjSepa from within your constructor.
2607 * The properties you have to set have the following meaning:
2608 *
2609 * \par SEPA_NAME: the name of the separator.
2610 * This name is used in the interactive shell to address the separator.
2611 * Additionally, if you are searching for a separator with SCIPfindSepa(), this name is looked up.
2612 * Names have to be unique: no two separators may have the same name.
2613 *
2614 * \par SEPA_DESC: the description of the separator.
2615 * This string is printed as a description of the separator in the interactive shell.
2616 *
2617 * \par SEPA_PRIORITY: the priority of the separator.
2618 * In each separation round during the price-and-cut loop of the subproblem processing or the separation loop
2619 * of the primal solution separation, the separators and separation functions of the constraint handlers are called in
2620 * a predefined order, which is given by the priorities of the separators and the separation priorities
2621 * of the constraint handlers (see \ref CONS_PROPERTIES).
2622 * First, the separators with non-negative priority are called in the order of decreasing priority.
2623 * Next, the separation functions of the constraint handlers are called in the order of decreasing separation
2624 * priority.
2625 * Finally, the separators with negative priority are called in the order of decreasing priority. An easy way to list the
2626 * priorities of all separators and constraint handlers is to type "display separators" and "display conshdlrs" in
2627 * the interactive shell.
2628 * \n
2629 * The priority of the separator should be set according to the complexity of the cut separation algorithm and the
2630 * impact of the resulting cuts: separators that provide fast algorithms that usually have a high impact (i.e., cut off
2631 * a large portion of the LP relaxation) should have a high priority.
2632 * See \ref SEPAEXECLP and \ref SEPAEXECSOL for further details of the separation callbacks.
2633 *
2634 * \par SEPA_FREQ: the default frequency for separating cuts.
2635 * The frequency defines the depth levels at which the separation functions \ref SEPAEXECLP and \ref SEPAEXECSOL are called.
2636 * For example, a frequency of 7 means, that the separation callback is executed for subproblems that are in depth
2637 * 0, 7, 14, ... of the branching tree. A frequency of 0 means, that the separation function is only called at the root node.
2638 * A frequency of -1 disables the separator.
2639 * \n
2640 * The frequency can be adjusted by the user. This property of the separator only defines the default value of the frequency.
2641 * If you want to have a more flexible control of when to execute the separation algorithm, you have to assign
2642 * a frequency of 1 and implement a check at the beginning of your separation functions whether you really want to execute
2643 * the separation or not. If you do not want to execute it, set the result code of
2644 * \ref SEPAEXECLP and \ref SEPAEXECSOL to SCIP_DIDNOTRUN.
2645 *
2646 * \par SEPA_MAXBOUNDDIST: the default maximal relative distance from the current node's dual bound to primal bound compared to best node's dual bound for applying separation.
2647 * At the current branch-and-bound node, the relative distance from its dual bound (local dual bound)
2648 * to the primal bound compared to the best node's dual bound (global dual bound) is considered. The separation function
2649 * of the separator will only be applied at the current node if this relative distance does not exceed SEPA_MAXBOUNDDIST.
2650 * \n
2651 * For example, if the global dual bound is 50 and the primal bound is 60, SEPA_MAXBOUNDDIST = 0.25 means that separation
2652 * is only applied if the current node's dual bound is in the first quarter of the interval [50,60], i.e., if it is less
2653 * than or equal to 52.5.
2654 * \n
2655 * In particular, the values 0.0 and 1.0 mean that separation is applied at the current best node only or at all
2656 * nodes, respectively. Since separation seems to be most important to apply at nodes that define to the global
2657 * dual bound, 0.0 is probably a good choice for SEPA_MAXBOUNDDIST.
2658 * Note that separators with a frequency of SEPA_FREQ = 0 are only applied at the root node.
2659 * Obviously, at the root node the local dual bound is equal to the global dual bound and thus, the separator is called
2660 * for any value of SEPA_MAXBOUNDDIST.
2661 *
2662 * \par SEPA_USESSUBSCIP: Does the separator use a secondary SCIP instance?
2663 * Some heuristics and separators solve MIPs or SAT problems and use a secondary SCIP instance. Examples are
2664 * Large Neighborhood Search heuristics such as RINS and Local Branching or the CGMIP separator. To avoid recursion,
2665 * these plugins usually deactivate all other plugins that solve MIPs. If a separator uses a secondary SCIP instance,
2666 * this parameter has to be TRUE and it is recommended to call SCIPsetSubscipsOff() for the secondary SCIP instance.
2667 *
2668 * \par SEPA_DELAY: the default for whether the separation function should be delayed, if other separators or constraint handlers found cuts.
2669 * If the separator's separation function is marked to be delayed, it is only executed after no other separator
2670 * or constraint handler found a cut during the price-and-cut loop, and in the last separation or stalling round,
2671 * either in the end, or in an additional round if only the maximal subsequent round is exceeded.
2672 * If the separation function of the separator is very expensive, you may want to mark it to be delayed until all cheap
2673 * separation functions have been executed.
2674 *
2675 * @section SEPA_DATA Separator Data
2676 *
2677 * Below the header "Data structures" you can find a struct which is called "struct SCIP_SepaData".
2678 * In this data structure, you can store the data of your separator. For example, you should store the adjustable
2679 * parameters of the separator in this data structure. In a separator, user parameters for the maximal number of
2680 * separation rounds per node and for the maximal number of cuts separated per separation round might be useful.
2681 * If you are using C++, you can add separator data as usual as object variables to your class.
2682 * \n
2683 * Defining separator data is optional. You can leave the struct empty.
2684 *
2685 * @section SEPA_INTERFACE Interface Functions
2686 *
2687 * At the bottom of "sepa_myseparator.c", you can find the interface function SCIPincludeSepaMyseparator(),
2688 * which also appears in "sepa_myseparator.h"
2689 * SCIPincludeSepaMyseparator() is called by the user, if (s)he wants to include the separator,
2690 * i.e., if (s)he wants to use the separator in his/her application.
2691 *
2692 * This function only has to be adjusted slightly.
2693 * It is responsible for notifying SCIP of the presence of the separator. For this, you can either call SCIPincludeSepa(),
2694 * or SCIPincludeSepaBasic() since SCIP version 3.0. In the latter variant, \ref SEPA_ADDITIONALCALLBACKS "additional callbacks"
2695 * must be added via setter functions as, e.g., SCIPsetSepaCopy(). We recommend this latter variant because
2696 * it is more stable towards future SCIP versions which might have more callbacks, whereas source code using the first
2697 * variant must be manually adjusted with every SCIP release containing new callbacks for separators in order to compile.
2698 *
2699 * If you are using separator data, you have to allocate the memory
2700 * for the data at this point. You can do this by calling:
2701 * \code
2702 * SCIP_CALL( SCIPallocBlockMemory(scip, &sepadata) );
2703 * \endcode
2704 * You also have to initialize the fields in "struct SCIP_SepaData" afterwards. For freeing the
2705 * separator data, see \ref SEPAFREE.
2706 *
2707 * You may also add user parameters for your separator, see \ref PARAM for how to add user parameters and
2708 * the function SCIPincludeSepaGomory() in src/scip/sepa_gomory.c for an example.
2709 *
2710 *
2711 * @section SEPA_FUNDAMENTALCALLBACKS Fundamental Callbacks of a Separator
2712 *
2713 * The fundamental callbacks of the plugins are the ones that have to be implemented in order to obtain
2714 * an operational algorithm.
2715 * They are passed together with the separator itself to SCIP using SCIPincludeSepa() or SCIPincludeSepaBasic(),
2716 * see @ref SEPA_INTERFACE.
2717 *
2718 * Separator plugins have two callbacks, @ref SEPAEXECLP and @ref SEPAEXECSOL, of which at least one must be implemented.
2719 *
2720 * Additional documentation for the callbacks, in particular to their input parameters,
2721 * can be found in type_sepa.h.
2722 *
2723 * @subsection SEPAEXECLP
2724 *
2725 * The SEPAEXECLP callback is executed during the price-and-cut loop of the subproblem processing.
2726 * It should try to generate general purpose cutting planes in order to separate the current LP solution.
2727 * The function is called in the LP solution loop, which means that a valid LP solution exists.
2728 *
2729 * Usually, the callback searches and produces cuts, that are added with a call to SCIPaddRow().
2730 * If the cut should be added to the global cut pool, it calls SCIPaddPoolCut().
2731 * If the cut is constructed via multiple calls to SCIPaddVarToRow(), then performance can be improved by calling
2732 * SCIPcacheRowExtensions() before these additions and SCIPflushRowExtensions() after.
2733 * In addition to LP rows, the callback may also produce domain reductions or add additional constraints.
2734 *
2735 * Overall, the SEPAEXECLP callback has the following options, which is indicated by the possible return values of
2736 * the 'result' variable (see type_sepa.h):
2737 * - detecting that the node is infeasible in the variable's bounds and can be cut off (result SCIP_CUTOFF)
2738 * - adding an additional constraint (result SCIP_CONSADDED)
2739 * - reducing a variable's domain (result SCIP_REDUCEDDOM)
2740 * - adding a cutting plane to the LP (result SCIP_SEPARATED)
2741 * - stating that the separator searched, but did not find domain reductions, cutting planes, or cut constraints
2742 * (result SCIP_DIDNOTFIND)
2743 * - stating that the separator was skipped (result SCIP_DIDNOTRUN)
2744 * - stating that the separator was skipped, but should be called again (result SCIP_DELAYED)
2745 * - stating that a new separation round should be started without calling the remaining separator functions (result SCIP_NEWROUND)
2746 *
2747 * @subsection SEPAEXECSOL
2748 *
2749 * The SEPAEXECSOL callback is executed during the separation loop on arbitrary primal solutions.
2750 * It should try to generate general purpose cutting planes in order to separate the given primal solution.
2751 * The function is not called in the LP solution loop, which means that there is no valid LP solution.
2752 *
2753 * In the standard SCIP environment, the SEPAEXECSOL callback is not used because only LP solutions are
2754 * separated. The SEPAEXECSOL callback provides means to support external relaxation handlers like semidefinite
2755 * relaxations that want to separate an intermediate primal solution vector. Thus, if you do not want to support
2756 * such external plugins, you do not need to implement this callback.
2757 *
2758 * Usually, the callback searches and produces cuts, that are added with a call to SCIPaddRow().
2759 * If the cut should be added to the global cut pool, it calls SCIPaddPoolCut().
2760 * If the cut is constructed via multiple calls to SCIPaddVarToRow(), then performance can be improved by calling
2761 * SCIPcacheRowExtensions() before these additions and SCIPflushRowExtensions() after.
2762 * In addition to LP rows, the callback may also produce domain reductions or add other constraints.
2763 *
2764 * Overall, the SEPAEXECSOL callback has the following options, which is indicated by the possible return values of
2765 * the 'result' variable (see type_sepa.h):
2766 * - detecting that the node is infeasible in the variable's bounds and can be cut off (result SCIP_CUTOFF)
2767 * - adding an additional constraint (result SCIP_CONSADDED)
2768 * - reducing a variable's domain (result SCIP_REDUCEDDOM)
2769 * - adding a cutting plane to the LP (result SCIP_SEPARATED)
2770 * - stating that the separator searched, but did not find domain reductions, cutting planes, or cut constraints
2771 * (result SCIP_DIDNOTFIND)
2772 * - stating that the separator was skipped (result SCIP_DIDNOTRUN)
2773 * - stating that the separator was skipped, but should be called again (result SCIP_DELAYED)
2774 * - stating that a new separation round should be started without calling the remaining separator functions (result SCIP_NEWROUND)
2775 *
2776 *
2777 * @section SEPA_ADDITIONALCALLBACKS Additional Callbacks of a Separator
2778 *
2779 * The additional callbacks do not need to be implemented in every case. However, some of them have to be
2780 * implemented for most applications, they can be used, for example, to initialize and free private data.
2781 * Additional callbacks can either be passed directly with SCIPincludeSepa() to SCIP or via specific
2782 * <b>setter functions</b> after a call of SCIPincludeSepaBasic(), see also @ref SEPA_INTERFACE.
2783 *
2784 * @subsection SEPAFREE
2785 *
2786 * If you are using separator data (see \ref SEPA_DATA and \ref SEPA_INTERFACE), you have to implement this function
2787 * in order to free the separator data. This can be done by the following procedure:
2788 *
2789 * @refsnippet{src/scip/sepa_gomory.c,SnippetSepaFreeGomory}
2790 *
2791 * If you have allocated memory for fields in your separator data, remember to free this memory
2792 * before freeing the separator data itself.
2793 * If you are using the C++ wrapper class, this function is not available.
2794 * Instead, just use the destructor of your class to free the member variables of your class.
2795 *
2796 * @subsection SEPACOPY
2797 *
2798 * The SEPACOPY callback is executed when a SCIP instance is copied, e.g. to
2799 * solve a sub-SCIP. By
2800 * defining this callback as
2801 * <code>NULL</code> the user disables the execution of the specified
2802 * separator for all copied SCIP instances. This may deteriorate the performance
2803 * of primal heuristics using sub-SCIPs.
2804 *
2805 * @subsection SEPAINIT
2806 *
2807 * The SEPAINIT callback is executed after the problem is transformed.
2808 * The separator may, e.g., use this call to initialize its separator data.
2809 * The difference between the original and the transformed problem is explained in
2810 * "What is this thing with the original and the transformed problem about?" on \ref FAQ.
2811 *
2812 * @subsection SEPAEXIT
2813 *
2814 * The SEPAEXIT callback is executed before the transformed problem is freed.
2815 * In this function, the separator should free all resources that have been allocated for the solving process in SEPAINIT.
2816 *
2817 * @subsection SEPAINITSOL
2818 *
2819 * The SEPAINITSOL callback is executed when the presolving is finished and the branch-and-bound process is about to
2820 * begin. The separator may use this call to initialize its branch-and-bound specific data.
2821 *
2822 * @subsection SEPAEXITSOL
2823 *
2824 * The SEPAEXITSOL callback is executed before the branch-and-bound process is freed. The separator should use this call
2825 * to clean up its branch-and-bound data, in particular to release all LP rows that it has created or captured.
2826 */
2827
2828/*--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
2829
2830/**@page PROP How to add propagators
2831 *
2832 * Propagators are used to tighten the domains of the variables. Like for cutting planes, there are two different types
2833 * of domain propagations. Constraint based (primal) domain propagation algorithms are part of the corresponding
2834 * constraint handlers, see \ref CONSPROP. In contrast, domain propagators usually provide dual propagations, i.e.,
2835 * propagations that can be applied using the objective function and the current best known primal solution. This
2836 * section deals with such propagators.
2837 *
2838 * A complete list of all propagators contained in this release can be found \ref PROPAGATORS "here".
2839 *
2840 * We now explain how users can add their own propagators. Take the pseudo objective function propagator
2841 * (src/scip/prop_pseudoobj.c) as an example. As all other default plugins, it is written in C. C++ users can easily
2842 * adapt the code by using the scip::ObjProp wrapper base class and implement the @c scip_...() virtual methods instead
2843 * of the @c SCIP_DECL_PROP... callbacks.
2844 *
2845 * Additional documentation for the callbacks of a propagator can be found in the file type_prop.h.
2846 *
2847 * Here is what you have to do to implement a propagator:
2848 * -# Copy the template files src/scip/prop_xyz.c and src/scip/prop_xyz.h into files named "prop_mypropagator.c"
2849 * and "prop_mypropagator.h".
2850 * \n
2851 * Make sure to adjust your build system such that these files are compiled and linked to your project. \n
2852 * If you are adding a new default plugin, this means updating the `src/CMakeLists.txt` and `Makefile` files in the SCIP distribution.
2853 * -# Use `SCIPincludePropMypropagator()` in order to include the propagator into your SCIP instance,
2854 * e.g., in the main file of your project (see, e.g., src/cmain.c in the Binpacking example). \n
2855 * If you are adding a new default plugin, this include function must be added to `src/scipdefplugins.c`.
2856 * -# Open the new files with a text editor and replace all occurrences of "xyz" by "mypropagator".
2857 * -# Adjust the properties of the propagator (see \ref PROP_PROPERTIES).
2858 * -# Define the propagator data (see \ref PROP_DATA). This is optional.
2859 * -# Implement the interface functions (see \ref PROP_INTERFACE).
2860 * -# Implement the fundamental callbacks (see \ref PROP_FUNDAMENTALCALLBACKS).
2861 * -# Implement the additional callbacks (see \ref PROP_ADDITIONALCALLBACKS). This is optional.
2862 *
2863 * @section PROP_PROPERTIES Properties of a Propagator
2864 *
2865 * At the top of the new file "prop_mypropagator.c" you can find the propagator properties. These are given as compiler
2866 * defines. The presolving-related properties are optional,
2867 * they only have to be defined if the propagator supports presolving routines.
2868 * In the C++ wrapper class, you have to provide the propagator properties by calling the constructor of the
2869 * abstract base class scip::ObjProp from within your constructor. The properties you have the following meaning:
2870 *
2871 * @subsection PROP_FUNDAMENTALPROPERTIES Fundamental properties of a propagator
2872 *
2873 * \par PROP_NAME: the name of the propagator.
2874 * This name is used in the interactive shell to address the propagator. Additionally, if you are searching for a
2875 * propagator with SCIPfindProp(), this name is searched for. Names have to be unique: no two propagators may have the
2876 * same name.
2877 *
2878 * \par PROP_DESC: the description of the propagator.
2879 * This string is printed as a description of the propagator in the interactive shell.
2880 *
2881 * \par PROP_PRIORITY: the priority of the propagator.
2882 * In each propagation round, the propagators and propagation functions of the constraint handlers are called in a
2883 * predefined order, which is given by the priorities of the propagators and the check priorities of the constraint
2884 * handlers. First, the propagators with non-negative priority are called in order of decreasing priority. Next, the
2885 * propagation functions of the different constraint handlers are called in order of decreasing check priority. Finally,
2886 * the propagators with negative priority are called in order of decreasing priority. \n The priority of the
2887 * propagators should be set according to the complexity of the propagation algorithm and the impact of the domain
2888 * propagations: propagators providing fast algorithms that usually have a high impact (i.e., tighten many bounds)
2889 * should have a high priority.
2890 *
2891 * \par PROP_FREQ: the default frequency for propagating domains.
2892 * The frequency defines the depth levels at which the propagation function \ref PROPEXEC is called. For example, a
2893 * frequency of 7 means, that the propagation callback is executed for subproblems that are in depth 0, 7, 14, ... of
2894 * the branching tree. A frequency of 0 means that propagation is only applied in preprocessing and at the root node. A
2895 * frequency of -1 disables the propagator.
2896 * \n
2897 * The frequency can be adjusted by the user. This property of the propagator only defines the default value of the
2898 * frequency.\n
2899 * <b>Note:</b> If you want to have a more flexible control of when to execute the propagation algorithm, you have to
2900 * assign a frequency of 1 and implement a check at the beginning of your propagation algorithm whether you really want
2901 * to execute the domain propagation or not. If you do not want to execute it, set the result code to SCIP_DIDNOTRUN.
2902 *
2903 * \par PROP_DELAY: the default for whether the propagation function should be delayed, if other propagators or constraint handlers found domain reductions.
2904 * If the propagator's propagation function is marked to be delayed, it is only executed after no other propagator or
2905 * constraint handler found a domain reduction in the current iteration of the domain propagation loop. If the
2906 * propagation function of the propagator is very expensive, you may want to mark it to be delayed until all cheap
2907 * propagation functions have been executed.
2908 *
2909 * \par PROP_TIMING: the timing mask of the propagator.
2910 * SCIP calls the domain propagation routines at different places in the node processing loop.
2911 * This property indicates at which places the propagator is called.
2912 * Possible values are defined in type_timing.h and can be concatenated, e.g., as in SCIP_PROPTIMING_ALWAYS.
2913 *
2914 * @subsection PROP_ADDITIONALPROPERTIES Optional propagator properties
2915 *
2916 * The following properties are optional and only need to be defined if the propagator supports
2917 * presolving, that is, if the \ref PROPPRESOL "presolving callback" is implemented.
2918
2919 * \par PROP_PRESOLTIMING: the timing of the presolving function (FAST, MEDIUM, or EXHAUSTIVE).
2920 * Every presolving round starts with the FAST presolvers. MEDIUM presolvers are only called, if FAST presolvers did not find
2921 * enough reductions in this round so far, and EXHAUSTIVE presolving steps are only performed if all presolvers called before
2922 * in this round were unsuccessful.
2923 * Presolving functions should be assigned a timing based on how expensive they are, e.g., presolvers that provide fast algorithms that
2924 * usually have a high impact (i.e., remove lots of variables or tighten bounds of many variables) should have a timing FAST.
2925 * If a presolving function implements different algorithms of different complexity, it may also get multiple timings and check the timing
2926 * internally in the \ref PROPPRESOL callback to decide which algorithms to run.
2927 *
2928 * \par PROP_PRESOL_PRIORITY: the priority of the presolving function.
2929 * This attribute is analogous to the PROP_PRIORITY flag, but deals with the preprocessing function of the presolver.
2930 *
2931 * \par PROP_PRESOL_MAXROUNDS: the default maximal number of presolving rounds the propagator participates in.
2932 * The preprocessing is executed in rounds.
2933 * If enough changes have been applied to the model, an additional preprocessing round is performed.
2934 * The MAXROUNDS parameter of a propagator denotes the maximal number of preprocessing rounds, the propagator
2935 * participates in.
2936 * A value of -1 means, that there is no limit on the number of rounds.
2937 * A value of 0 means, the preprocessing callback of the propagator is disabled.
2938 *
2939 * @section PROP_DATA Propagator Data
2940 *
2941 * Below the title "Data structures" you can find a struct called <code>struct SCIP_PropData</code>. In this data
2942 * structure, you can store the data of your propagator. For example, you should store the adjustable parameters of the
2943 * propagator in this data structure. If you are using C++, you can add propagator data as object variables to your
2944 * class as usual .
2945 * \n
2946 * Defining propagator data is optional. You can leave the struct empty.
2947 *
2948 *
2949 * @section PROP_INTERFACE Interface Functions
2950 *
2951 * At the bottom of "prop_mypropagator.c", you can find the interface function SCIPincludeSepaMypropagator(),
2952 * which also appears in "prop_mypropagator.h"
2953 * SCIPincludePropMypropagator() is called by the user, if (s)he wants to include the propagator,
2954 * i.e., if (s)he wants to use the propagator in his/her application.
2955 *
2956 * This function only has to be adjusted slightly.
2957 * It is responsible for notifying SCIP of the presence of the propagator. For this, you can either call SCIPincludeProp(),
2958 * or SCIPincludePropBasic() since SCIP version 3.0. In the latter variant, \ref PROP_ADDITIONALCALLBACKS "additional callbacks"
2959 * must be added via setter functions as, e.g., SCIPsetPropCopy(). We recommend this latter variant because
2960 * it is more stable towards future SCIP versions which might have more callbacks, whereas source code using the first
2961 * variant must be manually adjusted with every SCIP release containing new callbacks for separators in order to compile.
2962 *
2963 *
2964 * If you are using propagator data, you have to allocate the memory for the data at this point. You can do this by
2965 * calling
2966 * \code
2967 * SCIP_CALL( SCIPallocBlockMemory(scip, &propdata) );
2968 * \endcode
2969 * You also have to initialize the fields in <code>struct SCIP_PropData</code> afterwards.
2970 *
2971 * You may also add user parameters for your propagator, see the function SCIPincludePropPseudoobj() in
2972 * src/scip/prop_pseudoobj.c for an example.
2973 *
2974 *
2975 * @section PROP_FUNDAMENTALCALLBACKS Fundamental Callbacks of a Propagator
2976 *
2977 * The fundamental callbacks of the plugins are the ones that have to be implemented in order to obtain
2978 * an operational algorithm.
2979 * They are passed together with the propagator itself to SCIP using SCIPincludeProp() or SCIPincludePropBasic(),
2980 * see @ref PROP_INTERFACE.
2981 *
2982 * Propagator plugins have one fundamental callback, namely the \ref PROPEXEC function.
2983 * This function has to be implemented for every propagator; the other callbacks are optional. In the
2984 * C++ wrapper class scip::ObjProp, the scip_exec() method (which corresponds to the \ref PROPEXEC
2985 * callback) is a virtual abstract member function. You have to
2986 * implement it in order to be able to construct an object of your propagator class.
2987 *
2988 * Additional documentation for the callbacks can be found in type_prop.h.
2989 *
2990 * @subsection PROPEXEC
2991 *
2992 * The PROPEXEC callback is called during presolving and during the subproblem processing. It should perform the actual
2993 * domain propagation, which means that it should tighten the variables' bounds. The technique of domain propagation,
2994 * which is the main workhorse of constraint programming, is called "node preprocessing" in the Integer Programming
2995 * community.
2996 *
2997 * The PROPEXEC callback has the following options:
2998 * - detecting that the node is infeasible in the variables' bounds and can be cut off (result SCIP_CUTOFF)
2999 * - reducing (i.e, tightening) the domains of some variables (result SCIP_REDUCEDDOM)
3000 * - stating that the propagator searched, but did not find domain reductions, cutting planes, or cut constraints
3001 * (result SCIP_DIDNOTFIND)
3002 * - stating that the propagator was skipped (result SCIP_DIDNOTRUN)
3003 * - stating that the propagator was skipped, but should be called again (result SCIP_DELAYED)
3004 *
3005 *
3006 *
3007 * @section PROP_ADDITIONALCALLBACKS Additional Callbacks of a Propagator
3008 *
3009 * The additional callbacks do not need to be implemented in every case. However, some of them have to be
3010 * implemented for most applications, they can be used, for example, to initialize and free private data.
3011 * Additional callbacks can either be passed directly with SCIPincludeProp() to SCIP or via specific
3012 * <b>setter functions</b> after a call of SCIPincludePropBasic(), see also @ref PROP_INTERFACE.
3013 *
3014 * @subsection PROPRESPROP
3015 *
3016 * If the propagator wants to support \ref CONF "conflict analysis", it has to supply the PROPRESPROP function. It also should call
3017 * SCIPinferVarLbProp() or SCIPinferVarUbProp() in the domain propagation instead of SCIPchgVarLb() or SCIPchgVarUb() in
3018 * order to deduce bound changes on variables. In the SCIPinferVarLbProp() and SCIPinferVarUbProp() calls, the
3019 * propagator provides a pointer to itself and an integer value "inferinfo" that can be arbitrarily chosen.
3020 *
3021 * The propagation conflict resolving function PROPRESPROP must then be implemented to provide the "reasons" for the bound
3022 * changes, i.e., the bounds of variables at the time of the propagation, which forced the propagator to set the
3023 * conflict variable's bound to its current value. It can use the "inferinfo" tag to identify its own propagation rule
3024 * and thus identify the "reason" bounds. The bounds that form the reason of the assignment must then be provided by
3025 * calls to SCIPaddConflictLb() and SCIPaddConflictUb() in the propagation conflict resolving function.
3026 *
3027 * See the description of the propagation conflict resolving function \ref CONSRESPROP of constraint handlers for
3028 * further details.
3029 *
3030 * Omitting the PROPRESPROP callback circumvents the implementation of the usually rather complex conflict resolving function.
3031 * Yet, it
3032 * will make the conflict analysis less effective. We suggest to first omit the conflict resolving function and check how
3033 * effective the propagation function is. If it produces a lot of propagations for your application, you definitely should
3034 * consider implementing the conflict resolving function.
3035 *
3036 *
3037 * @subsection PROPFREE
3038 *
3039 * If you are using propagator data, you have to implement this function in order to free the propagator data.
3040 * This can be done by the following procedure:
3041 *
3042 * @refsnippet{src/scip/prop_redcost.c,SnippetPropFreeRedcost}
3043 *
3044 * If you have allocated memory for fields in your propagator data, remember to free this memory
3045 * before freeing the propagator data itself.
3046 * If you are using the C++ wrapper class, this function is not available.
3047 * Instead, just use the destructor of your class to free the member variables of your class.
3048 *
3049 * @subsection PROPINIT
3050 *
3051 * The PROPINIT callback is executed after the problem is transformed. The propagator may, e.g., use this call to
3052 * initialize its propagator data.
3053 *
3054 * @subsection PROPCOPY
3055 *
3056 * The PROPCOPY callback is executed when a SCIP instance is copied, e.g. to
3057 * solve a sub-SCIP. By
3058 * defining this callback as
3059 * <code>NULL</code> the user disables the execution of the specified
3060 * propagator for all copied SCIP instances. This may deteriorate the performance
3061 * of primal heuristics using sub-SCIPs.
3062 *
3063 * @subsection PROPEXIT
3064 *
3065 * The PROPEXIT callback is executed before the transformed problem is freed.
3066 * In this function, the propagator should free all resources that have been allocated for the solving process in PROPINIT.
3067 *
3068 * @subsection PROPINITPRE
3069 *
3070 * The PROPINITPRE callback is executed before the preprocessing is started, even if presolving is turned off.
3071 * The propagator may use this call to initialize its presolving data before the presolving process begins.
3072 *
3073 * @subsection PROPEXITPRE
3074 *
3075 * The PROPEXITPRE callback is executed after the preprocessing has been finished, even if presolving is turned off.
3076 * The propagator may use this call, e.g., to clean up its presolving data.
3077 * Besides clean up, no time consuming operations should be done.
3078 *
3079 * @subsection PROPINITSOL
3080 *
3081 * The PROPINITSOL callback is executed when the presolving is finished and the branch-and-bound process is about to
3082 * begin.
3083 * The propagator may use this call to initialize its branch-and-bound specific data.
3084 *
3085 * @subsection PROPEXITSOL
3086 *
3087 * The PROPEXITSOL callback is executed before the branch-and-bound process is freed.
3088 * The propagator should use this call to clean up its branch-and-bound data.
3089 *
3090 * @subsection PROPPRESOL
3091 *
3092 * Seaches for domain propagations, analogous to the \ref PROPEXEC callback.
3093 * However, this callback is called during preprocessing.
3094 *
3095 * To inform SCIP that the presolving function found a reduction the result pointer has to be set in a proper way.
3096 * The following options are possible:
3097 *
3098 * - SCIP_UNBOUNDED : at least one variable is not bounded by any constraint in objective direction
3099 * - SCIP_CUTOFF : at least one domain reduction that renders the problem infeasible has been found
3100 * - SCIP_SUCCESS : the presolver found a domain reduction
3101 * - SCIP_DIDNOTFIND : the presolver searched, but did not find a presolving change
3102 * - SCIP_DIDNOTRUN : the presolver was skipped
3103 * - SCIP_DELAYED : the presolver was skipped, but should be called again
3104 *
3105 *
3106 * Please see also the @ref PROP_ADDITIONALPROPERTIES section to learn about the properties
3107 * PROP_PRESOLTIMING and PROP_PRESOL_MAXROUNDS, which influence the behaviour of SCIP
3108 * calling PROPPRESOL.
3109 *
3110 */
3111
3112/*--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
3113
3114/**@page BRANCH How to add branching rules
3115 *
3116 * Branching rules are used to split the problem at the current node into smaller subproblems. Branching rules can be called at three
3117 * different occasions, which is why they have three different execution functions (see \ref
3118 * BRANCHRULE_ADDITIONALCALLBACKS). Branching is performed if:
3119 * - the LP solution of the current problem is fractional. In this case, the integrality constraint handler calls the
3120 * \ref BRANCHEXECLP functions of the branching rules.
3121 * - the list of external branching candidates is not empty. This will only be the case if branching candidates were added
3122 * by a user's \ref RELAX "relaxation handler" or \ref CONS "constraint handler" plugin, calling SCIPaddExternBranchCand().
3123 * These branching candidates should be processed by the \ref BRANCHEXECEXT function.
3124 * - if an integral solution violates one or more constraints and this infeasibility could not be resolved in the callbacks
3125 * \ref CONSENFOLP and \ref CONSENFOPS of the corresponding constraint handlers. In this case, the \ref BRANCHEXECPS function will be called. This is the
3126 * standard case, if you use SCIP as a pure CP or SAT solver. If the LP or any other type of relaxation is used, then
3127 * branching on pseudo solutions works as a last resort.
3128 *
3129 * The idea of branching rules is to take a global view on the problem. In contrast, branching paradigms which are
3130 * specific to one type of constraint are best implemented within the enforcement callbacks of your constraint handler.
3131 * See, e.g., the constraint specific branching rules provided by the constraint handlers for special ordered sets
3132 * (src/scip/cons_sos{1,2}.c)).
3133 * \n
3134 * All branching rules that come with the default distribution of SCIP create two subproblems by splitting a single
3135 * variable's domain. It is, however, fully supported to implement much more general branching schemes, for example by
3136 * creating more than two subproblems, or by adding additional constraints to the subproblems instead of tightening the
3137 * domains of the variables.
3138 * \n
3139 * A complete list of all branching rules contained in this release can be found \ref BRANCHINGRULES "here".
3140 * However, note that constraint handlers can implement their own branching when enforcing constraints.
3141 * In particular the handler for nonlinear constraints currently does not use the branching plugins for spatial branching
3142 * by default. Its behavior can be adjusted with the parameters in category constraints/nonlinear/branching.
3143 *
3144 * We now explain how users can add their own branching rules. Take the most infeasible LP branching rule
3145 * (src/scip/branch_mostinf.c) as an example. As all other default plugins, it is written in C. C++ users can easily
3146 * adapt the code by using the scip::ObjBranchrule wrapper base class and implement the scip_...() virtual methods instead of
3147 * the SCIP_DECL_BRANCH... callbacks.
3148 *
3149 * Additional documentation for the callbacks of a branching rule can be found in the file type_branch.h.
3150 *
3151 * Here is what you have to do to implement a branching rule:
3152 * -# Copy the template files src/scip/branch_xyz.c and src/scip/branch_xyz.h into files named
3153 * "branch_mybranchingrule.c" and "branch_mybranchingrule.h".
3154 * \n
3155 * Make sure to adjust your build system such that these files are compiled and linked to your project. \n
3156 * If you are adding a new default plugin, this means updating the `src/CMakeLists.txt` and `Makefile` files in the SCIP distribution.
3157 * -# Use `SCIPincludeBranchruleMybranchingrule()` in order to include the branching rule into your SCIP instance,
3158 * e.g., in the main file of your project (see, e.g., src/cmain.c in the Binpacking example). \n
3159 * If you are adding a new default plugin, this include function must be added to `src/scipdefplugins.c`.
3160 * -# Open the new files with a text editor and replace all occurrences of "xyz" by "mybranchingrule".
3161 * -# Adjust the properties of the branching rule (see \ref BRANCHRULE_PROPERTIES).
3162 * -# Define the branching rule data (see \ref BRANCHRULE_DATA). This is optional.
3163 * -# Implement the interface functions (see \ref BRANCHRULE_INTERFACE).
3164 * -# Implement the fundamental callbacks (see \ref BRANCHRULE_FUNDAMENTALCALLBACKS).
3165 * -# Implement the additional callbacks (see \ref BRANCHRULE_ADDITIONALCALLBACKS). This is optional.
3166 *
3167 *
3168 * @section BRANCHRULE_PROPERTIES Properties of a Branching Rule
3169 *
3170 * At the top of the new file "branch_mybranchingrule.c" you can find the branching rule properties.
3171 * These are given as compiler defines.
3172 * In the C++ wrapper class, you have to provide the branching rule properties by calling the constructor
3173 * of the abstract base class scip::ObjBranchrule from within your constructor.
3174 * The properties you have to set have the following meaning:
3175 *
3176 * \par BRANCHRULE_NAME: the name of the branching rule.
3177 * This name is used in the interactive shell to address the branching rule.
3178 * Additionally, if you are searching for a branching rule with SCIPfindBranchrule(), this name is looked up.
3179 * Names have to be unique: no two branching rules may have the same name.
3180 *
3181 * \par BRANCHRULE_DESC: the description of the branching rule.
3182 * This string is printed as a description of the branching rule in the interactive shell.
3183 *
3184 * \par BRANCHRULE_PRIORITY: the default value for the priority of the branching rule.
3185 * In the subproblem processing, the branching rules are called in decreasing order of their priority until
3186 * one succeeded to branch. Since most branching rules are able to generate a branching in all situations,
3187 * only the rule of highest priority is used. In combination with the BRANCHRULE_MAXDEPTH and
3188 * BRANCHRULE_MAXBOUNDDIST settings, however, interesting strategies can be easily employed. For example,
3189 * the user can set the priority of the "full strong branching" strategy to the highest value and assign the
3190 * second highest value to the "reliable pseudo cost" rule. If (s)he also sets the maximal depth for the
3191 * "full strong branching" to 5, in the top 5 depth levels of the search tree the "full strong branching" is
3192 * applied, while in the deeper levels "reliable pseudo cost branching" is used.
3193 * \n
3194 * Note that the BRANCHRULE_PRIORITY property only specifies the default value of the priority. The user can
3195 * change this value arbitrarily.
3196 *
3197 * \par BRANCHRULE_MAXDEPTH: the default value for the maximal depth level of the branching rule.
3198 * This parameter denotes the maximal depth level in the branch-and-bound tree up to which the branching function of the
3199 * branching rule will be applied. Use -1 for no limit.
3200 * \n
3201 * Note that this property only specifies the default value. The user can change this value arbitrarily.
3202 *
3203 * \par BRANCHRULE_MAXBOUNDDIST: the default value for the maximal relative distance from current node's dual bound to primal bound compared to best node's dual bound for applying branching.
3204 * At the current branch-and-bound node, the relative distance from its dual bound (local dual bound)
3205 * to the primal bound compared to the best node's dual bound (global dual bound) is considered. The branching function of
3206 * the branching rule will only be applied at the node if this relative distance does not exceed BRANCHRULE_MAXBOUNDDIST.
3207 * \n
3208 * For example, if the global dual bound is 50 and the primal bound is 60, BRANCHRULE_MAXBOUNDDIST = 0.25 means that
3209 * branching is only applied if the current node's dual bound is in the first quarter of the interval [50,60], i.e., if it
3210 * is less than or equal to 52.5. In particular, the values 0.0 and 1.0 mean that the branching rule is applied at the
3211 * current best node only or at all nodes, respectively.
3212 * \n
3213 * Note that the BRANCHRULE_MAXBOUNDDIST property only specifies the default value of the maximal bound distance.
3214 * The user can change this value arbitrarily.
3215 *
3216 *
3217 * @section BRANCHRULE_DATA Branching Rule Data
3218 *
3219 * Below the header "Data structures" you can find a struct which is called "struct SCIP_BranchruleData".
3220 * In this data structure, you can store the data of your branching rule. For example, you should store the adjustable
3221 * parameters of the branching rule in this data structure.
3222 * If you are using C++, you can add branching rule data as usual as object variables to your class.
3223 * \n
3224 * Defining branching rule data is optional. You can leave the struct empty.
3225 *
3226 *
3227 * @section BRANCHRULE_INTERFACE Interface Functions
3228 *
3229 * At the bottom of "branch_mybranchingrule.c", you can find the interface function SCIPincludeBranchruleMybranchingrule(),
3230 * which also appears in "branch_mybranchingrule.h"
3231 * SCIPincludeBranchruleMybranchingrule() is called by the user, if (s)he wants to include the branching rule,
3232 * i.e., if (s)he wants to use the branching rule in his/her application.
3233 *
3234 * This function only has to be adjusted slightly.
3235 * It is responsible for notifying SCIP of the presence of the branching rule. For this, you can either call
3236 * SCIPincludeBranchrule(),
3237 * or SCIPincludeBranchruleBasic() since SCIP version 3.0. In the latter variant, \ref BRANCHRULE_ADDITIONALCALLBACKS "additional callbacks"
3238 * must be added via setter functions as, e.g., SCIPsetBranchruleCopy(). We recommend this latter variant because
3239 * it is more stable towards future SCIP versions which might have more callbacks, whereas source code using the first
3240 * variant must be manually adjusted with every SCIP release containing new callbacks for branchrule in order to compile.
3241 *
3242 *
3243 * If you are using branching rule data, you have to allocate the memory for the data at this point.
3244 * You can do this by calling:
3245 * \code
3246 * SCIP_CALL( SCIPallocBlockMemory(scip, &branchruledata) );
3247 * \endcode
3248 * You also have to initialize the fields in struct SCIP_BranchruleData afterwards.
3249 *
3250 * You may also add user parameters for your branching rule, see the function SCIPincludeBranchruleRelpscost() in
3251 * src/scip/branch_relpscost.c for an example.
3252 *
3253 *
3254 * @section BRANCHRULE_FUNDAMENTALCALLBACKS Fundamental Callbacks of a Branching Rule
3255 *
3256 * Branching rules do not have any fundamental callbacks, i.e., all callbacks are optional.
3257 * In most cases, however, you want to implement the \ref BRANCHEXECLP function and sometimes the \ref BRANCHEXECPS function.
3258 *
3259 *
3260 * @section BRANCHRULE_ADDITIONALCALLBACKS Additional Callbacks of a Branching Rule
3261 *
3262 * The additional callbacks do not need to be implemented in every case. However, some of them have to be
3263 * implemented for most applications, they can be used, for example, to initialize and free private data.
3264 * Additional callbacks can either be passed directly with SCIPincludeBranchrule() to SCIP or via specific
3265 * <b>setter functions</b> after a call of SCIPincludeBranchruleBasic(), see also @ref BRANCHRULE_INTERFACE.
3266 *
3267 * The most important callbacks are the \ref BRANCHEXECLP, \ref BRANCHEXECEXT,
3268 * and \ref BRANCHEXECPS functions, which perform the actual task of generating a branching.
3269 *
3270 * Additional documentation for the callbacks can be found in type_branch.h.
3271 *
3272 * @subsection BRANCHEXECLP
3273 *
3274 * The BRANCHEXECLP callback is executed during node processing if a fractional LP solution is available. It should
3275 * split the current problem into smaller subproblems. Usually, the branching is done in a way such that the current
3276 * fractional LP solution is no longer feasible in the relaxation of the subproblems. It is, however, possible to
3277 * create a child node for which the fractional LP solution is still feasible in the relaxation, for example, by
3278 * branching on a variable with integral LP value. In every case, you have to make sure that each subproblem is a
3279 * proper restriction of the current problem. Otherwise, you risk to produce an infinite path in the search tree.
3280 *
3281 * The user gains access to the branching candidates, i.e., to the fractional variables, and their LP solution values by
3282 * calling the function SCIPgetLPBranchCands(). Furthermore, SCIP provides two functions for performing the actual
3283 * branching, namely SCIPbranchVar() and SCIPcreateChild().
3284 *
3285 * Given an integral variable \f$x\f$ with fractional LP solution value \f$x^*\f$, the function SCIPbranchVar() creates
3286 * two child nodes; one contains the bound \f$x \le \lfloor x^* \rfloor\f$ and the other one contains the bound \f$x \ge
3287 * \lceil x^* \rceil\f$, see the BRANCHEXECLP callback in src/scip/branch_mostinf.c for an example. In addition, if a
3288 * proven lower objective bound of a created child node is known, like after strong branching has been applied, the user
3289 * may call the function SCIPupdateNodeLowerbound() in order to update the child node's lower bound.
3290 *
3291 * Please also see the \ref BRANCHEXEC "further information for the three execution functions".
3292 *
3293 * @subsection BRANCHEXECEXT
3294 *
3295 * The BRANCHEXECEXT callback is executed during node processing if no LP solution is available and the list of
3296 * external branching candidates is not empty. It should split the current problem into smaller subproblems. If you
3297 * do not use relaxation handlers or constraints handlers that provide external branching candidates, you do not need to
3298 * implement this callback.
3299 *
3300 * In contrast to the LP branching candidates and the pseudo branching candidates, the list of external branching
3301 * candidates will not be generated automatically. The user has to add all variables to the list by calling
3302 * SCIPaddExternBranchCand() for each of them. Usually, this will happen in the execution function of a relaxation handler or in the
3303 * enforcement functions of a constraint handler.
3304 *
3305 * The user gains access to these branching candidates by calling the function SCIPgetExternBranchCands(). Furthermore,
3306 * SCIP provides two functions for performing the actual branching with a given solution value, namely SCIPbranchVarVal()
3307 * and SCIPcreateChild(). SCIPbranchVarVal() allows users to specify the branching point for a variable in contrast to
3308 * SCIPbranchVar(), which will always use the current LP or pseudo solution.
3309 *
3310 * This paragraph contains additional information regarding how the function SCIPbranchVarVal() works. For external branching candidates,
3311 * there are three principle possibilities:
3312 * - Given a continuous variable \f$x\f$ with solution value \f$x^*\f$, the function SCIPbranchVarVal() creates
3313 * two child nodes; one contains the bound \f$x \le x^* \f$ and the other one contains the bound \f$x \ge x^* \f$.
3314 * - Given an integer variable \f$x\f$ with fractional solution value \f$x^*\f$, the function
3315 * SCIPbranchVarVal() creates two child nodes; one contains the bound \f$x \le \lfloor x^* \rfloor\f$ and the other
3316 * one contains the bound \f$x \ge \lceil x^* \rceil\f$.
3317 * - Given an integer variable \f$x\f$ with integral solution value \f$x^*\f$, the function SCIPbranchVarVal()
3318 * creates three child nodes; one contains the bound \f$x \le x^* -1\f$, one contains the bound \f$x \ge x^* +1\f$,
3319 * one contains the fixing \f$x = x^*\f$.
3320 *
3321 * See the BRANCHEXECEXT callback in src/scip/branch_random.c for an example. In addition, if a proven lower bound of a
3322 * created child node is known the user may call the function SCIPupdateNodeLowerbound() in order to update the child
3323 * node's lower bound.
3324 *
3325 * Please also see the \ref BRANCHEXEC "further information for the three execution functions".
3326 *
3327 * @subsection BRANCHEXECPS
3328 *
3329 * The BRANCHEXECPS callback is executed during node processing if no LP solution is available and at least one of the
3330 * integer variables is not yet fixed. It should split the current problem into smaller subproblems. PS stands for
3331 * pseudo solution which is the vector of all variables set to their locally best (w.r.t. the objective function)
3332 * bounds.
3333 *
3334 * The user gains access to the branching candidates, i.e., to the non-fixed integer variables, by calling the function
3335 * SCIPgetPseudoBranchCands(). Furthermore, SCIP provides two functions for performing the actual branching, namely
3336 * SCIPbranchVar() and SCIPcreateChild().
3337 *
3338 * Given an integer variable \f$x\f$ with bounds \f$[l,u]\f$ and not having solved the LP, the function SCIPbranchVar()
3339 * creates two child nodes:
3340 * - If both bounds are finite, then the two children will contain the domain reductions \f$x \le x^*\f$, and \f$x \ge
3341 * x^*+1\f$ with \f$x^* = \lfloor \frac{l + u}{2}\rfloor\f$. The current pseudo solution will remain feasible in one
3342 * of the branches, but the hope is that halving the domain's size leads to good propagations.
3343 * - If only one of the bounds is finite, the variable will be fixed to that bound in one of the child nodes. In the
3344 * other child node, the bound will be shifted by one.
3345 * - If both bounds are infinite, three children will be created: \f$x \le 1\f$, \f$x \ge 1\f$, and \f$x = 0\f$.
3346
3347 *
3348 * See the BRANCHEXECPS callback in src/scip/branch_random.c for an example. In addition, if a proven lower bound of a
3349 * created child node is known, the user may call the function SCIPupdateNodeLowerbound() in order to update the child
3350 * node's lower bound.
3351 *
3352 * Please also see the \ref BRANCHEXEC "further information for the three execution functions".
3353 *
3354 * @subsection BRANCHEXEC Further information for the three execution functions
3355 *
3356 * In order to apply more general branching schemes, one should use the function SCIPcreateChild().
3357 * After having created a child node, the additional restrictions of the child node have to be added with calls to
3358 * SCIPaddConsNode(), SCIPchgVarLbNode(), or SCIPchgVarUbNode().
3359 * \n
3360 * In the function SCIPcreateChild(), the branching rule has to assign two values to the new nodes: a node selection
3361 * priority for each node and an estimate for the objective value of the best feasible solution contained in the subtree
3362 * after applying the branching. If the function SCIPbranchVar() is used, these values are automatically assigned. For
3363 * variable based branching schemes, one might use the functions SCIPcalcNodeselPriority() and the function
3364 * SCIPcalcChildEstimate().
3365 *
3366 * In some cases, the branching rule can tighten the current subproblem instead of producing a branching. For example,
3367 * strong branching might have proven that rounding up a variable would lead to an infeasible LP relaxation and thus,
3368 * the variable must be rounded down. Therefore, the BRANCHEXECLP, BRANCHEXECPS and BRANCHEXECREL callbacks may also
3369 * produce domain reductions or add additional constraints to the current subproblem.
3370 *
3371 * The execution callbacks have the following options:
3372 * - detecting that the node is infeasible and can be cut off (result SCIP_CUTOFF)
3373 * - adding an additional constraint (e.g. a conflict constraint) (result SCIP_CONSADDED; note that this action
3374 * must not be performed if the input "allowaddcons" is FALSE)
3375 * - reducing the domain of a variable such that the current LP solution becomes infeasible (result SCIP_REDUCEDDOM)
3376 * - applying a branching (result SCIP_BRANCHED)
3377 * - stating that the branching rule was skipped (result SCIP_DIDNOTRUN).
3378 *
3379 * Only the BRANCHEXECLP callback has the possibility to add a cutting plane to the LP (result SCIP_SEPARATED).
3380 *
3381 * @subsection BRANCHFREE
3382 *
3383 * If you are using branching rule data, you have to implement this function in order to free the branching rule data.
3384 * This can be done by the following procedure:
3385 *
3386 * @refsnippet{src/scip/branch_random.c,SnippetBranchFreeRandom}
3387 *
3388 * If you have allocated memory for fields in your branching rule data, remember to free this memory
3389 * before freeing the branching rule data itself.
3390 * If you are using the C++ wrapper class, this function is not available.
3391 * Instead, just use the destructor of your class to free the member variables of your class.
3392 *
3393 * @subsection BRANCHINIT
3394 *
3395 * The BRANCHINIT callback is executed after the problem is transformed.
3396 * The branching rule may, e.g., use this call to initialize its branching rule data.
3397 *
3398 * @subsection BRANCHCOPY
3399 *
3400 * The BRANCHCOPY callback is executed when a SCIP instance is copied, e.g. to
3401 * solve a sub-SCIP. By
3402 * defining this callback as
3403 * <code>NULL</code> the user disables the execution of the specified
3404 * branching rule for all copied SCIP instances. This may deteriorate the performance
3405 * of primal heuristics using sub-SCIPs.
3406 *
3407 * @subsection BRANCHEXIT
3408 *
3409 * The BRANCHEXIT callback is executed before the transformed problem is freed.
3410 * In this function, the branching rule should free all resources that have been allocated for the solving process in
3411 * BRANCHINIT.
3412 *
3413 * @subsection BRANCHINITSOL
3414 *
3415 * The BRANCHINITSOL callback is executed when the presolving is finished and the branch-and-bound process is about to
3416 * begin.
3417 * The branching rule may use this call to initialize its branch-and-bound specific data.
3418 *
3419 * @subsection BRANCHEXITSOL
3420 *
3421 * The BRANCHEXITSOL callback is executed before the branch-and-bound process is freed.
3422 * The branching rule should use this call to clean up its branch-and-bound data.
3423 */
3424
3425
3426/*--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
3427
3428/**@page CUTSEL How to add cut selectors
3429 *
3430 * Cut selectors are used to select the cuts that are going to be added to the relaxation.
3431 * For more information on how SCIP manages cuts, see "What is the difference between a sepastore and the cutpool?" in the
3432 * \ref FAQ.
3433 * \n
3434 * A complete list of all cut selectors contained in this release can be found \ref CUTSELECTORS "here".
3435 *
3436 * We now explain how users can add their own cut selectors.
3437 * Take the hybrid cut selector (src/scip/cutsel_hybrid.c) as an example.
3438 * As all other default plugins, it is written in C. C++ users can easily adapt the code by using the scip::ObjCutsel wrapper
3439 * base class and implement the scip_...() virtual methods instead of the SCIP_DECL_CUTSEL... callbacks.
3440 *
3441 * Additional documentation for the callbacks of a cut selector can be found in the file type_cutsel.h.
3442 *
3443 * Here is what you have to do to implement a cut selector:
3444 * -# Copy the template files src/scip/cutsel_xyz.c and src/scip/cutsel_xyz.h into files named "cutsel_mycutselector.c"
3445 * and "cutsel_mycutselector.h".
3446 * \n
3447 * Make sure to adjust your build system such that these files are compiled and linked to your project. \n
3448 * If you are adding a new default plugin, this means updating the `src/CMakeLists.txt` and `Makefile` files in the SCIP distribution.
3449 * -# Use SCIPincludeCutselMycutselector() in order to include the cut selector into your SCIP instance,
3450 * e.g., in the main file of your project (see, e.g., src/cmain.c in the Binpacking example). \n
3451 * If you are adding a new default plugin, this include function must be added to `src/scipdefplugins.c`.
3452 * -# Open the new files with a text editor and replace all occurrences of "xyz" by "mycutselector".
3453 * -# Adjust the properties of the cut selector (see \ref CUTSEL_PROPERTIES).
3454 * -# Define the cut selector data (see \ref CUTSEL_DATA). This is optional.
3455 * -# Implement the interface functions (see \ref CUTSEL_INTERFACE).
3456 * -# Implement the fundamental callbacks (see \ref CUTSEL_FUNDAMENTALCALLBACKS).
3457 * -# Implement the additional callbacks (see \ref CUTSEL_ADDITIONALCALLBACKS). This is optional.
3458 *
3459 *
3460 * @section CUTSEL_PROPERTIES Properties of a Cut Selector
3461 *
3462 * At the top of the new file "cutsel_mycutselector.c" you can find the cut selector properties.
3463 * These are given as compiler defines.
3464 * In the C++ wrapper class, you have to provide the cut selector properties by calling the constructor
3465 * of the abstract base class scip::ObjCutsel from within your constructor.
3466 * The properties you have to set have the following meaning:
3467 *
3468 * \par CUTSEL_NAME: the name of the cut selector.
3469 * This name is used in the interactive shell to address the cut selector.
3470 * Additionally, if you are searching for a cut selector with SCIPfindCutsel(), this name is looked up.
3471 * Names have to be unique: no two cut selectors may have the same name.
3472 *
3473 * \par CUTSEL_DESC: the description of the cut selector.
3474 * This string is printed as a description of the cut selector in the interactive shell.
3475 *
3476 * \par CUTSEL_PRIORITY: the priority of the cut selector.
3477 * After all cuts have been collected in the sepastore, SCIP asks the cut selectors to select cuts.
3478 * The cut selectors are sorted by priority (highest goes first) and are called, in this order, until the first one
3479 * succeeds.
3480 * \n
3481 * Note that this property only defines the default value of the priority. The user may change this value arbitrarily by
3482 * adjusting the corresponding parameter setting. Whenever, even during solving, the priority of a cut selector is
3483 * changed, the cut selectors are re-sorted by the new priorities.
3484 *
3485 *
3486 * @section CUTSEL_DATA Cut Selector Data
3487 *
3488 * Below the header "Data structures" you can find a struct which is called "struct SCIP_CutselData".
3489 * In this data structure, you can store the data of your cut selector. For example, you should store the adjustable
3490 * parameters of the cut selector in this data structure.
3491 * If you are using C++, you can add cut selector data as usual as object variables to your class.
3492 * \n
3493 * Defining cut selector data is optional. You can leave the struct empty.
3494 *
3495 *
3496 * @section CUTSEL_INTERFACE Interface Functions
3497 *
3498 * At the bottom of "cutsel_mycutselector.c", you can find the interface function SCIPincludeCutselMycutselector(),
3499 * which also appears in "cutsel_mycutselector.h"
3500 * SCIPincludeCutselMycutselector() is called by the user, if they want to include the cut selector, i.e., if they want
3501 * to use the cut selector in their application.
3502 *
3503 * This function only has to be adjusted slightly.
3504 * It is responsible for notifying SCIP of the presence of the cut selector. For this, you can either call
3505 * SCIPincludeCutsel()
3506 * or SCIPincludeCutselBasic(). In the latter variant, \ref CUTSEL_ADDITIONALCALLBACKS "additional callbacks"
3507 * must be added via setter functions as, e.g., SCIPsetCutselCopy(). We recommend this latter variant because
3508 * it is more stable towards future SCIP versions which might have more callbacks, whereas source code using the first
3509 * variant must be manually adjusted with every SCIP release containing new callbacks for cut selectors in order to compile.
3510 *
3511 *
3512 * If you are using cut selector data, you have to allocate the memory for the data at this point.
3513 * You can do this by calling:
3514 * \code
3515 * SCIP_CALL( SCIPallocBlockMemory(scip, &cutseldata) );
3516 * \endcode
3517 * You also have to initialize the fields in struct SCIP_CutselData afterwards.
3518 *
3519 * You may also add user parameters for your cut selector, see the function SCIPincludeCutselHybrid() in
3520 * src/scip/cutsel_hybrid.c for an example.
3521 *
3522 *
3523 * @section CUTSEL_FUNDAMENTALCALLBACKS Fundamental Callbacks of a Cut Selector
3524 *
3525 * The fundamental callbacks of the plugins are the ones that have to be implemented in order to obtain
3526 * an operational algorithm.
3527 * They are passed together with the cut selector itself to SCIP using SCIPincludeCutsel() or SCIPincludeCutselBasic(),
3528 * see @ref CUTSEL_INTERFACE.
3529 *
3530 * Cut selector plugins have a single fundamental callback, namely the CUTSELSELECT function.
3531 * This function has to be implemented for every cut selector; the other callbacks are optional.
3532 * It implements the single contribution every selector has to provide: Selecting cuts to be added to the relaxation.
3533 * In the C++ wrapper class scip::ObjCutsel, the scip_select() function is a virtual abstract member function.
3534 * You have to implement it in order to be able to construct an object of your cut selector class.
3535 *
3536 * @subsection CUTSELSELECT
3537 *
3538 * The CUTSELSELECT callback should decide which cuts should be added to the relaxation.
3539 * The callback receives the arrays of cuts to select from. This array must be re-sorted and the first nselectedcuts from
3540 * the sorted array are going to be selected.
3541 * In addition to the aforementioned cuts, the list of forced cuts is also given as an argument. This array can be used
3542 * to help with the selection algorithm. Note, however, that this array should not be tampered with.
3543 *
3544 * Additional documentation for this callback can be found in type_cutsel.h.
3545 *
3546 * @section CUTSEL_ADDITIONALCALLBACKS Additional Callbacks of a Cut Selector
3547 *
3548 * The additional callbacks do not need to be implemented in every case. However, some of them have to be
3549 * implemented for most applications. They can be used, for example, to initialize and free private data.
3550 * Additional callbacks can either be passed directly with SCIPincludeCutsel() to SCIP or via specific
3551 * <b>setter functions</b> after a call of SCIPincludeCutselBasic(), see also @ref CUTSEL_INTERFACE.
3552 *
3553 * @subsection CUTSELFREE
3554 *
3555 * If you are using cut selector data, you have to implement this function in order to free the cut selector data.
3556 * This can be done by the following procedure:
3557 *
3558 * @refsnippet{src/scip/cutsel_hybrid.c,SnippetCutselFreeHybrid}
3559 *
3560 * If you have allocated memory for fields in your cut selector data, remember to free this memory
3561 * before freeing the cut selector data itself.
3562 * If you are using the C++ wrapper class, this function is not available.
3563 * Instead, just use the destructor of your class to free the member variables of your class.
3564 *
3565 * @subsection CUTSELINIT
3566 *
3567 * The CUTSELINIT callback is executed after the problem is transformed.
3568 * The cut selector may, for example, use this call to initialize its cut selector data.
3569 *
3570 * @subsection CUTSELCOPY
3571 *
3572 * The CUTSELCOPY callback is executed when a SCIP instance is copied, e.g., to solve a sub-SCIP. By defining this
3573 * callback as <code>NULL</code> the user disables the execution of the specified cut selector for all copied SCIP
3574 * instances.
3575 *
3576 * @subsection CUTSELEXIT
3577 *
3578 * The CUTSELEXIT callback is executed before the transformed problem is freed.
3579 * In this function, the cut selector should free all resources that have been allocated for the solving process
3580 * in CUTSELINIT.
3581 *
3582 * @subsection CUTSELINITSOL
3583 *
3584 * The CUTSELINITSOL callback is executed when the presolving is finished and the branch-and-bound process is about to
3585 * begin.
3586 * The cut selector may use this call to initialize its branch-and-bound specific data.
3587 *
3588 * @subsection CUTSELEXITSOL
3589 *
3590 * The CUTSELEXITSOL callback is executed before the branch-and-bound process is freed.
3591 * The cut selector should use this call to clean up its branch-and-bound data.
3592 */
3593
3594/*--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
3595
3596/**@page NODESEL How to add node selectors
3597 *
3598 * Node selectors are used to decide which of the leaves in the current branching tree is selected as next subproblem
3599 * to be processed. The ordering relation of the tree's leaves for storing them in the leaf priority queue is also
3600 * defined by the node selectors.
3601 * \n
3602 * A complete list of all node selectors contained in this release can be found \ref NODESELECTORS "here".
3603 *
3604 * We now explain how users can add their own node selectors.
3605 * Take the node selector for depth first search (src/scip/nodesel_dfs.c) as an example.
3606 * As all other default plugins, it is written in C. C++ users can easily adapt the code by using the scip::ObjNodesel wrapper
3607 * base class and implement the scip_...() virtual methods instead of the SCIP_DECL_NODESEL... callbacks.
3608 *
3609 * Additional documentation for the callbacks of a node selector can be found in the file type_nodesel.h.
3610 *
3611 * Here is what you have to do to implement a node selector:
3612 * -# Copy the template files src/scip/nodesel_xyz.c and src/scip/nodesel_xyz.h into files named "nodesel_mynodeselector.c"
3613 * and "nodesel_mynodeselector.h".
3614 * \n
3615 * Make sure to adjust your build system such that these files are compiled and linked to your project. \n
3616 * If you are adding a new default plugin, this means updating the `src/CMakeLists.txt` and `Makefile` files in the SCIP distribution.
3617 * -# Use SCIPincludeNodeselMynodeselector() in order to include the node selector into your SCIP instance,
3618 * e.g., in the main file of your project (see, e.g., src/cmain.c in the Binpacking example). \n
3619 * If you are adding a new default plugin, this include function must be added to `src/scipdefplugins.c`.
3620 * -# Open the new files with a text editor and replace all occurrences of "xyz" by "mynodeselector".
3621 * -# Adjust the properties of the node selector (see \ref NODESEL_PROPERTIES).
3622 * -# Define the node selector data (see \ref NODESEL_DATA). This is optional.
3623 * -# Implement the interface functions (see \ref NODESEL_INTERFACE).
3624 * -# Implement the fundamental callbacks (see \ref NODESEL_FUNDAMENTALCALLBACKS).
3625 * -# Implement the additional callbacks (see \ref NODESEL_ADDITIONALCALLBACKS). This is optional.
3626 *
3627 *
3628 * @section NODESEL_PROPERTIES Properties of a Node Selector
3629 *
3630 * At the top of the new file "nodesel_mynodeselector.c" you can find the node selector properties.
3631 * These are given as compiler defines.
3632 * In the C++ wrapper class, you have to provide the node selector properties by calling the constructor
3633 * of the abstract base class scip::ObjNodesel from within your constructor.
3634 * The properties you have to set have the following meaning:
3635 *
3636 * \par NODESEL_NAME: the name of the node selector.
3637 * This name is used in the interactive shell to address the node selector.
3638 * Additionally, if you are searching for a node selector with SCIPfindNodesel(), this name is looked up.
3639 * Names have to be unique: no two node selectors may have the same name.
3640 *
3641 * \par NODESEL_DESC: the description of the node selector.
3642 * This string is printed as a description of the node selector in the interactive shell.
3643 *
3644 * \par NODESEL_STDPRIORITY: the default priority of the node selector in the standard mode.
3645 * The first step of each iteration of the main solving loop is the selection of the next subproblem to be processed.
3646 * The node selector of highest priority (the active node selector) is called to do this selection.
3647 * In particular, if you implemented your own node selector plugin which you want to be applied, you should choose a priority
3648 * which is greater then all priorities of the SCIP default node selectors.
3649 * Note that SCIP has two different operation modes: the standard mode and the memory saving mode. If the memory
3650 * limit - given as a parameter by the user - is almost reached, SCIP switches from the standard mode to the memory saving
3651 * mode in which different priorities for the node selectors are applied. NODESEL_STDPRIORITY is the priority of the
3652 * node selector used in the standard mode.
3653 * \n
3654 * Note that this property only defines the default value of the priority. The user may change this value arbitrarily by
3655 * adjusting the corresponding parameter setting.
3656 *
3657 * \par NODESEL_MEMSAVEPRIORITY: the default priority of the node selector in the memory saving mode.
3658 * The priority NODESEL_MEMSAVEPRIORITY of the node selector has the same meaning as the priority NODESEL_STDPRIORITY, but
3659 * is used in the memory saving mode.
3660 * Usually, you want the best performing node selector, for example best estimate search, to have maximal
3661 * standard priority, while you want a node selector which tends to keep the growth of the search tree limited, for example
3662 * depth first search, to have maximal memory saving priority.
3663 * \n
3664 * Note that this property only defines the default value of the priority. The user may change this value arbitrarily by
3665 * adjusting the corresponding parameter setting.
3666 *
3667 *
3668 * @section NODESEL_DATA Node Selector Data
3669 *
3670 * Below the header "Data structures" you can find a struct which is called "struct SCIP_NodeselData".
3671 * In this data structure, you can store the data of your node selector. For example, you should store the adjustable
3672 * parameters of the node selector in this data structure.
3673 * If you are using C++, you can add node selector data as usual as object variables to your class.
3674 * \n
3675 * Defining node selector data is optional. You can leave the struct empty.
3676 *
3677 *
3678 * @section NODESEL_INTERFACE Interface Functions
3679 *
3680 * At the bottom of "nodesel_mynodeselector.c", you can find the interface function SCIPincludeNodeselMynodeselector(),
3681 * which also appears in "nodesel_mynodeselector.h"
3682 * SCIPincludeNodeselMynodeselector() is called by the user, if (s)he wants to include the node selector,
3683 * i.e., if (s)he wants to use the node selector in his/her application.
3684 *
3685 * This function only has to be adjusted slightly.
3686 * It is responsible for notifying SCIP of the presence of the node selector. For this, you can either call
3687 * SCIPincludeNodesel(),
3688 * or SCIPincludeNodeselBasic() since SCIP version 3.0. In the latter variant, \ref NODESEL_ADDITIONALCALLBACKS "additional callbacks"
3689 * must be added via setter functions as, e.g., SCIPsetNodeselCopy(). We recommend this latter variant because
3690 * it is more stable towards future SCIP versions which might have more callbacks, whereas source code using the first
3691 * variant must be manually adjusted with every SCIP release containing new callbacks for node selectors in order to compile.
3692 *
3693 *
3694 * If you are using node selector data, you have to allocate the memory for the data at this point.
3695 * You can do this by calling:
3696 * \code
3697 * SCIP_CALL( SCIPallocBlockMemory(scip, &nodeseldata) );
3698 * \endcode
3699 * You also have to initialize the fields in struct SCIP_NodeselData afterwards.
3700 *
3701 * You may also add user parameters for your node selector, see the function SCIPincludeNodeselRestartdfs() in
3702 * src/scip/nodesel_restartdfs.c for an example.
3703 *
3704 *
3705 * @section NODESEL_FUNDAMENTALCALLBACKS Fundamental Callbacks of a Node Selector
3706 *
3707 * The fundamental callbacks of the plugins are the ones that have to be implemented in order to obtain
3708 * an operational algorithm.
3709 * They are passed together with the node selector itself to SCIP using SCIPincludeNodesel() or SCIPincludeNodeselBasic(),
3710 * see @ref NODESEL_INTERFACE.
3711 *
3712 * Node selector plugins have two fundamental callbacks, namely the NODESELSELECT function and the NODESELCOMP function.
3713 * These functions have to be implemented for every node selector; the other callbacks are optional.
3714 * They implement the two requirements every node selector has to fulfill: Selecting a node from the queue to be processed
3715 * next and, given two nodes, deciding which of both is favored by the node selector's selection rule. The first
3716 * task is implemented in the NODESELSELECT callback, the second one in the NODESELCOMP callback.
3717 * In the C++ wrapper class scip::ObjNodesel, the scip_select() function and the scip_comp() function (which correspond to the
3718 * NODESELSELECT callback and the NODESELCOMP callback, respectively) are virtual abstract member functions.
3719 * You have to implement them in order to be able to construct an object of your node selector class.
3720 *
3721 * Additional documentation for the callbacks can be found in type_nodesel.h.
3722 *
3723 * @subsection NODESELSELECT
3724 *
3725 * The NODESELSELECT callback is the first function called in each iteration in the main solving loop. It should decide
3726 * which of the leaves in the current branching tree is selected as the next subproblem to be processed.
3727 * It can arbitrarily decide between all leaves stored in the tree, but for performance reasons,
3728 * the current node's children and siblings are often treated different from the remaining leaves.
3729 * This is mainly due to the warm start capabilities of the simplex algorithm and the expectation that the bases of
3730 * neighboring vertices in the branching tree very similar.
3731 * The node selector's choice of the next node to process can
3732 * have a large impact on the solver's performance, because it influences the finding of feasible solutions and the
3733 * development of the global dual bound.
3734 *
3735 * Besides the ranking of the node selector, every node gets assigned a node selection priority by the branching rule
3736 * that created the node. See the \ref BRANCHEXECLP and \ref BRANCHEXECPS callbacks of the branching rules for details.
3737 * For example, the node where the branching went in the same way as the deviation from the branching variable's
3738 * root solution could be assigned a higher priority than the node where the branching went in the opposite direction.
3739 *
3740 * The following functions provide access to the various types of leaf nodes:
3741 * - SCIPgetPrioChild() returns the child of the current node with the largest node selection priority, as assigned by the
3742 * branching rule.
3743 * If no child is available (for example, because the current node was pruned), a NULL pointer is returned.
3744 * - SCIPgetBestChild() returns the best child of the current node with respect to the node selector's ordering relation as
3745 * defined by the \ref NODESELCOMP callback. If no child is available, a NULL pointer is returned.
3746 * - SCIPgetPrioSibling() returns the sibling of the current node with the largest node selection priority.
3747 * If no sibling is available (for example, because all siblings of the current node have already been processed), a NULL
3748 * pointer is returned.
3749 * Note that in binary branching every node has at most one sibling, but since SCIP supports arbitrary branching rules,
3750 * this might not always be the case.
3751 * - SCIPgetBestSibling() returns the best sibling of the current node with respect to the node selector's ordering relation
3752 * as defined by the \ref NODESELCOMP callback. If no sibling is available, a NULL pointer is returned.
3753 * - SCIPgetBestNode() returns the best leaf from the tree (children, siblings, or other leaves) with respect to the node
3754 * selector's ordering relation as defined by the \ref NODESELCOMP callback. If no open leaf exists, a NULL pointer is
3755 * returned. In this case, the optimization is finished, and the node selector should return a NULL pointer as 'selnode'.
3756 * - SCIPgetBestboundNode() returns a leaf from the tree (children, siblings, or other leaves) with the smallest lower (dual)
3757 * objective bound. If the queue is empty, a NULL pointer is returned. In this case, the optimization is finished, and the
3758 * node selector should return a NULL pointer as 'selnode'.
3759 *
3760 *
3761 * @subsection NODESELCOMP
3762 *
3763 * The NODESELCOMP callback is called to compare two leaves of the current branching tree (say node 1 and node 2)
3764 * regarding their ordering relation.
3765 *
3766 * The NODESELCOMP should return the following values:
3767 * - value < 0, if node 1 comes before (is better than) node 2
3768 * - value = 0, if both nodes are equally good
3769 * - value > 0, if node 1 comes after (is worse than) node 2.
3770 *
3771 * @section NODESEL_ADDITIONALCALLBACKS Additional Callbacks of a Node Selector
3772 *
3773 * The additional callbacks do not need to be implemented in every case. However, some of them have to be
3774 * implemented for most applications, they can be used, for example, to initialize and free private data.
3775 * Additional callbacks can either be passed directly with SCIPincludeNodesel() to SCIP or via specific
3776 * <b>setter functions</b> after a call of SCIPincludeNodeselBasic(), see also @ref NODESEL_INTERFACE.
3777 *
3778 * @subsection NODESELFREE
3779 *
3780 * If you are using node selector data, you have to implement this function in order to free the node selector data.
3781 * This can be done by the following procedure:
3782 *
3783 * @refsnippet{src/scip/nodesel_bfs.c,SnippetNodeselFreeBfs}
3784 *
3785 * If you have allocated memory for fields in your node selector data, remember to free this memory
3786 * before freeing the node selector data itself.
3787 * If you are using the C++ wrapper class, this function is not available.
3788 * Instead, just use the destructor of your class to free the member variables of your class.
3789 *
3790 * @subsection NODESELINIT
3791 *
3792 * The NODESELINIT callback is executed after the problem is transformed.
3793 * The node selector may, e.g., use this call to initialize its node selector data.
3794 *
3795 * @subsection NODESELCOPY
3796 *
3797 * The NODESELCOPY callback is executed when a SCIP instance is copied, e.g. to
3798 * solve a sub-SCIP. By
3799 * defining this callback as
3800 * <code>NULL</code> the user disables the execution of the specified
3801 * node selector for all copied SCIP instances. This may deteriorate the performance
3802 * of primal heuristics using sub-SCIPs.
3803 *
3804 * @subsection NODESELEXIT
3805 *
3806 * The NODESELEXIT callback is executed before the transformed problem is freed.
3807 * In this function, the node selector should free all resources that have been allocated for the solving process
3808 * in NODESELINIT.
3809 *
3810 * @subsection NODESELINITSOL
3811 *
3812 * The NODESELINITSOL callback is executed when the presolving is finished and the branch-and-bound process is about to
3813 * begin.
3814 * The node selector may use this call to initialize its branch-and-bound specific data.
3815 *
3816 * @subsection NODESELEXITSOL
3817 *
3818 * The NODESELEXITSOL callback is executed before the branch-and-bound process is freed.
3819 * The node selector should use this call to clean up its branch-and-bound data.
3820 */
3821
3822
3823/*--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
3824
3825/**@page HEUR How to add primal heuristics
3826 *
3827 * Feasible solutions can be found in two different ways during the traversal of the branch-and-bound tree. On one
3828 * hand, the solution of a node's relaxation may be feasible with respect to the constraints (including the integrality).
3829 * On the other hand, feasible solutions can be discovered by primal heuristics.
3830 * \n
3831 * A complete list of all primal heuristics contained in this release can be found \ref PRIMALHEURISTICS "here".
3832 * \n
3833 * Diving heuristics are primal heuristics that explore an auxiliary search tree in a depth-first manner. Since SCIP
3834 * version 3.2, it is easy to integrate further diving heuristics by using a special controller for the scoring,
3835 * see \ref DIVINGHEUR "here" for information on how to implement a diving heuristic.
3836 * \n
3837 * We now explain how users can add their own primal heuristics.
3838 * Take the simple and fast LP rounding heuristic (src/scip/heur_simplerounding.c) as an example.
3839 * The idea of simple rounding is to iterate over all fractional variables of an LP solution and round them down,
3840 * if the variables appears only with nonnegative coefficients in the system Ax <= b and round them up if
3841 * the variables appears only with nonpositive coefficients.
3842 * If one of both conditions applies for each of the fractional variables, this will give a feasible solution.
3843 * As all other default plugins, it is written in C. C++ users can easily adapt the code by using the scip::ObjHeur wrapper
3844 * base class and implement the scip_...() virtual methods instead of the SCIP_DECL_HEUR... callbacks.
3845 *
3846 * Additional documentation for the callbacks of a primal heuristic can be found in the file type_heur.h.
3847 *
3848 * Here is what you have to do to implement a primal heuristic:
3849 * -# Copy the template files src/scip/heur_xyz.c and src/scip/heur_xyz.h into files named "heur_myheuristic.c"
3850 * and "heur_myheuristic.h".
3851 * \n
3852 * Make sure to adjust your build system such that these files are compiled and linked to your project. \n
3853 * If you are adding a new default plugin, this means updating the `src/CMakeLists.txt` and `Makefile` files in the SCIP distribution.
3854 * -# Use `SCIPincludeHeurMyheuristic()` in order to include the heuristic into your SCIP instance,
3855 * e.g., in the main file of your project (see, e.g., src/cmain.c in the Binpacking example). \n
3856 * If you are adding a new default plugin, this include function must be added to `src/scipdefplugins.c`.
3857 * -# Open the new files with a text editor and replace all occurrences of "xyz" by "myheuristic".
3858 * -# Adjust the properties of the primal heuristic (see \ref HEUR_PROPERTIES).
3859 * -# Define the primal heuristic data (see \ref HEUR_DATA). This is optional.
3860 * -# Implement the interface functions (see \ref HEUR_INTERFACE).
3861 * -# Implement the fundamental callbacks (see \ref HEUR_FUNDAMENTALCALLBACKS).
3862 * -# Implement the additional callbacks (see \ref HEUR_ADDITIONALCALLBACKS). This is optional.
3863 *
3864 *
3865 * @section HEUR_PROPERTIES Properties of a Primal Heuristic
3866 *
3867 * At the top of the new file "heur_myheuristic.c" you can find the primal heuristic properties.
3868 * These are given as compiler defines.
3869 * In the C++ wrapper class, you have to provide the primal heuristic properties by calling the constructor
3870 * of the abstract base class scip::ObjHeur from within your constructor.
3871 * Of course, all of them are of relevant, but the most important ones for controlling the performance
3872 * are usually HEUR_FREQ and HEUR_TIMING.
3873 * The properties you have to set have the following meaning:
3874 *
3875 * \par HEUR_NAME: the name of the primal heuristic.
3876 * This name is used in the interactive shell to address the primal heuristic.
3877 * Additionally, if you are searching for a primal heuristic with SCIPfindHeur(), this name is looked up.
3878 * Names have to be unique: no two primal heuristics may have the same name.
3879 *
3880 * \par HEUR_DESC: the description of the primal heuristic.
3881 * This string is printed as a description of the primal heuristic in the interactive shell when you call "display heuristics".
3882 *
3883 * \par HEUR_DISPCHAR: the display character of the primal heuristic.
3884 * In the interactive shell, this character is printed in the first column of a status information row, if the primal
3885 * heuristic found the feasible solution belonging to the primal bound. Note that a star '*' stands for an integral
3886 * LP-relaxation.
3887 * It is recommended to select a lower or upper case letter as display character. The default primal heuristics of
3888 * SCIP use characters that describe the class to which the heuristic belongs. As an example all LP rounding heuristics
3889 * have an 'r' and all Large Neighborhood Search heuristics use the letter 'L'.
3890 * Users find commonly used display characters in type_heur.h.
3891 *
3892 *
3893 * \par HEUR_PRIORITY: the priority of the primal heuristic.
3894 * At each of the different entry points of the primal heuristics during the solving process (see HEUR_TIMING), they are
3895 * called in decreasing order of their priority.
3896 * \n
3897 * The priority of a primal heuristic should be set according to the complexity of the heuristic and the likelihood to find
3898 * feasible solutions: primal heuristics that provide fast algorithms that often succeed in finding a feasible solution should have
3899 * a high priority (like simple rounding). In addition, the interaction between different types of primal heuristics should be taken into account.
3900 * For example, improvement heuristics, which try to generate improved solutions by inspecting one or more of the feasible
3901 * solutions that have already been found, should have a low priority (like Crossover which by default needs at least 3 feasible solutions).
3902 *
3903 * \par HEUR_FREQ: the default frequency for executing the primal heuristic.
3904 * The frequency together with the frequency offset (see HEUR_FREQOFS) defines the depth levels at which the execution
3905 * function of the primal heuristic \ref HEUREXEC is called. For example, a frequency of 7 together with a frequency offset
3906 * of 5 means, that the \ref HEUREXEC callback is executed for subproblems that are in depth 5, 12, 19, ... of the branching tree. A
3907 * frequency of 0 together with a frequency offset of 3 means, that the execution function is only called at those nodes that are in
3908 * depth level 3 (i.e., at most for \f$2^3 = 8\f$ nodes if binary branching is applied).
3909 * Typical cases are: A frequency of 0 and an offset of 0 which means that
3910 * the heuristic is only called at the root node and a frequency of -1 which disables the heuristic.
3911 * \n
3912 * The frequency can be adjusted by the user. This property of the primal heuristic only defines the default value of the
3913 * frequency. If you want to have a more flexible control of when to execute the primal heuristic, you have to assign
3914 * a frequency of 1 and implement a check at the beginning of your execution function whether you really want to search for feasible
3915 * solutions or not. If you do not want to execute the function, set the result code to SCIP_DIDNOTRUN.
3916 *
3917 * \par HEUR_FREQOFS: the frequency offset for executing the primal heuristic.
3918 * The frequency offset defines the depth of the branching tree at which the primal heuristic is executed for the first
3919 * time. For example, a frequency of 7 (see HEUR_FREQ) together with a frequency offset of 10 means, that the
3920 * callback is executed for subproblems that are in depth 10, 17, 24, ... of the branching tree. In particular, assigning
3921 * different offset values to heuristics of the same type, like diving heuristics, can be useful for evenly spreading the
3922 * application of these heuristics across the branch-and-bound tree.
3923 * Note that if the frequency is equal to 1, the heuristic is applied for all nodes with depth level larger or equal to
3924 * the frequency offset.
3925 *
3926 * \par HEUR_MAXDEPTH: the maximal depth level for executing the primal heuristic.
3927 * This parameter denotes the maximal depth level in the branching tree up to which the execution function of the primal
3928 * heuristic is called. Use -1 for no limit (a usual case).
3929 *
3930 * \par HEUR_TIMING: the execution timing of the primal heuristic.
3931 * Primal heuristics have different entry points during the solving process and the execution timing parameter defines the
3932 * entry point at which the primal heuristic is executed first.
3933 * \n
3934 * The primal heuristic can be called first:
3935 * - before the processing of the node starts (SCIP_HEURTIMING_BEFORENODE)
3936 * - after each LP solve during the cut-and-price loop (SCIP_HEURTIMING_DURINGLPLOOP)
3937 * - after the cut-and-price loop was finished (SCIP_HEURTIMING_AFTERLPLOOP)
3938 * - after the processing of a node <em>with solved LP</em> was finished (SCIP_HEURTIMING_AFTERLPNODE)
3939 * - after the processing of a node <em>without solved LP</em> was finished (SCIP_HEURTIMING_AFTERPSEUDONODE)
3940 * - after the processing of the last node in the current plunge was finished, <em>and only if the LP was solved for
3941 * this node</em> (SCIP_HEURTIMING_AFTERLPPLUNGE)
3942 * - after the processing of the last node in the current plunge was finished, <em>and only if the LP was not solved
3943 * for this node</em> (SCIP_HEURTIMING_AFTERPSEUDOPLUNGE).
3944 * \par
3945 * A plunge is the successive solving of child and sibling nodes in the search tree.
3946 * The flags listed above can be combined to call the heuristic at multiple times by concatenating them with a bitwise OR.
3947 * Two useful combinations are already predefined:
3948 * - after the processing of a node was finished (SCIP_HEURTIMING_AFTERNODE; combines SCIP_HEURTIMING_AFTERLPNODE and
3949 * SCIP_HEURTIMING_AFTERPSEUDONODE)
3950 * - after the processing of the last node in the current plunge was finished (SCIP_HEURTIMING_AFTERPLUNGE; combines
3951 * SCIP_HEURTIMING_AFTERLPPLUNGE and SCIP_HEURTIMING_AFTERPSEUDOPLUNGE)
3952 * \par
3953 * Calling a primal heuristic "before the processing of the node starts" is particularly useful for heuristics
3954 * that do not need to access the LP solution of the current node. If such a heuristic finds a feasible solution, the
3955 * leaves of the branching tree exceeding the new primal bound are pruned. It may happen that even the current node can
3956 * be cut off without solving the LP relaxation. Combinatorial heuristics, like the farthest insert heuristic for the TSP
3957 * (see examples/TSP/src/HeurFarthestInsert.cpp), are often applicable at this point.
3958 * \n
3959 * Very fast primal heuristics that require an LP solution can also be called "after each LP solve during the
3960 * cut-and-price loop". Rounding heuristics, like the simple and fast LP rounding heuristic
3961 * (src/scip/heur_simplerounding.c), belong to this group of primal heuristics.
3962 * \n
3963 * Most heuristics, however, are called either after a node was completely processed
3964 * (e.g. expensive rounding heuristics like RENS), or even only after a full plunge was finished (e.g., diving heuristics).
3965 *
3966 * \par HEUR_USESSUBSCIP: Does the heuristic use a secondary SCIP instance?
3967 * Some heuristics and separators solve MIPs or SAT problems using a secondary SCIP instance. Examples are
3968 * Large Neighborhood Search heuristics such as RINS and Local Branching or the CGMIP separator. To avoid recursion,
3969 * these plugins usually deactivate all other plugins that solve MIPs. If a heuristic uses a secondary SCIP instance,
3970 * this parameter has to be TRUE and it is recommended to call SCIPsetSubscipsOff() for the secondary SCIP instance.
3971 *
3972 * Computational experiments indicate that for the overall performance of a MIP solver, it is important to evenly
3973 * spread the application of the heuristics across the branch-and-bound tree. Thus, the assignment of the parameters
3974 * HEUR_FREQ, HEUR_FREQOFS, and HEUR_TIMING should contribute to this aim.
3975 *
3976 * Note that all diving heuristics in the SCIP distribution (see, e.g., src/scip/heur_guideddiving.c) check whether other diving
3977 * heuristics have already been called at the current node. This can be done by comparing SCIPgetLastDivenode(scip) and
3978 * SCIPgetNNodes(scip). If the two are equal, and if the current node is not the root node (SCIPgetDepth(scip) > 0), diving
3979 * heuristics should be delayed by returning the result code 'SCIP_DELAYED'. This is an additional contribution to the goal of
3980 * not calling multiple similar heuristics at the same node.
3981 *
3982 *
3983 * @section HEUR_DATA Primal Heuristic Data
3984 *
3985 * Below the header "Data structures" you can find a struct which is called "struct SCIP_HeurData".
3986 * In this data structure, you can store the data of your primal heuristic. For example, you should store the adjustable
3987 * parameters of the primal heuristic or a working solution in this data structure.
3988 * If you are using C++, you can add primal heuristic data as usual as object variables to your class.
3989 * \n
3990 * Defining primal heuristic data is optional. You can leave the struct empty.
3991 *
3992 *
3993 * @section HEUR_INTERFACE Interface Functions
3994 *
3995 * At the bottom of "heur_myheuristic.c", you can find the interface function SCIPincludeHeurMyheuristic(),
3996 * which also appears in "heur_myheuristic.h"
3997 * SCIPincludeHeurMyheuristic() is called by the user, if (s)he wants to include the heuristic,
3998 * i.e., if (s)he wants to use the heuristic in his/her application.
3999 *
4000 * This function only has to be adjusted slightly.
4001 * It is responsible for notifying SCIP of the presence of the heuristic. For this, you can either call
4002 * SCIPincludeHeur(),
4003 * or SCIPincludeHeurBasic() since SCIP version 3.0. In the latter variant, \ref HEUR_ADDITIONALCALLBACKS "additional callbacks"
4004 * must be added via setter functions as, e.g., SCIPsetHeurCopy(). We recommend this latter variant because
4005 * it is more stable towards future SCIP versions which might have more callbacks, whereas source code using the first
4006 * variant must be manually adjusted with every SCIP release containing new callbacks for heuristics in order to compile.
4007 *
4008 * If you are using primal heuristic data, you have to allocate the memory for the data at this point.
4009 * You can do this by calling:
4010 * \code
4011 * SCIP_CALL( SCIPallocBlockMemory(scip, &heurdata) );
4012 * \endcode
4013 * You also have to initialize the fields in struct SCIP_HeurData afterwards.
4014 *
4015 * You may also add user parameters for your primal heuristic, see the function SCIPincludeHeurFeaspump() in
4016 * src/scip/heur_oneopt.c for an example where a single Boolean parameter is added.
4017 *
4018 *
4019 * @section HEUR_FUNDAMENTALCALLBACKS Fundamental Callbacks of a Primal Heuristic
4020 *
4021 * The fundamental callbacks of the plugins are the ones that have to be implemented in order to obtain
4022 * an operational algorithm.
4023 * They are passed together with the primal heuristic itself to SCIP using SCIPincludeHeur() or SCIPincludeHeurBasic(),
4024 * see @ref HEUR_INTERFACE.
4025 *
4026 *
4027 * Primal heuristic plugins have only one fundamental callback, namely the HEUREXEC function.
4028 * This function has to be implemented for every primal heuristic; the other callbacks are optional.
4029 * In the C++ wrapper class scip::ObjHeur, the scip_exec() method (which corresponds to the HEUREXEC callback) is a virtual
4030 * abstract member function. You have to implement it in order to be able to construct an object of your primal heuristic
4031 * class.
4032 *
4033 * Additional documentation for the callbacks can be found in type_heur.h.
4034 *
4035 * @subsection HEUREXEC
4036 *
4037 * The HEUREXEC callback is called at different positions during the node processing loop, see HEUR_TIMING. It should
4038 * search for feasible solutions and add them to the solution pool. For creating a new feasible solution, the
4039 * functions SCIPcreateSol() and SCIPsetSolVal() can be used. Afterwards, the solution can be added to the storage by
4040 * calling the function SCIPtrySolFree() (or SCIPtrySol() and SCIPfreeSol()).
4041 *
4042 * The HEUREXEC callback gets a SCIP pointer, a pointer to the heuristic itself, the current point in the
4043 * solve loop and a result pointer as input (see type_heur.h).
4044 *
4045 * The heuristic has to set the result pointer appropriately!
4046 * Therefore it has the following options:
4047 * - finding at least one feasible solution (result SCIP_FOUNDSOL)
4048 * - stating that the primal heuristic searched, but did not find a feasible solution (result SCIP_DIDNOTFIND)
4049 * - stating that the primal heuristic was skipped (result SCIP_DIDNOTRUN)
4050 * - stating that the primal heuristic was skipped, but should be called again (result SCIP_DELAYED).
4051 *
4052 *
4053 * @section HEUR_ADDITIONALCALLBACKS Additional Callbacks of a Primal Heuristic
4054 *
4055 * The additional callbacks do not need to be implemented in every case. However, some of them have to be
4056 * implemented for most applications, they can be used, for example, to initialize and free private data.
4057 * Additional callbacks can either be passed directly with SCIPincludeHeur() to SCIP or via specific
4058 * <b>setter functions</b> after a call of SCIPincludeHeurBasic(), see also @ref HEUR_INTERFACE.
4059 *
4060 * @subsection HEURFREE
4061 *
4062 * If you are using primal heuristic data, you have to implement this function in order to free the primal heuristic data.
4063 * This can be done by the following procedure:
4064 *
4065 * @refsnippet{applications/Coloring/src/heur_init.c,SnippetHeurFreeInit}
4066 *
4067 * If you have allocated memory for fields in your primal heuristic data, remember to free this memory
4068 * before freeing the primal heuristic data itself.
4069 * If you are using the C++ wrapper class, this function is not available.
4070 * Instead, just use the destructor of your class to free the member variables of your class.
4071 *
4072 * @subsection HEURINIT
4073 *
4074 * The HEURINIT callback is executed after the problem is transformed.
4075 * The primal heuristic may, e.g., use this call to initialize its primal heuristic data.
4076 *
4077 * @subsection HEURCOPY
4078 *
4079 * The HEURCOPY callback is executed when a SCIP instance is copied, e.g. to
4080 * solve a sub-SCIP. By
4081 * defining this callback as
4082 * <code>NULL</code> the user disables the execution of the specified
4083 * heuristic for all copied SCIP instances. This may deteriorate the performance
4084 * of primal heuristics using sub-SCIPs.
4085 *
4086 * @subsection HEUREXIT
4087 *
4088 * The HEUREXIT callback is executed before the tDIVINGHEURransformed problem is freed.
4089 * In this function, the primal heuristic should free all resources that have been allocated for the solving process in
4090 * HEURINIT.
4091 *
4092 * @subsection HEURINITSOL
4093 *
4094 * The HEURINITSOL callback is executed when the presolving is finished and the branch-and-bound process is about to
4095 * begin. The primal heuristic may use this call to initialize its branch-and-bound specific data.
4096 *
4097 * @subsection HEUREXITSOL
4098 *
4099 * The HEUREXITSOL callback is executed before the branch-and-bound process is freed. The primal heuristic should use this
4100 * call to clean up its branch-and-bound data, which was allocated in HEURINITSOL.
4101 */
4102
4103/*--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
4104
4105/**@page IISFINDER How to add IIS finders
4106 *
4107 * IIS finders are used to generate an (I)IS ((irreducible) infeasible subsystem) for an infeasible instance.
4108 * \n
4109 * A complete list of all iis finders contained in this release can be found \ref IISFINDERS "here".
4110 *
4111 * We now explain how users can add their own iis finders.
4112 * Take the greedy iis finder (src/scip/iisfinder_greedy.c) as an example.
4113 * As all other default plugins, it is written in C. C++ users can easily adapt the code by using the scip::ObjIISfinder wrapper
4114 * base class and implement the `scip_...()` virtual methods instead of the `SCIP_DECL_IISFINDER...` callbacks.
4115 *
4116 * Additional documentation for the callbacks of an iis finder can be found in the file type_iisfinder.h.
4117 *
4118 * Here is what you have to do to implement an iis finder:
4119 * -# Copy the template files `src/scip/iisfinder_xyz.c` and `src/scip/iisfinder_xyz.h` into files named `iisfinder_myiisfinder.c`
4120 * and `iisfinder_myiisfinder.h`.
4121 * \n
4122 * Make sure to adjust your build system such that these files are compiled and linked to your project. \n
4123 * If you are adding a new default plugin for SCIP, this means updating the `src/CMakeLists.txt` and `Makefile` files in the SCIP distribution.
4124 * -# Use `SCIPincludeIIsfinderMyiisfinder()` in order to include the iis finder into your SCIP instance,
4125 * e.g., in the main file of your project (see, e.g., `src/cmain.c` in the Binpacking example). \n
4126 * If you are adding a new default plugin, this include function must be added to `src/scipdefplugins.c`.
4127 * -# Open the new files with a text editor and replace all occurrences of "xyz" by "myiisfinder".
4128 * -# Adjust the properties of the iis finder (see \ref IISFINDER_PROPERTIES).
4129 * -# Define the iis finder data (see \ref IISFINDER_DATA). This is optional.
4130 * -# Implement the interface functions (see \ref IISFINDER_INTERFACE).
4131 * -# Implement the fundamental callbacks (see \ref IISFINDER_FUNDAMENTALCALLBACKS).
4132 * -# Implement the additional callbacks (see \ref IISFINDER_ADDITIONALCALLBACKS). This is optional.
4133 *
4134 *
4135 * @section IISFINDER_PROPERTIES Properties of an IIS finder
4136 *
4137 * At the top of the new file `iisfinder_myiisfinder.c` you can find the iis finder properties.
4138 * These are given as compiler defines.
4139 * In the C++ wrapper class, you have to provide the iis finder properties by calling the constructor
4140 * of the abstract base class scip::ObjIISfinder from within your constructor.
4141 * The properties you have to set have the following meaning:
4142 *
4143 * \par IISFINDER_NAME: the name of the iis finder.
4144 * This name is used in the interactive shell to address the iis finder.
4145 * Additionally, if you are searching for an iis finder with SCIPfindIISfinder(), this name is looked up.
4146 * Names have to be unique: no two iis finders may have the same name.
4147 *
4148 * \par IISFINDER_DESC: the description of the iis finder.
4149 * This string is printed as a description of the iis finder in the interactive shell.
4150 *
4151 * \par IISFINDER_PRIORITY: the priority of the iis finder.
4152 * When an IIS is desired, SCIP orders the IIS finders by priority.
4153 * The iis finders are then called in this order (highest goes first), until depending on the users settings,
4154 * one succeeds in finding an infeasible subsystem, an irreducible infeasible subsystem is found,
4155 * all iis finders have been run, or some limit has been hit.
4156 * \n
4157 * Note that this property only defines the default value of the priority. The user may change this value arbitrarily by
4158 * adjusting the corresponding parameter setting. Whenever, even during solving, the priority of an iis finder is
4159 * changed, then when a call is made to generate an IIS, the iis finders are resorted by the new priorities.
4160 *
4161 *
4162 * @section IISFINDER_DATA IIS Finder Data
4163 *
4164 * Below the header "Data structures" you can find a struct which is called `struct SCIP_IISfinderData`.
4165 * In this data structure, you can store the data of your iis finder. For example, you should store the adjustable
4166 * parameters of the iis finder in this data structure.
4167 * If you are using C++, you can add iis finder data as usual as object variables to your class.
4168 * \n
4169 * Defining iis finder data is optional. You can leave the struct empty.
4170 *
4171 *
4172 * @section IISFINDER_INTERFACE Interface Functions
4173 *
4174 * At the bottom of `iisfinder_myiisfinder.c`, you can find the interface function `SCIPincludeIISfinderMyiisfinder()`,
4175 * which also appears in `iisfinder_myiisfinder.h`
4176 * `SCIPincludeIISfinderMyiisfinder()` is called by the users, if they want to include the iis finder, i.e., if they want
4177 * to use the iis finder in their application.
4178 *
4179 * This function only has to be adjusted slightly.
4180 * It is responsible for notifying SCIP of the presence of the iis finder. For this, you can either call
4181 * SCIPincludeIISfinder()
4182 * or SCIPincludeIISfinderBasic(). In the latter variant, \ref IISFINDER_ADDITIONALCALLBACKS "additional callbacks"
4183 * must be added via setter functions as, e.g., SCIPsetIISfinderCopy(). We recommend this latter variant because
4184 * it is more stable towards future SCIP versions which might have more callbacks, whereas source code using the first
4185 * variant must be manually adjusted with every SCIP release containing new callbacks for iis finders in order to compile.
4186 *
4187 *
4188 * If you are using iis finder data, you have to allocate the memory for the data at this point.
4189 * You can do this by calling:
4190 * \code
4191 * SCIP_CALL( SCIPallocBlockMemory(scip, &iisfinderdata) );
4192 * \endcode
4193 * You also have to initialize the fields in struct SCIP_IISfinderData afterwards.
4194 *
4195 * You may also add user parameters for your iis finder, see the function SCIPincludeIISfinderGreedy() in
4196 * src/scip/iisfinder_greedy.c for an example.
4197 *
4198 *
4199 * @section IISFINDER_FUNDAMENTALCALLBACKS Fundamental Callbacks of an IIS Finder
4200 *
4201 * The fundamental callbacks of the plugins are the ones that have to be implemented in order to obtain
4202 * an operational algorithm.
4203 * They are passed together with the iis finder itself to SCIP using SCIPincludeIISfinder() or SCIPincludeIISfinderBasic(),
4204 * see @ref IISFINDER_INTERFACE.
4205 *
4206 * IIS finder plugins have a single fundamental callback, namely the IISFINDEREXEC function.
4207 * This function has to be implemented for every iis funder; the other callbacks are optional.
4208 * It implements the single contribution every iis finder has to provide: Generating an (I)IS from an infeasible instance.
4209 * In the C++ wrapper class scip::ObjIISfinder, the scip_exec() method is a virtual abstract member function.
4210 * You have to implement it in order to be able to construct an object of your iis finder class.
4211 *
4212 * @subsection IISFINDEREXEC
4213 *
4214 * The IISFINDEREXEC callback should generate an (I)IS from an infeasible instance.
4215 * The callback receives the IIS object, which contains the infeasible subscip that should be reduced in size,
4216 * as well as multiple parameters that limit how the IIS finder procedure should be performed.
4217 * The contained subscip should be transformed such that it remains infeasible and decreases in size,
4218 * and information about the current state of the subscip, e.g., is it still infeasible, should be recorded.
4219 *
4220 * Additional documentation for this callback can be found in type_iisfinder.h.
4221 *
4222 * @section IISFINDER_ADDITIONALCALLBACKS Additional Callbacks of an IIS Finder
4223 *
4224 * The additional callbacks do not need to be implemented in every case. However, some of them have to be
4225 * implemented for most applications. They can be used, for example, to initialize and free private data.
4226 * Additional callbacks can either be passed directly with SCIPincludeIISfinder() to SCIP or via specific
4227 * <b>setter functions</b> after a call of SCIPincludeIISfinderBasic(), see also @ref IISFINDER_INTERFACE.
4228 *
4229 * @subsection IISFINDERFREE
4230 *
4231 * If you are using iis finder data, you have to implement this function in order to free the iis finder data.
4232 * This can be done by the following procedure:
4233 *
4234 * @refsnippet{src/scip/iisfinder_greedy.c,SnippetIISfinderFreeGreedy}
4235 *
4236 * If you have allocated memory for fields in your iis finder data, remember to free this memory
4237 * before freeing the iis finder data itself.
4238 * If you are using the C++ wrapper class, this function is not available.
4239 * Instead, just use the destructor of your class to free the member variables of your class.
4240 *
4241 * @subsection IISFINDERCOPY
4242 *
4243 * The IISFINDERCOPY callback is executed when a SCIP instance is copied, e.g., to solve a sub-SCIP. By defining this
4244 * callback as `NULL` the user disables the execution of the specified iis finder for all copied SCIP
4245 * instances
4246 */
4247
4248/*--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
4249
4250/**@page EXPRHDLR How to add expression handlers
4251 *
4252 * Expression handlers define basic expression types and provide additional functionality to work with expressions,
4253 * e.g., differentiation, simplification, estimation, hashing, copying, printing, parsing.
4254 * A complete list of all expression handlers contained in this release can be found \ref EXPRHDLRS "here".
4255 * In addition to expression handlers, higher level nonlinear structures are handled by nonlinear handlers, see \ref NLHDLR.
4256 *
4257 * Here is what you have to do to implement an own expression handler:
4258 * -# Copy the template files `src/scip/expr_xyz.c` and `src/scip/expr_xyz.h` into files `expr_myfunc.c` and `expr_myfunc.h`, respectively. \n
4259 * Make sure to adjust your build system such that these files are compiled and linked to your project. \n
4260 * If you are adding a new default plugin, this means updating the `src/CMakeLists.txt` and `Makefile` files in the SCIP distribution.
4261 * -# Use `SCIPincludeExprhdlrMyfunc()` in order to include the expression handler into your SCIP instance,
4262 * e.g., in the main file of your project. \n
4263 * If you are adding a new default plugin, this include function must be added to `src/scipdefplugins.c`.
4264 * -# Open the new files with a text editor and replace all occurrences of "xyz" by "myfunc".
4265 * -# Adjust the properties of the expression handler (see \ref EXPRHDLR_PROPERTIES).
4266 * -# Define the expression handler data and expression data (see \ref EXPRHDLR_DATA). This is optional.
4267 * -# Implement the interface functions (see \ref EXPRHDLR_INTERFACE).
4268 * -# Implement the fundamental callbacks (see \ref EXPRHDLR_FUNDAMENTALCALLBACKS).
4269 * -# Implement the additional callbacks (see \ref EXPRHDLR_ADDITIONALCALLBACKS), where necessary.
4270 *
4271 * Additional documentation for the callbacks of an expression handler, in particular for the input parameters,
4272 * can be found in the file \ref type_expr.h.
4273 *
4274 * For a complete implementation of an expression handler, take the one for exponential expressions (src/scip/expr_exp.c) as an example.
4275 *
4276 * It is very easy to transfer the C explanation to C++; whenever a function should be implemented using the
4277 * SCIP_DECL_EXPRHDLR... notion, reimplement the corresponding virtual member function of the abstract scip::ObjExprhdlr
4278 * base class.
4279 *
4280 * @section EXPRHDLR_PROPERTIES Properties of an Expression Handler
4281 *
4282 * At the top of the new file `expr_myfunc.c`, you can find the expression handler properties.
4283 * These are given as compiler defines.
4284 * In the C++ wrapper class, you have to provide the expression handler properties by calling the constructor
4285 * of the abstract base class scip::ObjExprhdlr from within your constructor.
4286 * The properties you have to set have the following meaning:
4287 *
4288 * \par EXPRHDLR_NAME: the name of the expression handler.
4289 * This name is used in the interactive shell to address the expression handler.
4290 * Additionally, if you or a parsing routine is searching for an expression handler with SCIPfindExprhdlr(), this name is looked up.
4291 * Names have to be unique: no two expression handlers may have the same name.
4292 *
4293 * \par EXPRHDLR_DESC: the description of the expression handler.
4294 * This string is printed as a description of the expression handler in the interactive shell.
4295 *
4296 * \par EXPRHDLR_PRECEDENCE: the precedence of the expression handler.
4297 * Precedence of the expression operation relative to other expressions when printing the expression.
4298 *
4299 * @section EXPRHDLR_DATA Expression Handler Data and Expression Data
4300 *
4301 * Below the header "Data structures" you can find structs called `struct SCIP_ExprhdlrData` and `struct SCIP_ExprData`.
4302 * In this first data structure, you can store the data of your expression handler.
4303 * For example, you should store the adjustable parameters of the expression handler in this data structure.
4304 * In the second data structure, you can store data that is unique to an expression.
4305 * For example, the pow expression handler stores the exponent in this data structure.
4306 * \n
4307 * Defining expression handler data and expression data is optional. You can leave these structs empty.
4308 *
4309 * @section EXPRHDLR_INTERFACE Interface Functions
4310 *
4311 * @subsection EXPRHDLR_INCLUDE SCIPincludeExprhdlrMyfunc()
4312 *
4313 * At the bottom of `expr_myfunc.c`, you can find the interface function `SCIPincludeExprhdlrMyfunc()`,
4314 * which also appears in `expr_myfunc.h`.
4315 * `SCIPincludeExprhdlrMyfunc()` is called by the user, if (s)he wants to include the expression handler,
4316 * i.e., if (s)he wants to use the expression handler in his/her application.
4317 *
4318 * This function is responsible for notifying SCIP of the presence of the expression handler.
4319 * For this, you must call SCIPincludeExprhdlr() from SCIPincludeExprhdlrMyfunc().
4320 * The function only expects the properties and fundamental callbacks of the expression handler as arguments.
4321 * \ref EXPRHDLR_ADDITIONALCALLBACKS "Additional callbacks" must be added via setter functions as, e.g., SCIPexprhdlrSetCopyFreeHdlr().
4322 *
4323 * If you are using expression handler data, you have to allocate the memory for the data at this point.
4324 * You can do this by calling:
4325 * \code
4326 * SCIP_CALL( SCIPallocBlockMemory(scip, &exprhdlrdata) );
4327 * \endcode
4328 * You also have to initialize the fields in `struct SCIP_ExprhdlrData` afterwards.
4329 * For freeing the expression handler data, see \ref EXPRFREEHDLR.
4330 *
4331 * You may also add user parameters for your expression handler, see \ref PARAM for how to add user parameters.
4332 *
4333 * For the logarithm expression handler, the include function is as follows:
4334 * @refsnippet{src/scip/expr_log.c,SnippetIncludeExprhdlrLog}
4335 *
4336 * @subsection EXPRHDLR_CREATEEXPR SCIPcreateExprMyfunc()
4337 *
4338 * Another interface function that can be found in `expr_myfunc.c` is `SCIPcreateExprMyfunc()`.
4339 * This function is called by the user, if (s)he wants to create an expression that is handled by this expression handler.
4340 * Typically, the creation function takes the operands of the expression (the children) as arguments.
4341 * `SCIPcreateExprMyfunc()` may further be extended to take parameters of an expression into account.
4342 * For example, SCIPcreateExprPow() receives the exponent as argument.
4343 *
4344 * In the implementation of `SCIPcreateExprMyfunc()`, the expression data shall be allocated and initialized, if the expression has data
4345 * (like the exponent of pow expressions).
4346 * Then the expression shall be created by a call to SCIPcreateExpr().
4347 * This function takes the expression handler, expression data, children, and ownercreate callback as arguments.
4348 * For freeing the expression data, see \ref EXPRFREEDATA.
4349 *
4350 * The `ownercreate` and `ownercreatedata` that are passed to `SCIPcreateExprMyfunc()` need to be passed on to SCIP.
4351 * The owner of the expression that is created uses these arguments to store additional data in an expression.
4352 * For most usecases, these arguments will be set to `NULL`.
4353 * However, if the \ref EXPRPARSE callback is implemented, then `SCIPcreateExprMyfunc()` may need to be called with a non-NULL value
4354 * for `ownercreate` and `ownercreatedata`.
4355 * This will be the case if, for example, the constraint handler for nonlinear constraint parses an expression.
4356 * The constraint handler will then own the expression and needs to store some data in the expression.
4357 *
4358 * For the product expression handler, the expression create function is as follows:
4359 * @refsnippet{src/scip/expr_product.c,SnippetCreateExprProduct}
4360 *
4361 *
4362 * @section EXPRHDLR_FUNDAMENTALCALLBACKS Fundamental Callbacks of an Expression Handler
4363 *
4364 * The fundamental callbacks of the plugins are the ones that have to be implemented in order to obtain
4365 * an operational algorithm.
4366 * They are passed to SCIP when the expression handler is created and included in SCIP via SCIPincludeExprhdlr(),
4367 * see @ref EXPRHDLR_INTERFACE.
4368 * In the C++ wrapper class scip::ObjExprhdlr, the fundamental callbacks are virtual abstract member functions.
4369 * You have to implement them in order to be able to construct an object of your expression handler class.
4370 *
4371 * Expression handlers have one fundamental callback, @ref EXPREVAL, that needs to be implemented.
4372 * However, expression handlers with stateful expressions (expressions that have data) need to implement also the
4373 * @ref EXPRCOPYDATA, @ref EXPRFREEDATA, and @ref EXPRCOMPARE callbacks.
4374 *
4375 * Additional documentation for the callbacks, in particular relating to their input parameters,
4376 * can be found in \ref type_expr.h.
4377 *
4378 * @subsection EXPREVAL
4379 *
4380 * The expression evaluation callback defines the mathematical operation that the expression handler represents.
4381 * Its purpose is to evaluate an expression by taking the values of its children (operands) into account.
4382 *
4383 * The children of the expression can be retrieved via SCIPexprGetChildren() and SCIPexprGetNChildren().
4384 * The value (a `SCIP_Real`) for each child can be retrieved via function SCIPexprGetEvalValue().
4385 * The value of the expression should be stored in the argument `val` that is passed to the callback.
4386 * For example, the evaluation in the expression handler for sum is doing the following:
4387 * @refsnippet{src/scip/expr_sum.c,SnippetExprEvalSum}
4388 *
4389 * When an expression cannot be evaluated w.r.t. the values of its children, such a domain error must be signaled
4390 * to SCIP by setting `*val` to `SCIP_INVALID`.
4391 * SCIP then aborts evaluation. It is thus not necessary to check in the evaluation callback whether any child
4392 * has value `SCIP_INVALID`.
4393 * For example, the evaluation in the expression handler for logarithm expressions is doing the following:
4394 * @refsnippet{src/scip/expr_log.c,SnippetExprEvalLog}
4395 *
4396 * The solution (`sol`) that is passed to EXPREVAL can usually be ignored.
4397 * It is used by the expression handler for variables to retrieve the value of a variable expression.
4398 *
4399 *
4400 * @section EXPRHDLR_ADDITIONALCALLBACKS Additional Callbacks of an Expression Handler
4401 *
4402 * The additional callbacks do not need to be implemented in every case. However, some of them have to be
4403 * implemented for most applications; they can be used, for example, to initialize and free private data.
4404 * Additional callbacks can be passed via specific
4405 * <b>setter functions</b> after a call of SCIPincludeExprhdlr(), see also @ref EXPRHDLR_INCLUDE.
4406 *
4407 * @subsection EXPRCOPYHDLR
4408 *
4409 * This function should include the expression handler into a given SCIP instance.
4410 * It is usually called when a copy of SCIP is generated.
4411 *
4412 * By not implementing this callback, the expression handler will not be available in copied SCIP instances.
4413 * If a nonlinear constraint uses expressions of this type, it will not be possible to copy them.
4414 * This may deteriorate the performance of primal heuristics using sub-SCIPs.
4415 *
4416 * @subsection EXPRFREEHDLR
4417 *
4418 * If you are using expression handler data (see \ref EXPRHDLR_DATA and \ref EXPRHDLR_INCLUDE), you have to implement this function
4419 * in order to free the expression handler data.
4420 *
4421 * @subsection EXPRCOPYDATA
4422 *
4423 * This function is called when creating copies of an expression within
4424 * the same or between different SCIP instances. It is given the
4425 * source expression, whose data shall be copied, and expects that
4426 * the data for the target expression is returned. This data will then be used
4427 * to create a new expression.
4428 *
4429 * If expressions that are handled by this expression handler have no data,
4430 * then this callback can be omitted.
4431 *
4432 * @subsection EXPRFREEDATA
4433 *
4434 * This function is called when freeing an expression that has data.
4435 * It is given an expression and shall free its expression data.
4436 * It shall then call `SCIPexprSetData(expr, NULL)`.
4437 *
4438 * This callback must be implemented for expressions that have data.
4439 *
4440 * @subsection EXPRPRINT
4441 *
4442 * This callback is called when an expression is printed.
4443 * It is called while DFS-iterating over the expression at different stages, that is,
4444 * when the expression is visited the first time, before each child of the expression is visited,
4445 * after each child of the expression has been visited, and when the iterator leaves the expression
4446 * for its parent.
4447 * At the various stages, the expression may print a string.
4448 * The given precedence of the parent expression can be used to decide whether parenthesis need to be printed.
4449 *
4450 * For example, the pow expression prints `(f(x))^p` where `f(x)` is a print of the child of the pow expression and `p` is the exponent:
4451 * @refsnippet{src/scip/expr_pow.c,SnippetExprPrintPow}
4452 *
4453 * The pow expression handler does not yet take expression precedence into account to decide whether the parenthesis around `f(x)` can be omitted.
4454 * For the sum expression handler, this has been implemented:
4455 * @refsnippet{src/scip/expr_sum.c,SnippetExprPrintSum}
4456 *
4457 * If this callback is not implemented, the expression is printed as `<hdlrname>(<child1>, <child2>, ...)`.
4458 *
4459 * @subsection EXPRPARSE
4460 *
4461 * This callback is called when an expression is parsed from a string and an operator with the name of the expression handler is found.
4462 * The given string points to the beginning of the arguments of the expression, that is, the beginning of "..." in the string `myfunc(...)`.
4463 * The callback shall interpret "..." and create an expression, probably via `SCIPcreateExprMyfunc()`, and return this created expression
4464 * and the position of the last character in "..." to SCIP.
4465 * When creating an expression, the given `ownercreate` and `ownercreatedata` shall be passed on.
4466 *
4467 * The string "..." likely contains one or several other expressions that will be the children of the `myfunc` expression.
4468 * `SCIPparseExpr()` shall be used to parse these expressions.
4469 *
4470 * For an expression that takes only one argument and has no parameters, the parsing routine is straightforward.
4471 * For example:
4472 * @refsnippet{src/scip/expr_exp.c,SnippetExprParseExp}
4473 *
4474 * For an expression that has additional data, the parsing routine is slightly more complex.
4475 * For the signpower expression, this parses `signpower(<child>,<exponent>)`:
4476 * @refsnippet{src/scip/expr_pow.c,SnippetExprParseSignpower}
4477 *
4478 * If this callback is not implemented, the expression cannot be parsed.
4479 * For instance, `.cip` files with nonlinear constraints that use this expression cannot be read.
4480 *
4481 * @subsection EXPRCURVATURE
4482 *
4483 * This callback is called when an expression is checked for convexity or concavity.
4484 * It is important to note that the callback is given a desired curvature (convex, concave, or both (=linear))
4485 * and the callback is required to return whether the given expression has the desired curvature.
4486 * In addition, it can state conditions on the curvature of the children under which the desired curvature
4487 * can be achieved and it can take bounds on the children into account.
4488 * SCIPevalExprActivity() and SCIPexprGetActivity() shall be used to evaluate and get bounds on a child expression.
4489 *
4490 * The implementation in the absolute-value expression handler serves as an example:
4491 * @refsnippet{src/scip/expr_abs.c,SnippetExprCurvatureAbs}
4492 *
4493 * If this callback is not implemented, the expression is assumed to be indefinite.
4494 *
4495 * @subsection EXPRMONOTONICITY
4496 *
4497 * This callback is called when an expression is checked for its monotonicity with respect to a given child.
4498 * It is given the index of the child and shall return whether the expression is monotonically increasing or decreasing with respect to this child,
4499 * that is, when assuming that all other children are fixed.
4500 * Bounds on the children can be taken into account.
4501 * These can be evaluated and obtained via SCIPevalExprActivity() and SCIPexprGetActivity().
4502 *
4503 * The implementation in the absolute value expression handler serves as an example:
4504 * @refsnippet{src/scip/expr_abs.c,SnippetExprMonotonicityAbs}
4505 *
4506 * If this callback is not implemented, the expression is assumed to be not monotone in any child.
4507 *
4508 * @subsection EXPRINTEGRALITY
4509 *
4510 * This callback is called when an expression is checked for integrality, that is,
4511 * whether the expression evaluates always to an integral value in a feasible solution.
4512 * An implementation usually uses SCIPexprGetIntegrality() or SCIPexprIsIntegral() to evaluate the integrality of a
4513 * feasible child expression. The function SCIPexprGetIntegrality() distinguishes the integrality types none, weak, and strong. Weak
4514 * integrality occurs if one of the variables in the expression is weakly implied integral.
4515 *
4516 * For example, a sum expression is returned to be integral if all coefficients and all children are integral:
4517 * @refsnippet{src/scip/expr_sum.c,SnippetExprIntegralitySum}
4518 *
4519 * If this callback is not implemented, the expression is assumed to be not integral.
4520 *
4521 * @subsection EXPRHASH
4522 *
4523 * This callback is called when a hash value is computed for an expression.
4524 * The hash is used to quickly identify expressions that may be equal (or better: to identify expressions that cannot be pairwise equal).
4525 *
4526 * The hash shall be unique to the expression as likely as positive.
4527 * To achieve this, the hashing algorithm shall use the expression type, expression data, and hash of children as input.
4528 * It must also be deterministic in this input.
4529 *
4530 * For example, for the sum expression, the coefficients and the hashes of all children are taken into account:
4531 * @refsnippet{src/scip/expr_sum.c,SnippetExprHashSum}
4532 *
4533 * `EXPRHDLR_HASHKEY` is a constant that is unique to the sum expression handler.
4534 *
4535 * If this callback is not implemented, a hash is computed from the expression handler name and the hashes of all children.
4536 *
4537 * @subsection EXPRCOMPARE
4538 *
4539 * This callback is called when two expressions (expr1 and expr2) that are handled by the expression handlers need to be compared.
4540 * The function shall impose an order on expressions and thus must return
4541 * - -1 if expr1 < expr2, or
4542 * - 0 if expr1 = expr2, or
4543 * - 1 if expr1 > expr2.
4544 *
4545 * The callback may use SCIPcompareExpr() to compare children of expr1 and expr2.
4546 *
4547 * For example, for pow expressions, the order is given by the order of the children.
4548 * If the children are equal, then the order of the exponents is used:
4549 * @refsnippet{src/scip/expr_pow.c,SnippetExprComparePow}
4550 *
4551 * If this callback is not implemented, a comparison is done based on the children of expr1 and expr2 only.
4552 * If the expression is stateful, it must implement this callback.
4553 *
4554 * @subsection EXPRBWDIFF
4555 *
4556 * This callback is called when the gradient or Hessian of a function that is represented by an expression is computed.
4557 *
4558 * The function shall compute the partial derivative of the expression w.r.t. a child with specified childidx.
4559 * That is, it should return
4560 * \f[
4561 * \frac{\partial \text{expr}}{\partial \text{child}_{\text{childidx}}}
4562 * \f]
4563 *
4564 * See also \ref SCIP_EXPR_DIFF "Differentiation functions in scip_expr.h" for more details on automatic differentiation of expressions.
4565 *
4566 * For the product expression, backward differentiation is implemented as follows:
4567 * @refsnippet{src/scip/expr_product.c,SnippetExprBwdiffProduct}
4568 *
4569 * If this callback is not implemented, gradients and Hessian of functions that involve this expression cannot be computed.
4570 * This can be hurtful for performance because linear relaxation routines that rely on gradient evaluation (e.g., nlhdlr_convex) cannot be used.
4571 *
4572 * @subsection EXPRFWDIFF
4573 *
4574 * This callback is called when the Hessian of a function that is represented by an expression is computed.
4575 * It may also be used to compute first derivatives.
4576 *
4577 * The function shall evaluate the directional derivative of the expression when interpreted as an operator
4578 * \f$ f(c_1, \ldots, c_n) \f$, where \f$ c_1, \ldots, c_n \f$ are the children.
4579 * The directional derivative is
4580 * \f[
4581 * \sum_{i = 1}^n \frac{\partial f}{\partial c_i} D_u c_i,
4582 * \f]
4583 * where \f$ u \f$ is the direction (given to the callback) and \f$ D_u c_i \f$ is the directional derivative of the i-th child,
4584 * which can be accessed via SCIPexprGetDot().
4585 * The point at which to compute the derivative is given by SCIPexprGetEvalValue().
4586 *
4587 * See also \ref SCIP_EXPR_DIFF "Differentiation functions in scip_expr.h" for more details on automatic differentiation of expressions.
4588 *
4589 * For a product, \f$f(x) = c\prod_i x_i\f$, the directional derivative is \f$c\sum_j \prod_{i\neq j} x_i x^{\text{dot}}_j\f$:
4590 * @refsnippet{src/scip/expr_product.c,SnippetExprFwdiffProduct}
4591 *
4592 * If this callback is not implemented, routines (in particular primal heuristics) that rely on solving NLPs cannot be used, as they currently rely on using forward differentiation for gradient computations.
4593 *
4594 * @subsection EXPRBWFWDIFF
4595 *
4596 * This callback is called when the Hessian of a function that is represented by an expression is computed.
4597 *
4598 * The function computes the total derivative, w.r.t. its children, of the partial derivative of expr w.r.t. childidx.
4599 * Equivalently, it computes the partial derivative w.r.t. childidx of the total derivative.
4600 *
4601 * The expression should be interpreted as an operator \f$ f(c_1, \ldots, c_n) \f$, where \f$ c_1, \ldots, c_n \f$ are the children,
4602 * and the function should return
4603 * \f[
4604 * \sum_{i = 1}^n \frac{\partial^2 f}{\partial c_i} \partial c_{\text{childidx}} D_u c_i,
4605 * \f]
4606 * where \f$ u \f$ is the direction (given to the callback) and \f$ D_u c_i \f$ is the directional derivative of the i-th child,
4607 * which can be accessed via SCIPexprGetDot().
4608 *
4609 * Thus, if \f$ n = 1 \f$ (i.e., the expression represents a univariate operator), the function should return
4610 * \f[
4611 * f^{\prime \prime}(\text{SCIPexprGetEvalValue}(c)) D_u c.
4612 * \f]
4613 *
4614 * See also \ref SCIP_EXPR_DIFF "Differentiation functions in scip_expr.h" for more details on automatic differentiation of expressions.
4615 *
4616 * For a product, \f$f(x) = c\prod_i x_i\f$, the directional derivative is
4617 * \f$c\partial_k \sum_j \prod_{i \neq j} x_i x^{\text{dot}}_j = c\sum_{j \neq k} \prod_{i \neq j, k} x_i x^{\text{dot}}_j\f$:
4618 * @refsnippet{src/scip/expr_product.c,SnippetExprBwfwdiffProduct}
4619 *
4620 * If this callback is not implemented, there is currently no particular performance impact.
4621 * In a future version, not implementing this callback would mean that Hessians are not available for NLP solvers, in which case they may have to work with approximations.
4622 *
4623 * @subsection EXPRINTEVAL
4624 *
4625 * This callback is called when bounds on an expression need to be computed.
4626 * It shall compute an (as tight as possible) overestimate on the range that the expression values take w.r.t. bounds (given as \ref SCIP_INTERVAL) for the children.
4627 * The latter can be accessed via SCIPexprGetActivity().
4628 *
4629 * Often, interval evaluation is implemented analogous to evaluation with numbers.
4630 * For example, for products:
4631 * @refsnippet{src/scip/expr_product.c,SnippetExprIntevalProduct}
4632 *
4633 * If this callback is not implemented, the performance of domain propagation for nonlinear constraints and other routines that rely on bounds of expressions will be impacted severely.
4634 *
4635 * @subsection EXPRESTIMATE
4636 *
4637 * While \ref EXPRINTEVAL computes constant under- and overestimators,
4638 * this callback is called when linear under- or overestimators need to be computed.
4639 * The estimator shall be as tight as possible at a given point and must be valid w.r.t. given (local) bounds.
4640 * If the value of the estimator in the reference point is smaller (larger) than a given targetvalue
4641 * when underestimating (overestimating), then no estimator needs to be computed.
4642 * Note, that targetvalue can be infinite if any estimator will be accepted.
4643 *
4644 * The callback shall also indicate whether the estimator is also valid w.r.t. given global bounds and for which
4645 * child a reduction in the local bounds (usually by branching) would improve the estimator.
4646 *
4647 * For the absolute-value expression, the under- and overestimators are computed as follows:
4648 * @refsnippet{src/scip/expr_abs.c,SnippetExprEstimateAbs}
4649 *
4650 * If this callback is not implemented, updating the linear relaxation for nonlinear constraints that use this expression will not be possible, which has a severe impact on performance.
4651 *
4652 * @subsection EXPRINITESTIMATES
4653 *
4654 * This callback is similar to \ref EXPRESTIMATE, but is not given a reference point.
4655 * It can also return several (up to \ref SCIP_EXPR_MAXINITESTIMATES many) estimators.
4656 * A usecase for this callback is the construction of an initial linear relaxation of nonlinear constraints.
4657 *
4658 * For the absolute-value expression, the following initial under- and overestimators are computed:
4659 * @refsnippet{src/scip/expr_abs.c,SnippetExprInitestimatesAbs}
4660 *
4661 * If this callback is not implemented, the initial linear relaxation for nonlinear constraints may be less tight.
4662 * This can have a minor effect on performance, as long as \ref EXPRESTIMATE has been implemented and the linear relaxation
4663 * is still bounded (e.g., when all nonlinear variables have finite bounds).
4664 *
4665 * @subsection EXPRSIMPLIFY
4666 *
4667 * This callback shall try to simplify an expression by applying algebraic transformations.
4668 * It shall return the simplified (and equivalent) expression.
4669 * It can assume that children have been simplified.
4670 * If no simplification is possible, then it can return the original expression, but needs to capture it.
4671 * When creating a new expression, it shall pass on the given ownerdata creation callback and its data.
4672 *
4673 * A simplification that should be implemented by every expression handler at the moment is constant-folding, i.e.,
4674 * returning a value-expression if every child is a value expression.
4675 * For an example, the simplification for the exponentiation expression is implemented as
4676 * @refsnippet{src/scip/expr_exp.c,SnippetExprSimplifyExp}
4677 *
4678 * See also SCIPsimplifyExpr() for more information on implemented simplification rules.
4679 *
4680 * If this callback is not implemented, reducing the problem size when variables are fixed may not be possible, which can have an impact on performance.
4681 * (Also bugs may show up as this situation is untested.)
4682 *
4683 * @subsection EXPRREVERSEPROP
4684 *
4685 * This callback is called when given bounds on an expression shall be propagated over the children of an expression.
4686 * Already existing bounds on the children (see \ref EXPRINTEVAL) shall be used.
4687 * That is, the function shall compute an interval overestimate on
4688 * \f[
4689 * \{ x_i : f(c_1,\ldots,c_{i-1},x_i,c_{i+1},\ldots,c_n) \in \text{bounds} \}
4690 * \f]
4691 * for each child \f$i\f$, given bounds on f and initial intervals \f$c_i, i=1,\ldots,n,\f$, for the children.
4692 *
4693 * For univariate expressions, the implementation can be rather straightforward, e.g., for absolute value:
4694 * @refsnippet{src/scip/expr_abs.c,SnippetExprReversepropAbs}
4695 *
4696 * For multivariate expressions, it can be more complicated, e.g., for products:
4697 * @refsnippet{src/scip/expr_product.c,SnippetExprReversepropProduct}
4698 *
4699 * If this callback is not implemented, the performance of domain propagation for nonlinear constraints will be impacted severely.
4700 */
4701
4702/*--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
4703
4704/**@page NLHDLR How to add nonlinear handlers
4705 *
4706 * Nonlinear handlers define the extended formulations of nonlinear constraints and provide domain propagation and separation routines on this extended formulation.
4707 * In difference to \ref EXPRHDLR "expression handlers", they do not define a function, but instead identify a
4708 * structure in an existing expression and provide bound tightening and separation on this structure similar to \ref EXPRINTEVAL, \ref EXPRREVERSEPROP, \ref EXPRINITESTIMATES, and \ref EXPRESTIMATE.
4709 * The structure typically consists of a composition of expressions.
4710 *
4711 * Nonlinear handlers are a new plugin type in SCIP and may still have some rough edges.
4712 * They resemble constraint handlers in some sense, but are specific to the handling of nonlinear constraints.
4713 * We suggest to read section "New Handler for Nonlinear Constraints" in the SCIP 8.0 release report (2021)
4714 * to understand the role and use of nonlinear handlers before attempting to implement one.
4715 *
4716 * A complete list of all nonlinear handlers contained in this release can be found \ref NLHDLRS "here".
4717 * In difference to many other plugins in SCIP, nonlinear handlers are not handled by the SCIP core but by the constraint handler for nonlinear constraints.
4718 *
4719 * Here is what you have to do to implement a nonlinear handler:
4720 * -# Copy the template files `src/scip/nlhdlr_xyz.c` and `src/scip/nlhdlr_xyz.h` into files `nlhdlr_mystruct.c` and `nlhdlr_mystruct.h`, respectively. \n
4721 * Make sure to adjust your build system such that these files are compiled and linked to your project. \n
4722 * If you are adding a new default plugin, this means updating the `src/CMakeLists.txt` and `Makefile` files in the SCIP distribution.
4723 * -# Use `SCIPincludeNlhdlrMystruct()` in order to include the nonlinear handler into your SCIP instance, e.g., in the main file of your project. \n
4724 If you are adding a new default plugin, this include function must be added to `src/scipdefplugins.c`.
4725 * -# Open the new files with a text editor and replace all occurrences of "xyz" by "mystruct".
4726 * -# Adjust the properties of the nonlinear handler (see \ref NLHDLR_PROPERTIES).
4727 * -# Define the nonlinear handler data and nonlinear handler expression data (see \ref NLHDLR_DATA). This is optional.
4728 * -# Implement the interface functions (see \ref NLHDLR_INTERFACE).
4729 * -# Implement the fundamental callbacks (see \ref NLHDLR_FUNDAMENTALCALLBACKS).
4730 * -# Implement the additional callbacks (see \ref NLHDLR_ADDITIONALCALLBACKS), where necessary.
4731 *
4732 * Additional documentation for the callbacks of a nonlinear handler, in particular for the input parameters,
4733 * can be found in the file \ref type_nlhdlr.h.
4734 *
4735 * @section NLHDLR_PROPERTIES Properties of a Nonlinear Handler
4736 *
4737 * At the top of the new file `nlhdlr_mystruct.c`, you can find the nonlinear handler properties.
4738 * These are given as compiler defines.
4739 * The properties you have to set have the following meaning:
4740 *
4741 * \par NLHDLR_NAME: the name of the nonlinear handler.
4742 * This name is used in the interactive shell to address the nonlinear handler.
4743 * Additionally, if you are searching for a nonlinear handler with SCIPfindNlhdlrNonlinear(), this name is looked up.
4744 * Names have to be unique: no two nonlinear handlers may have the same name.
4745 *
4746 * \par NLHDLR_DESC: the description of the nonlinear handler.
4747 * This string is printed as a description of the nonlinear handler in the interactive shell.
4748 *
4749 * \par NLHDLR_DETECTPRIORITY: the priority of the nonlinear handler when detecting structure.
4750 * This priority decides when the \ref NLHDLRDETECT callback of the nonlinear handler is called, relative to other nonlinear handlers, on an expression.
4751 * Typically, the priority should be strictly positive.
4752 * This is because the nonlinear handler "default" (having detection priority 0) will not become active on expressions that are already handled by other nonlinear handlers.
4753 *
4754 * \par NLHDLR_ENFOPRIORITY: the priority of the nonlinear handler when enforcing constraints in the extended formulations.
4755 * This priority decides when the callbacks that help on domain propagation and separation are called for an expression for which the nonlinear handler detected a structure.
4756 * A high priority means that the nonlinear handler will be called before others.
4757 * The nonlinear handler "default" has enforcement priority 0.
4758 *
4759 * @section NLHDLR_DATA Nonlinear Handler Data and Nonlinear Handler Expression Data
4760 *
4761 * Below the header "Data structures" you can find structs called `struct SCIP_NlhdlrData` and `struct SCIP_NlhdlrExprData`.
4762 * In this first data structure, you can store the data of your nonlinear handler.
4763 * For example, you should store the adjustable parameters of the nonlinear handler in this data structure.
4764 * In the second data structure, you can store data that is unique to an expression for which the nonlinear handler detected a structure.
4765 * For example, the nonlinear handler for quotients stores a representation of a detected quotient in this data structure.
4766 * \n
4767 * Defining nonlinear handler data and nonlinear handler expression data is optional. You can leave these structs empty.
4768 *
4769 * @section NLHDLR_INTERFACE Interface Functions
4770 *
4771 * At the bottom of `nlhdlr_mystruct.c`, you can find the interface function `SCIPincludeNlhdlrXyz()`,
4772 * which also appears in `nlhdlr_mystruct.h`.
4773 * `SCIPincludeNlhdlrXyz()` is called by the user, if (s)he wants to include the nonlinear handler,
4774 * i.e., if (s)he wants to use the nonlinear handler in his/her application.
4775 *
4776 * This function is responsible for notifying SCIP of the presence of the nonlinear handler.
4777 * For this, you must call SCIPincludeNlhdlrNonlinear() from SCIPincludeNlhdlrMystruct().
4778 * The function only expects the properties and fundamental callbacks of the nonlinear handler as arguments.
4779 * \ref NLHDLR_ADDITIONALCALLBACKS "Additional callbacks" must be added via setter functions as, e.g., SCIPnlhdlrSetCopyHdlr().
4780 *
4781 * If you are using nonlinear handler data, you have to allocate the memory for the data at this point and initialize it.
4782 * For freeing the nonlinear handler data, see \ref NLHDLRFREEHDLRDATA.
4783 * You may also add user parameters or statistic tables for your nonlinear handler, see \ref PARAM for how to add user parameters.
4784 *
4785 * For the bilinear nonlinear handler, the include function is as follows:
4786 * @refsnippet{src/scip/nlhdlr_bilinear.c,SnippetIncludeNlhdlrBilinear}
4787 *
4788 *
4789 * @section NLHDLR_FUNDAMENTALCALLBACKS Fundamental Callbacks of a Nonlinear Handler
4790 *
4791 * The fundamental callbacks of the plugins are the ones that have to be implemented in order to obtain
4792 * an operational algorithm.
4793 * They are passed to SCIP when the nonlinear handler is created and included in SCIP via SCIPincludeNlhdlrNonlinear(),
4794 * see @ref NLHDLR_INTERFACE.
4795 *
4796 * Nonlinear handlers have two fundamental callbacks that need to be implemented.
4797 * Additional documentation for the callbacks, in particular to their input parameters,
4798 * can be found in \ref type_nlhdlr.h.
4799 *
4800 * @subsection NLHDLRDETECT
4801 *
4802 * This callback is called by the handler for nonlinear constraints when extended formulations are constructed.
4803 * The result of this callback determines the extended formulation.
4804 *
4805 * The nonlinear handler shall analyze the given expression (`expr`) and decide whether it wants to contribute
4806 * in enforcing the relation between bounds or an auxiliary variable (`auxvar`) associated with this expression and
4807 * its descendants (e.g., children) via linear under- or overestimation, cut generation, and/or activity computation and propagation.
4808 * For linear under- or overestimation and cut generation, an auxiliary variable can be assumed to
4809 * be associated with the expression and auxiliary variables may be requested for descendant expressions.
4810 *
4811 * We distinguish the following enforcement methods:
4812 * - \ref SCIP_NLHDLR_METHOD_SEPABELOW : linear underestimation of `expr` or cut generation for the relation `expr` &le; `auxvar` (denoted as "below")
4813 * - \ref SCIP_NLHDLR_METHOD_SEPAABOVE : linear overestimation of `expr` or cut generation for the relation `expr` &ge; `auxvar` (denoted as "above")
4814 * - \ref SCIP_NLHDLR_METHOD_ACTIVITY : domain propagation (i.e., constant under/overestimation) for `expr`.
4815 *
4816 * On input, parameter `enforcing` indicates for any of these methods, whether
4817 * - it is not necessary to have such a method, e.g., because no `auxvar` will exist for `expr`, or no one uses or sets activities of this expression,
4818 * or because analysis of the expression has shown that a relation like `expr` &ge; `auxvar` is not necessary to be satisfied,
4819 * - or there already exists a nonlinear handler that will provide this method in an "enforcement" sense, that is,
4820 * it believes that no one else could provide this method in a stronger sense. (This is mainly used by the nonlinear handler "default" to check whether
4821 * it should still reach out to the expression handler or whether it would be dominated by some nonlinear handler.)
4822 *
4823 * The DETECT callback shall augment the `enforcing` bitmask by setting the enforcement methods it wants to provide in an "enforcement" sense.
4824 *
4825 * Additionally, the `participating` bitmask shall be set if the nonlinear handler wants to be called on this expression at all.
4826 * Here, it shall set all methods that it wants to provide, which are those set in `enforcing`, but additionally those where it wants
4827 * to participate but leave enforcement to another nonlinear handler.
4828 * This can be useful for nonlinear handlers that do not implement a complete enforcement, e.g., a handler that only contributes
4829 * cutting planes in some situations only.
4830 *
4831 * A nonlinear handler will be called only for those callbacks that it mentioned in `participating`, which is
4832 * - \ref NLHDLRENFO and/or \ref NLHDLRESTIMATE will be called with `overestimate==FALSE` if \ref SCIP_NLHDLR_METHOD_SEPABELOW has been set
4833 * - \ref NLHDLRENFO and/or \ref NLHDLRESTIMATE will be called with `overestimate==TRUE` if \ref SCIP_NLHDLR_METHOD_SEPAABOVE has been set
4834 * - \ref NLHDLRINTEVAL and/or \ref NLHDLRREVERSEPROP will be called if \ref SCIP_NLHDLR_METHOD_ACTIVITY has been set
4835 *
4836 * If \ref SCIP_NLHDLR_METHOD_SEPABELOW or \ref SCIP_NLHDLR_METHOD_SEPAABOVE has been set, then at least one of the
4837 * callbacks \ref NLHDLRENFO and \ref NLHDLRESTIMATE needs to be implemented.
4838 * Also \ref NLHDLREVALAUX will be called in this case.
4839 * If \ref SCIP_NLHDLR_METHOD_ACTIVITY has been set, then at least one of \ref NLHDLRINTEVAL and \ref NLHDLRREVERSEPROP needs to be implemented.
4840 * If the nonlinear handler chooses not to participate, then it must not set `nlhdlrexprdata` and can leave `participating` at its
4841 * initial value (\ref SCIP_NLHDLR_METHOD_NONE).
4842 *
4843 * Additionally, a nonlinear handler that decides to participate in any of the enforcement methods must call
4844 * @ref SCIPregisterExprUsageNonlinear() for every subexpression that it will use and indicate whether
4845 * - it will use an auxiliary variable in \ref NLHDLRENFO or \ref NLHDLRESTIMATE,
4846 * - it will use activity for some subexpressions when computing estimators or cuts, and
4847 * - it will use activity for some subexpressions when in \ref NLHDLRINTEVAL or \ref NLHDLRREVERSEPROP.
4848 *
4849 * Note that auxiliary variables do not exist in subexpressions during DETECT and are not created by a call to @ref SCIPregisterExprUsageNonlinear().
4850 * They will be available when the \ref NLHDLRINITSEPA callback is called.
4851 *
4852 * For an example, see the implementation of the DETECT callback for the nonlinear handler for quotients (src/scip/nlhdlr_quotient.c).
4853 *
4854 * @subsection NLHDLREVALAUX
4855 *
4856 * This callback is called by the constraint handler for nonlinear constraints when the violation of constraints in the extended formulation
4857 * (`expr` &le;/&ge; `auxvar`) needs to be evaluated.
4858 * During constraint enforcement, this violation value is used to decide whether estimation and separation callbacks should be called.
4859 *
4860 * The function shall evaluate the expression w.r.t. the auxiliary variables that were introduced by the nonlinear handler (if any).
4861 * It can be assumed that the expression itself has been evaluated in the given sol.
4862 *
4863 * For an example, see the evaluation for the quotient nonlinear handler:
4864 * @refsnippet{src/scip/nlhdlr_quotient.c,SnippetNlhdlrEvalauxQuotient}
4865*
4866 * @section NLHDLR_ADDITIONALCALLBACKS Additional Callbacks of a Nonlinear Handler
4867 *
4868 * The additional callbacks do not need to be implemented in every case. However, some of them have to be
4869 * implemented for most applications, they can be used, for example, to initialize and free private data.
4870 * Additional callbacks can be passed via specific
4871 * <b>setter functions</b> after a call of SCIPincludeNlhdlrNonlinear(), see also @ref NLHDLR_INTERFACE.
4872 *
4873 * @subsection NLHDLRCOPYHDLR
4874 *
4875 * This callback is called when doing a copy of the constraint handler for nonlinear constraints.
4876 * It shall include the nonlinear handler into the copy of the constraint handler.
4877 *
4878 * @subsection NLHDLRFREEHDLRDATA
4879 *
4880 * If you are using nonlinear handler data (see \ref NLHDLR_DATA and \ref NLHDLR_INTERFACE), you have to implement this function
4881 * in order to free the nonlinear handler data.
4882 *
4883 * @subsection NLHDLRFREEEXPRDATA
4884 *
4885 * If you are using nonlinear handler expression data (see \ref NLHDLR_DATA and \ref NLHDLRDETECT), you have to implement this function
4886 * in order to free the nonlinear handler expression data.
4887 * This function is called when an extended formulation is freed.
4888 *
4889 * @subsection NLHDLRINIT
4890 *
4891 * This callback is called when the constraint handler for nonlinear constraints is initialized, that is, after the problem was transformed.
4892 * The nonlinear handler can use this callback to initialize or reset some data for the upcoming solve.
4893 *
4894 * @subsection NLHDLREXIT
4895 *
4896 * This callback is called when the constraint handler for nonlinear constraints is deinitialized, that is, before the transformed problem is freed.
4897 * The nonlinear handler can use this callback to free some data that was used for the previous solve only.
4898 *
4899 * @subsection NLHDLRINTEVAL
4900 *
4901 * This callback is called when bounds on a given expression shall be computed.
4902 * It is called for expressions for which the nonlinear handler registered to participate in \ref SCIP_NLHDLR_METHOD_ACTIVITY in \ref NLHDLRDETECT.
4903 * The function is given the currently available bounds to the expression and can return possibly tighter bounds.
4904 *
4905 * For a univariate quotient ((ax+b)/(cx+d)), the interval evaluation is implemented as follows:
4906 * @refsnippet{src/scip/nlhdlr_quotient.c,SnippetNlhdlrIntevalQuotient}
4907 *
4908 * @subsection NLHDLRREVERSEPROP
4909 *
4910 * This callback is called when bounds on a given expression shall be propagated to its successors.
4911 * It is called for expressions for which the nonlinear handler registered to participate in \ref SCIP_NLHDLR_METHOD_ACTIVITY in \ref NLHDLRDETECT.
4912 * The tighter intervals should be passed to the corresponding expression via SCIPtightenExprIntervalNonlinear().
4913 *
4914 * For a univariate quotient ((ax+b)/(cx+d)), reverse propagation is implemented as follows:
4915 * @refsnippet{src/scip/nlhdlr_quotient.c,SnippetNlhdlrReversepropQuotient}
4916 *
4917 * @subsection NLHDLRINITSEPA
4918 *
4919 * This callback is called when the constraint handler for nonlinear constraints initializes the LP relaxation (@ref CONSINITLP).
4920 * It is called for expressions for which the nonlinear handler registered to participate in \ref SCIP_NLHDLR_METHOD_SEPABELOW or \ref SCIP_NLHDLR_METHOD_SEPAABOVE in \ref NLHDLRDETECT.
4921 * The function shall initialize the separation data of the nonlinear handler, if any, and add initial cuts to the LP relaxation.
4922 * It can assume that auxiliary variables are available for expressions for which auxiliary variables were requested via SCIPregisterExprUsageNonlinear() in \ref NLHDLRDETECT.
4923 *
4924 * @subsection NLHDLREXITSEPA
4925 *
4926 * This callback is called when the solving process is finished and the branch and bound process data is freed (@ref CONSEXITSOL).
4927 * It is called for expressions for which the nonlinear handler registered to participate in \ref SCIP_NLHDLR_METHOD_SEPABELOW or \ref SCIP_NLHDLR_METHOD_SEPAABOVE in \ref NLHDLRDETECT and \ref NLHDLRINITSEPA was called.
4928 * The function shall deinitialize the separation data of the nonlinear handler, if any.
4929 *
4930 * @subsection NLHDLRENFO
4931 *
4932 * This callback is called when the constraint handler requires that the relation between the given expression and its auxiliary variable
4933 * (`expr` &le; `auxvar` or `expr` &ge; `auxvar`) is violated by a given solution and this solution needs to be separated.
4934 * It is called for expressions for which the nonlinear handler registered to participate in \ref SCIP_NLHDLR_METHOD_SEPABELOW or \ref SCIP_NLHDLR_METHOD_SEPAABOVE in \ref NLHDLRDETECT.
4935 *
4936 * The nonlinear handler can enforce `expr` &le;/&ge; `auxvar` by
4937 * - separation, i.e., finding an affine hyperplane (a cut) that separates the given point, or
4938 * - bound tightening, i.e., changing bounds on a variable so that the given point is outside the updated domain, or
4939 * - adding branching scores to potentially split the current problem into two subproblems.
4940 *
4941 * If parameter `inenforcement` is FALSE, then only the first option (separation) is allowed.
4942 *
4943 * If the nonlinear handler always separates by computing a linear under- or overestimator of `expr`,
4944 * then it is usually easier to implement the \ref NLHDLRESTIMATE callback instead.
4945 *
4946 * Note, that the nonlinear handler may also choose to separate for a relaxation of the mentioned sets,
4947 * e.g., `expr` &le; upperbound(`auxvar`) or `expr` &ge; lowerbound(`auxvar`).
4948 * This is especially useful in situations where `expr` is the root expression of a constraint
4949 * and it is sufficient to satisfy `lhs` &le; `expr` &le; `rhs`.
4950 * The constraint handler ensures that `lhs` &le; lowerbound(`auxvar`) and upperbound(`auxvar`) &le; `rhs`.
4951 *
4952 * The constraint handler may call this callback first with `allowweakcuts` = FALSE and repeat later with
4953 * `allowweakcuts` = TRUE, if it didn't succeed to enforce a solution without using weak cuts.
4954 * If in enforcement and the nonlinear handler cannot enforce by separation or bound tightening, it should register
4955 * branching scores for those expressions where branching may help to compute tighter cuts in children.
4956 *
4957 * The nonlinear handler must set `result` to \ref SCIP_SEPARATED if it added a cut,
4958 * to \ref SCIP_REDUCEDDOM if it added a bound change, and
4959 * to \ref SCIP_BRANCHED if it added branching scores.
4960 * Otherwise, it may set result to \ref SCIP_DIDNOTRUN or \ref SCIP_DIDNOTFIND.
4961 *
4962 * @subsection NLHDLRESTIMATE
4963 *
4964 * This callback is called when the constraint handler requires that the relaxation between the given expression and its auxiliary variable
4965 * (`expr` &le; `auxvar` or `expr` &ge; `auxvar`) is violated by a given solution and this solution needs to be separated.
4966 * It is called for expressions for which the nonlinear handler registered to participate in \ref SCIP_NLHDLR_METHOD_SEPABELOW or \ref SCIP_NLHDLR_METHOD_SEPAABOVE in \ref NLHDLRDETECT.
4967 * This function is a simpler alternative to \ref NLHDLRENFO and is called if \ref NLHDLRENFO is not implemented or does not succeed.
4968 *
4969 * The function shall compute one or several linear under- or overestimator of `expr` that are as tight as possible at a given point.
4970 * If the value of the estimator in the solution is smaller (larger) than a given targetvalue
4971 * when underestimating (overestimating), then no estimator needs to be computed.
4972 * Note, that targetvalue can be infinite if any estimator will be accepted.
4973 * If successful, it shall store the estimators in the given `rowpreps` data structure and set the
4974 * `rowprep->local` flag accordingly (SCIProwprepSetLocal()).
4975 * The sidetype of a rowprep must be set to \ref SCIP_SIDETYPE_LEFT if overestimating and
4976 * \ref SCIP_SIDETYPE_RIGHT if underestimating.
4977 *
4978 * The callback may also be required to indicate for which expression a reduction in the local bounds (usually by branching) would improve the estimator.
4979 * This is done by a call to SCIPaddExprsViolScoreNonlinear().
4980 *
4981 * For the quotient nonlinear handler, the estimators are computed as follows:
4982 * @refsnippet{src/scip/nlhdlr_quotient.c,SnippetNlhdlrEstimateQuotient}
4983 *
4984 * @subsection NLHDLRSOLLINEARIZE
4985 *
4986 * This callback is called by the constraint handler when it has caught a solution event from SCIP and option constraints/nonlinear/linearizeheursol has been enabled.
4987 * The constraint handler then calls the nonlinear handlers for all expressions they currently handle.
4988 * The nonlinear handler may use this opportunity to add a cut that supports its nonlinear function in the given solution to the cutpool.
4989 * For convex functions, this may help to accellerate proving optimality for a solution found by a NLP solver.
4990 */
4991
4992/*--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
4993
4994/**@page DIVINGHEUR How to implement a diving heuristic
4995 *
4996 * Diving heuristics are an important addon to the branch-and-cut search. A diving heuristic explores a single probing
4997 * path down the search tree. In contrast to the regular search guided by branching rule(s) and the selected
4998 * node selector, the diving is performed in an auxiliary tree originating from the focus node of the main
4999 * search tree where the heuristic was called. The advantage of this approach is that many different scoring mechanisms
5000 * can be safely tried as diving heuristic and may probably lead to better solutions. SCIP has a lot of diving heuristics
5001 * included in its default plugin set.
5002 * \n
5003 *
5004 * Since SCIP version 3.2, the diving heuristics have been redesigned to contain mainly the scoring function used by the
5005 * heuristic. In order to implement a user-defined diving heuristic, it is possible to create one (or several)
5006 * divesets that control the scoring mechanism and add them to the primal heuristic. This has the advantage that
5007 * less code is necessary to create a working diving heuristic. The SCIP statistics now also display some interesting statistics
5008 * about every diveset together in the section 'Diving Statistics'.
5009 * \n
5010 *
5011 * This page contains the necessary steps to understand and include a diveset into ones primal diving heuristic plugin. As
5012 * a prerequisite, you should understand the basic implementation steps for a primal heuristic, see \ref HEUR.
5013 * In order to make use of divesets, they must be included _after_ the primal heuristic to which they should belong
5014 * has been included, by using SCIPincludeDiveset(). This will create the data structure for the diveset and
5015 * append it to the list of divesets belonging to the heuristic, which can be retrieved later together with their number
5016 * by using SCIPheurGetDivesets() and SCIPheurGetNDivesets(), respectively. No further memory allocation or deletion is needed;
5017 * As a member of the heuristic, SCIP automatically takes care of freeing the diveset when it is exiting.
5018 * \n
5019 *
5020 * Before the inclusion, one may think of adjusting the various properties that a diveset offers to control
5021 * the behavior of the algorithm. These are subject to the following section.
5022 * \n
5023 *
5024 * It is mandatory to implement the fundamental scoring callback of the diveset, which is explained in more detail
5025 * in Section \ref DIVING_FUNDAMENTALCALLBACKS.
5026 * \n
5027 *
5028 * Once the properties have been carefully adjusted and the scoring
5029 * has been defined, use the function SCIPperformGenericDivingAlgorithm() inside the execution callback (\ref HEUREXEC) of the primal
5030 * heuristic to which the diveset belongs, after checking possible preliminaries that may not be met at all times of the search.
5031 * \n
5032 *
5033 * For a code example, we refer to \ref heur_guideddiving.h, which guides the diving into the direction of the current incumbent solution.
5034 * Before it calls SCIPperformGenericDivingAlgorithm(), it checks whether an incumbent is available, and returns if there is none.
5035 *
5036 *
5037 * @section DIVING_PARAMETERS User parameters and properties for every diveset
5038 *
5039 * Every diveset controls the diving behavior through a set of user-defined parameters, which are explained in the following:
5040 *
5041 * \par MINRELDEPTH
5042 * the minimal relative depth (to the maximum depth explored during regular search) of the current focus node to start diving
5043 *
5044 * \par MAXRELDEPTH
5045 * the maximal relative depth (to the maximum depth explored during regular search) of the current focus node to start diving
5046 *
5047 * \par MAXLPITERQUOT
5048 * maximal fraction of diving LP iterations compared to node LP iterations that this dive controller may consume
5049 *
5050 * \par MAXLPITEROFS
5051 * an additional number of allowed LP iterations
5052 *
5053 * \par MAXDIVEUBQUOT
5054 * maximal quotient (curlowerbound - lowerbound)/(cutoffbound - lowerbound)
5055 * where diving is performed (0.0: no limit)
5056 *
5057 * \par MAXDIVEAVGQUOT
5058 * maximal quotient (curlowerbound - lowerbound)/(avglowerbound - lowerbound)
5059 * where diving is performed (0.0: no limit)
5060 *
5061 * \par MAXDIVEUBQUOTNOSOL
5062 * maximal UBQUOT when no solution was found yet (0.0: no limit)
5063 *
5064 * \par MAXDIVEAVGQUOTNOSOL
5065 * maximal AVGQUOT when no solution was found yet (0.0: no limit)
5066 *
5067 * \par BACKTRACK
5068 * use one level of backtracking if infeasibility is encountered?
5069 *
5070 * \par LPRESOLVEDOMCHGQUOT
5071 * parameter to control LP resolve dynamically based on this percentage of observed bound changes relative to all variables or
5072 * the LP branching candidates (integer variables with fractional solution values) from the last node where an LP has been solved.
5073 * This property has no effect when the LPSOLVEFREQ is set to 1.
5074 *
5075 * \par LPSOLVEFREQ
5076 * LP solve frequency for diveset, use a positive integer k to solve an LP at every k'th depth of the diving search (ie. 1 causes the
5077 * diveset to solve _all_ intermediate LPs) or 0 to only resolve the LP relaxation after propagation found at least a certain percentage
5078 * domain changes, see also the previous LPRESOLVEDOMCHGQUOT parameter.
5079 *
5080 * \par ONLYLPBRANCHCANDS
5081 * Set this property to TRUE if only LP branching candidates be considered for the execution of the diving algorithm instead of the slower but
5082 * more general constraint handler diving variable selection.
5083 *
5084 * \par DIVETYPES
5085 * bit mask that represents all supported dive types. Irrelevant if only LP branching candidates should be scored, otherwise, different
5086 * constraint handlers may ask the diveset if it supports their preferred divetype. See \ref type_heur.h for a list of
5087 * available dive types.
5088 *
5089 * @section DIVING_FUNDAMENTALCALLBACKS Fundamental callbacks of a diveset
5090 *
5091 * Only one callback is necessary to complete a diveset to guide the diving search performed:
5092 *
5093 * @subsection DIVESETGETSCORE
5094 *
5095 * The scoring callback expects a candidate variable and calculates a score value and a preferred direction. The selected
5096 * variable for diving will be one that _maximizes_ the score function provided by the diveset.
5097 * If the diveset should support more than one possible type of diving, it may use the divetype argument as a hint how
5098 * the caller of the score function (could be the diving algorithm itself or one of the constraint handlers that
5099 * implement diving variable selection) intends to perform the search.
5100 *
5101 * @section DIVING_FURTHERINFO Further information
5102 *
5103 * This is all there is to extend the SCIP set of diving heuristics by a new one. For further information, please see
5104 * diveset related functions in \ref type_heur.h, \ref pub_heur.h, \ref heuristics.h, and \ref heur_guideddiving.h or
5105 * other diving heuristics that implement diving through a diveset.
5106 */
5107
5108/*--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
5109
5110/**@page RELAX How to add relaxation handlers
5111 *
5112 * SCIP provides specific support for LP relaxations of constraint integer programs. In addition, relaxation handlers,
5113 * also called relaxators, can be used to include other relaxations, e.g. Lagrange relaxations or semidefinite
5114 * relaxations. The relaxation handler manages the necessary data structures and calls the relaxation solver to generate dual
5115 * bounds and primal solution candidates.
5116 * \n
5117 * However, the data to define a single relaxation must either be extracted by the relaxation handler itself (e.g., from
5118 * the user defined problem data, the LP information, or the integrality conditions), or it must be provided by the constraint
5119 * handlers. In the latter case, the constraint handlers have to be extended to support this specific relaxation.
5120 * \n
5121 *
5122 * We now explain how users can add their own relaxation handlers using the C interface. As an example, look into the NLP
5123 * relaxation handler of the \ref RELAXATOR_MAIN "Relaxator example" (examples/Relaxator/src/relax_nlp.c). It is very easy to
5124 * transfer the C explanation to C++: whenever a function should be implemented using the SCIP_DECL_RELAX... notion,
5125 * reimplement the corresponding virtual member method of the abstract scip::ObjRelax wrapper base class.
5126 *
5127 * Additional documentation for the callbacks of a relaxation handler can be found in the file type_relax.h.
5128 *
5129 * Here is what you have to do to implement a relaxation handler:
5130 * -# Copy the template files src/scip/relax_xyz.c and src/scip/relax_xyz.h into files named "relax_myrelaxator.c"
5131 * and "relax_myrelaxator.h".
5132 * \n
5133 * Make sure to adjust your build system such that these files are compiled and linked to your project. \n
5134 * If you are adding a new default plugin, this means updating the `src/CMakeLists.txt` and `Makefile` files in the SCIP distribution.
5135 * -# Use `SCIPincludeRelaxMyrelaxator()` in order to include the relaxation handler into your SCIP instance,
5136 * e.g., in the main file of your project (see, e.g., src/cmain.c in the Binpacking example). \n
5137 * If you are adding a new default plugin, this include function must be added to `src/scipdefplugins.c`.
5138 * -# Open the new files with a text editor and replace all occurrences of "xyz" by "myrelaxator".
5139 * -# Adjust the properties of the relaxation handler (see \ref RELAX_PROPERTIES).
5140 * -# Define the relaxation handler data (see \ref RELAX_DATA). This is optional.
5141 * -# Implement the interface functions (see \ref RELAX_INTERFACE).
5142 * -# Implement the fundamental callbacks (see \ref RELAX_FUNDAMENTALCALLBACKS).
5143 * -# Implement the additional callbacks (see \ref RELAX_ADDITIONALCALLBACKS). This is optional.
5144 *
5145 *
5146 * @section RELAX_PROPERTIES Properties of a Relaxation Handler
5147 *
5148 * At the top of the new file "relax_myrelaxator.c" you can find the relaxation handler properties,
5149 * which are given as compiler defines.
5150 * In the C++ wrapper class, you have to provide the relaxation handler properties by calling the constructor
5151 * of the abstract base class scip::ObjRelax from within your constructor.
5152 * The properties have the following meaning:
5153 *
5154 * \par RELAX_NAME: the name of the relaxation handler.
5155 * This name is used in the interactive shell to address the relaxation handler.
5156 * Additionally, if you are searching for a relaxation handler with SCIPfindRelax(), this name is looked up.
5157 * Names have to be unique: no two relaxation handlers may have the same name.
5158 *
5159 * \par RELAX_DESC: the description of the relaxation handler.
5160 * This string is printed as a description of the relaxation handler in the interactive shell.
5161 *
5162 * \par RELAX_PRIORITY: the priority of the relaxation handler.
5163 * During each relaxation solving round, the included relaxation handlers and the
5164 * price-and-cut loop for solving the LP relaxation are called in a predefined order, which is given by the priorities
5165 * of the relaxation handlers.
5166 * First, the relaxation handlers with non-negative priority are called in the order of decreasing priority.
5167 * Next, the price-and-cut loop for solving the LP relaxation is executed.
5168 * Finally, the relaxation handlers with negative priority are called in the order of decreasing priority.
5169 * \n
5170 * Usually, you will have only one relaxation handler in your application and thus only have to decide whether it should
5171 * be called before or after solving the LP relaxation. For this decision you should consider the complexity of
5172 * the relaxation solving algorithm and the impact of the resulting solution: if your relaxation handler provides a fast
5173 * algorithm that usually has a high impact (i.e. the relaxation is a good approximation of the
5174 * feasible region of the subproblem and the solution severely improves the dual bound), it should have a non-negative
5175 * priority.
5176 * \n
5177 * Note that for certain applications, it is useful to disable the LP relaxation and only use your custom relaxation.
5178 * This can easily be achieved by setting the "lp/solvefreq" parameter to -1.
5179 *
5180 * \par RELAX_FREQ: the default frequency for solving the relaxation.
5181 * The frequency defines the depth levels at which the relaxation solving function \ref RELAXEXEC is called.
5182 * For example, a frequency of 7 means, that the relaxation solving callback is executed for subproblems that are in depth
5183 * 0, 7, 14, ... of the branching tree. A frequency of 0 means that the callback is only executed at the root node, i.e.,
5184 * only the relaxation of the root problem is solved. A frequency of -1 disables the relaxation handler.
5185 *
5186 *
5187 *
5188 * @section RELAX_DATA Relaxation Handler Data
5189 *
5190 * Below the header "Data structures" you can find a struct which is called "struct SCIP_RelaxData".
5191 * In this data structure, you can store the data of your relaxation handler. For example, you should store the adjustable
5192 * parameters of the relaxation handler in this data structure.
5193 * If you are using C++, you can add relaxation handler data as usual as object variables to your class.
5194 * \n
5195 * Defining relaxation handler data is optional. You can leave the struct empty.
5196 *
5197 *
5198 * @section RELAX_INTERFACE Interface Functions
5199 *
5200 * At the bottom of "relax_myrelaxator.c", you can find the interface function SCIPincludeRelaxMyrelaxator(),
5201 * which also appears in "relax_myrelaxator.h".
5202 * SCIPincludeRelaxMyrelaxator() is called by the user, if (s)he wants to include the relaxation handler,
5203 * i.e., if (s)he wants to use the relaxation handler in his/her application.
5204 *
5205 * This function only has to be adjusted slightly.
5206 * It is responsible for notifying SCIP of the presence of the relaxation handler. For this, you can either call
5207 * SCIPincludeRelax(),
5208 * or SCIPincludeRelaxBasic() since SCIP version 3.0. In the latter variant, \ref RELAX_ADDITIONALCALLBACKS "additional callbacks"
5209 * must be added via setter functions as, e.g., SCIPsetRelaxCopy(). We recommend this latter variant because
5210 * it is more stable towards future SCIP versions which might have more callbacks, whereas source code using the first
5211 * variant must be manually adjusted with every SCIP release containing new callbacks for relaxation handlers in order to compile.
5212 *
5213 * If you are using relaxation handler data, you have to allocate the memory for the data at this point.
5214 * You can do this by calling:
5215 * \code
5216 * SCIP_CALL( SCIPallocBlockMemory(scip, &relaxdata) );
5217 * \endcode
5218 * You also have to initialize the fields in struct SCIP_RelaxData afterwards.
5219 *
5220 * You may also add user parameters for your relaxation handler, see the function SCIPincludeConshdlrKnapsack() in
5221 * the \ref cons_knapsack.h "knapsack constraint handler" for an example of how to add user parameters.
5222 *
5223 *
5224 * @section RELAX_FUNDAMENTALCALLBACKS Fundamental Callbacks of a Relaxation Handler
5225 *
5226 * The fundamental callbacks of the plugins are the ones that have to be implemented in order to obtain
5227 * an operational algorithm.
5228 * They are passed together with the relaxation handler itself to SCIP using SCIPincludeRelax() or SCIPincludeRelaxBasic(),
5229 * see @ref RELAX_INTERFACE.
5230 *
5231 *
5232 * Relaxation handler plugins have only one fundamental callback, namely the \ref RELAXEXEC function.
5233 * This function has to be implemented for every relaxation handler; the other callbacks are optional.
5234 * In the C++ wrapper class scip::ObjRelax, the scip_exec() method (which corresponds to the \ref RELAXEXEC callback) is a virtual
5235 * abstract member function.
5236 * You have to implement it in order to be able to construct an object of your relaxation handler class.
5237 *
5238 * Additional documentation for the callbacks can be found in type_relax.h.
5239 *
5240 * @subsection RELAXEXEC
5241 * The RELAXEXEC is called in each relaxation solving round. It should solve the current
5242 * subproblem's relaxation.
5243 *
5244 * Note that, like the LP relaxation, the relaxation handler should only operate on variables for which the corresponding
5245 * column exists in the transformed problem. Typical functions called by a relaxation handler are SCIPconstructLP() and SCIPflushLP() to
5246 * make sure that the LP of the current node is constructed and its data can be accessed via calls to SCIPgetLPRowsData()
5247 * and SCIPgetLPColsData(), and SCIPseparateSol() to call the cutting plane separators for a given primal solution.
5248 *
5249 * The lowerbound computed by the relaxation should be returned in the lowerbound pointer. If the relaxation improves on the best
5250 * relaxation already computed (either <code>SCIPisRelaxSolValid()</code> returns FALSE, meaning that no relaxation solution
5251 * is available so far, or the lowerbound is larger than the value returned by <code>SCIPgetRelaxSolObj()</code>), then the primal
5252 * solution of the relaxation should be stored inside the data structures of SCIP with <code>SCIPsetRelaxSolVal()</code>,
5253 * <code>SCIPsetRelaxSolVals()</code> or <code>SCIPsetRelaxSolValsSol()</code>. If you set the values one by one, you will need to call
5254 * <code>SCIPmarkRelaxSolValid()</code> to inform SCIP that the solution is complete and valid. With the "includeslp" argument of
5255 * <code>SCIPsetRelaxSolVals()</code>, <code>SCIPsetRelaxSolValsSol()</code> and <code>SCIPmarkRelaxSolValid()</code> you need to tell SCIP
5256 * whether the relaxation included all lp rows. In this case, the solution will be enforced and, if feasible, added to the solution storage if the
5257 * lowerbound of this relaxator is larger than the LP's. You may also call SCIPtrySolFree() directly from the
5258 * relaxation handler to make sure that a solution is added to the solution storage if it is feasible, even if the relaxator does not
5259 * include the LP or another relaxator produced a stronger bound. Also note that when setting the values of the relaxation solution one by one,
5260 * the objective value of the relaxation solution will be updated incrementally. If the whole solution should be updated, using SCIPsetRelaxSolVals()
5261 * instead or calling SCIPclearRelaxSolVals() before setting the first value to reset the solution and the objective value to 0 may help the numerics.
5262 * Furthermore, there is a list of external branching candidates, that can be filled by relaxation handlers and constraint handlers,
5263 * allowing branching rules to take these candidates as a guide on how to split the problem into subproblems. If the relaxation
5264 * solution is enforced, the integrality constraint handler will add external branching candidates for the relaxation solution
5265 * automatically, but the relaxation handler can also directly call <code>SCIPaddExternBranchCand()</code>.
5266 *
5267 * Usually, the RELAXEXEC callback only solves the relaxation and provides a lower (dual) bound through the corresponding pointer and
5268 * possibly a solution through <code>SCIPsetRelaxSolVal()</code> calls.
5269 * However, it may also produce domain reductions, add additional constraints or generate cutting planes. It has the
5270 * following options:
5271 * - detecting that the node is infeasible in the variable's bounds and can be cut off (result SCIP_CUTOFF)
5272 * - adding an additional constraint and stating that the relaxation handler should not be called again on the same
5273 * relaxation (result SCIP_CONSADDED)
5274 * - reducing a variable's domain and stating that the relaxation handler should not be called again on the same
5275 * relaxation (result SCIP_REDUCEDDOM)
5276 * - adding a cutting plane to the LP and stating that the relaxation handler should not be called again on the same
5277 * relaxation (result SCIP_SEPARATED)
5278 * - stating that the relaxation handler solved the relaxation and should not be called again on the same relaxation
5279 * (result SCIP_SUCCESS)
5280 * - interrupting the solving process to wait for additional input, e.g., cutting planes (result SCIP_SUSPENDED)
5281 * - stating that the separator was skipped (result SCIP_DIDNOTRUN).
5282 *
5283 * In the above criteria, "the same relaxation" means that the LP relaxation stayed unmodified. This means in particular
5284 * that no row has been added and no bounds have been modified. For example, changing the bounds of a variable will, as
5285 * long as it was a COLUMN variable, lead to a modification in the LP such that the relaxation handler is called again
5286 * after it returned with the result code SCIP_REDUCEDDOM. If the relaxation solution should be enforced, the relaxation
5287 * handler has to produce a new solution in this case which satisfies the updated LP. If a relaxation handler should only run
5288 * once per node to compute a lower bound, it should store the node of the last relaxation call itself and return
5289 * SCIP_DIDNOTRUN for subsequent calls in the same node.
5290 *
5291 *
5292 * @section RELAX_ADDITIONALCALLBACKS Additional Callbacks of a Relaxation Handler
5293 *
5294 * The additional callbacks do not need to be implemented in every case. However, some of them have to be
5295 * implemented for most applications, they can be used, for example, to initialize and free private data.
5296 * Additional callbacks can either be passed directly with SCIPincludeRelax() to SCIP or via specific
5297 * <b>setter functions</b> after a call of SCIPincludeRelaxBasic(), see also @ref RELAX_INTERFACE.
5298 *
5299 * @subsection RELAXFREE
5300 *
5301 * If you are using relaxation handler data, you have to implement this function in order to free the relaxation handler
5302 * data. This can be done by the following procedure:
5303 *
5304 * @refsnippet{tests/src/relax/relax.c,SnippetRelaxFreeUnittest}
5305 *
5306 * If you have allocated memory for fields in your relaxation handler data, remember to free this memory
5307 * before freeing the relaxation handler data itself.
5308 * If you are using the C++ wrapper class, this function is not available.
5309 * Instead, just use the destructor of your class to free the member variables of your class.
5310 *
5311 * @subsection RELAXINIT
5312 *
5313 * The RELAXINIT callback is executed after the problem is transformed.
5314 * The relaxation handler may, e.g., use this call to initialize its relaxation handler data.
5315 *
5316 * @subsection RELAXCOPY
5317 *
5318 * The RELAXCOPY callback is executed when a SCIP instance is copied, e.g. to
5319 * solve a sub-SCIP. By
5320 * defining this callback as
5321 * <code>NULL</code> the user disables the execution of the specified
5322 * relaxation handler for all copied SCIP instances. This may deteriorate the performance
5323 * of primal heuristics using sub-SCIPs.
5324 *
5325 * @subsection RELAXEXIT
5326 *
5327 * The RELAXEXIT callback is executed before the transformed problem is freed.
5328 * In this function, the relaxation handler should free all resources that have been allocated for the solving process in
5329 * RELAXINIT.
5330 *
5331 * @subsection RELAXINITSOL
5332 *
5333 * The RELAXINITSOL callback is executed when the presolving is finished and the branch-and-bound process is about to
5334 * begin. The relaxation handler may use this call to initialize its branch-and-bound specific data.
5335 *
5336 * @subsection REALXEXITSOL
5337 *
5338 * The RELAXEXITSOL callback is executed before the branch-and-bound process is freed.
5339 * The relaxation handler should use this call to clean up its branch-and-bound data.
5340 */
5341
5342/*--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
5343
5344/**@page READER How to add file readers
5345 *
5346 * Mainly, file readers are called to parse an input file and generate a constraint integer programming model. They
5347 * create constraints and variables and activate variable pricers if necessary. However, they can also be called, for
5348 * example, to parse an input file containing information about a primal solution or fixing of variables. Besides that
5349 * it is possible to use some of them for writing (exporting) the problem in a specific format. \n A complete list of
5350 * all file readers contained in this release can be found \ref FILEREADERS "here".
5351 *
5352 * Since a file reader is also responsible for writing a file, the user may
5353 * ask why the readers have not the name "filehandler". This name would
5354 * represent this plugin much better than the used one.
5355 * \n
5356 * The used name "readers" is historically grown. In the beginning of SCIP
5357 * there was no need to write/export problems. Therefore, the the plugin
5358 * name "readers" was best fitting for this plugin since only reading was essential.
5359 * It turned out, however, that it is quite nice to write/export certain subproblem during
5360 * the solving process mainly for debugging. Therefore, a writing callback
5361 * was added to the "readers" plugin.
5362 *
5363 * We now explain how users can add their own file readers.
5364 * Take the file reader for MIPs in IBM's Mathematical Programming System format (src/scip/reader_mps.c) as an example.
5365 * As all other default plugins, it is written in C. C++ users can easily adapt the code by using the scip::ObjReader wrapper
5366 * base class and implement the scip_...() virtual methods instead of the SCIP_DECL_READER... callbacks.
5367 *
5368 * Additional documentation for the callbacks of a file reader can be found in the file type_reader.h.
5369 *
5370 * Here is what you have to do to implement a file reader named "myreader" in C:
5371 * -# Copy the template files src/scip/reader_xyz.c and src/scip/reader_xyz.h into files named
5372 * "reader_myreader.c" and "reader_myreader.h".
5373 * \n
5374 * Make sure to adjust your build system such that these files are compiled and linked to your project. \n
5375 * If you are adding a new default plugin, this means updating the `src/CMakeLists.txt` and `Makefile` files in the SCIP distribution.
5376 * -# Use `SCIPincludeReaderMyreader()` in order to include the reader into your SCIP instance,
5377 * e.g., in the main file of your project (see, e.g., src/cmain.c in the Binpacking example). \n
5378 * If you are adding a new default plugin, this include function must be added to `src/scipdefplugins.c`.
5379 * -# Open the new files with a text editor and replace all occurrences of "xyz" by "myreader".
5380 * -# Adjust the \ref READER_PROPERTIES "properties of the file reader".
5381 * -# Define the \ref READER_DATA "file reader data". This is optional.
5382 * -# Implement the \ref READER_INTERFACE "interface functions".
5383 * -# Implement the \ref READER_FUNDAMENTALCALLBACKS "fundamental callbacks".
5384 * -# Implement the \ref READER_ADDITIONALCALLBACKS "additional callbacks". This is optional.
5385 *
5386 *
5387 * @section READER_PROPERTIES Properties of a File Reader
5388 *
5389 * At the top of the new file "reader_myreader.c" you can find the file reader properties.
5390 * These are given as compiler defines.
5391 * In the C++ wrapper class, you have to provide the file reader properties by calling the constructor
5392 * of the abstract base class scip::ObjReader from within your constructor.
5393 * The properties you have to set have the following meaning:
5394 *
5395 * \par READER_NAME: the name of the file reader.
5396 * This name is used in the interactive shell to address the file reader.
5397 * Additionally, if you are searching for a file reader with SCIPfindReader(), this name is looked up.
5398 * Names have to be unique: no two file readers may have the same name.
5399 *
5400 * \par READER_DESC: the description of the file reader.
5401 * This string is printed as a description of the file reader in the interactive shell.
5402 *
5403 * \par READER_EXTENSION: the file name extension of the file reader.
5404 * Each file reader is hooked to a single file name extension. It is automatically called if the user wants to read in a
5405 * file of corresponding name. The extensions of the different file readers have to be unique.
5406 * Note that the additional extension '.gz', '.z', or '.Z' (indicating a gzip compressed file) are ignored for assigning
5407 * an input file to a reader.
5408 * \n
5409 * It is not possible to hook up a (single) file reader with more than one file extension.
5410 * It is, however, not necessary to implement the same (parsing/writing) functions more than once, if you want to
5411 * support several file extension with the same parser. To do so look at the files reader_lp.c
5412 * and reader_rlp.c. Both support the LP format.
5413 *
5414 *
5415 * @section READER_DATA File Reader Data
5416 *
5417 * Below the header "Data structures" you can find a struct which is called "struct SCIP_ReaderData".
5418 * In this data structure, you can store the data of your file reader. For example, you should store the adjustable
5419 * parameters of the file reader in this data structure.
5420 * If you are using C++, you can add file reader data as usual as object variables to your class.
5421 * \n
5422 * Defining file reader data is optional. You can leave the struct empty.
5423 *
5424 *
5425 * @section READER_INTERFACE Interface Functions
5426 *
5427 * At the bottom of "reader_myreader.c", you can find the interface function SCIPincludeReaderMyreader(),
5428 * which also appears in "reader_myreader.h".
5429 * SCIPincludeReaderMyreader() is called by the user, if (s)he wants to include the reader,
5430 * i.e., if (s)he wants to use the reader in his/her application.
5431 *
5432 * This function only has to be adjusted slightly.
5433 * It is responsible for notifying SCIP of the presence of the reader. For this, you can either call
5434 * SCIPincludeReader(),
5435 * or SCIPincludeReaderBasic() since SCIP version 3.0. In the latter variant, \ref READER_ADDITIONALCALLBACKS "additional callbacks"
5436 * must be added via setter functions as, e.g., SCIPsetReaderCopy(). We recommend this latter variant because
5437 * it is more stable towards future SCIP versions which might have more callbacks, whereas source code using the first
5438 * variant must be manually adjusted with every SCIP release containing new callbacks for readers in order to compile.
5439 *
5440 * If you are using file reader data, you have to allocate the memory for the data at this point.
5441 * You can do this by calling:
5442 * \code
5443 * SCIP_CALL( SCIPallocBlockMemory(scip, &readerdata) );
5444 * \endcode
5445 * You also have to initialize the fields in struct SCIP_ReaderData afterwards.
5446 *
5447 * You may also add user parameters for your file reader, see the function SCIPincludeReaderLp() in
5448 * src/scip/reader_lp.c for an example.
5449 *
5450 *
5451 * @section READER_FUNDAMENTALCALLBACKS Fundamental Callbacks of a File Reader
5452 *
5453 * File reader plugins have no fundamental callbacks. This is due to
5454 * the fact that a file reader can be used for reading and/or writing a
5455 * file. A file reader is only useful if the reader function \ref READERREAD
5456 * and/or the writing function \ref READERWRITE is implemented. One of these
5457 * functions should be implemented for every file reader; the other callback
5458 * functions \ref READERCOPY and \ref READERFREE are optional. In the C++ wrapper class scip::ObjReader, the
5459 * scip_read() and scip_write() methods (which corresponds to the \ref
5460 * READERREAD and \ref READERWRITE callback) are virtual member
5461 * functions. At least one of them should be implemented.
5462 *
5463 * Additional documentation for the callbacks can be found in type_reader.h.
5464 *
5465 *
5466 * @section READER_ADDITIONALCALLBACKS Additional Callbacks of a File Reader
5467 *
5468 * Additional callbacks can either be passed directly with SCIPincludeReader() to SCIP or via specific
5469 * <b>setter functions</b> after a call of SCIPincludeReaderBasic(), see also @ref READER_INTERFACE.
5470 *
5471 *
5472 * File reader plugins contain only additional callbacks, namely the functions \ref READERREAD,
5473 * \ref READERWRITE, \ref READERFREE, and \ref READERCOPY. Therefore, these are not needed to be implemented. However,
5474 * at least \ref READERREAD and/or \ref READERWRITE should be implemented (see notes
5475 * \ref READER_FUNDAMENTALCALLBACKS "above").
5476 *
5477 *
5478 * @subsection READERREAD
5479 *
5480 * The READERREAD callback is called when the user invokes SCIP to read in a file with file name extension
5481 * corresponding to the READER_EXTENSION property of the file reader. This is usually triggered by a call to the function
5482 * SCIPreadProb() or by an interactive shell command.
5483 * The READERREAD callback should parse the input file and perform the desired action, which usually means
5484 * generating a constraint integer programming model, adding a primal solution, fixing variables
5485 * in an existing model.
5486 * \n
5487 * Typical functions called by a file reader that is used to read/generate constraint
5488 * integer programming models are, for example,
5489 *
5490 * - creating an empty problem: SCIPcreateProb()
5491 * - creating the variables: SCIPcreateVar(), SCIPchgVarType(), SCIPchgVarLb(), SCIPchgVarUb(), SCIPaddVar(), and
5492 * SCIPreleaseVar()
5493 * - modifying the objective function: SCIPchgVarObj() and SCIPsetObjsense().
5494 * - creating the constraints: SCIPcreateConsLinear(), SCIPaddCoefLinear(), SCIPchgLhsLinear(), SCIPchgRhsLinear(),
5495 * SCIPaddCons(), and SCIPreleaseCons()
5496 *
5497 * Primal solutions can only be created for the transformed problem. Therefore, the user has to call SCIPtransformProb()
5498 * before (s)he reads in the file containing the solution and adds it to the solution pool via the function SCIPreadSol().
5499 *
5500 *
5501 * @subsection READERWRITE
5502 *
5503 * The READERWRITE callback is called when the user invokes SCIP to write a problem (original or transformed)
5504 * in the format the reader supports. This is only possible if this callback is implemented. To write the problem
5505 * all necessary information is given through the parameters of this callback (see type_reader.h). This
5506 * information should be used to output the problem in the requested format. This callback is usually
5507 * triggered by the call of the functions SCIPwriteOrigProblem(), SCIPwriteTransProblem(), SCIPprintOrigProblem(),
5508 * or SCIPprintTransProblem().
5509 * \n
5510 * A typical function called by a file reader which is used to write/export a constraint
5511 * integer programming model is SCIPinfoMessage(). This function outputs a given string into a file
5512 * or into stdout.
5513 * \n
5514 * For an example we refer to the writing function of the MPS reader (see reader_mps.c).
5515 *
5516 *
5517 * @subsection READERCOPY
5518 *
5519 * The READERCOPY callback is executed when a SCIP instance is copied, e.g. to solve a sub-SCIP. By defining this
5520 * callback as <code>NULL</code> the user disables the execution of the specified reader for all copied SCIP
5521 * instances. The question might arise why to copy that plugin. In case of debugging it is nice to be able to
5522 * write/display the copied instances. Since the reader is in charge of that, you might want to copy the plugin. Below
5523 * you see a standard implementation.
5524 *
5525 * @refsnippet{src/scip/reader_mps.c,SnippetReaderCopyMps}
5526 *
5527 * @subsection READERFREE
5528 *
5529 * If you are using file reader data, you have to implement this function in order to free the file reader data.
5530 * This can be done by the following procedure:
5531 *
5532 * @refsnippet{src/scip/reader_mps.c,SnippetReaderFreeMps}
5533 *
5534 * If you have allocated memory for fields in your file reader data, remember to free this memory
5535 * before freeing the file reader data itself.
5536 * If you are using the C++ wrapper class, this function is not available.
5537 * Instead, just use the destructor of your class to free the member variables of your class.
5538 *
5539 */
5540
5541/*--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
5542
5543/**@page DIALOG How to add dialogs
5544 *
5545 * SCIP comes with a command line shell which allows the user to read in problem instances, modify the solver's
5546 * parameters, initiate the optimization and display certain statistics and solution information. This shell consists
5547 * of dialogs, which are organized as a tree in SCIP. A node of this tree which is not a leaf represents a menu in
5548 * the shell and the children of this node correspond to the entries of this menu (which can again be menus). All
5549 * different dialogs are managed by a dialog handler, which, in particular, is responsible for executing the dialog
5550 * corresponding to the user's command in the shell. The concept of a dialog handler is different to that
5551 * of a constraint handler, which is used to manage objects of the same structure, see \ref CONS. In particular, SCIP
5552 * features only one dialog handler (dialog_default.h), whereas there may exist different constraint handlers.
5553 * \n
5554 * A complete list of all dialogs contained in this release can be found \ref DIALOGS "here".
5555 *
5556 * We now explain how users can extend the interactive shell by adding their own dialog.
5557 * We give the explanation for creating your own source file for each additional dialog. Of course, you can collect
5558 * different dialogs in one source file. Take src/scip/dialog_default.c, where all default dialog plugins are collected, as an
5559 * example.
5560 * As all other default plugins, the default dialog plugin and the template dialog are written in C. C++ users can easily
5561 * adapt the code by using the scip::ObjDialog wrapper base class and implement the scip_...() virtual methods instead of the
5562 * SCIP_DECL_DIALOG... callbacks.
5563 *
5564 * Additional documentation for the callbacks of a dialog can be found in the file type_dialog.h.
5565 *
5566 * Here is what you have to do to add a dialog (assuming your dialog is named "mydialog"):
5567 * -# Copy the template files src/scip/dialog_xyz.c and src/scip/dialog_xyz.h into files named "dialog_mydialog.c"
5568 * and "dialog_mydialog.h".
5569 * \n
5570 * Make sure to adjust your build system such that these files are compiled and linked to your project. \n
5571 * If you are adding a new default plugin, this means updating the `src/CMakeLists.txt` and `Makefile` files in the SCIP distribution.
5572 * -# Use `SCIPincludeDialogMydialog()` in order to include the dialog handler into your SCIP instance,
5573 * e.g., in the main file of your project (see, e.g., src/cmain.c in the Binpacking example). \n
5574 * If you are adding a new default plugin, this include function must be added to `src/scipdefplugins.c`.
5575 * -# Open the new files with a text editor and replace all occurrences of "xyz" by "mydialog".
5576 * -# Adjust the \ref DIALOG_PROPERTIES "properties of the dialog".
5577 * -# Define the \ref DIALOG_DATA "dialog data". This is optional.
5578 * -# Implement the \ref DIALOG_INTERFACE "interface functions".
5579 * -# Implement the \ref DIALOG_FUNDAMENTALCALLBACKS "fundamental callbacks".
5580 * -# Implement the \ref DIALOG_ADDITIONALCALLBACKS "additional callbacks". This is optional.
5581 *
5582 *
5583 * @section DIALOG_PROPERTIES Properties of a Dialog
5584 *
5585 * At the top of the new file "dialog_mydialog.c" you can find the dialog properties.
5586 * These are given as compiler defines.
5587 * In the C++ wrapper class, you have to provide the dialog properties by calling the constructor
5588 * of the abstract base class scip::ObjDialog from within your constructor.
5589 * The properties you have to set have the following meaning:
5590 *
5591 * \par DIALOG_NAME: the name of the dialog.
5592 * In the interactive shell, this name appears as the command name of the dialog in the parent dialog.
5593 * Additionally, if you are searching an entry in a menu with SCIPdialogFindEntry(), this name is looked up.
5594 * Names within one menu have to be unique: no two dialogs in the same menu may have the same name.
5595 *
5596 * \par DIALOG_DESC: the description of the dialog.
5597 * This string is printed as a description of the dialog in the interactive shell if the additional
5598 * callback \ref DIALOGDESC is not implemented.
5599 *
5600 * \par DIALOG_ISSUBMENU: whether the dialog is a (sub)menu.
5601 * This parameter states whether the dialog is a menu in the interactive shell, i.e., is the parent of further
5602 * dialogs.
5603 *
5604 *
5605 * @section DIALOG_DATA Dialog Data
5606 *
5607 * Below the header "Data structures" you can find a struct which is called "struct SCIP_DialogData".
5608 * In this data structure, you can store the data of your dialog.
5609 * If you are using C++, you can add dialog data as usual as object variables to your class.
5610 * \n
5611 * Defining dialog data is optional. You can leave the struct empty.
5612 *
5613 *
5614 * @section DIALOG_INTERFACE Interface Functions
5615 *
5616 * At the bottom of "dialog_mydialog.c" you can find the interface function SCIPincludeDialogMydialog(), which also appears
5617 * in "dialog_mydialog.h".
5618 * \n
5619 * This function only has to be adjusted slightly.
5620 * It is responsible for notifying SCIP of the presence of the dialog, which can be done by the following lines of code:
5621 *
5622 * @refsnippet{src/scip/dialog_xyz.c,SnippetDialogAddXyz}
5623 *
5624 * Here "parentdialog" has to be an existing dialog which is defined to be a menu (see DIALOG_ISSUBMENU), e.g.,
5625 * the default root dialog. The function SCIPgetRootDialog() returns the root dialog.
5626 *
5627 * The interface function is called by the user, if (s)he wants to include the dialog, i.e., if (s)he wants to use the dialog in
5628 * his/her application.
5629 * Note that in order to be able to link the new dialog to an existing default dialog
5630 * (except the root dialog) it has to be included <b>after the
5631 * default dialogs plugin</b>, i.e., the SCIPincludeDialogMydialog() call has to occur after the
5632 * SCIPincludeDialogDefault() call. The SCIPincludeDialogDefault() function is called from within the SCIPincludeDefaultPlugins()
5633 * function. Therefore, it suffices to include your dialog plugins after you have called SCIPincludeDefaultPlugins().
5634 * In case you want to add a dialog to the <b>root dialog</b>, you just use the following
5635 * lines of code to get/create the root dialog.
5636 *
5637 * @refsnippet{tests/src/misc/snippets.c,SnippetDialogCreate}
5638 *
5639 * Therefore, in this case you do not have to worry about the calls of
5640 * SCIPincludeDialogDefault() and SCIPincludeDefaultPlugins() .
5641 *
5642 * If you are using dialog data, you have to allocate the memory for the data at this point.
5643 * You can do this by calling:
5644 * \code
5645 * SCIP_CALL( SCIPallocBlockMemory(scip, &dialogdata) );
5646 * \endcode
5647 * You also have to initialize the fields in struct SCIP_DialogData afterwards.
5648 *
5649 * Consider the following example. The user wants to add a "drawgraph" command to the root menu of SCIP.
5650 * (S)he copies the "dialog_xyz.c" and "dialog_xyz.h" files into files "dialog_drawgraph.c" and "dialog_drawgraph.h", respectively.
5651 * Then, (s)he puts the following code into the SCIPincludeDialogDrawgraph() function, compare SCIPincludeDialogDefault() in
5652 * src/scip/dialog_default.c:
5653 * @refsnippet{tests/src/misc/snippets.c,SnippetDialogInclude}
5654 *
5655 * Using this code, it is even possible to call SCIPincludeDialogDrawgraph() before including the default dialog plugins,
5656 * and you can also call it multiple times without causing inconsistencies in the dialog structure.
5657 *
5658 *
5659 * @section DIALOG_FUNDAMENTALCALLBACKS Fundamental Callbacks of a Dialog
5660 *
5661 * Dialogs have only one fundamental callback, namely the \ref DIALOGEXEC function.
5662 * This function has to be implemented for every dialog; the other callbacks are optional.
5663 * In the C++ wrapper class scip::ObjDialog, the scip_exec() method (which corresponds to the \ref DIALOGEXEC callback) is a virtual
5664 * abstract member function.
5665 * You have to implement it in order to be able to construct an object of your dialog class.
5666 *
5667 * Additional documentation for the callbacks can be found in type_dialog.h.
5668 *
5669 * @subsection DIALOGEXEC
5670 *
5671 * The DIALOGEXEC function is invoked, if the user selected the dialog's command name in the parent's menu. It should
5672 * execute what is stated in DIALOG_DESC, e.g., the display constraint handlers dialog should display information about
5673 * the constraint handlers included in SCIP, see src/scip/dialog_default.c.
5674 *
5675 * For typical functions called by the execution function, have a look at src/scip/dialog_default.c.
5676 *
5677 * The callback has to return which dialog should be processed next. This can be, for example, the root dialog
5678 * (SCIPdialoghdlrGetRoot()), the parent dialog (SCIPdialogGetParent()) or NULL, which stands for closing the interactive
5679 * shell.
5680 *
5681 *
5682 * @section DIALOG_ADDITIONALCALLBACKS Additional Callbacks of a Dialog
5683 *
5684 * The additional callbacks do not need to be implemented in every case.
5685 * They can be used, for example, to free private data.
5686 *
5687 * @subsection DIALOGFREE
5688 *
5689 * If you are using dialog data, you have to implement this function in order to free the dialog data.
5690 * This can be done by the following procedure:
5691 * @refsnippet{tests/src/misc/snippets.c,SnippetDialogFree}
5692 *
5693 * If you have allocated memory for fields in your dialog data, remember to free this memory
5694 * before freeing the dialog data itself.
5695 * If you are using the C++ wrapper class, this function is not available.
5696 * Instead, just use the destructor of your class to free the member variables of your class.
5697 *
5698 * @subsection DIALOGDESC
5699 *
5700 * This function is called when the help menu of the parent is displayed. It should output (usually a single line of)
5701 * information describing the meaning of the dialog.
5702 * \n
5703 * If this callback is not implemented, the description string of the dialog (DIALOG_DESC) is displayed instead.
5704 *
5705 * @subsection DIALOGCOPY
5706 *
5707 * The DIALOGCOPY callback is executed when a SCIP instance is copied, e.g. to solve a sub-SCIP. By defining this
5708 * callback as <code>NULL</code> the user disables the execution of this dialog for all copied SCIP instances. In
5709 * general there is no need to copy any dialog since it is most unlikely to start the interactive shell of the copied
5710 * instances.
5711 *
5712 */
5713
5714/*--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
5715
5716/**@page DISP How to add display columns
5717 *
5718 * While solving a constraint integer program, SCIP displays status information in a column-like fashion. The current
5719 * number of processed branching tree nodes, the solving time, and the relative gap between primal and dual bound are
5720 * examples of such display columns. There already exists a wide variety of display columns which can be activated or
5721 * deactivated on demand, see src/scip/disp_default.c. Additionally, the user can implement his/her own display columns
5722 * in order to track problem or algorithm specific values.
5723 * \n
5724 * A complete list of all displays contained in this release can be found \ref DISPLAYS "here".
5725 *
5726 * We now explain how users can add their own display columns.
5727 * We give the explanation for creating your own source file for each additional display column. Of course, you can collect
5728 * different additional display columns in one source file.
5729 * Take src/scip/disp_default.c, where all default display columns are collected, as an example.
5730 * As all other default plugins, the default display column plugins and the display column template are written in C.
5731 * C++ users can easily adapt the code by using the scip::ObjDisp wrapper base class and implement the scip_...() virtual methods
5732 * instead of the SCIP_DECL_DISP... callbacks.
5733 *
5734 *
5735 * Additional documentation for the callbacks of a display column can be found in the file type_disp.h.
5736 *
5737 * Here is what you have to do to implement a display column (assuming your display column is named "mydisplaycolumn"):
5738 * -# Copy the template files src/scip/disp_xyz.c and src/scip/disp_xyz.h into files named "disp_mydisplaycolumn.c"
5739 * and "disp_mydisplaycolumn.h".
5740 \n
5741 * Make sure to adjust your build system such that these files are compiled and linked to your project. \n
5742 * If you are adding a new default plugin, this means updating the `src/CMakeLists.txt` and `Makefile` files in the SCIP distribution.
5743 * -# Use `SCIPincludeDispMydisplaycolumn()` in order to include the display column into your SCIP instance,
5744 * e.g., in the main file of your project (see, e.g., src/cmain.c in the Binpacking example). \n
5745 * If you are adding a new default plugin, this include function must be added to `src/scipdefplugins.c`.
5746 * -# Open the new files with a text editor and replace all occurrences of "xyz" by "mydisplaycolumn".
5747 * -# Adjust the \ref DISP_PROPERTIES "properties of the display column".
5748 * -# Define the \ref DISP_DATA "display column data". This is optional.
5749 * -# Implement the \ref DISP_INTERFACE "interface functions".
5750 * -# Implement the \ref DISP_FUNDAMENTALCALLBACKS "fundamental callbacks".
5751 * -# Implement the \ref DISP_ADDITIONALCALLBACKS "additional callbacks". This is optional.
5752 *
5753 *
5754 * @section DISP_PROPERTIES Properties of a Display Column
5755 *
5756 * At the top of the new file "disp_mydisplaycolumn.c" you can find the display column properties.
5757 * These are given as compiler defines.
5758 * In the C++ wrapper class, you have to provide the display column properties by calling the constructor
5759 * of the abstract base class scip::ObjDisp from within your constructor.
5760 * The properties you have to set have the following meaning:
5761 *
5762 * \par DISP_NAME: the name of the display column.
5763 * This name is used in the interactive shell to address the display column.
5764 * Additionally, if you are searching for a display column with SCIPfindDisp(), this name is looked up.
5765 * Names have to be unique: no two display columns may have the same name.
5766 *
5767 * \par DISP_DESC: the description of the display column.
5768 * This string is printed as a description of the display column in the interactive shell.
5769 *
5770 * \par DISP_HEADER: the header of the display column.
5771 * This string is printed as the header of the display column in the status information display.
5772 *
5773 * \par DISP_WIDTH: the width of the display column.
5774 * This parameter defines the width (number of characters) of the display column. The value of the parameter has to be
5775 * greater than or equal to the number of characters in the header string.
5776 *
5777 * \par DISP_PRIORITY: the priority of the display column.
5778 * The total width of status information lines is bounded by the parameter "display width". The display columns actually contained
5779 * in the status information display are selected in decreasing order of their priority. Furthermore, the user can force
5780 * columns to be displayed or not to be displayed in the status information display. For that, (s)he has to switch the value
5781 * of the display column's parameter "active" from "auto" (its default value) to "on" or "off", respectively.
5782 *
5783 * \par DISP_POSITION: the relative position of the display column.
5784 * In the status information display, the display columns are arranged from left to right in increasing order of their
5785 * relative position.
5786 *
5787 * \par DISP_STRIPLINE: the default for whether the display column should be separated with a line from its right neighbor.
5788 * This parameter states whether the display column should be separated with the string "|" from its right neighbor. In so
5789 * doing, the clearness of the status information display may improve.
5790 *
5791 * @section DISP_DATA Display Column Data
5792 *
5793 * Below the header "Data structures" you can find a struct which is called "struct SCIP_DispData".
5794 * In this data structure, you can store the data of your display column. For example, you should store the adjustable
5795 * parameters of the display column in this data structure.
5796 * If you are using C++, you can add display column data as usual as object variables to your class.
5797 * \n
5798 * Defining display column data is optional. You can leave the struct empty.
5799 *
5800 *
5801 * @section DISP_INTERFACE Interface Functions
5802 *
5803 * At the bottom of "disp_mydisplaycolumn.c" you can find the interface function SCIPincludeDispMydisplaycolumn(), which also
5804 * appears in "disp_mydisplaycolumn.h".
5805 * \n
5806 * This function only has to be adjusted slightly.
5807 * It is responsible for notifying SCIP of the presence of the display column by calling the function
5808 * SCIPincludeDisp().
5809 *
5810 * The interface function is called by the user, if (s)he wants to include the display column, i.e., if (s)he wants to use the display column in his
5811 * application.
5812 *
5813 * If you are using display column data, you have to allocate the memory for the data at this point.
5814 * You can do this by calling:
5815 * \code
5816 * SCIP_CALL( SCIPallocBlockMemory(scip, &dispdata) );
5817 * \endcode
5818 * You also have to initialize the fields in struct SCIP_DispData afterwards.
5819 *
5820 * Although this is very uncommon, you may also add user parameters for your display column, see the function
5821 * SCIPincludeConshdlrKnapsack() in the \ref cons_knapsack.h "knapsack constraint handler" for an example.
5822 *
5823 *
5824 * @section DISP_FUNDAMENTALCALLBACKS Fundamental Callbacks of a Display Column
5825 *
5826 * Display column plugins have only one fundamental callback, namely the \ref DISPOUTPUT function.
5827 * This function has to be implemented for every display column; the other callbacks are optional.
5828 * In the C++ wrapper class scip::ObjDisp, the scip_output() method (which corresponds to the \ref DISPOUTPUT callback) is a virtual
5829 * abstract member function.
5830 * You have to implement it in order to be able to construct an object of your display column class.
5831 *
5832 * Additional documentation for the callbacks can be found in type_disp.h.
5833 *
5834 * @subsection DISPOUTPUT
5835 *
5836 * The DISPOUTPUT callback is called after each pricing loop during node processing and after a node has been processed.
5837 * In addition, at the root node, the callback is executed after each iteration of the price-and-cut loop.
5838 * It should write the display column information for the current node to a given output file stream.
5839 *
5840 * Typical functions called by a display column are, for example, SCIPdispLongint(), SCIPdispInt(), SCIPdispTime(), and
5841 * SCIPinfoMessage().
5842 *
5843 *
5844 * @section DISP_ADDITIONALCALLBACKS Additional Callbacks of a Display Column
5845 *
5846 * The additional callbacks do not need to be implemented in every case.
5847 * They can be used, for example, to initialize and free private data.
5848 *
5849 * @subsection DISPCOPY
5850 *
5851 * The DISPCOPY callback is executed when a SCIP instance is copied, e.g. to solve a sub-SCIP. By defining this callback
5852 * as <code>NULL</code> the user disables the execution of the specified column. In general it is probably not needed to
5853 * implement that callback since the output of the copied instance is usually suppressed. In the other case or for
5854 * debugging the callback should be implement.
5855 *
5856 *
5857 * @subsection DISPFREE
5858 *
5859 * If you are using display column data, you have to implement this function in order to free the display column data.
5860 * This can be done by the following procedure:
5861 * @refsnippet{tests/src/misc/snippets.c,SnippetDispFree}
5862 *
5863 * If you have allocated memory for fields in your display column data, remember to free this memory
5864 * before freeing the display column data itself.
5865 * If you are using the C++ wrapper class, this function is not available.
5866 * Instead, just use the destructor of your class to free the member variables of your class.
5867 *
5868 * @subsection DISPINIT
5869 *
5870 * The DISPINIT callback is executed after the problem is transformed.
5871 * The display column may, e.g., use this call to initialize its display column data.
5872 *
5873 * @subsection DISPEXIT
5874 *
5875 * The DISPEXIT callback is executed before the transformed problem is freed.
5876 * In this function, the display column should free all resources that have been allocated for the solving process in
5877 * \ref DISPINIT.
5878 *
5879 * @subsection DISPINITSOL
5880 *
5881 * The DISPINITSOL callback is executed when the presolving is finished and the branch-and-bound process is about to
5882 * begin. The display column may use this call to initialize its branch-and-bound specific data.
5883 *
5884 * @subsection DISPEXITSOL
5885 *
5886 * The DISPEXITSOL callback is executed before the branch-and-bound process is freed. The display column should use this
5887 * call to clean up its branch-and-bound specific data.
5888 */
5889
5890/*--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
5891
5892/**@page EVENT How to add event handler
5893 *
5894 * While solving a constraint integer program, SCIP drops thousands of events such as SCIP_EVENTTYPE_VARFIXED (a
5895 * complete list of all events is given in type_event.h). These events can be caught and used to do something after a
5896 * certain event happens. Events can be used to speed up the solution process. For example, the set partitioning
5897 * constraint is only worth propagating if one of the involved variables is fixed. This can be detected by
5898 * catching the event SCIP_EVENTTYPE_VARFIXED. To be able to catch an event it is necessary to write an event handler
5899 * which defines what to do after a certain event was caught.
5900 *
5901 * We now explain how users can add their own event handlers. We give the explanation for creating your own
5902 * source file for each additional event handler. Of course, you can collect different event handlers in one source file
5903 * or you can put the event handler directly into the constraint handler. In a \ref EVENTUSAGE "second step" we discuss
5904 * the usage of an event handler. This means how to catch and drop events. \ref EVENTTYPES "Finally", we give some notes on the existing
5905 * types of events.
5906 *
5907 * Take src/scip/cons_logior.c, where the event handler is directly included into the constraint handler. As all other
5908 * default plugins, the event handlers are written in C. C++ users can easily adapt the code by using the scip::ObjEventhdlr
5909 * wrapper base class and implement the scip_...() virtual methods instead of the SCIP_DECL_EVENT... callbacks.
5910 *
5911 * Additional documentation for the callbacks of an event handler can be found in the file type_event.h. There is
5912 * also an example written in C which deals with an event handler. You find this example in the directory
5913 * "examples/Eventhdlr/". An C++ example can be found within the TSP project (examples/TSP/src/EventhdlrNewSol.cpp).
5914 *
5915 * Here is what you have to do to implement an event handler (assuming your event handler is named "bestsol"):
5916 * -# Copy the template files src/scip/event_xyz.c and src/scip/event_xyz.h into files named "event_bestsol.c"
5917 * and "event_bestsol.h".
5918 \n
5919 * Make sure to adjust your build system such that these files are compiled and linked to your project. \n
5920 * If you are adding a new default plugin, this means updating the `src/CMakeLists.txt` and `Makefile` files in the SCIP distribution.
5921 * -# Use `SCIPincludeEventBestsol()` in order to include the event handler into your SCIP instance,
5922 * e.g., in the main file of your project (see, e.g., src/cmain.c in the Binpacking example). \n
5923 * If you are adding a new default plugin, this include function must be added to `src/scipdefplugins.c`.
5924 * -# Open the new files with a text editor and replace all occurrences of "xyz" by "bestsol".
5925 * -# Adjust the \ref EVENTHDLR_PROPERTIES "properties of the event handler".
5926 * -# Implement the \ref EVENT_INTERFACE "interface functions".
5927 * -# Implement the \ref EVENT_FUNDAMENTALCALLBACKS "fundamental callbacks".
5928 * -# Implement the \ref EVENT_ADDITIONALCALLBACKS "additional callbacks". This is optional.
5929 *
5930 *
5931 * @section EVENTHDLR_PROPERTIES Properties of a Event Handler
5932 *
5933 * At the top of the new file "event_bestsol.c" you can find the event handler properties.
5934 * These are given as compiler defines.
5935 * In the C++ wrapper class, you have to provide the event handler properties by calling the constructor
5936 * of the abstract base class scip::ObjEventhdlr from within your constructor.
5937 * The properties you have to set have the following meaning:
5938 *
5939 * \par EVENT_NAME: the name of the event handler.
5940 * This name has to be unique with respect to all other event handlers. If you are searching for an event handler with
5941 * SCIPfindEventhdlr(), this name is looked up.
5942 *
5943 * \par EVENT_DESC: the description of the event handler.
5944 * This string is printed as a description of the event handler.
5945 *
5946 * @section EVENTHDLR_DATA Event Handler Data
5947 *
5948 * Below the header "Data structures" you can find a struct which is called "struct SCIP_EventhdlrData".
5949 * In this data structure, you can store the data of your event handler. For example, you should store the adjustable
5950 * parameters of the event handler in this data structure.
5951 * If you are using C++, you can add event handler data as usual as object variables to your class.
5952 * \n
5953 * Defining event handler data is optional. You can leave the struct empty.
5954 *
5955 *
5956 * @section EVENT_INTERFACE Interface Functions
5957 *
5958 * At the bottom of "event_bestsol.c", you can find the interface function SCIPincludeEventBestsol(),
5959 * which also appears in "event_bestsol.h".
5960 * SCIPincludeEventBestsol() is called by the user, if (s)he wants to include the event handler,
5961 * i.e., if (s)he wants to use the event handler in his/her application.
5962 *
5963 * This function only has to be adjusted slightly.
5964 * It is responsible for notifying SCIP of the presence of the event handler. For this, you can either call
5965 * SCIPincludeEventhdlr(),
5966 * or SCIPincludeEventhdlrBasic() since SCIP version 3.0. In the latter variant, \ref EVENT_ADDITIONALCALLBACKS "additional callbacks"
5967 * must be added via setter functions as, e.g., SCIPsetReaderCopy(). We recommend this latter variant because
5968 * it is more stable towards future SCIP versions which might have more callbacks, whereas source code using the first
5969 * variant must be manually adjusted with every SCIP release containing new callbacks for event handlers in order to compile.
5970 *
5971 * If you are using event handler data, you have to allocate the memory for the data at this point.
5972 * You can do this by calling:
5973 * \code
5974 * SCIP_CALL( SCIPallocBlockMemory(scip, &eventhdlrdata) );
5975 * \endcode
5976 * You also have to initialize the fields in struct SCIP_EventhdlrData afterwards.
5977 *
5978 * Although this is very uncommon, you may also add user parameters for your event handler, see the function
5979 * SCIPincludeConshdlrKnapsack() in the \ref cons_knapsack.h "knapsack constraint handler" for an example.
5980 *
5981 *
5982 * @section EVENT_FUNDAMENTALCALLBACKS Fundamental Callbacks of a Event Handler
5983 *
5984 * The fundamental callbacks of the plugins are the ones that have to be implemented in order to obtain
5985 * an operational algorithm.
5986 * They are passed together with the event handler itself to SCIP using SCIPincludeEventhdlr() or SCIPincludeEventhdlrBasic(),
5987 * see @ref EVENT_INTERFACE.
5988 *
5989 *
5990 * Event handler plugins have only one fundamental callback, namely the \ref EVENTEXEC function. This function has
5991 * to be implemented for every event handler; the other callbacks are optional. In the C++ wrapper class
5992 * scip::ObjEventhdlr, the scip_exec() method (which corresponds to the \ref EVENTEXEC callback) is a virtual abstract member
5993 * function. You have to implement it in order to be able to construct an object of your event handler class.
5994 *
5995 * Additional documentation for the callbacks can be found in type_event.h.
5996 *
5997 * @subsection EVENTEXEC
5998 *
5999 * The EVENTEXEC callback is called after the requested event happened. Then the event handler can do some action in
6000 * reaction to the event.
6001 *
6002 * Typical the execution function sets a parameter to TRUE to indicate later in solving process that something happened
6003 * which should be analyzed further. In the \ref cons_knapsack.h "knapsack constraint handler" you find such a typical
6004 * example.
6005 *
6006 * @section EVENT_ADDITIONALCALLBACKS Additional Callbacks of a Event Handler
6007 *
6008 * The additional callbacks do not need to be implemented in every case. However, some of them have to be
6009 * implemented for most applications, they can be used, for example, to initialize and free private data.
6010 * Additional callbacks can either be passed directly with SCIPincludeEventhdlr() to SCIP or via specific
6011 * <b>setter functions</b> after a call of SCIPincludeEventhdlrBasic(), see also @ref EVENT_INTERFACE.
6012 *
6013 * @subsection EVENTCOPY
6014 *
6015 * The EVENTCOPY callback is executed when a SCIP instance is copied, e.g. to solve a sub-SCIP. By defining this
6016 * callback as <code>NULL</code> the user disables the execution of the specified event handler for all copied SCIP
6017 * instances. Note that in most cases the event handler in the copied instance will be initialize by those objects (such
6018 * as constraint handlers or propagators) which need this event handler (see \ref cons_knapsack.h). In these cases the copy
6019 * callback can be ignored. In case of general events, such as a new best solution being found
6020 * (SCIP_EVENTTYPE_BESTSOLFOUND), you might want to implement that callback. The event handler example which you find
6021 * in the directory "examples/Eventhdlr/" uses that callback.
6022 *
6023 * @refsnippet{src/scip/event_softtimelimit.c,SnippetEventCopySofttimelimit}
6024 *
6025 * @subsection EVENTFREE
6026 *
6027 * If you are using event handler data, you have to implement this function in order to free the event handler data.
6028 * This can be done by the following procedure:
6029 *
6030 * @refsnippet{src/scip/event_softtimelimit.c,SnippetEventFreeSofttimelimit}
6031 *
6032 * If you have allocated memory for fields in your event handler data, remember to free this memory
6033 * before freeing the event handler data itself.
6034 * If you are using the C++ wrapper class, this function is not available.
6035 * Instead, just use the destructor of your class to free the member variables of your class.
6036 *
6037 *
6038 * @subsection EVENTINIT
6039 *
6040 * The EVENTINIT callback is executed after the problem is transformed.
6041 * The event handler may, e.g., use this call to initialize its event handler data.
6042 *
6043 * @subsection EVENTEXIT
6044 *
6045 * The EVENTEXIT callback is executed before the transformed problem is freed.
6046 * In this function, the event handler should free all resources that have been allocated for the solving process in
6047 * \ref EVENTINIT.
6048 *
6049 * @subsection EVENTINITSOL
6050 *
6051 * The EVENTINITSOL callback is executed when the presolving is finished and the branch-and-bound process is about to
6052 * begin. The event handler may use this call to initialize its branch-and-bound specific data.
6053 *
6054 * @subsection EVENTEXITSOL
6055 *
6056 * The EVENTEXITSOL callback is executed before the branch-and-bound process is freed. The event handler should use this
6057 * call to clean up its branch-and-bound specific data.
6058 *
6059 * @section EVENTUSAGE Catching and Dropping Events
6060 *
6061 * After you have implemented the event handler, you have to tell SCIP for which events this event handler should be
6062 * used. This can be a general events, such as <code>SCIP_EVENTTYPE_BESTSOLFOUND</code>, or a variable event which is the most common
6063 * way.
6064 *
6065 * In case of a general (not variable) event you use the function SCIPcatchEvent() to attach to an event and
6066 * SCIPdropEvent() to release this event later.
6067 *
6068 * \code
6069 * SCIP_CALL( SCIPcatchEvent( scip, SCIP_EVENTTYPE_BESTSOLFOUND, eventhdlr, NULL, NULL) );
6070 * \endcode
6071 *
6072 * \code
6073 * SCIP_CALL( SCIPdropEvent( scip, SCIP_EVENTTYPE_BESTSOLFOUND, eventhdlr, NULL, NULL) );
6074 * \endcode
6075 *
6076 * If you want trigger some variable event, you use the function SCIPcatchVarEvent() to attach the variable event and
6077 * SCIPdropVarEvent() to drop it later.
6078 *
6079 * \code
6080 * SCIP_CALL( SCIPcatchVarEvent( scip, var, SCIP_EVENTTYPE_VARFIXED, eventhdlr, NULL, NULL) );
6081 * \endcode
6082 *
6083 * \code
6084 * SCIP_CALL( SCIPdropVarEvent( scip, var, SCIP_EVENTTYPE_VARFIXED, eventhdlr, NULL, NULL) );
6085 * \endcode
6086 *
6087 * @section EVENTTYPES Event types
6088 *
6089 * All available events are listed in type_event.h. There are atomic events such as <code>SCIP_EVENTTYPE_VARFIXED</code>
6090 * and combined events such as <code>SCIP_EVENTTYPE_VARCHANGED</code>. The events are encoded via bit masks. Each atomic
6091 * event has a unique power of two. This enables combination of the atomic events.
6092 *
6093 * SCIP only throws atomic events. However, an event handler might be interested in bunch of events. Through the
6094 * underlying bit masks it is possible to combine the atomic events. For example, <code>SCIP_EVENTTYPE_VARCHANGED</code>
6095 * is an event which combines the events <code>SCIP_EVENTTYPE_VARFIXED</code>, <code>SCIP_EVENTTYPE_VARUNLOCKED</code>,
6096 * <code>SCIP_EVENTTYPE_OBJCHANGED</code>, <code>SCIP_EVENTTYPE_GBDCHANGED</code>,
6097 * <code>SCIP_EVENTTYPE_DOMCHANGED</code>, and <code>SCIP_EVENTTYPE_IMPLADDED</code>.
6098 *
6099 * \code
6100 * #define SCIP_EVENTTYPE_VARCHANGED (SCIP_EVENTTYPE_VARFIXED | SCIP_EVENTTYPE_VARUNLOCKED | SCIP_EVENTTYPE_OBJCHANGED
6101 * | SCIP_EVENTTYPE_GBDCHANGED | SCIP_EVENTTYPE_DOMCHANGED | SCIP_EVENTTYPE_IMPLADDED)
6102 * \endcode
6103 *
6104 * Depending on the event type, the event offers different information. The functions which can be used to gain
6105 * access to this information are given in pub_event.h.
6106 *
6107 */
6108
6109/*--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
6110
6111/**@page NLPI How to add interfaces to nonlinear programming solvers
6112 *
6113 * NLPIs are used to interface a solver for nonlinear programs (NLP).
6114 * It is used, e.g., to solve convex relaxations of the problem or to find locally optimal solutions of
6115 * nonlinear relaxations or subproblems.
6116 * The NLPI has been designed such that it can be used independently of a SCIP problem.
6117 *
6118 * While the NLPI itself corresponds to the solver interface, the NLPIPROBLEM corresponds to the
6119 * (solver specific) representation of a concrete nonlinear program.
6120 * An NLP is specified as a set of indexed variables with variable bounds, an objective function,
6121 * and a set of constraints, where each constraint is specified as a function which is restricted to lie
6122 * between given left and right hand sides (possibly infinite).
6123 * A function consists of a linear and a nonlinear part.
6124 * The linear part is specified via variable indices and coefficients, while the nonlinear part is specified via an expression.
6125 * That is, the user of the NLPI does not provide function evaluation callbacks but an algebraic representation of the NLP.
6126 * Interfaces for solvers that require function evaluations can make use of the \ref NLPIOracle "NLPIORACLE", which
6127 * provides functionality to store a NLP and compute functions values, gradients, Jacobians, and Hessians.
6128 * See the interface to Ipopt for an example on how to use the NLPIORACLE.
6129 *
6130 * A complete list of all NLPIs contained in this release can be found \ref NLPIS "here".
6131 *
6132 * We now explain how users can add their own NLP solver interface.
6133 * Take the interface to Ipopt (src/scip/nlpi_ipopt.cpp) as an example.
6134 * Unlike most other plugins, it is written in C++.
6135 * Additional documentation for the callbacks of an NLPI, in particular for their input parameters,
6136 * can be found in the file \ref type_nlpi.h.
6137 *
6138 * Here is what you have to do to implement an NLPI:
6139 * -# Copy the template files src/scip/nlpi_xyz.c and src/scip/nlpi_xyz.h into files named "nlpi_mysolver.c" and "nlpi_mysolver.h".
6140 * Make sure to adjust your build system such that these files are compiled and linked to your project. \n
6141 * If you are adding a new default plugin, this means updating the `src/CMakeLists.txt` and `Makefile` files in the SCIP distribution.
6142 * -# Use `SCIPincludeNlpSolverMysolver()` in order to include the NLPI into your SCIP instance,
6143 * e.g., in the main file of your project (see, e.g., src/cmain.c in the Binpacking example). \n
6144 * If you are adding a new default plugin, this include function must be added to `src/scipdefplugins.c`.
6145 * -# Open the new files with a text editor and replace all occurrences of "xyz" by "mysolver".
6146 * -# Adjust the properties of the nlpi (see \ref NLPI_PROPERTIES).
6147 * -# Define the NLPI and NLPIPROBLEM data (see \ref NLPI_DATA).
6148 * -# Implement the interface functions (see \ref NLPI_INTERFACE).
6149 * -# Implement the fundamental callbacks (see \ref NLPI_FUNDAMENTALCALLBACKS).
6150 * -# Implement the additional callbacks (see \ref NLPI_ADDITIONALCALLBACKS). This is optional.
6151 *
6152 *
6153 * @section NLPI_PROPERTIES Properties of an NLPI
6154 *
6155 * At the top of the new file "nlpi_mysolver.c", you can find the NLPI properties.
6156 * These are given as compiler defines.
6157 * The properties you have to set have the following meaning:
6158 *
6159 * \par NLPI_NAME: the name of the NLP solver interface.
6160 * This name is used in the interactive shell to address the NLPI.
6161 * Additionally, if you are searching for an NLPI with SCIPfindNlpi(), this name is looked up.
6162 * Names have to be unique: no two NLPIs may have the same name.
6163 *
6164 * \par NLPI_DESC: the description of the NLPI.
6165 * This string is printed as a description of the NLPI in the interactive shell.
6166 *
6167 * \par NLPI_PRIORITY: the priority of the NLPI.
6168 * If an NLP has to be solved, an NLP solver has to be selected.
6169 * By default, the solver with the NLPI with highest priority is selected.
6170 * The priority of an NLPI should be set according to performance of the solver:
6171 * solvers that provide fast algorithms that are usually successful on a wide range of problems should have a high priority.
6172 * An easy way to list the priorities of all NLPIs is to type "display nlpis" in the interactive shell of SCIP.
6173 *
6174 * @section NLPI_DATA NLPI Data
6175 *
6176 * Below the header "Data structures" you can find structs which are called `struct SCIP_NlpiData` and `struct SCIP_NlpiProblem`.
6177 * In these data structures, you can store the data of your solver interface and of a specific NLP problem.
6178 * For example, you could store a pointer to your NLP solver environment object in the `SCIP_NlpiData` data structure
6179 * and store a pointer to an NLPIORACLE in the `SCIP_NlpiProblem` data structure.
6180 *
6181 * @section NLPI_INTERFACE Interface Functions
6182 *
6183 * At the bottom of "nlpi_mysolver.c", you can find the interface function SCIPincludeNlpSolverXyz(),
6184 * which also appears in "nlpi_mysolver.h".
6185 *
6186 * This function only has to be adjusted slightly.
6187 * It is responsible for creating an NLPI that contains all properties and callbacks of your
6188 * solver interface and included it into SCIP by calling the function SCIPincludeNlpi().
6189 * SCIPincludeNlpSolverXyz() is called by the user (e.g., SCIP), if (s)he wants to use this solver interface in his/her application.
6190 *
6191 * If you are using NLPI data, you have to allocate the memory for the data at this point.
6192 * You can do this by calling:
6193 * \code
6194 * SCIP_CALL( SCIPallocBlockMemory(scip, &nlpidata) );
6195 * \endcode
6196 * You also have to initialize the fields in struct SCIP_NlpiData afterwards. For freeing the
6197 * NLPI data, see \ref NLPIFREE.
6198 *
6199 *
6200 * @section NLPI_FUNDAMENTALCALLBACKS Fundamental Callbacks of an NLPI
6201 *
6202 * The fundamental callbacks of the plugins are the ones that have to be implemented in order to obtain
6203 * an operational algorithm. Most NLPI callbacks are fundamental.
6204 *
6205 * Additional documentation of the callbacks, in particular to their input parameters,
6206 * can be found in \ref type_nlpi.h.
6207 *
6208 * @subsection NLPIFREE
6209 *
6210 * The NLPIFREE callback is executed if the NLP solver interface data structure should be freed, e.g., when a SCIP instance is freed.
6211 *
6212 * @subsection NLPICREATEPROBLEM
6213 *
6214 * The NLPICREATEPROBLEM callback is executed if a particular NLP problem is to be created.
6215 * The callback should initialize a SCIP_NlpiProblem struct here that corresponds to an empty NLP.
6216 *
6217 * @subsection NLPIFREEPROBLEM
6218 *
6219 * The NLPIFREEPROBLEMPOINTER callback is executed if a particular NLP problem is to be freed.
6220 * The callback should free a SCIP_NlpiProblem struct here.
6221 *
6222 * @subsection NLPIADDVARS
6223 *
6224 * The NLPIADDVARS callback is executed if a set of variables with lower and upper bounds and names should be added to a particular NLP.
6225 * The callback must add the new variables behind the previously added variables, if any.
6226 * If NULL is given for the lower bounds arguments, -infinity is assumed as lower bound for each new variable.
6227 * If NULL is given for the upper bounds arguments, +infinity is assumed as upper bound for each new variable.
6228 * It is also permitted to use NULL for the names argument.
6229 *
6230 * @subsection NLPIADDCONSTRAINTS
6231 *
6232 * The NLPIADDCONSTRAINTS callback is executed if a set of constraints should be added to a particular NLP.
6233 * Constraints are specified by providing left- and right-hand-sides, linear coefficients, expressions, and constraint names.
6234 * All of these arguments are optional, giving NULL for left-hand-sides corresponds to -infinity, giving NULL for right-hand-sides corresponds to +infinity.
6235 *
6236 * @subsection NLPISETOBJECTIVE
6237 *
6238 * The NLPISETOBJECTIVE callback is executed to set the objective function of a particular NLP.
6239 *
6240 * @subsection NLPICHGVARBOUNDS
6241 *
6242 * The NLPICHGVARBOUNDS callback is executed to change the bounds on a set of variables of an NLP.
6243 *
6244 * @subsection NLPICHGCONSSIDES
6245 *
6246 * The NLPICHGCONSSIDES callback is executed to change the sides on a set of constraints of an NLP.
6247 *
6248 * @subsection NLPIDELVARSET
6249 *
6250 * The NLPIDELVARSET callback is executed to delete a set of variables from an NLP.
6251 * The caller provides an array in which for each variable it is marked whether it should be deleted.
6252 * In the same array, the function should return the new position of each variable in the NLP, or -1 if it was deleted.
6253 *
6254 * @subsection NLPIDELCONSSET
6255 *
6256 * The NLPIDELCONSSET callback is executed to delete a set of constraints from an NLP.
6257 * The caller provides an array in which for each constraint it is marked whether it should be deleted.
6258 * In the same array, the function should return the new position of each constraint in the NLP, or -1 if it was deleted.
6259 *
6260 * @subsection NLPICHGLINEARCOEFS
6261 *
6262 * The NLPICHGLINEARCOEFS callback is executed to change the coefficients in the linear part of the objective function or a constraint of an NLP.
6263 *
6264 * @subsection NLPICHGEXPR
6265 *
6266 * The NLPICHGEXPR callback is executed to replace the expression of the objective function or a constraint of an NLP.
6267 *
6268 * @subsection NLPICHGOBJCONSTANT
6269 *
6270 * The NLPICHGOBJCONSTANT callback is executed to change the constant offset of the objective function of an NLP.
6271 *
6272 * @subsection NLPISOLVE
6273 *
6274 * The NLPISOLVE callback is executed when an NLP should be solved.
6275 * The solver may use the initial guess provided by \ref NLPISETINITIALGUESS as starting point.
6276 * The status of the solving process and solution can be requested by
6277 * \ref NLPIGETSOLSTAT, \ref NLPIGETTERMSTAT, \ref NLPIGETSOLUTION, and \ref NLPIGETSTATISTICS.
6278 *
6279 * @subsection NLPIGETSOLSTAT
6280 *
6281 * The NLPIGETSOLSTAT callback can be used to request the solution status (solved, infeasible, ...) after an NLP has been solved.
6282 *
6283 * @subsection NLPIGETTERMSTAT
6284 *
6285 * The NLPIGETTERMSTAT callback can be used to request the termination reason (normal, iteration limit, ...) after an NLP has been solved.
6286 *
6287 * @subsection NLPIGETSOLUTION
6288 *
6289 * The NLPIGETSOLUTION callback can be used to request the primal and dual solution values after an NLP solve.
6290 * The function should pass pointers to arrays of variable values to the caller.
6291 * It is possible to return only primal values for the variables, but no values for the dual variables, e.g., if a solver does not compute such values.
6292 *
6293 * @subsection NLPIGETSTATISTICS
6294 *
6295 * The NLPIGETSTATISTICS callback can be used to request the statistical values (number of iterations, time, ...) after an NLP solve.
6296 * The function should fill the provided NLPSTATISTICS data structure.
6297 *
6298 * @section NLPI_ADDITIONALCALLBACKS Additional Callbacks of an NLPI
6299 *
6300 * The additional callbacks do not need to be implemented in every case.
6301 *
6302 * @subsection NLPICOPY
6303 *
6304 * The NLPICOPY callback is executed if the plugin should be copied, e.g., when a SCIP instance is copied.
6305 *
6306 * It is advisable to implement this callback to make the NLP solver available in sub-SCIPs.
6307 * Note that the sub-NLP heuristic solves NLPs in a sub-SCIP.
6308 *
6309 * @subsection NLPIGETSOLVERPOINTER
6310 *
6311 * The NLPIGETSOLVERPOINTER callback can be used to pass a pointer to a solver specific data structure to the user.
6312 * Return NULL if you do not have a pointer to return.
6313 *
6314 * @subsection NLPIGETPROBLEMPOINTER
6315 *
6316 * The NLPIGETPROBLEMPOINTER callback can be used to pass a pointer to a solver specific data structure of the NLP to the user.
6317 *
6318 * @subsection NLPISETINITIALGUESS
6319 *
6320 * The NLPISETINITIALGUESS callback is executed to provide primal and dual initial values for the variables and constraints of an NLP.
6321 * For a local solver, it is strongly advisable to implement this callback, as these values should be used as a starting point for the search.
6322 * It is possible to pass a NULL pointer for any of the arguments (primal values of variables, dual values of variable bounds, dual values of constraints).
6323 * In this case, the solver should clear previously set starting values and setup its own starting point.
6324 *
6325 */
6326
6327/*--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
6328
6329/**@page EXPRINT How to add interfaces to expression interpreters
6330 *
6331 * An expression interpreter is a tool to compute point-wise the function values, gradients, and
6332 * Hessians of algebraic expressions which are given in the form of an expression.
6333 * Typically, this is done via automatic differentiation.
6334 * It is used, e.g., by an NLP solver interface to compute Jacobians and Hessians for the solver.
6335 *
6336 * The expression interpreter interface in SCIP has been implemented similar to those of the LP solver interface (LPI).
6337 * For one binary, exactly one expression interpreter has to be linked.
6338 * The expression interpreter API has been designed such that it can be used independently from a SCIP problem.
6339 *
6340 * A complete list of all expression interpreters contained in this release can be found \ref EXPRINTS "here".
6341 *
6342 * We now explain how users can add their own expression interpreters.
6343 * Take the interface to CppAD (\ref exprinterpret_cppad.cpp) as an example.
6344 * Unlike most other plugins, it is written in C++.
6345 *
6346 * Additional documentation for the callbacks of an expression interpreter, in particular for their input parameters,
6347 * can be found in the file \ref exprinterpret.h.
6348 *
6349 * Here is what you have to do to implement an expression interpreter:
6350 * -# Copy the file \ref exprinterpret_none.c into a file named "exprinterpret_myad.c".
6351 * Make sure to adjust your build system such that this file is compiled and linked to your project instead of exprinterpret implementations. \n
6352 * If you are adding a new default plugin, this means updating the `src/CMakeLists.txt` and `Makefile` files in the SCIP distribution.
6353 * -# Open the new file with a text editor.
6354 * -# Define the expression interpreter data (see \ref EXPRINT_DATA).
6355 * -# Implement the interface functions (see \ref EXPRINT_INTERFACE).
6356 *
6357 *
6358 * @section EXPRINT_DATA Expression Interpreter Data
6359 *
6360 * In `struct SCIP_ExprInt`, you can store the general data of your expression interpreter.
6361 * For example, you could store the environment of your automatic differentiation code.
6362 *
6363 * @section EXPRINT_INTERFACE Interface Functions
6364 *
6365 * The expression interpreter has to implement a set of interface function.
6366 * In your "exprinterpret_myad.c", these functions are mostly dummy functions that return error codes.
6367 *
6368 * @subsection SCIPexprintGetName
6369 *
6370 * The SCIPexprintGetName() function should return the name of the expression interpreter.
6371 *
6372 * @subsection SCIPexprintGetDesc
6373 *
6374 * The SCIPexprintGetDesc() function should return a short description of the expression interpreter, e.g., the name of the developer of the code.
6375 *
6376 * @subsection SCIPexprintGetCapability
6377 *
6378 * The SCIPexprintGetCapability() function should return a bitmask that indicates the capabilities of the expression interpreter,
6379 * i.e., whether it can compute gradients and Hessians.
6380 *
6381 * @subsection SCIPexprintCreate
6382 *
6383 * The SCIPexprintCreate() function is called to create an expression interpreter data structure.
6384 * The function should initialize a `struct SCIP_ExprInt` here.
6385 *
6386 * @subsection SCIPexprintFree
6387 *
6388 * The SCIPexprintFree() function is called to free an expression interpreter data structure.
6389 * The function should free a `struct SCIP_ExprInt` here.
6390 *
6391 * @subsection SCIPexprintCompile
6392 *
6393 * The SCIPexprintCompile() function is called to initialize the data structures that are required to evaluate a particular expression.
6394 * The expression interpreter can create and return data that is particular to a given expression in the argument `exprintdata`.
6395 *
6396 * @subsection SCIPexprintFreeData
6397 *
6398 * The SCIPexprintFreeData() function is called to free the data that is particular to a given expression and was possibly created in SCIPexprintCompile().
6399 *
6400 * @subsection SCIPexprintGetExprCapability
6401 *
6402 * The SCIPexprintGetExprCapability() function is called to request the capability to evaluate a specific expression by the expression interpreter.
6403 *
6404 * In cases of user-given expressions, higher order derivatives may not be available for the user-expression,
6405 * even if the expression interpreter could handle these. This function allows to recognize that, e.g., the
6406 * Hessian for an expression is not available because it contains a user expression that does not provide
6407 * Hessians.
6408 *
6409 * @subsection SCIPexprintEval
6410 *
6411 * The SCIPexprintEval() function is called when the value of an expression should be computed for a point.
6412 *
6413 * @subsection SCIPexprintGrad
6414 *
6415 * The SCIPexprintGrad() function is called when the gradient of an expression represented by an expression should be computed for a point.
6416 *
6417 * @subsection SCIPexprintHessianSparsity
6418 *
6419 * The SCIPexprintHessianSparsity() function is called when the sparsity structure of the Hessian matrix should be computed and returned.
6420 * Only the position of nonzero entries in the lower-triangular part of Hessian should be reported.
6421 *
6422 * @subsection SCIPexprintHessian
6423 *
6424 * The SCIPexprintHessian() function is called when the Hessian of an expression should be computed for a point.
6425 */
6426
6427/*--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
6428
6429/**@page TABLE How to add statistics tables
6430 *
6431 * After solving a constraint integer program, SCIP can display statistics tables with information about, e.g., the solving time,
6432 * number of nodes, LP iterations or the number of calls and successes of different plugins via "display statistics" in the shell
6433 * or via SCIPprintStatistics() in the C-interface. There already exists a wide variety of statistics tables which can be activated
6434 * or deactivated on demand, see src/scip/table_default.c. Additionally, the user can implement his/her own statistics tables
6435 * in order to display problem or algorithm specific values.
6436 * \n
6437 * A complete list of all statistics tables contained in this release can be found \ref TABLES "here".
6438 *
6439 * We now explain how users can add their own statistics tables.
6440 * We give the explanation for creating your own source file for each additional statistics table. Of course, you can collect
6441 * different additional statistics tables in one source file.
6442 * Take src/scip/table_default.c, where all default statistics tables are collected, as an example.
6443 * As all other default plugins, the default statistics table plugins and the statistics table template are written in C.
6444 * C++ users can easily adapt the code by using the scip::ObjTable wrapper base class and implement the scip_...() virtual methods
6445 * instead of the SCIP_DECL_TABLE... callbacks.
6446 *
6447 *
6448 * Additional documentation for the callbacks of a statistics table can be found in the file type_table.h.
6449 *
6450 * Here is what you have to do to implement a statistics table (assuming your statistics table is named "mystatisticstable"):
6451 * -# Copy the template files src/scip/table_xyz.c and src/scip/table_xyz.h into files named "table_mystatisticstable.c"
6452 * and "table_mystatisticstable.h".
6453 * \n
6454 * Make sure to adjust your build system such that these files are compiled and linked to your project. \n
6455 * If you are adding a new default plugin, this means updating the `src/CMakeLists.txt` and `Makefile` files in the SCIP distribution.
6456 * -# Use SCIPincludeTableMystatisticstable() in order to include the statistics table into your SCIP instance,
6457 * e.g., in the main file of your project (see, e.g., src/cmain.c in the Binpacking example). \n
6458 * If you are adding a new default plugin, this include function must be added to `src/scipdefplugins.c`.
6459 * -# Open the new files with a text editor and replace all occurrences of "xyz" by "mystatisticstable".
6460 * -# Adjust the \ref TABLE_PROPERTIES "properties of the statistics table".
6461 * -# Define the \ref TABLE_DATA "statistics table data". This is optional.
6462 * -# Implement the \ref TABLE_INTERFACE "interface functions".
6463 * -# Implement the \ref TABLE_FUNDAMENTALCALLBACKS "fundamental callbacks".
6464 * -# Implement the \ref TABLE_ADDITIONALCALLBACKS "additional callbacks". This is optional.
6465 *
6466 *
6467 * @section TABLE_PROPERTIES Properties of a Statistics Table
6468 *
6469 * At the top of the new file "table_mystatisticstable.c" you can find the statistics table properties.
6470 * These are given as compiler defines.
6471 * In the C++ wrapper class, you have to provide the statistics table properties by calling the constructor
6472 * of the abstract base class scip::ObjTable from within your constructor.
6473 * The properties you have to set have the following meaning:
6474 *
6475 * \par TABLE_NAME: the name of the statistics table.
6476 * This name is used in the interactive shell to address the statistics table.
6477 * Additionally, if you are searching for a statistics table with SCIPfindTable(), this name is looked up.
6478 * Names have to be unique: no two statistic tables may have the same name.
6479 *
6480 * \par TABLE_DESC: the description of the statistics table.
6481 * This string is printed as a description of the statistics table in the interactive shell.
6482 *
6483 * \par TABLE_POSITION: the position of the statistics table.
6484 * In the statistics output, the statistics tables will be ordered by increasing position. Compare with the
6485 * default statistics tables in "table_default.c" to find a value which will give you the desired position
6486 * between the default statistics tables. If you give your table a negative position value, it will appear
6487 * before all SCIP statistcs, with a value larger than 20000 it will appear after all default statistics.
6488 *
6489 * \par TABLE_EARLIEST_STAGE: output of the statistics table is only printed from this stage onwards
6490 * The output routine of your statistics table will only be called if SCIP has reached this stage. For
6491 * example, the default table "tree" will only output information starting from SCIP_STAGE_SOLVING, because
6492 * there is no meaningful information available before, while the "presolver" table can already be called
6493 * in SCIP_STAGE_TRANSFORMED.
6494 *
6495 * @section TABLE_DATA Statistics Table Data
6496 *
6497 * Below the header "Data structures" you can find a struct which is called "struct SCIP_TableData".
6498 * In this data structure, you can store the data of your statistics table. For example, you should store the adjustable
6499 * parameters of the statistics table in this data structure.
6500 * If you are using C++, you can add statistics table data as usual as object variables to your class.
6501 * \n
6502 * Defining statistics table data is optional. You can leave the struct empty.
6503 *
6504 *
6505 * @section TABLE_INTERFACE Interface Functions
6506 *
6507 * At the bottom of "table_mystatisticstable.c" you can find the interface function SCIPincludeTableMystatisticstable(), which also
6508 * appears in "table_mystatisticstable.h".
6509 * \n
6510 * This function only has to be adjusted slightly.
6511 * It is responsible for notifying SCIP of the presence of the statistics table by calling the function
6512 * SCIPincludeTable().
6513 *
6514 * The interface function is called by the user, if (s)he wants to include the statistics table, i.e., if (s)he wants to use the statistics table in an
6515 * application.
6516 *
6517 * If you are using statistics table data, you have to allocate the memory for the data at this point.
6518 * You can do this by calling:
6519 * \code
6520 * SCIP_CALL( SCIPallocBlockMemory(scip, &tabledata) );
6521 * \endcode
6522 * You also have to initialize the fields in struct SCIP_TableData afterwards.
6523 *
6524 * Although this is very uncommon, you may also add user parameters for your statistics table, see the function
6525 * SCIPincludeConshdlrKnapsack() in the \ref cons_knapsack.h "knapsack constraint handler" for an example.
6526 *
6527 *
6528 * @section TABLE_FUNDAMENTALCALLBACKS Fundamental Callbacks of a Statistics Table
6529 *
6530 * Statistics table plugins have callbacks that output and collect data.
6531 * One or both of these functions have to be implemented for every table.
6532 * If the output function is not implemented, then SCIP tries to print the data that is retrieved from the collect callback in table form.
6533 * In the C++ wrapper class scip::ObjTable, the scip_output() method (which corresponds to the \ref TABLEOUTPUT callback) and
6534 * scip_collect() method (which corresponds to the \ref TABLECOLLECT callback) are virtual member functions.
6535 * One or both of them should be overwritten.
6536 *
6537 * Additional documentation for the callbacks can be found in type_table.h.
6538 *
6539 * @subsection TABLEOUTPUT
6540 *
6541 * The TABLEOUTPUT callback is called whenever SCIP is asked to print statistics (because the user typed "display statistics"
6542 * in the shell or called SCIPprintStatistics()). In this callback, the table should print all of its information to the given file
6543 * (which may be NULL if the output should be printed to the console).
6544 *
6545 * Typical functions called by a statistics table are, for example, SCIPdispLongint(), SCIPdispInt(), SCIPdispTime(), and
6546 * SCIPinfoMessage().
6547 *
6548 * @subsection TABLECOLLECT
6549 *
6550 * The TABLECOLLECT callback is called when the statistics table should collect its information in a SCIP_DATATREE.
6551 * This is used, for example, to write statistics to a JSON file (SCIPprintStatisticsJson()).
6552 * To implement the TABLECOLLECT callback, `SCIPinsertDatatree*()` functions should be used to insert information
6553 * into the given SCIP_DATATREE. Currently, inserting data of different types is supported: long, double, char*,
6554 * another SCIP_DATATREE*, or arrays of long, double, and char*. See also scip_datatree.h and pub_datatree.h.
6555 *
6556 *
6557 * @section TABLE_ADDITIONALCALLBACKS Additional Callbacks of a Statistics Table
6558 *
6559 * The additional callbacks do not need to be implemented in every case.
6560 * They can be used, for example, to initialize and free private data.
6561 *
6562 * @subsection TABLECOPY
6563 *
6564 * The TABLECOPY callback is executed when a SCIP instance is copied, e.g. to solve a sub-SCIP. By defining this callback
6565 * as <code>NULL</code> the user disables the execution of the specified column. In general it is probably not needed to
6566 * implement that callback since the output of the copied instance is usually suppressed. In the other case or for
6567 * debugging the callback should be implement.
6568 *
6569 *
6570 * @subsection TABLEFREE
6571 *
6572 * If you are using statistics table data, you have to implement this function in order to free the statistics table data.
6573 * This can be done by the following procedure:
6574 * @refsnippet{tests/src/misc/snippets.c,SnippetTableFree}
6575 *
6576 * If you have allocated memory for fields in your statistics table data, remember to free this memory
6577 * before freeing the statistics table data itself.
6578 * If you are using the C++ wrapper class, this function is not available.
6579 * Instead, just use the destructor of your class to free the member variables of your class.
6580 *
6581 * @subsection TABLEINIT
6582 *
6583 * The TABLEINIT callback is executed after the problem is transformed.
6584 * The statistics table may, e.g., use this call to initialize its statistics table data.
6585 *
6586 * @subsection TABLEEXIT
6587 *
6588 * The TABLEEXIT callback is executed before the transformed problem is freed.
6589 * In this function, the statistics table should free all resources that have been allocated for the solving process in
6590 * \ref TABLEINIT.
6591 *
6592 * @subsection TABLEINITSOL
6593 *
6594 * The TABLEINITSOL callback is executed when the presolving is finished and the branch-and-bound process is about to
6595 * begin. The statistics table may use this call to initialize its branch-and-bound specific data.
6596 *
6597 * @subsection TABLEEXITSOL
6598 *
6599 * The TABLEEXITSOL callback is executed before the branch-and-bound process is freed. The statistics table should use this
6600 * call to clean up its branch-and-bound specific data.
6601 */
6602
6603/*--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
6604
6605/**@page BENDER How to add custom Benders' decomposition implementations
6606 *
6607 * Benders' decomposition is a very popular mathematical programming technique that is applied to solve structured
6608 * problems. Problems that display a block diagonal structure are particularly amenable to the application of Benders'
6609 * decomposition. Such problems are given by
6610 *
6611 * \f[
6612 * \begin{array}[t]{rllclcl}
6613 * \min & \displaystyle & c^{T}x & + & d^{T}y \\
6614 * & \\
6615 * subject \ to & \displaystyle & Ax & & & = & b \\
6616 * & \\
6617 * & \displaystyle & Tx & + & Hy & = & h \\
6618 * & \\
6619 * & & x & & & \in & \mathbb{Z}^{p}\times\mathbb{R}^{n - p} \\
6620 * & & & & y & \in & \mathbb{R}^{m} \\
6621 * \end{array}
6622 * \f]
6623 *
6624 * The variables \f$x\f$ and \f$y\f$ are described as the first and second stage variables respectively. In the
6625 * classical use of Benders' decomposition, it is a requirement that the all second stage variables are continuous.
6626 * Extensions to the classical Benders' decomposition approach have permitted the use of more general second stage
6627 * problems.
6628 *
6629 * The application of Benders' decomposition to the above problem results in a subproblem, given by
6630 *
6631 * \f[
6632 * \begin{array}[t]{rll}
6633 * \min & \displaystyle & d^{T}y \\
6634 * & \\
6635 * subject \ to & \displaystyle & Hy = h - T\bar{x} \\
6636 * & \\
6637 * & & y \in \mathbb{R}^{m} \\
6638 * \end{array}
6639 * \f]
6640 *
6641 * where \f$\bar{x}\f$ is a solution vector of the first stage variables. As such, the subproblem is a problem only in
6642 * \f$y\f$. The dual solution to the subproblem, either an extreme point or extreme ray, is used to generate cuts that
6643 * are added to the master problem. Let \f$\lambda\f$ be the vector of dual variables associated with the set of
6644 * constraints from the subproblem. If, for a given \f$\bar{x}\f$, the subproblem is infeasible, then \f$\lambda\f$
6645 * corresponds to a dual ray and is used to produce the cut
6646 *
6647 * \f[
6648 * 0 \geq \lambda(h - Tx)
6649 * \f]
6650 *
6651 * which eliminates \f$\bar{x}\f$ from the master problem. If, for a given \f$\bar{x}\f$, the subproblem is feasible,
6652 * then \f$\lambda\f$ corresponds to a dual extreme point and is used to produce the cut
6653 *
6654 * \f[
6655 * \varphi \geq \lambda(h - Tx)
6656 * \f]
6657 *
6658 * where \f$\varphi\f$ is an auxiliary variable added to the master problem as an underestimator of the optimal
6659 * subproblem objective function value.
6660 *
6661 * Given \f$\Omega^{p}\f$ and \f$\Omega^{r}\f$ as the sets of dual extreme points and rays of the subproblem,
6662 * respectively, the Benders' decomposition master problem is given by
6663 *
6664 * \f[
6665 * \begin{array}[t]{rll}
6666 * \min & \displaystyle & c^{T}x + \varphi \\
6667 * & \\
6668 * subject \ to & \displaystyle & Ax = b \\
6669 * & \\
6670 * & \displaystyle & \varphi \geq \lambda(h - Tx) \quad \forall \lambda \in \Omega^{r}\\
6671 * & \\
6672 * & \displaystyle & 0 \geq \lambda(h - Tx) \quad \forall \lambda \in \Omega^{r} \\
6673 * & \\
6674 * & & x \in \mathbb{Z}^{p}\times\mathbb{R}^{n - p} \\
6675 * & & \varphi \in \mathbb{R} \\
6676 * \end{array}
6677 * \f]
6678 *
6679 * The Benders' decomposition framework of SCIP allows the user to provide a custom implementation of many aspects of
6680 * the Benders' decomposition algorithm. It is possible to implement multiple Benders' decompositions that work in
6681 * conjunction with each other. Such a situation is where you may have different formulations of the Benders'
6682 * decomposition subproblem.
6683 *
6684 * The current list of all Benders' decomposition implementations available in this release can be found \ref BENDERS
6685 * "here".
6686 *
6687 * We now explain how users can add their own Benders' decomposition implementations.
6688 * Take the default Benders' decomposition implementation (src/scip/benders_default.c) as an example. Same as all other
6689 * default plugins, it is written in C. C++ users can easily adapt the code by using the scip::ObjBenders wrapper base
6690 * class and implement the scip_...() virtual methods instead of the SCIP_DECL_BENDERS... callbacks.
6691 *
6692 * Additional documentation for the callbacks of a Benders' decomposition implementation, in particular for the
6693 * input parameters, can be found in the file type_benders.h.
6694 *
6695 * Here is what you have to do to implement a custom Benders' decomposition:
6696 * -# Copy the template files src/scip/benders_xyz.c and src/scip/benders_xyz.h into files "benders_mybenders.c" and
6697 * "benders_mybenders.h".
6698 \n
6699 * Make sure to adjust your build system such that these files are compiled and linked to your project. \n
6700 * If you are adding a new default plugin, this means updating the `src/CMakeLists.txt` and `Makefile` files in the SCIP distribution.
6701 * -# Use SCIPincludeBendersMybenders() in order to include the Benders' decomposition into your SCIP instance, e.g., in
6702 * the main file of your project (see, e.g., src/cmain.c in the Binpacking example). \n
6703 * If you are adding a new default plugin, this include function must be added to `src/scipdefplugins.c`.
6704 * -# Open the new files with a text editor and replace all occurrences of "xyz" by "mybenders".
6705 * -# Adjust the properties of the Benders' decomposition (see \ref BENDERS_PROPERTIES).
6706 * -# Define the Benders' decomposition data (see \ref BENDERS_DATA). This is optional.
6707 * -# Implement the interface functions (see \ref BENDERS_INTERFACE).
6708 * -# Implement the fundamental callbacks (see \ref BENDERS_FUNDAMENTALCALLBACKS).
6709 * -# Implement the additional callbacks (see \ref BENDERS_ADDITIONALCALLBACKS). This is optional.
6710 *
6711 *
6712 * @section BENDERS_PROPERTIES Properties of a Benders' decomposition
6713 *
6714 * At the top of the new file "benders_mybenders.c", you can find the Benders' decomposition properties.
6715 * These are given as compiler defines.
6716 * In the C++ wrapper class, you have to provide the Benders' decomposition properties by calling the constructor
6717 * of the abstract base class scip::ObjBenders from within your constructor.
6718 * The properties you have to set have the following meaning:
6719 *
6720 * \par BENDERS_NAME: the name of the Benders' decomposition.
6721 * This name is used in the interactive shell to address the Benders' decomposition.
6722 * Additionally, if you are searching for a Benders' decomposition with SCIPfindBenders(), this name is looked up.
6723 * Names have to be unique: no two Benders' decompositions may have the same name.
6724 *
6725 * \par BENDERS_DESC: the description of the Benders' decomposition.
6726 * This string is printed as a description of the Benders' decomposition in the interactive shell.
6727 *
6728 * \par BENDERS_PRIORITY: the priority of the Benders' decomposition.
6729 * During the enforcement and checking of solutions in src/scip/cons_benders.c and src/scip/cons_benderslp.c, every
6730 * active Benders' decompositions are called. The execution function of the Benders' decomposition calls each of the
6731 * subproblems and generates cuts from their solutions. So the active Benders' decompositions are called in order of
6732 * priority until a cut is generated or feasibility is proven.
6733 * \n
6734 * The priority of the Benders' decomposition should be set according to the difficulty of solving the subproblems and
6735 * the generation of cuts. However, it is possible to prioritise the Benders' decompositions with respect to the
6736 * strength of the subproblem formulation and the resulting cuts.
6737 *
6738 * \par BENDERS_CUTLP: should Benders' decomposition cuts be generated during the enforcement of LP solutions.
6739 * This is a flag that is used by src/scip/cons_benders.c and src/scip/cons_benderslp.c to idicate whether the
6740 * enforcement of LP solutions should involve solving the Benders' decomposition subproblems. This should be set to TRUE
6741 * to have an exact solution algorithm. In the presence of multiple Benders' decomposition, it may be desired to enforce
6742 * the LP solutions for only a subset of those implemented.
6743 *
6744 * \par BENDERS_CUTRELAX: should Benders' decomposition cuts be generated during the enforcement of relaxation solutions.
6745 * This is a flag that is used by src/scip/cons_benders.c and src/scip/cons_benderslp.c to idicate whether the
6746 * enforcement of relaxation solutions should involve solving the Benders' decomposition subproblems. This should be
6747 * set to TRUE to have an exact solution algorithm. In the presence of multiple Benders' decomposition, it may be desired
6748 * to enforce the relaxation solutions for only a subset of those implemented. This parameter will only take effect if
6749 * external relaxation have been implemented.
6750 *
6751 * \par BENDERS_CUTPSEUDO: should Benders' decomposition subproblems be solved during the enforcement of pseudo solutions.
6752 * This is a flag that is used by src/scip/cons_benders.c and src/scip/cons_benderslp.c to indicate whether the
6753 * enforcement of pseudo solutions should involve solving the Benders' decomposition subproblems. This should be set to
6754 * TRUE, since not enforcing pseudo solutions could result in an error or suboptimal result. During the enforcement of
6755 * pseudo solutions, no cuts are generated. Only a flag to indicate whether the solution is feasible or if the LP should
6756 * be solved again is returned.
6757 *
6758 * \par BENDERS_SHAREAUXVARS: should this Benders' decomposition use the auxiliary variables from the highest priority
6759 * Benders' decomposition.
6760 * This parameter only takes effect if multiple Benders' decompositions are implemented. Consider the case that two Benders'
6761 * decompositions are implemented with different formulations of the subproblem. Since the subproblems in each of the
6762 * decomposition will have the same optimal solution, then it is useful to only have a single auxiliary variable for the
6763 * two different subproblems. This means that when an optimality cut is generated in the lower priority Benders'
6764 * decomposition, the auxiliary variable from the highest priority Benders' decomposition will be added to the right
6765 * hand side.
6766 *
6767 * @section BENDERS_DATA Benders' decomposition Data
6768 *
6769 * Below the header "Data structures" you can find a struct which is called "struct SCIP_BendersData".
6770 * In this data structure, you can store the data of your Benders' decomposition. For example, you should store the adjustable
6771 * parameters of the Benders' decomposition in this data structure. In a Benders' decomposition, user parameters for the
6772 * number of subproblems and an array to store the subproblem SCIP instances could be useful.
6773 * \n
6774 * Defining Benders' decomposition data is optional. You can leave the struct empty.
6775 *
6776 * @section BENDERS_INTERFACE Interface Functions
6777 *
6778 * At the bottom of "benders_mybenders.c", you can find the interface function SCIPincludeBendersMybenders(),
6779 * which also appears in "benders_mybenders.h"
6780 * SCIPincludeBendersMybenders() is called by the user, if (s)he wants to include the Benders' decomposition,
6781 * i.e., if (s)he wants to use the Benders' decomposition in his/her application.
6782 *
6783 * This function only has to be adjusted slightly.
6784 * It is responsible for notifying SCIP of the presence of the Benders' decomposition. For this, you can either call SCIPincludeBenders(),
6785 * or SCIPincludeBendersBasic() since SCIP version 3.0. In the latter variant, \ref BENDERS_ADDITIONALCALLBACKS "additional callbacks"
6786 * must be added via setter functions as, e.g., SCIPsetBendersCopy(). We recommend this latter variant because
6787 * it is more stable towards future SCIP versions which might have more callbacks, whereas source code using the first
6788 * variant must be manually adjusted with every SCIP release containing new callbacks for Benders' decompositions in order to compile.
6789 *
6790 * If you are using Benders' decomposition data, you have to allocate the memory
6791 * for the data at this point. You can do this by calling:
6792 * \code
6793 * SCIP_CALL( SCIPallocBlockMemory(scip, &bendersdata) );
6794 * \endcode
6795 * You also have to initialize the fields in "struct SCIP_BendersData" afterwards. For freeing the
6796 * Benders' decomposition data, see \ref BENDERSFREE.
6797 *
6798 * You may also add user parameters for your Benders' decomposition, see \ref PARAM for how to add user parameters and
6799 * the function SCIPincludeBendersDefault() in src/scip/benders_default.c for an example.
6800 *
6801 * It is advised to disable presolving for the Benders' decomposition master problem by calling SCIPsetPresolving() with
6802 * the parameter SCIP_PARAMSETTING_OFF. Presolving should be disabled because reductions on the master problem could be
6803 * invalid since constraints have been transferred to the subproblems. It is not necessary to disable all presolving,
6804 * but care must be taken when it is used for the Benders' decomposition master problem.
6805 *
6806 * The Benders' decomposition constraint handler, see src/scip/cons_benders.c, includes a presolver for tightening the
6807 * bound on the auxiliary variables. This presolver can be enabled with by setting "presolving/maxround" to 1 and
6808 * "constraints/benders/maxprerounds" to 1. This presolver solves the Benders' decomposition subproblems without fixing
6809 * the master problem variables to find a lower bound for the auxiliary variable.
6810 *
6811 *
6812 * @section BENDERS_FUNDAMENTALCALLBACKS Fundamental Callbacks of a Benders' decomposition
6813 *
6814 * The fundamental callbacks of the plugins are the ones that have to be implemented in order to obtain
6815 * an operational algorithm.
6816 * They are passed together with the Benders' decomposition itself to SCIP using SCIPincludeBenders() or SCIPincludeBendersBasic(),
6817 * see @ref BENDERS_INTERFACE.
6818 *
6819 * Benders' decomposition plugins have two callbacks, @ref BENDERSGETVAR and @ref BENDERSCREATESUB that must be implemented.
6820 *
6821 * Additional documentation for the callbacks, in particular to their input parameters,
6822 * can be found in type_benders.h.
6823 *
6824 * @subsection BENDERSGETVAR
6825 *
6826 * The BENDERSGETVAR callback provides a mapping between the master problem variables and their corresponding subproblem
6827 * variables, and vice versa. The parameters of this function include the variable for which the mapped variable is
6828 * desired and the problem number for the mapped variable. When requesting a subproblem variable for a given master
6829 * problem variable, the master variable is input with the appropriate subproblem index. If a master problem variable is
6830 * requested for a given subproblem variable, then the subproblem variable is input with the subproblem index given as
6831 * -1.
6832 *
6833 * An example of how to implement the mapping between the master and subproblem variables is shown by
6834 *
6835 * @refsnippet{src/scip/benders_default.c,SnippetBendersGetvarDefault}
6836 *
6837 * In the above code snippet, the hashmaps providing the mapping between the master and subproblem variables are
6838 * constructed in the <code>SCIP_STAGE_INIT</code> stage (see \ref BENDERSINIT).
6839 *
6840 * The requested variable is returned via the mappedvar parameter. There may not exist a corresponding master
6841 * (subproblem) variable for every input subproblem (master) variable. In such cases were no corresponding variable
6842 * exists, mappedvar must be returned as NULL.
6843 *
6844 * The mapped variables are retrieved by calling SCIPgetBendersMasterVar() and SCIPgetBendersSubproblemVar().
6845 *
6846 * The variable mapping must be created before <code>SCIP_STAGE_PRESOLVE</code> stage. This is because the variable
6847 * mapping is required for checking solutions found by heuristics during presolving.
6848 *
6849 * @subsection BENDERSCREATESUB
6850 *
6851 * The BENDERSCREATESUB callback is executed during the <code>SCIP_STAGE_INIT</code> stage. In this function, the
6852 * user must register the SCIP instances for each subproblem. The BENDERSCREATESUB callback is executed once for each
6853 * subproblem. The user registers a subproblem by calling SCIPbendersAddSubproblem().
6854 *
6855 * It is possible to build the SCIP instance for the subproblem during the execution of this callback. However, it may
6856 * be more convenient to build the subproblem instances during the problem creation stage of the master problem and
6857 * store the subproblem SCIP instances in SCIP_BendersData. This approach is used in src/scip/benders_default.c.
6858 *
6859 * @section BENDERS_ADDITIONALCALLBACKS Additional Callbacks of a Benders' decomposition implementation
6860 *
6861 * The additional callbacks do not need to be implemented in every case. However, some of them have to be
6862 * implemented for most applications, they can be used, for example, to initialize and free private data.
6863 * Additional callbacks can either be passed directly with SCIPincludeBenders() to SCIP or via specific
6864 * <b>setter functions</b> after a call of SCIPincludeBendersBasic(), see also @ref BENDERS_INTERFACE.
6865 *
6866 * @subsection BENDERSFREE
6867 *
6868 * If you are using Benders' decomposition data (see \ref BENDERS_DATA and \ref BENDERS_INTERFACE), you have to
6869 * implement this function in order to free the Benders' decomposition data. This can be done by the following procedure:
6870 *
6871 * @refsnippet{src/scip/benders_default.c,SnippetBendersFreeDefault}
6872 *
6873 * If you have allocated memory for fields in your Benders' decomposition data, remember to free this memory
6874 * before freeing the Benders' decomposition data itself.
6875 * If you are using the C++ wrapper class, this function is not available.
6876 * Instead, just use the destructor of your class to free the member variables of your class.
6877 *
6878 * @subsection BENDERSCOPY
6879 *
6880 * The BENDERSCOPY callback is executed when a SCIP instance is copied, e.g. to
6881 * solve a sub-SCIP. By
6882 * defining this callback as
6883 * <code>NULL</code> the user disables the execution of the specified
6884 * separator for all copied SCIP instances. This may deteriorate the performance
6885 * of primal heuristics using sub-SCIPs.
6886 *
6887 * If a user wishes to employ the Large Neighbourhood Benders' Search, it is necessary for the BENDERSCOPY callback to
6888 * be implemented. This is required because the sub-SCIP instances of large neighbourhood search heuristics can only
6889 * access the implemented Benders' decomposition if it is copied via the BENDERSCOPY callback.
6890 *
6891 * @subsection BENDERSINIT
6892 *
6893 * The BENDERSINIT callback is executed after the problem is transformed.
6894 * The Benders' decomposition implementation may, e.g., use this call to initialize its Benders' decomposition data. In
6895 * src/scip/benders_default.c BENDERSINIT is used to create the mapping between the master and subproblem variables.
6896 * The difference between the original and the transformed problem is explained in
6897 * "What is this thing with the original and the transformed problem about?" on \ref FAQ.
6898 *
6899 * @subsection BENDERSEXIT
6900 *
6901 * The BENDERSEXIT callback is executed before the transformed problem is freed.
6902 * In this function, the Benders' decomposition implementation should free all resources that have been allocated for
6903 * the solving process in BENDERSINIT.
6904 *
6905 * @subsection BENDERSINITPRE
6906 *
6907 * The BENDERSINITPRE callback is executed before the preprocessing is started, even if presolving is turned off.
6908 * The Benders' decomposition may use this call to initialize its presolving data before the presolving process begins.
6909 *
6910 * @subsection BENDERSEXITPRE
6911 *
6912 * The BENDERSEXITPRE callback is executed after the preprocessing has been finished, even if presolving is turned off.
6913 * The Benders' decomposition implementation may use this call, e.g., to clean up its presolving data.
6914 * Besides clean up, no time consuming operations should be done.
6915 *
6916 * @subsection BENDERSINITSOL
6917 *
6918 * The BENDERSINITSOL callback is executed when the presolving is finished and the branch-and-bound process is about to
6919 * begin. The Benders' decomposition implementation may use this call to initialize its branch-and-bound specific data.
6920 *
6921 * @subsection BENDERSEXITSOL
6922 *
6923 * The BENDERSEXITSOL callback is executed before the branch-and-bound process is freed. The Benders' decomposition
6924 * implementation should use this call to clean up its branch-and-bound data.
6925 *
6926 * @subsection BENDERSPRESUBSOLVE
6927 *
6928 * The BENDERSPRESUBSOLVE callback is provided to give the user an opportunity in each iteration to perform any setup
6929 * operations prior to solving the subproblems. This callback also allows the user to skip the subproblem solve for the
6930 * current iteration. In this case, the user must set the result parameter appropriately
6931 * - the subproblem was not solved in this iteration. Other decompositions will be checked (SCIP_DIDNOTRUN).
6932 * - a constraint has been added to the master problem. No other decompositions will be checked (SCIP_CONSADDED).
6933 * - a cut has been added to the master problem. No other decompositions will be checked (SCIP_SEPARATED).
6934 * - feasibility of the solution is reported to SCIP. Other decompositions will be checked (SCIP_FEASIBLE).
6935 * - infeasibility of the solution is reported to SCIP. No other decompositions will be checked (SCIP_INFEASIBLE).
6936 *
6937 * @subsection BENDERSSOLVESUBCONVEX
6938 *
6939 * Two different subproblem solving functions are provide in the Benders' decomposition framework, BENDERSSOLVESUBCONVEX
6940 * and BENDERSSOLVESUB. These two solving functions are used in the two solving loops of the Benders' decomposition
6941 * framework. The first solving loop solves convex subproblems and convex relaxations of CIPs. The BENDERSSOLVESUBCONVEX
6942 * callback is executed only during the FIRST solving loop. Benders' cut generating functions suitable for convex
6943 * subproblems are executed during this solving loop. If a cut is found, then the second solve loop is not executed. If
6944 * your decomposition does not have any convex subproblems, then it is not necessary to implement the
6945 * BENDERSSOLVESUBCONVEX callback. However, it may be computationally beneficial to solve the convex relaxation of CIP
6946 * subproblems, such as the LP relaxation of a MIP subproblem.
6947 *
6948 * The second solve loop expects that the CIP subproblems are solved to optimality.
6949 *
6950 * If you implement the BENDERSSOLVESUBCONVEX callback, it is necessary to implement the BENDERSFREESUB callback.
6951 *
6952 * The objective function value after the subproblem solve and the result must be returned. The permissible results
6953 * are:
6954 * - the subproblem was not solved in this iteration (SCIP_DIDNOTRUN)
6955 * - the subproblem is solved and is feasible (SCIP_FEASIBLE)
6956 * - the subproblem is solved and is infeasible (SCIP_INFEASIBLE)
6957 * - the subproblem is solved and is unbounded (SCIP_UNBOUNDED)
6958 *
6959 * @subsection BENDERSSOLVESUB
6960 *
6961 * The BENDERSSOLVESUB is executed only during the SECOND solve loop. This callback is used to solve CIP
6962 * subproblems. If your decomposition does not have any CIP subproblems, then it is not necessary to implement the
6963 * BENDERSSOLVESUB callback.
6964 *
6965 * If you implement the BENDERSSOLVESUB callback, it is necessary to implement the BENDERSFREESUB callback.
6966 *
6967 * The objective function value after the subproblem solve and the result must be returned. The permissible results
6968 * are:
6969 * - the subproblem was not solved in this iteration (SCIP_DIDNOTRUN)
6970 * - the subproblem is solved and is feasible (SCIP_FEASIBLE)
6971 * - the subproblem is solved and is infeasible (SCIP_INFEASIBLE)
6972 * - the subproblem is solved and is unbounded (SCIP_UNBOUNDED)
6973 *
6974 * @subsection BENDERSPOSTSOLVE
6975 *
6976 * The BENDERSPOSTSOLVE callback is executed after the subproblems have been solved and any required cuts have been
6977 * generated, but before the subproblems are freed. This callback provides the user an opportunity to interact the
6978 * subproblems at a global level. For example, the user is able to construct a solution to the original problem by
6979 * combining the solutions from the master problem and all subproblems.
6980 *
6981 * Additionally, the user is able to merge subproblems into the master problem during the execution of this callback.
6982 * The merging of subproblems into the master problem could be desired if it is too time consuming to satisfy the
6983 * feasibility of a subproblem or the appropriate cutting functions are not available for the provided subproblem. A list
6984 * of indicies of subproblems suitable for merging are given in the mergecands array. The first npriomergecands are the
6985 * merge candidates that must be merged into the master problem. If they are not, then the solution process will
6986 * terminate with an error. These merge candidates arise if a cut could not be generated due to numerical difficulties.
6987 * The remaining nmergecands - npriomergecands are subproblems that could be merged into the master problem if desired
6988 * by the user.
6989 *
6990 * @subsection BENDERSFREESUB
6991 *
6992 * The BENDERSFREESUB callback is executed to clean up the subproblems after the solving process and prepare them for
6993 * the next iteration. Typically, SCIPfreeTransform() is called for each subproblem to free the transformed problem.
6994 *
6995 */
6996
6997/*--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
6998
6999/**@page BENDERSCUT How to add custom Benders' decomposition cut generation functions
7000 *
7001 * The Benders' decomposition framework of SCIP allows the user to provide a custom implementation of cut generation
7002 * method. The Benders' decomposition cut methods are linked to the Benders' decomposition implementations, not the
7003 * master problem SCIP instance. As such, you are able to have different Benders' decomposition cut methods for each
7004 * included Benders' decomposition.
7005 * The current list of all Benders' decomposition cut generation methods available in this release can be found
7006 * \ref BENDERSCUTS "here".
7007 *
7008 * We now explain how users can add their own Benders' decomposition cut methods. Take the default Benders'
7009 * decomposition cut method (src/scip/benderscut_opt.c) as an example. This Benders' decomposition cut method generates
7010 * a classical optimality cut from the optimal dual solution to the convex relaxation of the Benders' decomposition
7011 * subproblem. Same as all other default plugins, it is written in C. C++ users can easily adapt the code by using the
7012 * scip::ObjBenderscut wrapper base class and implement the scip_...() virtual methods instead of the
7013 * SCIP_DECL_BENDERSCUT... callbacks.
7014 *
7015 * Additional documentation for the callbacks of a Benders' decomposition cut methods, in particular for the
7016 * input parameters, can be found in the file type_benderscut.h.
7017 *
7018 * Here is what you have to do to implement a custom Benders' decomposition cut method:
7019 * -# Copy the template files src/scip/benderscut_xyz.c and src/scip/benderscut_xyz.h into files "benderscut_mybenderscut.c" and
7020 * "benderscut_mybenderscut.h".
7021 \n
7022 * Make sure to adjust your build system such that these files are compiled and linked to your project. \n
7023 * If you are adding a new default plugin, this means updating the `src/CMakeLists.txt` and `Makefile` files in the SCIP distribution.
7024 * -# Use SCIPincludeBenderscutMybenderscut() in order to include the Benders' decomposition cut method into your SCIP
7025 * instance, e.g., in the main file of your project (see, e.g., src/cmain.c in the Binpacking example). \n
7026 * If you are adding a new default plugin, this include function must be added to `src/scipdefplugins.c`.
7027 * -# Open the new files with a text editor and replace all occurrences of "xyz" by "mybenderscut".
7028 * -# Adjust the properties of the Benders' decomposition (see \ref BENDERSCUT_PROPERTIES).
7029 * -# Define the Benders' decomposition data (see \ref BENDERSCUT_DATA). This is optional.
7030 * -# Implement the interface functions (see \ref BENDERSCUT_INTERFACE).
7031 * -# Implement the fundamental callbacks (see \ref BENDERSCUT_FUNDAMENTALCALLBACKS).
7032 * -# Implement the additional callbacks (see \ref BENDERSCUT_ADDITIONALCALLBACKS). This is optional.
7033 *
7034 *
7035 * @section BENDERSCUT_PROPERTIES Properties of a Benders' decomposition
7036 *
7037 * At the top of the new file "benderscut_mybenderscut.c", you can find the Benders' decomposition cut methods
7038 * properties. These are given as compiler defines.
7039 * In the C++ wrapper class, you have to provide the Benders' decomposition properties by calling the constructor
7040 * of the abstract base class scip::ObjBenderscut from within your constructor.
7041 * The properties you have to set have the following meaning:
7042 *
7043 * \par BENDERSCUT_NAME: the name of the Benders' decomposition cut method.
7044 * This name is used in the interactive shell to address the Benders' decomposition cut method.
7045 * Additionally, if you are searching for a Benders' decomposition cut method with SCIPfindBenderscut(), this name is
7046 * looked up. Names have to be unique: no two Benders' decomposition cut methods linked to the same Benders'
7047 * decomposition may have the same name.
7048 *
7049 * \par BENDERSCUT_DESC: the description of the Benders' decomposition cut method.
7050 * This string is printed as a description of the Benders' decomposition cut method in the interactive shell.
7051 *
7052 * \par BENDERSCUT_PRIORITY: the priority of the Benders' decomposition cut method.
7053 * In each of the Benders' decomposition subproblem solving loops, the included Benders' decomposition cut methods are
7054 * called in order of priority. The priority is important because once a cut is generated for a subproblem, no other
7055 * cuts are generated for that subproblem for that solving loop.
7056 * \n
7057 * The priority of the Benders' decomposition should be set according to the order in which the cut should be generated.
7058 * For example, the priority of the included cuts attempt to generation feasibility cuts (src/scip/benderscut_feas.c
7059 * and src/scip/benderscut_nogood.c) prior to attempting to generate optimality cuts.
7060 *
7061 * \par BENDERSCUT_LPCUT: Can this cut be applied to convex subproblems and convex relaxations of CIP subproblems?
7062 * Since the Benders' decomposition framework executes two different solving loops, one for convex subproblems and the
7063 * other for CIP subproblems, the Benders' decomposition cut methods must be partitioned by their suitability for each
7064 * subproblem type. If BENDERSCUT_LPCUT is set to TRUE, then this cut is only applied to convex subproblems and convex
7065 * relaxations of CIP subproblems.
7066 *
7067 * @section BENDERSCUT_DATA Benders' decomposition Data
7068 *
7069 * Below the header "Data structures" you can find a struct which is called "struct SCIP_BenderscutData".
7070 * In this data structure, you can store the data of your Benders' decomposition. For example, you should store the adjustable
7071 * parameters of the Benders' decomposition in this data structure. In a Benders' decomposition, user parameters for the
7072 * number of subproblems and an array to store the subproblem SCIP instances could be useful.
7073 * \n
7074 * Defining Benders' decomposition data is optional. You can leave the struct empty.
7075 *
7076 * @section BENDERSCUT_INTERFACE Interface Functions
7077 *
7078 * At the bottom of "benderscut_mybenderscut.c", you can find the interface function SCIPincludeBenderscutMybenderscut(),
7079 * which also appears in "benderscut_mybenderscut.h"
7080 * SCIPincludeBenderscutMybenderscut() is called by the user, if (s)he wants to include the Benders' decomposition,
7081 * i.e., if (s)he wants to use the Benders' decomposition in his/her application.
7082 *
7083 * This function only has to be adjusted slightly.
7084 * It is responsible for notifying SCIP of the presence of the Benders' decomposition. For this, you can either call SCIPincludeBenderscut(),
7085 * or SCIPincludeBenderscutBasic() since SCIP version 3.0. In the latter variant, \ref BENDERSCUT_ADDITIONALCALLBACKS "additional callbacks"
7086 * must be added via setter functions as, e.g., SCIPsetBenderscutCopy(). We recommend this latter variant because
7087 * it is more stable towards future SCIP versions which might have more callbacks, whereas source code using the first
7088 * variant must be manually adjusted with every SCIP release containing new callbacks for Benders' decompositions in order to compile.
7089 *
7090 * If you are using Benders' decomposition cut data, you have to allocate the memory
7091 * for the data at this point. You can do this by calling:
7092 * \code
7093 * SCIP_CALL( SCIPallocBlockMemory(scip, &benderscutdata) );
7094 * \endcode
7095 * You also have to initialize the fields in "struct SCIP_BenderscutData" afterwards. For freeing the
7096 * Benders' decomposition cut data, see \ref BENDERSCUTFREE.
7097 *
7098 * You may also add user parameters for your Benders' decomposition, see \ref PARAM for how to add user parameters and
7099 * the function SCIPincludeBenderscutOpt() in src/scip/benderscut_opt.c for an example.
7100 *
7101 *
7102 * @section BENDERSCUT_FUNDAMENTALCALLBACKS Fundamental Callbacks of a Benders' decomposition cut function
7103 *
7104 * The fundamental callbacks of the plugins are the ones that have to be implemented in order to obtain
7105 * an operational algorithm.
7106 * They are passed together with the Benders' decomposition itself to SCIP using SCIPincludeBenderscut() or SCIPincludeBenderscutBasic(),
7107 * see @ref BENDERSCUT_INTERFACE.
7108 *
7109 * Benders' decomposition cut methods have only one callback, @ref BENDERSCUTEXEC, that must be implemented.
7110 *
7111 * Additional documentation for the callbacks, in particular to their input parameters,
7112 * can be found in type_benderscut.h.
7113 *
7114 * @subsection BENDERSCUTEXEC
7115 *
7116 * The BENDERSCUTEXEC callback is called during the cut generation process within the Benders' decomposition subproblem
7117 * solving loop. This function must generate a cut for the given subproblem if the associated subsystem is not optimal
7118 * with respect to the checked master problem solution.
7119 *
7120 * When generating cuts, it is possible to store these within the SCIP_BendersData of the associated Benders'
7121 * decomposition. This is achieved by calling SCIPstoreBenderscutCons() (SCIPstoreBenderscutCut() if the Benders'
7122 * decomposition cut is added as a cutting plane instead as a constraint). The storing of cuts can be useful when using
7123 * the large neighbourhood Benders' search, where the cut generated in the sub-SCIP solve are transferred to the main
7124 * SCIP instance.
7125 *
7126 * The BENDERSCUTEXEC callback must return the result of the cut generation. The permissable results are:
7127 * - if the Benders' cut was not run (SCIP_DIDNOTRUN).
7128 * - if the Benders' cut was run, but there was an error in generating the cut (SCIP_DIDNOTFIND).
7129 * - if the Benders' decomposition cut algorithm has not generated a constraint or cut (SCIP_FEASIBLE).
7130 * - an additional constraint for the Benders' decomposition cut was generated (SCIP_CONSADDED).
7131 * - a cutting plane representing the Benders' decomposition cut was generated (SCIP_SEPARATED).
7132 *
7133 * If the BENDERSCUTEXEC callback returns SCIP_DIDNOTFIND due to an error in the cut generation, if no other subproblems
7134 * generate a cut during the same iteration of the Benders' decomposition algorithm, then this could result in an
7135 * error. It is possible to avoid the error by merging the subproblem into the master problem (see \ref
7136 * BENDERSPOSTSOLVE).
7137 *
7138 * @section BENDERSCUT_ADDITIONALCALLBACKS Additional Callbacks of a Separator
7139 *
7140 * The additional callbacks do not need to be implemented in every case. However, some of them have to be
7141 * implemented for most applications, they can be used, for example, to initialize and free private data.
7142 * Additional callbacks can either be passed directly with SCIPincludeBenderscut() to SCIP or via specific
7143 * <b>setter functions</b> after a call of SCIPincludeBenderscutBasic(), see also @ref BENDERSCUT_INTERFACE.
7144 *
7145 * @subsection BENDERSCUTFREE
7146 *
7147 * If you are using Benders' decomposition cut data (see \ref BENDERSCUT_DATA and \ref BENDERSCUT_INTERFACE), you have
7148 * to implement this function in order to free the Benders' decomposition cut data.
7149 *
7150 * If you have allocated memory for fields in your Benders' decomposition cut data, remember to free this memory
7151 * before freeing the Benders' decomposition data itself.
7152 * If you are using the C++ wrapper class, this method is not available.
7153 * Instead, just use the destructor of your class to free the member variables of your class.
7154 *
7155 * @subsection BENDERSCUTCOPY
7156 *
7157 * The BENDERSCUTCOPY callback is executed when a SCIP instance is copied, e.g. to
7158 * solve a sub-SCIP. By
7159 * defining this callback as
7160 * <code>NULL</code> the user disables the execution of the specified
7161 * separator for all copied SCIP instances. This may deteriorate the performance
7162 * of primal heuristics using sub-SCIPs.
7163 *
7164 * If the Benders' decomposition cuts are included by calling SCIPincludeBendersDefaultCuts() in the include function of
7165 * the Benders' decomposition implementation, such as SCIPincludeBendersDefault(), then it is not necessary to implement
7166 * BENDERSCUTCOPY. The copy function could be implemented to copy Benders' decomposition cut data from the original SCIP
7167 * instance to the sub-SCIP.
7168 *
7169 *
7170 * @subsection BENDERSCUTINIT
7171 *
7172 * The BENDERSCUTINIT callback is executed after the problem is transformed The Benders' decomposition cut method may,
7173 * e.g., use this call to initialize its Benders' decomposition cut data. The difference between the original and the
7174 * transformed problem is explained in "What is this thing with the original and the transformed problem about?" on \ref
7175 * FAQ.
7176 *
7177 * @subsection BENDERSCUTEXIT
7178 *
7179 * The BENDERSCUTEXIT callback is executed before the transformed problem is freed. In this function, the Benders'
7180 * decomposition cut method should free all resources that have been allocated for the solving process in
7181 * BENDERSCUTINIT.
7182 *
7183 * @subsection BENDERSCUTINITSOL
7184 *
7185 * The BENDERSCUTINITSOL callback is executed when the presolving is finished and the branch-and-bound process is about to
7186 * begin. The Benders' decomposition implementation may use this call to initialize its branch-and-bound specific data.
7187 *
7188 * @subsection BENDERSCUTEXITSOL
7189 *
7190 * The BENDERSCUTEXITSOL callback is executed before the branch-and-bound process is freed. The Benders' decomposition
7191 * implementation should use this call to clean up its branch-and-bound data.
7192 *
7193 */
7194/*--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
7195
7196/**@page CONF How to use conflict analysis
7197 *
7198 * Conflict analysis is a way to automatically use the information obtained from infeasible nodes
7199 * in the branch-and-bound tree.
7200 *
7201 * Once a node is declared infeasible, SCIP automatically tries to infer a constraint that explains the reason for the
7202 * infeasibility, in order to avoid similar situations later in the search. This explanation essentially consists of a
7203 * constraint stating that at least one of its variables should have a bound different from the current infeasible node,
7204 * because the current setting led to infeasibility. Clearly, all variables that are fixed in the current infeasible
7205 * node would yield such a constraint (since this leads to infeasibility). The key point rather is to infer a "small"
7206 * constraint that does the same job. SCIP handles this by several heuristics. For this, SCIP sets up a
7207 * so-called (directed) conflict graph. The nodes in this graph correspond to bound changes of variables and an arc (@a
7208 * u, @a v) means that the bound change corresponding to @a v is based on the bound change of @a u. In general, a node
7209 * will have several ingoing arcs which represent all bound changes that have been used to infer (propagate) the bound
7210 * change in question. The graph also contains source nodes for each bound that has been changed during branching and an
7211 * artificial target node representing the conflict, i.e., the infeasibility. Essentially, SCIP heuristically constructs
7212 * a cut in this graph that involves few "branching nodes". For details on the techniques that SCIP uses,
7213 * we refer to the paper @par
7214 * Tobias Achterberg, Conflict Analysis in Mixed Integer Programming@n
7215 * Discrete Optimization, 4, 4-20 (2007)
7216 *
7217 * For conflict analysis to work well, the author of a \ref CONS "Constraint Handler" or a
7218 * \ref PROP "Propagator" has to implement three kinds of functionality:
7219 *
7220 * -# If one detects infeasibility, one should initiate conflict analysis, see \ref INITCONFS "below".
7221 * -# During propagation, one should call the right functions to fix variables.
7222 * -# One should implement the <em>so-called reverse propagation</em>.
7223 *
7224 * If this functionality is not implemented, SCIP will still work correctly, but cannot use the information of the constraint
7225 * handler or the propagator for conflict analysis. In this case, each bound reduction performed by the constraint
7226 * handler/propagator will be treated as if it had been a branching decision.
7227 *
7228 * @section INITCONFS Initiating Conflict Analysis
7229 *
7230 * If one detects infeasibility within propagation, one should do the following:
7231 * -# Call SCIPinitConflictAnalysis().
7232 * -# Inform SCIP about the variable bounds that are the reason for the detection of infeasibility
7233 * via the functions SCIPaddConflictLb(), SCIPaddConflictUb(), SCIPaddConflictBd(), or
7234 * SCIPaddConflictBinvar(). If there is more than one valid explanation of infeasibility, either one can be used.
7235 * Typically, smaller explanations tend to be better.
7236 * -# Call SCIPanalyzeConflict() from a propagator or SCIPanalyzeConflictCons() from a constraint
7237 * handler.
7238 *
7239 * This functionality allows SCIP to set up the conflict graph and perform a conflict analysis.
7240 *
7241 * @section Propagation
7242 *
7243 * When propagating variable domains, SCIP needs to be informed that the deduced variable bounds should be
7244 * used in conflict analysis. This can be done by the functions SCIPinferVarLbCons(),
7245 * SCIPinferVarUbCons(), and SCIPinferBinvarCons() for constraint handlers and SCIPinferVarLbProp(),
7246 * SCIPinferVarUbProp(), and SCIPinferBinvarProp() for propagators. You can pass one integer of
7247 * information that should indicate the reason of the propagation and can be used in reverse
7248 * propagation, see the next section.
7249 *
7250 * @section RESPROP Reverse Propagation
7251 *
7252 * Reverse Propagation is used to build up the conflict graph. Essentially, it provides an algorithm to detect the arcs
7253 * leading to a node in the conflict graph, i.e., the bound changes responsible for the new bound change deduced during
7254 * propagation. Reverse Propagation needs to be implemented in the RESPROP callbacks of
7255 * \ref CONSRESPROP "constraint handlers" or \ref PROPRESPROP "propagators".
7256 * These callbacks receive the following information: the variable which is under investigation (@p
7257 * infervar), the corresponding bound change (@p bdchgidx, @p boundtype), and the integer (@p inferinfo) that has been
7258 * supplied during propagation.
7259 *
7260 * One can use SCIPgetVarUbAtIndex() or SCIPgetVarLbAtIndex() to detect the bounds before or after the propagation that
7261 * should be investigated. Then the bounds that were involved should be passed to SCIP via SCIPaddConflictLb() and
7262 * SCIPaddConflictUb(). If there is more than one valid explanation of infeasibility, either one can be used.
7263 * Typically, smaller explanations tend to be better.
7264 *
7265 * Details and (more) examples are given in Sections @ref CONSRESPROP and @ref PROPRESPROP.
7266 *
7267 *
7268 * @section Example
7269 *
7270 * Consider the constraint handler @p cons_linearordering.c in the
7271 * \ref LOP_MAIN "linear ordering example"
7272 * (see @p example/LOP directory). This constraint handler propagates the equations \f$x_{ij} + x_{ji} =
7273 * 1\f$ and triangle inequalities \f$x_{ij} + x_{jk} + x_{ki} \leq 2\f$.
7274 *
7275 * When propagating the equation and <code>vars[i][j]</code> is fixed to 1, the constraint handler uses
7276 * \code
7277 * SCIP_CALL( SCIPinferBinvarCons(scip, vars[j][i], FALSE, cons, i*n + j, &infeasible, &tightened) );
7278 * \endcode
7279 * Thus, variable <code>vars[j][i]</code> is fixed to 0 (@p FALSE), and it passes <code>i*n + j </code> as @p inferinfo.
7280 *
7281 * When it propagates the triangle inequality and both <code>vars[i][j]</code> and <code>vars[j][k]</code>
7282 * are fixed to 1, the constraint handler uses
7283 * \code
7284 * SCIP_CALL( SCIPinferBinvarCons(scip, vars[k][i], FALSE, cons, n*n + i*n*n + j*n + k, &infeasible, &tightened) );
7285 * \endcode
7286 * Thus, in this case, variable <code>vars[k][i]</code> is fixed to 0 and <code>n*n + i*n*n + j*n + k</code> is
7287 * passed as <code>inferinfo</code>.
7288 *
7289 * In reverse propagation, the two cases can be distinguished by @p inferinfo: if it is less than @p n*n,
7290 * we deal with an equation, otherwise with a triangle inequality. The constraint handler can then extract the
7291 * indices @p i, @p j (and @p k in the second case) from inferinfo.
7292 *
7293 * In the first case, it has to distinguish whether <code>vars[i][j]</code> is fixed to 0 or 1 &ndash;
7294 * by calling SCIPaddConflictLb()
7295 * or SCIPaddConflictUb(), respectively, with variable <code>vars[j][i]</code>. In the second case, it is clear that the only
7296 * possible propagation is to fix <code>vars[i][j]</code> to 0 when both <code>vars[k][i]</code> and <code>vars[j][k]</code>
7297 * are fixed to 1. It then calls
7298 * SCIPaddConflictLb() for both <code>vars[k][i]</code> and <code>vars[j][k]</code>.
7299 */
7300
7301/*--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
7302
7303/**@page REOPT How to use reoptimization
7304 *
7305 * The reoptimization feature of SCIP can be used to solve a sequence of optimization problems \f$(P_{i})_{i \in I}\f$ with
7306 * \f[
7307 * (P_i) \quad \min \{ c_i^T x \;|\; A^ix \geq b^i,\; x_{j} \in \mathbb{Z}\;\forall j \in \mathcal{I} \}
7308 * \f]
7309 * such that between two problems \f$P_i\f$ and \f$P_{i+1}\f$ the space of solutions gets restricted and/or the objective
7310 * function changes. To use reoptimization the user has to change the parameter <code>reoptimization/enable</code> to
7311 * <code>TRUE</code> before the solving process of the first problem of the sequence starts, i.e., in stage
7312 * <code>SCIP_STAGE_INIT</code> or <code>SCIP_STAGE_PROBLEM</code>. This can be done via the interactive shell or by
7313 * calling SCIPenableReoptimization(). In both cases SCIP changes some parameters and fixes them:
7314 * -# disable conflict analysis based on dual information
7315 * -# set the limit <code>maxorigsol</code> of stored solutions to zero because this is handled by a special solution tree provided
7316 * by the reoptimization feature itself
7317 * -# disable restarts (<code>presolving/maxrestarts = 0</code>)
7318 * -# disable multi-aggegations (<code>presolving/donotmultaggr = TRUE</code>)
7319 * -# disable dual reductions within presolvers and propagators (<code>misc/allowdualreds = FALSE</code>)
7320 * -# disable propagation with current cutoff bound (<code>misc/allowobjprop = FALSE</code>)
7321 *
7322 * In contrast to the presolving and propagating functions that are using dual information, performing strong branching is
7323 * allowed. The bound tightenings resulting from strong branching are handeled in a special way. After changing the objective
7324 * function and solving the modified problem the feasible region that was pruned by strong branching will be reconstructed
7325 * within the tree.
7326 *
7327 * If the reoptimization feature is enabled SCIP tries to reuse the search tree, especially the search frontier at the end
7328 * of the solving process, to speed up the solving process of the following problems. Therefore, the current release
7329 * provides the branching rule <code>branch_nodereopt</code> to reconstruct the tree. SCIP triggers a restart of the
7330 * reoptimization, i.e., solving the problem from scratch, if
7331 *
7332 * -# the stored search tree is too large,
7333 * -# the objective functions changed too much, or
7334 * -# the last \f$n\f$ optimal solution are updated solution of previous runs.
7335 *
7336 * The thresholds to trigger a restart can be set by the user:
7337 *
7338 * -# <code>reoptimization/maxsavednodes</code>
7339 * -# <code>reoptimization/delay</code>
7340 * -# <code>reoptimization/forceheurrestart</code>
7341 *
7342 * Before SCIP discards all the stored information and solves the problem from scratch it tries to compress the search
7343 * tree. Therefore, the current release provides compression heuristics that try to find a good and much smaller
7344 * representation of the current search tree.
7345 *
7346 * After a problem in the sequence of optimization problems was solved, the objective function can be changed in two ways:
7347 * -# Using the provided reader <code>reader_diff</code> the objective function can be changed via using the interactive
7348 * shell
7349 * \code
7350 * SCIP> read new_obj.diff
7351 * \endcode
7352 * or by calling SCIPreadDiff().
7353 * -# The objective function can be changed within the code. Therefore, the transformed problem needs to be freed by
7354 * calling SCIPfreeReoptSolve(). Afterwards, the new objective function can be installed by calling
7355 * SCIPchgReoptObjective().
7356 *
7357 * After changing the objective function the modified problem can be solved as usal.
7358 *
7359 * \note Currently, the compression heuristics used between two successive reoptimization runs only support pure binary
7360 * and mixed binary programs.
7361 *
7362 * For more information on reoptimization we refer to@par
7363 * Jakob Witzig@n
7364 * Reoptimization Techniques in MIP Solvers@n
7365 * Master's Thesis, Technical University of Berlin, 2014.
7366 */
7367
7368/*--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
7369
7370/**@page CONCSCIP How to use the concurrent solving mode
7371 *
7372 * @section Overview
7373 *
7374 * In \SCIP 4.0 a new feature has been added that allows to run multiple \SCIP instances with different settings
7375 * on one problem in parallel. To use this feature \SCIP has to be compiled with an additional make option to
7376 * enable the threading functionality (e.g. TPI=tny, see \ref MAKE).
7377 * Then, a concurrent solve can be started by using the <code>concurrentopt</code> command instead of the <code>optimize</code> command
7378 * in the \SCIP shell, or by calling the interface function SCIPsolveConcurrent().
7379 * To configure the behavior of the concurrent solving mode there are new parameters in the category <code>concurrent/</code>
7380 * and <code>parallel/</code> which will be explained here shortly.
7381 *
7382 * @section CONTROLNTHREADS Controlling the number of threads
7383 *
7384 * The parameters <code>parallel/maxnthreads</code> and <code>parallel/minnthreads</code> can be used to configure the number of threads
7385 * that sould be used for solving. \SCIP will try to use the configured maximum number of threads. If the
7386 * problem that is currently read is too large \SCIP will automatically use fewer threads, but never
7387 * go below the configured minimum number of threads.
7388 *
7389 * @section USEEMPHSETTINGS Using emphasis settings
7390 *
7391 * The parameters <code>concurrent/scip.../prefprio</code> configure which concurrent solvers should be used.
7392 * The concurrent solver <code>scip</code> will use the same settings as the \SCIP instance configured by the user.
7393 * The other concurrent solvers, e.g. <code>scip-feas</code>, will load the corresponding emphasis setting.
7394 * The behavior of the prefprio parameter is as follows: If it is set to 1.0 for <code>scip-feas</code> and
7395 * <code>scip-opti</code>, and to 0.0 for every other concurrent solver, then the threads will be evenly
7396 * distributed between the two types <code>scip-feas</code> and <code>scip-opti</code>. An example: if 4 threads are used each of these concurrent
7397 * solvers will use 2 threads. If the <code>prefprio</code> for one solver is set to 0.33 and the other is set to 1.0, then the former will use 1 thread
7398 * and the latter will use 3 threads of the 4 available threads.
7399 *
7400 * @section CUSTOMCONCSOLVERS Running custom solvers
7401 *
7402 * To use custom settings for the concurrent solvers there is the parameter <code>concurrent/paramsetprefix</code>. If custom parameters
7403 * should be loaded by the concurrent solvers, then it must point to the folder where they are located (including a path separator at the end).
7404 * The parameter settings must be named after the concurrent solvers, e.g. if only the concurrent solver <code>scip</code> is used
7405 * they should be named <code>scip-1</code>, <code>scip-2</code>, <code>scip-3</code>. When different types of concurrent solvers are used the counter
7406 * starts at one for each of them, e.g. <code>scip-1</code> and <code>scip-feas-1</code>.
7407 */
7408
7409/*--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
7410
7411/**@page MINUCIIS How to deduce reasons for infeasibility in SCIP
7412 *
7413 * It is a common problem for integer programming practitioners to (unexpectedly) encounter infeasible instances.
7414 * Often it desirable to better understand exactly why the instance is infeasible. Was it an error in the
7415 * input data, was the underlying formulation incorrect, or is my model simply infeasible by construction?
7416 * There are two main ways to analyse infeasible instances using SCIP:
7417 *
7418 * Firstly, there is an IIS (irreducible infeasible subsystem) functionality in SCIP.
7419 * This produces an infeasible problem, which contains a subset of constraints and variable bounds from
7420 * the original problem. The infeasible problem is also irreducible, in that removing any additional
7421 * constraints results in the problem becoming feasible. This is a fantastic method for debugging
7422 * problems, and for determining what needs to be changed in the formulation. To use this functionality
7423 * in the SCIP shell do the following
7424 * \code
7425 * SCIP> read path_to_instance
7426 * SCIP> iis
7427 * \endcode
7428 * This will read in your instance and then compute an IIS of your infeasible instance.
7429 * To display or print the subscip that contains the modified instance that is still
7430 * infeasible, and hopefully substantially smaller, do the following
7431 * \code
7432 * SCIP> display/iis
7433 * SCIP> write/iis path_to_where_iis_should_be_printed
7434 * \endcode
7435 * See \ref PublicInfeasibilityAnalysisMethods "here" for IIS API functions.
7436 * An IIS is returned as a SCIP instance that contains only the constraints and variables of the original SCIP that are part of the IIS.
7437 *
7438 * Secondly there is the MinUC (minimize number of unsatisfied constraints) functionality in SCIP.
7439 * This produces a minimum set of constraints, such that if those constraints were relaxed, the original
7440 * problem would be feasible. To use this functionality in the SCIP shell do the following
7441 * \code
7442 * SCIP> read path_to_instance
7443 * SCIP> change/minuc
7444 * SCIP> optimize
7445 * \endcode
7446 * The second command changes the loaded problem to now minimize the number of
7447 * unsatisfied constraints. The primal bound during solving corresponds to current best solution,
7448 * i.e., a set of constraints which when removed or relaxed will induce feasibility.
7449 * One can view the constraints that art part of the MinUC by seeing which of the variables
7450 * have value 1. The variables in the new problem have naming conventions `originalconsname_master`.
7451 * The solution can be displayed in the shell with the command
7452 * \code
7453 * SCIP> display/solution
7454 * \endcode
7455 * See \ref PublicInfeasibilityAnalysisMethods "here" for MinUC API functions.
7456 */
7457
7458/*--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
7459
7460/**@page DECOMP How to provide a problem decomposition
7461 *
7462 * Most mixed-integer programs have sparse constraint matrices in the sense that most columns and rows have only very few nonzero entries,
7463 * maybe except for a few outlier columns/rows with many nonzeros.
7464 * A decomposition identifies subproblems (subsets of rows and columns) that are only linked to each other via a set of linking rows and/or linking
7465 * columns, but are otherwise independent.
7466 * The special case of completely independent subproblems (with no linking rows and columns), for example, can be solved by solving
7467 * the much smaller subproblems and concatenating their optimal solutions.
7468 * This case has already been integrated into SCIP as a successful presolving technique (see @ref cons_components.c).
7469 * Another use of decomposition within SCIP is the @ref BENDDECF "Benders Decomposition framework".
7470 *
7471 * Since SCIP 7.0, it is easier to pass user decompositions to SCIP that can be used within Benders decomposition or by user algorithms.
7472 * This page introduces the struct SCIP_DECOMP and gives examples how to create and use it.
7473 *
7474 * @section DECOMP_OVERVIEW Overview
7475 *
7476 * In the following, we present decompositions of mixed-integer programs. However, the generalization to Constraint Integer Programs is straightforward.
7477 *
7478 * Concretely, for \f$k \geq 0\f$ we call a partition \f$\mathcal{D}=(D^{\text{row}},D^{\text{col}})\f$ of the rows and columns of the constraint matrix \f$A\f$ into \f$k + 1\f$ pieces each,
7479 *
7480 * \f[
7481 * D^{\text{row}} = (D^{\text{row}}_{1},\dots,D^{\text{row}}_{k},L^{\text{row}}), \quad D^{\text{col}} = (D^{\text{col}}_{1},\dots,D^{\text{col}}_{k},L^{\text{col}})
7482 * \f]
7483 * a decomposition of \f$A\f$ if \f$D^{\text{row}}_{q} \neq \emptyset\f$, \f$D^{\text{col}}_{q} \neq \emptyset\f$ for \f$q \in \{1,\dots,k\}\f$ and if it holds for all \f$i\in D^{\text{row}}_{q_{1}}, j\in D^{\text{col}}_{q_{2}}\f$ that \f$a_{i,j} \neq 0 \Rightarrow q_{1} = q_{2}\f$.
7484 * The special rows \f$L^{\text{row}}\f$ and columns \f$L^{\text{col}}\f$, which may be empty, are called linking rows and linking columns, respectively.
7485 * In other words, the inequality system \f$A x \geq b\f$ can be rewritten
7486 * with respect to a decomposition \f$\mathcal{D}\f$ by a suitable permutation of the rows
7487 * and columns of \f$A\f$ as equivalent system
7488 * \f[
7489 * \left(
7490 * \begin{matrix}
7491 * A_{[D^{\text{row}}_{1},D^{\text{col}}_{1}]} &
7492 * 0 &
7493 * \cdots &
7494 * 0 &
7495 * A_{[D^{\text{row}}_{1},L^{\text{col}}]}\\
7496 * 0 &
7497 * A_{[D^{\text{row}}_{2},D^{\text{col}}_{2}]} &
7498 * 0 &
7499 * 0 &
7500 * A_{[D^{\text{row}}_{2},L^{\text{col}}]}\\
7501 * \vdots &
7502 * 0 &
7503 * \ddots &
7504 * 0 &
7505 * \vdots\\
7506 * 0 &
7507 * \cdots &
7508 * 0 &
7509 * A_{[D^{\text{row}}_{k},D^{\text{col}}_{k}]} &
7510 * A_{[D^{\text{row}}_{k},L^{\text{col}}]}\\
7511 * A_{[L^{\text{row}},D^{\text{col}}_{1}]} &
7512 * A_{[L^{\text{row}},D^{\text{col}}_{2}]} &
7513 * \cdots &
7514 * A_{[L^{\text{row}},D^{\text{col}}_{k}]} &
7515 * A_{[L^{\text{row}},L^{\text{col}}]}
7516 * \end{matrix}
7517 * \right)
7518 * \left(
7519 * \begin{matrix}
7520 * x_{[D^{\text{col}}_{1}]}\\
7521 * x_{[D^{\text{col}}_{2}]}\\
7522 * \vdots\\
7523 * x_{[D^{\text{col}}_{k}]}\\
7524 * x_{[L^{\text{col}}]}
7525 * \end{matrix}
7526 * \right)
7527 * \geq
7528 * \left(
7529 * \begin{matrix}
7530 * b_{[D^{\text{row}}_{1}]}\\
7531 * b_{[D^{\text{row}}_{2}]}\\
7532 * \vdots\\
7533 * b_{[D^{\text{row}}_{k}]}\\
7534 * b_{[L^{\text{row}}]}
7535 * \end{matrix}
7536 * \right)
7537 * % A= \left(\begin{matrix}4&8&\frac{1}{2}\\\frac{3}{2}&4&1\\1&3&7\end{matrix}\right)
7538 * \f]
7539 * where we use the short hand syntax \f$A_{[I,J]}\f$ to denote
7540 * the \f$|I|\f$-by-\f$|J|\f$ submatrix that arises from the deletion of all entries
7541 * from \f$A\f$ except for rows \f$I\f$ and columns \f$J\f$,
7542 * for nonempty row
7543 * and column subsets \f$I\subseteq\{1,\dots,m\}\f$ and \f$J\subseteq\{1,\dots,n\}\f$.
7544 *
7545 *
7546 * @section DECOMP_USING Using a decomposition
7547 *
7548 * After passing one or more decompositions, see below, one can access all available decompositions with SCIPgetDecomps().
7549 * The labels can be obtained by calling SCIPdecompGetVarsLabels() and SCIPdecompGetConsLabels().
7550 * If some variables/constraints are not labeled, these functions will mark them as linking variables/constraints.
7551 * There are several functions to get more information about one decomposition, see @ref DecompMethods.
7552 *
7553 * A decomposition can be used to split the problem into several subproblems which, in general, are easier to solve.
7554 * For \f$q \in \{1,\dots,k\}\f$ the system
7555 * \f[
7556 * A_{[D^{\text{row}}_{q},D^{\text{col}}_{q}]}\; x_{[D^{\text{col}}_{q}]} \geq b_{[D^{\text{row}}_{q}]}
7557 * \f]
7558 * is part of subproblem \f$q\f$, the handling of the linking variables/constraints depends on the chosen application context.
7559 * For example, in the heuristic @ref heur_padm.c several smaller subproblems are solved multiple times to get a feasible solution.
7560 * Also the @ref BENDDECF "Benders' decomposition framework" was extended with release 7.0 to use user decompositions.
7561 *
7562 * @section DECOMP_CREATION Creation via SCIP-API
7563 *
7564 * There are two different ways to provide a decomposition in SCIP.
7565 * It can be created with the SCIP-API or it can be read from a file.
7566 *
7567 * To create it with the API, the user must first create a decomposition with SCIPcreateDecomp() specifying
7568 * whether the decomposition belongs to the original or transformed problem and the number of blocks.
7569 * Then the variables and constraints can be assigned to one block or to the linking rows/columns by calling
7570 * SCIPdecompSetVarsLabels() and SCIPdecompSetConsLabels(), respectively.
7571 * To complete the decomposition or to ensure that it is internally consistent, SCIPcomputeDecompVarsLabels() or
7572 * SCIPcomputeDecompConsLabels() can be called.
7573 * Note that SCIPcomputeDecompVarsLabels() will ignore the existing variable labels and computes again the labels based on the constraint labels only;
7574 * SCIPcomputeDecompConsLabels() works in the same way and ignores the existing constraint labels.
7575 *
7576 * After the decomposition has been successfully created, it can be saved for later use in the DecompStore using SCIPaddDecomp().
7577 * Access to all decompositions in the DecompStore is possible with SCIPgetDecomps().
7578 *
7579 * @section DECOMP_READDEC Reading a decomposition from a file
7580 *
7581 * Alternatively, after a problem has been read, a related decomposition can be read from a dec-file.
7582 * Please refer to the @ref reader_dec.h "DEC file reader" for further information about the required file format.
7583 * Upon reading a valid dec-file, a decomposition structure is created, where the corresponding variable labels are inferred from the constraint labels, giving precedence to block over linking constraints.
7584 *
7585 * @section DECOMP_BENDERS Use for Benders
7586 *
7587 * If the variables should be labeled for the application of @ref BENDDECF "Benders' decomposition", the decomposition must be explicitly flagged by setting the parameter decomposition/benderslabels to TRUE.
7588 * With this setting, the variable's labeling takes place giving precedence to its presence in linking constraints over its presence in named blocks.
7589 *
7590 * @section DECOMP_TRANS Decomposition after problem transformation
7591 *
7592 * As the problem's constraints are constantly changing, or possibly deleted, during presolving, the constraints' labeling must be triggered again.
7593 * Therefore, SCIP automatically transforms all user decompositions at the beginning of the root node based on the variables' labels.
7594 *
7595 * @section DECOMP_STATS Decomposition statistics
7596 *
7597 * Further useful measures and statistics about the decomposition are computed within SCIPcomputeDecompStats().
7598 * When the labeling process is concluded, the following measures are computed and printed:
7599 * - the number of blocks;
7600 * - the number of linking variables and linking constraints;
7601 * - the size of the largest as well as the smallest block;
7602 * - the area score:
7603 * This score is also used by GCG to rank decompositions during the automatic detection procedure.
7604 * For a decomposition
7605 * \f$\mathcal{D}=(D^{\text{row}},D^{\text{col}})\f$,
7606 * the area score is defined as
7607 * \f[
7608 * \text{areascore}(\mathcal{D}) = 1 - \frac{ \sum_{q=1}^k \lvert D^{\text{row}}_{q} \rvert
7609 * \lvert D^{\text{col}}_{q} \rvert + n\lvert L^{\text{row}} \rvert + m\lvert L^{\text{col}} \rvert -
7610 * \lvert L^{\text{row}} \rvert \lvert L^{\text{col}} \rvert }{mn}
7611 * \enspace.
7612 * \f]
7613 * In the case of a mixed-integer program, the area score intuitively measures the coverage of the rearranged matrix by 0's.
7614 * Decompositions with few linking variables and/or constraints and many small blocks \f$A_{[D^{\text{row}}_{q},D^{\text{col}}_{q}]}\f$
7615 * will have an area score close to \f$1\f$, whereas coarse decompositions of a matrix have smaller area scores.
7616 * The trivial decomposition with a single block has the worst possible area score of 0.
7617 * - the modularity:
7618 * This measure is used to assess the quality of the community structure within a decomposition.
7619 * The modularity of the decomposition is computed as follows:
7620 * \f[
7621 * \begin{aligned}
7622 * \sum_{q=1}^{k} \dfrac{e_{q}}{m} \left(1-\dfrac{e_{q}}{m}\right),
7623 * \end{aligned}
7624 * \f]
7625 * where \f$e_{q}\f$ is the number of inner edges within block \f$q\f$ and \f$m\f$ is the total number of edges.
7626 * The presence of an inner edge is identified through the presence of a variable in a constraint,
7627 * both—the variable and the constraint—belonging to the same block.
7628 * - the block graph statistics: A block graph is constructed with the aim of depicting the connection between the different blocks in a decomposition through the existing linking variables in the constraints.
7629 * Note that the linking constraints are intentionally skipped in this computation.
7630 * \f$ G = (V,E) \f$ denotes a block graph, with vertex set \f$V\f$ and edge set \f$E\f$.
7631 * Each vertex in the graph represents a block in the decomposition; \f$V = \{v_{1},\dots,v_{k}\}\f$.
7632 * An edge \f$e = \{ v_{s},v_{t} \}\f$ is added to \f$G\f$, if and only if there exists a column \f$\ell \in L^{\text{col}}\f$, a row \f$i \in D^{\text{row}}_{s}\f$
7633 * and a row \f$j \in D^{\text{row}}_{t}\f$, such that \f$a_{i,\ell} \neq 0\f$ and \f$a_{j,\ell} \neq 0\f$.
7634 * From the constructed graph, the number of edges, articulation points and connected components are computed, together with the maximum and minimum degree.
7635 * Note that building the block graph can become computationally expensive with large and dense decompositions.
7636 * Thus, it is possible through a user parameter <code>decomposition/maxgraphedge</code> to define a maximum edge limit.
7637 * The construction process will be interrupted once this limit is reached, in which case only approximate estimations of the block graph statistics will be displayed and accompanied with a warning message.
7638 *
7639 */
7640
7641/*--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
7642
7643
7644/**@page BENDDECF How to use the Benders' decomposition framework
7645 *
7646 * Benders' decomposition is a very popular mathematical programming technique that is applied to solve structured
7647 * problems. Problems that display a block diagonal structure are particularly amenable to the application of Benders'
7648 * decomposition. In a purely mixed-integer linear setting, such problems are given by
7649 *
7650 * \f[
7651 * \begin{array}[t]{rllclcl}
7652 * \min & \displaystyle & c^{T}x & + & d^{T}y \\
7653 * & \\
7654 * \text{subject to} & \displaystyle & Ax & & & = & b \\
7655 * & \\
7656 * & \displaystyle & Tx & + & Hy & = & h \\
7657 * & \\
7658 * & & x & & & \in & \mathbb{Z}^{p}\times\mathbb{R}^{n - p} \\
7659 * & & & & y & \in & \mathbb{R}^{m} \\
7660 * \end{array}
7661 * \f]
7662 *
7663 * The variables \f$x\f$ and \f$y\f$ are described as the first and second stage variables respectively. In the
7664 * classical use of Benders' decomposition, it is a requirement that the all second stage variables are continuous.
7665 * Extensions to the classical Benders' decomposition approach have permitted the use of more general second stage
7666 * problems.
7667 *
7668 * The application of Benders' decomposition to the above problem results in a subproblem, given by
7669 *
7670 * \f[
7671 * \begin{array}[t]{rll}
7672 * \min & \displaystyle & d^{T}y \\
7673 * & \\
7674 * \text{subject to} & \displaystyle & Hy = h - T\bar{x} \\
7675 * & \\
7676 * & & y \in \mathbb{R}^{m} \\
7677 * \end{array}
7678 * \f]
7679 *
7680 * where \f$\bar{x}\f$ is a solution vector of the first stage variables. As such, the subproblem is a problem only in
7681 * \f$y\f$. The dual solution to the subproblem, either an extreme point or extreme ray, is used to generate cuts that
7682 * are added to the master problem. Let \f$\lambda\f$ be the vector of dual variables associated with the set of
7683 * constraints from the subproblem. If, for a given \f$\bar{x}\f$, the subproblem is infeasible, then \f$\lambda\f$
7684 * corresponds to a dual ray and is used to produce the cut
7685 *
7686 * \f[
7687 * 0 \geq \lambda(h - Tx)
7688 * \f]
7689 *
7690 * which eliminates \f$\bar{x}\f$ from the master problem. If, for a given \f$\bar{x}\f$, the subproblem is feasible,
7691 * then \f$\lambda\f$ corresponds to a dual extreme point and is used to produce the cut
7692 *
7693 * \f[
7694 * \varphi \geq \lambda(h - Tx)
7695 * \f]
7696 *
7697 * where \f$\varphi\f$ is an auxiliary variable added to the master problem as an underestimator of the optimal
7698 * subproblem objective function value.
7699 *
7700 * Given \f$\Omega^{p}\f$ and \f$\Omega^{r}\f$ as the sets of dual extreme points and rays of the subproblem,
7701 * respectively, the Benders' decomposition master problem is given by
7702 *
7703 * \f[
7704 * \begin{array}[t]{rll}
7705 * \min & \displaystyle & c^{T}x + \varphi \\
7706 * & \\
7707 * \text{subject to} & \displaystyle & Ax = b \\
7708 * & \\
7709 * & \displaystyle & \varphi \geq \lambda(h - Tx) \quad \forall \lambda \in \Omega^{r}\\
7710 * & \\
7711 * & \displaystyle & 0 \geq \lambda(h - Tx) \quad \forall \lambda \in \Omega^{r} \\
7712 * & \\
7713 * & & x \in \mathbb{Z}^{p}\times\mathbb{R}^{n - p} \\
7714 * & & \varphi \in \mathbb{R} \\
7715 * \end{array}
7716 * \f]
7717 *
7718 * @section BENDERFRAMEWORK Overview
7719 *
7720 * In \SCIP 6.0 a Benders' decomposition framework has been implemented.
7721 *
7722 * The current framework can be used to handle a Benders Decomposition of CIPs of the form
7723 *
7724 * \f[
7725 * \begin{array}[t]{rllclcl}
7726 * \min & \displaystyle & c^{T}x & + & d^{T}y \\
7727 * \text{subject to} & \displaystyle & g(x & , & y) & \in & [\ell,u] \\
7728 * & & x & & & \in & X \\
7729 * & & & & y & \in & Y \\
7730 * \end{array}
7731 * \f]
7732 * when either
7733 * - the subproblem is convex: \f$g_i(x,y)\f$ convex on \f$X\times Y\f$ if \f$u_i<\infty\f$, \f$g_i(x,y)\f$ concave on \f$X\times Y\f$ if \f$\ell_i>-\infty\f$, and \f$Y=\mathbb{R}^m\f$, or
7734 * - the first stage variables are of binary type: \f$ X \subseteq \{0,1\}^n \f$.
7735 *
7736 * This framework can be used in four different
7737 * ways: inputting an instance in the SMPS file format, using the default Benders' decomposition implementation
7738 * (see src/scip/benders_default.c), implementing a custom Benders' decomposition plugin (see \ref BENDER), or by using
7739 * the Benders' decomposition mode of GCG.
7740 * An overview of how to use each of these functions will be provided in this section.
7741 *
7742 * @section BENDERSSMPS Inputting an instance in the SMPS file format.
7743 *
7744 * As part of the Benders' decomposition framework development, a reader for instances in the SMPS file format has been
7745 * implemented (see src/scip/reader_smps.c). The details regarding the SMPS file format can be found at:
7746 *
7747 * Birge, J. R.; Dempster, M. A.; Gassmann, H. I.; Gunn, E.; King, A. J. & Wallace, S. W.
7748 * A standard input format for multiperiod stochastic linear programs
7749 * IIASA, Laxenburg, Austria, WP-87-118, 1987
7750 *
7751 * In brief, the SMPS file format involves three different files:
7752 * - A core file (.cor): a problem instance in MPS format that is the core problem of a stochastic program.
7753 * - A time file (.tim): partitions the variables and constraints into the different stages of the stochastic program
7754 * - A stochastic file (.sto): describes the scenarios for each stage.
7755 *
7756 * The STO reader (see src/scip/reader_sto.c) constructs the stochastic program using the information from the core and
7757 * time files. By default, the STO reader will construct the deterministic equivalent of the stochastic program. A
7758 * parameter is provided "reading/sto/usebenders" that will inform the STO reader to apply Benders' decomposition to the
7759 * input stochastic program.
7760 *
7761 * @section BENDERSDECSTRUCTURE Inputting a user-defined decomposition structure
7762 *
7763 * Benders' decomposition can be applied from a user-provided decomposition structure. Details about the decomposition
7764 * structure and how to provide it to SCIP can be found at @ref DECOMP. Prior to reading the decomposition structure
7765 * into SCIP, it is necessary to inform SCIP that the variables and constraints must be labelled for Benders'
7766 * decomposition. This is achieved by setting the parameter "decomposition/benderslabels" to "TRUE". Following this,
7767 * Benders' decomposition will be applied if the parameter "decomposition/applybenders" is set to "TRUE".
7768 *
7769 * When Benders' decomposition is applied using the decomposition structure, the Benders' decomposition algorithm is
7770 * executed within a relaxator (see @ref RELAX). The relaxator is called when processing the root node of the original
7771 * SCIP instance, before the first LP solve. Within the relaxator, a sub-SCIP is created, upon which the Benders'
7772 * decomposition is applied. The default Benders' decomposition plugin (see @ref BENDERSDEFAULT) is used for applying
7773 * the decomposition. The master problem sub-SCIP is solved and then the solution from the Benders' decomposition
7774 * algorithm is returned.
7775 *
7776 * If the problem is solved to optimality by the Benders' decomposition algorithm, then the original SCIP instance
7777 * terminates. There are cases where the Benders' decomposition algorithm terminates without an optimal solution. As a
7778 * result, the original SCIP instance would continue solving. These cases are: reaching node, memory or solution limits,
7779 * or numerical issues meaning that the Benders' solution is not optimal for the original problem. The parameter
7780 * "relaxing/benders/continueorig" is provided to inform SCIP whether the original SCIP instance should continue solving
7781 * following the completion of the Benders' algorithm. By default, solving in the original SCIP instance is interrupted
7782 * when the relaxator finishes.
7783 *
7784 * The parameter setting and limits from the original SCIP instance are copied across to the master problem
7785 * sub-SCIP in the Benders' decomposition relaxator. It is possible to set a separate node limit for the Benders'
7786 * algorithm within the relaxator. This is achieved by using the parameter "relaxing/benders/nodelimit". A possible use
7787 * case for a separate Benders' node limit is that the Benders' algorithm could be used as an initial heuristics for the
7788 * original SCIP instance.
7789 *
7790 * An advantage over using the decomposition structure compared to an instance in the SMPS format is that the solution
7791 * to the original problem is easily accessible. At the completion of the Benders' decomposition algorithm, the best
7792 * know solution is copied back to the original SCIP instance. Note that using a decomposition structure is not the only
7793 * way to get the original problem solution from the Benders' decomposition algorithm. Whichever method you use, it is
7794 * possible to solve the Benders' decomposition subproblems by calling SCIPsetupBendersSubproblem() and then
7795 * SCIPsolveBendersSubproblem() for each subproblem using the best solution from the master problem. An example of this
7796 * can be found in solveBendersSubproblems() of `src/scip/relax_benders.c`.
7797 *
7798 * @section BENDERSDEFAULT Using the default Benders' decomposition plugin.
7799 *
7800 * A default implementation of a Benders' decomposition plugin has been included in \SCIP 6.0 (see
7801 * src/scip/benders_default.c). In order to use the default plugin, the user must create SCIP instances of the master
7802 * problem and subproblems. The subproblems must also contain a copy of the master problem variables, since these are
7803 * fixed to the master problem solution values during the subproblem solving loop. These SCIP instances for the master
7804 * and subproblems are passed to the default plugin by calling SCIPcreateBendersDefault().
7805 *
7806 * The mapping between the master and subproblem variables is performed automatically. The default solving and cut
7807 * generation methods are applied to solve the input problem. It is important to note that the mapping between the
7808 * master and subproblem variables relies on the variable names. The variables of the subproblem corresponding to
7809 * master problem variables must have the same name in both problems.
7810 *
7811 * The CAP (stochastic capacitated facility location problem) example demonstrates the use of the default Benders'
7812 * decomposition implementation within a project.
7813 *
7814 * @section BENDERSCUSTOM Implementing a custom Benders' decomposition implementation.
7815 *
7816 * A custom Benders' decomposition requires the implementation of a Benders' decomposition plugin. The key aspects for
7817 * implementing a custom Benders' decomposition plugin are explained in \ref BENDER.
7818 *
7819 * @section BENDERSGCG Using the Benders' decomposition mode of GCG
7820 *
7821 * In GCG 3.0, a Benders' decomposition mode has been implemented. This mode takes the decomposition found by the
7822 * detection schemes of GCG and applies Benders' decomposition. Using GCG it is possible to apply Benders' decomposition
7823 * to general problem without having to manually construct the decompositions.
7824 *
7825 * @section BENDERSOBJTYPE Objective type options for the Benders' decomposition
7826 *
7827 * Classically, the application of Benders' decomposition results in the inclusion of an auxiliary variable to provide an
7828 * underestimation of the subproblem objective value. If the subproblem can be separated into disjoint problems, then
7829 * this auxiliary variable can be substituted with the sum of auxiliary variables (one for each subproblem).
7830 *
7831 * While the summation of auxiliary variables is theoretically possible for all applications of Benders' decomposition,
7832 * there are problems where an alternative objective may be beneficial. An example is a multiple machine scheduling
7833 * problem with a makespan objective. To accommodate different objective types, the Benders' decomposition framework
7834 * allows for the objective types of summation (the classical method) or the minimum of the maximum subproblem auxiliary
7835 * variables. The objective type can be set using the function SCIPsetBendersObjectiveType(). Note that the different
7836 * objective types only have an impact if more than one subproblem is used in the Benders' decomposition.
7837 *
7838 */
7839
7840/*--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
7841
7842/**@page PROBINGDIVING How to use probing and diving mode
7843 *
7844 * SCIP contains two methods to perform a temporary dive in the branch-and-bound tree: the diving mode and the probing mode.
7845 * Both methods enable the modification of variable bounds, addition of new constraints, or adjustments to the objective function.
7846 * Whereas the diving mode works directly on the LP structure, the probing mode creates temporary branch-and-bound nodes, which makes it possible to perform backtracks during a dive.
7847 * Probing allows to perform domain propagation at the temporary nodes and provides the ability to solve the LP by column generation if a pricer plugin is implemented; neither is possible in diving mode.
7848 *
7849 * After entering diving or probing mode by calling SCIPstartDive() and SCIPstartProbing(), respectively, there exist various functions that allow the user to temporarily change the LP.
7850 * An overview for diving can be found here[https://www.scipopt.org/doc/html/group__PublicLPDivingMethods.php] and for the probing mode here[https://scipopt.org/doc/html/group__PublicProbingMethods.php].
7851 * To reset all changes, the respective mode needs to be ended by calling SCIPendDive() and SCIPendProbing(), respectively.
7852 *
7853 * Note that, although the state of the LP and the problem is reset after ending probing and diving, both modes can have several effects on the subsequent solving process.
7854 * In some situations, when the LP is infeasible for example, conflict analysis will be run in both probing and diving modes, which can lead to globally valid conflict constraints that are then added to the main solving process.
7855 * Similarly, the function SCIPpropagateProbing() might find globally valid bound changes, which are added to the main SCIP and considered in the subsequent solving process.
7856 * Another way to leverage insights found during probing or diving is to update pseudo costs during both modes, helping make better branching decisions.
7857 * This is controlled by setting the parameter "divingpscosts" to TRUE, which is done in the default settings of SCIP.
7858 * Moreover, if the LP was not solved to optimality before entering diving mode (or the parameter "resolverestore" is set to TRUE), the LP is resolved to reset the solution.
7859 * In some cases, such as when dealing with a numerically difficult instance, this might lead to a different LP state.
7860 * Finally, during probing, global variable statistics can be collected by calling SCIPenableVarHistory() after starting probing.
7861 * Since these statistics can be used for decision-making in SCIP, enabling their collection can have an effect on the solving process after probing ends.
7862 *
7863 */
7864/*--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
7865
7866/**@page EXACT How to use the numerically exact solving mode
7867 *
7868 * As a feature standing out among today's MIP solvers, \SCIP offers the option to solve mixed-integer linear programs
7869 * in a numerically exact solving mode, in which it uses rational, extended-precision, and safe floating-point
7870 * computation in order to guarantee that results are not affected by roundoff errors from unsafe floating-point
7871 * arithmetic.
7872 *
7873 * Exact solving mode requires \SCIP to be built with
7874 *
7875 * - [GMP](https://gmplib.org/) for rational arithmetic in ZIMPL, SoPlex, SCIP, and PaPILO,
7876 * - [Boost](https://www.boost.org/) multiprecision library for rationals in SCIP (and PaPILO, if linked),
7877 * - [MPFR](https://www.mpfr.org/) for approximating rationals with floating-point numbers in SCIP,
7878 * - and an exact LP solver such as SoPlex.
7879 *
7880 * Enabling the exact solving mode is done by setting the parameter `exact/enable = TRUE` or calling the API function
7881 * `SCIPenableExactSolving()`. Note that this has to be done <b>before</b> reading a problem instance. Further advanced
7882 * parameters for exact solving can be set in the `exact` submenu.
7883 *
7884 * Optionally, the output of a certificate (also known as proof logging) can be enabled by specifying
7885 * `certificate/filename`. The resulting certificate can be checked with the proof checker
7886 * [VIPR](https://github.com/scipopt/vipr) or a formally verified version in [CakeML](https://cakeml.org/checkers.html).
7887 * Note that certificate files are incomplete if cutting plane separation is enabled (as by default). In this case, the
7888 * certificate needs to be completed using the `viprcomp` script prior to verification.
7889 *
7890 * All plugins that want to participate in exact solving mode need to be marked as safe to use when included.
7891 *
7892 * For further details we refer to the release report of SCIP 10.
7893 */
7894
7895/*--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
7896
7897/**@page OBJ Creating, capturing, releasing, and adding data objects
7898 *
7899 * Data objects (variables, constraints, rows, ... ) are subject to reference counting
7900 * to avoid expensive copying operations. This concept is similar to smart pointers.
7901 * Creating such an object (e.g., by calling SCIPcreateVar()) will set the
7902 * reference counter to one. Capturing an object (e.g., by calling SCIPcaptureVar()) increases the reference counter,
7903 * releasing it (e.g., by calling SCIPreleaseVar()) decreases the counter. If the reference counter gets zero, the
7904 * object will be destroyed automatically.
7905 *
7906 * Remember that a created data object is automatically captured. If the user
7907 * doesn't need the object anymore, (s)he has to call the object's release function.
7908 *
7909 * When a data object is added to SCIP (e.g., by calling SCIPaddVar()) , it is captured again, such that a
7910 * release call does not destroy the object. If SCIP doesn't need the object
7911 * anymore, it is automatically released.
7912 *
7913 * E.g., if the user calls
7914 * \code
7915 * SCIPcreateVar(); // reference counter 1
7916 * SCIPaddVar(); // reference counter 2
7917 * SCIPreleaseVar(); // reference counter 1
7918 * \endcode
7919 * the reference counter will be 1 afterwards, and the variable will be destroyed, if SCIP frees the problem.
7920 * If the user wants to use this variable, e.g. for extracting statistics after SCIP was finished, the user must not call
7921 * SCIPreleaseVar() right after adding the variable, but before terminating the program.
7922 */
7923
7924/*--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
7925
7926/**@page PARAM How to add additional user parameters
7927 *
7928 * Users may add their own parameters to SCIP by calling SCIPaddXyzParam(). Using
7929 * this function, there are two possibilities for where to store the actual parameter value:
7930 * - If the given valueptr is NULL, SCIP stores the parameter value internally, and
7931 * the user can only access the value with the SCIPgetXyzParam() and
7932 * SCIPsetXyzParam() calls.
7933 * - If the given valueptr is not NULL, SCIP stores the parameter value at the given
7934 * address, and the user can directly manipulate the value at this address.
7935 * (S)he has to be careful with memory management in string parameters: when the
7936 * SCIPaddStringParam() function is called, the given address must hold a char*
7937 * pointer with value NULL. The default value is then copied into this pointer,
7938 * allocating memory with BMSallocMemoryArray(). If the parameter is changed, the
7939 * old string is freed with BMSfreeMemoryArray() and the new one is copied to a new
7940 * memory area allocated with BMSallocMemoryArray(). When the parameter is freed,
7941 * the memory is freed with BMSfreeMemoryArray().
7942 * The user should not interfere with this internal memory management. Accessing
7943 * the string parameter through the given valueptr is okay as long as it does not
7944 * involve reallocating memory for the string.
7945 *
7946 * In some cases, it is necessary to keep track of changes in a parameter.
7947 * If this is the case, the user can define a function by the PARAMCHGD callback and use this function as
7948 * the @c paramchgd parameter of the @c SCIPaddXyzParam() function, also giving a pointer to the data, which is
7949 * needed in this function, as @c paramdata. If this function is not NULL, it is called every time
7950 * the value of the parameter is changed.
7951 */
7952
7953/*--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
7954
7955/**@page MEMORY Using the memory functions of SCIP
7956 *
7957 * SCIP provides three ways for allocating memory:
7958 * -# <b>block memory:</b> efficient handling of memory blocks of similar small sizes
7959 * -# <b>buffer memory:</b> efficient handling of memory that needs to locally be allocated and freed
7960 * -# <b>standard memory:</b> access to standard malloc/free
7961 *
7962 * <em>Whenever possible, the first two should be used, because of reasons detailed below.</em>
7963 *
7964 * In the following, we provide a brief description of these methods. We refer the reader to the dissertation of Tobias
7965 * Achterberg for more details. We also present best practice models.
7966 *
7967 * @section MEMBACK Background
7968 *
7969 * The main goals for providing such particular methods are:
7970 * - <em>Accounting:</em> Using its own functions, SCIP knows the total size of memory allocated internally and can change its
7971 * behavior: for instance, it can change to "memory saving mode" (using depth first search (DFS) and possibly do a garbage
7972 * collection). It also allows for keeping a memory limit.
7973 * - <em>Speed:</em> SCIP often needs to allocate a very large number of small blocks of similar sizes (often powers of
7974 * two). Depending on the operating system and compiler, the methods implemented in SCIP can be faster, since blocks
7975 * of the same size are grouped together. Especially at the end of the 1990ies the standard malloc/free methods were
7976 * quite ineffective. The experiments of Tobias Achterberg in 2007 show a speed improvement of 11 % when using block
7977 * memory.
7978 * - <em>Efficiency:</em> Since blocks are groups in sizes, the blocks do not need to store their sizes within each
7979 * block. In comparison, standard malloc/free stores the size using one word for each memory chunk. The price to pay
7980 * is that one needs to pass the size to the functions that free a block. In any case, the methods in SCIP can save
7981 * memory. Moreover, buffer memory is stored in similar places and not spread out, which also might help cache.
7982 * - <em>Debugging:</em> All of the possibilities provide methods to detect memory leaks. Together with tools like
7983 * valgrind, this can be quite effective in avoiding such problems.
7984 *
7985 * @n
7986 * @section BLKMEM Block memory
7987 *
7988 * SCIP offers its own block memory handling, which allows efficient handling of smaller blocks of memory in cases in
7989 * which many blocks of the same (small) size appear. This is adequate for branch-and-cut codes in which small blocks
7990 * of the same size are allocated and freed very often (for data structures used to store rows or branch-and-bound
7991 * nodes). Actually, most blocks allocated within SCIP have small sizes like 8, 16, 30, 32, 64. The idea is simple:
7992 * There is a separate list of memory blocks for each interesting small size. When allocating memory, the list is
7993 * checked for a free spot in the list; if no such spot exists, the list is enlarged. Freeing just sets the block to be
7994 * available. Very large blocks are handled separately. See the dissertation of Tobias Achterberg for more details.
7995 *
7996 * One important comment is that freeing block memory requires the size of the block in order to find the right list.
7997 *
7998 * The most important functions are
7999 * - SCIPallocBlockMemory(), SCIPallocBlockMemoryArray() to allocate memory
8000 * - SCIPfreeBlockMemory(), SCIPfreeBlockMemoryArray() to free memory
8001 *
8002 * An example code is:
8003 * @refsnippet{tests/src/misc/snippets.c,SnippetArrayAllocAndFree}
8004 * @n
8005 *
8006 * @section BUFMEM Buffer memory
8007 *
8008 * @subsection BUFMEMSTD Standard Buffer Memory
8009 *
8010 * In addition to block memory, SCIP offers buffer memory. This should be used if memory is locally used within a
8011 * function and freed within the same function. For this purpose, SCIP has a list of memory buffers that are reused for
8012 * this purpose. In this way, a very efficient allocation/freeing is possible.
8013 *
8014 * Note that the buffers are organized in a stack, i.e., freeing buffers in reverse order of allocation is faster.
8015 *
8016 * The most important functions are
8017 * - SCIPallocBuffer(), SCIPallocBufferArray() to allocate memory,
8018 * - SCIPfreeBuffer(), SCIPfreeBufferArray() to free memory.
8019 *
8020 * @subsection BUFMEMCLEAN Clean Buffer Memory
8021 *
8022 * SCIP 3.2 introduced a new type of buffer memory, the <em>clean buffer</em>. It provides memory which is initialized to zero
8023 * and requires the user to reset the memory to zero before freeing it. This can be used at performance-critical
8024 * places where only few nonzeros are added to a dense array and removing these nonzeros individually is much faster
8025 * than clearing the whole array. Similar to the normal buffer array, the clean buffer should be used for temporary memory
8026 * allocated and freed within the same function.
8027 *
8028 * The most important functions are
8029 * - SCIPallocCleanBufferArray() to allocate memory,
8030 * - SCIPfreeCleanBufferArray() to free memory.
8031 *
8032 * @n
8033 * @section STDMEM Standard memory
8034 *
8035 * SCIP provides an access to the standard C functions @c malloc and @c free with the additional feature of tracking
8036 * memory in debug mode. In this way, memory leaks can be easily detected. This feature is automatically activated in
8037 * debug mode.
8038 *
8039 * The most important functions are
8040 * - SCIPallocMemory(), SCIPallocMemoryArray() to allocate memory,
8041 * - SCIPfreeMemory(), SCIPfreeMemoryArray() to free memory.
8042 *
8043 * @section REALLOCATION Reallocating memory
8044 *
8045 * - `SCIPensureBlockMemoryArray()`: Extends a dynamically allocated block memory array to be able to store at least the given
8046 * number of elements. This function ensures that the array is resized efficiently by calculating an appropriate new size. This can be
8047 * useful to build data structures that grow dynamically.
8048 *
8049 * - `SCIPreallocBlockMemoryArray()`, `SCIPreallocBufferArray()`, `SCIPreallocMemoryArray()`: Reallocate memory arrays to a specific
8050 * new size. These are useful when you already know the exact new size needed, for instance when managing multiple arrays of the
8051 * same size or when you want to compute the new size once and apply it to multiple arrays. Unlike the ensure* functions, these
8052 * give you direct control over the array size.
8053 *
8054 * @n
8055 * @section MEMBESTPRACTICE Best Practice of Using Memory Functions
8056 *
8057 * Since allocating and freeing memory is very crucial for the speed and memory consumption of a program, it is
8058 * important to keep the following notes and recommendations in mind.
8059 *
8060 * @subsection GEN General Notes
8061 *
8062 * The following holds for all three types of memory functions:
8063 * - In debug mode, the arguments are checked for overly large allocations (usually arising from a bug). Note that all
8064 * arguments are converted to unsigned values of type @c size_t, such that negative sizes are converted into very
8065 * large values.
8066 * - The functions always allocate at least one byte and return non-NULL pointers if memory is available. In particular,
8067 * freeing is always possible.
8068 * - The freeing functions set the pointer to the memory to NULL.
8069 * - Debugging can be supported by using the compiler flags @p NOBLKMEM=true, @p NOBUFMEM=true, @p NOBLKBUFMEM=true
8070 * that turn off the usage of block memory, buffer memory, as well as block and buffer memory, respectively. Since,
8071 * the internal block and buffer memory is freed at the end (leaving no memory leaks), turning them off allows tools
8072 * like valgrind to find memory leaks.
8073 * - Moreover, additional checks can be turned on by defining @p CHECKMEM in memory.c.
8074 *
8075 * @n
8076 * @subsection DOS Things to do ...
8077 *
8078 * - Use buffer memory if your memory chunk can be allocated and freed within the same function.
8079 * - Use buffer and block memory wherever possible, because of the reasons explained above.
8080 * - Free memory in the reverse order in which it was allocated! For block and buffer memory this @b significantly
8081 * speeds up the code.
8082 * - Use as few memory allocations/freeing operations as possible, since these functions take a significant amount of time.
8083 *
8084 * @n
8085 * @subsection DONTS Things to avoid ...
8086 *
8087 * - Avoid the usage of standard memory, since SCIP is unaware of the size used in such blocks.
8088 * - Avoid reallocation with only slightly increased size, rather use a geometrically growing
8089 * size allocation. SCIPcalcMemGrowSize() is one way to calculate new sizes.
8090 * - Be careful with buffer memory reallocation: For single buffers, the memory is reallocated (using malloc); since
8091 * the actual space might be larger than what was needed at allocation time, reallocation sometimes comes without
8092 * extra cost. Note that reallocating block memory in most cases implies moving memory arround.
8093 */
8094
8095/*--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
8096
8097/**@page DEBUG Debugging
8098 *
8099 * If you need to debug your own code that uses SCIP, here are some tips and tricks:
8100 *
8101 * - Use <b>asserts</b> in your code to show preconditions for the parameters, invariants and postconditions.
8102 * Assertions are boolean expressions which inevitably have to evaluate to <code>TRUE</code>. Consider the
8103 * following example:
8104 *
8105 * @refsnippet{src/scip/cons_linear.c,SnippetDebugAssertions}
8106 *
8107 * As you can see, both pointers and integers are checked for valid values at the beginning of the
8108 * function <code>consCatchEvent()</code>. This is particularly important for, e.g., array indices like
8109 * the variable <code>pos</code> in this example, where using the <code>consdata->vars[pos]</code>
8110 * pointer could result in unexspected behaviour
8111 * if the asserted precondition on <code>pos</code> were not matched and <code>pos</code> were an arbitrary index
8112 * outside the array range.
8113 *
8114 * - In order to activate assertions, use the <b>Debug mode</b> by compiling SCIP via
8115 * \code
8116 * cmake -DCMAKE_BUILD_TYPE=Debug
8117 * \endcode
8118 * or the Makefile equivalent
8119 * \code
8120 * make OPT=dbg
8121 * \endcode and run the code. See \ref CMAKE and \ref MAKE for further information about compiler options for SCIP.
8122 * As a rule of thumb, Spending only little extra time on
8123 * asserting preconditions saves most of the time spent on debugging!
8124 *
8125 * - Turn on <b>additional debug output</b> by adding the line
8126 * \code
8127 * #define SCIP_DEBUG
8128 * \endcode
8129 * at the top of SCIP files you want to analyze. This will output messages included in the code using
8130 * <code>SCIPdebugMsg(scip, ...)</code> (or <code>SCIPdebugMessage()</code>), see \ref EXAMPLE_1.
8131 * We recommend to also use <code>SCIPdebugMsg(scip, ...)</code> in your own code for being able to activate
8132 * debug output in the same way.
8133 * - If available on your system, we recommend to use a debugger like <code>gdb</code>
8134 * to trace all function calls on the stack,
8135 * display values of certain expressions, manually break the running code, and so forth.
8136 * - If available on your system, you can use software like <a href="http://valgrind.org">valgrind</a> to check for uninitialized
8137 * values or segmentation faults.
8138 * - For checking the usage of SCIP memory, you can use
8139 * <code>SCIPprintMemoryDiagnostic()</code>. This outputs memory that is currently in use,
8140 * which can be useful after a <code>SCIPfree()</code> call.
8141 * - If there are memory leaks for which you cannot detect the origin, you can recompile your code with the option <code>cmake -DNOBLKBUFMEM=on</code>
8142 * (or <code>make NOBLKBUFMEM=true</code> if you are using the Makefile system.
8143 * Also for the Makefile system, do not forget to clean your code before with <code>make OPT=... LPS=... clean</code>)
8144 * Only with that change, valgrind (or similar) reliably helps
8145 * to detect leaked memory.
8146 * - If your code cuts off a feasible solution, but you do not know which component is responsible,
8147 * you can use the debugging mechanism (see \ref EXAMPLE_2). Therefore, a given solution is read and it
8148 * is checked for every reduction, whether the solution will be pruned globally.
8149 *
8150 * @section EXAMPLE_1 How to activate debug messages
8151 * For example, if we include a <code>\#define SCIP_DEBUG</code> at the top of \ref heur_oneopt.c, recompile SCIP
8152 * in Debug mode, and run the SCIP interactive shell to solve p0033.mps from the
8153 * <a href="http://miplib2010.zib.de/miplib3/miplib.html">MIPLIB 3.0</a> , we get some output like:
8154 *
8155 * \include debugexamples/example1.txt
8156 *
8157 * @section EXAMPLE_2 How to add a debug solution
8158 *
8159 * Continuing the example above, we finish the solving process.
8160 * The optimal solution can now be written to a file:
8161 * \include debugexamples/example2_1.txt
8162 *
8163 * If we afterwards recompile SCIP with the additional compiler flag <code>cmake -DDEBUGSOL=on</code> (<code>make DEBUGSOL=true</code> in the Makefile system),
8164 * set the parameter <code>misc/debugsol = check/p0033.sol</code>, and run SCIP again it will output:
8165 * \include debugexamples/example2_2.txt
8166 * Further debug output would only appear, if the solution was cut off in the solving process.
8167 */
8168
8169/*--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
8170
8171/**@page STAGES SCIP stages
8172 *
8173 * The SCIP object goes through different stages during the solving process, the transitions from one to the next are presented in the following diagram.
8174 * \image html stages.png
8175 * More exhaustively, the stages are:
8176 * \code
8177 * SCIP_STAGE_INIT = 0, /**< SCIP data structures are initialized, no problem exists
8178 * SCIP_STAGE_PROBLEM = 1, /**< the problem is being created and modified
8179 * SCIP_STAGE_TRANSFORMING = 2, /**< the problem is being transformed into solving data space
8180 * SCIP_STAGE_TRANSFORMED = 3, /**< the problem was transformed into solving data space
8181 * SCIP_STAGE_INITPRESOLVE = 4, /**< presolving is initialized
8182 * SCIP_STAGE_PRESOLVING = 5, /**< the problem is being presolved
8183 * SCIP_STAGE_EXITPRESOLVE = 6, /**< presolving is exited
8184 * SCIP_STAGE_PRESOLVED = 7, /**< the problem was presolved
8185 * SCIP_STAGE_INITSOLVE = 8, /**< the solving process data is being initialized
8186 * SCIP_STAGE_SOLVING = 9, /**< the problem is being solved
8187 * SCIP_STAGE_SOLVED = 10, /**< the problem was solved
8188 * SCIP_STAGE_EXITSOLVE = 11, /**< the solving process data is being freed
8189 * SCIP_STAGE_FREETRANS = 12, /**< the transformed problem is being freed
8190 * SCIP_STAGE_FREE = 13 /**< SCIP data structures are being freed
8191 * \endcode
8192 * Most functions can be called in a subset of the stages, this is then documented, a runtime check is often added and will throw a \ref SCIP_INVALIDCALL if the stage is not allowed.
8193 */
8194
8195/*--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
8196
8197/**@page SRCORGA Organization of Source Code
8198 *
8199 * The SCIP source code has different types of files, distinguished by their naming style. The following list gives an overview of the most important file types and their purpose.
8200 *
8201 * @section SRCORGA_CORE SCIP core components
8202 *
8203 * - Each core component has an implementation with an internal API and a public API.
8204 * - The internal implementation should be in a file `<component>.c,h` and should not be included in the public API.
8205 * - Internal API functions usually do not take a `SCIP*` parameter, but a pointer to the component as first argument and pointers to internal structures like `SCIP_SET*` or `SCIP_STAT*`, where necessary.
8206 * - The name of internal API functions follows the style `SCIP<component><operation>...`, e.g., <code>SCIPvarCreateOriginal()</code> or <code>SCIPvarAddLocks()</code>.
8207 * - `pub_<component>.h` declares the functions of the public API that do not need a SCIP pointer.
8208 * Often, these are getter-functions.
8209 * For example, \ref pub_var.h contains public variable API functions.
8210 * - Functions in `pub_<component>.h` follow the same naming style as those in `<component>.h` and are used by the implementation of the internal API as well.
8211 * - `scip_<component>.h` declares the functions of the public API that need a SCIP instance (`SCIP*`), e.g., \ref scip_var.h for public variable manipulation functions.
8212 * Functions declared in `scip_<component>.h` are often thin wrappers that call the internal API functions from `<component>.h`.
8213 * These functions should follow the naming style `SCIP<operation><component>...`, e.g., <code>SCIPcreateVarOriginal()</code> or <code>SCIPaddVarLocks()</code>.
8214 * - To ensure functions of the public API being reachable in shared libraries, their declaration needs to contain the <code>SCIP_EXPORT</code> attribute.
8215 * - Public types (typedef's, enumerations) are defined in file `type_<component>.h`.
8216 * Type names follow the style `SCIP_<COMPONENT>...`. For every struct, we have a typedef that shortens the name
8217 * (so one could for instance use `SCIP_PARAM` instead of `struct SCIP_Param`).
8218 * The convention is to have the mixed-casing for the struct name, and then all-capital for the typedef's type. Similar for enums.
8219 * - Structs that need to be accessed by several source files are defined in `struct_<component>.h`.
8220 * `struct_<component>.h` is usually included only by `<component>.c` and maybe `scip_<component>.c`.
8221 * Exceptions are due to manual inlining of functions via macros when compiling for optimized mode.
8222 * - All types, structs, and functions are documented with Doxygen-style comments.
8223 * The documentation of the implementation of a function must repeat the documentation of the function declaration exactly (for doxygen to treat them as identical).
8224 *
8225 * @section SRCORGA_PLUGINS Plugins
8226 * - Each plugin is defined in files `<type>_<name>.c,h`, e.g.,
8227 * \ref cons_knapsack.c implements the Knapsack constraint handler plugin and
8228 * \ref cons_knapsack.h declares its public API functions.
8229 * - Public types that belong to a plugin are declared in its header, `<type>_<name>.h`.
8230 * - API functions of plugins are named as `SCIP<operation>...<Name>`, e.g., <code>SCIPincludeConshdlrAnd()</code>, <code>SCIPcreateConsAnd()</code>, or <code>SCIPgetNVarsAnd()</code>.
8231 * - Plugins access only the public API.
8232 * - Plugins that need to be included by default should be registered in <code>src/scip/scipdefplugins.c</code>.
8233 */
8234
8235/*--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
8236
8237/**@page TEST How to run automated tests with SCIP
8238 *
8239 * SCIP comes along with a set of useful tools that allow to perform automated tests. The
8240 * following is a step-by-step guide from setting up the test environment for evaluation and
8241 * customization of test runs.
8242 *
8243 *
8244 * @section SETUP Setting up the test environment
8245 *
8246 * At first you should create a file listing all problem instances that should be part of the test.
8247 * This file has to be located in the the directory <code>scip/check/testset/</code>
8248 * and has to have the file extension <code>.test</code>, e.g., <code>testrun.test</code>,
8249 * in order to be found by the <code>scip/check/check.sh</code> script.
8250 * \n
8251 * All test problems can be listed in the <code>test</code>-file by a relative path,
8252 * e.g., <code>../../problems/instance1.lp</code> or absolute path, e.g., <code>/home/problems/instance2.mps</code>
8253 * in this file. Only one problem should be listed on every line (since the command <code>cat</code> is used to parse this file).
8254 * Note that these problems have to be readable for SCIP in order to solve them.
8255 * However, you can use different file formats.
8256 *
8257 * Optionally, you can provide a solution file in the <code>scip/check/testset/</code> directory containing
8258 * known information about the feasibility and the best known objective values for the test instances.
8259 * SCIP can use these values to verify the results. The file has to have the same basename as the
8260 * <code>.test</code>-file, i.e., in our case <code>testrun.solu</code>. One line can only contain
8261 * information about one test instance. A line has to start with the type of information given:
8262 *
8263 * - <code>=opt=</code> stating that a problem name with an optimal objective value follows
8264 * - <code>=best=</code> stating that a problem name with a best know objective value follows
8265 * - <code>=inf=</code> stating that a problem name follows which is infeasible
8266 *
8267 * With these information types you can encode for an instance named <code>instance1.lp</code> the following
8268 * information:
8269 * - The instance has a known optimal (objective) value of 10.
8270 * \code
8271 * =opt= instance1 10
8272 * \endcode
8273 * - The instance has a best known solution with objective value 15.
8274 * \code
8275 * =best= instance1 15
8276 * \endcode
8277 * - The instance is feasible (but has no objective function or we don't know a solution value)
8278 * \code
8279 * =feas= instance1
8280 * \endcode
8281 * - The instance is infeasible.
8282 * \code
8283 * =inf= instance1
8284 * \endcode
8285 *
8286 * If you don't know whether the instance is feasible or not (so the status is unknown),
8287 * you can omit the instance in the <code>solu</code>-file or write
8288 * \code
8289 * =unkn= instance1
8290 * \endcode
8291 *
8292 * <b>Note that in all lines the file extension of the file name is omitted.</b>
8293 * \n
8294 * See the files <code>scip/check/testset/short.test</code> and <code>scip/check/testset/short.solu</code>
8295 * for an example of a <code>test</code>-file and its corresponding <code>solu</code>-file.
8296 *
8297 *
8298 *
8299 * @section STARTING Starting a test run
8300 *
8301 *
8302 * \code
8303 * make TEST=testrun test
8304 * \endcode
8305 *
8306 * in the SCIP root directory. Note that <code>testrun</code> is exactly the basename of our
8307 * <code>test</code>-file (<code>testrun.test</code>). This will cause SCIP to solve our test instances
8308 * one after another and to create various output files (see \ref EVAL).
8309 *
8310 *
8311 * @section EVAL Evaluating a test run
8312 *
8313 * During computation, SCIP automatically creates the directory <code>scip/check/results/</code>
8314 * (if it does not already exist) and stores the following output files there.
8315 *
8316 * \arg <code>*.out</code> - output of <code>stdout</code>
8317 * \arg <code>*.err</code> - output of <code>stderr</code>
8318 * \arg <code>*.json</code> - SCIP statistics in JSON format
8319 * \arg <code>*.set</code> - copy of the used settings file
8320 * \arg <code>*.sol</code> - file with best found solution, if any
8321 *
8322 * \arg <code>*.res</code> - ASCII table containing a summary of the computational results
8323 * \arg <code>*.tex</code> - TeX table containing a summary of the computational results
8324 * \arg <code>*.pav</code> - <a href="http://www.gamsworld.org/performance/paver/">PAVER</a> output
8325 *
8326 * The last three files in the above list, i.e., the files containing a summary of the computational results,
8327 * can also be generated manually. Therefore the user has to call the <code>evalcheck.sh</code> script in the
8328 * @c check directory with the corresponding @c out file as argument. For example, this may be useful if the user stopped the
8329 * test before it was finished, in which case the last three files will not be automatically generated by SCIP.
8330 *
8331 * The last column of the ASCII summary table contains the solver status. We distinguish the following statuses: (in order of priority)
8332 *
8333 * \arg abort: solver broke before returning solution
8334 * \arg fail: solver cut off a known feasible solution (value of the <code>solu</code>-file is beyond the dual bound;
8335 * especially if problem is claimed to be solved but solution is not the optimal solution)
8336 * <b>or</b> if a final solution check revealed a violation of one of the original constraints.
8337 * \arg ok: solver solved problem with the value in solu-file
8338 * \arg solved: solver solved problem which has no (optimal) value in solu-file (since we here cannot detect the direction
8339 * of optimization, it is possible that a solver claims an optimal solution which contradicts a known feasible solution)
8340 * \arg better: solver found solution better than known best solution (or no solution was noted in the <code>solu</code>-file so far)
8341 * \arg gaplimit, sollimit: solver reached gaplimit or limit of number of solutions (at present: only in SCIP)
8342 * \arg timeout: solver reached any other limit (like time or nodes)
8343 * \arg unknown: otherwise
8344 *
8345 * Additionally the <code>evalcheck.sh</code> script can generate a <code>solu</code>-file by calling
8346 * \code
8347 * ./evalcheck.sh writesolufile=1 NEWSOLUFILE=<solu-file> <out-file>
8348 * \endcode
8349 * where <code><solu-file></code> denotes the name of the new file where the optimal values or primal bounds shall be written to
8350 * (and <code><out-file></code> denotes the output (<code>.out</code>) files to evaluate).
8351 *
8352 * Another feature can be enabled by calling:
8353 * \code
8354 * ./evalcheck.sh printsoltimes=1 ...
8355 * \endcode
8356 * The output has two additional columns containing the solving time until the first and the best solution was found.
8357 *
8358 *
8359 * @b Note: The @em basename of all these files is the same and has the following structure
8360 * which allows us to reconstruct the test run:
8361 *
8362 * \code
8363 * check.<test name>.<binary>.<machine name>.<setting name>
8364 * \endcode
8365 *
8366 * \arg <<code>test name</code>> indicates the name of the the test file, e.g., <code>testrun</code>
8367 * \arg <<code>binary</code>> defines the used binary, e.g., <code>scip-3.2.0.linux.x86_64.gnu.opt.spx</code>
8368 * \arg <<code>machine name</code>> tells the name of the machine, e.g., <code>mycomputer</code>
8369 * \arg <<code>setting name</code>> denotes the name of the used settings, e.g., <code>default</code>
8370 * means the (SCIP) default settings were used
8371 *
8372 * Using the examples out of the previous listing the six file names would have the name:
8373 *
8374 * \code
8375 * check.testrun.scip-1.1.0.linux.x86.gnu.opt.spx.mycomputer.default.<out,err,set,res,tex,pav>
8376 * \endcode
8377 *
8378 *
8379 * @section USING Using customized setting files
8380 *
8381 * It is possible to use customized settings files for the test run instead of testing SCIP with default settings.
8382 * These have to be placed in the directory <code>scip/settings/</code>.
8383 *
8384 * @b Note: Several common user parameters such as, e.g., the time limit and node limit parameters,
8385 * <b>cannot</b> be controlled by the settings file, whose specifications would be overwritten
8386 * by optional command line arguments to the <code>make test</code> command, see @ref ADVANCED
8387 * for a list of available advanced testing options that have to be specified from the command line.
8388 *
8389 * @b Note: Accessing settings files in subfolders of the @c settings directory is currently not supported.
8390 *
8391 * To run SCIP with a custom settings file, say for example <code>fast.set</code>, we call
8392 *
8393 * \code
8394 * make TEST=testrun SETTINGS=fast test
8395 * \endcode
8396 *
8397 * in the SCIP root directory. It is possible to enter a list of settings files as a double-quoted,
8398 * comma-separated list of settings names as <code>fast</code> above, i.e. <code>SETTINGS="fast,medium,slow"</code>
8399 * will invoke the solution process for every instance with the three settings <code>fast.set, medium.set, slow.set</code>
8400 * before continuing with the next instance from the <code>.test</code>-file. This may come in handy if the
8401 * whole test runs for a longer time and partial results are already available.
8402 *
8403 *
8404 * @section ADVANCED Advanced options
8405 *
8406 * We can further customize the test run by specifying the following options in the <code>make</code> call:
8407 *
8408 * \arg <code>CONTINUE</code> - continue the test run if it was previously aborted [default: "false"]
8409 * \arg <code>DISPFREQ</code> - display frequency of the output [default: 10000]
8410 * \arg <code>FEASTOL</code> - LP feasibility tolerance for constraints [default: "default"]
8411 * \arg <code>LOCK</code> - should the test run be locked to prevent other machines from performing the same test run [default: "false"]
8412 * \arg <code>MAXJOBS=n</code> - run tests on 'n' cores in parallel. Note that several instances are solved in parallel, but
8413 * only one thread is used per job (parallelization is not that easy) [default: 1]
8414 * \arg <code>MEM</code> - memory limit in MB [default: 6144]
8415 * \arg <code>NODES</code> - node limit [default: 2100000000]
8416 * \arg <code>TIME</code> - time limit for each test instance in seconds [default: 3600]
8417 * \arg <code>SETCUTOFF</code> - if set to '1', an optimal solution value (from the <code>.solu</code>-file) is used as objective limit [default: 0]
8418 * \arg <code>THREADS</code> - the number of threads used for solving LPs, if the linked LP solver supports multithreading [default: 1]
8419 * \arg <code>VALGRIND</code> - run valgrind on the SCIP binary; errors and memory leaks found by valgrind are reported as fails [default: "false"]
8420 * \arg <code>KEEPSOL</code> - if set to 'false', the best found solution is no longer written out to a solution file [default: "true"]
8421 * \arg <code>DEBUGTOOL</code> - runs SCIP through an additional tool, possible values: valgrind, rr, gdb, perf, "" [default: ""]
8422 *
8423 *
8424 * @section COMPARE Comparing test runs for different settings
8425 *
8426 * Often test runs are performed on the basis of different settings. In this case, it is useful to
8427 * have a performance comparison. For this purpose, we can use the <code>allcmpres.sh</code> script in
8428 * the @c check directory.
8429 *
8430 * Suppose, we performed our test run with two different settings, say <code>fast.set</code> and
8431 * <code>slow.set</code>. Assuming that all other parameters (including the SCIP binary), were the same,
8432 * we may have the following <code>res</code>-files in the directory <code>scip/check/results/</code>
8433 *
8434 * \code
8435 * check.testrun.scip-3.2.0.linux.x86_64.gnu.opt.spx.mycomputer.fast.res
8436 * check.testrun.scip-3.2.0.linux.x86_64.gnu.opt.spx.mycomputer.slow.res
8437 * \endcode
8438 *
8439 * For a comparison of both computations, we simply call
8440 *
8441 * \code
8442 * allcmpres.sh results/check.testrun.scip-3.2.0.linux.x86_64.gnu.opt.spx.mycomputer.fast.res \
8443 * results/check.testrun.scip-3.2.0.linux.x86_64.gnu.opt.spx.mycomputer.slow.res
8444 * \endcode
8445 *
8446 * in the @c check directory. This produces an ASCII table on the console that provide a detailed
8447 * performance comparison of both test runs. Note that the first <code>res</code>-file serves as reference
8448 * computation. The following list explains the output.
8449 * (The term "solver" can be considered as the combination of SCIP with a specific setting file.)
8450 *
8451 * \arg <code>Nodes</code> - Number of processed branch-and-bound nodes.
8452 * \arg <code>Time</code> - Computation time in seconds.
8453 * \arg <code>F</code> - If no feasible solution was found, then '#', empty otherwise.
8454 * \arg <code>NodQ</code> - Equals Nodes(i) / Nodes(0), where 'i' denotes the current solver and '0' stands for the reference solver.
8455 * \arg <code>TimQ</code> - Equals Time(i) / Time(0).
8456 * \arg <code>bounds check</code> - Status of the primal and dual bound check.
8457 *
8458 * \arg <code>proc</code> - Number of instances processed.
8459 * \arg <code>eval</code> - Number of instances evaluated (bounds check = "ok", i.e., solved to optimality
8460 * within the time and memory limit and result is correct). Only these instances are used in the calculation
8461 * of the mean values.
8462 * \arg <code>fail</code> - Number of instances with bounds check = "fail".
8463 * \arg <code>time</code> - Number of instances with timeout.
8464 * \arg <code>solv</code> - Number of instances correctly solved within the time limit.
8465 * \arg <code>wins</code> - Number of instances on which the solver won (i.e., the
8466 * solver was at most 10% slower than the fastest solver OR had the best
8467 * primal bound in case the instance was not solved by any solver within
8468 * the time limit).
8469 * \arg <code>bett</code> - Number of instances on which the solver was better than the
8470 * reference solver (i.e., more than 10% faster).
8471 * \arg <code>wors</code> - Number of instances on which the solver was worse than the
8472 * reference solver (i.e., more than 10% slower).
8473 * \arg <code>bobj</code> - Number of instances on which the solver had a better primal
8474 * bound than the reference solver (i.e., a difference larger than 10%).
8475 * \arg <code>wobj</code> - Number of instances on which the solver had a worse primal
8476 * bound than the reference solver (i.e., a difference larger than 10%).
8477 * \arg <code>feas</code> - Number of instances for which a feasible solution was found.
8478 * \arg <code>gnodes</code> - Geometric mean of the processed nodes over all evaluated instances.
8479 * \arg <code>shnodes</code> - Shifted geometric mean of the processed nodes over all evaluated instances.
8480 * \arg <code>gnodesQ</code> - Equals nodes(i) / nodes(0), where 'i' denotes the current
8481 * solver and '0' stands for the reference solver.
8482 * \arg <code>shnodesQ</code> - Equals shnodes(i) / shnodes(0).
8483 * \arg <code>gtime</code> - Geometric mean of the computation time over all evaluated instances.
8484 * \arg <code>shtime</code> - Shifted geometric mean of the computation time over all evaluated instances.
8485 * \arg <code>gtimeQ</code> - Equals time(i) / time(0).
8486 * \arg <code>shtimeQ</code> - Equals shtime(i) / shtime(0).
8487 * \arg <code>score</code> - N/A
8488 *
8489 * \arg <code>all</code> - All solvers.
8490 * \arg <code>optimal auto settings</code> - Theoretical result for a solver that performed 'best of all' for every instance.
8491 * \arg <code>diff</code> - Solvers with instances that differ from the reference solver in the number of
8492 * processed nodes or in the total number of simplex iterations.
8493 * \arg <code>equal</code> - Solvers with instances whose number of processed nodes and total number of
8494 * simplex iterations is equal to the reference solver (including a 10% tolerance) and where no timeout
8495 * occurred.
8496 * \arg <code>all optimal</code> - Solvers with instances that could be solved to optimality by
8497 * <em>all</em> solvers; in particular, no timeout occurred.
8498 *
8499 * Since this large amount of information is not always needed, one can generate a narrower table by calling:
8500 * \code
8501 * allcmpres.sh short=1 ...
8502 * \endcode
8503 * where <code>NodQ</code>, <code>TimQ</code> and the additional comparison tables are omitted.
8504 *
8505 * If the <code>res</code>-files were generated with the parameter <code>printsoltimes=1</code>
8506 * we can enable the same feature here as well by calling:
8507 * \code
8508 * allcmpres.sh printsoltimes=1 ...
8509 * \endcode
8510 * As in the evaluation, the output contains the two additional columns of the solving time until the first and the best solution was found.
8511 *
8512 * @section STATISTICS Statistical tests
8513 *
8514 * The \c allcmpres script also performs two statistical tests for comparing different settings: For deciding whether
8515 * more feasible solutions have been found or more instances have been solved to optimality or not, we use a McNemar
8516 * test. For comparing the running time and number of nodes, we use a variant of the Wilcoxon signed rank test. A
8517 * detailed explanation can be found in the PhD thesis of Timo Berthold (Heuristic algorithms in global MINLP solvers).
8518 *
8519 * @subsection McNemar McNemar test
8520 *
8521 * Assume that we compare two settings \c S1 and \c S2 with respect to the number of instances solved to optimality
8522 * within the timelimit. The null hypothesis would be "Both settings lead to an equal number of instances being solved
8523 * to optimality", which we would like to disprove. Let \f$n_1\f$ be the number of instances solved by setting \c S1
8524 * but not by \c S2, and let \f$n_2\f$ be the number of instances solved by setting \c S2 but not by \c S1. The
8525 * McNemar test statistic is
8526 * \f[
8527 * \chi^2 = \frac{(n_1 - n_2)^2}{n_1 + n_2}.
8528 * \f]
8529 * Under the null hypothesis, \f$\chi^2\f$ is chi-squared distributed with one degree of freedom. This allows to compute
8530 * a \f$p\f$-value as the probability for obtaining a similar or even more extreme result under the null hypothesis.
8531 * More explicitly, \c allcmpres uses the following evaluation:
8532 * - \f$0.05 < p\f$: The null hypothesis is accepted (marked by "X").
8533 * - \f$0.005 < p \leq 0.05\f$: The null hypothesis might be false (marked by "!").
8534 * - \f$0.0005 < p \leq 0.005\f$: The null hypothesis can be false (marked by "!!").
8535 * - \f$p \leq 0.0005\f$: The null hypothesis is very likely false (marked by "!!!").
8536 *
8537 * As an example consider the following output:
8538 * \code
8539 * McNemar (feas) x2 0.0000, 0.05 < p X
8540 * McNemar (opt) x2 6.0000, p ~ (0.005, 0.05] !
8541 * \endcode
8542 * Here, \c x2 represents \f$\chi^2\f$.
8543 *
8544 * In this case, the test with respect to the number of found feasible solutions is irrelevant, since their number is
8545 * equal. In particular, the null hypothesis gets accepted (i.e., there is no difference in the settings - this is
8546 * marked by "X").
8547 *
8548 * With respect to the number of instances solved to optimality within the timelimit, we have that \f$0.005 < p <=
8549 * 0.05\f$ (marked by <tt>p ~ (0.005, 0.05)</tt>). Thus, there is some evidence that the null hypothesis is false, i.e., the
8550 * settings perform differently; this is marked by "!". In the concrete case, we have 230 instances, all of which are
8551 * solved by setting \c S2, but only 224 by setting \c S1.
8552 *
8553 * @subsection Wilcoxon Wilcoxon signed rank test
8554 *
8555 * Assume that we compare two settings \c S1 and \c S2 with respect to their solution times (within the time limit). We
8556 * generate a sorted list of the ratios of the run times, where ratios that are (absolutely or relatively) within 1\%
8557 * of 1.0 are discarded, and ratios between 0.0 and 0.99 are replaced with their negative inverse in order to
8558 * obtain a symmetric distribution for the ratios around the origin.
8559 * We then assign ranks 1 to \c N to the remaining \c N data points in nondecreasing
8560 * order of their absolute ratio. This yields two groups \c G1
8561 * and \c G2 depending on whether the ratios are smaller than -1.0 or larger than 1.0 (\c G1 contains the instances for which
8562 * setting \c S1 is faster). Then the sums of the ranks in groups \c G1 and \c G2 are computed, yielding values \c R1
8563 * and \c R2, respectively.
8564 *
8565 * The Wilcoxon test statistic is then
8566 * \f[
8567 * z = \frac{\min(R1, R2) - \frac{N(N+1)}{4}}{\sqrt{\frac{N(N+1)(2N+1)}{24}}},
8568 * \f]
8569 * which we assume to be (approximately) normally distributed (with zero mean) and allows to compute the probability
8570 * \f$p\f$ that one setting is faster than the other. (Note that for \f$N \leq 60\f$, we apply a correction by
8571 * subtracting 0.5 from the numerator).
8572 *
8573 * As an example consider the following output:
8574 * \code
8575 * Wilcoxon (time) z -0.1285, 0.05 <= p X
8576 * Wilcoxon (nodes) z -11.9154, p < 0.0005 !!!
8577 * \endcode
8578 * While the \f$z\f$-value is close to zero for the run time, it is extremely negative regarding the solving nodes. This latter
8579 * tendency for the number of nodes is significant on a 0.05 % level, i.e., the probability \f$p\f$ that setting \c S1 uses more
8580 * nodes than setting \c S2 is negligible (this null hypothesis is rejected - marked by "!!!").
8581 *
8582 * However, the null hypothesis is not rejected with respect to the run time. In the concrete case, setting \c S1 has a
8583 * shifted geometric mean of its run times (over 230 instances) of 248.5, for \c S2 it is 217.6. This makes a ratio of
8584 * 0.88. Still - the null hypothesis is not rejected.
8585 *
8586 * @section SOLVER Testing and Evaluating using GAMS
8587 *
8588 * Analogously to the target <code>test</code> there is another target to run automated tests with <a href="http://www.gams.com/">gams</a>
8589 * \code
8590 * make testgams GAMSSOLVER=xyz
8591 * \endcode
8592 * For this target, the option GAMSSOLVER has to be given to specify the name of a GAMS solver to run, e.g. GAMSSOLVER=SCIP.
8593 * Additional advanced options specific to this target are:
8594 * GAMS to specify the GAMS executable (default: gams),
8595 * GAP to specify a gap limit (default: 0.0),
8596 * CLIENTTMPDIR to specify a directory where GAMS should put its scratch files (default: /tmp),
8597 * CONVERTSCIP to specify a SCIP which can be used to convert non-gams files into gams format (default: bin/scip, if existing; set to "no" to disable conversion).
8598 * The following options are NOT supported (and ignored): DISPFREQ, FEASTOL, LOCK.
8599 * A memory limit (MEM option) is only passed as workspace option to GAMS, but not enforced via ulimit (it's up to the solver to regard and obey the limit).
8600 *
8601 * Note: This works only if the referred programs are installed globally on your machine.
8602 *
8603 * The above options like <code>TIME</code> are also available for gams.
8604 *
8605 * After the testrun there should be an <code>.out</code>, an <code>.err</code> and a <code>.res</code> file
8606 * with the same basename as described above.
8607 *
8608 * Furthermore you can also use the script <code>allcmpres.sh</code> for comparing results.
8609 *
8610 * @section PYTHON Testing using PySCIPOpt
8611 *
8612 * To run a python script that uses PySCIPOpt with <code>make test</code> or <code>make testcluster</code>, one has to
8613 * specify the python code to execute with the option <code>EXECUTABLE=/full/path/to/python-script.py</code>.
8614 * Note that <code>python-script.py</code> must be an executable file.
8615 * In addition, one <b>must</b> specify which python it should run with the option <code>PYTHON=my-python</code>.
8616 * The reason for this is that one usually installs PySCIPOpt in a virtual environment, thus only the python of the
8617 * virtual environment will work with the python script.
8618 *
8619 * The scripts work in such a way that they pass information to SCIP like the setting files, the instance name, and some other options.
8620 * It is the responsability of the python script <code>python-script.py</code> to parse this information.
8621 * Thus, you need to modify your python script to read the setting files and the other options provided by the testing scripts.
8622 * An example of how to do this is provided in <code>scip/check/scip-runner.py</code>.
8623 * One should either modify <code>scip/check/scip-runner.py</code> or include the <code>build_model()</code> function
8624 * into your script to correctly read the options passed by the scripts.
8625 *
8626 * An example of how to run the tests is
8627 * \code
8628 * make test EXECUTABLE=/full/path/to/scip/check/scip-runner.py PYTHON=python
8629 * \endcode
8630 */
8631
8632/*--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
8633
8634/**@page COUNTER How to use SCIP to count/enumerate feasible solutions
8635 *
8636 * SCIP is capable of computing (count or enumerate) the number of feasible solutions of a given constraint integer
8637 * program. In case continuous variables are present, the number of feasible solutions for the projection to the
8638 * integral variables is counted/enumerated. This means, an assignment to the integer variables is counted if the
8639 * remaining problem (this is the one after fixing the integer variables w.r.t. to this assignment) is feasible.
8640 *
8641 * As a first step you have to load or create your problem in the usual way. In case of using the
8642 * interactive shell, you use the <code>read</code> command:
8643 *
8644 * <code>SCIP&gt; read &lt;file name&gt;</code>
8645 *
8646 * Afterwards you can count the number of feasible solution with the command <code>count</code>.
8647 *
8648 * <code>SCIP&gt; count</code>
8649 *
8650 * @note After completing the counting process, SCIP will terminate with status <tt>infeasible</tt>. This is intended
8651 * behavior, because SCIP counts solutions by the following internal mechanism. Each feasible solution that is found is
8652 * reported as infeasible to the SCIP core. This avoids that SCIP performs reductions based on the primal bound that
8653 * could cut off suboptimal feasible solutions, which would then be missing in the count. However, as a result, the
8654 * SCIP core has not found any feasible solutions during the search and reports status <tt>infeasible</tt>.
8655 *
8656 * By default, SCIP only counts the number of solutions but does not store (enumerate) them. If you are interested in
8657 * that see \ref COLLECTALLFEASEBLES.
8658 *
8659 * @note Since SCIP version 2.0.0 you do not have to worry about the impact of dual reductions anymore. These are
8660 * automatically turned off. The only thing you should switch off are restarts. These restarts can lead to a wrong
8661 * counting process. We recommend using the counting settings which can be set in the interactive shell as follows:
8662 *
8663 * <code>SCIP&gt; set emphasis counter</code>
8664 *
8665 * The SCIP callable library provides an interface function SCIPcount() which allows users to count the number of feasible
8666 * solutions to their problem. The function SCIPsetParamsCountsols(), which is also located in cons_countsols.h, loads the
8667 * predefined counting settings to ensure a safe count. The complete list of all functions that can be used for counting
8668 * via the callable library can be found in cons_countsols.h.
8669 *
8670 *
8671 * @section COUNTLIMIT Limit the number of solutions which should be counted
8672 *
8673 * It is possible to give a (soft) upper bound on the number solutions that should be counted. If this upper bound is
8674 * exceeded, SCIP will be stopped. The name of this parameter is <code>constraints/countsols/sollimit</code>. In
8675 * the interactive shell this parameter can be set as follows:
8676 *
8677 * <code>SCIP&gt; set constraints countsols sollimit 1000</code>
8678 *
8679 * In case you are using the callable library, this upper bound can be assigned by calling SCIPsetLongintParam() as follows:
8680 *
8681 * \code
8682 * SCIP_CALL( SCIPsetLongintParam( scip, "constraints/countsols/sollimit", 1000) );
8683 * \endcode
8684 *
8685 *
8686 * The reason why this upper bound is soft comes from the fact that, by default, SCIP uses a technique called unrestricted
8687 * subtree detection. Using this technique it is possible to detect several solutions at once. Therefore, it can happen
8688 * that the solution limit is exceeded before SCIP is stopped.
8689 *
8690 * @section COLLECTALLFEASEBLES Collect all feasible solutions
8691 *
8692 * Per default SCIP only counts all feasible solutions. This means, these solutions are not stored. If you switch the
8693 * parameter <code>constraints/countsols/collect</code> to TRUE (the default value is FALSE) the detected solutions are
8694 * stored. Changing this parameter can be done in the interactive shell
8695 *
8696 * <code>SCIP&gt; set constraints countsols collect TRUE</code>
8697 *
8698 * as well as via the callable library
8699 *
8700 * \code
8701 * SCIP_CALL( SCIPsetBoolParam( scip, "constraints/countsols/collect", TRUE) );
8702 * \endcode
8703 *
8704 * @note The solution which are collected are stored w.r.t. the active variables. These are the variables which got not
8705 * removed during presolving.
8706 *
8707 * In case you are using the interactive shell you can write all collected solutions to a file as follows
8708 *
8709 * <code>SCIP&gt; write allsolutions &lt;file name&gt;</code>
8710 *
8711 * In that case the sparse solutions are unrolled and lifted back into the original variable space.
8712 *
8713 * The callable library provides a function which gives access to all collected sparse solutions. That is,
8714 * SCIPgetCountedSparseSolutions(). The sparse solutions you get are defined w.r.t. active variables. To get solutions
8715 * w.r.t. to the original variables. You have to do two things:
8716 *
8717 * -# unroll each sparse solution
8718 * -# lift each solution into original variable space by extending the solution by those variable which got removed
8719 * during presolving
8720 *
8721 * The get the variables which got removed during presolving, you can use the functions SCIPgetFixedVars() and
8722 * SCIPgetNFixedVars(). The function SCIPgetProbvarLinearSum() transforms given variables, scalars and constant to the
8723 * corresponding active variables, scalars and constant. Using this function for a single variable gives a representation
8724 * for that variable w.r.t. the active variables which can be used to compute the value for the considered solution (which
8725 * is defined w.r.t. active variables).
8726 *
8727 * For that complete procedure you can also check the source code of
8728 * \ref SCIP_DECL_DIALOGEXEC(SCIPdialogExecWriteAllsolutions) "SCIPdialogExecWriteAllsolutions()" cons_countsols.c which
8729 * does exactly that.
8730 *
8731 *
8732 * @section COUNTOPTIMAL Count number of optimal solutions
8733 *
8734 * If you are interested in counting the number of optimal solutions, this can be done with SCIP using the
8735 * <code>count</code> command by applying the following steps:
8736 *
8737 * -# Solve the original problem to optimality and let \f$c^*\f$ be the optimal value
8738 * -# Added the objective function as constraint with left and right hand side equal to \f$c^*\f$
8739 * -# load the adjusted problem into SCIP
8740 * -# use the predefined counting settings
8741 * -# start counting the number of feasible solutions
8742 *
8743 * If you do this, SCIP will collect all optimal solutions of the original problem.
8744 *
8745 */
8746
8747/*--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
8748
8749/** @page SYMMETRY How to use symmetry handling in SCIP
8750 *
8751 * Symmetry handling is an important feature of SCIP that allows to discard symmetric subproblems from the
8752 * branch-and-bound tree, and thus, can substantially reduce the running time. To handle symmetries, SCIP
8753 * automatically detects symmetries and then applies (combinations of) symmetry handling methods.
8754 *
8755 * @section SYMDETECT Symmetry detection
8756 *
8757 * SCIP can detect two types of symmetries: permutation symmetries and signed permutation symmetries.
8758 * In a purely integer linear setting
8759 * \f[
8760 * \max \{ c^{\top} x : Ax \leq b,\; x \in \mathbb{Z}^n \},
8761 * \f]
8762 * a permutation symmetry is a permutation \f$\gamma\f$ of \f$\{1,\dots,n\}\f$ that acts on vector \f$x\f$ by
8763 * permuting its coordinates via \f$\gamma(x) = (x_{\gamma^{-1}(1)}, \dots, x_{\gamma^{-1}(n)})\f$
8764 * such that
8765 *
8766 * -# \f$\gamma\f$ leaves the objective invariant, i.e., \f$c^{\top}x = c^{\top}\gamma(x)\f$, and
8767 * -# \f$\gamma\f$ maps feasible solutions onto feasible solutions, i.e., \f$Ax \leq b\f$ if and only
8768 * if \f$A\gamma(x) \leq b\f$.
8769 *
8770 * Signed permutation symmetries are defined similarly and allow to also handle symmetries arising from
8771 * reflections of the feasible region along standard hyperplanes, e.g., mapping \f$x_i\f$ to \f$-x_i\f$
8772 * and keeping the remaining entries of a solution vector \f$x\f$ invariant. Formally, a signed permutation \f$\gamma\f$
8773 * is a permutation of the set \f$\{\pm 1, \dots, \pm n\}\f$ such that \f$\gamma(-i) = - \gamma(i)\f$
8774 * for all \f$i \in \{1,\dots,n\}\f$. A signed permutation acts on a vector \f$x\f$ as
8775 * \f$\gamma(x) = (\mathrm{sgn}(\gamma^{-1}(1))x_{|\gamma^{-1}(1)|},\dots,
8776 * \mathrm{sgn}(\gamma^{-1}(n))x_{|\gamma^{-1}(n)|})\f$,
8777 * where \f$\mathrm{sgn}(\cdot)\f$ is the sign function. The remaining properties of a symmetry are the same.
8778 * It is possible to switch between these two types of symmetries via the
8779 * parameter <code>propagating/symmetry/symtype</code>.
8780 * Moreover, to detect more general signed permutations, one can shift variables with a
8781 * bounded domain to be centered at the origin. This way, also variables with, e.g., domains \f$[1,2]\f$
8782 * and \f$[0,1]\f$ can be symmetric. In SCIP, we implement this shift only within symmetry detection
8783 * to find generalized signed permutations; the variable bounds of the problem itself remain unchanged.
8784 *
8785 * Since both definitions depend on the feasible region of the integer program, which is unknown
8786 * in general, SCIP only computes symmetries that leave the formulation of the optimization problem
8787 * invariant. To detect such formulation symmetries, SCIP builds an auxiliary colored graph whose
8788 * color-preserving automorphisms correspond to symmetries of the integer program. The symmetries of
8789 * the graph, and thus of the integer program, are then computed by an external graph automorphism
8790 * library that needs to be linked to SCIP. Currently, SCIP can use three such libraries: The graph
8791 * automorphism libraries bliss, nauty/traces, and dejavu. They are the basic workhorses to detect symmetries. Moreover, one can use
8792 * sassy, a graph symmetry preprocessor which passes the preprocessed graphs to bliss or nauty/traces; sassy is automatically included in dejavu.
8793 * The current default is to use nauty in combination with sassy for symmetry detection.
8794 * To use other symmetry packages, options <code>SYM</code> and <code>-DSYM</code> in the Makefile and CMake
8795 * system, respectively, need to be set.
8796 *
8797 * Besides purely integer linear problems, SCIP also supports symmetry detection for general
8798 * constraint mixed-integer programs containing most of the constraint types that can be handled
8799 * by SCIP. In particular, symmetries of mixed-integer nonlinear problems can be detected.
8800 * Moreover, symmetries can also be detected in code containing customized constraints.
8801 * To this end, a suitable callback needs to be implemented, see \ref SYMDETECTCUSTOM.
8802 *
8803 * The (generators of the) symmetry group detected by SCIP can be printed to the terminal
8804 * by querying <code>display symmetry</code> in SCIP's interactive shell.
8805 *
8806 * @subsection SYMPROCESS Processing symmetry information
8807 *
8808 * After symmetries have been computed, SCIP has access to a list \f$\gamma_1,\dots,\gamma_m\f$ of
8809 * (signed) permutations that generate a group \f$\Gamma\f$ of symmetries of the optimization problem. That
8810 * is, SCIP has not access to all permutations in \f$\Gamma\f$, but only a set of generators. Based
8811 * on these generators, SCIP analyzes the group \f$\Gamma\f$ and checks whether it can be split into
8812 * independent factors. That is, whether there exist subgroups \f$\Gamma_1,\dots,\Gamma_k\f$ of
8813 * \f$\Gamma\f$ that act on pairwise independent sets of variables such that \f$\bigcup_{i=1}^k \Gamma_i = \Gamma\f$.
8814 * In this case, SCIP can handle the symmetries of the different subgroups independently. In particular,
8815 * different subgroups can be treated by different symmetry handling methods.
8816 *
8817 * @section SYMMETHODS Symmetry handling methods
8818 *
8819 * Most symmetry handling methods available in SCIP have only been implemented for ordinary permutation symmetries,
8820 * and not for signed permutation symmetries. In the following, we silently assume that the described methods
8821 * deal with ordinary permutation symmetries if not mentioned differently.
8822 * To handle symmetries, SCIP uses three different classes of methods, which we detail below.
8823 *
8824 * @subsection SYMCONSS Static symmetry handling constraints for binary variable domains
8825 *
8826 * SCIP contains three constraint handlers for handling symmetries of binary variables: the symresack,
8827 * orbisack, and orbitope constraint handler. Given a symmetry \f$\gamma\f$,
8828 * the symresack constraint handler enforces that a solution vector \f$x\f$ is not lexicographically
8829 * smaller than its image \f$\gamma(x)\f$. This constraint is enforced by a propagation algorithm
8830 * and separating inequalities. Moreover, given the disjoint cycle decomposition of \f$\gamma\f$,
8831 * SCIP checks, for each cycle of \f$\gamma\f$, whether all variables in the cycle are contained
8832 * in set packing or partitioning constraints. If this is the case, specialized inequalities can
8833 * be separated.
8834 *
8835 * In case the permutation \f$\gamma\f$ is an involution, i.e., \f$\gamma(\gamma(x)) = x\f$,
8836 * specialized separation and propagation algorithms can be used, which are implemented in the
8837 * orbisack constraint handler. For orbisack constraints, also facet-defining inequalities of the
8838 * convex hull of all binary points \f$x\f$ being not lexicographically smaller than \f$\gamma(x)\f$
8839 * can be separated. Since the coefficients in these inequalities grow exponentially large which might
8840 * cause numerical instabilities, the separation of these inequalities is disabled by default, but can be
8841 * enabled via the parameter <code>constraints/orbisack/orbiSeparation</code>. Furthermore, to avoid
8842 * numerical instabilities, the parameter <code>constraints/orbisack/coeffbound</code> controls the
8843 * maximum absolute value of a coefficient in separated facet-defining inequalities.
8844 *
8845 * Finally, the orbitope constraint handler is able to handle symmetries of special symmetric groups \f$\Gamma\f$.
8846 * For orbitopes to be applicable, the affected variables need to be arranged in a matrix \f$X\f$ such that
8847 * the symmetries in \f$\Gamma\f$ permute the columns of \f$X\f$. Symmetries are then handled by orbitope
8848 * constraints by enforcing to only compute solution matrices \f$X\f$ whose columns are sorted lexicographically
8849 * non-increasingly. To this end, a propagation algorithm is used and inequalities are separated. In case
8850 * the variables of each row of the matrix \f$X\f$ are contained in a set packing or partitioning constraint,
8851 * specialized propagation and separation routines are used.
8852 *
8853 * @subsection SYMPROP Dynamic symmetry handling by propagation
8854 *
8855 * Static symmetry handling enforces a lexicographic ordering on the variable solution vectors.
8856 * The pro of that approach, is that throughout the solving process, the same lexicographic ordering constraint
8857 * is used. This means that already during presolving certain symmetry reductions can be made.
8858 * The con of this approach is that an ordering of the variables for lexicographic comparisons have to be made
8859 * before solving. Consequently, if reductions of certain variable domains are found, but these variables are compared
8860 * late by the lexicographic comparison order, the effect for symmetry handling is very slim.
8861 *
8862 * Dynamic symmetry handling addresses this issue by propagating symmetry handling constraints, where the variable
8863 * comparison ordering are determined while solving, attempting to make strong symmetry handling reductions early on.
8864 * Dynamic symmetry handling removes feasible solutions of the problem, while it is guaranteed that at least one
8865 * symmetric solution remains feasible.
8866 *
8867 * Whether dynamic or static symmetry handling methods are used, is determined by the boolean parameter
8868 * <code>propagating/symmetry/usedynamicprop</code>.
8869 * SCIP features three dynamic symmetry handling methods.
8870 * SCIP only provides propagation methods for handling these symmetries,
8871 * and the methods work on variables with arbitrary (so also non-binary) variable domains.
8872 *
8873 * -# Orbitopal reduction is the dynamic counterpart of orbitopal fixing. This method can be used if the variables
8874 * can be arranged without duplicates in a matrix, and symmetries permute the columns of this matrix. This method
8875 * propagates the variable domains such that solutions in matrix-form have lexicographically decreasing columns,
8876 * with respect to the dynamically chosen row and column order.
8877 * Orbitopal reduction respects the parameter <code>propagating/symmetry/detectorbitopes</code>.
8878 * -# Lexicographic reduction is the dynamic counterpart of symresack and orbisack propagation.
8879 * Lexicographic reduction respects the parameter <code>propagating/symmetry/addsymresacks</code>.
8880 * At the moment, the implementation of this method is the only one that allows to also handle signed permutation
8881 * symmetries.
8882 * -# Orbital reduction is a generalization of orbital fixing that also works for non-binary variable domains.
8883 * Orbital reduction respects the 2-bit of the bitset <code>misc/usesymmetry</code>.
8884 * See \ref SYMMETHODSELECT "method selection". Since there is no static counterpart, this method ignores
8885 * <code>propagating/symmetry/usedynamicprop</code>.
8886 *
8887 * In all cases, the dynamic variable ordering is derived from the branching decisions.
8888 * In particular, at different branch-and-bound tree nodes, a different variable ordering can be active.
8889 * Since the symmetries are handled for independent factors of the symmetry group, a different variable ordering method
8890 * can be used for handling symmetries in different factors. In SCIP, the same method is used for orbital reduction and
8891 * for lexicographic reduction, which means that these two methods are compatible and can be used simultaneously in the
8892 * same factor. Orbitopal reduction uses a different method.
8893 *
8894 * As SCIP might restart the branch-and-bound process, which removes information regarding the branching decisions,
8895 * we need to make sure that correct reductions are found after a restart.
8896 * If a restart occurs, static symmetry handling methods are preserved. Since dynamic symmetry handling methods
8897 * depend on the branch-and-bound tree structure, and because the prior branch-and-bound tree is removed,
8898 * the dynamic symmetry handling methods are disabled after a restart.
8899 *
8900 * @subsection SYMSST SST cuts
8901 *
8902 * The Schreier-Sims table (SST) is a table that contains certain information about symmetry groups
8903 * and can be used, among others, to derive symmetry handling inequalities. The corresponding SST cuts
8904 * are symmetry handling inequalities that are defined iteratively in rounds \f$r = 1,\dots,R\f$.
8905 * In each round \f$r\f$, a leader variable \f$\ell_r\f$ is selected and the group
8906 * \f$\Gamma_r = \{ \gamma \in \Gamma : \gamma(\ell_i) = \ell_i \text{ for all } i = 1,\dots,r-1\}\f$
8907 * is considered. Then, the symmetry handling inequalities of round \f$r\f$ are defined as
8908 * \f$x_{\ell_r} \geq x_j\f$ for all \f$j \in \{\gamma(i) : i \in \{1,\dots,n\}\}\f$.
8909 * The latter set is called the orbit of leader \f$\ell_r\f$.
8910 *
8911 * SST cuts admit many degrees of freedom. In particular, they are not limited to binary variables
8912 * but can be used for arbitrary variable types. A user can gain control over the selection process of
8913 * SST cuts via several parameters. For instance,
8914 *
8915 * - <code>sstleadervartype</code> is a bitset encoding the variable types of leaders: the 1-bit models binary,
8916 * the 2-bit integer, the 4-bit implied integral of any type, and the 8-bit continuous variables. That is, a value
8917 * of 9 models that the leader can be a binary or continuous variable.
8918 * - <code>sstleaderrule</code> ranges from 0 to 2 and models whether a leader is the first variable in
8919 * its orbit, the last variable in its orbit, or a variable with most conflicts with other variables in
8920 * the orbit, respectively.
8921 * - <code>ssttiebreakrule</code> ranges from 0 to 2 and models whether an orbit of minimum size, maximum
8922 * size or with most variables being in conflict to the leader is selected, respectively.
8923 * - <code>sstmixedcomponents</code> whether SST cuts are also applied if a symmetries do not only affect
8924 * variables of a single type.
8925 * - <code>sstaddcuts</code> whether SST cuts are added to the problem. If no cuts are added, only
8926 * binary variables might be fixed to 0 if they are in conflict with the leader.
8927 *
8928 * @subsection SYMMETHODSELECT Selecting symmetry handling methods
8929 *
8930 * The symmetry handling methods explained above can be enabled and disabled via the parameter
8931 * <code>misc/usesymmetry</code>, which encodes the enabled methods via a bitset that ranges between 0
8932 * and 7: the 1-bit encodes symmetry handling constraints, the 2-bit encodes orbital reduction, and the
8933 * 4-bit encodes SST cuts. For example, <code>misc/usesymmetry = 3</code> enables symmetry handling
8934 * constraints and orbital reduction, whereas <code>misc/usesymmetry = 0</code> disables symmetry handling.
8935 * In the following, we explain how the combination of different symmetry handling methods works.
8936 *
8937 * The default strategy of SCIP is to handle symmetries via the bitset value 7, i.e., symmetry handling
8938 * constraints, orbital reduction, and SST cuts are enabled. To make sure that the different methods are
8939 * compatible, the following steps are carried out:
8940 *
8941 * -# SCIP determines independent subgroups \f$\Gamma_1,\dots,\Gamma_k\f$ as described in \ref SYMPROCESS.
8942 * Then, for each subgroup \f$\Gamma_i\f$, different symmetry handling methods can be applied.
8943 * -# For each subgroup \f$\Gamma_i\f$, a heuristic is called that checks whether orbitopes are applicable
8944 * to handle the entire subgroup. If yes, this subgroup is handled by orbitopes and no other
8945 * symmetry handling methods.
8946 * -# Otherwise, if parameter <code>propagating/symmetry/detectsubgroups</code> is <code>TRUE</code>
8947 * and <code>propagating/symmetry/usedynamicprop</code> is <code>FALSE</code>, a
8948 * heuristic is called to detect whether "hidden" orbitopes are present. That is, whether some but not
8949 * all symmetries of \f$\Gamma_i\f$ can be handled by orbitopes. If sufficiently many symmetries can
8950 * be handled by orbitopes, orbitopes are applied and, if parameter <code>propagating/symmetry/addweaksbcs</code>
8951 * is TRUE, some compatible SST cuts are added, too. Besides this, no further symmetry handling methods
8952 * are applied for \f$\Gamma_i\f$.
8953 * -# Otherwise, orbital reduction is used. If <code>propagating/symmetry/usedynamicprop</code> and
8954 * <code>propagating/symmetry/addsymresacks</code> are <code>TRUE</code>, then also the dynamic lexicographic
8955 * reduction method is used.
8956 * -# Otherwise, if the majority of variables affected by \f$\Gamma_i\f$ are non-binary, SST cuts are applied
8957 * to handle \f$\Gamma_i\f$. No further symmetry handling methods are applied for \f$\Gamma_i\f$.
8958 *
8959 * @note If orbital reduction is enabled, a factor \f$\Gamma_i\f$ can always be handled by this method.
8960 * As such, by default, no SST cuts will be added.
8961 *
8962 * @note Depending on the setting of <code>misc/usesymmetry</code>, it might be possible that a symmetry component is
8963 * not handled. For instance, if only orbitopal reduction is used
8964 * (i.e., <code>propagating/symmetry/detectorbitopes</code> is set to 1),
8965 * and if a symmetry component is no orbitope, no symmetry is handled for that component at all.
8966 *
8967 *
8968 * @subsection SYMTIMING Controlling the timing of symmetry computation
8969 *
8970 * Since presolving might both remove and introduce formulation symmetries, the timing of computing symmetries
8971 * can be changed via the parameter <code>propagating/symmetry/symtiming</code>.
8972 * The parameter takes value 0, 1, or 2, corresponding to computing symmetries before presolving,
8973 * during presolving, or at the end of presolving, respectively.
8974 * Based on the computed symmetries, SCIP enables some symmetry handling methods as explained above.
8975 *
8976 * @subsection SYMDETECTCUSTOM Symmetry detection for customized constraints
8977 *
8978 * To detect (signed) permutation symmetries, SCIP requests from each constraint present in the problem to be solved
8979 * a node and edge colored graph whose symmetries correspond to the symmetries of the corresponding constraint.
8980 * This information is provided by two callbacks, the SCIP_DECL_CONSGETPERMSYMGRAPH callback for permutation
8981 * symmetries and the SCIP_DECL_CONSGETSIGNEDPERMSYMGRAPH callback for signed permutation symmetries. If a
8982 * constraint handler does not implement one of these callbacks, SCIP will not detect symmetries of the corresponding
8983 * type.
8984 *
8985 * In the following, we briefly describe how such a symmetry detection graph looks like for linear constraints.
8986 * Afterwards, we mention the basic setup of the symmetry detection graphs and how the callbacks could be implemented
8987 * for customized constraints.
8988 *
8989 * @subsubsection SYMDETECTLINEAR Symmetry detection graphs for linear constraints
8990 *
8991 * Simple permutation symmetries of a linear constraint \f$\sum_{i = 1}^n a_ix_i \leq \beta\f$ are given
8992 * by permutations that exchange equivalent variables with the same coefficients. These symmetries can be encoded
8993 * by a graph with the following structure. For every variable \f$x_i\f$, the graph contains a node \f$v_i\f$
8994 * that receives a color that uniquely determines the type of the variable (lower/upper bound, objective coefficient,
8995 * integrality). Moreover, the graph contains a node \f$w\f$ that receives a color corresponding to the right-hand side
8996 * \f$\beta\f$. Node \f$w\f$ is then connected with all nodes corresponding to variables. Edge \f$\{w,v_i\}\f$ then
8997 * receives a color corresponding to the coefficient \f$a_i\f$. Then, every automorphism of this graph corresponds to a
8998 * permutation symmetry of the linear constraint.
8999 *
9000 * For signed permutation symmetries, almost the same construction can be used. The only difference is that also
9001 * nodes \f$v_{-i}\f$ need to be introduced that correspond to the negation of variable \f$x_i\f$. These negated
9002 * variable nodes are then also connected with node \f$\beta\f$ and the corresponding edge receives color \f$-a_i\f$.
9003 * Finally, to make sure that the corresponding symmetry corresponds to a signed permutation \f$\gamma\f$, i.e.,
9004 * \f$\gamma(-i) = - \gamma(i)\f$, one also needs to add the edges \f$\{v_i,v_{-i}\}\f$ that remain uncolored.
9005 * Note that the color of node \f$v_{-i}\f$ also needs to uniquely determine the negated variable bounds and
9006 * objective coefficient.
9007 *
9008 * @subsubsection SYMDETECTRULES Principles for building symmetry detection graphs
9009 *
9010 * A symmetry detection graph of a constraint needs to have the property that each of its automorphisms corresponds
9011 * to a (signed) permutation of the constraint. Moreover, the corresponding constraint handler of the constraints
9012 * needs to be encoded in the graph to make sure that only symmetries between equivalent constraints can be computed.
9013 * Among others, this can be achieved by assigning the nodes and edges appropriate colors. To make sure that the
9014 * colors are compatible between the different symmetry detection graphs, SCIP automatically determines the colors of
9015 * nodes and edges based on information that is provided by the user (or the creator of the graph).
9016 *
9017 * A pointer to a globally maintained symmetry detection graph is provided to the callbacks. The nodes and edges of the
9018 * graph of a constraint are added to this global graph.
9019 * The nodes of the graph need to be added via the functions <code>SCIPaddSymgraphValnode()</code>
9020 * and <code>SCIPaddSymgraphConsnode()</code>. The first function can be used to create nodes corresponding to
9021 * a numerical value like \f$\beta\f$ in the above example, the latter function creates a node corresponding to
9022 * a provided constraint. This ensures that only symmetry detection graphs from the same constraint handler
9023 * can be isomorphic. The colors of the nodes are then computed automatically by SCIP based on the information
9024 * that is provided the functions creating these nodes. This ensures that node colors are compatible.
9025 *
9026 * Edges are created via the function <code>SCIPaddSymgraphEdge()</code> which receives, among others, the
9027 * indices of created nodes. Note that there is no function for creating variable nodes as SCIP automatically
9028 * creates nodes for variables. Their indices can be accessed via <code>SCIPgetSymgraphVarnodeidx()</code> for
9029 * original variables and <code>SCIPgetSymgraphNegatedVarnodeidx()</code> for negated variables used for
9030 * signed permutations. The edges between variables \f$x_i\f$ and \f$-x_i\f$ are also automatically present
9031 * in the symmetry detection graph for signed permutation symmetries. The function <code>SCIPaddSymgraphEdge()</code>
9032 * also takes a numerical value as argument, which allows to assign an edge a weight (e.g., \f$a_i\f$
9033 * as in the above example).
9034 *
9035 * Moreover, special nodes, so-called operator nodes, can be added via <code>SCIPaddSymgraphOpnode()</code>.
9036 * Such nodes allow to model special structures of a constraint, which allow to have more degrees of freedom in
9037 * creating symmetry detection graphs. Different operators are distinguished by an integral value.
9038 * Their encoding is thus similar to the one of nodes created by <code>SCIPaddSymgraphValnode()</code>.
9039 * In computing colors, operator nodes are treated differently though, which allows to distinguish
9040 * operator 2 from the numerical value 2.
9041 *
9042 * @subsubsection SYMDETECTEXAMPLES Example for creating symmetry detection callbacks
9043 *
9044 * Let \f$G = (V,E)\f$ be an undirected graph with node weights \f$c_v\f$, \f$v \in C\f$. The maximum weight
9045 * stable set problem can be modeled via the integer program
9046 * \f\‍[ \max\Big\{ \sum_{v \in V} c_vx_v : x_u + x_v \leq 1 \text{ for all } \{u,v\} \in E,\; x \in \{0,1\}^V\Big\}.\f\‍]
9047 * Suppose a user wants to implement a constraint handler <code>cons_stableset</code> that enforces a solution to define
9048 * a stable set in \f$G\f$, e.g., by propagation methods and separating edge and clique inequalities.
9049 * Then, the symmetries of the constraint are the weight-preserving automorphisms of the underlying graph \f$G\f$.
9050 * The symmetry detection graph thus can be almost a copy of \f$G\f$.
9051 *
9052 * In our construction, we introduce for each node \f$v\f$ of the graph an operator node \f$v'\f$.
9053 * Moreover, for each edge \f$\{u,v\}\in E\f$, we add the edges \f$\{u',v'\}\f$ to the symmetry detection graph.
9054 * To identify the symmetry detection graph as derived from <code>cons_stableset</code>, we add a constraint node
9055 * that is connected with all operator nodes, which preserves the automorphisms of \f$G\f$. Finally, each
9056 * node \f$v'\f$ is connected with the corresponding variable node for \f$x_v\f$ by an edge.
9057 *
9058 * In the following, we present a code snippet showing how to implement the above mentioned symmetry detection graph.
9059 * We assume that the constraint data <code>consdata</code> contains the following fields
9060 *
9061 * - <code>nnodes</code> number of nodes in graph;
9062 * - <code>nedges</code> number of edges in graph;
9063 * - <code>first</code> array containing the first nodes of each edge;
9064 * - <code>second</code> array containing the second nodes of each edge;
9065 * - <code>weights</code> array containing for each node its corresponding weight;
9066 * - <code>vars</code> array containing a binary variable for each node modeling whether node is present in stable set.
9067 *
9068 * The code for creating the symmetry detection callback could then look like this.
9069 *
9070 * \code{.c}
9071 * #define NODEOP 1
9072 * static
9073 * SCIP_DECL_CONSGETPERMSYMGRAPH(consGetPermsymGraphStableSet)
9074 * {
9075 * SCIP_CONSDATA* consdata;
9076 * int* idx;
9077 * int vidx;
9078 * int nnodes;
9079 * int v;
9080 *
9081 * consdata = SCIPconsGetData(cons);
9082 * nnodes = consdata->nnodes;
9083 *
9084 * SCIP_CALL( SCIPallocBufferArray(scip, &idx, nnodes + 1) );
9085 *
9086 * // create operator nodes and constraint node
9087 * for( v = 0; v < nnodes; ++v )
9088 * {
9089 * SCIP_CALL( SCIPaddSymgraphOpnode(scip, graph, NODEOP, &idx[v]) );
9090 * }
9091 * SCIP_CALL( SCIPaddSymgraphConsnode(scip, graph, cons, 0.0, 0.0, &idx[nnodes]) );
9092 *
9093 * // add edges of underlying graph
9094 * for( v = 0; v < consdata->nedges; ++v )
9095 * {
9096 * SCIP_CALL( SCIPaddSymgraphEdge(scip, graph, idx[consdata->first[v]], idx[consdata->second[v]], FALSE, 0.0) );
9097 * }
9098 *
9099 * // connect nodes with constraint node
9100 * for( v = 0; v < nnodes; ++v )
9101 * {
9102 * SCIP_CALL( SCIPaddSymgraphEdge(scip, graph, idx[v], nodeidx[nnodes], FALSE, 0.0) );
9103 * }
9104 *
9105 * // connect operator nodes with variable nodes, assign edges weight of node
9106 * for( v = 0; v < nnodes; ++v )
9107 * {
9108 * vidx = SCIPgetSymgraphVarnodeidx(scip, graph, consdata->vars[v]);
9109 * SCIP_CALL( SCIPaddSymgraphEdge(scip, graph, idx[v], vidx, TRUE, consdata->weights[v]) );
9110 * }
9111 *
9112 * SCIPfreeBufferArray(scip, &idx);
9113 *
9114 * return SCIP_OKAY;
9115 * }
9116 * \endcode
9117 */
9118
9119/**@page LICENSE License
9120 *
9121 * \verbinclude LICENSE
9122 */
9123
9124/**@page FAQ Frequently Asked Questions (FAQ)
9125 * \htmlinclude faq/faq.inc
9126 */
9127
9128
9129/**@page PARAMETERS List of all SCIP parameters
9130 *
9131 * This page list all parameters of the current SCIP version. This list can
9132 * easily be generated by SCIP via the interactive shell using the following command:
9133 *
9134 * <code>SCIP&gt; set save &lt;file name&gt;</code>
9135 *
9136 * or via the function call:
9137 *
9138 * <code>SCIP_CALL( SCIPwriteParams(scip, &lt;file name&gt;, TRUE, FALSE) );</code>
9139 *
9140 * \verbinclude parameters.set
9141 */
9142
9143/**@page INTERFACES Interfaces
9144 *
9145 * There are several ways of accessing the \SCIP Optimization Suite from other software packages or programming
9146 * platforms.
9147 *
9148 *
9149 * @section FILEFORMATS File formats
9150 *
9151 * The easiest way to load a problem into SCIP is via an input file, given in a format that SCIP can parse directly,
9152 * see \ref SHELL "the tutorial on how to use the interactive shell".
9153 * \SCIP is capable of reading more than ten different file formats, including formats for nonlinear
9154 * problems and constraint programs. This gives researchers from different communities an easy access to the
9155 * \SCIP Optimization Suite. See also the \ref AVAILABLEFORMATS "list of readable file formats".
9156 *
9157 * @section C_API C API
9158 *
9159 * The main access point for \SCIP is its API to C. Please refer to the \ref PUBLICAPI documentation
9160 * for further details.
9161 *
9162 * @section CPLUSPLUS C++ wrapper classes
9163 *
9164 * Since \SCIP is written in C, its callable library can be directly accessed from C++. If a user wants to program own
9165 * plugins in C++, there are wrapper classes for all different types of plugins available in the <code>src/objscip</code>
9166 * directory of the \SCIP standard distribution. SCIP provides several examples that were written in C++, see
9167 * \ref EXAMPLES "Examples".
9168 *
9169 * @section SCIPINTERFACES Interfaces for other programming languages
9170 *
9171 * Interfaces for other programming languages are developed and maintained independently from the SCIP Optimization Suite
9172 * on <a href="https://github.com/scipopt">GitHub</a> in order to provide extensions and patches faster
9173 * and to collaborate on them more easily.
9174 *
9175 * - <a href="https://github.com/scipopt/PySCIPOpt">PySCIPOpt</a> provides an extensive open-source interface for Python.
9176 * PySCIPOpt can be installed via <a href="https://anaconda.org/conda-forge/pyscipopt">conda-forge</a>,
9177 * which automatically includes \SCIP.
9178 * PySCIPOpt uses wrappers to allow users to build
9179 * their own plugins without accessing the C code of \SCIP itself.
9180 * Since Python is one of the most commonly used programming languages, especially in the field of
9181 * machine learning, the API gives easy access to the solvers functionality to incorporate \SCIP
9182 * into any python project pipeline, extract data for further analysis and computation as well as allow
9183 * customizing the solving process.
9184 * - <a href="https://github.com/scipopt/SCIP.jl">SCIP.jl</a> is a
9185 * Julia interface that exposes an API identical to the SCIP-C_API and implements the
9186 * MathOptInterface used by most constrained solvers in Julia.
9187 * It can be accessed through the Julia package manager and will install a pre-built version of
9188 * \SCIP if none is provided by the user.
9189 * - There is a <a href="https://github.com/scipopt/MatlabSCIPInterface">Matlab interface</a>
9190 * to use SCIP and SCIP-SDP from Matlab and Octave.
9191 * - <a href="https://github.com/scipopt/JSCIPOpt">JSCIPOpt</a> is an interface for Java.
9192 * - <a href="https://github.com/scipopt/russcip">Russcip</a> is an interface for Rust.
9193 * - <a href="https://github.com/scipopt/SCIPpp">SCIP++</a> is a modeling interface for C++.
9194 *
9195 * Contributions to these projects are very welcome.
9196 *
9197 * There are also many third-party python interfaces to the \SCIP Optimization Suite, for example:
9198 * - <a href="https://github.com/eomahony/Numberjack">NUMBERJACK</a> is a constraint programming platform implemented in python.
9199 * It supports a variety of different solvers, one of them being the \SCIP Optimization Suite .
9200 * - <a href="http://code.google.com/p/python-zibopt/">python-zibopt</a> was developed
9201 * by Ryan J. O'Neil and is a python extension of the \SCIP Optimization Suite (not maintained anymore).
9202 * - <a href="http://picos.zib.de/">PICOS</a> is a python interface for conic optimization,
9203 * provided by Guillaume Sagnol.
9204 *
9205 * @section MODELLING Modeling languages
9206 *
9207 * A natural way of formulating an optimization problem is to use a modeling language.
9208 * Besides ZIMPL, which is part of the \SCIP Optimization Suite,
9209 * there are several other modeling tools with a direct interface to \SCIP:
9210 *
9211 * - <a href="https://zimpl.zib.de">ZIMPL</a>, a modeling language for constraint programming,
9212 * - both <a href="http://www.ampl.com/">AMPL</a> and <a href="http://www.gams.com">GAMS</a>,
9213 * are well-suited for modeling mixed-integer linear and nonlinear optimization problems,
9214 * - and <a href="https://coliop.org/">CMPL</a> for mixed-integer linear problems.
9215 * - <a href="https://jump.dev/JuMP.jl/stable/">JuMP</a> accesses SCIP through the Julia interface.
9216 * - <a href="http://users.isy.liu.se/johanl/yalmip/pmwiki.php?n=Main.HomePage">YALMIP</a> by Johan L&ouml;fberg provides a
9217 * free modeling language.
9218 *
9219 * The AMPL and ZIMPL interfaces are included in the \SCIP distribution,
9220 * the GAMS interface is available <a href="https://github.com/coin-or/GAMSlinks">here</a>.
9221 *
9222 * @subsection AMPL AMPL Interface
9223 *
9224 * The AMPL interface is part of the main \SCIP executable.
9225 * It is activated when the executable is called with the name of the AMPL `.nl` file as first argument and `-AMPL` as second argument.
9226 * In this case, \SCIP will employ the \ref reader_nl.h "NL reader" to read the `.nl` file (and `.col` and `.row` files with variable and constraint names, if available),
9227 * read parameter settings from a `scip.set` file (if present), attempt to solve the problem, write an AMPL solution file with the solve output, and exit.
9228 * However, if `-i` is given as third argument, then solving the problem is replaced by opening the \ref SHELL "interactive shell".
9229 *
9230 * Next to a `scip.set` file, parameter settings can also be given via an `option` command in AMPL, e.g.,
9231 * ```
9232 * option scip_options 'limits/gap = 1e-4 display/statistics = TRUE';
9233 * ```
9234 * Parameter `display/statistics` is specific to using \SCIP via the AMPL interface and triggers a call to \ref SCIPprintStatistics after the problem has been solved (or the interactive shell has been exited).
9235 * In addition, a parameter `display/logfile` is available to specify a file to which to print \SCIP output in addition to stdout.
9236 *
9237 * For most problems, \SCIP computes a primal solution only.
9238 * A dual solution is written to an AMPL solution file only if an LP has been solved with presolve disabled.
9239 *
9240 * \SCIP is also able to write AMPL `.nl` files (and `.col` and `.row` files with variable and constraint names). See \ref reader_nl.h for currently supported constraint types.
9241 */
9242
9243 /**@defgroup PUBLICAPI Public API of SCIP
9244 * @brief functions and headers of the public C-API of \SCIP. Please refer to \ref DOC "" for information how to use the reference manual.
9245 *
9246 * \PUBLICAPIDESCRIPTION
9247 *
9248 *
9249 */
9250
9251/**@defgroup PUBLICCOREAPI Core API
9252 * @ingroup PUBLICAPI
9253 * @brief functions and headers of the plugin-independent C-API provided by the \SCIP header file scip.h.
9254 *
9255 * This module comprises functions provided by the header file scip.h. Including this header into a user-written extension
9256 * suffices to have all plugin-independent functionality of \SCIP available. Plugin-independent
9257 * user functionality includes the
9258 *
9259 * - creation of problems that \SCIP should solve
9260 * - fine-grained access to initiate the solving process of \SCIP
9261 * - access to all sorts of solving process statistics
9262 * - commonly used data structures and algorithms
9263 * - the management of plugins
9264 * - ...
9265 *
9266 * In order facilitate the navigation through the core API of \SCIP, it is structured into different modules.
9267 */
9268
9269/**@defgroup TYPEDEFINITIONS Type Definitions
9270 * @ingroup PUBLICCOREAPI
9271 * @brief type definitions and callback declarations
9272 *
9273 * This page lists headers which contain type definitions of callbacks.
9274 *
9275 * All headers below include the descriptions of callbacks of
9276 * certain plugins. For more detail see the corresponding header.
9277 */
9278
9279/**@defgroup PublicProblemMethods Problem Creation
9280 * @ingroup PUBLICCOREAPI
9281 * @brief functions to create a problem that \SCIP should solve
9282 *
9283 * This module summarizes the main functions needed to create a problem for \SCIP, and access its most important members:
9284 * - Declaring, adding, accessing, and changing variables of the problem
9285 * - Declaring, adding, accessing, and changing constraints of the problem
9286 * - Creating, adding, accessing, changing, and checking of solutions to the problem
9287 *
9288 * @note These core functions are not sufficient to create constraints of a certain type that is provided by the default plugins of \SCIP.
9289 * An example would be the creation of a linear constraint for which the functions provided by the
9290 * \ref cons_linear.h "linear constraint handler" must be used. Such functions are provided by the default plugins of \SCIP
9291 * and can be found in the \ref PUBLICPLUGINAPI.
9292 */
9293
9294/**@defgroup GeneralSCIPMethods SCIP
9295 * @ingroup PublicProblemMethods
9296 * @brief functions to manipulate a SCIP object
9297 */
9298
9299/**@defgroup GlobalProblemMethods Global Problem
9300 * @ingroup PublicProblemMethods
9301 * @brief functions to create, read and modify a global problem together with its callbacks
9302 */
9303
9304/**@defgroup PublicVariableMethods Problem Variables
9305 * @ingroup PublicProblemMethods
9306 * @brief public functions for problem variables
9307 */
9308
9309/**@defgroup PublicConstraintMethods Problem Constraints
9310 * @ingroup PublicProblemMethods
9311 * @brief Public functions for constraints
9312 */
9313
9314/**@defgroup PublicSolutionMethods Primal Solution
9315 * @ingroup PublicProblemMethods
9316 * @brief functions to create and change primal solutions of \SCIP
9317 */
9318
9319/**@defgroup CopyMethods Problem Copies
9320 * @ingroup PublicProblemMethods
9321 * @brief functions to copy problems between a source and a target \SCIP
9322 */
9323
9324
9325 /**@defgroup PublicSolveMethods Solving Process
9326 * @ingroup PUBLICCOREAPI
9327 * @brief functions to control the solving process of \SCIP
9328 *
9329 * This large group of functions and modules comprises the solving process related API of \SCIP. This includes
9330 *
9331 * -# changing parameters to control the solver behavior
9332 * -# access search tree related information
9333 * -# access relaxation information
9334 * -# access various solving process statistics
9335 * -# solve auxiliary relaxations and subproblems using LP/NLP diving or probing mode
9336 */
9337
9338/**@defgroup PublicSolvingStatsMethods Solving Statistics
9339 * @ingroup PublicSolveMethods
9340 * @brief functions to query statistics about the solving process
9341 */
9342
9343/**@defgroup ParameterMethods Parameter
9344 * @ingroup PublicSolveMethods
9345 * @brief functions to create, query, and print user parameters
9346 */
9347
9348/**@defgroup PublicEventMethods Event Handling
9349 * @ingroup PublicSolveMethods
9350 * @brief functions to create, catch, process, and drop events during the solving process of \SCIP
9351 *
9352 * Events can only be caught during the operation on the transformed problem.
9353 * Events on variables can only be caught for transformed variables.
9354 * If you want to catch an event for an original variable, you have to get the corresponding transformed variable
9355 * with a call to SCIPgetTransformedVar() and catch the event on the transformed variable.
9356 */
9357
9358/**@defgroup PublicLPMethods LP Relaxation
9359 * @ingroup PublicSolveMethods
9360 * @brief functions to build and access LP relaxation information
9361 * @see functions to interact with \ref PublicColumnMethods "LP columns" and \ref PublicRowMethods "LP rows"
9362 */
9363
9364/**@defgroup PublicColumnMethods LP Column
9365 * @ingroup PublicLPMethods
9366 * @brief public functions for LP columns
9367 */
9368
9369/**@defgroup PublicRowMethods LP Row
9370 * @ingroup PublicLPMethods
9371 * @brief public functions for LP rows
9372 */
9373
9374/**@defgroup PublicCutMethods Cuts and Cutpools
9375 * @ingroup PublicLPMethods
9376 * @brief common functions used to manipulate, generate, and strengthen cuts and to organize the cutpool
9377 *
9378 * SCIP provides a generic cut generation interface via SCIPcalcBestCut() that tries multiple cut generation
9379 * methods on an aggregated row and returns the best cut by efficacy. The available methods are specified
9380 * using the SCIP_CUTGENMETHOD bitmask type:
9381 * - SCIP_CUTGENMETHOD_FLOWCOVER: flow cover cuts
9382 * - SCIP_CUTGENMETHOD_KNAPSACKCOVER: knapsack cover cuts
9383 * - SCIP_CUTGENMETHOD_CMIR: complemented mixed-integer rounding cuts
9384 * - SCIP_CUTGENMETHOD_ALL: try all available methods
9385 *
9386 * The cut generation is configured via SCIP_CUTGENPARAMS and results are returned in SCIP_CUTGENRESULT.
9387 */
9388
9389/**@defgroup PublicLPDivingMethods LP Diving
9390 * @ingroup PublicLPMethods
9391 * @brief functions to initiate and conduct LP diving
9392 */
9393
9394/**@defgroup PublicLPExactMethods Exact LP Relaxation
9395 * @ingroup PublicSolveMethods
9396 * @brief functions to manage exact LP relaxation
9397 */
9398
9399/**@defgroup PublicExactMethods Exact Solving Mode
9400 * @ingroup PublicSolveMethods
9401 * @brief general functions for numerically exact solving
9402 */
9403
9404/**@defgroup PublicCertificateMethods Certificate Output
9405 * @ingroup PublicSolveMethods
9406 * @brief functions for certified solving
9407 */
9408
9409/**@defgroup PublicNLPMethods NLP Relaxation
9410 * @ingroup PublicSolveMethods
9411 * @brief functions for the nonlinear relaxation
9412 */
9413
9414/**@defgroup PublicNLRowMethods Nonlinear Rows
9415 * @ingroup PublicNLPMethods
9416 * @brief functions for the creation and interaction with rows of the NLP relaxation
9417 */
9418
9419/**@defgroup PublicNLPDiveMethods NLP Diving
9420 * @ingroup PublicNLPMethods
9421 * @brief functions to initiate and conduct NLP Diving
9422 */
9423
9424/**@defgroup PublicConflictMethods Conflict Analysis
9425 * @ingroup PublicSolveMethods
9426 * @brief public functions for conflict analysis
9427 */
9428
9429/**@defgroup PublicBranchingMethods Branching
9430 * @ingroup PublicSolveMethods
9431 * @brief functions for branching on LP solutions, relaxation solutions, and pseudo solutions
9432 *
9433 * @see \ref PublicVariableMethods "Public Variable functions" contains some typical variable branching score functions
9434 */
9435
9436/**@defgroup LocalSubproblemMethods Local Subproblem
9437 * @ingroup PublicSolveMethods
9438 * @brief functions to query information about or strengthen the problem at the current local search node
9439 */
9440
9441/**@defgroup PublicTreeMethods Search Tree
9442 * @ingroup PublicSolveMethods
9443 * @brief functions to query search tree related information
9444 * @see \ref PublicNodeMethods "Public functions for nodes"
9445 */
9446
9447/**@defgroup PublicNodeMethods Nodes
9448 * @ingroup PublicTreeMethods
9449 * @brief functions for nodes of the search tree of \SCIP
9450 */
9451
9452/**@defgroup PublicProbingMethods Probing
9453 * @ingroup PublicSolveMethods
9454 * @brief functions to initiate and control the probing mode of \SCIP
9455 */
9456
9457/**@defgroup PublicReoptimizationMethods Reoptimization
9458 * @ingroup PublicSolveMethods
9459 * @brief functions for reoptimization related tasks
9460 */
9461
9462/** @defgroup DataStructures Data Structures
9463 * @ingroup PUBLICCOREAPI
9464 * @brief commonly used data structures
9465 *
9466 * Below you find a list of available data structures
9467 */
9468
9469/** @defgroup DisjointSet Disjoint Set (Union Find)
9470 * @ingroup DataStructures
9471 * @brief weighted disjoint set (union find) data structure with path compression
9472 *
9473 * Weighted Disjoint Set is a data structure to quickly update and query connectedness information
9474 * between nodes of a graph. Disjoint Set is also known as Union Find.
9475 */
9476
9477/**@defgroup PublicDynamicArrayMethods Dynamic Arrays
9478 * @ingroup DataStructures
9479 * @brief functions for the creation and access of dynamic arrays
9480 */
9481
9482/**@defgroup DirectedGraph Directed Graph
9483 * @ingroup DataStructures
9484 * @brief graph structure with common algorithms for directed and undirected graphs
9485 */
9486
9487/**@defgroup PublicDatatreeMethods Data Tree
9488 * @ingroup DataStructures
9489 * @brief functions for managing data trees
9490 */
9491
9492/**@defgroup DecompMethods Decomposition data structure
9493 * @ingroup DataStructures
9494 * @brief functions for creating and accessing user decompositions
9495 */
9496
9497/**@defgroup NetworkMatrix Network Matrix
9498 * @ingroup DataStructures
9499 * @brief functions for detecting network matrices and converting them to the underlying graphs
9500 */
9501
9502/**@defgroup PublicRationalMethods Rational Arithmetic
9503 * @ingroup DataStructures
9504 * @brief wrapper for rational number arithmetic
9505 */
9506
9507/**@defgroup SymGraph Symmetry Detection Graph
9508 * @ingroup DataStructures
9509 * @brief functions for creating and manipulating symmetry detection graphs
9510 *
9511 * Below you find a list of functions to create and manipulate symmetry detection graphs.
9512 */
9513
9514/**@defgroup MiscellaneousMethods Miscellaneous Methods
9515 * @ingroup PUBLICCOREAPI
9516 * @brief commonly used functions from different categories
9517 *
9518 * Below you find a list of miscellaneous functions grouped by different categories.
9519 */
9520
9521/**@defgroup PublicValidationMethods Validation
9522 * @ingroup PUBLICCOREAPI
9523 * @brief functions for validating the correctness of a solving process
9524 */
9525
9526/**@defgroup PublicInfeasibilityAnalysisMethods Infeasibility Analysis
9527 * @ingroup PUBLICCOREAPI
9528 * @brief functions for analyzing infeasibility of a model (IIS, MinUC), see also \ref MINUCIIS
9529 */
9530
9531/**@defgroup PublicMemoryMethods Memory Management
9532 * @ingroup MiscellaneousMethods
9533 * @brief functions and macros to use the \SCIP memory management
9534 *
9535 * @see \ref MEMORY "Using the memory functions of SCIP" for more information
9536 */
9537
9538/**@defgroup PublicTimingMethods Timing
9539 * @ingroup MiscellaneousMethods
9540 * @brief functions for timing
9541 */
9542
9543/**@defgroup PublicBanditMethods Bandit Algorithms
9544 * @ingroup MiscellaneousMethods
9545 * @brief functions for bandit algorithms
9546 */
9547
9548
9549
9550/**@defgroup DebugSolutionMethods Debug Solution
9551 * @ingroup PUBLICCOREAPI
9552 * @brief functions to control the SCIP debug solution mechanism, see also \ref DEBUG
9553 */
9554
9555/**@defgroup MessageOutputMethods Messaging
9556 * @ingroup PUBLICCOREAPI
9557 * @brief message output functions
9558 */
9559
9560/**@defgroup PluginManagementMethods Methods for managing plugins
9561 * @ingroup PUBLICCOREAPI
9562 * @brief Functions for the inclusion and management of SCIP plugins and callbacks
9563 *
9564 */
9565
9566/**@defgroup PublicBendersMethods Benders' decomposition
9567 * @ingroup PluginManagementMethods
9568 * @brief functions for Benders' decomposition plugins
9569 */
9570
9571/**@defgroup PublicBenderscutsMethods Benders' decomposition cuts
9572 * @ingroup PluginManagementMethods
9573 * @brief functions for Benders' decomposition cuts plugins
9574 */
9575
9576/**@defgroup PublicBranchRuleMethods Branching Rules
9577 * @ingroup PluginManagementMethods
9578 * @brief functions for branching rule plugins
9579 */
9580
9581/**@defgroup PublicCompressionMethods Tree Compression
9582 * @ingroup PluginManagementMethods
9583 * @brief public functions for tree compressions
9584 */
9585
9586/**@defgroup PublicConflicthdlrMethods Conflict Analysis
9587 * @ingroup PluginManagementMethods
9588 * @brief public functions for conflict handlers
9589 */
9590
9591/**@defgroup PublicConshdlrMethods Constraint handlers
9592 * @ingroup PluginManagementMethods
9593 * @brief functions for constraint handlers
9594 */
9595
9596/**@defgroup PublicCutSelectorMethods Cut Selector
9597 * @ingroup PluginManagementMethods
9598 * @brief functions for cut selectors
9599 */
9600
9601/**@defgroup PublicDialogMethods Dialogs
9602 * @ingroup PluginManagementMethods
9603 * @brief public functions for user interface dialogs
9604 */
9605
9606/**@defgroup PublicDisplayMethods Displays
9607 * @ingroup PluginManagementMethods
9608 * @brief functions for the inclusion and access of display plugins
9609 */
9610
9611/**@defgroup PublicEventHandlerMethods Event Handler
9612 * @ingroup PluginManagementMethods
9613 * @brief functions for event handlers
9614 */
9615
9616/**@defgroup PublicExprHandlerMethods Expression Handler
9617 * @ingroup PluginManagementMethods
9618 * @brief functions for expression handlers
9619 */
9620
9621/**@defgroup PublicHeuristicMethods Primal Heuristics
9622 * @ingroup PluginManagementMethods
9623 * @brief functions for primal heuristic plugins
9624 */
9625
9626/**@defgroup PublicDivesetMethods Dive sets
9627 * @ingroup PublicSpecialHeuristicMethods
9628 * @brief functions for dive sets to control the generic diving algorithm
9629 */
9630
9631/**@defgroup PublicIISfinderMethods IIS Finders
9632 * @ingroup PluginManagementMethods
9633 * @brief functions for irreducible infeasible subsystems (IIS) finders
9634 */
9635
9636/**@defgroup PublicNodeSelectorMethods Node Selector
9637 * @ingroup PluginManagementMethods
9638 * @brief functions for node selector plugin management
9639 */
9640
9641/**@defgroup PublicNlhdlrInterfaceMethods Nonlinear Handlers
9642 * @ingroup PluginManagementMethods
9643 * @brief functions for the management of nonlinear handlers
9644 */
9645
9646/**@defgroup PublicPresolverMethods Presolver
9647 * @ingroup PluginManagementMethods
9648 * @brief functions for presolver plugins
9649 */
9650
9651/**@defgroup PublicPricerMethods Pricer
9652 * @ingroup PluginManagementMethods
9653 * @brief functions to include and access pricer plugins of \SCIP
9654 */
9655
9656/**@defgroup PublicPropagatorMethods Propagators
9657 * @ingroup PluginManagementMethods
9658 * @brief functions for propagator plugins
9659 */
9660
9661/**@defgroup PublicReaderMethods Reader
9662 * @ingroup PluginManagementMethods
9663 * @brief functions for the inclusion and access to reader plugins of \SCIP
9664 */
9665
9666/**@defgroup PublicRelaxatorMethods Relaxation Handlers
9667 * @ingroup PluginManagementMethods
9668 * @brief public functions for relaxation handlers
9669 */
9670
9671/**@defgroup PublicSeparatorMethods Separators
9672 * @ingroup PluginManagementMethods
9673 * @brief functions for separator plugins
9674 */
9675
9676/**@defgroup PublicTableMethods Tables
9677 * @ingroup PluginManagementMethods
9678 * @brief functions for the inclusion and access of statistics tables
9679 */
9680
9681/**@defgroup PublicConcsolverTypeMethods Concurrent Solver Types
9682 * @ingroup PluginManagementMethods
9683 * @brief functions for concurrent solver type plugins
9684 */
9685
9686/**@defgroup PublicNLPIInterfaceMethods NLP solver interfaces
9687 * @ingroup PluginManagementMethods
9688 * @brief functions for the management of NLP solver interfaces
9689 */
9690
9691/**@defgroup PublicExternalCodeMethods External Codes
9692 * @ingroup PluginManagementMethods
9693 * @brief functions to access information about external codes used by \SCIP
9694 */
9695
9696/**@defgroup PublicParallelMethods Parallel Interface
9697 * @ingroup PUBLICCOREAPI
9698 * @brief functions to construct the parallel interface of \SCIP
9699 */
9700
9701 /**@defgroup PUBLICPLUGINAPI Plugin API of SCIP
9702 * @ingroup PUBLICAPI
9703 * @brief core API extensions provided by the default plugins of \SCIP, includable via scipdefplugins.h.
9704 *
9705 * All default plugins of \SCIP, especially the default \ref CONSHDLRS "constraint handlers", provide
9706 * valuable extensions to the \ref PUBLICCOREAPI "core API" of \SCIP. These functions are made available
9707 * by including scipdefplugins.h to user-written extensions.
9708 *
9709 * For a better overview, this page lists all default plugin headers structured into modules based on their individual
9710 * topic.
9711 *
9712 * All of the modules listed below provide functions that are allowed to be used by user-written extensions of \SCIP.
9713 */
9714 /**@defgroup INTERNALAPI Internal API of SCIP
9715 * @brief internal API functions that should only be used by the core of \SCIP
9716 *
9717 * This page lists the header files of internal API functions. In contrast to the public API, these internal functions
9718 * should not be used by user plugins and extensions of SCIP. Please consult
9719 * \ref PUBLICCOREAPI "the Core API" and \ref PUBLICPLUGINAPI "Plugin API" for the complete API available to user plugins.
9720 *
9721 */
9722
9723/**@defgroup BENDERS Benders' decomposition implementations
9724 * @ingroup PUBLICPLUGINAPI
9725 * @brief functions and files provided by the default Benders' decomposition implementations of \SCIP
9726 *
9727 * A detailed description what a Benders' decomposition implementation does and how to add a Benders' decomposition
9728 * implementations to SCIP can be found
9729 * \ref BENDER "here".
9730 */
9731
9732/**@defgroup BendersIncludes Inclusion functions
9733 * @ingroup BENDERS
9734 * @brief functions to include specific Benders' decomposition implementations into \SCIP
9735 *
9736 * This module contains functions to include specific Benders' decomposition implementations into \SCIP.
9737 *
9738 * @note All default plugins can be included at once (including all Benders' decomposition implementations) using
9739 * SCIPincludeDefaultPlugins()
9740 *
9741 */
9742
9743/**@defgroup BENDERSCUTS Benders' decomposition cut function
9744 * @ingroup PUBLICPLUGINAPI
9745 * @brief functions and files provided by the default Benders' decomposition cut method of \SCIP
9746 *
9747 * A detailed description what a Benders' decomposition cut method does and how to add a Benders' decomposition
9748 * cut method to SCIP can be found
9749 * \ref BENDERSCUT "here".
9750 */
9751
9752/**@defgroup BenderscutIncludes Inclusion functions
9753 * @ingroup BENDERSCUTS
9754 * @brief functions to include specific Benders' decomposition cut methods into \SCIP
9755 *
9756 * This module contains functions to include specific Benders' decomposition cut methods into \SCIP.
9757 *
9758 * @note The Benders' decomposition cut methods are linked to each Benders' decomposition implementation. Thus, the
9759 * default Benders' decomposition implementations automatically include the necessary Benders' decomposition cut
9760 * methods. For custom Benders' decomposition implementations, you can call SCIPincludeDefaultBendersCuts() in the
9761 * SCIPincludeBendersMybenders() include function.
9762 *
9763 */
9764
9765/**@defgroup BRANCHINGRULES Branching Rules
9766 * @ingroup PUBLICPLUGINAPI
9767 * @brief functions and files provided by the default branching rules of \SCIP
9768 *
9769 * A detailed description what a branching rule does and how to add a branching rule to SCIP can be found
9770 * \ref BRANCH "here".
9771 */
9772
9773/**@defgroup BranchingRuleIncludes Inclusion functions
9774 * @ingroup BRANCHINGRULES
9775 * @brief functions to include specific branching rules into \SCIP
9776 *
9777 * This module contains functions to include specific branching rules into \SCIP.
9778 *
9779 * @note All default plugins can be included at once (including all branching rules) using SCIPincludeDefaultPlugins()
9780 *
9781 */
9782
9783/**@defgroup CONSHDLRS Constraint Handlers
9784 * @ingroup PUBLICPLUGINAPI
9785 * @brief functions and files provided by the default constraint handlers of \SCIP
9786 *
9787 * A detailed description what a constraint handler does and how to add a constraint handler to SCIP can be found
9788 * \ref CONS "here".
9789 */
9790
9791/**@defgroup ConshdlrIncludes Inclusion functions
9792 * @ingroup CONSHDLRS
9793 * @brief functions to include specific constraint handlers into \SCIP
9794 *
9795 * This module contains functions to include specific constraint handlers into \SCIP.
9796 *
9797 * @note All default plugins can be included at once (including all default constraint handlers) using SCIPincludeDefaultPlugins()
9798 *
9799 */
9800
9801/**@defgroup CUTSELECTORS Cut Selectors
9802 * @ingroup PUBLICPLUGINAPI
9803 * @brief functions and files provided by the default cut selectors of \SCIP
9804 *
9805 * A detailed description what a cut selector does and how to add a cut selector to SCIP can be found
9806 * \ref CUTSEL "here".
9807 */
9808
9809/**@defgroup CutSelectorIncludes Inclusion functions
9810 * @ingroup CUTSELECTORS
9811 * @brief functions to include specific cut selectors into \SCIP
9812 *
9813 * This module contains functions to include specific cut selectors into \SCIP.
9814 *
9815 * @note All default plugins can be included at once (including all default cut selectors) using SCIPincludeDefaultPlugins()
9816 *
9817 */
9818
9819/**@defgroup DIALOGS Dialogs
9820 * @ingroup PUBLICPLUGINAPI
9821 * @brief functions and files provided by the default dialogs of \SCIP
9822 *
9823 * A detailed description what a dialog does and how to add a dialog to SCIP can be found
9824 * \ref DIALOG "here".
9825 */
9826
9827/**@defgroup DialogIncludes Inclusion functions
9828 * @ingroup DIALOGS
9829 * @brief functions to include specific dialogs into \SCIP
9830 *
9831 * This module contains functions to include specific dialogs into \SCIP.
9832 *
9833 * @note All default plugins can be included at once (including all default dialogs) using SCIPincludeDefaultPlugins()
9834 *
9835 */
9836
9837/**@defgroup DISPLAYS Displays
9838 * @ingroup PUBLICPLUGINAPI
9839 * @brief functions and files provided by the default displays (output columns) of \SCIP
9840 *
9841 * A detailed description what a display does and how to add a display to SCIP can be found
9842 * \ref DISP "here".
9843 *
9844 */
9845
9846/**@defgroup DisplayIncludes Inclusion functions
9847 * @ingroup DISPLAYS
9848 * @brief functions to include specific displays into \SCIP
9849 *
9850 * This module contains functions to include specific displays into \SCIP.
9851 *
9852 * @note All default plugins can be included at once (including all default displays) using SCIPincludeDefaultPlugins()
9853 *
9854 */
9855
9856/**@defgroup EXPRHDLRS Expression Handlers
9857 * @ingroup PUBLICPLUGINAPI
9858 * @brief functions and files provided by the default expressions handlers of \SCIP
9859 */
9860
9861/**@defgroup ExprhdlrIncludes Inclusion functions
9862 * @ingroup EXPRHDLRS
9863 * @brief functions to include specific expression handlers into \SCIP
9864 *
9865 * This module contains functions to include specific expression handlers into \SCIP.
9866 *
9867 * @note All default plugins can be included at once (including all default expression handlers) using SCIPincludeDefaultPlugins()
9868 *
9869 */
9870
9871/**@defgroup EXPRINTS Expression Interpreter
9872 * @ingroup PUBLICPLUGINAPI
9873 * @brief functions and files provided by the default expression interpreters of \SCIP
9874 *
9875 * A detailed description what a expression interpreter does and how to add a expression interpreter to SCIP can be found
9876 * \ref EXPRINT "here".
9877 */
9878
9879/**@defgroup FILEREADERS File Readers
9880 * @ingroup PUBLICPLUGINAPI
9881 * @brief This page contains a list of all file readers which are currently available.
9882 *
9883 * @section AVAILABLEFORMATS List of readable file formats
9884 *
9885 * The \ref SHELL "interactive shell" and the callable library are capable of reading/parsing several different file
9886 * formats.
9887 *
9888 * <table>
9889 * <tr><td>\ref reader_bnd.h "BND format"</td> <td>for variable bounds</td></tr>
9890 * <tr><td>\ref reader_cip.h "CIP format"</td> <td>for SCIP's constraint integer programming format</td></tr>
9891 * <tr><td>\ref reader_cnf.h "CNF format"</td> <td>DIMACS CNF (conjunctive normal form) file format used for example for SAT problems</td></tr>
9892 * <tr><td>\ref reader_diff.h "DIFF format"</td> <td>for reading a new objective function for mixed-integer programs</td></tr>
9893 * <tr><td>\ref reader_fzn.h "FZN format"</td> <td>FlatZinc is a low-level solver input language that is the target language for MiniZinc</td></tr>
9894 * <tr><td>\ref reader_lp.h "LP format"</td> <td>for mixed-integer (quadratically constrained quadratic) programs (CPLEX)</td></tr>
9895 * <tr><td>\ref reader_mps.h "MPS format"</td> <td>for mixed-integer (quadratically constrained quadratic) programs</td></tr>
9896 * <tr><td>\ref reader_nl.h "NL format"</td> <td>for <a href="http://www.ampl.com">AMPL</a> .nl files, e.g., mixed-integer linear and nonlinear
9897 * <tr><td>\ref reader_opb.h "OPB format"</td> <td>for pseudo-Boolean optimization instances</td></tr>
9898 * <tr><td>\ref reader_osil.h "OSiL format"</td> <td>for mixed-integer nonlinear programs</td></tr>
9899 * <tr><td>\ref reader_pip.h "PIP format"</td> <td>for <a href="http://polip.zib.de/pipformat.php">mixed-integer polynomial programming problems</a></td></tr>
9900 * <tr><td>\ref reader_sol.h "SOL format"</td> <td>for solutions; XML-format (read-only) or raw SCIP format</td></tr>
9901 * <tr><td>\ref reader_wbo.h "WBO format"</td> <td>for weighted pseudo-Boolean optimization instances</td></tr>
9902 * <tr><td>\ref reader_zpl.h "ZPL format"</td> <td>for <a href="http://zimpl.zib.de">ZIMPL</a> models, i.e., mixed-integer linear and nonlinear
9903 * programming problems [read only]</td></tr>
9904 * </table>
9905 *
9906 * @section ADDREADER How to add a file reader
9907 *
9908 * A detailed description what a file reader does and how to add a file reader to SCIP can be found
9909 * \ref READER "here".
9910 *
9911 */
9912
9913/**@defgroup FileReaderIncludes Inclusion functions
9914 * @ingroup FILEREADERS
9915 * @brief functions to include specific file readers into \SCIP
9916 *
9917 * This module contains functions to include specific file readers into \SCIP.
9918 *
9919 * @note All default plugins can be included at once (including all default file readers) using SCIPincludeDefaultPlugins()
9920 */
9921
9922/**@defgroup IISFINDERS IIS Finders
9923 * @ingroup PUBLICPLUGINAPI
9924 * @brief functions and files provided by the default IIS finders of \SCIP
9925 *
9926 * A detailed description what an IIS finder does and how to add a IIS finder to SCIP can be found \ref IISFINDER "here".
9927 */
9928
9929/**@defgroup IISfinderIncludes Inclusion functions
9930 * @ingroup IISFINDERS
9931 * @brief functions to include specific IIS finders into \SCIP
9932 *
9933 * This module contains functions to include specific IIS finders into \SCIP.
9934 *
9935 * @note All default plugins can be included at once (including all default file readers) using SCIPincludeDefaultPlugins()
9936 */
9937
9938/**@defgroup PARALLEL Parallel interface functions
9939 * @ingroup INTERNALAPI
9940 * @brief headers and functions for the parallel interface of \SCIP
9941 *
9942 */
9943
9944/**@defgroup TASKINTERFACE Parallel task interface functions
9945 * @ingroup INTERNALAPI
9946 * @brief headers and functions for the parallel task interface of \SCIP
9947 */
9948
9949/**@defgroup PublicSymmetryMethods Symmetry
9950 * @ingroup PUBLICCOREAPI
9951 * @brief functions for symmetry handling
9952 */
9953
9954/**@defgroup FileReaderIncludes Inclusion functions
9955 * @ingroup FILEREADERS
9956 * @brief functions to include specific file readers into \SCIP
9957 *
9958 * This module contains functions to include specific file readers into \SCIP.
9959 *
9960 * @note All default plugins can be included at once (including all default file readers) using SCIPincludeDefaultPlugins()
9961 *
9962 */
9963
9964/**@defgroup LPIS LP Solver Interface
9965 * @ingroup PUBLICPLUGINAPI
9966 * @brief functions and files provided by the LP solver interface of \SCIP
9967 *
9968 * \SCIP uses external tools to solve LP relaxations. The communication
9969 * is realized through an LP interface.
9970 *
9971 * This page lists public interface functions that every LP interface provides.
9972 * Find the concrete implementation for your LP solver
9973 * under "src/lpi/".
9974 *
9975 * @see \ref LPI for a list of available LP solver interfaces
9976 */
9977
9978/**@defgroup LPIEXACTS Exact LP Solver Interface
9979 * @ingroup PUBLICPLUGINAPI
9980 * @brief functions and files provided by the exact LP solver interface of \SCIP
9981 *
9982 * For the numerically exact solving mode, \SCIP also uses exact LP solvers. The communication
9983 * is realized through an exact LP interface.
9984 *
9985 * This page lists public interface functions that every exact LP interface provides.
9986 * Find the concrete implementation for your exact LP solver
9987 * under "src/lpiexact/".
9988 *
9989 * @see \ref LPIEXACT for a list of available exact LP solver interfaces
9990 */
9991
9992/**@defgroup NODESELECTORS Node Selectors
9993 * @ingroup PUBLICPLUGINAPI
9994 * @brief functions and files provided by the default node selectors of \SCIP
9995 *
9996 * A detailed description what a node selector does and how to add a node selector to SCIP can be found
9997 * \ref NODESEL "here".
9998 */
9999
10000/**@defgroup NodeSelectorIncludes Inclusion functions
10001 * @ingroup NODESELECTORS
10002 * @brief functions to include specific node selectors into \SCIP
10003 *
10004 * This module contains functions to include specific node selectors into \SCIP.
10005 *
10006 * @note All default plugins can be included at once (including all default node selectors) using SCIPincludeDefaultPlugins()
10007 *
10008 */
10009
10010/**@defgroup NLHDLRS Nonlinear Handlers
10011 * @ingroup PUBLICPLUGINAPI
10012 * @brief functions and files provided by the default nonlinear handlers of \SCIP
10013 */
10014
10015/**@defgroup NlhdlrIncludes Inclusion functions
10016 * @ingroup NLHDLRS
10017 * @brief functions to include specific nonlinear handlers into \SCIP
10018 *
10019 * This module contains functions to include specific nonlinear handlers into \SCIP.
10020 *
10021 * @note All default plugins can be included at once (including all default nonlinear handlers) using SCIPincludeDefaultPlugins()
10022 *
10023 */
10024
10025/**@defgroup NLPIS NLP Solver Interfaces
10026 * @ingroup PUBLICPLUGINAPI
10027 * @brief functions and files provided by the default NLP solver interfaces of \SCIP
10028 *
10029 * A detailed description what a NLP solver interface does and how to add a NLP solver interface to SCIP can be found
10030 * \ref NLPI "here".
10031 */
10032
10033/**@defgroup NLPIIncludes Inclusion functions
10034 * @ingroup NLPIS
10035 * @brief functions to include specific NLP solver interfaces into \SCIP
10036 *
10037 * This module contains functions to include specific NLP solver interfaces into \SCIP.
10038 *
10039 * @note All default plugins can be included at once (including all default NLP solver interfaces) using SCIPincludeDefaultPlugins()
10040 *
10041 */
10042
10043/**@defgroup PRESOLVERS Presolvers
10044 * @ingroup PUBLICPLUGINAPI
10045 * @brief functions and files provided by the default presolvers of \SCIP
10046 *
10047 * A detailed description what a presolver does and how to add a presolver to SCIP can be found
10048 * \ref PRESOL "here".
10049 */
10050
10051/**@defgroup PresolverIncludes Inclusion functions
10052 * @ingroup PRESOLVERS
10053 * @brief functions to include specific presolvers into \SCIP
10054 *
10055 * This module contains functions to include specific presolvers into \SCIP.
10056 *
10057 * @note All default plugins can be included at once (including all default presolvers) using SCIPincludeDefaultPlugins()
10058 *
10059 */
10060
10061/**@defgroup PRICERS Pricers
10062 * @ingroup PUBLICPLUGINAPI
10063 * @brief functions and files provided by the default pricers of \SCIP
10064 *
10065 * Per default there exist no variable pricer. A detailed description what a variable pricer does and how to add a
10066 * variable pricer to SCIP can be found \ref PRICER "here".
10067 */
10068
10069/**@defgroup PricerIncludes Inclusion functions
10070* @ingroup PRICERS
10071* @brief functions to include specific pricers into \SCIP
10072*
10073* This module contains functions to include specific pricers into \SCIP.
10074*
10075* @note All default plugins can be included at once using SCIPincludeDefaultPlugins(). There exists no pricer per default.
10076* In order to see examples of variable pricers, please consult the \ref EXAMPLES "Coding Examples" of \SCIP.
10077*
10078*/
10079
10080/**@defgroup PRIMALHEURISTICS Primal Heuristics
10081 * @ingroup PUBLICPLUGINAPI
10082 * @brief functions and files provided by the default primal heuristics of \SCIP
10083 *
10084 * A detailed description what a primal heuristic does and how to add a primal heuristic to SCIP can be found
10085 * \ref HEUR "here".
10086 */
10087
10088/**@defgroup PrimalHeuristicIncludes Inclusion functions
10089 * @ingroup PRIMALHEURISTICS
10090 * @brief functions to include specific primal heuristics into \SCIP
10091 *
10092 * This module contains functions to include specific primal heuristics into \SCIP.
10093 *
10094 * @note All default plugins can be included at once (including all default primal heuristics) using SCIPincludeDefaultPlugins()
10095 *
10096 */
10097
10098/**@defgroup PROPAGATORS Propagators
10099 * @ingroup PUBLICPLUGINAPI
10100 * @brief functions and files provided by the default propagators of \SCIP
10101 *
10102 * A detailed description what a propagator does and how to add a propagator to SCIP can be found
10103 * \ref PROP "here".
10104 */
10105
10106/**@defgroup PropagatorIncludes Inclusion functions
10107 * @ingroup PROPAGATORS
10108 * @brief functions to include specific propagators into \SCIP
10109 *
10110 * This module contains functions to include specific propagators into \SCIP.
10111 *
10112 * @note All default plugins can be included at once (including all default propagators) using SCIPincludeDefaultPlugins()
10113 *
10114 */
10115
10116/**@defgroup RELAXATORS Relaxation Handlers
10117 * @ingroup PUBLICPLUGINAPI
10118 * @brief functions and files provided by the default relaxation handlers of \SCIP
10119 *
10120 * A detailed description what a relaxation handler does and how to add a relaxation handler to SCIP can be found
10121 * \ref RELAX "here". Note that the linear programming relaxation is not implemented via the relaxation handler plugin.
10122 * Per default no relaxation handler exists in SCIP. However, there are two relaxation handlers in the
10123 * \ref RELAXATOR_MAIN "Relaxator example".
10124 */
10125
10126/**@defgroup SEPARATORS Separators
10127 * @ingroup PUBLICPLUGINAPI
10128 * @brief functions and files provided by the default separators of \SCIP
10129 *
10130 * A detailed description what a separator does and how to add a separator to SCIP can be found
10131 * \ref SEPA "here".
10132 */
10133
10134/**@defgroup SeparatorIncludes Inclusion functions
10135 * @ingroup SEPARATORS
10136 * @brief functions to include specific separators into \SCIP
10137 *
10138 * This module contains functions to include specific separators into \SCIP.
10139 *
10140 * @note All default plugins can be included at once (including all default separators) using SCIPincludeDefaultPlugins()
10141 *
10142 */
10143
10144/**@defgroup TABLES Tables
10145 * @ingroup PUBLICPLUGINAPI
10146 * @brief functions and files provided by the default statistics tables of \SCIP
10147 *
10148 * A detailed description what a table does and how to add a table to SCIP can be found
10149 * \ref TABLE "here".
10150 *
10151 */
10152
10153/**@defgroup TableIncludes Inclusion functions
10154 * @ingroup TABLES
10155 * @brief functions to include specific tables into \SCIP
10156 *
10157 * This module contains functions to include specific statistics tables into \SCIP.
10158 *
10159 * @note All default plugins can be included at once (including all default statisticstables) using SCIPincludeDefaultPlugins()
10160 *
10161 */
10162
10163/**@defgroup PublicToleranceMethods Computations With Tolerances
10164 * @ingroup NumericalMethods
10165 * @brief functions used by the majority of operations involving floating-point computations in \SCIP
10166 *
10167 * - query the numerical tolerances of \SCIP, as well as special values such as infinity.
10168 * - change tolerances inside relaxations
10169 * - epsilon-comparison functions for floating point numbers
10170 */
10171
10172/** @defgroup CFILES Implementation files (.c files)
10173 * @brief implementation files (.c files) of the SCIP core and the default plugins
10174 *
10175 * The core provides the functionality for creating problems, variables, and general constraints.
10176 * The default plugins of SCIP provide a mix of public API function and private, static function and callback declarations.
10177 */
10178
10179/** @defgroup DEFPLUGINS SCIP Default Plugins
10180 * @ingroup CFILES
10181 * @brief implementation files (.c files) of the SCIP default plugins
10182 *
10183 * The SCIP default plugins provide a mix of public API function and private, static function and callback declarations.
10184 */
10185
10186/** @defgroup OTHER_CFILES Other implementation files of SCIP
10187 * @ingroup CFILES
10188 * @brief other implementation files of SCIP
10189 *
10190 * Relevant core and other functionality of SCIP.
10191 */