cuts.h
Go to the documentation of this file.
33/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
57/** perform activity based coefficient tigthening on the given cut; returns TRUE if the cut was detected
68 int* cutinds, /**< array of the problem indices of variables with a non-zero coefficient in the cut */
75 * @note By default, this data structure uses quad precision via double-double arithmetic, i.e., it allocates a
76 * SCIP_Real array of length two times SCIPgetNVars() for storing the coefficients. In exact solving mode, we
77 * cannot use quad precision because we need to control the ronding mode, hence only the first SCIPgetNVars()
120 * @note this method is the variant of SCIPaggrRowAddRow that is safe to use in exact solving mode
132/** Removes a given variable @p var from position @p pos the aggregation row and updates the right-hand side according
133 * to sign of the coefficient, i.e., rhs -= coef * bound, where bound = lb if coef >= 0 and bound = ub, otherwise.
135 * @note: The choice of global or local bounds depend on the validity (global or local) of the aggregation row.
137 * @note: The list of non-zero indices will be updated by swapping the last non-zero index to @p pos.
148/** add the objective function with right-hand side @p rhs and scaled by @p scale to the aggregation row */
157/** add the objective function with right-hand side @p rhs and scaled by @p scale to the aggregation row
181/** calculates the efficacy norm of the given aggregation row, which depends on the "separating/efficacynorm" parameter
183 * @return the efficacy norm of the given aggregation row, which depends on the "separating/efficacynorm" parameter
203/** aggregate rows using the given weights; the current content of the aggregation row, \p aggrrow, is overwritten
216 int negslack, /**< should negative slack variables be used? (0: no, 1: only for integral rows, 2: yes) */
255 SCIP_Real* minabsrowweight, /**< pointer to store smallest absolute value of weights used for aggregating rows */
256 SCIP_Real* maxabsrowweight /**< pointer to store largest absolute value of weights used for aggregating rows */
259/** gets the array of corresponding variable problem indices for each non-zero in the aggregation row */
334 * aggregation row must not contain non-zero weights for modifiable rows, because these rows cannot
337 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
350 SCIP_Real boundswitch, /**< fraction of domain up to which lower bound is used in transformation */
355 SCIP_Bool allowlocal, /**< should local information allowed to be used, resulting in a local cut? */
356 SCIP_Bool fixintegralrhs, /**< should complementation tried to be adjusted such that rhs gets fractional? */
357 int* boundsfortrans, /**< bounds that should be used for transformed variables: vlb_idx/vub_idx,
360 SCIP_BOUNDTYPE* boundtypesfortrans, /**< type of bounds that should be used for transformed variables;
368 int* cutinds, /**< array to store the problem indices of variables with a non-zero coefficient in the cut */
373 SCIP_Bool* success /**< pointer to store whether the returned coefficients are a valid MIR cut */
377 * aggregation row must not contain non-zero weights for modifiable rows, because these rows cannot
378 * participate in an MIR cut. The function uses a cut generation heuristic which tries different scaling
385 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
398 SCIP_Real boundswitch, /**< fraction of domain up to which lower bound is used in transformation */
403 SCIP_Bool allowlocal, /**< should local information allowed to be used, resulting in a local cut? */
405 int* boundsfortrans, /**< bounds that should be used for transformed variables: vlb_idx/vub_idx,
408 SCIP_BOUNDTYPE* boundtypesfortrans, /**< type of bounds that should be used for transformed variables;
415 int* cutinds, /**< array to store the problem indices of variables with a non-zero coefficient in the cut */
417 SCIP_Real* cutefficacy, /**< pointer to store efficacy of best cut; only cuts that are strictly better than the value of
424/** calculates a lifted simple generalized flow cover cut out of the weighted sum of LP rows given by an aggregation row; the
425 * aggregation row must not contain non-zero weights for modifiable rows, because these rows cannot
429 * Gu, Z., Nemhauser, G. L., & Savelsbergh, M. W. (1999). Lifted flow cover inequalities for mixed 0-1 integer programs.
432 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
445 SCIP_Real boundswitch, /**< fraction of domain up to which lower bound is used in transformation */
446 SCIP_Bool allowlocal, /**< should local information allowed to be used, resulting in a local cut? */
450 int* cutinds, /**< array to store the problem indices of variables with a non-zero coefficient in the cut */
459/** calculates a lifted knapsack cover cut out of the weighted sum of LP rows given by an aggregation row; the
460 * aggregation row must not contain non-zero weights for modifiable rows, because these rows cannot
464 * Letchford, A. N., & Souli, G. (2019). On lifted cover inequalities: A new lifting procedure with unusual properties.
467 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
479 SCIP_Bool allowlocal, /**< should local information allowed to be used, resulting in a local cut? */
483 int* cutinds, /**< array to store the problem indices of variables with a non-zero coefficient in the cut */
491/** calculates a strong CG cut out of the weighted sum of LP rows given by an aggregation row; the
492 * aggregation row must not contain non-zero weights for modifiable rows, because these rows cannot
495 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
508 SCIP_Real boundswitch, /**< fraction of domain up to which lower bound is used in transformation */
513 SCIP_Bool allowlocal, /**< should local information allowed to be used, resulting in a local cut? */
520 int* cutinds, /**< array to store the problem indices of variables with a non-zero coefficient in the cut */
534/** creates a cut generation result structure and allocates arrays for cut coefficients and indices
536 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
552/** tries multiple cut generation methods on an aggregation row and returns the best cut by efficacy
559 * Use SCIPcreateCutGenResult() to create the result structure, or manually set result->cutcoefs and result->cutinds
563 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
574 SCIP_CUTGENMETHOD methods, /**< bit field indicating which methods to try (SCIP_CUTGENMETHOD_*) */
576 SCIP_CUTGENRESULT* result /**< pointer to result structure (cutcoefs and cutinds pre-allocated) */
common defines and data types used in all packages of SCIP
void SCIPaggrRowGetAbsWeightRange(SCIP_AGGRROW *aggrrow, SCIP_Real *minabsrowweight, SCIP_Real *maxabsrowweight)
void SCIPaggrRowCancelVarWithBound(SCIP *scip, SCIP_AGGRROW *aggrrow, SCIP_VAR *var, int pos, SCIP_Bool *valid)
Definition: cuts.c:3019
SCIP_Bool SCIPaggrRowHasRowBeenAdded(SCIP_AGGRROW *aggrrow, SCIP_ROW *row)
Definition: cuts.c:4016
SCIP_RETCODE SCIPcutGenerationHeuristicCMIR(SCIP *scip, SCIP_SOL *sol, SCIP_Bool postprocess, SCIP_Real boundswitch, int vartypeusevbds, SCIP_Bool allowlocal, int maxtestdelta, int *boundsfortrans, SCIP_BOUNDTYPE *boundtypesfortrans, SCIP_Real minfrac, SCIP_Real maxfrac, SCIP_AGGRROW *aggrrow, SCIP_Real *cutcoefs, SCIP_Real *cutrhs, int *cutinds, int *cutnnz, SCIP_Real *cutefficacy, int *cutrank, SCIP_Bool *cutislocal, SCIP_Bool *success)
Definition: cuts.c:8350
SCIP_RETCODE SCIPcalcMIR(SCIP *scip, SCIP_SOL *sol, SCIP_Bool postprocess, SCIP_Real boundswitch, int vartypeusevbds, SCIP_Bool allowlocal, SCIP_Bool fixintegralrhs, int *boundsfortrans, SCIP_BOUNDTYPE *boundtypesfortrans, SCIP_Real minfrac, SCIP_Real maxfrac, SCIP_Real scale, SCIP_AGGRROW *aggrrow, SCIP_Real *cutcoefs, SCIP_Real *cutrhs, int *cutinds, int *cutnnz, SCIP_Real *cutefficacy, int *cutrank, SCIP_Bool *cutislocal, SCIP_Bool *success)
Definition: cuts.c:7934
SCIP_Bool SCIPcutsTightenCoefficients(SCIP *scip, SCIP_Bool cutislocal, SCIP_Real *cutcoefs, SCIP_Real *cutrhs, int *cutinds, int *cutnnz, int *nchgcoefs)
Definition: cuts.c:2477
SCIP_RETCODE SCIPaggrRowCreate(SCIP *scip, SCIP_AGGRROW **aggrrow)
Definition: cuts.c:2679
SCIP_RETCODE SCIPaggrRowAddRowSafely(SCIP *scip, SCIP_AGGRROW *aggrrow, SCIP_ROW *row, SCIP_Real weight, int sidetype, SCIP_Bool *success)
Definition: cuts.c:2898
SCIP_RETCODE SCIPcalcKnapsackCover(SCIP *scip, SCIP_SOL *sol, SCIP_Bool allowlocal, SCIP_AGGRROW *aggrrow, SCIP_Real *cutcoefs, SCIP_Real *cutrhs, int *cutinds, int *cutnnz, SCIP_Real *cutefficacy, int *cutrank, SCIP_Bool *cutislocal, SCIP_Bool *success)
Definition: cuts.c:12302
SCIP_RETCODE SCIPaggrRowAddObjectiveFunctionSafely(SCIP *scip, SCIP_AGGRROW *aggrrow, SCIP_Real rhs, SCIP_Real scale)
SCIP_RETCODE SCIPcreateCutGenResult(SCIP *scip, SCIP_CUTGENRESULT **result)
Definition: cuts.c:13665
SCIP_RETCODE SCIPaggrRowCopy(SCIP *scip, SCIP_AGGRROW **aggrrow, SCIP_AGGRROW *source)
Definition: cuts.c:2769
SCIP_RETCODE SCIPaggrRowAddCustomCons(SCIP *scip, SCIP_AGGRROW *aggrrow, int *inds, SCIP_Real *vals, int len, SCIP_Real rhs, SCIP_Real weight, int rank, SCIP_Bool local)
Definition: cuts.c:3154
SCIP_RETCODE SCIPcalcStrongCG(SCIP *scip, SCIP_SOL *sol, SCIP_Bool postprocess, SCIP_Real boundswitch, int vartypeusevbds, SCIP_Bool allowlocal, SCIP_Real minfrac, SCIP_Real maxfrac, SCIP_Real scale, SCIP_AGGRROW *aggrrow, SCIP_Real *cutcoefs, SCIP_Real *cutrhs, int *cutinds, int *cutnnz, SCIP_Real *cutefficacy, int *cutrank, SCIP_Bool *cutislocal, SCIP_Bool *success)
Definition: cuts.c:13313
static INLINE SCIP_Real SCIPaggrRowGetValue(SCIP_AGGRROW *aggrrow, int i)
Definition: cuts.h:273
void SCIPfreeCutGenResult(SCIP *scip, SCIP_CUTGENRESULT **result)
Definition: cuts.c:13685
SCIP_RETCODE SCIPcalcBestCut(SCIP *scip, SCIP_SOL *sol, SCIP_AGGRROW *aggrrow, SCIP_CUTGENMETHOD methods, SCIP_CUTGENPARAMS *params, SCIP_CUTGENRESULT *result)
Definition: cuts.c:13716
void SCIPaggrRowPrint(SCIP *scip, SCIP_AGGRROW *aggrrow, FILE *file)
Definition: cuts.c:2732
void SCIPaggrRowRemoveZeros(SCIP *scip, SCIP_AGGRROW *aggrrow, SCIP_Bool useglbbounds, SCIP_Bool *valid)
Definition: cuts.c:3960
SCIP_Real * SCIPaggrRowGetRowWeights(SCIP_AGGRROW *aggrrow)
Definition: cuts.c:4005
SCIP_RETCODE SCIPaggrRowAddRow(SCIP *scip, SCIP_AGGRROW *aggrrow, SCIP_ROW *row, SCIP_Real weight, int sidetype)
Definition: cuts.c:2815
static INLINE SCIP_Real SCIPaggrRowGetProbvarValue(SCIP_AGGRROW *aggrrow, int probindex)
Definition: cuts.h:297
SCIP_RETCODE SCIPaggrRowSumRows(SCIP *scip, SCIP_AGGRROW *aggrrow, SCIP_Real *weights, int *rowinds, int nrowinds, SCIP_Bool sidetypebasis, SCIP_Bool allowlocal, int negslack, int maxaggrlen, SCIP_Bool *valid)
Definition: cuts.c:3534
SCIP_RETCODE SCIPaggrRowAddObjectiveFunction(SCIP *scip, SCIP_AGGRROW *aggrrow, SCIP_Real rhs, SCIP_Real scale)
Definition: cuts.c:3078
static INLINE SCIP_Real SCIPaggrRowGetValueSafely(SCIP_AGGRROW *aggrrow, int i)
Definition: cuts.h:287
SCIP_RETCODE SCIPcalcFlowCover(SCIP *scip, SCIP_SOL *sol, SCIP_Bool postprocess, SCIP_Real boundswitch, SCIP_Bool allowlocal, SCIP_AGGRROW *aggrrow, SCIP_Real *cutcoefs, SCIP_Real *cutrhs, int *cutinds, int *cutnnz, SCIP_Real *cutefficacy, int *cutrank, SCIP_Bool *cutislocal, SCIP_Bool *success)
Definition: cuts.c:11656
SCIP_Real SCIPaggrRowCalcEfficacyNorm(SCIP *scip, SCIP_AGGRROW *aggrrow)
Definition: cuts.c:3254
Definition: multiprecision.hpp:66
Definition: struct_cuts.h:43
Definition: struct_cuts.h:60
Definition: struct_cuts.h:74
Definition: struct_lp.h:205
Definition: struct_sol.h:74
Definition: struct_var.h:262
Definition: struct_scip.h:72
struct definitions for cuts
type definitions for cuts
type definitions for LP management
type definitions for miscellaneous datastructures
type definitions for return codes for SCIP methods
type definitions for SCIP's main datastructure
type definitions for storing primal CIP solutions
type definitions for problem variables