Scippy

SCIP

Solving Constraint Integer Programs

visual.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 2002-2022 Zuse Institute Berlin */
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 visual.h
26  * @ingroup INTERNALAPI
27  * @brief methods for creating output for visualization tools (VBC, BAK)
28  * @author Tobias Achterberg
29  * @author Marc Pfetsch
30  */
31 
32 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
33 
34 #ifndef __SCIP_VISUAL_H__
35 #define __SCIP_VISUAL_H__
36 
37 
38 #include "scip/def.h"
39 #include "scip/type_set.h"
40 #include "scip/type_sol.h"
41 #include "scip/type_stat.h"
42 #include "scip/type_tree.h"
43 #include "scip/type_visual.h"
44 
45 #ifdef __cplusplus
46 extern "C" {
47 #endif
48 
49 /** creates visualization data structure */
50 SCIP_EXPORT
52  SCIP_VISUAL** visual, /**< pointer to store the visualization information */
53  SCIP_MESSAGEHDLR* messagehdlr /**< message handler */
54  );
55 
56 /** frees visualization data structure */
57 SCIP_EXPORT
58 void SCIPvisualFree(
59  SCIP_VISUAL** visual /**< pointer to store the visualization information */
60  );
61 
62 /** initializes visualization information and creates a file for visualization output */
63 SCIP_EXPORT
65  SCIP_VISUAL* visual, /**< visualization information */
66  BMS_BLKMEM* blkmem, /**< block memory */
67  SCIP_SET* set, /**< global SCIP settings */
68  SCIP_MESSAGEHDLR* messagehdlr /**< message handler */
69  );
70 
71 /** closes the visualization output file */
72 SCIP_EXPORT
73 void SCIPvisualExit(
74  SCIP_VISUAL* visual, /**< visualization information */
75  SCIP_SET* set, /**< global SCIP settings */
76  SCIP_MESSAGEHDLR* messagehdlr /**< message handler */
77  );
78 
79 /** creates a new node entry in the visualization output file */
80 SCIP_EXPORT
82  SCIP_VISUAL* visual, /**< visualization information */
83  SCIP_SET* set, /**< global SCIP settings */
84  SCIP_STAT* stat, /**< problem statistics */
85  SCIP_NODE* node /**< new node, that was created */
86  );
87 
88 /** updates a node entry in the visualization output file */
90  SCIP_VISUAL* visual, /**< visualization information */
91  SCIP_SET* set, /**< global SCIP settings */
92  SCIP_STAT* stat, /**< problem statistics */
93  SCIP_NODE* node /**< new node, that was created */
94  );
95 
96 /** marks node as solved in visualization output file */
97 SCIP_EXPORT
99  SCIP_VISUAL* visual, /**< visualization information */
100  SCIP_SET* set, /**< global SCIP settings */
101  SCIP_STAT* stat, /**< problem statistics */
102  SCIP_NODE* node /**< node, that was solved */
103  );
104 
105 /** changes the color of the node to the color of cutoff nodes */
106 SCIP_EXPORT
108  SCIP_VISUAL* visual, /**< visualization information */
109  SCIP_SET* set, /**< global SCIP settings */
110  SCIP_STAT* stat, /**< problem statistics */
111  SCIP_NODE* node, /**< node, that was cut off */
112  SCIP_Bool infeasible /**< whether the node is infeasible (otherwise exceeded the cutoff bound) */
113  );
114 
115 /** changes the color of the node to the color of nodes where a conflict constraint was found */
116 SCIP_EXPORT
118  SCIP_VISUAL* visual, /**< visualization information */
119  SCIP_STAT* stat, /**< problem statistics */
120  SCIP_NODE* node /**< node, where the conflict was found */
121  );
122 
123 /** changes the color of the node to the color of nodes that were marked to be repropagated */
124 SCIP_EXPORT
126  SCIP_VISUAL* visual, /**< visualization information */
127  SCIP_STAT* stat, /**< problem statistics */
128  SCIP_NODE* node /**< node, that was marked to be repropagated */
129  );
130 
131 /** changes the color of the node to the color of repropagated nodes */
132 SCIP_EXPORT
134  SCIP_VISUAL* visual, /**< visualization information */
135  SCIP_STAT* stat, /**< problem statistics */
136  SCIP_NODE* node /**< node, that was repropagated */
137  );
138 
139 /** changes the color of the node to the color of nodes with a primal solution */
140 SCIP_EXPORT
142  SCIP_VISUAL* visual, /**< visualization information */
143  SCIP_SET* set, /**< global SCIP settings */
144  SCIP_STAT* stat, /**< problem statistics */
145  SCIP_NODE* node, /**< node where the solution was found, or NULL */
146  SCIP_Bool bettersol, /**< the solution was better than the previous ones */
147  SCIP_SOL* sol /**< solution that has been found */
148  );
149 
150 /** outputs a new global lower bound to the visualization output file */
151 SCIP_EXPORT
153  SCIP_VISUAL* visual, /**< visualization information */
154  SCIP_SET* set, /**< global SCIP settings */
155  SCIP_STAT* stat, /**< problem statistics */
156  SCIP_Real lowerbound /**< new lower bound */
157  );
158 
159 /** outputs a new global upper bound to the visualization output file */
160 SCIP_EXPORT
162  SCIP_VISUAL* visual, /**< visualization information */
163  SCIP_SET* set, /**< global SCIP settings */
164  SCIP_STAT* stat, /**< problem statistics */
165  SCIP_Real upperbound /**< new upper bound */
166  );
167 
168 #ifdef __cplusplus
169 }
170 #endif
171 
172 #endif
void SCIPvisualLowerbound(SCIP_VISUAL *visual, SCIP_SET *set, SCIP_STAT *stat, SCIP_Real lowerbound)
Definition: visual.c:768
SCIP_RETCODE SCIPvisualNewChild(SCIP_VISUAL *visual, SCIP_SET *set, SCIP_STAT *stat, SCIP_NODE *node)
Definition: visual.c:266
void SCIPvisualExit(SCIP_VISUAL *visual, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr)
Definition: visual.c:189
SCIP_RETCODE SCIPvisualCreate(SCIP_VISUAL **visual, SCIP_MESSAGEHDLR *messagehdlr)
Definition: visual.c:85
void SCIPvisualFoundSolution(SCIP_VISUAL *visual, SCIP_SET *set, SCIP_STAT *stat, SCIP_NODE *node, SCIP_Bool bettersol, SCIP_SOL *sol)
Definition: visual.c:669
SCIP_RETCODE SCIPvisualInit(SCIP_VISUAL *visual, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr)
Definition: visual.c:120
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:63
void SCIPvisualUpperbound(SCIP_VISUAL *visual, SCIP_SET *set, SCIP_STAT *stat, SCIP_Real upperbound)
Definition: visual.c:805
type definitions for global SCIP settings
type definitions for problem statistics
type definitions for output for visualization tools (VBC, BAK)
void SCIPvisualSolvedNode(SCIP_VISUAL *visual, SCIP_SET *set, SCIP_STAT *stat, SCIP_NODE *node)
Definition: visual.c:473
void SCIPvisualFree(SCIP_VISUAL **visual)
Definition: visual.c:106
#define SCIP_Bool
Definition: def.h:93
void SCIPvisualMarkedRepropagateNode(SCIP_VISUAL *visual, SCIP_STAT *stat, SCIP_NODE *node)
Definition: visual.c:630
void SCIPvisualCutoffNode(SCIP_VISUAL *visual, SCIP_SET *set, SCIP_STAT *stat, SCIP_NODE *node, SCIP_Bool infeasible)
Definition: visual.c:533
type definitions for branch and bound tree
type definitions for storing primal CIP solutions
void SCIPvisualRepropagatedNode(SCIP_VISUAL *visual, SCIP_STAT *stat, SCIP_NODE *node)
Definition: visual.c:651
SCIP_MESSAGEHDLR * messagehdlr
Definition: struct_visual.h:53
#define SCIP_Real
Definition: def.h:186
common defines and data types used in all packages of SCIP
struct BMS_BlkMem BMS_BLKMEM
Definition: memory.h:439
void SCIPvisualFoundConflict(SCIP_VISUAL *visual, SCIP_STAT *stat, SCIP_NODE *node)
Definition: visual.c:612
SCIP_RETCODE SCIPvisualUpdateChild(SCIP_VISUAL *visual, SCIP_SET *set, SCIP_STAT *stat, SCIP_NODE *node)
Definition: visual.c:341