Scippy

GCG

Branch-and-Price & Column Generation for Everyone

branch_generic.h
Go to the documentation of this file.
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2 /* */
3 /* This file is part of the program */
4 /* GCG --- Generic Column Generation */
5 /* a Dantzig-Wolfe decomposition based extension */
6 /* of the branch-cut-and-price framework */
7 /* SCIP --- Solving Constraint Integer Programs */
8 /* */
9 /* Copyright (C) 2010-2021 Operations Research, RWTH Aachen University */
10 /* Zuse Institute Berlin (ZIB) */
11 /* */
12 /* This program is free software; you can redistribute it and/or */
13 /* modify it under the terms of the GNU Lesser General Public License */
14 /* as published by the Free Software Foundation; either version 3 */
15 /* of the License, or (at your option) any later version. */
16 /* */
17 /* This program is distributed in the hope that it will be useful, */
18 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
19 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
20 /* GNU Lesser General Public License for more details. */
21 /* */
22 /* You should have received a copy of the GNU Lesser General Public License */
23 /* along with this program; if not, write to the Free Software */
24 /* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.*/
25 /* */
26 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
27 
28 /**@file branch_generic.h
29  * @brief branching rule based on vanderbeck's generic branching scheme
30  * @author Marcel Schmickerath
31  */
32 
33 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
34 
35 #ifndef __SCIP_BRANCH_GENERIC_H__
36 #define __SCIP_BRANCH_GENERIC_H__
37 
38 
39 #include "scip/scip.h"
40 #include "type_branchgcg.h"
41 
42 #ifdef __cplusplus
43 extern "C" {
44 #endif
45 
46 typedef enum {
50 
51 /** component bound structure */
53 {
54  SCIP_VAR* component; /**< variable to which this bound belongs */
55  GCG_COMPSENSE sense; /**< sense of the bound */
56  SCIP_Real bound; /**< bound value */
57 };
59 
60 /** strip structure */
61 struct GCG_Strip
62 {
63  SCIP* scip; /**< SCIP data structure */
64  SCIP_VAR* mastervar; /**< master variable */
65  GCG_COMPSEQUENCE** C; /**< current set of comp bound sequences */
66  int Csize; /**< number of component bound sequences */
67  int* sequencesizes; /**< array of sizes of component bound sequences */
68 };
69 typedef struct GCG_Strip GCG_STRIP;
70 
71 /** creates the generic branching rule and includes it in SCIP */
72 extern
73 SCIP_RETCODE SCIPincludeBranchruleGeneric(
74  SCIP* scip /**< SCIP data structure */
75  );
76 
77 /** initializes branchdata */
78 extern
80  SCIP* scip, /**< SCIP data structure */
81  GCG_BRANCHDATA** branchdata /**< branching data to initialize */
82  );
83 
84 /** get component bound sequence */
85 extern
87  GCG_BRANCHDATA* branchdata /**< branching data to initialize */
88  );
89 
90 /** get size of component bound sequence */
91 extern
93  GCG_BRANCHDATA* branchdata /**< branching data to initialize */
94  );
95 
96 /** get id of pricing problem (or block) to which the constraint belongs */
97 extern
99  GCG_BRANCHDATA* branchdata /**< branching data to initialize */
100  );
101 
102 /** get master constraint */
103 extern
105  GCG_BRANCHDATA* branchdata /**< branching data to initialize */
106  );
107 
108 /** prepares informations for using the generic branching scheme */
109 extern
110 SCIP_RETCODE GCGbranchGenericInitbranch(
111  SCIP* masterscip, /**< SCIP data structure */
112  SCIP_BRANCHRULE* branchrule, /**< branching rule */
113  SCIP_RESULT* result, /**< pointer to store the result of the branching call */
114  int** checkedblocks, /**< blocks that have been checked */
115  int* ncheckedblocks, /**< number of checked blocks */
116  GCG_STRIP**** checkedblockssortstrips, /**< sorted strips of checked blocks */
117  int** checkedblocksnsortstrips /**< sizes of the strips */
118  );
119 
120 /** returns true when the branch rule is the generic branchrule */
121 SCIP_Bool GCGisBranchruleGeneric(
122  SCIP_BRANCHRULE* branchrule /**< branchrule to check */
123 );
124 
125 #ifdef __cplusplus
126 }
127 #endif
128 
129 #endif
type definitions for branching rules in GCG projects
GCG_COMPSENSE
SCIP * scip
SCIP_RETCODE SCIPincludeBranchruleGeneric(SCIP *scip)
int GCGbranchGenericBranchdataGetConsblocknr(GCG_BRANCHDATA *branchdata)
SCIP_CONS * GCGbranchGenericBranchdataGetMastercons(GCG_BRANCHDATA *branchdata)
@ GCG_COMPSENSE_GE
SCIP_Bool GCGisBranchruleGeneric(SCIP_BRANCHRULE *branchrule)
GCG_COMPSEQUENCE ** C
SCIP_VAR * mastervar
int * sequencesizes
GCG_COMPSEQUENCE * GCGbranchGenericBranchdataGetConsS(GCG_BRANCHDATA *branchdata)
SCIP_RETCODE GCGbranchGenericInitbranch(SCIP *masterscip, SCIP_BRANCHRULE *branchrule, SCIP_RESULT *result, int **checkedblocks, int *ncheckedblocks, GCG_STRIP ****checkedblockssortstrips, int **checkedblocksnsortstrips)
SCIP_RETCODE GCGbranchGenericCreateBranchdata(SCIP *scip, GCG_BRANCHDATA **branchdata)
int GCGbranchGenericBranchdataGetConsSsize(GCG_BRANCHDATA *branchdata)
@ GCG_COMPSENSE_LT