1    	/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2    	/*                                                                           */
3    	/*                  This file is part of the program and library             */
4    	/*         SCIP --- Solving Constraint Integer Programs                      */
5    	/*                                                                           */
6    	/*  Copyright (c) 2002-2023 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_stat.h
26   	 * @ingroup INTERNALAPI
27   	 * @brief  datastructures for problem statistics
28   	 * @author Tobias Achterberg
29   	 * @author Timo Berthold
30   	 * @author Stefan Heinz
31   	 * @author Gregor Hendel
32   	 * @author Gerald Gamrath
33   	 * @author Marc Pfetsch
34   	 * @author Stefan Vigerske
35   	 */
36   	
37   	/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
38   	
39   	#ifndef __SCIP_STRUCT_STAT_H__
40   	#define __SCIP_STRUCT_STAT_H__
41   	
42   	
43   	#include "scip/def.h"
44   	#include "scip/type_stat.h"
45   	#include "scip/type_clock.h"
46   	#include "scip/type_visual.h"
47   	#include "scip/type_history.h"
48   	#include "scip/type_var.h"
49   	#include "scip/type_lp.h"
50   	#include "scip/type_heur.h"
51   	#include "scip/type_relax.h"
52   	#include "scip/type_misc.h"
53   	
54   	#ifdef __cplusplus
55   	extern "C" {
56   	#endif
57   	
58   	/** problem and runtime specific statistics */
59   	struct SCIP_Stat
60   	{
61   	   SCIP_REGRESSION*      regressioncandsobjval;/**< linear regression of pairs (nbranchcands, lpobjval) for every node */
62   	   SCIP_Longint          nlpiterations;      /**< total number of LP iterations */
63   	   SCIP_Longint          nrootlpiterations;  /**< total number of LP iterations in root node */
64   	   SCIP_Longint          nrootfirstlpiterations;/**< number of LP iterations for first LP solved at the root node */
65   	   SCIP_Longint          nprimallpiterations;/**< number of iterations in primal simplex */
66   	   SCIP_Longint          nduallpiterations;  /**< number of iterations in dual simplex */
67   	   SCIP_Longint          nlexduallpiterations;/**< number of iterations in lexicographic dual simplex */
68   	   SCIP_Longint          nbarrierlpiterations;/**< number of iterations in barrier algorithm */
69   	   SCIP_Longint          nprimalresolvelpiterations;  /**< number of primal LP iterations with advanced start basis */
70   	   SCIP_Longint          ndualresolvelpiterations;    /**< number of dual LP iterations with advanced start basis */
71   	   SCIP_Longint          nlexdualresolvelpiterations; /**< number of lexicographic dual LP iterations with advanced start basis */
72   	   SCIP_Longint          nnodelpiterations;  /**< number of iterations for totally solving node relaxations */
73   	   SCIP_Longint          ninitlpiterations;  /**< number of iterations for solving nodes' initial relaxations */
74   	   SCIP_Longint          ndivinglpiterations;/**< number of iterations in diving and probing */
75   	   SCIP_Longint          ndivesetlpiterations; /**< total number of LP iterations performed by divesets */
76   	   SCIP_Longint          nsbdivinglpiterations;/**< number of iterations in probing mode for strong branching */
77   	   SCIP_Longint          nsblpiterations;    /**< number of simplex iterations used in strong branching */
78   	   SCIP_Longint          nrootsblpiterations;/**< number of simplex iterations used in strong branching at the root node */
79   	   SCIP_Longint          nconflictlpiterations;/**< number of simplex iterations used in conflict analysis */
80   	   SCIP_Longint          nresolveinstablelps;       /**< number of simplex resolves of instable LPs */
81   	   SCIP_Longint          nresolveinstablelpiters;   /**< number of simplex iterations used for resolving instable LPs */
82   	   SCIP_Longint          nnodes;             /**< number of nodes processed in current run (including focus node) */
83   	   SCIP_Longint          ninternalnodes;     /**< number of nodes processed in current run where a branching was performed */
84   	   SCIP_Longint          nobjleaves;         /**< number of leaf nodes processed that reached the cutoff bound */
85   	   SCIP_Longint          nfeasleaves;        /**< number of leaf nodes processed with feasible relaxation solution */
86   	   SCIP_Longint          ninfeasleaves;      /**< number of infeasible leaf nodes processed */
87   	   SCIP_Longint          ntotalnodes;        /**< total number of nodes processed in all runs (including focus node) */
88   	   SCIP_Longint          ntotalinternalnodes;/**< total number of nodes processed in all runs where a branching was performed */
89   	   SCIP_Longint          ntotalnodesmerged;  /**< total number of nodes added ot the statistics of the main SCIP so far (see SCIPmergeStatistics) */
90   	   SCIP_Longint          ncreatednodes;      /**< total number of nodes created */
91   	   SCIP_Longint          ncreatednodesrun;   /**< number of nodes created in current run */
92   	   SCIP_Longint          nactivatednodes;    /**< number of times, a node got activated in current run */
93   	   SCIP_Longint          ndeactivatednodes;  /**< number of times, a node got deactivated in current run */
94   	   SCIP_Longint          nearlybacktracks;   /**< counter for early switches (if children dual bound is below reference value) */
95   	   SCIP_Longint          nnodesaboverefbound;/**< counter for the number of focus nodes exceeding the reference bound */
96   	   SCIP_Longint          nbacktracks;        /**< number of times, the new node was chosen from the leaves queue */
97   	   SCIP_Longint          ndelayedcutoffs;    /**< number of times, the selected node was from a cut off subtree */
98   	   SCIP_Longint          nreprops;           /**< number of times, a solved node is repropagated again */
99   	   SCIP_Longint          nrepropboundchgs;   /**< number of bound changes generated in repropagating nodes */
100  	   SCIP_Longint          nrepropcutoffs;     /**< number of times, a repropagated node was cut off */
101  	   SCIP_Longint          nlpsolsfound;       /**< number of CIP-feasible LP solutions found so far */
102  	   SCIP_Longint          nrelaxsolsfound;    /**< number of CIP-feasible relaxation solutions found so far */
103  	   SCIP_Longint          npssolsfound;       /**< number of CIP-feasible pseudo solutions found so far */
104  	   SCIP_Longint          nsbsolsfound;       /**< number of CIP-feasible solutions found during strong branching so far */
105  	   SCIP_Longint          nlpbestsolsfound;   /**< number of new best CIP-feasible LP solutions found so far */
106  	   SCIP_Longint          nrelaxbestsolsfound;/**< number of new best CIP-feasible relaxation solutions found so far */
107  	   SCIP_Longint          npsbestsolsfound;   /**< number of new best CIP-feasible pseudo solutions found so far */
108  	   SCIP_Longint          nsbbestsolsfound;   /**< number of new best CIP-feasible solutions found during strong branching so far */
109  	   SCIP_Longint          nexternalsolsfound; /**< number of externally given CIP-feasible solutions (or new solutions found when transforming old ones) */
110  	   SCIP_Longint          lastdispnode;       /**< last node for which an information line was displayed */
111  	   SCIP_Longint          lastdivenode;       /**< last node where LP diving was applied */
112  	   SCIP_Longint          lastconflictnode;   /**< last node where conflict analysis was applied */
113  	   SCIP_Longint          bestsolnode;        /**< node number where the last incumbent solution was found */
114  	   SCIP_Longint          domchgcount;        /**< internal counter, where all domain changes are counted */
115  	   SCIP_Longint          nboundchgs;         /**< total number of bound changes generated in the tree */
116  	   SCIP_Longint          nholechgs;          /**< total number of hole changes generated in the tree */
117  	   SCIP_Longint          nprobboundchgs;     /**< total number of bound changes generated in the tree during probing */
118  	   SCIP_Longint          nprobholechgs;      /**< total number of hole changes generated in the tree  during probing */
119  	   SCIP_Longint          nsbdowndomchgs;     /**< total number of domain changes generated at down children during strong branching */
120  	   SCIP_Longint          nsbupdomchgs;       /**< total number of domain changes generated at up children during strong branching */
121  	   SCIP_Longint          nsbtimesiterlimhit; /**< total number of times that the strong branching iteration limit was hit */
122  	   SCIP_Longint          nnodesbeforefirst;  /**< number of nodes before first primal solution */
123  	   SCIP_Longint          ninitconssadded;    /**< total number of initial constraints added during the solve */
124  	   SCIP_Longint          nactiveconssadded;  /**< total number of active constraints added */
125  	   SCIP_Longint          externmemestim;     /**< estimation of external memory usage, e.g., by LP solver */
126  	   SCIP_Longint          exprlastvisitedtag; /**< last used visited tag; used by expression iterators to identify expression that have been visited already */
127  	   SCIP_Longint          exprlastsoltag;     /**< last solution tag; used by expression evaluation to identify whether expression has been evaluated for given sol already */
128  	   SCIP_Longint          exprlastdifftag;    /**< last differentiation tag; used by expression differentiation to identify whether expression has been differentiated for given sol already */
129  	   SCIP_Real             avgnnz;             /**< average number of nonzeros per constraint in presolved problem */
130  	   SCIP_Real             firstlpdualbound;   /**< dual bound of root node computed by first LP solve (without cuts) */
131  	   SCIP_Real             rootlowerbound;     /**< lower bound of root node */
132  	   SCIP_Real             vsidsweight;        /**< current weight to use for updating VSIDS in history */
133  	   SCIP_Real             firstprimalbound;   /**< objective value of first primal solution */
134  	   SCIP_Real             firstprimaltime;    /**< time (in seconds) needed for first primal solution */
135  	   SCIP_Real             firstsolgap;        /**< solution gap when first solution is found */
136  	   SCIP_Real             lastsolgap;         /**< solution gap when last solution is found */
137  	   SCIP_Real             primalzeroittime;   /**< time used in primal simplex calls without iterations */
138  	   SCIP_Real             dualzeroittime;     /**< time used in dual simplex calls without iterations */
139  	   SCIP_Real             barrierzeroittime;  /**< time used in barrier calls without iterations */
140  	   SCIP_Real             maxcopytime;        /**< maxmimal time needed for copying a problem */
141  	   SCIP_Real             mincopytime;        /**< minimal time needed for copying a problem */
142  	   SCIP_Real             firstlptime;        /**< time needed to solve the very first LP in the root node */
143  	   SCIP_Real             lastbranchvalue;    /**< domain value of the last branching */
144  	   SCIP_Real             dualrefintegral;    /**< current reference-dual integral value */
145  	   SCIP_Real             primalrefintegral;  /**< current primal-reference integral value */
146  	   SCIP_Real             primaldualintegral; /**< current primal-dual integral value */
147  	   SCIP_Real             previousgap;        /**< primal dual gap preceding the current gap */
148  	   SCIP_Real             previousdualrefgap; /**< reference-dual gap preceding the current gap */
149  	   SCIP_Real             previousprimalrefgap; /**< primal-reference gap preceding the current gap */
150  	   SCIP_Real             previntegralevaltime;/**< last time of primal-dual integral evaluation */
151  	   SCIP_Real             lastprimalbound;    /**< last (non-infinite) primal bound (in transformed space) for integral evaluation */
152  	   SCIP_Real             lastdualbound;      /**< last (non-infinite) dual bound (in transformed space) for integral evaluation */
153  	   SCIP_Real             lastlowerbound;     /**< last lower bound (in transformed space) for integral evaluation */
154  	   SCIP_Real             lastupperbound;     /**< last upper bound (in transformed space) for integral evaluation */
155  	   SCIP_Real             rootlpbestestimate; /**< best-estimate for final root LP solution that changes with every pseudo-cost update */
156  	   SCIP_Real             referencebound;     /**< objective bound for reference purposes */
157  	   SCIP_Real             bestefficacy;       /**< best efficacy of global pool cut seen so far */
158  	   SCIP_Real             minefficacyfac;     /**< factor of best efficacy to use as min efficacy */
159  	   SCIP_Real             detertimecnt;       /**< internal counter for deterministic time */
160  	   SCIP_CLOCK*           solvingtime;        /**< total time used for solving (including presolving) the current problem */
161  	   SCIP_CLOCK*           solvingtimeoverall; /**< total time used for solving (including presolving) during reoptimization */
162  	   SCIP_CLOCK*           presolvingtime;     /**< total time used for presolving the current problem */
163  	   SCIP_CLOCK*           presolvingtimeoverall;/**< total time used for presolving during reoptimization */
164  	   SCIP_CLOCK*           primallptime;       /**< primal LP solution time */
165  	   SCIP_CLOCK*           duallptime;         /**< dual LP solution time */
166  	   SCIP_CLOCK*           lexduallptime;      /**< lexicographic dual LP solution time */
167  	   SCIP_CLOCK*           barrierlptime;      /**< barrier LP solution time */
168  	   SCIP_CLOCK*           resolveinstablelptime;/**< LP solution time for taking care of instable LPs */
169  	   SCIP_CLOCK*           divinglptime;       /**< diving and probing LP solution time */
170  	   SCIP_CLOCK*           strongbranchtime;   /**< strong branching time */
171  	   SCIP_CLOCK*           conflictlptime;     /**< conflict analysis LP solution time */
172  	   SCIP_CLOCK*           lpsoltime;          /**< time needed for storing feasible LP solutions */
173  	   SCIP_CLOCK*           relaxsoltime;       /**< time needed for storing feasible relaxation solutions */
174  	   SCIP_CLOCK*           pseudosoltime;      /**< time needed for storing feasible pseudo solutions */
175  	   SCIP_CLOCK*           sbsoltime;          /**< time needed for searching and storing feasible strong branching solutions */
176  	   SCIP_CLOCK*           nodeactivationtime; /**< time needed for path switching and activating nodes */
177  	   SCIP_CLOCK*           nlpsoltime;         /**< time needed for solving NLPs */
178  	   SCIP_CLOCK*           copyclock;          /**< time needed for copying problems */
179  	   SCIP_CLOCK*           strongpropclock;    /**< time needed for propagation during strong branching */
180  	   SCIP_CLOCK*           reoptupdatetime;    /**< time needed for storing and recreating nodes and solutions for reoptimization */
181  	   SCIP_HISTORY*         glbhistory;         /**< global history information over all variables */
182  	   SCIP_HISTORY*         glbhistorycrun;     /**< global history information over all variables for current run */
183  	   SCIP_VAR*             lastbranchvar;      /**< last variable, that was branched on */
184  	   SCIP_VISUAL*          visual;             /**< visualization information */
185  	   SCIP_HEUR*            firstprimalheur;    /**< heuristic which found the first primal solution */
186  	   SCIP_STATUS           status;             /**< SCIP solving status */
187  	   SCIP_BRANCHDIR        lastbranchdir;      /**< direction of the last branching */
188  	   SCIP_LPSOLSTAT        lastsblpsolstats[2];/**< last LP solving statuses for variable strong branching */
189  	   SCIP_Longint          nnz;                /**< number of nonzeros in presolved problem */
190  	   SCIP_Longint          lpcount;            /**< internal counter, where all lp calls are counted; this includes the restored lps after diving and probing */
191  	   SCIP_Longint          relaxcount;         /**< internal counter, where all relax calls are counted */
192  	   SCIP_Longint          nlps;               /**< total number of LPs solved with at least 1 iteration */
193  	   SCIP_Longint          nrootlps;           /**< number of LPs solved at the root node with at least 1 iteration */
194  	   SCIP_Longint          nprimallps;         /**< number of primal LPs solved with at least 1 iteration */
195  	   SCIP_Longint          nprimalzeroitlps;   /**< number of primal LPs with 0 iterations */
196  	   SCIP_Longint          nduallps;           /**< number of dual LPs solved with at least 1 iteration */
197  	   SCIP_Longint          ndualzeroitlps;     /**< number of dual LPs with 0 iterations */
198  	   SCIP_Longint          nlexduallps;        /**< number of lexicographic dual LPs solved */
199  	   SCIP_Longint          nbarrierlps;        /**< number of barrier LPs solved with at least 1 iteration */
200  	   SCIP_Longint          nbarrierzeroitlps;  /**< number of barrier LPs with 1 iteration */
201  	   SCIP_Longint          nprimalresolvelps;  /**< number of primal LPs solved with advanced start basis and at least 1 iteration */
202  	   SCIP_Longint          ndualresolvelps;    /**< number of dual LPs solved with advanced start basis and at least 1 iteration */
203  	   SCIP_Longint          nlexdualresolvelps; /**< number of lexicographic dual LPs solved with advanced start basis and at least 1 iteration */
204  	   SCIP_Longint          nnodelps;           /**< number of LPs solved for node relaxations */
205  	   SCIP_Longint          nnodezeroitlps;     /**< number of LPs solved with 0 iterations for node relaxations */
206  	   SCIP_Longint          ninitlps;           /**< number of LPs solved for nodes' initial relaxations */
207  	   SCIP_Longint          ndivinglps;         /**< number of LPs solved during diving and probing */
208  	   SCIP_Longint          ndivesetlps;        /**< total number of diveset LPs */
209  	   SCIP_Longint          nsbdivinglps;       /**< number of LPs solved during strong branching probing mode */
210  	   SCIP_Longint          nnumtroublelpmsgs;  /**< number of messages about numerical trouble in LP on verblevel HIGH or lower */
211  	   SCIP_Longint          nstrongbranchs;     /**< number of strong branching calls */
212  	   SCIP_Longint          nrootstrongbranchs; /**< number of strong branching calls at the root node */
213  	   SCIP_Longint          nconflictlps;       /**< number of LPs solved during conflict analysis */
214  	   SCIP_Longint          nnlps;              /**< number of NLPs solved */
215  	   SCIP_Longint          nisstoppedcalls;    /**< number of calls to SCIPsolveIsStopped() */
216  	   SCIP_Longint          totaldivesetdepth;  /**< the total probing depth over all diveset calls */
217  	   int                   subscipdepth;       /**< depth of current scip instance (increased by each copy call) */
218  	   int                   ndivesetcalls;      /**< total number of diveset diving calls */
219  	   int                   nruns;              /**< number of branch and bound runs on current problem, including current run */
220  	   int                   ncutpoolfails;      /**< number of fails in a cutpool to separate efficacious cuts */
221  	   int                   nconfrestarts;      /**< number of restarts performed due to conflict analysis */
222  	   int                   nrootboundchgs;     /**< total number of bound changes generated in the root node */
223  	   int                   nrootboundchgsrun;  /**< total number of bound changes generated in the root node of current run */
224  	   int                   nrootintfixings;    /**< total number of global fixings of integer variables */
225  	   int                   nrootintfixingsrun; /**< total number of global fixings of integer variables of current run */
226  	   int                   prevrunnvars;       /**< number of variables in the previous run */
227  	   int                   nvaridx;            /**< number of used variable indices */
228  	   int                   ncolidx;            /**< number of used column indices */
229  	   int                   nrowidx;            /**< number of used row indices */
230  	   int                   marked_nvaridx;     /**< number of used variable indices before solving started */
231  	   int                   marked_ncolidx;     /**< number of used column indices before solving started */
232  	   int                   marked_nrowidx;     /**< number of used row indices before solving started */
233  	   int                   npricerounds;       /**< number of pricing rounds performed in current node */
234  	   int                   nseparounds;        /**< number of separation rounds performed in current node */
235  	   int                   ndisplines;         /**< number of displayed information lines */
236  	   int                   maxdepth;           /**< maximal depth of all processed nodes in current run */
237  	   int                   maxtotaldepth;      /**< maximal depth of all processed nodes over all runs */
238  	   int                   plungedepth;        /**< current plunging depth (successive times, a child was selected as next node) */
239  	   int                   nactiveconss;       /**< total number of currently active constraints */
240  	   int                   nenabledconss;      /**< total number of currently enabled constraints */
241  	   int                   nimplications;      /**< total number of implications stored in the implication graph */
242  	   int                   npresolrounds;      /**< number of presolving rounds in current run */
243  	   int                   npresolroundsfast;  /**< number of fast presolving rounds in current run */
244  	   int                   npresolroundsmed;   /**< number of medium presolving rounds in current run */
245  	   int                   npresolroundsext;   /**< number of exhaustive presolving rounds in current run */
246  	   int                   npresolfixedvars;   /**< number of presolving fixings in current run */
247  	   int                   npresolaggrvars;    /**< number of presolving aggregations in current run */
248  	   int                   npresolchgvartypes; /**< number of presolving variable type changes in current run */
249  	   int                   npresolchgbds;      /**< number of presolving bound changes in current run */
250  	   int                   npresoladdholes;    /**< number of presolving hole additions in current run */
251  	   int                   npresoldelconss;    /**< number of presolving constraint deletions in current run */
252  	   int                   npresoladdconss;    /**< number of presolving constraint additions in current run */
253  	   int                   npresolupgdconss;   /**< number of presolving constraint upgrades in current run */
254  	   int                   npresolchgcoefs;    /**< number of presolving coefficient changes in current run */
255  	   int                   npresolchgsides;    /**< number of presolving side changes in current run */
256  	   int                   lastnpresolfixedvars;/**< number of presolving fixings before presolving round */
257  	   int                   lastnpresolaggrvars;/**< number of presolving aggregations before presolving round */
258  	   int                   lastnpresolchgvartypes;/**< number of presolving variable type changes before presolving round */
259  	   int                   lastnpresolchgbds;  /**< number of presolving bound changes before presolving round */
260  	   int                   lastnpresoladdholes;/**< number of presolving hole additions before presolving round */
261  	   int                   lastnpresoldelconss;/**< number of presolving constraint deletions before presolving round */
262  	   int                   lastnpresoladdconss;/**< number of presolving constraint additions before presolving round */
263  	   int                   lastnpresolupgdconss;/**< number of presolving constraint upgrades before presolving round */
264  	   int                   lastnpresolchgcoefs;/**< number of presolving coefficient changes before presolving round */
265  	   int                   lastnpresolchgsides;/**< number of presolving side changes before presolving round */
266  	#ifdef SCIP_DISABLED_CODE
267  	   int                   lastnpresolimplications;/**< number of implications before presolving round */
268  	   int                   lastnpresolcliques; /**< number of cliques before presolving round */
269  	#endif
270  	   int                   solindex;           /**< consecutively numbered solution index */
271  	   int                   nrunsbeforefirst;   /**< number of runs until first primal solution */
272  	   int                   firstprimaldepth;   /**< depth in which first primal solution was found */
273  	   int                   ncopies;            /**< counter how often SCIPcopy() was performed */
274  	   int                   nreoptruns;         /**< number of reoptimization runs */
275  	   int                   nclockskipsleft;    /**< how many times the timing should be skipped in SCIPsolveIsStopped() */
276  	   int                   nactiveexpriter;    /**< number of active expression iterators */
277  	   SCIP_Bool             memsavemode;        /**< should algorithms be switched to memory saving mode? */
278  	   SCIP_Bool             userinterrupt;      /**< has the user asked to interrupt the solving process? */
279  	   SCIP_Bool             userrestart;        /**< has the user asked to restart the solving process? */
280  	   SCIP_Bool             inrestart;          /**< are we currently restarting the system? */
281  	   SCIP_Bool             collectvarhistory;  /**< should variable history statistics be collected */
282  	   SCIP_Bool             performpresol;      /**< indicates whether presolving is enabled */
283  	   SCIP_Bool             branchedunbdvar;    /**< indicates whether branching on an unbounded variable has been performed */
284  	   SCIP_Bool             disableenforelaxmsg;/**< was disable enforelax message printed? */
285  	};
286  	
287  	#ifdef __cplusplus
288  	}
289  	#endif
290  	
291  	#endif
292