flow cover and complemented mixed integer rounding cuts separator (Marchand's version)
For an overview see:
Marchand, H., & Wolsey, L. A. (2001).
Aggregation and mixed integer rounding to solve MIPs.
Operations research, 49(3), 363-371.
Some remarks:
Definition in file sepa_aggregation.c.
#include <assert.h>
#include <string.h>
#include "scip/sepa_aggregation.h"
#include "scip/pub_misc.h"
#include "scip/cuts.h"
Go to the source code of this file.
Typedefs | |
typedef struct AggregationData | AGGREGATIONDATA |
Functions | |
static SCIP_RETCODE | addCut (SCIP *scip, SCIP_SOL *sol, SCIP_SEPA *sepa, SCIP_Bool makeintegral, SCIP_Real *cutcoefs, int *cutinds, int cutnnz, SCIP_Real cutrhs, SCIP_Real cutefficacy, SCIP_Bool cutislocal, SCIP_Bool cutremovable, int cutrank, const char *cutclassname, SCIP_Bool *cutoff, int *ncuts, SCIP_ROW **thecut) |
static SCIP_RETCODE | setupAggregationData (SCIP *scip, SCIP_SOL *sol, SCIP_Bool allowlocal, AGGREGATIONDATA *aggrdata) |
static void | destroyAggregationData (SCIP *scip, AGGREGATIONDATA *aggrdata) |
static SCIP_Bool | getRowAggregationCandidates (AGGREGATIONDATA *aggrdata, int probvaridx, SCIP_ROW ***rows, SCIP_Real **rowvarcoefs, int *nrows, int *ngoodrows) |
static SCIP_Real | aggrdataGetBoundDist (AGGREGATIONDATA *aggrdata, int probvaridx) |
static SCIP_RETCODE | aggregateNextRow (SCIP *scip, SCIP_SEPADATA *sepadata, SCIP_Real *rowlhsscores, SCIP_Real *rowrhsscores, AGGREGATIONDATA *aggrdata, SCIP_AGGRROW *aggrrow, int *naggrs, SCIP_Bool *success) |
static SCIP_RETCODE | aggregation (SCIP *scip, AGGREGATIONDATA *aggrdata, SCIP_SEPA *sepa, SCIP_SOL *sol, SCIP_Bool allowlocal, SCIP_Real *rowlhsscores, SCIP_Real *rowrhsscores, int startrow, int maxaggrs, SCIP_Bool *wastried, SCIP_Bool *cutoff, int *cutinds, SCIP_Real *cutcoefs, SCIP_Bool negate, int *ncuts) |
static SCIP_Real | getRowFracActivity (SCIP_ROW *row, SCIP_Real *fractionalities) |
static SCIP_RETCODE | separateCuts (SCIP *scip, SCIP_SEPA *sepa, SCIP_SOL *sol, SCIP_Bool allowlocal, SCIP_RESULT *result) |
static | SCIP_DECL_SEPACOPY (sepaCopyAggregation) |
static | SCIP_DECL_SEPAFREE (sepaFreeAggregation) |
static | SCIP_DECL_SEPAEXECLP (sepaExeclpAggregation) |
static | SCIP_DECL_SEPAEXECSOL (sepaExecsolAggregation) |
static | SCIP_DECL_SEPAEXECLP (sepaExeclpDummy) |
static | SCIP_DECL_SEPAEXECSOL (sepaExecsolDummy) |
SCIP_RETCODE | SCIPincludeSepaAggregation (SCIP *scip) |
#define SEPA_NAME "aggregation" |
Definition at line 48 of file sepa_aggregation.c.
Referenced by separateCuts().
#define SEPA_DESC "aggregation heuristic for complemented mixed integer rounding cuts and flowcover cuts" |
Definition at line 49 of file sepa_aggregation.c.
#define SEPA_PRIORITY -3000 |
Definition at line 50 of file sepa_aggregation.c.
#define SEPA_FREQ 10 |
Definition at line 51 of file sepa_aggregation.c.
#define SEPA_MAXBOUNDDIST 1.0 |
Definition at line 52 of file sepa_aggregation.c.
#define SEPA_USESSUBSCIP FALSE |
does the separator use a secondary SCIP instance?
Definition at line 53 of file sepa_aggregation.c.
#define SEPA_DELAY FALSE |
should separation method be delayed, if other separators found cuts?
Definition at line 54 of file sepa_aggregation.c.
#define DEFAULT_MAXROUNDS -1 |
maximal number of cmir separation rounds per node (-1: unlimited)
Definition at line 56 of file sepa_aggregation.c.
#define DEFAULT_MAXROUNDSROOT -1 |
maximal number of cmir separation rounds in the root node (-1: unlimited)
Definition at line 57 of file sepa_aggregation.c.
#define DEFAULT_MAXTRIES 200 |
maximal number of rows to start aggregation with per separation round (-1: unlimited)
Definition at line 58 of file sepa_aggregation.c.
#define DEFAULT_MAXTRIESROOT -1 |
maximal number of rows to start aggregation with per round in the root node (-1: unlimited)
Definition at line 61 of file sepa_aggregation.c.
#define DEFAULT_MAXFAILS 20 |
maximal number of consecutive unsuccessful aggregation tries (-1: unlimited)
Definition at line 64 of file sepa_aggregation.c.
#define DEFAULT_MAXFAILSROOT 100 |
maximal number of consecutive unsuccessful aggregation tries in the root node (-1: unlimited)
Definition at line 65 of file sepa_aggregation.c.
#define DEFAULT_MAXAGGRS 3 |
maximal number of aggregations for each row per separation round
Definition at line 68 of file sepa_aggregation.c.
#define DEFAULT_MAXAGGRSROOT 6 |
maximal number of aggregations for each row per round in the root node
Definition at line 69 of file sepa_aggregation.c.
#define DEFAULT_MAXSEPACUTS 100 |
maximal number of cmir cuts separated per separation round
Definition at line 70 of file sepa_aggregation.c.
#define DEFAULT_MAXSEPACUTSROOT 500 |
maximal number of cmir cuts separated per separation round in root node
Definition at line 71 of file sepa_aggregation.c.
#define DEFAULT_MAXSLACK 0.0 |
maximal slack of rows to be used in aggregation
Definition at line 72 of file sepa_aggregation.c.
#define DEFAULT_MAXSLACKROOT 0.1 |
maximal slack of rows to be used in aggregation in the root node
Definition at line 73 of file sepa_aggregation.c.
#define DEFAULT_DENSITYSCORE 1e-4 |
weight of row density in the aggregation scoring of the rows
Definition at line 74 of file sepa_aggregation.c.
#define DEFAULT_SLACKSCORE 1e-3 |
weight of slack in the aggregation scoring of the rows
Definition at line 75 of file sepa_aggregation.c.
#define DEFAULT_MAXAGGDENSITY 0.20 |
maximal density of aggregated row
Definition at line 76 of file sepa_aggregation.c.
#define DEFAULT_MAXROWDENSITY 0.05 |
maximal density of row to be used in aggregation
Definition at line 77 of file sepa_aggregation.c.
#define DEFAULT_DENSITYOFFSET 100 |
additional number of variables allowed in row on top of density
Definition at line 78 of file sepa_aggregation.c.
#define DEFAULT_MAXROWFAC 1e+4 |
maximal row aggregation factor
Definition at line 79 of file sepa_aggregation.c.
#define DEFAULT_MAXTESTDELTA -1 |
maximal number of different deltas to try (-1: unlimited)
Definition at line 80 of file sepa_aggregation.c.
#define DEFAULT_AGGRTOL 1e-2 |
aggregation heuristic: we try to delete continuous variables from the current aggregation, whose distance to its tightest bound is >= L - DEFAULT_AGGRTOL, where L is the largest of the distances between a continuous variable's value and its tightest bound in the current aggregation
Definition at line 81 of file sepa_aggregation.c.
#define DEFAULT_TRYNEGSCALING TRUE |
should negative values also be tested in scaling?
Definition at line 88 of file sepa_aggregation.c.
#define DEFAULT_FIXINTEGRALRHS TRUE |
should an additional variable be complemented if f0 = 0?
Definition at line 89 of file sepa_aggregation.c.
#define DEFAULT_DYNAMICCUTS TRUE |
should generated cuts be removed from the LP if they are no longer tight?
Definition at line 90 of file sepa_aggregation.c.
#define BOUNDSWITCH 0.5 |
Definition at line 92 of file sepa_aggregation.c.
Referenced by aggregation().
#define POSTPROCESS TRUE |
Definition at line 93 of file sepa_aggregation.c.
Referenced by aggregation().
#define USEVBDS TRUE |
Definition at line 94 of file sepa_aggregation.c.
Referenced by aggregation().
#define MINFRAC 0.05 |
Definition at line 95 of file sepa_aggregation.c.
Referenced by aggregation().
#define MAXFRAC 0.999 |
Definition at line 96 of file sepa_aggregation.c.
Referenced by aggregation().
#define MAKECONTINTEGRAL FALSE |
Definition at line 97 of file sepa_aggregation.c.
Referenced by addCut().
#define IMPLINTSARECONT |
Definition at line 98 of file sepa_aggregation.c.
typedef struct AggregationData AGGREGATIONDATA |
|
static |
adds given cut to LP if violated
scip | SCIP data structure |
sol | the solution that should be separated, or NULL for LP solution |
sepa | separator |
makeintegral | should cut be scaled to integral coefficients if possible? |
cutcoefs | coefficients of active variables in cut |
cutinds | problem indices of variables in cut |
cutnnz | number of non-zeros in cut |
cutrhs | right hand side of cut |
cutefficacy | efficacy of cut |
cutislocal | is the cut only locally valid? |
cutremovable | should the cut be removed from the LP due to aging or cleanup? |
cutrank | rank of the cut |
cutclassname | name of cut class to use for row names |
cutoff | whether a cutoff has been detected |
ncuts | pointer to count the number of added cuts |
thecut | pointer to return cut if it was added |
Definition at line 162 of file sepa_aggregation.c.
References FALSE, MAKECONTINTEGRAL, SCIP_Bool, SCIP_CALL, SCIP_MAXSTRLEN, SCIP_OKAY, SCIPaddPoolCut(), SCIPaddRow(), SCIPaddVarToRow(), SCIPcacheRowExtensions(), SCIPcreateEmptyRowSepa(), SCIPdebug, SCIPdebugMsg, SCIPepsilon(), SCIPflushRowExtensions(), SCIPgetNLPs(), SCIPgetRowMaxCoef(), SCIPgetRowMinCoef(), SCIPgetRowNumIntCols(), SCIPgetVars(), SCIPinfinity(), SCIPisCutEfficacious(), SCIPisCutNew(), SCIPisEfficacious(), SCIPisInfinity(), SCIPmakeRowIntegral(), SCIPprintRow(), SCIPreleaseRow(), SCIProwChgRank(), SCIProwGetNNonz(), SCIProwGetRank(), SCIProwGetRhs(), SCIPsnprintf(), SCIPsumepsilon(), and setupAggregationData().
Referenced by aggregation().
|
static |
setup data for aggregating rows
scip | SCIP data structure |
sol | solution to separate, NULL for LP solution |
allowlocal | should local cuts be allowed |
aggrdata | pointer to aggregation data to setup |
Definition at line 289 of file sepa_aggregation.c.
References AggregationData::aggrrow, AggregationData::aggrrows, AggregationData::aggrrowscoef, AggregationData::aggrrowssize, AggregationData::aggrrowsstart, BMSclearMemoryArray, AggregationData::bounddist, AggregationData::bounddistinds, destroyAggregationData(), MAX, AggregationData::naggrrows, AggregationData::nbadvarsinrow, AggregationData::nbounddistvars, AggregationData::ngoodaggrrows, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPaggrRowCreate(), SCIPaggrRowFree(), SCIPallocBufferArray, SCIPcolGetNLPNonz(), SCIPcolGetRows(), SCIPcolGetVals(), SCIPgetLPRowsData(), SCIPgetSolVal(), SCIPgetVarClosestVlb(), SCIPgetVarClosestVub(), SCIPgetVarsData(), SCIPisEQ(), SCIPisZero(), SCIPreallocBufferArray, SCIProwGetLhs(), SCIProwGetLPPos(), SCIProwGetRhs(), SCIProwIsModifiable(), SCIPswapPointers(), SCIPswapReals(), SCIPvarGetCol(), SCIPvarGetLbGlobal(), SCIPvarGetLbLocal(), SCIPvarGetUbGlobal(), SCIPvarGetUbLocal(), and SCIPvarIsInLP().
Referenced by addCut(), and separateCuts().
|
static |
free resources held in aggregation data
scip | SCIP datastructure |
aggrdata | pointer to ggregation data |
Definition at line 466 of file sepa_aggregation.c.
Referenced by separateCuts(), and setupAggregationData().
|
static |
retrieves the candidate rows for canceling out the given variable, also returns the number of "good" rows which are the rows stored at the first ngoodrows positions. A row is good if its continuous variables are all at their bounds, except maybe the given continuous variable (in probvaridx)
aggrdata | pointer to ggregation data |
probvaridx | problem index of variables to retrieve candidates for |
rows | pointer to store array to candidate rows |
rowvarcoefs | pointer to store array of coefficients of given variable in the corresponding rows |
nrows | pointer to return number of rows in returned arrays |
ngoodrows | pointer to return number of "good" rows in the returned arrays |
Definition at line 486 of file sepa_aggregation.c.
References aggrdataGetBoundDist(), AggregationData::aggrrows, AggregationData::aggrrowscoef, AggregationData::aggrrowsstart, AggregationData::bounddistinds, FALSE, AggregationData::nbounddistvars, AggregationData::ngoodaggrrows, SCIP_Real, SCIPsortedvecFindInt(), and TRUE.
Referenced by aggregateNextRow().
|
static |
find the bound distance value in the aggregation data struct for the given variable problem index
aggrdata | SCIP datastructure |
probvaridx | problem index of variables to retrieve candidates for |
Definition at line 510 of file sepa_aggregation.c.
Referenced by aggregateNextRow(), and getRowAggregationCandidates().
|
static |
Aggregates the next row suitable for cancelling out an active continuous variable. Equality rows that contain no other active continuous variables are preffered and apart from that the scores for the rows are used to determine which row is aggregated next
scip | SCIP data structure |
sepadata | separator data |
rowlhsscores | aggregation scores for left hand sides of row |
rowrhsscores | aggregation scores for right hand sides of row |
aggrdata | aggregation data |
aggrrow | current aggregation row |
naggrs | pointer to increase counter if real aggregation took place |
success | pointer to return whether another row was added to the aggregation row |
Definition at line 528 of file sepa_aggregation.c.
References aggrdataGetBoundDist(), aggregation(), FALSE, getRowAggregationCandidates(), MAX, AggregationData::nbadvarsinrow, REALABS, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPABORT, SCIPaggrRowAddRow(), SCIPaggrRowGetInds(), SCIPaggrRowGetNNz(), SCIPaggrRowGetProbvarValue(), SCIPaggrRowHasRowBeenAdded(), SCIPaggrRowRemoveZeros(), SCIPallocBufferArray, SCIPfreeBufferArray, SCIPgetNBinVars(), SCIPgetNIntVars(), SCIPgetNVars(), SCIPisEQ(), SCIPisFeasZero(), SCIPisGT(), SCIPisInfinity(), SCIProwGetLhs(), SCIProwGetLPPos(), SCIProwGetRhs(), and SCIPsortDownRealInt().
Referenced by aggregation().
|
static |
aggregates different single mixed integer constraints by taking linear combinations of the rows of the LP
scip | SCIP data structure |
aggrdata | pointer to aggregation data |
sepa | separator |
sol | the solution that should be separated, or NULL for LP solution |
allowlocal | should local cuts be allowed |
rowlhsscores | aggregation scores for left hand sides of row |
rowrhsscores | aggregation scores for right hand sides of row |
startrow | index of row to start aggregation |
maxaggrs | maximal number of aggregations |
wastried | pointer to store whether the given startrow was actually tried |
cutoff | whether a cutoff has been detected |
cutinds | buffer array to store temporarily cut |
cutcoefs | buffer array to store temporarily cut |
negate | should the start row be multiplied by -1 |
ncuts | pointer to count the number of generated cuts |
Definition at line 767 of file sepa_aggregation.c.
References addCut(), aggregateNextRow(), AggregationData::aggrrow, BOUNDSWITCH, FALSE, getRowFracActivity(), MAXFRAC, MINFRAC, POSTPROCESS, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPaggrRowAddRow(), SCIPaggrRowClear(), SCIPaggrRowGetNNz(), SCIPaggrRowGetNRows(), SCIPaggrRowGetRowInds(), SCIPcalcFlowCover(), SCIPcutGenerationHeuristicCMIR(), SCIPdebugMsg, SCIPgetLPRowsData(), SCIPgetNLPCols(), SCIPgetRowSolActivity(), SCIPinfinity(), SCIPreleaseRow(), SCIProwGetLhs(), SCIProwGetName(), SCIProwGetParallelism(), SCIProwGetRhs(), SCIPsepaGetData(), TRUE, and USEVBDS.
Referenced by aggregateNextRow(), and separateCuts().
gives an estimate of how much the activity of this row is affected by fractionality in the current solution
row | the LP row |
fractionalities | array of fractionalities for each variable |
Definition at line 943 of file sepa_aggregation.c.
Referenced by aggregation(), and separateCuts().
|
static |
searches and adds c-MIR cuts that separate the given primal solution
scip | SCIP data structure |
sepa | the c-MIR separator |
sol | the solution that should be separated, or NULL for LP solution |
allowlocal | should local cuts be allowed |
result | pointer to store the result |
Definition at line 971 of file sepa_aggregation.c.
References aggregation(), destroyAggregationData(), FALSE, getRowFracActivity(), MAX, SCIP_Bool, SCIP_CALL, SCIP_CUTOFF, SCIP_DECL_SEPACOPY(), SCIP_DIDNOTFIND, SCIP_DIDNOTRUN, SCIP_OKAY, SCIP_Real, SCIP_SEPARATED, SCIPallocBufferArray, SCIPdebugMsg, SCIPfeasFrac(), SCIPfreeBufferArray, SCIPgetDepth(), SCIPgetLPRowsData(), SCIPgetNContVars(), SCIPgetNImplVars(), SCIPgetNSepaRounds(), SCIPgetNVars(), SCIPgetObjNorm(), SCIPgetRowSolActivity(), SCIPgetSolVals(), SCIPgetVarClosestVlb(), SCIPgetVarClosestVub(), SCIPgetVars(), SCIPisEQ(), SCIPisInfinity(), SCIPisLE(), SCIPisPositive(), SCIPisStopped(), SCIProwGetDualsol(), SCIProwGetLhs(), SCIProwGetLPPos(), SCIProwGetName(), SCIProwGetNLPNonz(), SCIProwGetNorm(), SCIProwGetRhs(), SCIProwIsLocal(), SCIPsepaGetData(), SCIPsepaGetName(), SCIPsepaGetNCallsAtNode(), SCIPvarGetProbindex(), SCIPvarGetVlbCoefs(), SCIPvarGetVlbVars(), SCIPvarGetVubCoefs(), SCIPvarGetVubVars(), SEPA_NAME, setupAggregationData(), and TRUE.
|
static |
copy method for separator plugins (called when SCIP copies plugins)
Definition at line 1334 of file sepa_aggregation.c.
Referenced by separateCuts().
|
static |
destructor of separator to free user data (called when SCIP is exiting)
Definition at line 1348 of file sepa_aggregation.c.
|
static |
LP solution separation method of separator
Definition at line 1366 of file sepa_aggregation.c.
|
static |
arbitrary primal solution separation method of separator
Definition at line 1391 of file sepa_aggregation.c.
References SCIP_DIDNOTRUN, and SCIP_OKAY.
|
static |
LP solution separation method of dummy separator
Definition at line 1403 of file sepa_aggregation.c.
References SCIP_DIDNOTRUN, and SCIP_OKAY.
|
static |
arbitrary primal solution separation method of dummy separator
Definition at line 1414 of file sepa_aggregation.c.