59#define PRESOL_NAME "redvub"
60#define PRESOL_DESC "detect redundant variable bound constraints"
61#define PRESOL_PRIORITY -9000000
62#define PRESOL_MAXROUNDS 0
63#define PRESOL_TIMING SCIP_PRESOLTIMING_EXHAUSTIVE
65#define MAXPAIRCOMP 1000
77 SCIP_Real* lowthreshold,
78 SCIP_Real* highthreshold,
158 SCIP_Real* lowthreshold,
159 SCIP_Real* highthreshold,
241 SCIP_Real* lowthresholds,
242 SCIP_Real* highthresholds,
246 SCIP_Bool* isvartoagg,
249 SCIP_Bool* deletecons
254 SCIP_Bool uselinearscan;
272 uselinearscan =
TRUE;
274 uselinearscan =
FALSE;
276 for(
i = 0;
i < nvubs;
i++ )
278 for( j =
i+1; j < nvubs; j++ )
306 isvartoagg[binidxs[j]] =
TRUE;
310 deletecons[vubs[j]] =
TRUE;
323 isvartoagg[binidxs[
i]] =
TRUE;
327 deletecons[vubs[
i]] =
TRUE;
347 SCIP_Real* lowthresholds,
348 SCIP_Real* highthresholds,
352 SCIP_Bool* isvartoagg,
355 SCIP_Bool* deletecons
361 SCIP_Bool uselinearscan;
379 uselinearscan =
TRUE;
381 uselinearscan =
FALSE;
383 for(
i = 0;
i < nvlbs;
i++ )
385 for( j =
i+1; j < nvlbs; j++ )
413 isvartoagg[binidxs[j]] =
TRUE;
417 deletecons[vlbs[j]] =
TRUE;
430 isvartoagg[binidxs[
i]] =
TRUE;
434 deletecons[vlbs[
i]] =
TRUE;
453 SCIP_Bool* isvartoagg,
456 SCIP_Bool* deletecons
466 SCIP_Real* lowthresholds;
467 SCIP_Real* highthresholds;
480 for(
c = 0;
c < ncols;
c++ )
493 for( ; (colpnt < colend); colpnt++ )
495 SCIP_Real lowthreshold;
496 SCIP_Real highthreshold;
500 if(
isVub(
scip, matrix, *colpnt, &lowthreshold, &highthreshold, &conidx, &binidx) )
502 vbcons[nvbcons] = *colpnt;
503 lowthresholds[nvbcons] = lowthreshold;
504 highthresholds[nvbcons] = highthreshold;
505 conidxs[nvbcons] = conidx;
506 binidxs[nvbcons] = binidx;
513 lowthresholds, highthresholds, conidxs, binidxs,
514 nvaragg, isvartoagg, aggvars, ndeletecons, deletecons) );
521 for( ; (colpnt < colend); colpnt++ )
523 SCIP_Real lowthreshold;
524 SCIP_Real highthreshold;
528 if(
isVlb(
scip, matrix, *colpnt, &lowthreshold, &highthreshold, &conidx, &binidx) )
530 vbcons[nvbcons] = *colpnt;
531 lowthresholds[nvbcons] = lowthreshold;
532 highthresholds[nvbcons] = highthreshold;
533 conidxs[nvbcons] = conidx;
534 binidxs[nvbcons] = binidx;
541 lowthresholds, highthresholds, conidxs, binidxs,
542 nvaragg, isvartoagg, aggvars, ndeletecons, deletecons) );
566 SCIP_Bool initialized;
568 SCIP_Bool infeasible;
583 naddconss, ndelconss, nchgcoefs, nchgbds, nfixedvars) );
595 if( initialized && complete )
598 SCIP_Bool* isvartoagg;
600 SCIP_Bool* deletecons;
625 for( v = 0; v < ncols; v++ )
630 SCIP_Bool aggregated;
635 0.0, &infeasible, &redundant, &aggregated) );
656 if( ndeletecons > 0 )
659 for(
r = 0;
r < nrows;
r++ )
SCIP_Bool SCIPisStopped(SCIP *scip)
SCIP_STAGE SCIPgetStage(SCIP *scip)
int SCIPgetNContVars(SCIP *scip)
SCIP_RETCODE SCIPdelCons(SCIP *scip, SCIP_CONS *cons)
void SCIPinfoMessage(SCIP *scip, FILE *file, const char *formatstr,...)
SCIP_RETCODE SCIPincludePresolRedvub(SCIP *scip)
SCIP_RETCODE SCIPprintCons(SCIP *scip, SCIP_CONS *cons, FILE *file)
#define SCIPallocBufferArray(scip, ptr, num)
#define SCIPfreeBufferArray(scip, ptr)
SCIP_Bool SCIPisNLPEnabled(SCIP *scip)
SCIP_RETCODE SCIPincludePresolBasic(SCIP *scip, SCIP_PRESOL **presolptr, const char *name, const char *desc, int priority, int maxrounds, SCIP_PRESOLTIMING timing, SCIP_DECL_PRESOLEXEC((*presolexec)), SCIP_PRESOLDATA *presoldata)
int SCIPgetNActivePricers(SCIP *scip)
SCIP_Bool SCIPinProbing(SCIP *scip)
SCIP_Bool SCIPisGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_RETCODE SCIPaggregateVars(SCIP *scip, SCIP_VAR *varx, SCIP_VAR *vary, SCIP_Real scalarx, SCIP_Real scalary, SCIP_Real rhs, SCIP_Bool *infeasible, SCIP_Bool *redundant, SCIP_Bool *aggregated)
SCIP_Real SCIPvarGetObj(SCIP_VAR *var)
SCIP_VARTYPE SCIPvarGetType(SCIP_VAR *var)
const char * SCIPvarGetName(SCIP_VAR *var)
SCIP_Real SCIPvarGetLbGlobal(SCIP_VAR *var)
SCIP_Bool SCIPvarsHaveCommonClique(SCIP_VAR *var1, SCIP_Bool value1, SCIP_VAR *var2, SCIP_Bool value2, SCIP_Bool regardimplics)
assert(minobj< SCIPgetCutoffbound(scip))
int * SCIPmatrixGetColIdxPtr(SCIP_MATRIX *matrix, int col)
int SCIPmatrixGetRowNNonzs(SCIP_MATRIX *matrix, int row)
int SCIPmatrixGetColNDownlocks(SCIP_MATRIX *matrix, int col)
int SCIPmatrixGetColNNonzs(SCIP_MATRIX *matrix, int col)
SCIP_Bool SCIPmatrixIsRowRhsInfinity(SCIP_MATRIX *matrix, int row)
int SCIPmatrixGetColNUplocks(SCIP_MATRIX *matrix, int col)
SCIP_Real SCIPmatrixGetRowLhs(SCIP_MATRIX *matrix, int row)
SCIP_Real * SCIPmatrixGetRowValPtr(SCIP_MATRIX *matrix, int row)
SCIP_RETCODE SCIPmatrixCreate(SCIP *scip, SCIP_MATRIX **matrixptr, SCIP_Bool onlyifcomplete, SCIP_Bool *initialized, SCIP_Bool *complete, SCIP_Bool *infeasible, int *naddconss, int *ndelconss, int *nchgcoefs, int *nchgbds, int *nfixedvars)
int SCIPmatrixGetNColumns(SCIP_MATRIX *matrix)
SCIP_CONS * SCIPmatrixGetCons(SCIP_MATRIX *matrix, int row)
void SCIPmatrixFree(SCIP *scip, SCIP_MATRIX **matrix)
SCIP_VAR * SCIPmatrixGetVar(SCIP_MATRIX *matrix, int col)
int * SCIPmatrixGetRowIdxPtr(SCIP_MATRIX *matrix, int row)
int SCIPmatrixGetNRows(SCIP_MATRIX *matrix)
memory allocation routines
#define BMSclearMemoryArray(ptr, num)
static SCIP_RETCODE detectDominatingVlbs(SCIP *scip, SCIP_MATRIX *matrix, int nvlbs, int *vlbs, SCIP_Real *lowthresholds, SCIP_Real *highthresholds, int *conidxs, int *binidxs, int *nvaragg, SCIP_Bool *isvartoagg, SCIP_VAR **aggvars, int *ndeletecons, SCIP_Bool *deletecons)
static SCIP_Bool isVlb(SCIP *scip, SCIP_MATRIX *matrix, int row, SCIP_Real *lowthreshold, SCIP_Real *highthreshold, int *conidx, int *binidx)
static SCIP_RETCODE detectDominatingVubs(SCIP *scip, SCIP_MATRIX *matrix, int nvubs, int *vubs, SCIP_Real *lowthresholds, SCIP_Real *highthresholds, int *conidxs, int *binidxs, int *nvaragg, SCIP_Bool *isvartoagg, SCIP_VAR **aggvars, int *ndeletecons, SCIP_Bool *deletecons)
static SCIP_Bool isVub(SCIP *scip, SCIP_MATRIX *matrix, int row, SCIP_Real *lowthreshold, SCIP_Real *highthreshold, int *conidx, int *binidx)
static SCIP_RETCODE findVarAggrRedVbcons(SCIP *scip, SCIP_MATRIX *matrix, int *nvaragg, SCIP_Bool *isvartoagg, SCIP_VAR **aggvars, int *ndeletecons, SCIP_Bool *deletecons)
remove redundant variable upper bound constraints
public methods for matrix
public methods for message output
public methods for problem variables
public methods for constraint handler plugins and constraints
public methods for memory management
public methods for message handling
public methods for nonlinear relaxation
public methods for numerical tolerances
public methods for presolving plugins
public methods for variable pricer plugins
public methods for global and local (sub)problems
public methods for the probing mode
public methods for SCIP variables
#define SCIP_DECL_PRESOLEXEC(x)
enum SCIP_Retcode SCIP_RETCODE
@ SCIP_VARTYPE_CONTINUOUS
enum SCIP_Vartype SCIP_VARTYPE