Detailed Description
{0,1/2}-cuts separator
{0,1/2}-Chvátal-Gomory cuts separator. It solves the following separation problem: Consider an integer program
\[ \min \{ c^T x : Ax \leq b, x \geq 0, x \mbox{ integer} \} \]
and a fractional solution \(x^*\) of its LP relaxation. Find a weightvector \(u\) whose entries \(u_i\) are either 0 or \(\frac{1}{2}\) such that the following inequality is valid for all integral solutions and violated by \(x^*\):
\[ \lfloor(u^T A) x \rfloor \leq \lfloor u^T b\rfloor \]
References:
- Alberto Caprara, Matteo Fischetti. {0,1/2}-Chvatal-Gomory cuts. Math. Programming, Volume 74, p221–235, 1996.
- Arie M. C. A. Koster, Adrian Zymolka and Manuel Kutschka.
Algorithms to separate {0,1/2}-Chvatal-Gomory cuts. Algorithms - ESA 2007: 15th Annual European Symposium, Eilat, Israel, October 8-10, 2007,
Proceedings. Lecture Notes in Computer Science, Volume 4698, p. 693–704, 2007. - Arie M. C. A. Koster, Adrian Zymolka and Manuel Kutschka.
Algorithms to separate {0,1/2}-Chvatal-Gomory cuts (Extended Version).
ZIB Report 07-10, Zuse Institute Berlin, 2007. http://www.zib.de/Publications/Reports/ZR-07-10.pdf - Manuel Kutschka. Algorithmen zur Separierung von {0,1/2}-Schnitten. Diplomarbeit. Technische Universitaet Berlin, 2007.
Definition in file zerohalf_selector.c.
#include "string.h"#include "scip/sepa_zerohalf.h"#include "scip/cutsel_hybrid.h"#include "gcg/zerohalf_selector.h"#include "gcg/gcg.h"Go to the source code of this file.
Data Structures | |
| struct | TransIntRow |
| struct | Mod2Row |
| struct | Mod2Col |
| struct | Mod2Matrix |
Macros | |
| #define | MAXDNOM 1000LL |
| #define | MAXSCALE 1000.0 |
| #define | MAXREDUCTIONROUNDS 100 |
| #define | BOUNDSWITCH 0.5 |
| #define | MAXAGGRLEN(nvars) ((int)(0.1*(nvars)+1000)) |
| #define | ROWIND_TYPE unsigned int |
| #define | ORIG_RHS 0u |
| #define | ORIG_LHS 1u |
| #define | TRANSROW 2u |
| #define | UNIQUE_INDEX(rowind) (3*(rowind).index + (rowind).type) |
| #define | COLINFO_GET_MOD2COL(x) ((MOD2_COL*) (((uintptr_t)(x)) & ~((uintptr_t)1))) |
| #define | COLINFO_GET_RHSOFFSET(x) ((int) (((uintptr_t)(x)) & ((uintptr_t)1))) |
| #define | COLINFO_CREATE(mod2col, rhsoffset) ((void*) (((uintptr_t)(mod2col)) | ((uintptr_t)(rhsoffset)))) |
| #define | NONZERO(x) (COPYSIGN(1e-100, (x)) + (x)) |
Typedefs | |
| typedef struct Mod2Col | MOD2_COL |
| typedef struct Mod2Row | MOD2_ROW |
| typedef struct Mod2Matrix | MOD2_MATRIX |
| typedef struct TransIntRow | TRANSINTROW |
Macro Definition Documentation
◆ MAXDNOM
| #define MAXDNOM 1000LL |
Definition at line 68 of file zerohalf_selector.c.
◆ MAXSCALE
| #define MAXSCALE 1000.0 |
Definition at line 69 of file zerohalf_selector.c.
◆ MAXREDUCTIONROUNDS
| #define MAXREDUCTIONROUNDS 100 |
maximum number of rounds to perform reductions on the mod 2 system
Definition at line 72 of file zerohalf_selector.c.
◆ BOUNDSWITCH
| #define BOUNDSWITCH 0.5 |
threshold for bound switching
Definition at line 73 of file zerohalf_selector.c.
◆ MAXAGGRLEN
| #define MAXAGGRLEN | ( | nvars | ) | ((int)(0.1*(nvars)+1000)) |
Definition at line 74 of file zerohalf_selector.c.
◆ ROWIND_TYPE
| #define ROWIND_TYPE unsigned int |
enum for different types of row indices in ROWINDEX structure
Definition at line 84 of file zerohalf_selector.c.
◆ ORIG_RHS
| #define ORIG_RHS 0u |
Definition at line 85 of file zerohalf_selector.c.
◆ ORIG_LHS
| #define ORIG_LHS 1u |
Definition at line 86 of file zerohalf_selector.c.
◆ TRANSROW
| #define TRANSROW 2u |
Definition at line 87 of file zerohalf_selector.c.
◆ UNIQUE_INDEX
| #define UNIQUE_INDEX | ( | rowind | ) | (3*(rowind).index + (rowind).type) |
Definition at line 90 of file zerohalf_selector.c.
◆ COLINFO_GET_MOD2COL
Definition at line 223 of file zerohalf_selector.c.
◆ COLINFO_GET_RHSOFFSET
Definition at line 224 of file zerohalf_selector.c.
◆ COLINFO_CREATE
| #define COLINFO_CREATE | ( | mod2col, | |
| rhsoffset | |||
| ) | ((void*) (((uintptr_t)(mod2col)) | ((uintptr_t)(rhsoffset)))) |
Definition at line 225 of file zerohalf_selector.c.
◆ NONZERO
Definition at line 1519 of file zerohalf_selector.c.
Typedef Documentation
◆ MOD2_COL
Definition at line 76 of file zerohalf_selector.c.
◆ MOD2_ROW
Definition at line 77 of file zerohalf_selector.c.
◆ MOD2_MATRIX
| typedef struct Mod2Matrix MOD2_MATRIX |
Definition at line 78 of file zerohalf_selector.c.
◆ TRANSINTROW
| typedef struct TransIntRow TRANSINTROW |
Definition at line 79 of file zerohalf_selector.c.
Function Documentation
◆ GCGcreateCutIndicesFromRowindex()
| SCIP_RETCODE GCGcreateCutIndicesFromRowindex | ( | SCIP * | scip, |
| GCG_CUTINDICES ** | cutindices, | ||
| int | nindices, | ||
| ROWINDEX * | rowindex | ||
| ) |
data of separator create an instance of cut indices
- Parameters
-
scip SCIP data structure (master problem) cutindices pointer to store cutindices nindices number of indices rowindex indices
Definition at line 154 of file zerohalf_selector.c.
References RowIndex::index, NULL, SCIP_CALL, SCIP_OKAY, SCIPallocBuffer, and SCIPallocBufferArray.
Referenced by GCGselectConstraintsZeroHalf(), and mod2matrixPreprocessRows().
◆ GCGcreateCutIndicesFromArray()
| SCIP_RETCODE GCGcreateCutIndicesFromArray | ( | SCIP * | scip, |
| GCG_CUTINDICES ** | cutindices, | ||
| int | nindices, | ||
| int * | indices | ||
| ) |
create an instance of cut indices
- Parameters
-
scip SCIP data structure (master problem) cutindices pointer to store cutindices nindices number of indices indices indices
Definition at line 181 of file zerohalf_selector.c.
References NULL, SCIP_CALL, SCIP_OKAY, and SCIPallocBuffer.
Referenced by selectConstraintsEnumerate(), and selectConstraintsRandom().
◆ GCGfreeCutIndices()
| SCIP_RETCODE GCGfreeCutIndices | ( | SCIP * | scip, |
| GCG_CUTINDICES ** | cutindices | ||
| ) |
free an instance of cut indices
- Parameters
-
scip SCIP data structure (master problem) cutindices pointer to cutindices
Definition at line 200 of file zerohalf_selector.c.
References NULL, SCIP_OKAY, SCIPfreeBuffer, and SCIPfreeBufferArray.
Referenced by SCIP_DECL_SEPAEXECLP().
◆ checkRow()
|
static |
Definition at line 230 of file zerohalf_selector.c.
References Mod2Col::index, MAX, Mod2Row::maxsolval, Mod2Row::nnonzcols, Mod2Row::nonzcols, SCIP_Real, and Mod2Col::solval.
Referenced by mod2MatrixAddOrigRow(), mod2MatrixAddTransRow(), mod2matrixPreprocessColumns(), mod2matrixPreprocessRows(), mod2matrixRemoveRow(), and mod2rowAddRow().
◆ SCIP_DECL_SORTPTRCOMP() [1/2]
|
static |
compare to mod 2 columns by there index
Definition at line 252 of file zerohalf_selector.c.
References Mod2Col::index.
◆ SCIP_DECL_SORTPTRCOMP() [2/2]
|
static |
comparison function for slack of mod 2 rows
Definition at line 270 of file zerohalf_selector.c.
References EPSZ, Mod2Row::maxsolval, Mod2Row::nnonzcols, SCIP_Bool, SCIP_DEFAULT_EPSILON, and Mod2Row::slack.
◆ mod2()
take integral real value modulo 2
- Parameters
-
scip scip data structure val value to take mod 2
Definition at line 308 of file zerohalf_selector.c.
References REALABS, SCIPisFeasIntegral(), and SCIPround().
Referenced by buildMod2Matrix(), mod2MatrixAddOrigRow(), and mod2MatrixAddTransRow().
◆ getIntegralScalar()
|
static |
returns the integral value for the given scaling parameters, see SCIPcalcIntegralScalar()
- Parameters
-
val value that should be scaled to an integral value scalar scalar that should be tried mindelta minimal relative allowed difference of scaled coefficient s*c and integral i maxdelta maximal relative allowed difference of scaled coefficient s*c and integral i sval pointer to store the scaled value intval pointer to store the scaled integral value
Definition at line 320 of file zerohalf_selector.c.
References SCIP_Real, and SCIPrelDiff().
Referenced by transformNonIntegralRow().
◆ transformNonIntegralRow()
|
static |
Tries to transform a non-integral row into an integral row that can be used in zerohalf separation
- Parameters
-
scip scip data structure sol solution to separate, or NULL for LP solution allowlocal should local cuts be allowed maxslack maximum slack allowed for transformed row sign +1 or -1 scale to select the side of the row local is the row only valid locally? rank rank of row rowlen length of row rowvals coefficients of columns in row rowcols columns of row rhs right hand side of row intvarpos clean buffer array of size SCIPgetNVars that will be clean when the function returns introw pointer to return transformed row success pointer to return whether the transformation succeeded
Definition at line 352 of file zerohalf_selector.c.
References FALSE, getIntegralScalar(), TransIntRow::len, TransIntRow::local, MAXDNOM, MAXSCALE, NULL, TransIntRow::rank, REALABS, TransIntRow::rhs, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPallocBlockMemoryArray, SCIPcalcIntegralScalar(), SCIPcolGetVar(), SCIPcolGetVarProbindex(), SCIPcolIsIntegral(), SCIPcutsTightenCoefficients(), SCIPepsilon(), SCIPfeasFloor(), SCIPfreeBlockMemoryArray, SCIPgetSolVal(), SCIPgetVarClosestVlb(), SCIPgetVarClosestVub(), SCIPgetVars(), SCIPisEQ(), SCIPisGT(), SCIPisInfinity(), SCIPisLT(), SCIPisSumEQ(), SCIPisSumGT(), SCIPisSumLT(), SCIPisZero(), SCIPsumepsilon(), SCIPvarGetLbGlobal(), SCIPvarGetLbLocal(), SCIPvarGetProbindex(), SCIPvarGetUbGlobal(), SCIPvarGetUbLocal(), SCIPvarGetVlbCoefs(), SCIPvarGetVlbConstants(), SCIPvarGetVlbVars(), SCIPvarGetVubCoefs(), SCIPvarGetVubConstants(), SCIPvarGetVubVars(), TransIntRow::size, TransIntRow::slack, TRUE, TransIntRow::vals, and TransIntRow::varinds.
Referenced by mod2MatrixTransformContRows().
◆ mod2MatrixTransformContRows()
|
static |
Tries to transform non-integral rows into an integral form by using simple and variable bounds
- Parameters
-
gcg GCG data structure sol solution to separate, or NULL for LP solution zhdata zerohalf separator data mod2matrix mod2 matrix structure allowlocal should local cuts be allowed maxslack maximum slack allowed for mod 2 rows
Definition at line 642 of file zerohalf_selector.c.
References GCG_ZeroHalfData::densityoffset, GCGgetMasterprob(), GCG_ZeroHalfData::masterconss, GCG_ZeroHalfData::maxrowdensity, GCG_ZeroHalfData::nmasterconss, Mod2Matrix::ntransintrows, NULL, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPallocBlockMemoryArray, SCIPallocBufferArray, SCIPallocCleanBufferArray, SCIPconsGetRow(), SCIPfreeBufferArray, SCIPfreeCleanBufferArray, SCIPgetNLPCols(), SCIPgetNVars(), SCIPgetRowSolActivity(), SCIPinfinity(), SCIPisInfinity(), SCIProwGetCols(), SCIProwGetConstant(), SCIProwGetLhs(), SCIProwGetNLPNonz(), SCIProwGetNNonz(), SCIProwGetRank(), SCIProwGetRhs(), SCIProwGetVals(), SCIProwIsIntegral(), SCIProwIsLocal(), transformNonIntegralRow(), and Mod2Matrix::transintrows.
Referenced by buildMod2Matrix().
◆ mod2MatrixAddCol()
|
static |
adds new column to the mod 2 matrix
- Parameters
-
scip SCIP datastructure mod2matrix mod 2 matrix origvar2col hash map for mapping of problem variables to mod 2 columns origvar problem variable to create mod 2 column for solval solution value of problem variable rhsoffset offset in right hand side due complementation (mod 2)
Definition at line 757 of file zerohalf_selector.c.
References COLINFO_CREATE, Mod2Matrix::cols, Mod2Matrix::colssize, Mod2Col::index, Mod2Matrix::ncols, Mod2Col::nonzrows, Mod2Col::pos, SCIP_CALL, SCIP_OKAY, SCIPallocBlockMemory, SCIPblkmem(), SCIPensureBlockMemoryArray, SCIPhashmapInsert(), SCIPhashsetCreate(), SCIPvarGetProbindex(), and Mod2Col::solval.
Referenced by buildMod2Matrix().
◆ mod2colLinkRow()
|
static |
links row to mod 2 column
- Parameters
-
blkmem block memory shell col mod 2 column row mod 2 row
Definition at line 790 of file zerohalf_selector.c.
References MAX, Mod2Row::maxsolval, Mod2Col::nonzrows, SCIP_CALL, SCIP_OKAY, SCIPhashsetExists(), SCIPhashsetInsert(), and Mod2Col::solval.
Referenced by mod2MatrixAddOrigRow(), mod2MatrixAddTransRow(), and mod2rowAddRow().
◆ mod2colUnlinkRow()
|
static |
unlinks row from mod 2 column
- Parameters
-
col mod 2 column row mod 2 row
Definition at line 807 of file zerohalf_selector.c.
References Mod2Col::nonzrows, SCIP_CALL, SCIP_OKAY, SCIPhashsetExists(), SCIPhashsetGetNSlots(), SCIPhashsetGetSlots(), and SCIPhashsetRemove().
Referenced by mod2matrixRemoveRow(), and mod2rowAddRow().
◆ mod2rowUnlinkCol()
unlinks row from mod 2 column
- Parameters
-
row mod 2 row col mod 2 column
Definition at line 833 of file zerohalf_selector.c.
References BMSmoveMemoryArray, MAX, Mod2Row::maxsolval, Mod2Row::nnonzcols, Mod2Row::nonzcols, NULL, SCIP_UNUSED, SCIPsortedvecFindPtr(), and Mod2Col::solval.
Referenced by mod2matrixRemoveCol().
◆ mod2MatrixAddOrigRow()
|
static |
adds a SCIP_ROW to the mod 2 matrix
- Parameters
-
scip scip data structure blkmem block memory shell mod2matrix modulo 2 matrix origcol2col hashmap to retrieve the mod 2 column from a SCIP_COL origrow original SCIP row slack slack of row side side of row that is used for mod 2 row, must be ORIG_RHS or ORIG_LHS rhsmod2 modulo 2 value of the row's right hand side
Definition at line 860 of file zerohalf_selector.c.
References BMSallocBlockMemory, checkRow(), COLINFO_GET_MOD2COL, COLINFO_GET_RHSOFFSET, Mod2Row::index, RowIndex::index, MAX, Mod2Row::maxsolval, mod2(), mod2colLinkRow(), Mod2Row::nnonzcols, Mod2Row::nonzcols, Mod2Row::nonzcolssize, Mod2Row::nrowinds, Mod2Matrix::nrows, NULL, Mod2Matrix::nzeroslackrows, Mod2Row::rhs, Mod2Row::rowinds, Mod2Row::rowindssize, Mod2Matrix::rows, Mod2Matrix::rowssize, SCIP_ALLOC, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPcolGetVar(), SCIPensureBlockMemoryArray, SCIPhashmapGetImage(), SCIPisZero(), SCIProwGetCols(), SCIProwGetLPPos(), SCIProwGetNNonz(), SCIProwGetVals(), SCIPsortPtr(), Mod2Row::slack, and RowIndex::type.
Referenced by buildMod2Matrix().
◆ mod2MatrixAddTransRow()
|
static |
adds a transformed integral row to the mod 2 matrix
- Parameters
-
scip scip data structure mod2matrix modulo 2 matrix origcol2col hashmap to retrieve the mod 2 column from a SCIP_COL transrowind index to transformed int row
Definition at line 945 of file zerohalf_selector.c.
References checkRow(), COLINFO_GET_MOD2COL, COLINFO_GET_RHSOFFSET, Mod2Row::index, RowIndex::index, TransIntRow::len, MAX, Mod2Row::maxsolval, mod2(), mod2colLinkRow(), Mod2Row::nnonzcols, Mod2Row::nonzcols, Mod2Row::nonzcolssize, Mod2Row::nrowinds, Mod2Matrix::nrows, NULL, Mod2Matrix::nzeroslackrows, Mod2Row::rhs, TransIntRow::rhs, Mod2Row::rowinds, Mod2Row::rowindssize, Mod2Matrix::rows, Mod2Matrix::rowssize, SCIP_CALL, SCIP_OKAY, SCIPallocBlockMemory, SCIPblkmem(), SCIPensureBlockMemoryArray, SCIPgetVars(), SCIPhashmapGetImage(), SCIPisZero(), SCIPsortPtr(), Mod2Row::slack, TransIntRow::slack, Mod2Matrix::transintrows, TRANSROW, RowIndex::type, TransIntRow::vals, and TransIntRow::varinds.
Referenced by buildMod2Matrix().
◆ destroyMod2Matrix()
|
static |
free all resources held by the mod 2 matrix
- Parameters
-
gcg GCG data structure mod2matrix pointer to mod2 matrix structure
Definition at line 1026 of file zerohalf_selector.c.
References Mod2Matrix::cols, Mod2Matrix::colssize, GCGgetMasterprob(), GCGgetNMasterConss(), Mod2Matrix::ncols, Mod2Row::nonzcols, Mod2Row::nonzcolssize, Mod2Col::nonzrows, Mod2Matrix::nrows, Mod2Matrix::ntransintrows, Mod2Row::rowinds, Mod2Row::rowindssize, Mod2Matrix::rows, Mod2Matrix::rowssize, SCIPblkmem(), SCIPfreeBlockMemory, SCIPfreeBlockMemoryArray, SCIPfreeBlockMemoryArrayNull, SCIPhashsetFree(), TransIntRow::size, Mod2Matrix::transintrows, TransIntRow::vals, and TransIntRow::varinds.
Referenced by GCGselectConstraintsZeroHalf().
◆ buildMod2Matrix()
|
static |
build the modulo 2 matrix from all integral rows in the LP, and non-integral rows if the transformation to an integral row succeeds
- Parameters
-
gcg GCG data structure sol solution to separate, or NULL for LP solution zhdata zerohalf separator data blkmem block memory shell mod2matrix mod 2 matrix allowlocal should local cuts be allowed maxslack maximum slack allowed for mod 2 rows
Definition at line 1065 of file zerohalf_selector.c.
References BOUNDSWITCH, COLINFO_CREATE, Mod2Matrix::cols, Mod2Matrix::colssize, GCG_ZeroHalfData::densityoffset, FALSE, GCGgetMasterprob(), GCG_ZeroHalfData::masterconss, MAX, GCG_ZeroHalfData::maxrowdensity, mod2(), mod2MatrixAddCol(), mod2MatrixAddOrigRow(), mod2MatrixAddTransRow(), mod2MatrixTransformContRows(), Mod2Matrix::ncols, GCG_ZeroHalfData::nmasterconss, Mod2Matrix::nrows, Mod2Matrix::ntransintrows, NULL, Mod2Matrix::nzeroslackrows, ORIG_LHS, ORIG_RHS, Mod2Matrix::rows, Mod2Matrix::rowssize, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPallocBufferArray, SCIPblkmem(), SCIPconsGetRow(), SCIPfeasCeil(), SCIPfeasFloor(), SCIPfreeBufferArray, SCIPgetLPColsData(), SCIPgetNContVars(), SCIPgetNLPCols(), SCIPgetNVars(), SCIPgetRowSolActivity(), SCIPgetSolVal(), SCIPgetVars(), SCIPhashmapCreate(), SCIPhashmapFree(), SCIPhashmapInsert(), SCIPinfinity(), SCIPisEQ(), SCIPisInfinity(), SCIPisLT(), SCIPisZero(), SCIProwGetConstant(), SCIProwGetLhs(), SCIProwGetNNonz(), SCIProwGetRhs(), SCIProwIsIntegral(), SCIProwIsLocal(), SCIPvarGetLbGlobal(), SCIPvarGetLbLocal(), SCIPvarGetUbGlobal(), SCIPvarGetUbLocal(), and TRUE.
Referenced by GCGselectConstraintsZeroHalf().
◆ SCIP_DECL_HASHKEYEQ() [1/2]
|
static |
Definition at line 1267 of file zerohalf_selector.c.
References FALSE, Mod2Col::nonzrows, NULL, SCIPhashsetExists(), SCIPhashsetGetNElements(), SCIPhashsetGetNSlots(), SCIPhashsetGetSlots(), and TRUE.
◆ SCIP_DECL_HASHKEYVAL() [1/2]
|
static |
Definition at line 1294 of file zerohalf_selector.c.
References Mod2Col::nonzrows, NULL, SCIPhashsetGetNSlots(), SCIPhashsetGetSlots(), and SCIPhashSignature64.
◆ SCIP_DECL_HASHKEYEQ() [2/2]
|
static |
Definition at line 1319 of file zerohalf_selector.c.
References FALSE, Mod2Row::nnonzcols, Mod2Row::nonzcols, NULL, Mod2Row::rhs, and TRUE.
◆ SCIP_DECL_HASHKEYVAL() [2/2]
|
static |
Definition at line 1347 of file zerohalf_selector.c.
References Mod2Col::index, Mod2Row::nnonzcols, Mod2Row::nonzcols, NULL, Mod2Row::rhs, and SCIPhashSignature64.
◆ mod2matrixRemoveRow()
|
static |
removes a row from the mod 2 matrix
- Parameters
-
scip scip data structure mod2matrix the mod 2 matrix row mod 2 row
Definition at line 1366 of file zerohalf_selector.c.
References checkRow(), mod2colUnlinkRow(), Mod2Row::nnonzcols, Mod2Row::nonzcols, Mod2Row::nonzcolssize, Mod2Matrix::nrows, Mod2Matrix::nzeroslackrows, Mod2Row::pos, Mod2Row::rowinds, Mod2Row::rowindssize, Mod2Matrix::rows, SCIP_CALL, SCIP_OKAY, SCIPfreeBlockMemory, SCIPfreeBlockMemoryArray, SCIPfreeBlockMemoryArrayNull, SCIPisZero(), and Mod2Row::slack.
Referenced by mod2matrixPreprocessRows().
◆ mod2matrixRemoveCol()
|
static |
removes a column from the mod 2 matrix
- Parameters
-
scip scip data structure mod2matrix the mod 2 matrix col a column in the mod 2 matrix
Definition at line 1402 of file zerohalf_selector.c.
References Mod2Matrix::cols, mod2rowUnlinkCol(), Mod2Matrix::ncols, Mod2Col::nonzrows, NULL, Mod2Col::pos, SCIPblkmem(), SCIPfreeBlockMemory, SCIPhashsetFree(), SCIPhashsetGetNSlots(), and SCIPhashsetGetSlots().
Referenced by GCGselectConstraintsZeroHalf(), and mod2matrixPreprocessColumns().
◆ mod2matrixPreprocessColumns()
|
static |
- Parameters
-
scip scip data structure mod2matrix mod 2 matrix
Definition at line 1442 of file zerohalf_selector.c.
References checkRow(), Mod2Matrix::cols, mod2matrixRemoveCol(), Mod2Matrix::ncols, Mod2Col::nonzrows, GCG_ZeroHalfData::nreductions, NULL, Mod2Matrix::nzeroslackrows, SCIP_CALL, SCIP_OKAY, SCIPblkmem(), SCIPhashsetGetNElements(), SCIPhashsetGetSlots(), SCIPhashtableCreate(), SCIPhashtableFree(), SCIPhashtableInsert(), SCIPhashtableRetrieve(), SCIPisZero(), Mod2Row::slack, and Mod2Col::solval.
Referenced by GCGselectConstraintsZeroHalf().
◆ computeMaxViolation()
computes maximal violation that can be achieved for zerohalf cuts where this row particiaptes
- Parameters
-
row mod 2 row
Definition at line 1523 of file zerohalf_selector.c.
References SCIP_Real, and Mod2Row::slack.
Referenced by GCGselectConstraintsZeroHalf(), and mod2matrixPreprocessRows().
◆ mod2matrixPreprocessRows()
|
static |
remove rows that are (a) zero (b) identical to other rows (keep the one with smallest slack) (c) have slack greater than 1 (d) for zero rows with 1 as rhs and slack less than 1, we can directly generate a cut and remove the row (Lemma 4)
- Parameters
-
scip scip data structure sol solution to separate, or NULL for LP solution mod2matrix the mod 2 matrix allowlocal should local cuts be allowed
Definition at line 1539 of file zerohalf_selector.c.
References checkRow(), computeMaxViolation(), GCGcreateCutIndicesFromRowindex(), GCG_ZeroHalfData::infeasible, GCG_ZeroHalfData::minviol, mod2matrixRemoveRow(), Mod2Row::nnonzcols, Mod2Row::nonzcols, GCG_ZeroHalfData::nreductions, Mod2Row::nrowinds, Mod2Matrix::nrows, NULL, Mod2Row::pos, Mod2Row::rhs, Mod2Row::rowinds, Mod2Matrix::rows, SCIP_CALL, SCIP_OKAY, SCIPblkmem(), SCIPhashtableCreate(), SCIPhashtableExists(), SCIPhashtableFree(), SCIPhashtableInsert(), SCIPhashtableRemove(), SCIPhashtableRetrieve(), SCIPisLT(), SCIPswapInts(), SCIPswapPointers(), and Mod2Row::slack.
Referenced by GCGselectConstraintsZeroHalf().
◆ mod2rowAddRow()
|
static |
add a mod2 row to another one
- Parameters
-
gcg GCG data structure blkmem block memory shell mod2matrix mod 2 matrix row mod 2 row rowtoadd mod 2 row that is added to the other mod 2 row
Definition at line 1642 of file zerohalf_selector.c.
References BMScopyMemoryArray, checkRow(), GCGgetMasterprob(), GCGgetNMasterConss(), Mod2Col::index, MAX, Mod2Row::maxsolval, mod2colLinkRow(), mod2colUnlinkRow(), Mod2Row::nnonzcols, Mod2Row::nonzcols, Mod2Row::nonzcolssize, Mod2Row::nrowinds, Mod2Matrix::ntransintrows, NULL, Mod2Matrix::nzeroslackrows, Mod2Row::rhs, Mod2Row::rowinds, Mod2Row::rowindssize, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIP_Shortbool, SCIPallocBufferArray, SCIPallocCleanBufferArray, SCIPblkmem(), SCIPensureBlockMemoryArray, SCIPfreeBufferArray, SCIPfreeCleanBufferArray, SCIPisZero(), Mod2Row::slack, Mod2Col::solval, and UNIQUE_INDEX.
Referenced by GCGselectConstraintsZeroHalf().
◆ GCGselectConstraintsZeroHalf()
| 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 | ||
| ) |
perform the zerohalf cut separation
Definition at line 1788 of file zerohalf_selector.c.
References buildMod2Matrix(), computeMaxViolation(), destroyMod2Matrix(), FALSE, GCGcreateCutIndicesFromRowindex(), GCGgetMasterprob(), GCG_ZeroHalfData::infeasible, MAXREDUCTIONROUNDS, GCG_ZeroHalfData::maxslack, GCG_ZeroHalfData::maxslackroot, Mod2Row::maxsolval, GCG_ZeroHalfData::minviol, mod2matrixPreprocessColumns(), mod2matrixPreprocessRows(), mod2matrixRemoveCol(), mod2rowAddRow(), Mod2Matrix::ncols, Mod2Row::nnonzcols, Mod2Row::nonzcols, Mod2Col::nonzrows, GCG_ZeroHalfData::nreductions, Mod2Row::nrowinds, Mod2Matrix::nrows, NULL, Mod2Matrix::nzeroslackrows, Mod2Row::rhs, Mod2Row::rowinds, Mod2Matrix::rows, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPallocBufferArray, SCIPblkmem(), SCIPdebugMsg, SCIPfeastol(), SCIPfreeBufferArray, SCIPhashsetGetNSlots(), SCIPhashsetGetSlots(), SCIPisPositive(), SCIPselectPtr(), SCIPsortPtr(), Mod2Row::slack, and Mod2Col::solval.
Referenced by selectConstraintsZerohalf().