Scippy

SCIP

Solving Constraint Integer Programs

struct_branch.h
Go to the documentation of this file.
1/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2/* */
3/* This file is part of the program and library */
4/* SCIP --- Solving Constraint Integer Programs */
5/* */
6/* Copyright (c) 2002-2024 Zuse Institute Berlin (ZIB) */
7/* */
8/* Licensed under the Apache License, Version 2.0 (the "License"); */
9/* you may not use this file except in compliance with the License. */
10/* You may obtain a copy of the License at */
11/* */
12/* http://www.apache.org/licenses/LICENSE-2.0 */
13/* */
14/* Unless required by applicable law or agreed to in writing, software */
15/* distributed under the License is distributed on an "AS IS" BASIS, */
16/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
17/* See the License for the specific language governing permissions and */
18/* limitations under the License. */
19/* */
20/* You should have received a copy of the Apache-2.0 license */
21/* along with SCIP; see the file LICENSE. If not visit scipopt.org. */
22/* */
23/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
24
25/**@file struct_branch.h
26 * @ingroup INTERNALAPI
27 * @brief datastructures for branching rules and branching candidate storage
28 * @author Tobias Achterberg
29 */
30
31/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
32
33#ifndef __SCIP_STRUCT_BRANCH_H__
34#define __SCIP_STRUCT_BRANCH_H__
35
36
37#include "scip/def.h"
38#include "scip/type_var.h"
39#include "scip/type_branch.h"
40
41#ifdef __cplusplus
42extern "C" {
43#endif
44
45/** branching candidate storage */
47{
48 SCIP_VAR** lpcands; /**< candidates for branching on LP solution (fractional integer variables) */
49 SCIP_Real* lpcandssol; /**< solution values of LP candidates */
50 SCIP_Real* lpcandsfrac; /**< fractionalities of LP candidates */
51 SCIP_VAR** externcands; /**< external candidates for branching, e.g. given by relaxation */
52 SCIP_Real* externcandsscore; /**< scores of external candidates, e.g. infeasibilities */
53 SCIP_Real* externcandssol; /**< values in solution of external candidates */
54 SCIP_VAR** pseudocands; /**< candidates for branching on pseudo solution (non-fixed integer variables) */
55 SCIP_Longint validlpcandslp; /**< lp number for which lpcands are valid */
56 int lpcandssize; /**< number of available slots in lpcands array */
57 int nlpcands; /**< number of candidates for branching on LP solution */
58 int npriolpcands; /**< number of LP candidates with largest branch priority value */
59 int npriolpbins; /**< number of binary LP candidates with largest branch priority value */
60 int nimpllpfracs; /**< number of implicit variables with fractional LP solution value */
61 int lpmaxpriority; /**< maximal branch priority of all LP candidates */
62 int externcandssize; /**< number of available slots in externcands array */
63 int nexterncands; /**< number of external candidates for branching */
64 int nprioexterncands; /**< number of external candidates with largest branch priority value */
65 int nprioexternbins; /**< number of binary external candidates with largest branch priority value */
66 int nprioexternints; /**< number of integer external candidates with largest branch priority value */
67 int nprioexternimpls; /**< number of implicit integer external candidates with largest branch priority value */
68 int externmaxpriority; /**< maximal branch priority of all external candidates */
69 int pseudocandssize; /**< number of available slots in pseudocands array */
70 int npseudocands; /**< number of candidates for branching on pseudo solution */
71 int npriopseudocands; /**< number of pseudo candidates with largest branch priority value */
72 int npriopseudobins; /**< number of binary pseudo candidates with largest branch priority value */
73 int npriopseudoints; /**< number of integer pseudo candidates with largest branch priority value */
74 int pseudomaxpriority; /**< maximal branch priority of all pseudo candidates */
75};
76
77/** branching rule */
79{
80 SCIP_Real maxbounddist; /**< maximal relative distance from current node's dual bound to primal bound
81 * compared to best node's dual bound for applying branching rule
82 * (0.0: only on current best node, 1.0: on all nodes) */
83 SCIP_Longint nlpcalls; /**< number of times, this branching rule was called on an LP solution */
84 SCIP_Longint nexterncalls; /**< number of times, this branching rule was called on external candidates */
85 SCIP_Longint npseudocalls; /**< number of times, this branching rule was called on a pseudo solution */
86 SCIP_Longint ncutoffs; /**< number of cutoffs found so far by this branching rule */
87 SCIP_Longint ncutsfound; /**< number of cutting planes found so far by this branching rule */
88 SCIP_Longint nconssfound; /**< number of cutting constraints added so far by this branching rule (not
89 * counting constraint additions to child nodes used for branching) */
90 SCIP_Longint ndomredsfound; /**< number of domain reductions found so far by this branching rule */
91 SCIP_Longint nchildren; /**< number of children created so far by this branching rule */
92 char* name; /**< name of branching rule */
93 char* desc; /**< description of branching rule */
94 SCIP_DECL_BRANCHCOPY ((*branchcopy)); /**< copy method of branching rule or NULL if you don't want to copy your plugin into sub-SCIPs */
95 SCIP_DECL_BRANCHFREE ((*branchfree)); /**< destructor of branching rule */
96 SCIP_DECL_BRANCHINIT ((*branchinit)); /**< initialize branching rule */
97 SCIP_DECL_BRANCHEXIT ((*branchexit)); /**< deinitialize branching rule */
98 SCIP_DECL_BRANCHINITSOL((*branchinitsol));/**< solving process initialization method of branching rule */
99 SCIP_DECL_BRANCHEXITSOL((*branchexitsol));/**< solving process deinitialization method of branching rule */
100 SCIP_DECL_BRANCHEXECLP((*branchexeclp)); /**< branching execution method for fractional LP solutions */
101 SCIP_DECL_BRANCHEXECEXT((*branchexecext));/**< branching execution method for external candidates */
102 SCIP_DECL_BRANCHEXECPS((*branchexecps)); /**< branching execution method for not completely fixed pseudo solutions */
103 SCIP_BRANCHRULEDATA* branchruledata; /**< branching rule data */
104 SCIP_CLOCK* setuptime; /**< time spend for setting up this branchrule for the next stages */
105 SCIP_CLOCK* branchclock; /**< branching rule execution time */
106 int priority; /**< priority of the branching rule */
107 int maxdepth; /**< maximal depth level, up to which this branching rule should be used (or -1) */
108 SCIP_Bool initialized; /**< is branching rule initialized? */
109 SCIP_Bool isobjbranchrule; /**< is branching rule an obj branching rule? */
110};
111
112#ifdef __cplusplus
113}
114#endif
115
116#endif
common defines and data types used in all packages of SCIP
#define SCIP_Longint
Definition: def.h:158
#define SCIP_Bool
Definition: def.h:91
#define SCIP_Real
Definition: def.h:173
SCIP_Longint validlpcandslp
Definition: struct_branch.h:55
SCIP_Real * lpcandssol
Definition: struct_branch.h:49
SCIP_VAR ** externcands
Definition: struct_branch.h:51
SCIP_VAR ** pseudocands
Definition: struct_branch.h:54
SCIP_Real * externcandsscore
Definition: struct_branch.h:52
SCIP_Real * externcandssol
Definition: struct_branch.h:53
SCIP_Real * lpcandsfrac
Definition: struct_branch.h:50
SCIP_VAR ** lpcands
Definition: struct_branch.h:48
SCIP_Longint nexterncalls
Definition: struct_branch.h:84
SCIP_DECL_BRANCHINIT((*branchinit))
SCIP_Longint nchildren
Definition: struct_branch.h:91
SCIP_BRANCHRULEDATA * branchruledata
SCIP_Longint ncutsfound
Definition: struct_branch.h:87
SCIP_Real maxbounddist
Definition: struct_branch.h:80
SCIP_Longint nlpcalls
Definition: struct_branch.h:83
SCIP_Bool isobjbranchrule
SCIP_DECL_BRANCHEXECPS((*branchexecps))
SCIP_CLOCK * branchclock
SCIP_CLOCK * setuptime
SCIP_DECL_BRANCHFREE((*branchfree))
SCIP_DECL_BRANCHEXECLP((*branchexeclp))
SCIP_DECL_BRANCHEXIT((*branchexit))
SCIP_DECL_BRANCHINITSOL((*branchinitsol))
SCIP_Longint nconssfound
Definition: struct_branch.h:88
SCIP_Bool initialized
SCIP_DECL_BRANCHEXECEXT((*branchexecext))
SCIP_Longint ncutoffs
Definition: struct_branch.h:86
SCIP_DECL_BRANCHCOPY((*branchcopy))
SCIP_Longint npseudocalls
Definition: struct_branch.h:85
SCIP_Longint ndomredsfound
Definition: struct_branch.h:90
SCIP_DECL_BRANCHEXITSOL((*branchexitsol))
type definitions for branching rules
struct SCIP_BranchruleData SCIP_BRANCHRULEDATA
Definition: type_branch.h:57
type definitions for problem variables