31 #define SEPA_NAME "cmir" 32 #define SEPA_DESC "complemented mixed integer rounding cuts separator (Marchand's version)" 33 #define SEPA_PRIORITY -3000 35 #define SEPA_MAXBOUNDDIST 0.0 36 #define SEPA_USESSUBSCIP FALSE 37 #define SEPA_DELAY FALSE 39 #define DEFAULT_MAXROUNDS 3 40 #define DEFAULT_MAXROUNDSROOT 10 41 #define DEFAULT_MAXTRIES 100 43 #define DEFAULT_MAXTRIESROOT -1 45 #define DEFAULT_MAXFAILS 20 46 #define DEFAULT_MAXFAILSROOT 100 48 #define DEFAULT_MAXAGGRS 3 49 #define DEFAULT_MAXAGGRSROOT 6 50 #define DEFAULT_MAXSEPACUTS 100 51 #define DEFAULT_MAXSEPACUTSROOT 500 52 #define DEFAULT_MAXSLACK 0.0 53 #define DEFAULT_MAXSLACKROOT 0.1 54 #define DEFAULT_DENSITYSCORE 1e-04 55 #define DEFAULT_SLACKSCORE 1e-03 56 #define DEFAULT_MAXAGGDENSITY 0.20 57 #define DEFAULT_MAXROWDENSITY 0.05 58 #define DEFAULT_DENSITYOFFSET 100 59 #define DEFAULT_MAXROWFAC 1e+4 60 #define DEFAULT_MAXTESTDELTA -1 61 #define DEFAULT_MAXCONTS 10 62 #define DEFAULT_MAXCONTSROOT 10 63 #define DEFAULT_AGGRTOL 0.1 65 #define DEFAULT_TRYNEGSCALING TRUE 66 #define DEFAULT_FIXINTEGRALRHS TRUE 67 #define DEFAULT_DYNAMICCUTS TRUE 69 #define BOUNDSWITCH 0.5 71 #define ALLOWLOCAL TRUE 74 #define MAKECONTINTEGRAL FALSE 75 #define IMPLINTSARECONT 77 #define MAXAGGRLEN(nvars) (0.1*(nvars)+1000) 141 assert(nvars == 0 || cutcoefs !=
NULL);
142 assert(nvars == 0 || varsolvals !=
NULL);
143 assert(cutvars !=
NULL);
144 assert(cutvals !=
NULL);
145 assert(cutlen !=
NULL);
146 assert(cutact !=
NULL);
150 for( v = 0; v < nvars; ++v )
157 act += val * varsolvals[v];
158 cutvars[len] = vars[v];
182 const char* cutclassname,
194 assert(scip !=
NULL);
195 assert(varsolvals !=
NULL);
196 assert(cutcoefs !=
NULL);
197 assert(cutoff !=
NULL);
198 assert(ncuts !=
NULL);
204 assert(nvars == 0 || vars !=
NULL);
212 cutvars, cutvals, &cutlen, &cutact) );
228 cutislocal,
FALSE, cutremovable) );
234 SCIPdebugMsg(scip,
" -> found potential %s cut <%s>: activity=%f, rhs=%f, norm=%f, eff=%f\n",
243 SCIPdebugMsg(scip,
" -> %s cut <%s> no longer efficacious: act=%f, rhs=%f, norm=%f, eff=%f\n",
254 SCIPdebugMsg(scip,
" -> found %s cut <%s>: act=%f, rhs=%f, norm=%f, eff=%f, rank=%d, min=%f, max=%f (range=%g)\n",
260 if( !(*cutoff) && !cutislocal )
292 assert(nactiveconts !=
NULL);
302 assert(probindex >= nintvars);
304 primsol = varsolvals[probindex];
305 lb = bestcontlbs[probindex - nintvars];
306 ub = bestcontubs[probindex - nintvars];
309 (*nactiveconts) += delta;
322 assert(rowlhsscores !=
NULL);
323 assert(rowrhsscores !=
NULL);
324 assert(rowlhsscores[rowidx] >= 0.0);
325 assert(rowrhsscores[rowidx] >= 0.0);
327 rowlhsscores[rowidx] *= 0.9;
328 rowrhsscores[rowidx] *= 0.9;
365 assert(testeddeltas !=
NULL);
366 assert(ntesteddeltas !=
NULL);
367 assert(bestdelta !=
NULL);
368 assert(bestefficacy !=
NULL);
376 for( i = 0; i < *ntesteddeltas && !tested; i++ )
377 tested =
SCIPisEQ(scip, testeddeltas[i], delta);
385 testeddeltas[*ntesteddeltas] = delta;
390 maxweightrange, minfrac, maxfrac, rowweights, maxweight, weightinds, nweightinds, rowlensum,
NULL, delta,
391 mksetcoefs, mksetcoefsvalid, cutcoefs, &cutrhs, &cutact, &success, &cutislocal,
NULL) );
392 assert(allowlocal || !cutislocal);
393 SCIPdebugMsg(scip,
"delta = %g -> success: %u, cutact: %g, cutrhs: %g, vio: %g\n",
394 delta, success, success ? cutact : 0.0, success ? cutrhs : 0.0, success ? cutact - cutrhs : 0.0);
406 efficacy = (cutact - cutrhs)/norm;
407 SCIPdebugMsg(scip,
"act = %g rhs = %g eff = %g, old besteff = %g, old bestdelta=%g\n", cutact, cutrhs, efficacy, *bestefficacy, *bestdelta);
408 if( efficacy > *bestefficacy )
411 *bestefficacy = efficacy;
447 const char* cutclassname,
468 assert( cutoff !=
NULL );
471 if( maxtestdelta == -1 )
472 maxtestdelta = INT_MAX;
481 nintvars = nvars-ncontvars;
484 assert(vars !=
NULL);
502 maxabsmksetcoef = 0.0;
503 mksetcoefsvalid =
FALSE;
510 SCIP_CALL(
tryDelta(scip, sol, nvars, rowweights, maxweight, weightinds, nweightinds, rowlensum, cutcoefs, mksetcoefs,
511 &mksetcoefsvalid, testeddeltas, &ntesteddeltas, 1.0, boundswitch, usevbds, allowlocal, fixintegralrhs,
512 maxmksetcoefs, maxweightrange, minfrac, maxfrac, &bestdelta, &bestefficacy) );
513 if( mksetcoefsvalid && trynegscaling )
515 SCIP_CALL(
tryDelta(scip, sol, nvars, rowweights, maxweight, weightinds, nweightinds, rowlensum, cutcoefs,
NULL,
516 NULL, testeddeltas, &ntesteddeltas, -1.0, boundswitch, usevbds, allowlocal, fixintegralrhs, maxmksetcoefs,
517 maxweightrange, minfrac, maxfrac, &bestdelta, &bestefficacy) );
521 for( vi = 0; mksetcoefsvalid && vi < nintvars; vi++ )
539 absmksetcoef =
REALABS(mksetcoefs[vi]);
540 maxabsmksetcoef =
MAX(maxabsmksetcoef, absmksetcoef);
542 if( ntesteddeltas >= maxtestdelta )
546 primsol = varsolvals[vi];
555 SCIP_CALL(
tryDelta(scip, sol, nvars, rowweights, maxweight, weightinds, nweightinds, rowlensum, cutcoefs,
NULL,
556 NULL, testeddeltas, &ntesteddeltas, 1.0/absmksetcoef, boundswitch, usevbds, allowlocal, fixintegralrhs,
557 maxmksetcoefs, maxweightrange, minfrac, maxfrac, &bestdelta, &bestefficacy) );
560 SCIP_CALL(
tryDelta(scip, sol, nvars, rowweights, maxweight, weightinds, nweightinds, rowlensum, cutcoefs,
561 NULL,
NULL, testeddeltas, &ntesteddeltas, -1.0/absmksetcoef, boundswitch, usevbds, allowlocal,
562 fixintegralrhs, maxmksetcoefs, maxweightrange, minfrac, maxfrac, &bestdelta, &bestefficacy) );
570 SCIP_CALL(
tryDelta(scip, sol, nvars, rowweights, maxweight, weightinds, nweightinds, rowlensum, cutcoefs,
NULL,
571 NULL, testeddeltas, &ntesteddeltas, 1.0/(maxabsmksetcoef+1.0), boundswitch, usevbds, allowlocal,
572 fixintegralrhs, maxmksetcoefs, maxweightrange, minfrac, maxfrac, &bestdelta, &bestefficacy) );
575 SCIP_CALL(
tryDelta(scip, sol, nvars, rowweights, maxweight, weightinds, nweightinds, rowlensum, cutcoefs,
NULL,
576 NULL, testeddeltas, &ntesteddeltas, -1.0/(maxabsmksetcoef+1.0), boundswitch, usevbds, allowlocal,
577 fixintegralrhs, maxmksetcoefs, maxweightrange, minfrac, maxfrac, &bestdelta, &bestefficacy) );
595 for( i = 0, currentdelta = 2.0 * bestdelta; i < 3; i++, currentdelta *= 2.0 )
597 SCIP_CALL(
tryDelta(scip, sol, nvars, rowweights, maxweight, weightinds, nweightinds, rowlensum, cutcoefs,
598 NULL,
NULL, testeddeltas, &ntesteddeltas, currentdelta, boundswitch, usevbds, allowlocal, fixintegralrhs,
599 maxmksetcoefs, maxweightrange, minfrac, maxfrac, &bestdelta, &bestefficacy) );
607 maxmksetcoefs, maxweightrange, minfrac, maxfrac, rowweights, maxweight, weightinds, nweightinds, rowlensum,
608 NULL, bestdelta,
NULL,
NULL, cutcoefs, &cutrhs, &cutact, &success, &cutislocal, &cutrank) );
609 assert(allowlocal || !cutislocal);
613 SCIP_CALL(
addCut(scip, sepa, sol, varsolvals, cutcoefs, cutrhs, cutislocal, cutremovable, cutrank, cutclassname, cutoff, ncuts) );
640 #ifdef IMPLINTSARECONT 673 distlower = primsol - lb;
674 distupper = ub - primsol;
675 bounddist =
MIN(distlower, distupper);
677 #ifdef IMPLINTSARECONT 717 int* aggrcontnonzposs;
740 assert(scip !=
NULL);
741 assert(sepadata !=
NULL);
742 assert(varsolvals !=
NULL);
743 assert(rowlhsscores !=
NULL);
744 assert(rowrhsscores !=
NULL);
745 assert(wastried !=
NULL);
746 assert(cutoff !=
NULL);
747 assert(ncuts !=
NULL);
753 #ifdef IMPLINTSARECONT 756 nintvars = nvars - ncontvars;
757 assert((nvars == 0 && nintvars == 0 && ncontvars == 0) || vars !=
NULL);
759 assert(ncols == 0 || cols !=
NULL);
761 assert(nrows == 0 || rows !=
NULL);
762 assert(0 <= startrow && startrow < nrows);
767 maxaggrnonzs = (int)(sepadata->maxaggdensity * ncols) + sepadata->densityoffset;
782 rowweights[startrow] = -1.0;
784 rowweights[startrow] = 1.0;
789 weightinds[nweightinds] = startrow;
805 hasfractional =
FALSE;
806 for( c = 0; c < nstartnonzcols; c++ )
815 aggrcoefs[pos] = rowweights[startrow] * startnonzcoefs[c];
820 updateNActiveConts(scip, varsolvals, bestcontlbs, bestcontubs, nintvars, var, +1, &nactiveconts);
823 bounddist =
getBounddist(scip, nintvars, varsolvals, bestcontlbs, bestcontubs, var);
837 assert(naggrintnonzs + naggrcontnonzs == nstartnonzcols);
842 SCIPdebugMsg(scip,
" -> row has no fractional integer variables: ignore\n");
854 while( nactiveconts <= maxconts && naggrs <= maxaggrs && naggrcontnonzs + naggrintnonzs <= maxaggrnonzs )
859 int nbestrownonzcols;
867 int ncanceledcontnonzs;
872 SCIPdebugMsg(scip,
"aggregation of startrow %d and %d additional rows with %d integer and %d continuous variables (%d active):\n",
873 startrow, naggrs, naggrintnonzs, naggrcontnonzs, nactiveconts);
874 for( c = 0; c < ncols; ++c )
876 if( aggrcoefs[c] != 0.0 )
890 sepadata->dynamiccuts,
"cmir", cutoff, ncuts,
NULL,
NULL) );
896 if( *ncuts > oldncuts )
898 SCIPdebugMsg(scip,
" -> abort aggregation: cut found\n");
907 if( naggrs == maxaggrs )
909 SCIPdebugMsg(scip,
" -> abort aggregation: %s\n", nactiveconts == 0 ?
"no more active continuous variables" 910 :
"maximal number of aggregations reached");
924 bestbounddist = -1.0;
928 for( nzi = 0; nzi < naggrcontnonzs; ++nzi )
934 c = aggrcontnonzposs[nzi];
935 assert(0 <= c && c < ncols);
943 bounddist = aggrcontnonzbounddists[nzi];
944 assert(
SCIPisEQ(scip, bounddist,
getBounddist(scip, nintvars, varsolvals, bestcontlbs, bestcontubs, var)));
945 assert(bounddist <= bestbounddist || bestbounddist == -1.0);
948 if( bounddist >= bestbounddist - sepadata->aggrtol )
957 assert(probindex >= nintvars);
960 bestcontubs[probindex - nintvars], varsolvals[probindex], bounddist);
963 if( contvarscorebounds[probindex - nintvars] <= bestscore )
974 for( r = 0; r < nnonzrows; r++ )
988 assert(0 <= lppos && lppos < nrows);
990 SCIPdebugMsg(scip,
" -> r=%d row <%s>: weight=%g, pos=%d, alpha_j=%g, a^r_j=%g, factor=%g, %g <= %g <= %g\n",
991 r,
SCIProwGetName(nonzrows[r]), rowweights[lppos], lppos, aggrcoefs[c], nonzcoefs[r],
996 rowlhsscore = rowlhsscores[lppos];
997 rowrhsscore = rowrhsscores[lppos];
998 rowscore =
MAX(rowlhsscore, rowrhsscore);
999 maxrowscore =
MAX(maxrowscore, rowscore);
1002 if( rowscore <= bestscore )
1010 factor = - aggrcoefs[c] / nonzcoefs[r];
1013 || absfactor > sepadata->maxrowfac * minweight
1014 || maxweight > sepadata->maxrowfac * absfactor )
1022 score = (factor < 0.0 ? rowlhsscore : rowrhsscore);
1023 if( score <= bestscore )
1030 if( (factor < 0.0 &&
SCIPisGT(scip, factor * (lhs - activity), maxslack))
1031 || (factor > 0.0 &&
SCIPisGT(scip, factor * (rhs - activity), maxslack)) )
1035 bestbounddist = bounddist;
1038 bestrow = nonzrows[r];
1040 SCIPdebugMsg(scip,
" -> col <%s>: %g * row <%s>, bounddist=%g, score=%g\n",
1045 assert(maxrowscore <= contvarscorebounds[probindex - nintvars]);
1046 contvarscorebounds[probindex - nintvars] = maxrowscore;
1054 assert((bestcol ==
NULL) == (bestrow ==
NULL));
1058 for( ; nzi < naggrcontnonzs; ++nzi )
1064 c = aggrcontnonzposs[nzi];
1065 assert(0 <= c && c < ncols);
1072 bounddist = aggrcontnonzbounddists[nzi];
1074 SCIPdebugMsg(scip,
" -> ignoring col <%s>[%g,%g]: sol=%g, dist=%g\n",
1078 assert(
SCIPisEQ(scip, bounddist,
getBounddist(scip, nintvars, varsolvals, bestcontlbs, bestcontubs, var)));
1079 assert(bounddist < bestbounddist - sepadata->aggrtol);
1084 if( bestcol ==
NULL )
1086 SCIPdebugMsg(scip,
" -> abort aggregation: no removable column found\n");
1092 SCIPdebugMsg(scip,
" -> adding %+g<%s> to eliminate variable <%s> (aggregation %d)\n",
1094 assert(rowweights[bestrowpos] == 0.0);
1098 rowweights[bestrowpos] = aggrfac;
1104 absaggrfac =
REALABS(aggrfac);
1105 maxweight =
MAX(maxweight, absaggrfac);
1106 minweight =
MIN(minweight, absaggrfac);
1115 ncanceledcontnonzs = 0;
1116 for( c = 0; c < nbestrownonzcols; c++ )
1127 assert(!
SCIPisZero(scip, bestrownonzcoefs[c]));
1130 waszero = (aggrcoefs[pos] == 0.0);
1131 aggrcoefs[pos] += bestrownonzcoefs[c] * aggrfac;
1136 aggrcoefs[pos] = 0.0;
1142 ncanceledcontnonzs++;
1144 updateNActiveConts(scip, varsolvals, bestcontlbs, bestcontubs, nintvars, var, -1, &nactiveconts);
1157 assert(naggrcontnonzs < ncols);
1160 bounddist =
getBounddist(scip, nintvars, varsolvals, bestcontlbs, bestcontubs, var);
1163 updateNActiveConts(scip, varsolvals, bestcontlbs, bestcontubs, nintvars, var, +1, &nactiveconts);
1171 if( ncanceledcontnonzs > 0 )
1173 int newnaggrintnonzs;
1175 newnaggrintnonzs = 0;
1176 for( nzi = 0; nzi < naggrcontnonzs; ++nzi )
1180 pos = aggrcontnonzposs[nzi];
1181 assert(0 <= pos && pos < ncols);
1182 if( aggrcoefs[pos] != 0.0 )
1184 assert(newnaggrintnonzs <= nzi);
1185 aggrcontnonzposs[newnaggrintnonzs] = pos;
1186 aggrcontnonzbounddists[newnaggrintnonzs] = aggrcontnonzbounddists[nzi];
1190 assert(ncanceledcontnonzs == naggrcontnonzs - newnaggrintnonzs);
1191 naggrcontnonzs = newnaggrintnonzs;
1196 SCIPdebugMsg(scip,
" -> %d continuous variables left (%d/%d active), %d/%d nonzeros, %d/%d aggregations\n",
1197 naggrcontnonzs, nactiveconts, maxconts, naggrcontnonzs + naggrintnonzs, maxaggrnonzs, naggrs, maxaggrs);
1200 if( nactiveconts > maxconts )
1202 SCIPdebugMsg(scip,
" -> abort aggregation: %d/%d active continuous variables\n", nactiveconts, maxconts);
1204 if( naggrcontnonzs + naggrintnonzs > maxaggrnonzs )
1206 SCIPdebugMsg(scip,
" -> abort aggregation: %d/%d nonzeros\n", naggrcontnonzs + naggrintnonzs, maxaggrnonzs);
1262 assert(result !=
NULL);
1266 assert(sepadata !=
NULL);
1272 if( (depth == 0 && sepadata->maxroundsroot >= 0 && ncalls >= sepadata->maxroundsroot)
1273 || (depth > 0 && sepadata->maxrounds >= 0 && ncalls >= sepadata->maxrounds) )
1278 assert(nrows == 0 || rows !=
NULL);
1292 #ifdef IMPLINTSARECONT 1295 nintvars = nvars-ncontvars;
1296 assert(nvars == 0 || vars !=
NULL);
1320 for( v = nintvars; v < nvars; ++v )
1338 if( bestvlbidx >= 0 )
1339 bestlb =
MAX(bestlb, bestvlb);
1340 if( bestvubidx >= 0 )
1341 bestub =
MIN(bestub, bestvub);
1343 bestcontlbs[v-nintvars] = bestlb;
1344 bestcontubs[v-nintvars] = bestub;
1353 maxtries = sepadata->maxtriesroot;
1354 maxfails = sepadata->maxfailsroot;
1355 maxaggrs = sepadata->maxaggrsroot;
1356 maxsepacuts = sepadata->maxsepacutsroot;
1357 maxslack = sepadata->maxslackroot;
1358 maxconts = sepadata->maxcontsroot;
1362 maxtries = sepadata->maxtries;
1363 maxfails = sepadata->maxfails;
1364 maxaggrs = sepadata->maxaggrs;
1365 maxsepacuts = sepadata->maxsepacuts;
1366 maxslack = sepadata->maxslack;
1367 maxconts = sepadata->maxconts;
1372 objnorm =
MAX(objnorm, 1.0);
1379 for( r = 0; r < nrows; r++ )
1390 rowlhsscores[r] = 0.0;
1391 rowrhsscores[r] = 0.0;
1397 roworder[nrows - zerorows] = r;
1415 rownorm =
MAX(rownorm, 0.1);
1419 slack = (activity - lhs)/rownorm;
1420 dualscore =
MAX(dualsol/objnorm, 0.0001);
1423 && rowdensity <= sepadata->maxrowdensity
1424 && rowdensity <= sepadata->maxaggdensity )
1426 rowlhsscores[r] = dualscore + sepadata->densityscore * (1.0-rowdensity)
1427 + sepadata->slackscore *
MAX(1.0 - slack, 0.0);
1428 assert(rowlhsscores[r] > 0.0);
1431 rowlhsscores[r] = 0.0;
1433 slack = (rhs - activity)/rownorm;
1434 dualscore =
MAX(-dualsol/objnorm, 0.0001);
1437 && rowdensity <= sepadata->maxrowdensity
1438 && rowdensity <= sepadata->maxaggdensity )
1440 rowrhsscores[r] = dualscore + sepadata->densityscore * (1.0-rowdensity)
1441 + sepadata->slackscore *
MAX(1.0 - slack, 0.0);
1442 assert(rowrhsscores[r] > 0.0);
1445 rowrhsscores[r] = 0.0;
1447 rowscores[r] =
MAX(rowlhsscores[r], rowrhsscores[r]);
1448 if( rowscores[r] == 0.0 )
1453 roworder[nrows - zerorows] = r;
1459 for( i = nnonzrows; i > 0 && rowscores[r] > rowscores[roworder[i - 1]]; --i )
1460 roworder[i] = roworder[i - 1];
1467 SCIPdebugMsg(scip,
" -> row %d <%s>: lhsscore=%g rhsscore=%g maxscore=%g\n", r,
SCIProwGetName(rows[r]), rowlhsscores[r], rowrhsscores[r], rowscores[r]);
1469 assert(nrows == nnonzrows + zerorows);
1481 for( r = 0; r < nrows && ntries < maxtries && ncuts < maxsepacuts && rowscores[roworder[r]] > 0.0
1488 SCIP_CALL(
aggregation(scip, sepa, sepadata, sol, varsolvals, bestcontlbs, bestcontubs, contvarscorebounds,
1489 rowlhsscores, rowrhsscores, roworder[r], maxaggrs, maxslack, maxconts, &wastried, &cutoff, &ncuts) );
1497 if( ncuts == oldncuts )
1500 if( nfails >= maxfails )
1519 else if ( ncuts > 0 )
1534 assert(scip !=
NULL);
1535 assert(sepa !=
NULL);
1552 assert(sepadata !=
NULL);
1618 sepaExeclpCmir, sepaExecsolCmir,
1621 assert(sepa !=
NULL);
1629 "separating/cmir/maxrounds",
1630 "maximal number of cmir separation rounds per node (-1: unlimited)",
1633 "separating/cmir/maxroundsroot",
1634 "maximal number of cmir separation rounds in the root node (-1: unlimited)",
1637 "separating/cmir/maxtries",
1638 "maximal number of rows to start aggregation with per separation round (-1: unlimited)",
1641 "separating/cmir/maxtriesroot",
1642 "maximal number of rows to start aggregation with per separation round in the root node (-1: unlimited)",
1645 "separating/cmir/maxfails",
1646 "maximal number of consecutive unsuccessful aggregation tries (-1: unlimited)",
1649 "separating/cmir/maxfailsroot",
1650 "maximal number of consecutive unsuccessful aggregation tries in the root node (-1: unlimited)",
1653 "separating/cmir/maxaggrs",
1654 "maximal number of aggregations for each row per separation round",
1657 "separating/cmir/maxaggrsroot",
1658 "maximal number of aggregations for each row per separation round in the root node",
1661 "separating/cmir/maxsepacuts",
1662 "maximal number of cmir cuts separated per separation round",
1665 "separating/cmir/maxsepacutsroot",
1666 "maximal number of cmir cuts separated per separation round in the root node",
1669 "separating/cmir/maxslack",
1670 "maximal slack of rows to be used in aggregation",
1673 "separating/cmir/maxslackroot",
1674 "maximal slack of rows to be used in aggregation in the root node",
1677 "separating/cmir/densityscore",
1678 "weight of row density in the aggregation scoring of the rows",
1681 "separating/cmir/slackscore",
1682 "weight of slack in the aggregation scoring of the rows",
1685 "separating/cmir/maxaggdensity",
1686 "maximal density of aggregated row",
1689 "separating/cmir/maxrowdensity",
1690 "maximal density of row to be used in aggregation",
1693 "separating/cmir/densityoffset",
1694 "additional number of variables allowed in row on top of density",
1697 "separating/cmir/maxrowfac",
1698 "maximal row aggregation factor",
1701 "separating/cmir/maxtestdelta",
1702 "maximal number of different deltas to try (-1: unlimited)",
1705 "separating/cmir/maxconts",
1706 "maximal number of active continuous variables in aggregated row",
1709 "separating/cmir/maxcontsroot",
1710 "maximal number of active continuous variables in aggregated row in the root node",
1713 "separating/cmir/aggrtol",
1714 "tolerance for bound distances used to select continuous variable in current aggregated constraint to be eliminated",
1717 "separating/cmir/trynegscaling",
1718 "should negative values also be tested in scaling?",
1721 "separating/cmir/fixintegralrhs",
1722 "should an additional variable be complemented if f0 = 0?",
1725 "separating/cmir/dynamiccuts",
1726 "should generated cuts be removed from the LP if they are no longer tight?",
enum SCIP_Result SCIP_RESULT
SCIP_RETCODE SCIPincludeSepaCmir(SCIP *scip)
SCIP_Bool SCIPisFeasZero(SCIP *scip, SCIP_Real val)
static SCIP_DECL_SEPAEXECSOL(sepaExecsolCmir)
void SCIPsortedvecInsertDownRealInt(SCIP_Real *realarray, int *intarray, SCIP_Real keyval, int field1val, int *len, int *pos)
static void decreaseRowScore(SCIP *scip, SCIP_Real *rowlhsscores, SCIP_Real *rowrhsscores, int rowidx)
static void updateNActiveConts(SCIP *scip, SCIP_Real *varsolvals, SCIP_Real *bestcontlbs, SCIP_Real *bestcontubs, int nintvars, SCIP_VAR *var, int delta, int *nactiveconts)
SCIP_Real SCIPvarGetLbGlobal(SCIP_VAR *var)
SCIP_Real * SCIPcolGetVals(SCIP_COL *col)
int SCIProwGetNNonz(SCIP_ROW *row)
SCIP_Bool SCIPisPositive(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPvarGetLbLocal(SCIP_VAR *var)
SCIP_Bool SCIPisGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
const char * SCIProwGetName(SCIP_ROW *row)
static SCIP_DECL_SEPACOPY(sepaCopyCmir)
int SCIProwGetNLPNonz(SCIP_ROW *row)
SCIP_RETCODE SCIPgetVarsData(SCIP *scip, SCIP_VAR ***vars, int *nvars, int *nbinvars, int *nintvars, int *nimplvars, int *ncontvars)
SCIP_Real SCIProwGetLhs(SCIP_ROW *row)
#define DEFAULT_TRYNEGSCALING
SCIP_Real SCIPinfinity(SCIP *scip)
int SCIPsnprintf(char *t, int len, const char *s,...)
const char * SCIPsepaGetName(SCIP_SEPA *sepa)
enum SCIP_Retcode SCIP_RETCODE
#define DEFAULT_SLACKSCORE
int SCIPvarGetProbindex(SCIP_VAR *var)
SCIP_Real SCIPgetVectorEfficacyNorm(SCIP *scip, SCIP_Real *vals, int nvals)
SCIP_RETCODE SCIPcalcMIR(SCIP *scip, SCIP_SOL *sol, SCIP_Real boundswitch, SCIP_Bool usevbds, SCIP_Bool allowlocal, SCIP_Bool fixintegralrhs, int *boundsfortrans, SCIP_BOUNDTYPE *boundtypesfortrans, int maxmksetcoefs, SCIP_Real maxweightrange, SCIP_Real minfrac, SCIP_Real maxfrac, SCIP_Real *weights, SCIP_Real maxweight, int *weightinds, int nweightinds, int rowlensum, int *sidetypes, SCIP_Real scale, SCIP_Real *mksetcoefs, SCIP_Bool *mksetcoefsvalid, SCIP_Real *mircoef, SCIP_Real *mirrhs, SCIP_Real *cutactivity, SCIP_Bool *success, SCIP_Bool *cutislocal, int *cutrank)
#define SCIPfreeBlockMemory(scip, ptr)
static SCIP_RETCODE tryDelta(SCIP *scip, SCIP_SOL *sol, int nvars, SCIP_Real *rowweights, SCIP_Real maxweight, int *weightinds, int nweightinds, int rowlensum, SCIP_Real *cutcoefs, SCIP_Real *mksetcoefs, SCIP_Bool *mksetcoefsvalid, SCIP_Real *testeddeltas, int *ntesteddeltas, SCIP_Real delta, SCIP_Real boundswitch, SCIP_Bool usevbds, SCIP_Bool allowlocal, SCIP_Bool fixintegralrhs, int maxmksetcoefs, SCIP_Real maxweightrange, SCIP_Real minfrac, SCIP_Real maxfrac, SCIP_Real *bestdelta, SCIP_Real *bestefficacy)
static SCIP_Real getBounddist(SCIP *scip, int nintvars, SCIP_Real *varsolvals, SCIP_Real *bestcontlbs, SCIP_Real *bestcontubs, SCIP_VAR *var)
#define DEFAULT_MAXAGGDENSITY
SCIP_Bool SCIPisEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
#define SCIPfreeBufferArray(scip, ptr)
#define SCIPallocBlockMemory(scip, ptr)
int SCIPgetNLPBranchCands(SCIP *scip)
SCIP_RETCODE SCIPgetLPColsData(SCIP *scip, SCIP_COL ***cols, int *ncols)
SCIP_RETCODE SCIPsetSepaCopy(SCIP *scip, SCIP_SEPA *sepa, SCIP_DECL_SEPACOPY((*sepacopy)))
SCIP_Real SCIProwGetDualsol(SCIP_ROW *row)
#define SCIPdebugMsgPrint
SCIP_RETCODE SCIPaddIntParam(SCIP *scip, const char *name, const char *desc, int *valueptr, SCIP_Bool isadvanced, int defaultvalue, int minvalue, int maxvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
int SCIPgetNContVars(SCIP *scip)
SCIP_Real SCIPgetObjNorm(SCIP *scip)
SCIP_Real SCIPepsilon(SCIP *scip)
SCIP_RETCODE SCIPgetVarClosestVlb(SCIP *scip, SCIP_VAR *var, SCIP_SOL *sol, SCIP_Real *closestvlb, int *closestvlbidx)
SCIP_Real SCIPgetRowMaxCoef(SCIP *scip, SCIP_ROW *row)
#define DEFAULT_FIXINTEGRALRHS
SCIP_SEPADATA * SCIPsepaGetData(SCIP_SEPA *sepa)
#define DEFAULT_MAXROUNDSROOT
SCIP_Real SCIPvarGetUbGlobal(SCIP_VAR *var)
SCIP_Bool SCIPisCutEfficacious(SCIP *scip, SCIP_SOL *sol, SCIP_ROW *cut)
#define MAXAGGRLEN(nvars)
SCIP_Real SCIPgetRowMinCoef(SCIP *scip, SCIP_ROW *row)
static SCIP_DECL_SEPAEXECLP(sepaExeclpCmir)
SCIP_Bool SCIPisLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_ROW ** SCIPcolGetRows(SCIP_COL *col)
SCIP_RETCODE SCIPgetSolVals(SCIP *scip, SCIP_SOL *sol, int nvars, SCIP_VAR **vars, SCIP_Real *vals)
#define DEFAULT_MAXSEPACUTS
SCIP_Bool SCIProwIsLocal(SCIP_ROW *row)
static SCIP_Bool varIsContinuous(SCIP_VAR *var)
int SCIPsepaGetNCallsAtNode(SCIP_SEPA *sepa)
SCIP_Bool SCIPisEfficacious(SCIP *scip, SCIP_Real efficacy)
const char * SCIPvarGetName(SCIP_VAR *var)
void SCIPsepaSetData(SCIP_SEPA *sepa, SCIP_SEPADATA *sepadata)
complemented mixed integer rounding cuts separator (Marchand's version)
#define DEFAULT_DENSITYSCORE
SCIP_Bool SCIPisFeasGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_RETCODE SCIPgetVarClosestVub(SCIP *scip, SCIP_VAR *var, SCIP_SOL *sol, SCIP_Real *closestvub, int *closestvubidx)
#define DEFAULT_MAXSEPACUTSROOT
SCIP_Real SCIProwGetRhs(SCIP_ROW *row)
SCIP_RETCODE SCIPaddCut(SCIP *scip, SCIP_SOL *sol, SCIP_ROW *cut, SCIP_Bool forcecut, SCIP_Bool *infeasible)
SCIP_Bool SCIProwIsModifiable(SCIP_ROW *row)
SCIP_COL ** SCIProwGetCols(SCIP_ROW *row)
SCIP_RETCODE SCIPincludeSepaBasic(SCIP *scip, SCIP_SEPA **sepa, const char *name, const char *desc, int priority, int freq, SCIP_Real maxbounddist, SCIP_Bool usessubscip, SCIP_Bool delay, SCIP_DECL_SEPAEXECLP((*sepaexeclp)), SCIP_DECL_SEPAEXECSOL((*sepaexecsol)), SCIP_SEPADATA *sepadata)
#define SCIPallocBufferArray(scip, ptr, num)
SCIP_Real * SCIProwGetVals(SCIP_ROW *row)
public data structures and miscellaneous methods
#define DEFAULT_MAXCONTSROOT
SCIP_LPSOLSTAT SCIPgetLPSolstat(SCIP *scip)
int SCIPgetNImplVars(SCIP *scip)
#define DEFAULT_DYNAMICCUTS
int SCIPgetDepth(SCIP *scip)
SCIP_RETCODE SCIPcutGenerationHeuristicCmir(SCIP *scip, SCIP_SEPA *sepa, SCIP_SOL *sol, SCIP_Real *varsolvals, int maxtestdelta, SCIP_Real *rowweights, SCIP_Real maxweight, int *weightinds, int nweightinds, int rowlensum, SCIP_Real boundswitch, SCIP_Bool usevbds, SCIP_Bool allowlocal, SCIP_Bool fixintegralrhs, int maxmksetcoefs, SCIP_Real maxweightrange, SCIP_Real minfrac, SCIP_Real maxfrac, SCIP_Bool trynegscaling, SCIP_Bool cutremovable, const char *cutclassname, SCIP_Bool *cutoff, int *ncuts, SCIP_Real *delta, SCIP_Bool *deltavalid)
static SCIP_RETCODE addCut(SCIP *scip, SCIP_SEPA *sepa, SCIP_SOL *sol, SCIP_Real *varsolvals, SCIP_Real *cutcoefs, SCIP_Real cutrhs, SCIP_Bool cutislocal, SCIP_Bool cutremovable, int cutrank, const char *cutclassname, SCIP_Bool *cutoff, int *ncuts)
SCIP_RETCODE SCIPaddPoolCut(SCIP *scip, SCIP_ROW *row)
static SCIP_RETCODE aggregation(SCIP *scip, SCIP_SEPA *sepa, SCIP_SEPADATA *sepadata, SCIP_SOL *sol, SCIP_Real *varsolvals, SCIP_Real *bestcontlbs, SCIP_Real *bestcontubs, SCIP_Real *contvarscorebounds, SCIP_Real *rowlhsscores, SCIP_Real *rowrhsscores, int startrow, int maxaggrs, SCIP_Real maxslack, int maxconts, SCIP_Bool *wastried, SCIP_Bool *cutoff, int *ncuts)
SCIP_RETCODE SCIPcreateEmptyRowSepa(SCIP *scip, SCIP_ROW **row, SCIP_SEPA *sepa, const char *name, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool removable)
SCIP_Real SCIPgetCutEfficacy(SCIP *scip, SCIP_SOL *sol, SCIP_ROW *cut)
SCIP_Bool SCIPisInfinity(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPgetRowSolActivity(SCIP *scip, SCIP_ROW *row, SCIP_SOL *sol)
int SCIProwGetRank(SCIP_ROW *row)
#define DEFAULT_MAXROUNDS
int SCIPgetNVars(SCIP *scip)
SCIP_RETCODE SCIPreleaseRow(SCIP *scip, SCIP_ROW **row)
SCIP_RETCODE SCIPsetSepaFree(SCIP *scip, SCIP_SEPA *sepa, SCIP_DECL_SEPAFREE((*sepafree)))
SCIP_Bool SCIPisGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
#define DEFAULT_MAXROWFAC
SCIP_VAR * SCIPcolGetVar(SCIP_COL *col)
#define DEFAULT_DENSITYOFFSET
void SCIProwChgRank(SCIP_ROW *row, int rank)
#define DEFAULT_MAXTRIESROOT
SCIP_VAR ** SCIPgetVars(SCIP *scip)
int SCIProwGetLPPos(SCIP_ROW *row)
SCIP_RETCODE SCIPaddVarsToRow(SCIP *scip, SCIP_ROW *row, int nvars, SCIP_VAR **vars, SCIP_Real *vals)
SCIP_Bool SCIPisStopped(SCIP *scip)
static SCIP_RETCODE storeCutInArrays(SCIP *scip, int nvars, SCIP_VAR **vars, SCIP_Real *cutcoefs, SCIP_Real *varsolvals, SCIP_VAR **cutvars, SCIP_Real *cutvals, int *cutlen, SCIP_Real *cutact)
#define DEFAULT_MAXAGGRSROOT
SCIP_RETCODE SCIPprintRow(SCIP *scip, SCIP_ROW *row, FILE *file)
#define DEFAULT_MAXTESTDELTA
SCIP_VARTYPE SCIPvarGetType(SCIP_VAR *var)
static SCIP_DECL_SEPAFREE(sepaFreeCmir)
SCIP_Bool SCIPisZero(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
enum SCIP_Vartype SCIP_VARTYPE
SCIP_Real SCIPvarGetUbLocal(SCIP_VAR *var)
SCIP_Bool SCIPisFeasIntegral(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPsumepsilon(SCIP *scip)
#define BMSclearMemoryArray(ptr, num)
SCIP_RETCODE SCIPgetLPRowsData(SCIP *scip, SCIP_ROW ***rows, int *nrows)
static SCIP_RETCODE separateCuts(SCIP *scip, SCIP_SEPA *sepa, SCIP_SOL *sol, SCIP_RESULT *result)
#define DEFAULT_MAXROWDENSITY
#define DEFAULT_MAXSLACKROOT
SCIP_Longint SCIPgetNLPs(SCIP *scip)
int SCIPcolGetNLPNonz(SCIP_COL *col)
int SCIPcolGetLPPos(SCIP_COL *col)
SCIP_Bool SCIPvarIsIntegral(SCIP_VAR *var)
SCIP_RETCODE SCIPmakeRowIntegral(SCIP *scip, SCIP_ROW *row, SCIP_Real mindelta, SCIP_Real maxdelta, SCIP_Longint maxdnom, SCIP_Real maxscale, SCIP_Bool usecontvars, SCIP_Bool *success)
SCIP_Real SCIProwGetNorm(SCIP_ROW *row)
void SCIPsortedvecInsertInt(int *intarray, int keyval, int *len, int *pos)
#define SEPA_MAXBOUNDDIST
SCIP_RETCODE SCIPaddRealParam(SCIP *scip, const char *name, const char *desc, SCIP_Real *valueptr, SCIP_Bool isadvanced, SCIP_Real defaultvalue, SCIP_Real minvalue, SCIP_Real maxvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
#define DEFAULT_MAXFAILSROOT
struct SCIP_SepaData SCIP_SEPADATA
SCIP_RETCODE SCIPaddBoolParam(SCIP *scip, const char *name, const char *desc, SCIP_Bool *valueptr, SCIP_Bool isadvanced, SCIP_Bool defaultvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
int SCIPgetNSepaRounds(SCIP *scip)
SCIP_Bool SCIPvarIsActive(SCIP_VAR *var)