138#define SEPA_NAME "lagromory"
139#define SEPA_DESC "separator for Lagromory cuts for MIP relaxations"
140#define SEPA_PRIORITY -8000
142#define SEPA_MAXBOUNDDIST 1.0
143#define SEPA_USESSUBSCIP FALSE
144#define SEPA_DELAY FALSE
147#define DEFAULT_AWAY 0.01
148#define DEFAULT_DELAYEDCUTS FALSE
149#define DEFAULT_SEPARATEROWS TRUE
150#define DEFAULT_SORTCUTOFFSOL TRUE
151#define DEFAULT_SIDETYPEBASIS TRUE
152#define DEFAULT_DYNAMICCUTS TRUE
153#define DEFAULT_MAKEINTEGRAL FALSE
154#define DEFAULT_FORCECUTS FALSE
155#define DEFAULT_ALLOWLOCAL FALSE
158#define DEFAULT_MAXROUNDSROOT 1
159#define DEFAULT_MAXROUNDS 1
160#define DEFAULT_DUALDEGENERACYRATETHRESHOLD 0.5
161#define DEFAULT_VARCONSRATIOTHRESHOLD 1.0
162#define DEFAULT_MINRESTART 1
164#define DEFAULT_PERLPMAXCUTSROOT 50
165#define DEFAULT_PERLPMAXCUTS 10
166#define DEFAULT_PERROUNDLPITERLIMITFACTOR -1.0
168#define DEFAULT_ROOTLPITERLIMITFACTOR -1.0
170#define DEFAULT_TOTALLPITERLIMITFACTOR -1.0
172#define DEFAULT_PERROUNDMAXLPITERS 50000
173#define DEFAULT_PERROUNDCUTSFACTORROOT 1.0
175#define DEFAULT_PERROUNDCUTSFACTOR 0.5
177#define DEFAULT_TOTALCUTSFACTOR 50.0
178#define DEFAULT_MAXMAINITERS 4
179#define DEFAULT_MAXSUBGRADIENTITERS 6
182#define DEFAULT_MUPARAMCONST TRUE
183#define DEFAULT_MUPARAMINIT 0.01
184#define DEFAULT_MUPARAMLB 0.0
185#define DEFAULT_MUPARAMUB 2.0
186#define DEFAULT_MUBACKTRACKFACTOR 0.5
188#define DEFAULT_MUSLAB1FACTOR 10.0
190#define DEFAULT_MUSLAB2FACTOR 2.0
192#define DEFAULT_MUSLAB3FACTOR 0.5
194#define DEFAULT_DELTASLAB1UB 0.001
196#define DEFAULT_DELTASLAB2UB 0.01
198#define DEFAULT_UBPARAMPOSFACTOR 2.0
200#define DEFAULT_UBPARAMNEGFACTOR 0.5
202#define DEFAULT_MAXLAGRANGIANVALSFORAVG 2
203#define DEFAULT_MAXCONSECITERSFORMUUPDATE 10
204#define DEFAULT_PERROOTLPITERFACTOR 0.2
206#define DEFAULT_PERLPITERFACTOR 0.1
208#define DEFAULT_CUTGENFREQ 1
209#define DEFAULT_CUTADDFREQ 1
210#define DEFAULT_CUTSFILTERFACTOR 1.0
211#define DEFAULT_OPTIMALFACEPRIORITY 2
213#define DEFAULT_AGGREGATECUTS TRUE
216#define DEFAULT_PROJECTIONTYPE 2
219#define DEFAULT_STABILITYCENTERTYPE 1
221#define DEFAULT_RADIUSINIT 0.5
222#define DEFAULT_RADIUSMAX 20.0
223#define DEFAULT_RADIUSMIN 1e-6
224#define DEFAULT_CONST 2.0
225#define DEFAULT_RADIUSUPDATEWEIGHT 0.98
229#define MAKECONTINTEGRAL FALSE
230#define POSTPROCESS TRUE
231#define BOUNDSWITCH 0.9999
232#define VARTYPEUSEVBDS 2
234#define FIXINTEGRALRHS FALSE
235#define MAXAGGRLEN(ncols) (0.1*(ncols)+1000)
260 int nrowsinhardcutslp;
261 int nrunsinsoftcutslp;
271 int nmaxcutsperlproot;
279 int perroundnmaxlpiters;
286 int nmaxsubgradientiters;
287 int nmaxperroundlpiters;
290 int nmaxtotallpiters;
292 int nmaxperroundcutsroot;
293 int nmaxperroundcuts;
317 int nmaxlagrangianvalsforavg;
318 int nmaxconsecitersformuupdate;
326 int optimalfacepriority;
334 int stabilitycentertype;
362 unsigned int nintcols;
372 nruns =
sepadata->nrunsinsoftcutslp;
382 if( nruns != runnum )
389 sepadata->nmaxrootlpiters = (int)(
sepadata->rootlpiterlimitfactor * nrootlpiters);
395 sepadata->nmaxtotallpiters = (int)(
sepadata->totallpiterlimitfactor * nrootlpiters);
401 sepadata->nmaxperroundlpiters = (int)(
sepadata->perroundlpiterlimitfactor * nrootlpiters);
406 if(
sepadata->perroundnmaxlpiters > 0 )
411 for(
i = 0;
i < ncols; ++
i )
414 sepadata->nmaxperroundcutsroot = (int)(
sepadata->perroundcutsfactorroot * nintcols);
415 sepadata->nmaxperroundcuts = (int)(
sepadata->perroundcutsfactor * nintcols);
424 sepadata->nrunsinsoftcutslp = runnum;
509 for(
i = 0;
i < ncols; ++
i )
524 for(
i = 0;
i < nrows; ++
i )
539 for(
i = 0;
i < nrows; ++
i )
542 assert(nrownonz <= ncols);
546 rowbegs[
i + 1] = rowbegs[
i] + nrownonz;
551 for( j = 0; j < nrownonz; ++j )
555 assert(collppos <= ncols);
557 rowcolinds[rowbegs[
i] + j] = collppos;
558 rowvals[rowbegs[
i] + j] = rowval[j];
583 for(
i =
sepadata->nrowsinhardcutslp - nrows;
i < ncuts; ++
i )
598 for(
i =
sepadata->nrowsinhardcutslp - nrows;
i < ncuts; ++
i )
601 assert(nrownonz <= ncols);
605 rowbegs[
i -
sepadata->nrowsinhardcutslp + nrows + 1] = rowbegs[
i -
sepadata->nrowsinhardcutslp + nrows] +
613 for( j = 0; j < nrownonz; ++j )
617 assert(collppos <= ncols);
619 rowcolinds[rowbegs[
i -
sepadata->nrowsinhardcutslp + nrows] + j] = collppos;
620 rowvals[rowbegs[
i -
sepadata->nrowsinhardcutslp + nrows] + j] = rowval[j];
626 rowbegs[(ncuts -
sepadata->nrowsinhardcutslp + nrows)], rowbegs, rowcolinds, rowvals) );
633 sepadata->nrowsinhardcutslp = nrows + ncuts;
657 if( (*sepadata)->lpiwithhardcuts !=
NULL )
662 (*sepadata)->nrowsinhardcutslp = 0;
663 (*sepadata)->nrunsinsoftcutslp = 0;
664 (*sepadata)->ncalls = 0;
665 (*sepadata)->nmaxperroundlpiters = 0;
666 (*sepadata)->nmaxrootlpiters = 0;
667 (*sepadata)->nrootlpiters = 0;
668 (*sepadata)->nmaxtotallpiters = 0;
669 (*sepadata)->ntotallpiters = 0;
670 (*sepadata)->nmaxperroundcutsroot = 0;
671 (*sepadata)->nmaxperroundcuts = 0;
672 (*sepadata)->nmaxtotalcuts = 0;
673 (*sepadata)->ntotalcuts = 0;
687 int subgradientiternum,
712 delta = ubparam - bestlagrangianval;
721 muslab1factor =
sepadata->muslab1factor;
722 muslab2factor =
sepadata->muslab2factor;
723 muslab3factor =
sepadata->muslab3factor;
729 muslab1factor =
sepadata->muslab1factor;
730 muslab2factor =
sepadata->muslab3factor;
731 muslab3factor =
sepadata->muslab2factor;
735 muslab1factor =
sepadata->muslab3factor;
736 muslab2factor =
sepadata->muslab1factor;
737 muslab3factor =
sepadata->muslab2factor;
745 muslab1factor =
sepadata->muslab2factor;
746 muslab2factor =
sepadata->muslab1factor;
747 muslab3factor =
sepadata->muslab3factor;
753 muslab1factor =
sepadata->muslab2factor;
754 muslab2factor =
sepadata->muslab3factor;
755 muslab3factor =
sepadata->muslab1factor;
759 muslab1factor =
sepadata->muslab3factor;
760 muslab2factor =
sepadata->muslab2factor;
761 muslab3factor =
sepadata->muslab1factor;
770 if( subgradientiternum >= maxiters )
772 for(
i = subgradientiternum - maxiters;
i < subgradientiternum;
i++ )
774 if(
SCIPisGE(
scip, lagrangianvals[
i], bestlagrangianval - delta) )
778 if(
i == subgradientiternum )
780 *muparam *=
sepadata->mubacktrackfactor;
786 if( (subgradientiternum < maxiters) || (
i >= 0 &&
i < subgradientiternum) )
788 if( bestlagrangianval - avglagrangianval < deltaslab1ub * delta )
789 *muparam *= muslab1factor;
790 else if( bestlagrangianval - avglagrangianval < deltaslab2ub * delta )
791 *muparam *= muslab2factor;
793 *muparam *= muslab3factor;
818 int* nnzsubgradientdualprod,
824 int nzerosubgradient;
836 *nnzsubgradientdualprod = 0;
837 *maxnzsubgradientdualprod = 0.0;
838 nzerosubgradient = 0;
839 *subgradientzero =
FALSE;
842 for(
i = 0;
i < ncuts;
i++ )
850 subgradient[
i] = 0.0;
859 *maxcutviol =
MAX(*maxcutviol, subgradient[
i]);
865 (*nnzsubgradientdualprod)++;
866 term =
REALABS(subgradient[
i] * dualvector[
i]);
867 *maxnzsubgradientdualprod =
MAX(*maxnzsubgradientdualprod, term);
873 if( nzerosubgradient == ncuts )
874 *subgradientzero =
TRUE;
894 for(
i = 0;
i < ncuts;
i++ )
917 for(
i = 0;
i < ncuts;
i++ )
918 normsquared +=
SQR(subgradient[
i]);
921 *steplength = (muparam * (ubparam - lagrangianval))/(normsquared);
950 if( maxviolscoreimproved && nviolscoreimproved )
953 if(
sepadata->optimalfacepriority <= 1 )
956 *ballradius =
MIN(*ballradius,
sepadata->radiusmax);
961 *ballradius =
MIN(*ballradius,
sepadata->radiusmax/2.0);
964 else if( !maxviolscoreimproved && !nviolscoreimproved )
968 *ballradius =
MAX(*ballradius,
sepadata->radiusmin);
970 else if( nlpiters == 0 )
974 if(
sepadata->optimalfacepriority <= 1 )
977 *ballradius =
MIN(*ballradius,
sepadata->radiusmax);
982 *ballradius =
MIN(*ballradius,
sepadata->radiusmax/2.0);
1020 for(
i = 1;
i < dualvectorlen;
i++ )
1030 for(
i = 0;
i < dualvectorlen;
i++ )
1037 temp1vals[0] =
REALABS(dualvector[0]);
1040 pivotparam =
REALABS(dualvector[0]) - radius;
1042 for(
i = 1;
i < dualvectorlen;
i++ )
1046 pivotparam += ((
REALABS(dualvector[
i]) - pivotparam) / (temp1len + 1));
1049 temp1vals[temp1len] =
REALABS(dualvector[
i]);
1050 temp1inds[temp1len] =
i;
1055 for( j = 0; j < temp1len; j++ )
1057 temp2vals[temp2len + j] = temp1vals[j];
1058 temp2inds[temp2len + j] = temp1inds[j];
1060 temp2len += temp1len;
1061 temp1vals[0] =
REALABS(dualvector[
i]);
1064 pivotparam =
REALABS(dualvector[
i]) - radius;
1069 for(
i = 0;
i < temp2len;
i++ )
1073 temp1vals[temp1len] = temp2vals[
i];
1074 temp1inds[temp1len] = temp2inds[
i];
1076 pivotparam += ((temp2vals[
i] - pivotparam) / temp1len);
1080 temp1changed =
TRUE;
1082 while( temp1changed )
1084 temp1changed =
FALSE;
1086 for(
i = 0;
i < temp1len;
i++ )
1091 if( (temp1inds[
i] >= 0) &&
SCIPisLE(
scip, temp1vals[
i], pivotparam) )
1094 temp1changed =
TRUE;
1096 assert(temp1len - ntemp1removed > 0);
1098 pivotparam += ((pivotparam - temp1vals[
i]) / (temp1len - ntemp1removed));
1103 for(
i = 0;
i < dualvectorlen;
i++ )
1106 val =
MAX(term - pivotparam, 0.0);
1110 dualvector[
i] = val;
1114 dualvector[
i] = -val;
1119 for(
i = 0;
i < dualvectorlen;
i++ )
1151 for(
i = 0;
i < dualvectorlen;
i++ )
1152 l2norm +=
SQR(dualvector[
i]);
1153 l2norm = sqrt(l2norm);
1154 factor = radius/(1.0 + l2norm);
1159 for(
i = 0;
i < dualvectorlen;
i++ )
1160 dualvector[
i] *= factor;
1178 for(
i = 0;
i < dualvectorlen;
i++ )
1181 dualvector[
i] = -radius;
1183 dualvector[
i] = radius;
1197 int stabilitycenterlen,
1198 int nbestdualupdates,
1210 weight =
MIN(constant, (totaliternum + 1 + nbestdualupdates) / 2.0);
1211 alpha = 1.0 / weight;
1213 assert(dualvectorlen >= stabilitycenterlen);
1216 for(
i = 0;
i < stabilitycenterlen;
i++ )
1217 dualvector[
i] =
alpha * dualvector[
i] + (1 -
alpha) * stabilitycenter[
i];
1219 for(
i = stabilitycenterlen;
i < dualvectorlen;
i++ )
1220 dualvector[
i] =
alpha * dualvector[
i];
1231 int bestdualvectorlen,
1232 int nbestdualupdates,
1233 int subgradientiternum,
1250 if( subgradientiternum >= 1 )
1257 if(
sepadata->projectiontype == 1 )
1262 else if(
sepadata->projectiontype == 2 )
1267 else if(
sepadata->projectiontype == 3 )
1274 if(
sepadata->stabilitycentertype == 1 )
1291 int ndualvector2updates,
1292 int subgradientiternum,
1315 assert(dualvector2len <= ncuts);
1318 *dualvecsdiffer =
FALSE;
1323 for(
i = 0;
i < ncuts;
i++ )
1324 dualvector1copy[
i] = dualvector1[
i];
1331 assert((subgradient !=
NULL) || (ncuts == 0));
1332 assert(subgradientiternum >= 0);
1335 for(
i = 0;
i < ncuts;
i++ )
1338 dualvector1[
i] += steplength * subgradient[
i];
1342 for(
i = 0;
i < ncuts;
i++ )
1345 dualvector1[
i] =
MAX(dualvector1[
i], 0.0);
1350 ndualvector2updates, subgradientiternum, totaliternum, maxviolscore, maxviolscoreold, nviolscore,
1351 nviolscoreold, nlpiters, ballradius) );
1354 for(
i = 0;
i < ncuts;
i++ )
1355 dualvector1[
i] =
MAX(dualvector1[
i], 0.0);
1362 for(
i = 0;
i < dualvector2len;
i++ )
1363 dualvector1[
i] = dualvector2[
i];
1365 for(
i = dualvector2len;
i < ncuts;
i++ )
1366 dualvector1[
i] = 0.0;
1370 for(
i = 0;
i < ncuts;
i++ )
1374 *dualvecsdiffer =
TRUE;
1380 for(
i = 0;
i < ncuts;
i++ )
1381 dualvector1copy[
i] = 0.0;
1396 int nnewaddedsoftcuts,
1398 int nyettoaddsoftcuts,
1401 int ngeneratedcurrroundcuts,
1402 int nmaxgeneratedperroundcuts,
1403 int ncurrroundlpiters,
1413 if( (nnewaddedsoftcuts == 0) && (nyettoaddsoftcuts == 0) && !objvecsdiffer )
1417 if( ngeneratedcurrroundcuts >= nmaxgeneratedperroundcuts )
1425 if( (
sepadata->nmaxperroundlpiters >= 0) && (ncurrroundlpiters >=
sepadata->nmaxperroundlpiters) )
1450 int* ncurrroundlpiters
1486 if( timelimit <= 0.0 )
1504 else if( (
depth > 0) &&
1509 if(
sepadata->nmaxperroundlpiters >= 0 )
1511 if(
sepadata->nmaxperroundlpiters - *ncurrroundlpiters >= 0 )
1513 if( iterlimit >= 0 )
1514 iterlimit =
MIN(iterlimit,
sepadata->nmaxperroundlpiters - *ncurrroundlpiters);
1516 iterlimit =
sepadata->nmaxperroundlpiters - *ncurrroundlpiters;
1549 for(
i = 0;
i < ncols; ++
i )
1567 sepadata->nrootlpiters += (int)nlpiters;
1569 sepadata->ntotallpiters += (int)nlpiters;
1570 *ncurrroundlpiters += (int)nlpiters;
1605 if( timelimit <= 0.0 )
1625 for(
i = 0;
i < ncols; ++
i )
1647 int subgradientiternum,
1658 int ngeneratedcurrroundcuts,
1659 int* ngeneratednewcuts,
1670 assert(mainiternum >= 0);
1678 SCIPdebugMsg(
scip,
" -> Lagromory cut detected node infeasibility with cut 0 <= %g.\n", cutrhs);
1692 if( subgradientiternum >= 0 )
1695 sepadata->ncalls, mainiternum, subgradientiternum, ngeneratedcurrroundcuts + *ngeneratednewcuts);
1700 sepadata->ncalls, mainiternum, ngeneratedcurrroundcuts + *ngeneratednewcuts);
1716 for( v = 0; v < cutnnz; ++v )
1728 SCIPdebugMsg(
scip,
" -> Lagromory cut detected node infeasibility with cut 0 <= %g.\n", cutrhs);
1741 SCIPdebugMsg(
scip,
" -> %s cut <%s>: rhs=%f, eff=%f\n",
"lagromory", cutname, cutrhs, cutefficacy);
1756 SCIPdebugMsg(
scip,
"cut <%s> is infeasible (sides=[%g,%g], act=[%g,%g])\n",
1763 generatedcuts[ngeneratedcurrroundcuts + *ngeneratednewcuts] = cut;
1764 generatedcutefficacies[ngeneratedcurrroundcuts + *ngeneratednewcuts] = cutefficacy;
1765 ++(*ngeneratednewcuts);
1780 int bestdualvectorlen,
1831 aggrindicator =
FALSE;
1844 for(
i = 0;
i < bestdualvectorlen;
i++ )
1846 multiplier = bestdualvector[
i];
1849 cut = generatedcuts[
i];
1859 for( j = 0; j < cutnnz; j++ )
1863 assert(collppos <= ncols);
1877 aggrcutrank =
MAX(aggrcutrank, cutrank);
1879 aggrindicator =
TRUE;
1883 aggrcutislocal = (nlocalcuts > 0 ?
TRUE :
FALSE);
1892 for(
i = 0;
i < ncols;
i++ )
1898 aggrcutcoefs[aggrcutnnz] = aggrcutvals[
i];
1899 aggrcutinds[aggrcutnnz] =
i;
1906 SCIPdebugMsg(
scip,
" -> Lagromory cut detected node infeasibility with cut 0 <= %g.\n", aggrcutrhs);
1917 aggrcutconst, aggrcutislocal,
FALSE,
sepadata->dynamiccuts) );
1926 for(
i = 0;
i < aggrcutnnz;
i++ )
1938 SCIPdebugMsg(
scip,
" -> Lagromory cut detected node infeasibility with cut 0 <= %g.\n", aggrcutrhs);
1951 SCIPdebugMsg(
scip,
" -> %s cut <%s>: rhs=%f\n",
"lagromory", aggrcutname, aggrcutrhs);
1966 SCIPdebugMsg(
scip,
"cut <%s> is infeasible (sides=[%g,%g], act=[%g,%g])\n",
1967 SCIProwGetName(aggrcut), cutlhs, cutrhs, minactivity, maxactivity);
1973 aggrcuts[*naggrcuts] = aggrcut;
1978 for(
i = 0;
i < ncols;
i++ )
1980 aggrcutvals[
i] = 0.0;
2002 int subgradientiternum,
2005 int nmaxgeneratedperroundcuts,
2010 int ngeneratedcurrroundcuts,
2011 int* ngeneratednewcuts,
2051 *ngeneratednewcuts = 0;
2067 for(
i = 0;
i < nrows; ++
i )
2103 if(
frac >= minfrac )
2124 if( (ngeneratedcurrroundcuts + *ngeneratednewcuts >= nmaxgeneratedperroundcuts) ||
2126 (*ngeneratednewcuts >= nmaxcutsperlp) )
2133 if( basisfrac[
i] == 0.0 )
2159 NULL, minfrac, maxfrac, 1.0, aggrrow, cutcoefs, &cutrhs, cutinds, &cutnnz, &cutefficacy, &cutrank,
2160 &cutislocal, &success) );
2164 assert(allowlocal || !cutislocal);
2167 cutefficacy, cutrhs, cutislocal, cutrank, generatedcurrroundcuts, generatedcutefficacies,
2168 ngeneratedcurrroundcuts, ngeneratednewcuts,
cutoff));
2218 *objvecsdiffer =
FALSE;
2221 for(
i = 0;
i < ncuts;
i++ )
2234 for( j = 0; j < cutnnz; ++j )
2238 assert(collppos <= ncols);
2240 prod[collppos] += dualvector[
i] * cutvals[j];
2246 for(
i = 0;
i < ncols;
i++ )
2250 objvals[
i] = origobjcoefs[
i] + prod[
i];
2255 if( !(*objvecsdiffer) && !
SCIPisEQ(
scip, oldobjvals[
i], objvals[
i]) )
2256 *objvecsdiffer =
TRUE;
2259 for(
i = 0;
i < ncols;
i++)
2277 int* nnewaddedsoftcuts
2282 assert(*naddedcuts <= ngeneratedcuts);
2285 for(
i = *naddedcuts;
i < ngeneratedcuts;
i++ )
2286 dualvector[
i] = 0.0;
2288 *nnewaddedsoftcuts = ngeneratedcuts - *naddedcuts;
2289 *naddedcuts = ngeneratedcuts;
2308 int nmaxgeneratedperroundcuts,
2316 int* ngeneratedcutsperiter,
2317 int* ngeneratedcurrroundcuts,
2318 int* ncurrroundlpiters,
2323 int* bestdualvectorlen,
2325 int* nbestdualupdates,
2351 int ncurrroundlpiterslast;
2353 int nnewaddedsoftcuts;
2355 int nnzsubgradientdualprod;
2365 avglagrangianval = 0.0;
2366 maxsoftcutviol = 0.0;
2367 maxnzsubgradientdualprod = 0.0;
2373 nnzsubgradientdualprod = 0;
2375 objvecsdiffer =
FALSE;
2379 if( *nsoftcuts > 0 )
2386 nmaxgeneratedperroundcuts, *ncurrroundlpiters,
depth, &terminate) );
2392 subgradientzero =
FALSE;
2393 objvecsdiffer =
FALSE;
2394 dualvecsdiffer =
FALSE;
2395 nnewaddedsoftcuts = 0;
2396 scoreweight *=
sepadata->radiusupdateweight;
2398 ncurrroundlpiterslast = *ncurrroundlpiters;
2403 ncurrroundlpiters) );
2405 nlpiters = *ncurrroundlpiters - ncurrroundlpiterslast;
2411 if( (nlpiters >= 1) && (
i %
sepadata->cutgenfreq == 0) )
2413 int ngeneratednewcuts = 0;
2415 nmaxgeneratedperroundcuts, allowlocal, generatedcurrroundcuts, generatedcutefficacies,
2416 *ngeneratedcurrroundcuts, &ngeneratednewcuts,
depth,
cutoff));
2417 sepadata->ntotalcuts += ngeneratednewcuts;
2418 *ngeneratedcurrroundcuts += ngeneratednewcuts;
2419 ngeneratedcutsperiter[mainiternum *
sepadata->nmaxsubgradientiters +
i + 1] = ngeneratednewcuts;
2424 &nsoftcutviols, &maxsoftcutviol, &nnzsubgradientdualprod, &maxnzsubgradientdualprod);
2430 *bestlagrangianval = lagrangianval;
2432 for( j = 0; j < *nsoftcuts; j++ )
2433 bestdualvector[j] = dualvector[j];
2435 *bestdualvectorlen = *nsoftcuts;
2436 (*nbestdualupdates)++;
2438 lagrangianvals[
i] = lagrangianval;
2440 avglagrangianval = (avglagrangianval *
i + lagrangianval)/(
i+1);
2443 avglagrangianval = (avglagrangianval *
sepadata->nmaxlagrangianvalsforavg -
2444 lagrangianvals[
i -
sepadata->nmaxlagrangianvalsforavg] +
2445 lagrangianval)/(
sepadata->nmaxlagrangianvalsforavg);
2449 if( !subgradientzero )
2453 &muparam, &backtrack) );
2459 maxviolscoreold = maxviolscore;
2460 nviolscoreold = nviolscore;
2461 maxviolscore = (1.0 - scoreweight) * maxsoftcutviol + scoreweight * maxnzsubgradientdualprod;
2462 nviolscore = (1.0 - scoreweight) * nsoftcutviols + scoreweight * nnzsubgradientdualprod;
2466 *nbestdualupdates,
i, *totaliternum, steplength, subgradient, *nsoftcuts, backtrack, maxviolscore,
2467 maxviolscoreold, nviolscore, nviolscoreold, nlpiters, &dualvecsdiffer, &ballradius) );
2470 if( dualvecsdiffer )
2479 dualvecsdiffer =
FALSE;
2480 objvecsdiffer =
FALSE;
2485 if( (
i %
sepadata->cutaddfreq == 0) || (!dualvecsdiffer && !objvecsdiffer &&
2486 (*ngeneratedcurrroundcuts - *nsoftcuts > 0)) )
2495 if( (*ngeneratedcurrroundcuts - *nsoftcuts) > 0 )
2505 objvecsdiffer, *ngeneratedcurrroundcuts, nmaxgeneratedperroundcuts, *ncurrroundlpiters,
depth,
2513 if( (*ngeneratedcurrroundcuts - *nsoftcuts) > 0 )
2519 for(
i = 0;
i < nmaxgeneratedperroundcuts;
i++)
2520 subgradient[
i] = 0.0;
2537 int nmaxgeneratedperroundcuts,
2542 int* ngeneratedcutsperiter,
2543 int* ngeneratedcurrroundcuts,
2548 int ngeneratednewcuts;
2550 ngeneratednewcuts = 0;
2554 allowlocal, generatedcurrroundcuts, generatedcutefficacies, *ngeneratedcurrroundcuts, &ngeneratednewcuts,
2558 sepadata->ntotalcuts += ngeneratednewcuts;
2559 *ngeneratedcurrroundcuts += ngeneratednewcuts;
2560 ngeneratedcutsperiter[
sepadata->nmaxsubgradientiters * mainiternum] = ngeneratednewcuts;
2588 madeintegral =
FALSE;
2590 for(
i = 0;
i < ncuts && !*
cutoff;
i++ )
2648 int ngeneratedcurrroundcuts,
2650 int nmaxgeneratedperroundcuts,
2651 int ncurrroundlpiters,
2664 if( !dualvecsdiffer && (ngeneratedcurrroundcuts == nsoftcuts) )
2668 if( ngeneratedcurrroundcuts >= nmaxgeneratedperroundcuts )
2676 if( (
sepadata->nmaxperroundlpiters >= 0) && (ncurrroundlpiters >=
sepadata->nmaxperroundlpiters) )
2703 SCIP_ROW** aggregatedcurrroundcuts;
2725 int* ngeneratedcutsperiter;
2726 int bestdualvectorlen;
2727 int nbestdualupdates;
2733 int ngeneratedcurrroundcuts;
2734 int nselectedcurrroundcuts;
2736 int naddedcurrroundcuts;
2737 int naggregatedcurrroundcuts;
2738 int nmaxgeneratedperroundcuts;
2739 int ncurrroundlpiters;
2751 bestdualvectorlen = 0;
2752 nbestdualupdates = 0;
2754 ngeneratedcurrroundcuts = 0;
2755 naddedcurrroundcuts = 0;
2756 naggregatedcurrroundcuts = 0;
2757 ncurrroundlpiters = 0;
2775 nmaxgeneratedperroundcuts = ((
depth == 0) ?
sepadata->nmaxperroundcutsroot :
sepadata->nmaxperroundcuts);
2783 (
sepadata->nmaxsubgradientiters + 1)) );
2794 for(
i = 0;
i < ncols;
i++ )
2801 &ncurrroundlpiters));
2805 generatedcurrroundcuts, generatedcutefficacies, ngeneratedcutsperiter, &ngeneratedcurrroundcuts,
depth,
2810 nmaxgeneratedperroundcuts, ncurrroundlpiters,
depth, &terminate) );
2815 nsoftcutsold = nsoftcuts;
2816 nsoftcuts = ngeneratedcurrroundcuts;
2817 dualvecsdiffer =
FALSE;
2821 nmaxgeneratedperroundcuts, origobjcoefs, origobjoffset, dualvector, &nsoftcuts, generatedcurrroundcuts,
2822 generatedcutefficacies, ngeneratedcutsperiter, &ngeneratedcurrroundcuts, &ncurrroundlpiters, &
cutoff,
2823 &bestlagrangianval, bestdualvector, &bestdualvectorlen, &nbestdualupdates, &totaliternum) );
2828 if( !
cutoff && (ngeneratedcurrroundcuts - nsoftcutsold > 0) )
2850 ngeneratedcurrroundcuts, 0, -1, -1, 0.0,
NULL, ngeneratedcurrroundcuts,
TRUE, 0.0, 0.0, 0.0, 0.0, -1,
2851 &dualvecsdiffer,
NULL) );
2855 SCIP_CALL(
updateDualVector(
scip,
sepadata, dualvector, dualvector, nsoftcuts, 0, -1, -1, 0.0,
NULL,
2856 ngeneratedcurrroundcuts,
TRUE, 0.0, 0.0, 0.0, 0.0, -1, &dualvecsdiffer,
NULL) );
2862 nmaxgeneratedperroundcuts, ncurrroundlpiters,
depth, &terminate) );
2895 if( !
cutoff && (ngeneratedcurrroundcuts > 0) )
2899 nselectedcurrroundcuts = ngeneratedcurrroundcuts;
2901 &naddedcurrroundcuts, &cutoff2) );
2909 if( ngeneratedcutsperiter[
i] != 0 )
2911 for( j = 0; j < ngeneratedcutsperiter[
i]; j++ )
2912 cutindsperm[j] = j + nprocessedcuts;
2915 SCIPsortDownRealInt(&generatedcutefficacies[nprocessedcuts], cutindsperm, ngeneratedcutsperiter[
i]);
2920 maxscale, &naddedcurrroundcuts, &cutoff2) );
2923 nprocessedcuts += ngeneratedcutsperiter[
i];
2928 else if( ngeneratedcurrroundcuts > 0 )
2930 nselectedcurrroundcuts = ngeneratedcurrroundcuts;
2932 &naddedcurrroundcuts, &cutoff2) );
2936 if(
sepadata->aggregatecuts && (ngeneratedcurrroundcuts > 0) && (bestdualvectorlen > 0) )
2938 assert(bestdualvectorlen <= ngeneratedcurrroundcuts);
2940 aggregatedcurrroundcuts, &naggregatedcurrroundcuts, &cutoff2) );
2942 if( naggregatedcurrroundcuts > 0 )
2945 &naddedcurrroundcuts, &cutoff2) );
2954 else if( naddedcurrroundcuts > 0 )
2967 for(
i = 0;
i < naggregatedcurrroundcuts; ++
i )
2973 for(
i = 0;
i < ngeneratedcurrroundcuts; ++
i )
2979 ngeneratedcutsperiter[
i] = 0;
2981 for(
i = 0;
i < nrows;
i++ )
2984 for(
i = 0;
i < nmaxgeneratedperroundcuts;
i++ )
2986 dualsol[nrows +
i] = 0.0;
2987 dualvector[
i] = 0.0;
2988 bestdualvector[
i] = 0.0;
3129 dualdegeneracyrate = 0.0;
3137 if( (
sepadata->minrestart >= 1) && (runnum < sepadata->minrestart + 1) )
3160 if( ncols == 0 || nrows == 0 )
3164 threshold1 =
sepadata->dualdegeneracyratethreshold;
3165 threshold2 =
sepadata->varconsratiothreshold;
3167 if( (dualdegeneracyrate < threshold1) && (varconsratio < threshold2) )
3174 if( bestsol !=
NULL )
3176 for(
i = 0;
i < ncols; ++
i )
3193 for(
i = 0;
i < ncols; ++
i )
3246 "iterations for maximal separating LP iterations in the root node (negative for no limit)",
3250 "iterations for maximal separating LP iterations in the tree (negative for no limit)",
3254 "iterations for maximal separating LP iterations per separation round (negative for no limit)",
3259 "columns for number of cuts separated per separation round in root node", &
sepadata->perroundcutsfactorroot,
3263 "columns for number of cuts separated per separation round at a non-root node",
3311 "iterations for iteration limit of each separating LP (negative for no limit)",
3315 "iterations for iteration limit of each separating LP (negative for no limit)", &
sepadata->perlpiterfactor,
TRUE,
3339 "violation score used for updating ball radius", &
sepadata->radiusupdateweight,
TRUE,
3343 "rate for separator execution", &
sepadata->dualdegeneracyratethreshold,
FALSE,
3347 "ratio on optimal face for separator execution", &
sepadata->varconsratiothreshold,
FALSE,
3388 "iterations per separation round (-1: unlimited)", &
sepadata->perroundnmaxlpiters,
FALSE,
3403 "iterations of the relax-and-cut algorithm", &
sepadata->nmaxsubgradientiters,
TRUE,
3413 "for rolling average of Lagrangian value", &
sepadata->nmaxlagrangianvalsforavg,
TRUE,
3417 "iterations used to determine if mu needs to be backtracked", &
sepadata->nmaxconsecitersformuupdate,
TRUE,
3421 "are projected for stabilization (0: no projection, 1: L1-norm ball projection, 2: L2-norm ball projection, 3: "
3425 "taking weighted average of Lagrangian multipliers for stabilization (0: no weighted stabilization, 1: best "
3430 "separator execution (0: low priority, 1: medium priority, 2: high priority)",
3434 "execution (0: from beginning of the instance solving, >= n with n >= 1: from restart round n)",
#define DEFAULT_MAXROUNDSROOT
#define DEFAULT_MAXROUNDS
#define QUAD_ARRAY_STORE(a, idx, x)
#define SCIPquadprecProdDD(r, a, b)
#define QUAD_ARRAY_SIZE(size)
#define QUAD_ASSIGN(a, constant)
#define SCIPquadprecSumQQ(r, a, b)
#define QUAD_ARRAY_LOAD(r, a, idx)
#define SCIP_LONGINT_FORMAT
SCIP_Bool SCIPisStopped(SCIP *scip)
SCIP_Real SCIPgetTransObjoffset(SCIP *scip)
SCIP_RETCODE SCIPlpiSetState(SCIP_LPI *lpi, BMS_BLKMEM *blkmem, const SCIP_LPISTATE *lpistate)
SCIP_Real SCIPlpiInfinity(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiAddRows(SCIP_LPI *lpi, int nrows, const SCIP_Real *lhs, const SCIP_Real *rhs, char **rownames, int nnonz, const int *beg, const int *ind, const SCIP_Real *val)
SCIP_RETCODE SCIPlpiSetRealpar(SCIP_LPI *lpi, SCIP_LPPARAM type, SCIP_Real dval)
SCIP_RETCODE SCIPlpiFree(SCIP_LPI **lpi)
SCIP_Bool SCIPlpiIsPrimalFeasible(SCIP_LPI *lpi)
SCIP_Bool SCIPlpiIsDualFeasible(SCIP_LPI *lpi)
SCIP_Bool SCIPlpiWasSolved(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiGetSol(SCIP_LPI *lpi, SCIP_Real *objval, SCIP_Real *primsol, SCIP_Real *dualsol, SCIP_Real *activity, SCIP_Real *redcost)
SCIP_RETCODE SCIPlpiFreeState(SCIP_LPI *lpi, BMS_BLKMEM *blkmem, SCIP_LPISTATE **lpistate)
SCIP_RETCODE SCIPlpiAddCols(SCIP_LPI *lpi, int ncols, const SCIP_Real *obj, const SCIP_Real *lb, const SCIP_Real *ub, char **colnames, int nnonz, const int *beg, const int *ind, const SCIP_Real *val)
SCIP_RETCODE SCIPlpiSolvePrimal(SCIP_LPI *lpi)
SCIP_RETCODE SCIPlpiCreate(SCIP_LPI **lpi, SCIP_MESSAGEHDLR *messagehdlr, const char *name, SCIP_OBJSEN objsen)
SCIP_RETCODE SCIPlpiGetState(SCIP_LPI *lpi, BMS_BLKMEM *blkmem, SCIP_LPISTATE **lpistate)
SCIP_MESSAGEHDLR * SCIPgetMessagehdlr(SCIP *scip)
SCIP_RETCODE SCIPheurPassSolTrySol(SCIP *scip, SCIP_HEUR *heur, SCIP_SOL *sol)
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)
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)
SCIP_RETCODE SCIPgetRealParam(SCIP *scip, const char *name, SCIP_Real *value)
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 SCIPcolGetLPPos(SCIP_COL *col)
SCIP_VAR * SCIPcolGetVar(SCIP_COL *col)
SCIP_Bool SCIPcolIsIntegral(SCIP_COL *col)
SCIP_Real SCIPcolGetObj(SCIP_COL *col)
SCIP_Real SCIPcolGetLb(SCIP_COL *col)
SCIP_Real SCIPcolGetPrimsol(SCIP_COL *col)
SCIP_Real SCIPcolGetUb(SCIP_COL *col)
SCIP_RETCODE SCIPaddPoolCut(SCIP *scip, SCIP_ROW *row)
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)
SCIP_RETCODE SCIPaggrRowCreate(SCIP *scip, SCIP_AGGRROW **aggrrow)
SCIP_Bool SCIPisCutNew(SCIP *scip, SCIP_ROW *row)
SCIP_Bool SCIPisEfficacious(SCIP *scip, SCIP_Real efficacy)
void SCIPaggrRowFree(SCIP *scip, SCIP_AGGRROW **aggrrow)
SCIP_RETCODE SCIPaddRow(SCIP *scip, SCIP_ROW *row, SCIP_Bool forcecut, SCIP_Bool *infeasible)
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)
SCIP_RETCODE SCIPaddDelayedPoolCut(SCIP *scip, SCIP_ROW *row)
SCIP_HEUR * SCIPfindHeur(SCIP *scip, const char *name)
SCIP_Real SCIPgetVarObjDive(SCIP *scip, SCIP_VAR *var)
SCIP_RETCODE SCIPstartDive(SCIP *scip)
SCIP_RETCODE SCIPgetLPDualDegeneracy(SCIP *scip, SCIP_Real *degeneracy, SCIP_Real *varconsratio)
SCIP_RETCODE SCIPchgVarObjDive(SCIP *scip, SCIP_VAR *var, SCIP_Real newobj)
SCIP_RETCODE SCIPsolveDiveLP(SCIP *scip, int itlim, SCIP_Bool *lperror, SCIP_Bool *cutoff)
SCIP_RETCODE SCIPendDive(SCIP *scip)
SCIP_RETCODE SCIPgetLPBasisInd(SCIP *scip, int *basisind)
SCIP_RETCODE SCIPgetLPColsData(SCIP *scip, SCIP_COL ***cols, int *ncols)
SCIP_RETCODE SCIPgetLPRowsData(SCIP *scip, SCIP_ROW ***rows, int *nrows)
int SCIPgetNLPRows(SCIP *scip)
SCIP_RETCODE SCIPgetLPI(SCIP *scip, SCIP_LPI **lpi)
SCIP_LPSOLSTAT SCIPgetLPSolstat(SCIP *scip)
SCIP_COL ** SCIPgetLPCols(SCIP *scip)
SCIP_Real SCIPgetLPObjval(SCIP *scip)
SCIP_Bool SCIPisLPSolBasic(SCIP *scip)
SCIP_RETCODE SCIPgetLPBInvRow(SCIP *scip, int r, SCIP_Real *coefs, int *inds, int *ninds)
#define SCIPfreeCleanBufferArray(scip, ptr)
#define SCIPallocCleanBufferArray(scip, ptr, num)
BMS_BLKMEM * SCIPblkmem(SCIP *scip)
#define SCIPallocBufferArray(scip, ptr, num)
#define SCIPfreeBufferArray(scip, ptr)
#define SCIPfreeBlockMemory(scip, ptr)
#define SCIPallocBlockMemory(scip, ptr)
SCIP_Bool SCIProwIsIntegral(SCIP_ROW *row)
SCIP_Real SCIProwGetLhs(SCIP_ROW *row)
SCIP_Bool SCIProwIsModifiable(SCIP_ROW *row)
SCIP_RETCODE SCIPcacheRowExtensions(SCIP *scip, SCIP_ROW *row)
SCIP_Real SCIPgetRowMinActivity(SCIP *scip, SCIP_ROW *row)
int SCIProwGetNNonz(SCIP_ROW *row)
SCIP_COL ** SCIProwGetCols(SCIP_ROW *row)
SCIP_Real SCIProwGetRhs(SCIP_ROW *row)
SCIP_Real SCIPgetRowMaxActivity(SCIP *scip, SCIP_ROW *row)
int SCIProwGetNLPNonz(SCIP_ROW *row)
SCIP_RETCODE SCIPflushRowExtensions(SCIP *scip, SCIP_ROW *row)
SCIP_Bool SCIProwIsLocal(SCIP_ROW *row)
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_RETCODE SCIPaddVarToRow(SCIP *scip, SCIP_ROW *row, SCIP_VAR *var, SCIP_Real val)
const char * SCIProwGetName(SCIP_ROW *row)
SCIP_Real SCIPgetRowActivity(SCIP *scip, SCIP_ROW *row)
SCIP_RETCODE SCIPreleaseRow(SCIP *scip, SCIP_ROW **row)
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)
int SCIProwGetRank(SCIP_ROW *row)
void SCIProwChgRank(SCIP_ROW *row, int rank)
SCIP_Real SCIProwGetConstant(SCIP_ROW *row)
int SCIPgetRowNumIntCols(SCIP *scip, SCIP_ROW *row)
SCIP_Real * SCIProwGetVals(SCIP_ROW *row)
SCIP_Real SCIPgetRowSolActivity(SCIP *scip, SCIP_ROW *row, SCIP_SOL *sol)
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)
SCIP_RETCODE SCIPsetSepaFree(SCIP *scip, SCIP_SEPA *sepa,)
const char * SCIPsepaGetName(SCIP_SEPA *sepa)
int SCIPsepaGetNCallsAtNode(SCIP_SEPA *sepa)
SCIP_RETCODE SCIPsetSepaExit(SCIP *scip, SCIP_SEPA *sepa,)
SCIP_RETCODE SCIPsetSepaInit(SCIP *scip, SCIP_SEPA *sepa,)
SCIP_SEPADATA * SCIPsepaGetData(SCIP_SEPA *sepa)
void SCIPsepaSetData(SCIP_SEPA *sepa, SCIP_SEPADATA *sepadata)
SCIP_RETCODE SCIPsetSepaCopy(SCIP *scip, SCIP_SEPA *sepa,)
SCIP_Longint SCIPsepaGetNCalls(SCIP_SEPA *sepa)
SCIP_SOL * SCIPgetBestSol(SCIP *scip)
SCIP_RETCODE SCIPsetSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var, SCIP_Real val)
SCIP_Real SCIPgetSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var)
int SCIPgetMaxDepth(SCIP *scip)
int SCIPgetNRuns(SCIP *scip)
SCIP_Longint SCIPgetNRootFirstLPIterations(SCIP *scip)
SCIP_Longint SCIPgetNNodeInitLPIterations(SCIP *scip)
SCIP_Longint SCIPgetNLPIterations(SCIP *scip)
SCIP_Real SCIPgetSolvingTime(SCIP *scip)
SCIP_Real SCIPinfinity(SCIP *scip)
SCIP_Bool SCIPisGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Real SCIPfeasFrac(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisPositive(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisFeasZero(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisInfinity(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisFeasNegative(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisNegative(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPceil(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisZero(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPepsilon(SCIP *scip)
SCIP_Real SCIPsumepsilon(SCIP *scip)
SCIP_Bool SCIPisLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisFeasPositive(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPvarIsIntegral(SCIP_VAR *var)
SCIP_Real SCIPrandomGetReal(SCIP_RANDNUMGEN *randnumgen, SCIP_Real minrandval, SCIP_Real maxrandval)
SCIP_RETCODE SCIPincludeSepaLagromory(SCIP *scip)
void SCIPsortDownRealInt(SCIP_Real *realarray, int *intarray, int len)
int SCIPsnprintf(char *t, int len, const char *s,...)
SCIPfreeSol(scip, &heurdata->sol))
SCIPcreateSol(scip, &heurdata->sol, heur))
SCIPfreeRandom(scip, &heurdata->randnumgen)
SCIPcreateRandom(scip, &heurdata->randnumgen, DEFAULT_RANDSEED, TRUE))
assert(minobj< SCIPgetCutoffbound(scip))
primal heuristic that tries a given solution
#define BMSclearMemory(ptr)
struct BMS_BlkMem BMS_BLKMEM
#define DEFAULT_DYNAMICCUTS
#define SEPA_MAXBOUNDDIST
#define MAXAGGRLEN(nvars)
#define DEFAULT_MAKEINTEGRAL
#define DEFAULT_DELAYEDCUTS
#define DEFAULT_SIDETYPEBASIS
#define DEFAULT_FORCECUTS
#define DEFAULT_SEPARATEROWS
#define DEFAULT_MAXLAGRANGIANVALSFORAVG
#define DEFAULT_DELTASLAB1UB
#define DEFAULT_UBPARAMNEGFACTOR
#define DEFAULT_VARCONSRATIOTHRESHOLD
#define DEFAULT_DUALDEGENERACYRATETHRESHOLD
#define DEFAULT_MUPARAMINIT
static SCIP_RETCODE sepadataCreate(SCIP *scip, SCIP_SEPADATA **sepadata)
#define DEFAULT_MUPARAMUB
static SCIP_RETCODE updateMuSteplengthParam(SCIP *scip, SCIP_SEPADATA *sepadata, int subgradientiternum, SCIP_Real ubparam, SCIP_Real *lagrangianvals, SCIP_Real bestlagrangianval, SCIP_Real avglagrangianval, SCIP_Real *muparam, SCIP_Bool *backtrack)
#define DEFAULT_ALLOWLOCAL
static SCIP_RETCODE deleteLPWithSoftCuts(SCIP *scip, SCIP_SEPADATA *sepadata)
#define DEFAULT_UBPARAMPOSFACTOR
static void linfBallProjection(SCIP *scip, SCIP_Real *dualvector, int dualvectorlen, SCIP_Real radius)
#define DEFAULT_MAXSUBGRADIENTITERS
static SCIP_RETCODE generateGMICuts(SCIP *scip, SCIP_SEPA *sepa, SCIP_SEPADATA *sepadata, int mainiternum, int subgradientiternum, SCIP_SOL *sol, SCIP_Real *solvals, int nmaxgeneratedperroundcuts, SCIP_Bool allowlocal, SCIP_ROW **generatedcurrroundcuts, SCIP_Real *generatedcutefficacies, int ngeneratedcurrroundcuts, int *ngeneratednewcuts, int depth, SCIP_Bool *cutoff)
static SCIP_RETCODE solveLagromoryLP(SCIP *scip, SCIP_SEPADATA *sepadata, int depth, SCIP_Real origobjoffset, SCIP_Bool *solfound, SCIP_SOL *sol, SCIP_Real *solvals, SCIP_Real *objval, int *ncurrroundlpiters)
static SCIP_RETCODE aggregateGeneratedCuts(SCIP *scip, SCIP_SEPA *sepa, SCIP_SEPADATA *sepadata, SCIP_ROW **generatedcuts, SCIP_Real *bestdualvector, int bestdualvectorlen, SCIP_ROW **aggrcuts, int *naggrcuts, SCIP_Bool *cutoff)
#define DEFAULT_MUPARAMLB
#define DEFAULT_RADIUSMAX
static SCIP_RETCODE updateDualVector(SCIP *scip, SCIP_SEPADATA *sepadata, SCIP_Real *dualvector1, SCIP_Real *dualvector2, int dualvector2len, int ndualvector2updates, int subgradientiternum, int totaliternum, SCIP_Real steplength, SCIP_Real *subgradient, int ncuts, SCIP_Bool backtrack, SCIP_Real maxviolscore, SCIP_Real maxviolscoreold, SCIP_Real nviolscore, SCIP_Real nviolscoreold, int nlpiters, SCIP_Bool *dualvecsdiffer, SCIP_Real *ballradius)
#define DEFAULT_PERLPMAXCUTSROOT
#define DEFAULT_PROJECTIONTYPE
#define DEFAULT_CUTADDFREQ
static SCIP_RETCODE checkMainLoopTermination(SCIP_SEPADATA *sepadata, SCIP_Bool cutoff, SCIP_Bool dualvecsdiffer, int ngeneratedcurrroundcuts, int nsoftcuts, int nmaxgeneratedperroundcuts, int ncurrroundlpiters, int depth, SCIP_Bool *terminate)
#define DEFAULT_MUSLAB2FACTOR
#define DEFAULT_RADIUSINIT
#define DEFAULT_TOTALCUTSFACTOR
static SCIP_RETCODE generateInitCutPool(SCIP *scip, SCIP_SEPA *sepa, SCIP_SEPADATA *sepadata, int mainiternum, SCIP_SOL *sol, SCIP_Real *solvals, int nmaxgeneratedperroundcuts, SCIP_Bool allowlocal, SCIP_ROW **generatedcurrroundcuts, SCIP_Real *generatedcutefficacies, int *ngeneratedcutsperiter, int *ngeneratedcurrroundcuts, int depth, SCIP_Bool *cutoff)
#define DEFAULT_PERROUNDMAXLPITERS
#define DEFAULT_PERROUNDCUTSFACTOR
#define DEFAULT_MAXMAINITERS
#define DEFAULT_PERROUNDCUTSFACTORROOT
static void updateSubgradient(SCIP *scip, SCIP_SOL *sol, SCIP_ROW **cuts, int ncuts, SCIP_Real *subgradient, SCIP_Real *dualvector, SCIP_Bool *subgradientzero, int *ncutviols, SCIP_Real *maxcutviol, int *nnzsubgradientdualprod, SCIP_Real *maxnzsubgradientdualprod)
static SCIP_RETCODE l1BallProjection(SCIP *scip, SCIP_Real *dualvector, int dualvectorlen, SCIP_Real radius)
#define DEFAULT_OPTIMALFACEPRIORITY
#define DEFAULT_SORTCUTOFFSOL
static SCIP_RETCODE separateCuts(SCIP *scip, SCIP_SEPA *sepa, SCIP_SEPADATA *sepadata, SCIP_Real ubparam, int depth, SCIP_Bool allowlocal, SCIP_RESULT *result)
#define DEFAULT_MUSLAB1FACTOR
#define DEFAULT_PERROUNDLPITERLIMITFACTOR
#define DEFAULT_CUTSFILTERFACTOR
static SCIP_RETCODE sepadataFree(SCIP *scip, SCIP_SEPADATA **sepadata)
static SCIP_RETCODE createLPWithSoftCuts(SCIP *scip, SCIP_SEPADATA *sepadata)
static SCIP_RETCODE updateObjectiveVector(SCIP *scip, SCIP_Real *dualvector, SCIP_ROW **cuts, int ncuts, SCIP_Real *origobjcoefs, SCIP_Bool *objvecsdiffer)
static SCIP_RETCODE addGMICutsAsSoftConss(SCIP_Real *dualvector, int ngeneratedcuts, int *naddedcuts, int *nnewaddedsoftcuts)
static SCIP_RETCODE addCuts(SCIP *scip, SCIP_SEPADATA *sepadata, SCIP_ROW **cuts, int ncuts, SCIP_Longint maxdnom, SCIP_Real maxscale, int *naddedcuts, SCIP_Bool *cutoff)
static SCIP_RETCODE solveLPWithHardCuts(SCIP *scip, SCIP_SEPADATA *sepadata, SCIP_Bool *solfound, SCIP_SOL *sol, SCIP_Real *solvals)
#define DEFAULT_PERLPITERFACTOR
static SCIP_RETCODE checkLagrangianDualTermination(SCIP_SEPADATA *sepadata, int nnewaddedsoftcuts, int nyettoaddsoftcuts, SCIP_Bool objvecsdiffer, int ngeneratedcurrroundcuts, int nmaxgeneratedperroundcuts, int ncurrroundlpiters, int depth, SCIP_Bool *terminate)
static SCIP_RETCODE createLPWithHardCuts(SCIP *scip, SCIP_SEPADATA *sepadata, SCIP_ROW **cuts, int ncuts)
#define DEFAULT_STABILITYCENTERTYPE
#define DEFAULT_RADIUSMIN
static SCIP_RETCODE solveLagrangianDual(SCIP *scip, SCIP_SEPA *sepa, SCIP_SEPADATA *sepadata, SCIP_SOL *sol, SCIP_Real *solvals, int mainiternum, SCIP_Real ubparam, int depth, SCIP_Bool allowlocal, int nmaxgeneratedperroundcuts, SCIP_Real *origobjcoefs, SCIP_Real origobjoffset, SCIP_Real *dualvector, int *nsoftcuts, SCIP_ROW **generatedcurrroundcuts, SCIP_Real *generatedcutefficacies, int *ngeneratedcutsperiter, int *ngeneratedcurrroundcuts, int *ncurrroundlpiters, SCIP_Bool *cutoff, SCIP_Real *bestlagrangianval, SCIP_Real *bestdualvector, int *bestdualvectorlen, int *nbestdualupdates, int *totaliternum)
#define DEFAULT_PERROOTLPITERFACTOR
static SCIP_RETCODE constructCutRow(SCIP *scip, SCIP_SEPA *sepa, SCIP_SEPADATA *sepadata, int mainiternum, int subgradientiternum, int cutnnz, int *cutinds, SCIP_Real *cutcoefs, SCIP_Real cutefficacy, SCIP_Real cutrhs, SCIP_Bool cutislocal, int cutrank, SCIP_ROW **generatedcuts, SCIP_Real *generatedcutefficacies, int ngeneratedcurrroundcuts, int *ngeneratednewcuts, SCIP_Bool *cutoff)
#define DEFAULT_ROOTLPITERLIMITFACTOR
#define DEFAULT_AGGREGATECUTS
#define DEFAULT_MUBACKTRACKFACTOR
static void updateLagrangianValue(SCIP *scip, SCIP_Real objval, SCIP_Real *dualvector, SCIP_ROW **cuts, int ncuts, SCIP_Real *lagrangianval)
#define DEFAULT_MINRESTART
#define DEFAULT_CUTGENFREQ
static void updateStepLength(SCIP *scip, SCIP_Real muparam, SCIP_Real ubparam, SCIP_Real lagrangianval, SCIP_Real *subgradient, int ncuts, SCIP_Real *steplength)
#define DEFAULT_RADIUSUPDATEWEIGHT
static void updateBallRadius(SCIP *scip, SCIP_SEPADATA *sepadata, SCIP_Real maxviolscore, SCIP_Real maxviolscoreold, SCIP_Real nviolscore, SCIP_Real nviolscoreold, int nlpiters, SCIP_Real *ballradius)
static void l2BallProjection(SCIP *scip, SCIP_Real *dualvector, int dualvectorlen, SCIP_Real radius)
#define DEFAULT_DELTASLAB2UB
#define DEFAULT_MUPARAMCONST
static SCIP_RETCODE stabilizeDualVector(SCIP *scip, SCIP_SEPADATA *sepadata, SCIP_Real *dualvector, int dualvectorlen, SCIP_Real *bestdualvector, int bestdualvectorlen, int nbestdualupdates, int subgradientiternum, int totaliternum, SCIP_Real maxviolscore, SCIP_Real maxviolscoreold, SCIP_Real nviolscore, SCIP_Real nviolscoreold, int nlpiters, SCIP_Real *ballradius)
#define DEFAULT_TOTALLPITERLIMITFACTOR
#define DEFAULT_PERLPMAXCUTS
static void weightedDualVector(SCIP_SEPADATA *sepadata, SCIP_Real *dualvector, int dualvectorlen, SCIP_Real *stabilitycenter, int stabilitycenterlen, int nbestdualupdates, int totaliternum)
#define DEFAULT_MUSLAB3FACTOR
#define DEFAULT_MAXCONSECITERSFORMUUPDATE
struct SCIP_AggrRow SCIP_AGGRROW
struct SCIP_Heur SCIP_HEUR
enum SCIP_LPSolStat SCIP_LPSOLSTAT
struct SCIP_LPiState SCIP_LPISTATE
struct SCIP_RandNumGen SCIP_RANDNUMGEN
enum SCIP_Result SCIP_RESULT
enum SCIP_Retcode SCIP_RETCODE
struct SCIP_SepaData SCIP_SEPADATA
#define SCIP_DECL_SEPAEXECLP(x)
#define SCIP_DECL_SEPAFREE(x)
#define SCIP_DECL_SEPAEXIT(x)
struct SCIP_Sepa SCIP_SEPA
#define SCIP_DECL_SEPACOPY(x)
#define SCIP_DECL_SEPAINIT(x)