Scippy

SCIP

Solving Constraint Integer Programs

struct_reopt.h
Go to the documentation of this file.
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2 /* */
3 /* This file is part of the program and library */
4 /* SCIP --- Solving Constraint Integer Programs */
5 /* */
6 /* Copyright (C) 2002-2016 Konrad-Zuse-Zentrum */
7 /* fuer Informationstechnik Berlin */
8 /* */
9 /* SCIP is distributed under the terms of the ZIB Academic License. */
10 /* */
11 /* You should have received a copy of the ZIB Academic License */
12 /* along with SCIP; see the file COPYING. If not email to scip@zib.de. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file struct_reopt.h
17  * @brief data structures for collecting reoptimization information
18  * @author Jakob Witzig
19  */
20 
21 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
22 
23 #ifndef __SCIP_STRUCT_REOPT_H__
24 #define __SCIP_STRUCT_REOPT_H__
25 
26 
27 #include "scip/def.h"
28 #include "scip/type_reopt.h"
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
34 /** nodes of SCIP_SolTree */
36 {
37  SCIP_SOL* sol; /**< the stored solution */
38  SCIP_SOLNODE* father; /**< pointer to the parent node */
39  SCIP_SOLNODE* rchild; /**< pointer to the right child node (0-branch) */
40  SCIP_SOLNODE* lchild; /**< pointer to the left child node (1-branch) */
41  SCIP_Bool updated; /**< flag if the solution is already updated
42  * w.r.t. the new objective function */
43 };
44 
45 /** tree for solution */
47 {
48  SCIP_SOLNODE*** sols; /**< array of arrays of solutions of the reoptimization runs */
49  SCIP_SOLNODE* root; /**< root node of the solution tree */
50  int* solssize; /**< size of sols[x] arrays */
51  int* nsols; /**< number of solutions stored in sols[x] array */
52 };
53 
54 /** data for constraints to split nodes during reoptimization */
56 {
57  SCIP_VAR** vars; /**< array of variables */
58  SCIP_Real* vals; /**< array of variable bounds */
59  REOPT_CONSTYPE constype; /**< type of the constraint */
60  int varssize; /**< available sitze in the arrays */
61  int nvars; /**< number of enties in the arrays */
62 };
63 
64 /** nodes of SCIP_ReoptTree */
66 {
67  LOGICORDATA** conss; /**< array of constraints added to the node, i.e., logic-or constraints */
68  SCIP_VAR** vars; /**< variables along the branching path up to the next stored node */
69  SCIP_VAR** afterdualvars; /**< variables along the branching path after the first decision based on dual information */
70  LOGICORDATA* dualconscur; /**< dual constraint that need to be added the current round */
71  LOGICORDATA* dualconsnex; /**< dual constraint that need to be added the next round */
72  SCIP_BOUNDTYPE* varboundtypes; /**< boundtypes along the branching path up to the next stored node */
73  SCIP_BOUNDTYPE* afterdualvarboundtypes; /**< boundtypes along the branching path after the first dual information */
74  SCIP_Real* varbounds; /**< bounds along the branching path up to the next stored node */
75  SCIP_Real* afterdualvarbounds; /**< bounds along the branching path after the first decision based on dual information */
76  SCIP_Real lowerbound; /**< the last lowerbound of this node in the previous iteration */
77  SCIP_Bool dualfixing; /**< flag whether bound changes based on dual decisions exist */
78  int nvars; /**< number of branching decisions up to the next stored node */
79  int varssize; /**< size of allocated memory */
80  int nafterdualvars; /**< number of branching decisions after the first dual information */
81  int afterdualvarssize; /**< size of allocated memory */
82  int nchilds; /**< number of child nodes */
83  int allocchildmem; /**< allocated memory for child nodes */
84  int nconss; /**< number of added constraints */
85  int consssize; /**< allocated memory for constraints */
86  unsigned int* childids; /**< array of child nodes that need to be reoptimized */
87 
88  unsigned int parentID:29; /**< id of the stored parent node */
89  unsigned int reopttype:3; /**< reason for storing the node */
90 };
91 
92 /* tree to store the current search tree */
94 {
95 
96  SCIP_REOPTNODE** reoptnodes; /**< array of SCIP_REOPTNODE */
97  SCIP_QUEUE* openids; /**< queue of open positions in the reoptnodes array */
98  int nreoptnodes; /**< number of saved nodes */
99  int nfeasnodes; /**< number of feasible nodes in the current run */
100  int ntotalfeasnodes; /**< number of feasible nodes over all runs */
101  int ninfnodes; /**< number of (LP-)infeasible nodes in the current run */
102  int ntotalinfnodes; /**< number of (LP-)infeasible nodes over all runs */
103  int nprunednodes; /**< number of pruned nodes in the current run */
104  int ntotalprunednodes; /**< number of pruned nodes over all runs */
105  int ncutoffreoptnodes; /**< number of cut off reoptimized nodes in the current run */
106  int ntotalcutoffreoptnodes; /**< number of cut off reoptimized nodes over all runs */
107  int ninfsubtrees; /**< number of found infeasible subtrees */
108  SCIP_Bool initialized; /**< is the data structure initialized? */
109  unsigned int reoptnodessize; /**< size of allocated memory for the reoptnodes array and the openid queue */
110 };
111 
112 /** reoptimization data and solution storage */
114 {
115  SCIP_SOL** prevbestsols; /**< list of best solutions of all previous rounds */
116  SCIP_Real** objs; /**< list of objective coefficients */
117  LOGICORDATA** glbconss; /**< global constraints that need to be added at the beginning of the next iteration */
118  LOGICORDATA* dualcons; /**< constraint describing bound changes based on dual information */
119  SCIP_REOPTTREE* reopttree; /**< data structure to store the current reoptimization search tree */
120  SCIP_SOLTREE* soltree; /**< tree to handle all saved solutions */
121  SCIP_CLOCK* savingtime; /**< time needed to store the nodes */
122  SCIP_Real simtolastobj; /**< similarity to the last objective function */
123  SCIP_Real simtofirstobj; /**< similarity to the first objective function */
124  SCIP_Longint lastbranched; /**< number of the last branched node */
125  SCIP_Longint lastseennode; /**< node number of the last caught event */
126  SCIP_Longint currentnode; /**< number of the current node */
127  int run; /**< number of the current reoptimization run */
128  int runsize; /**< allocated memory for runs */
129  int firstobj; /**< first non empty objective function */
130  int noptsolsbyreoptsol; /**< number of successive optimal solutions found by heur_reoptsols */
131  int nglbconss; /**< number of stored global constraints */
132  int allocmemglbconss; /**< allocated memory for global constraints */
133  int ncheckedsols; /**< number of updated solutions by reoptsols */
134  int nimprovingsols; /**< number of improving solutions found by reoptsols */
135  int nglbrestarts; /**< number of global restarts */
136  int ntotallocrestarts; /**< number of local restarts over all runs */
137  int nlocrestarts; /**< number of local restarts in the current iteration */
138  int firstrestart; /**< run with the first global restart or -1 of no restart */
139  int lastrestart; /**< run with the last global restart or -1 if no restart */
140 };
141 
142 #ifdef __cplusplus
143 }
144 #endif
145 
146 #endif
LOGICORDATA ** conss
Definition: struct_reopt.h:67
enum SCIP_BoundType SCIP_BOUNDTYPE
Definition: type_lp.h:50
REOPT_CONSTYPE constype
Definition: struct_reopt.h:59
LOGICORDATA * dualconscur
Definition: struct_reopt.h:70
int firstrestart
Definition: struct_reopt.h:138
SCIP_Real simtofirstobj
Definition: struct_reopt.h:123
SCIP_BOUNDTYPE * afterdualvarboundtypes
Definition: struct_reopt.h:73
SCIP_Longint lastseennode
Definition: struct_reopt.h:125
SCIP_Bool updated
Definition: struct_reopt.h:41
SCIP_Real simtolastobj
Definition: struct_reopt.h:122
LOGICORDATA ** glbconss
Definition: struct_reopt.h:117
SCIP_REOPTNODE ** reoptnodes
Definition: struct_reopt.h:96
SCIP_SOL ** prevbestsols
Definition: struct_reopt.h:115
int nimprovingsols
Definition: struct_reopt.h:134
type definitions for collecting reoptimization information
SCIP_BOUNDTYPE * varboundtypes
Definition: struct_reopt.h:72
int ntotallocrestarts
Definition: struct_reopt.h:136
LOGICORDATA * dualconsnex
Definition: struct_reopt.h:71
SCIP_SOLNODE * root
Definition: struct_reopt.h:49
SCIP_VAR ** vars
Definition: struct_reopt.h:57
SCIP_Real * vals
Definition: struct_reopt.h:58
int * solssize
Definition: struct_reopt.h:50
SCIP_SOLTREE * soltree
Definition: struct_reopt.h:120
SCIP_SOLNODE * lchild
Definition: struct_reopt.h:40
SCIP_SOLNODE *** sols
Definition: struct_reopt.h:48
int allocmemglbconss
Definition: struct_reopt.h:132
SCIP_Longint currentnode
Definition: struct_reopt.h:126
SCIP_Real ** objs
Definition: struct_reopt.h:116
unsigned int * childids
Definition: struct_reopt.h:86
int nglbrestarts
Definition: struct_reopt.h:135
SCIP_REOPTTREE * reopttree
Definition: struct_reopt.h:119
#define SCIP_Bool
Definition: def.h:53
SCIP_SOLNODE * rchild
Definition: struct_reopt.h:39
SCIP_VAR ** afterdualvars
Definition: struct_reopt.h:69
unsigned int reoptnodessize
Definition: struct_reopt.h:109
int ntotalcutoffreoptnodes
Definition: struct_reopt.h:106
SCIP_Bool initialized
Definition: struct_reopt.h:108
SCIP_SOLNODE * father
Definition: struct_reopt.h:38
SCIP_Bool dualfixing
Definition: struct_reopt.h:77
SCIP_VAR ** vars
Definition: struct_reopt.h:68
int noptsolsbyreoptsol
Definition: struct_reopt.h:130
SCIP_Real * varbounds
Definition: struct_reopt.h:74
SCIP_QUEUE * openids
Definition: struct_reopt.h:97
#define SCIP_Real
Definition: def.h:127
LOGICORDATA * dualcons
Definition: struct_reopt.h:118
SCIP_Real * afterdualvarbounds
Definition: struct_reopt.h:75
#define SCIP_Longint
Definition: def.h:112
int ncheckedsols
Definition: struct_reopt.h:133
enum Reopt_ConsType REOPT_CONSTYPE
Definition: type_reopt.h:64
common defines and data types used in all packages of SCIP
SCIP_Real lowerbound
Definition: struct_reopt.h:76
SCIP_Longint lastbranched
Definition: struct_reopt.h:124
int nlocrestarts
Definition: struct_reopt.h:137
SCIP_CLOCK * savingtime
Definition: struct_reopt.h:121
SCIP_SOL * sol
Definition: struct_reopt.h:37