59#define TABLE_NAME_RPA "ringpacking"
60#define TABLE_DESC_RPA "ringpacking statistics"
61#define TABLE_POSITION_RPA 12500
62#define TABLE_EARLIEST_STAGE_RPA SCIP_STAGE_TRANSFORMED
65#define M_PI 3.141592653589793238462643
98 int ncppatternsunknownbeg;
161 (*probdata)->ncpatterns = ncpatterns;
162 (*probdata)->cpatternsize = ncpatterns;
165 for(
i = 0;
i < ncpatterns; ++
i )
173 (*probdata)->nrpatterns = nrpatterns;
174 (*probdata)->rpatternsize = nrpatterns;
177 for(
i = 0;
i < nrpatterns; ++
i )
186 if( patternconss !=
NULL )
199 (*probdata)->ntypes = ntypes;
200 (*probdata)->width = width;
201 (*probdata)->height = height;
220 if( (*probdata)->randnumgen !=
NULL )
226 if( (*probdata)->patternconss !=
NULL )
230 if( (*probdata)->patternconss[
i] !=
NULL )
239 for(
i = 0;
i < (*probdata)->ncpatterns; ++
i )
243 if( (*probdata)->cvars[
i] !=
NULL )
255 for(
i = 0;
i < (*probdata)->nrpatterns; ++
i )
260 if( (*probdata)->rvars[
i] !=
NULL )
294 for( p = 0; p < probdata->ncpatterns; ++p )
319 newsize =
MAX(size, 2 * probdata->cpatternsize);
323 probdata->cpatternsize = newsize;
327 newsize =
MAX(size, 2 * probdata->rpatternsize);
331 probdata->rpatternsize = newsize;
350 assert(probdata->ncpatterns > 0);
351 assert(probdata->nrpatterns > 0);
354 for( k = 0; k < probdata->ncpatterns; ++k )
360 pattern = probdata->cpatterns[k];
373 (void) strcat(name, strtmp);
381 probdata->cvars[k] =
var;
385 for( k = 0; k < probdata->nrpatterns; ++k )
389 pattern = probdata->rpatterns[k];
400 (void) strcat(name, strtmp);
408 probdata->rvars[k] =
var;
443 rintscaled = _rint / rext;
444 assert(rintscaled >= 1.0);
448 else if(
SCIPisLT(
scip, rintscaled, 2.1547005383792515) )
450 else if(
SCIPisLT(
scip, rintscaled, 2.414213562373095) )
452 else if(
SCIPisLT(
scip, rintscaled, 2.7013016167040798) )
456 else if(
SCIPisLT(
scip, rintscaled, 3.3047648709624866) )
458 else if(
SCIPisLT(
scip, rintscaled, 3.613125929752753) )
506 for(
i = 0;
i < ntypes && (pdomq || qdomp); ++
i )
510 else if( count[
i] > 0 )
539 for(
i = 0;
i < probdata->ncpatterns - 1; ++
i )
547 for( j =
i + 1; j < probdata->ncpatterns; ++j )
567 for(
i = 0;
i < probdata->ncpatterns; ++
i )
575 cpatterns[ncpatterns] = probdata->cpatterns[
i];
582 probdata->ncpatterns = ncpatterns;
626 lasttype = ntypes -1;
658 timelim =
MIN(heurtilim, *timeleft);
671 timelim =
MIN(*timeleft, nlptilim);
683 volume -=
SQR(rexts[t]) *
M_PI * nselected[t];
695 while( t > type && (nselected[t] == ms[t] ||
SCIPisGT(
scip, volume, maxvolume)) )
698 volume -=
SQR(rexts[t]) *
M_PI * nselected[t];
708 assert(nselected[t] < ms[t]);
710 volume +=
SQR(rexts[t]) *
M_PI;
754 probdata->totaltilimsoft, probdata->nlpnodelimsoft, probdata->heuriterlimsoft) );
761 for( t = 0; t < ntypes; ++t )
779 for( t = 0; t < ntypes; ++t )
786 for( p = 0; p < probdata->ncpatterns; ++p )
791 pattern = probdata->cpatterns[p];
795 var = probdata->cvars[p];
811 for( t = 0; t < ntypes; ++t )
823 for( p = 0; p < probdata->ncpatterns; ++p )
834 assert(type >= 0 && type < ntypes);
839 for( t = 0; t < ntypes; ++t )
852 for( p = 0; p < probdata->nrpatterns; ++p )
861 for( t = 0; t < ntypes; ++t )
874 minrext = rexts[ntypes-1];
876 for( t = 0; t < ntypes; ++t )
886 volume += vol * demands[t];
926 if( !probdata->isdualinvalid )
932 dualbound = probdata->dualbound;
935 for( t = 0; t < ntypes; ++t )
937 nrings += demands[t];
938 maxrint =
MAX(maxrint, rints[t]);
939 minrext =
MIN(minrext, rexts[t]);
942 SCIPinfoMessage(
scip, file,
"Ringpacking : %10s %10s %10s %10s %10s %10s %10s %10s %10s %10s %10s %10s\n",
943 "dual",
"ntypes",
"nrings",
"width",
"height",
"CP",
"CP_unk",
"CP_unk_end" ,
"CP_infeas",
"RP",
"enumtime",
"radiiratio");
1008 for(
i = 0;
i < nelements; ++
i )
1057 for(
i = 0;
i < nelements; ++
i )
1065 c = sqrt(xs[
i]*xs[
i] + ys[
i]*ys[
i]);
1068 if( !
SCIPisGE(
scip,
c + rexts[elements[
i]] + 2.0*rexts[elements[pos]], rbound)
1069 ||
SCIPisGT(
scip, rexts[elements[pos]] + rexts[elements[
i]], rbound) )
1072 a = rexts[elements[pos]] + rexts[elements[
i]];
1073 b = rbound - rexts[elements[pos]];
1078 updateBestCandidate(
scip, xs, ys, rexts, rexts[elements[pos]], rbound, -1.0, -1.0, rmax,
SCIP_PATTERNTYPE_CIRCULAR,
1079 ispacked, elements, nelements, bestx, besty, -rbound + rexts[elements[pos]], 0.0,
ncalls);
1080 updateBestCandidate(
scip, xs, ys, rexts, rexts[elements[pos]], rbound, -1.0, -1.0, rmax,
SCIP_PATTERNTYPE_CIRCULAR,
1081 ispacked, elements, nelements, bestx, besty, +rbound - rexts[elements[pos]], 0.0,
ncalls);
1097 updateBestCandidate(
scip, xs, ys, rexts, rexts[elements[pos]], rbound, -1.0, -1.0, rmax,
SCIP_PATTERNTYPE_CIRCULAR,
1098 ispacked, elements, nelements, bestx, besty, u + n1, v + n2,
ncalls);
1099 updateBestCandidate(
scip, xs, ys, rexts, rexts[elements[pos]], rbound, -1.0, -1.0, rmax,
SCIP_PATTERNTYPE_CIRCULAR,
1100 ispacked, elements, nelements, bestx, besty, u - n1, v - n2,
ncalls);
1132 SCIP_Real xcands[4] = {-rbound + rext, +rbound - rext, 0.0, 0.0};
1133 SCIP_Real ycands[4] = {0.0, 0.0, -rbound + rext, +rbound - rext};
1135 for(
i = 0;
i < 4; ++
i )
1136 updateBestCandidate(
scip, xs, ys, rexts, rexts[elements[pos]], rbound, width, height, rmax, patterntype,
1137 ispacked, elements, nelements, bestx, besty, xcands[
i], ycands[
i],
ncalls);
1141 SCIP_Real xcands[4] = {rext, width - rext, rext, width - rext};
1142 SCIP_Real ycands[4] = {rext, rext, height - rext, height - rext};
1144 for(
i = 0;
i < 4; ++
i )
1145 updateBestCandidate(
scip, xs, ys, rexts, rexts[elements[pos]], rbound, width, height, rmax, patterntype,
1146 ispacked, elements, nelements, bestx, besty, xcands[
i], ycands[
i],
ncalls);
1172 rext = rexts[elements[pos]];
1174 for(
i = 0;
i < nelements; ++
i )
1176 SCIP_Real xfix[2] = {rext, width - rext};
1177 SCIP_Real yfix[2] = {rext, height - rext};
1184 Ri = rexts[elements[
i]];
1187 for( k = 0; k < 2; ++k )
1202 for( k = 0; k < 2; ++k )
1242 rext = rexts[elements[pos]];
1245 for(
i = 0;
i < nelements - 1; ++
i )
1254 Ri = rexts[elements[
i]];
1256 for( j =
i + 1; j < nelements; ++j )
1264 Rj = rexts[elements[j]];
1265 dist = sqrt(
SQR(xs[
i] - xs[j]) +
SQR(ys[
i] - ys[j]));
1274 alpha = (dist*dist -
b*
b +
a*
a) / (2.0*dist);
1277 u = xs[
i] + (
alpha / dist) * (xs[j] - xs[
i]);
1278 v = ys[
i] + (
alpha / dist) * (ys[j] - ys[
i]);
1279 n1 =
h * ((ys[j] - ys[
i]) / dist);
1280 n2 =
h * ((xs[
i] - xs[j]) / dist);
1281 assert(n1*n1 + n2*n2 > 0.0);
1283 updateBestCandidate(
scip, xs, ys, rexts, rext, rbound, width, height, rmax, patterntype, ispacked, elements,
1284 nelements, bestx, besty, u + n1, v + n2,
ncalls);
1285 updateBestCandidate(
scip, xs, ys, rexts, rext, rbound, width, height, rmax, patterntype, ispacked, elements,
1286 nelements, bestx, besty, u - n1, v - n2,
ncalls);
1308 for(
i = 0;
i < nelements; ++
i )
1316 else if( iter == 1 )
1320 else if( iter <= 10 )
1324 else if( iter <= 20 )
1367 sourcedata->ncpatterns, sourcedata->rpatterns, sourcedata->rvars, sourcedata->nrpatterns,
1368 sourcedata->demands, sourcedata->rints, sourcedata->rexts, sourcedata->ntypes,
1369 sourcedata->width, sourcedata->height) );
1373 (*targetdata)->patternconss) );
1380 (*targetdata)->ncppatternsunknownbeg = sourcedata->ncppatternsunknownbeg;
1381 (*targetdata)->enumtime = sourcedata->enumtime;
1382 (*targetdata)->dualbound = sourcedata->dualbound;
1383 (*targetdata)->isdualinvalid = sourcedata->isdualinvalid;
1398 const char* probname,
1413 for( t = 0; t < ntypes -1; ++t )
1414 assert(rexts[t] >= rexts[t+1]);
1422 SCIP_CALL(
probdataCreate(
scip, &probdata,
NULL,
NULL,
NULL, 0,
NULL,
NULL, 0, demands, rints, rexts, ntypes, width,
1496 for( t = 0; t < ntypes; ++t )
1500 for( k = t+1; k < ntypes; ++k )
1505 heuriterlim, &timeleft) );
1526 return probdata->ntypes;
1536 return probdata->rexts;
1546 return probdata->rints;
1556 return probdata->demands;
1566 return probdata->width;
1577 return probdata->height;
1590 if( cpatterns !=
NULL )
1591 *cpatterns = probdata->cpatterns;
1593 *cvars= probdata->cvars;
1594 if( ncpatterns !=
NULL )
1595 *ncpatterns = probdata->ncpatterns;
1608 if( rpatterns !=
NULL )
1609 *rpatterns = probdata->rpatterns;
1611 *rvars= probdata->rvars;
1612 if( nrpatterns !=
NULL )
1613 *nrpatterns = probdata->nrpatterns;
1623 return probdata->patternconss;
1647 probdata->cpatterns[probdata->ncpatterns] = copy;
1648 probdata->cvars[probdata->ncpatterns] =
var;
1649 ++(probdata->ncpatterns);
1654 probdata->rpatterns[probdata->nrpatterns] = copy;
1655 probdata->rvars[probdata->nrpatterns] =
var;
1656 ++(probdata->nrpatterns);
1677 if( !probdata->isdualinvalid &&
SCIPisFeasLT(
scip, probdata->dualbound, dualbound) )
1680 probdata->dualbound = dualbound;
1692 if( !probdata->isdualinvalid )
1695 probdata->isdualinvalid =
TRUE;
1706 return probdata->isdualinvalid;
1747 assert(rexts[elements[0]] <= rbounding);
1748 xs[0] = rexts[elements[0]] - rbounding;
1753 assert(2.0 * rexts[elements[0]] <= width);
1754 assert(2.0 * rexts[elements[0]] <= height);
1755 xs[0] = rexts[elements[0]];
1756 ys[0] = rexts[elements[0]];
1765 rmax = rexts[elements[0]];
1766 for(
i = 1;
i < nelements; ++
i )
1768 if( rexts[elements[
i]] > rmax )
1769 rmax = rexts[elements[
i]];
1777 for(
i = 1;
i < nelements; ++
i )
1787 computePosTrivial(
scip, elements, nelements, rexts, xs, ys,
i, ispacked, rmax, rbounding, width, height,
1788 patterntype, &bestx, &besty,
ncalls);
1792 computePosRingCircle(
scip, elements, nelements, rexts, xs, ys,
i, ispacked, rmax, rbounding, &bestx,
1795 computePosRectangleCircle(
scip, elements, nelements, rexts, xs, ys,
i, ispacked, rmax, width, height, &bestx,
1799 computePosCircleCircle(
scip, elements, nelements, rexts, xs, ys,
i, ispacked, rmax, rbounding, width, height,
1800 patterntype, &bestx, &besty,
ncalls);
1849 if( timelim <= 0.0 )
1897 for(
i = 0;
i < nelements; ++
i )
1922 if( npacked == nelements )
1924 for(
i = 0;
i < nelements; ++
i )
1931 SCIPdebugMsg(
scip,
"heuristic verified pattern after %d iterations\n", niters + 1);
1979 if( timelim <= 0.0 )
2009 for( k = 0; k < nelems; ++k )
2028 for( k = 0; k < nelems; ++k )
2036 for( l = k + 1; l < nelems; ++l )
2043 quadvars1[0] = xvars[k]; quadvars2[0] = xvars[k]; quadcoefs[0] = 1.0;
2044 quadvars1[1] = xvars[k]; quadvars2[1] = xvars[l]; quadcoefs[1] = -2.0;
2045 quadvars1[2] = xvars[l]; quadvars2[2] = xvars[l]; quadcoefs[2] = 1.0;
2046 quadvars1[3] = yvars[k]; quadvars2[3] = yvars[k]; quadcoefs[3] = 1.0;
2047 quadvars1[4] = yvars[k]; quadvars2[4] = yvars[l]; quadcoefs[4] = -2.0;
2048 quadvars1[5] = yvars[l]; quadvars2[5] = yvars[l]; quadcoefs[5] = 1.0;
2052 quadcoefs,
SQR(rexts[elemtype1] + rexts[elemtype2]),
SCIPinfinity(subscip),
2061 for( k = 0; k < nelems; ++k )
2068 quadvars1[0] = xvars[k]; quadvars2[0] = xvars[k]; quadcoefs[0] = 1.0;
2069 quadvars1[1] = yvars[k]; quadvars2[1] = yvars[k]; quadcoefs[1] = 1.0;
2072 SCIP_CALL(
SCIPcreateConsQuadraticNonlinear(subscip, &cons, name, 0,
NULL,
NULL, 2, quadvars1, quadvars2, quadcoefs,
2073 0.0,
SQR(rints[type] - rexts[elemtype]),
2081 for( k = 0; k < nelems - 1; ++k )
2089 for( l = k + 1; l < nelems; ++l )
2096 if( elemtype1 != elemtype2 )
2110 SCIPdebugMsg(
scip,
"--------------------- SOLVE VERIFICATION NLP -------------------\n");
2112 SCIPdebugMsg(
scip,
"----------------------------------------------------------------\n");
2122 for( k = 0; k < nelems; ++k )
2136 for( k = 0; k < nelems; ++k )
2208 assert(patterntype >= 0);
SCIP_RETCODE SCIPaddCoefLinear(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var, SCIP_Real val)
SCIP_RETCODE SCIPcreateConsBasicLinear(SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars, SCIP_Real *vals, SCIP_Real lhs, SCIP_Real rhs)
SCIP_RETCODE SCIPcreateConsQuadraticNonlinear(SCIP *scip, SCIP_CONS **cons, const char *name, int nlinvars, SCIP_VAR **linvars, SCIP_Real *lincoefs, int nquadterms, SCIP_VAR **quadvars1, SCIP_VAR **quadvars2, SCIP_Real *quadcoefs, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool initial, SCIP_Bool separate, SCIP_Bool enforce, SCIP_Bool check, SCIP_Bool propagate, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool dynamic, SCIP_Bool removable)
SCIP_RETCODE SCIPfree(SCIP **scip)
SCIP_RETCODE SCIPcreate(SCIP **scip)
SCIP_STATUS SCIPgetStatus(SCIP *scip)
SCIP_RETCODE SCIPaddVar(SCIP *scip, SCIP_VAR *var)
SCIP_RETCODE SCIPsetObjIntegral(SCIP *scip)
SCIP_RETCODE SCIPsetProbTrans(SCIP *scip,)
SCIP_RETCODE SCIPsetProbDeltrans(SCIP *scip,)
SCIP_RETCODE SCIPaddCons(SCIP *scip, SCIP_CONS *cons)
SCIP_PROBDATA * SCIPgetProbData(SCIP *scip)
SCIP_RETCODE SCIPsetObjsense(SCIP *scip, SCIP_OBJSENSE objsense)
SCIP_RETCODE SCIPcreateProbBasic(SCIP *scip, const char *name)
SCIP_RETCODE SCIPsetProbDelorig(SCIP *scip,)
SCIP_RETCODE SCIPsetProbData(SCIP *scip, SCIP_PROBDATA *probdata)
SCIP_RETCODE SCIPupdateLocalDualbound(SCIP *scip, SCIP_Real newbound)
void SCIPinfoMessage(SCIP *scip, FILE *file, const char *formatstr,...)
#define SCIPdebugMsgPrint
void SCIPsetMessagehdlrQuiet(SCIP *scip, SCIP_Bool quiet)
SCIP_RETCODE SCIPsetLongintParam(SCIP *scip, const char *name, SCIP_Longint value)
SCIP_RETCODE SCIPsetIntParam(SCIP *scip, const char *name, int value)
SCIP_RETCODE SCIPgetRealParam(SCIP *scip, const char *name, SCIP_Real *value)
SCIP_RETCODE SCIPsetEmphasis(SCIP *scip, SCIP_PARAMEMPHASIS paramemphasis, SCIP_Bool quiet)
SCIP_RETCODE SCIPgetLongintParam(SCIP *scip, const char *name, SCIP_Longint *value)
SCIP_RETCODE SCIPgetIntParam(SCIP *scip, const char *name, int *value)
SCIP_RETCODE SCIPsetRealParam(SCIP *scip, const char *name, SCIP_Real value)
SCIP_RETCODE SCIPtransformConss(SCIP *scip, int nconss, SCIP_CONS **conss, SCIP_CONS **transconss)
SCIP_RETCODE SCIPsetConsModifiable(SCIP *scip, SCIP_CONS *cons, SCIP_Bool modifiable)
SCIP_RETCODE SCIPreleaseCons(SCIP *scip, SCIP_CONS **cons)
#define SCIPfreeBlockMemoryArray(scip, ptr, num)
#define SCIPallocBufferArray(scip, ptr, num)
#define SCIPfreeBufferArray(scip, ptr)
#define SCIPallocBlockMemoryArray(scip, ptr, num)
#define SCIPreallocBlockMemoryArray(scip, ptr, oldnum, newnum)
#define SCIPfreeBlockMemory(scip, ptr)
#define SCIPfreeBlockMemoryArrayNull(scip, ptr, num)
#define SCIPallocBlockMemory(scip, ptr)
#define SCIPduplicateBlockMemoryArray(scip, ptr, source, num)
SCIP_SOL * SCIPgetBestSol(SCIP *scip)
int SCIPgetNSols(SCIP *scip)
SCIP_Real SCIPgetSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var)
SCIP_RETCODE SCIPsolve(SCIP *scip)
SCIP_Real SCIPgetDualbound(SCIP *scip)
SCIP_TABLE * SCIPfindTable(SCIP *scip, const char *name)
SCIP_RETCODE SCIPincludeTable(SCIP *scip, const char *name, const char *desc, SCIP_Bool active, SCIP_DECL_TABLECOPY((*tablecopy)), SCIP_DECL_TABLEFREE((*tablefree)), SCIP_DECL_TABLEINIT((*tableinit)), SCIP_DECL_TABLEEXIT((*tableexit)), SCIP_DECL_TABLEINITSOL((*tableinitsol)), SCIP_DECL_TABLEEXITSOL((*tableexitsol)), SCIP_DECL_TABLEOUTPUT((*tableoutput)), SCIP_TABLEDATA *tabledata, int position, SCIP_STAGE earlieststage)
SCIP_Real SCIPgetTotalTime(SCIP *scip)
SCIP_Bool SCIPisFeasGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Real SCIPinfinity(SCIP *scip)
SCIP_Bool SCIPisGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Real SCIPfeasCeil(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisFeasLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisFeasLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
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_Bool SCIPisLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_RETCODE SCIPtransformVars(SCIP *scip, int nvars, SCIP_VAR **vars, SCIP_VAR **transvars)
SCIP_RETCODE SCIPreleaseVar(SCIP *scip, SCIP_VAR **var)
SCIP_RETCODE SCIPcreateVarBasic(SCIP *scip, SCIP_VAR **var, const char *name, SCIP_Real lb, SCIP_Real ub, SCIP_Real obj, SCIP_VARTYPE vartype)
SCIP_RETCODE SCIPcaptureVar(SCIP *scip, SCIP_VAR *var)
SCIP_Real SCIPrandomGetReal(SCIP_RANDNUMGEN *randnumgen, SCIP_Real minrandval, SCIP_Real maxrandval)
void SCIPsortDownRealIntInt(SCIP_Real *realarray, int *intarray1, int *intarray2, int len)
int SCIPsnprintf(char *t, int len, const char *s,...)
SCIPfreeRandom(scip, &heurdata->randnumgen)
SCIPcreateRandom(scip, &heurdata->randnumgen, DEFAULT_RANDSEED, TRUE))
assert(minobj< SCIPgetCutoffbound(scip))
#define BMSclearMemory(ptr)
#define BMScopyMemoryArray(ptr, source, num)
#define BMSclearMemoryArray(ptr, num)
SCIP_Real SCIPpatternGetElementPosY(SCIP_PATTERN *pattern, int elem)
SCIP_RETCODE SCIPpatternAddElement(SCIP_PATTERN *pattern, int type, SCIP_Real x, SCIP_Real y)
void SCIPpatternSetPackableStatus(SCIP_PATTERN *pattern, SCIP_PACKABLE packable)
SCIP_Real SCIPpatternGetElementPosX(SCIP_PATTERN *pattern, int elem)
SCIP_RETCODE SCIPpatternCreateRectangular(SCIP *scip, SCIP_PATTERN **pattern)
SCIP_PATTERNTYPE SCIPpatternGetPatternType(SCIP_PATTERN *pattern)
int SCIPpatternCountElements(SCIP_PATTERN *pattern, int type)
void SCIPpatternSetElementPos(SCIP_PATTERN *pattern, int elem, SCIP_Real x, SCIP_Real y)
void SCIPpatternRemoveLastElements(SCIP_PATTERN *pattern, int k)
SCIP_RETCODE SCIPpatternCreateCircular(SCIP *scip, SCIP_PATTERN **pattern, int type)
SCIP_PACKABLE SCIPpatternGetPackableStatus(SCIP_PATTERN *pattern)
void SCIPpatternSetType(SCIP_PATTERN *pattern, int type)
int SCIPpatternGetElementType(SCIP_PATTERN *pattern, int i)
void SCIPpatternRelease(SCIP *scip, SCIP_PATTERN **pattern)
int SCIPpatternGetNElemens(SCIP_PATTERN *pattern)
void SCIPpatternCapture(SCIP_PATTERN *pattern)
SCIP_RETCODE SCIPpatternCopy(SCIP *scip, SCIP_PATTERN *pattern, SCIP_PATTERN **copy)
int SCIPpatternGetCircleType(SCIP_PATTERN *pattern)
enum SCIP_Patterntype SCIP_PATTERNTYPE
enum SCIP_Packable SCIP_PACKABLE
struct SCIP_Pattern SCIP_PATTERN
@ SCIP_PATTERNTYPE_RECTANGULAR
@ SCIP_PATTERNTYPE_CIRCULAR
SCIP_RETCODE SCIPpricerRpaActivate(SCIP *scip)
Ringpacking variable pricer.
static SCIP_RETCODE enumeratePatterns(SCIP *scip, SCIP_PROBDATA *probdata, SCIP_PATTERN *pattern, int *ms, int *nselected, SCIP_Real nlptilim, SCIP_Real heurtilim, SCIP_Longint nlpnodelim, int heuriterlim, SCIP_Real *timeleft)
#define TABLE_POSITION_RPA
SCIP_Real SCIPprobdataGetHeight(SCIP_PROBDATA *probdata)
SCIP_Bool SCIPprobdataIsDualboundInvalid(SCIP_PROBDATA *probdata)
static SCIP_RETCODE createPatternVars(SCIP *scip, SCIP_PROBDATA *probdata)
SCIP_RETCODE SCIPverifyCircularPatternNLP(SCIP *scip, SCIP_PROBDATA *probdata, SCIP_PATTERN *pattern, SCIP_Real timelim, SCIP_Longint nodelim)
static void updateBestCandidate(SCIP *scip, SCIP_Real *xs, SCIP_Real *ys, SCIP_Real *rexts, SCIP_Real rext, SCIP_Real rbounding, SCIP_Real wbounding, SCIP_Real hbounding, SCIP_Real rmax, SCIP_PATTERNTYPE patterntype, SCIP_Bool *ispacked, int *elements, int nelements, SCIP_Real *bestx, SCIP_Real *besty, SCIP_Real x, SCIP_Real y, int ncalls)
static SCIP_RETCODE probdataCreate(SCIP *scip, SCIP_PROBDATA **probdata, SCIP_CONS **patternconss, SCIP_PATTERN **cpatterns, SCIP_VAR **cvars, int ncpatterns, SCIP_PATTERN **rpatterns, SCIP_VAR **rvars, int nrpatterns, int *demands, SCIP_Real *rints, SCIP_Real *rexts, int ntypes, SCIP_Real width, SCIP_Real height)
#define TABLE_EARLIEST_STAGE_RPA
static SCIP_RETCODE setupProblem(SCIP *scip, SCIP_PROBDATA *probdata)
int * SCIPprobdataGetDemands(SCIP_PROBDATA *probdata)
void SCIPprobdataGetRInfos(SCIP_PROBDATA *probdata, SCIP_PATTERN ***rpatterns, SCIP_VAR ***rvars, int *nrpatterns)
static int maxCircles(SCIP *scip, SCIP_PROBDATA *probdata, int type, int elemtype)
static SCIP_RETCODE ensureSize(SCIP *scip, SCIP_PROBDATA *probdata, SCIP_PATTERNTYPE type, int size)
int SCIPprobdataGetNTypes(SCIP_PROBDATA *probdata)
static SCIP_RETCODE filterPatterns(SCIP *scip, SCIP_PROBDATA *probdata)
static void computeScores(SCIP *scip, SCIP_PROBDATA *probdata, int *elements, int nelements, SCIP_Real *scores, int iter)
SCIP_RETCODE SCIPprobdataCreate(SCIP *scip, const char *probname, int *demands, SCIP_Real *rints, SCIP_Real *rexts, int ntypes, SCIP_Real width, SCIP_Real height)
static void computePosCircleCircle(SCIP *scip, int *elements, int nelements, SCIP_Real *rexts, SCIP_Real *xs, SCIP_Real *ys, int pos, SCIP_Bool *ispacked, SCIP_Real rmax, SCIP_Real rbound, SCIP_Real width, SCIP_Real height, SCIP_PATTERNTYPE patterntype, SCIP_Real *bestx, SCIP_Real *besty, int ncalls)
SCIP_RETCODE SCIPprobdataAddVar(SCIP *scip, SCIP_PROBDATA *probdata, SCIP_PATTERN *pattern, SCIP_VAR *var)
void SCIPprobdataGetCInfos(SCIP_PROBDATA *probdata, SCIP_PATTERN ***cpatterns, SCIP_VAR ***cvars, int *ncpatterns)
static int isPatternDominating(SCIP_PATTERN *p, SCIP_PATTERN *q, int *count, int ntypes)
static void computePosRingCircle(SCIP *scip, int *elements, int nelements, SCIP_Real *rexts, SCIP_Real *xs, SCIP_Real *ys, int pos, SCIP_Bool *ispacked, SCIP_Real rmax, SCIP_Real rbound, SCIP_Real *bestx, SCIP_Real *besty, int ncalls)
SCIP_Real * SCIPprobdataGetRexts(SCIP_PROBDATA *probdata)
SCIP_CONS ** SCIPprobdataGetPatternConss(SCIP_PROBDATA *probdata)
static int getNCPatterns(SCIP *scip, SCIP_PROBDATA *probdata, SCIP_PACKABLE status)
SCIP_RETCODE SCIPverifyCircularPatternHeuristic(SCIP *scip, SCIP_PROBDATA *probdata, SCIP_PATTERN *pattern, SCIP_Real timelim, int iterlim)
static void computePosTrivial(SCIP *scip, int *elements, int nelements, SCIP_Real *rexts, SCIP_Real *xs, SCIP_Real *ys, int pos, SCIP_Bool *ispacked, SCIP_Real rmax, SCIP_Real rbound, SCIP_Real width, SCIP_Real height, SCIP_PATTERNTYPE patterntype, SCIP_Real *bestx, SCIP_Real *besty, int ncalls)
SCIP_RETCODE SCIPprobdataEnumeratePatterns(SCIP *scip, SCIP_PROBDATA *probdata, SCIP_Real nlptilim, SCIP_Real heurtilim, SCIP_Real totaltilim, SCIP_Longint nlpnodelim, int heuriterlim)
static SCIP_RETCODE probdataFree(SCIP *scip, SCIP_PROBDATA **probdata)
static void computePosRectangleCircle(SCIP *scip, int *elements, int nelements, SCIP_Real *rexts, SCIP_Real *xs, SCIP_Real *ys, int pos, SCIP_Bool *ispacked, SCIP_Real rmax, SCIP_Real width, SCIP_Real height, SCIP_Real *bestx, SCIP_Real *besty, int ncalls)
SCIP_Real * SCIPprobdataGetRints(SCIP_PROBDATA *probdata)
void SCIPprobdataUpdateDualbound(SCIP *scip, SCIP_PROBDATA *probdata, SCIP_Real dualbound)
void SCIPprobdataInvalidateDualbound(SCIP *scip, SCIP_PROBDATA *probdata)
SCIP_RETCODE SCIPprobdataSetupProblem(SCIP *scip)
void SCIPcheckPattern(SCIP *scip, SCIP_PROBDATA *probdata, SCIP_PATTERN *pattern)
void SCIPpackCirclesGreedy(SCIP *scip, SCIP_Real *rexts, SCIP_Real *xs, SCIP_Real *ys, SCIP_Real rbounding, SCIP_Real width, SCIP_Real height, SCIP_Bool *ispacked, int *elements, int nelements, SCIP_PATTERNTYPE patterntype, int *npacked, int ncalls)
SCIP_Real SCIPprobdataGetWidth(SCIP_PROBDATA *probdata)
Problem data for ringpacking problem.
SCIP_RETCODE SCIPincludeDefaultPlugins(SCIP *scip)
struct SCIP_Cons SCIP_CONS
struct SCIP_RandNumGen SCIP_RANDNUMGEN
@ SCIP_PARAMEMPHASIS_FEASIBILITY
#define SCIP_DECL_PROBDELTRANS(x)
struct SCIP_ProbData SCIP_PROBDATA
#define SCIP_DECL_PROBDELORIG(x)
#define SCIP_DECL_PROBTRANS(x)
enum SCIP_Retcode SCIP_RETCODE
#define SCIP_DECL_TABLEOUTPUT(x)
@ SCIP_VARTYPE_CONTINUOUS