Scippy

GCG

Branch-and-Price & Column Generation for Everyone

zerohalf_selector.h
Go to the documentation of this file.
1/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2/* */
3/* This file is part of the program and library */
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-2026 Operations Research, RWTH Aachen University */
10/* Zuse Institute Berlin (ZIB) */
11/* */
12/* Licensed under the Apache License, Version 2.0 (the "License"); */
13/* you may not use this file except in compliance with the License. */
14/* You may obtain a copy of the License at */
15/* */
16/* http://www.apache.org/licenses/LICENSE-2.0 */
17/* */
18/* Unless required by applicable law or agreed to in writing, software */
19/* distributed under the License is distributed on an "AS IS" BASIS, */
20/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
21/* See the License for the specific language governing permissions and */
22/* limitations under the License. */
23/* */
24/* You should have received a copy of the Apache-2.0 license */
25/* along with GCG; see the file LICENSE. If not visit gcg.or.rwth-aachen.de.*/
26/* */
27/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
28
29/**@file sepa_zerohalf.h
30 * @ingroup SEPARATORS
31 * @brief {0,1/2}-cuts separator
32 * @author Manuel Kutschka
33 * @author Tobias Achterberg
34 */
35
36/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
37
38#ifndef GCG_ZEROHALF_SELECTOR_H__
39#define GCG_ZEROHALF_SELECTOR_H__
40
41
42#include <scip/def.h>
43#include <scip/type_retcode.h>
44#include <scip/def.h>
45#include <scip/type_retcode.h>
46#include <scip/type_scip.h>
47
48#include "gcg/gcg.h"
49
50#ifdef __cplusplus
51extern "C" {
52#endif
53
55{
56 SCIP_Real minviol; /**< minimal violation to generate zerohalfcut for */
57 SCIP_Real maxslack; /**< maximal slack of rows to be used in aggregation */
58 SCIP_Real maxslackroot; /**< maximal slack of rows to be used in aggregation in the root node */
59 SCIP_Real maxrowdensity; /**< maximal density of row to be used in aggregation */
60 SCIP_Bool infeasible; /**< infeasibility was detected after adding a zerohalf cut */
61 SCIP_Bool dynamiccuts; /**< should generated cuts be removed from the LP if they are no longer tight? */
62 int densityoffset; /**< additional number of variables allowed in row on top of density */
63 int nreductions; /**< number of reductions to the mod 2 system found so far */
64 SCIP_CONS** origmasterconss; /**< array of orig master conss (is only allocated if not equal to data of relaxator) */
65 SCIP_CONS** masterconss; /**< array of master conss (is only allocated if not equal to data of relaxator) */
66 int nmasterconss; /**< number of master conss */
67};
69
71{
72 int* indices; /**< indices of the the constraint used to create the cut */
73 int nindices; /**< number of constraints used to create the cut */
74};
76
77struct RowIndex
78{
79 unsigned int type:2; /**< type of row index; 0 means lp row using the right hand side,
80 * 1 means lp row using the left hand side, and 2 means a
81 * transformed integral row */
82 unsigned int index:30; /**< lp position of original row, or index of transformed integral row */
83};
84typedef struct RowIndex ROWINDEX;
85
86/** perform the zerohalf cut separation */
88 GCG* gcg,
89 SCIP_SOL* sol,
90 SCIP_Bool allowlocal,
91 int depth, /* current depth */
92 GCG_ZEROHALFDATA* zhdata,
93 int ncalls,
94 int maxcuts,
95 GCG_CUTINDICES*** cutindices,
96 int* ncutindices
97);
98
99/** create an instance of cut indices */
101 SCIP* scip, /**< SCIP data structure (master problem) */
102 GCG_CUTINDICES** cutindices, /**< pointer to store cutindices */
103 int nindices, /**< number of indices */
104 ROWINDEX* rowindex /**< indices */
105);
106
107/** create an instance of cut indices */
109 SCIP* scip, /**< SCIP data structure (master problem) */
110 GCG_CUTINDICES** cutindices, /**< pointer to store cutindices */
111 int nindices, /**< number of indices */
112 int* indices /**< indices */
113);
114
115/** free an instance of cut indices */
117 SCIP* scip, /**< SCIP data structure (master problem) */
118 GCG_CUTINDICES** cutindices /**< pointer to cutindices */
119);
120
121#ifdef __cplusplus
122}
123#endif
124
125#endif
#define SCIP_Bool
#define SCIP_Real
GCG interface methods.
SCIP_CONS ** masterconss
SCIP_CONS ** origmasterconss
Definition: struct_gcg.h:55
unsigned int index
unsigned int type
enum SCIP_Retcode SCIP_RETCODE
SCIP_RETCODE GCGcreateCutIndicesFromArray(SCIP *scip, GCG_CUTINDICES **cutindices, int nindices, int *indices)
SCIP_RETCODE GCGselectConstraintsZeroHalf(GCG *gcg, SCIP_SOL *sol, SCIP_Bool allowlocal, int depth, GCG_ZEROHALFDATA *zhdata, int ncalls, int maxcuts, GCG_CUTINDICES ***cutindices, int *ncutindices)
SCIP_RETCODE GCGfreeCutIndices(SCIP *scip, GCG_CUTINDICES **cutindices)
SCIP_RETCODE GCGcreateCutIndicesFromRowindex(SCIP *scip, GCG_CUTINDICES **cutindices, int nindices, ROWINDEX *rowindex)