58 #define CONSHDLR_NAME "symresack" 59 #define CONSHDLR_DESC "symmetry breaking constraint handler relying on symresacks" 60 #define CONSHDLR_SEPAPRIORITY +40100 61 #define CONSHDLR_ENFOPRIORITY -1005200 62 #define CONSHDLR_CHECKPRIORITY -1005200 63 #define CONSHDLR_SEPAFREQ 5 64 #define CONSHDLR_PROPFREQ 5 65 #define CONSHDLR_EAGERFREQ -1 67 #define CONSHDLR_MAXPREROUNDS -1 68 #define CONSHDLR_DELAYSEPA FALSE 69 #define CONSHDLR_DELAYPROP FALSE 70 #define CONSHDLR_NEEDSCONS TRUE 72 #define CONSHDLR_PROP_TIMING SCIP_PROPTIMING_BEFORELP 73 #define CONSHDLR_PRESOLTIMING SCIP_PRESOLTIMING_EXHAUSTIVE 75 #define DEFAULT_PPSYMRESACK FALSE 76 #define DEFAULT_CHECKALWAYSFEAS TRUE 79 #define ISFIXED0(x) (SCIPvarGetUbLocal(x) < 0.5 ? TRUE : FALSE) 80 #define ISFIXED1(x) (SCIPvarGetLbLocal(x) > 0.5 ? TRUE : FALSE) 88 struct SCIP_ConshdlrData
109 int** cycledecomposition;
127 assert( consdata != NULL );
128 assert( *consdata != NULL );
130 nvars = (*consdata)->nvars;
139 if ( (*consdata)->ppupgrade )
141 for (i = 0; i < (*consdata)->ncycles; ++i)
151 for (i = 0; i < nvars; ++i)
180 int** cycledecomposition;
190 assert( scip != NULL );
191 assert( perm != NULL );
192 assert( vars != NULL );
194 assert( upgrade != NULL );
200 for (i = 0; i < nvars; ++i)
204 for (i = 0; i < nvars; ++i)
238 assert( ncycles <= nvars / 2 );
241 for (i = 0; i < nvars; ++i)
247 for (i = 0; i < ncycles; ++i)
254 for (i = 0; i < nvars; ++i)
266 cycledecomposition[curcycle][++cyclelength] = j;
271 cycledecomposition[curcycle][0] = cyclelength;
274 if ( maxcyclelength < cyclelength )
275 maxcyclelength = cyclelength;
280 if ( setppcconshdlr == NULL )
295 for (i = 0; i < ncycles && *upgrade && ! terminated; ++i)
300 for (j = 0; j < cycledecomposition[i][0]; ++ j)
302 var = vars[cycledecomposition[i][j + 1]];
313 cyclelength = cycledecomposition[i][0];
319 for (c = 0; c < nsetppcconss; ++c)
334 assert( nsetppcvars > 0 );
337 assert( setppcvars != NULL );
340 for (j = 0; j < nsetppcvars && nfound < cyclelength; ++j)
349 for (k = 0; k < cyclelength; ++k)
351 if ( varidx == indicesincycle[k] )
358 assert( nfound <= cyclelength );
360 if ( nfound == cyclelength )
365 if ( c >= nsetppcconss )
371 (*consdata)->ncycles = ncycles;
372 (*consdata)->cycledecomposition = cycledecomposition;
381 for (i = 0; i < ncycles; ++i)
410 int* indexcorrection;
413 int naffectedvariables;
417 assert( consdata != NULL );
422 consdata->debugcnt = 0;
427 indexcorrection[0] = -1;
428 for (i = 0; i < inputnvars; ++i)
433 indexcorrection[i] = 0;
435 indexcorrection[i] = indexcorrection[i - 1] + 1;
440 indexcorrection[i] = indexcorrection[i - 1];
443 naffectedvariables = indexcorrection[inputnvars - 1] + 1;
445 (*consdata)->nvars = naffectedvariables;
448 if ( naffectedvariables == 0 )
457 for (i = 0; i < inputnvars; ++i)
461 if ( indexcorrection[i] > -1 )
463 vars[j] = inputvars[i];
464 perm[j++] = indexcorrection[inputperm[i]];
469 if ( indexcorrection[i] > indexcorrection[i - 1] )
471 vars[j] = inputvars[i];
472 perm[j++] = indexcorrection[inputperm[i]];
478 (*consdata)->vars = vars;
479 (*consdata)->perm = perm;
481 for (i = 0; i < naffectedvariables; ++i)
487 for (i = 0; i < naffectedvariables; ++i)
488 invperm[perm[i]] = i;
489 (*consdata)->invperm = invperm;
493 if ( conshdlr == NULL )
501 if ( conshdlrdata->checkppsymresack )
506 (*consdata)->ppupgrade = upgrade;
513 for (i = 0; i < naffectedvariables; ++i)
551 assert( scip != NULL );
552 assert( cons != NULL );
553 assert( infeasible != NULL );
558 assert( consdata != NULL );
560 nvars = consdata->nvars;
566 assert( consdata->vars != NULL );
567 vars = consdata->vars;
570 assert( consdata->invperm[0] != 0 );
587 if ( consdata->ppupgrade && ! *infeasible )
591 int** cycledecomposition;
595 int firstelemincycle;
597 ncycles = consdata->ncycles;
598 cycledecomposition = consdata->cycledecomposition;
606 for (i = 0; i < ncycles; ++i)
608 assert( cycledecomposition[i][0] > 0 );
610 nvarsincycle = cycledecomposition[i][0];
611 varsincons[0] = vars[cycledecomposition[i][nvarsincycle]];
612 firstelemincycle = cycledecomposition[i][1];
614 assert( firstelemincycle == consdata->perm[cycledecomposition[i][nvarsincycle]] );
619 for (j = 0; j < i; ++j)
621 nvarsincycle = cycledecomposition[j][0];
622 for (k = 1; k <= nvarsincycle; ++k)
624 if ( cycledecomposition[j][k] < firstelemincycle )
626 varsincons[nvarsincons] = vars[cycledecomposition[j][k]];
627 coeffs[nvarsincons++] = -1.0;
672 assert( scip != NULL );
673 assert( cons != NULL );
674 assert( infeasible != NULL );
675 assert( ngen != NULL );
684 assert( consdata != NULL );
685 assert( consdata->nvars > 0 );
686 nvars = consdata->nvars;
692 assert( consdata->vars != NULL );
693 assert( consdata->invperm != NULL );
694 vars = consdata->vars;
695 invperm = consdata->invperm;
698 for (i = 0; i < nvars; ++i)
706 assert( invperm[i] != i );
710 var2 = vars[invperm[i]];
711 assert( var != NULL );
712 assert( var2 != NULL );
717 SCIPdebugMsg(scip,
"Check variable pair (%d,%d).\n", i, invperm[i]);
719 SCIPdebugMsg(scip,
" -> node infeasible (pair was fixed to (0,1) but there was no pair of type (1,0) before) ---> lexicographical order violated, infeasible.\n");
726 for (r = 0; r <= i; ++r)
729 assert( invperm[r] != r );
748 SCIPdebugMsg(scip,
"Check variable pair (%d,%d).\n", i, invperm[i]);
752 assert( ! *infeasible );
764 SCIPdebugMsg(scip,
"Check variable pair (%d,%d).\n", i, invperm[i]);
768 assert( ! *infeasible );
779 SCIPdebugMsg(scip,
"Check variable pair (%d,%d).\n", i, invperm[i]);
780 SCIPdebugMsg(scip,
" -> node is feasible (pair was fixed to (1,0) and every earlier pair is constant).\n");
812 assert( scip != NULL );
813 assert( cons != NULL );
815 assert( vars != NULL );
816 assert( coeffs != NULL );
817 assert( infeasible != NULL );
825 consdata->debugcnt += 1;
831 for (i = 0; i < nvars; ++i)
833 if ( coeffs[i] == 1 || coeffs[i] == -1 )
875 assert( scip != NULL );
876 assert( consdata != NULL );
879 if ( consdata->nvars < 2 )
882 assert( consdata->vars != NULL );
883 assert( consdata->perm != NULL );
884 assert( consdata->invperm != NULL );
885 assert( infeasible != NULL );
886 assert( ngen != NULL );
888 nvars = consdata->nvars;
889 perm = consdata->perm;
890 invperm = consdata->invperm;
895 constobjective = 1.0;
896 for (i = 0; i < nvars; ++i)
900 sepaobjective[i] = vals[i];
901 constobjective -= vals[i];
904 sepaobjective[i] = vals[i] - 1.0;
912 for (crit = 0; crit < nvars; ++crit)
915 assert( perm[crit] != crit );
918 for (i = 0; i < nvars; ++i)
924 assert( invperm[crit] < nvars );
926 tmpsolu[invperm[crit]] = 1;
927 tmpsoluobj += sepaobjective[invperm[crit]];
935 tmpsoluobj += sepaobjective[i];
942 assert( tmpsolu[crit] == 0 );
953 for (i = 0; i < crit; ++i)
959 if ( tmpsolu[i] != 2 )
973 assert( tmpsolu[j] == 2 );
975 objimpact += sepaobjective[j];
978 while ( j < crit && j != i );
984 assert( tmpsolu[j] == 2 );
986 objimpact += sepaobjective[j];
993 assert( tmpsolu[j] == 2 );
995 objimpact += sepaobjective[j];
1005 tmpsoluobj += objimpact;
1011 assert( tmpsolu[j] == 1 );
1015 while ( j < crit && j != i );
1021 assert( tmpsolu[j] == 1 );
1029 assert( tmpsolu[j] == 1 );
1034 assert( j != crit );
1040 for (i = crit + 1; i < nvars; ++i)
1043 if ( tmpsolu[i] != 2 )
1048 assert( tmpsolu[i] == 2 );
1050 tmpsoluobj += sepaobjective[i];
1054 assert( tmpsolu[i] == 2 );
1063 for (i = 0; i < nvars; ++i)
1064 maxsolu[i] = tmpsolu[i];
1065 maxsoluobj = tmpsoluobj + constobjective;
1075 for (i = 0; i < nvars; ++i)
1079 maxsolu[i] = maxsolu[i] - 1;
1080 lhs += vals[i] * maxsolu[i];
1084 lhs += vals[i] * maxsolu[i];
1089 assert(
SCIPisGT(scip, lhs, rhs) );
1094 if ( ! *infeasible )
1121 assert( cons != NULL );
1123 assert( consdata != NULL);
1126 if ( consdata->nvars < 2 )
1129 assert( consdata->vars != NULL );
1130 assert( consdata->invperm != NULL );
1134 nvars = consdata->nvars;
1135 vars = consdata->vars;
1136 invperm = consdata->invperm;
1139 for (i = 0; i < nvars; ++i)
1146 assert( invperm[i] != i );
1167 else if ( val1 > val2 )
1171 assert( val2 > val1 );
1176 SCIPinfoMessage(scip, NULL,
"First non-constant pair (%d, %d) of variables has pattern (0,1).\n", i, invperm[i]);
1226 assert( scip != NULL );
1227 assert( perm != NULL );
1228 assert( nvars > 0 );
1229 assert( inputvars != NULL );
1230 assert( upgrade != NULL );
1236 if ( conshdlr == NULL )
1239 SCIPdebugMsg(scip,
"Cannot check whether symresack constraint can be upgraded to orbisack constraint. ");
1240 SCIPdebugMsg(scip,
"---> Orbisack constraint handler not found.\n");
1249 for (i = 0; i < nvars; ++i)
1255 if ( perm[perm[i]] != i )
1263 vars1[nrows] = inputvars[i];
1264 vars2[nrows++] = inputvars[perm[i]];
1266 assert( nrows <= nvars );
1273 else if ( *upgrade )
1276 initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode) );
1325 assert( scip != NULL );
1326 assert( cons != NULL );
1327 assert( perm != NULL );
1328 assert( vars != NULL );
1329 assert( nvars > 0 );
1332 initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode) );
1337 initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode) );
1353 assert( scip != NULL );
1354 assert( conshdlr != NULL );
1355 assert( consdata != NULL );
1370 assert( scip != NULL );
1371 assert( conshdlr != NULL );
1375 assert( conshdlrdata != NULL );
1392 assert( scip != NULL );
1393 assert( conshdlr != NULL );
1395 assert( sourcecons != NULL );
1396 assert( targetcons != NULL );
1402 assert( sourcedata != NULL);
1403 assert( sourcedata->nvars != 0 );
1404 assert( sourcedata->vars != NULL );
1405 assert( sourcedata->perm != NULL );
1406 assert( sourcedata->invperm != NULL );
1408 if ( sourcedata->ppupgrade )
1410 assert( sourcedata->ncycles != 0 );
1411 assert( sourcedata->cycledecomposition != NULL );
1412 for (i = 0; i < sourcedata->ncycles; ++i)
1414 assert( sourcedata->cycledecomposition[i] != NULL );
1415 assert( sourcedata->cycledecomposition[i][0] != 0 );
1421 nvars = sourcedata->nvars;
1426 consdata->debugcnt = sourcedata->debugcnt;
1428 consdata->nvars = nvars;
1434 for (i = 0; i < nvars; ++i)
1442 consdata->ppupgrade = sourcedata->ppupgrade;
1444 if ( sourcedata->ppupgrade )
1446 consdata->ncycles = sourcedata->ncycles;
1448 for (i = 0; i < sourcedata->ncycles; ++i)
1473 assert( infeasible != NULL );
1474 *infeasible =
FALSE;
1476 assert( scip != NULL );
1477 assert( conshdlr != NULL );
1481 for (c = 0; c < nconss; ++c)
1483 assert( conss[c] != NULL );
1491 SCIPdebugMsg(scip,
"Generated initial symresack cuts.\n");
1506 assert( scip != NULL );
1507 assert( conshdlr != NULL );
1509 assert( result != NULL );
1511 SCIPdebugMsg(scip,
"Separation method for symresack constraints\n");
1526 for (c = 0; c < nconss; ++c)
1534 assert( conss[c] != NULL );
1538 assert( consdata->nvars <= ntotalvars );
1571 assert( scip != NULL );
1572 assert( conshdlr != NULL );
1574 assert( result != NULL );
1576 SCIPdebugMsg(scip,
"Separation method for symresack constraints\n");
1587 for (c = 0; c < nconss; ++c)
1595 assert( conss[c] != NULL );
1599 assert( consdata->nvars <= ntotalvars );
1636 assert( scip != NULL );
1637 assert( conshdlr != NULL );
1639 assert( result != NULL );
1641 SCIPdebugMsg(scip,
"Enforcing method for symresack constraints (lp solutions) ...\n");
1657 for (c = 0; c < nconss; ++c)
1665 assert( conss[c] != NULL );
1669 assert( consdata->nvars <= ntotalvars );
1699 assert( scip != NULL );
1700 assert( conshdlr != NULL );
1702 assert( result != NULL );
1704 SCIPdebugMsg(scip,
"Enforcing method for symresack constraints (pseudo solutions) ...\n");
1708 if ( objinfeasible || solinfeasible )
1712 for (c = 0; c < nconss; ++c)
1735 assert( scip != NULL );
1736 assert( conshdlr != NULL );
1738 assert( result != NULL );
1740 SCIPdebugMsg(scip,
"Enforcing method for symresack constraints (relaxation solutions) ...\n");
1756 for (c = 0; c < nconss; ++c)
1764 assert( conss[c] != NULL );
1768 assert( consdata->nvars <= ntotalvars );
1797 assert( scip != NULL );
1798 assert( conshdlr != NULL );
1800 assert( result != NULL );
1805 assert( conshdlrdata != NULL );
1807 if ( conshdlrdata->checkalwaysfeas )
1811 for (c = 0; c < nconss; ++c)
1833 assert( scip != NULL );
1834 assert( conshdlr != NULL );
1836 assert( result != NULL );
1840 SCIPdebugMsg(scip,
"Propagation method of symresack constraint handler.\n");
1843 for (c = 0; c < nconss; ++c)
1848 assert( conss[c] != NULL );
1858 success = success || ( ngen > 0 );
1881 assert( scip != NULL );
1882 assert( conshdlr != NULL );
1884 assert( result != NULL );
1886 oldndelconss = *ndelconss;
1888 SCIPdebugMsg(scip,
"Presolving method of symresack constraint handler. Propagating symresack inequalities.\n");
1892 for (c = 0; c < nconss; ++c)
1898 assert( conss[c] != NULL );
1901 assert( consdata != NULL );
1904 if ( consdata->nvars == 0 )
1922 *nfixedvars += ngen;
1929 if ( *ndelconss > oldndelconss || success )
1946 assert( scip != NULL );
1947 assert( conshdlr != NULL );
1949 assert( cons != NULL );
1950 assert( infervar != NULL );
1951 assert( bdchgidx != NULL );
1952 assert( result != NULL );
1954 SCIPdebugMsg(scip,
"Propagation resolution method of symresack constraint handler.\n");
1959 assert( consdata != NULL );
1962 if ( consdata->nvars < 2 )
1965 assert( consdata->vars != NULL );
1966 assert( consdata->invperm != NULL );
1968 vars = consdata->vars;
1969 nvars = consdata->nvars;
1970 invperm = consdata->invperm;
1972 assert( 0 <= inferinfo && inferinfo < (2 * nvars - 1) );
1975 if ( inferinfo < nvars )
1977 assert( vars[invperm[inferinfo]] == infervar );
1984 SCIPdebugMsg(scip,
" -> reason for setting x[%d] = 0 was fixing x[%d] to 0 ", invperm[inferinfo], inferinfo);
1985 SCIPdebugMsg(scip,
"and each pair of binary variables before (%d,%d) which are not fixed points is constant.\n",
1986 inferinfo, invperm[inferinfo]);
1990 for (i = 0; i < inferinfo; ++i)
1993 assert( invperm[i] != i );
2007 inferinfo2 = inferinfo - nvars;
2008 assert( vars[inferinfo2] == infervar );
2015 SCIPdebugMsg(scip,
" -> reason for setting x[%d] = 1 was fixing x[%d] to 1 ", inferinfo2, invperm[inferinfo2]);
2016 SCIPdebugMsg(scip,
"and each pair of binary variables before (%d,%d) which are not fixed points is constant.\n",
2017 inferinfo2, invperm[inferinfo2]);
2021 for (i = 0; i < inferinfo2; ++i)
2024 assert( invperm[i] != i );
2061 assert( scip != NULL );
2062 assert( conshdlr != NULL );
2064 assert( cons != NULL );
2066 SCIPdebugMsg(scip,
"Locking method for symresack constraint handler.\n");
2070 assert( consdata != NULL );
2073 if ( consdata->nvars < 2 )
2076 assert( consdata->vars != NULL );
2077 assert( consdata->perm != NULL );
2079 nvars = consdata->nvars;
2080 vars = consdata->vars;
2081 perm = consdata->perm;
2083 for (i = 0; i < nvars; ++i)
2086 assert( perm[i] != i );
2118 assert( scip != NULL );
2119 assert( conshdlr != NULL );
2121 assert( cons != NULL );
2124 assert( consdata != NULL );
2126 SCIPdebugMsg(scip,
"Printing method for symresack constraint handler\n");
2129 if ( consdata->nvars < 2 )
2135 assert( consdata->vars != NULL );
2136 assert( consdata->perm != NULL );
2138 vars = consdata->vars;
2139 nvars = consdata->nvars;
2140 perm = consdata->perm;
2143 for (i = 0; i < nvars; ++i)
2146 if ( consdata->ppupgrade )
2151 for (i = 0; i < nvars; ++i)
2182 assert( cons != NULL );
2183 assert( success != NULL );
2184 assert( vars != NULL );
2187 assert( consdata != NULL );
2189 if ( varssize < consdata->nvars )
2196 for (i = 0; i < consdata->nvars; ++i)
2197 vars[cnt++] = consdata->vars[i];
2211 assert( cons != NULL );
2212 assert( success != NULL );
2213 assert( nvars != NULL );
2216 assert( consdata != NULL );
2218 (*nvars) = consdata->nvars;
2238 consEnfolpSymresack, consEnfopsSymresack, consCheckSymresack, consLockSymresack,
2240 assert( conshdlr != NULL );
2258 "Upgrade symresack constraints to packing/partioning symresacks?",
2262 "Whether check routine returns always SCIP_FEASIBLE.",
2315 assert( cons != NULL );
2316 assert( nvars > 0 );
2320 if ( conshdlr == NULL )
2330 SCIP_CALL(
SCIPcreateCons(scip, cons, name, conshdlr, consdata, initial, separate && (! consdata->ppupgrade), enforce, check, propagate,
2331 local, modifiable, dynamic, removable, stickingatnode) );
enum SCIP_Result SCIP_RESULT
#define SCIPfreeBlockMemoryArray(scip, ptr, num)
SCIP_RETCODE SCIPsetConshdlrDelete(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSDELETE((*consdelete)))
#define CONSHDLR_ENFOPRIORITY
#define CONSHDLR_PRESOLTIMING
SCIP_RETCODE SCIPcreateConsBasicSymresack(SCIP *scip, SCIP_CONS **cons, const char *name, int *perm, SCIP_VAR **vars, int nvars)
#define SCIPallocBlockMemoryArray(scip, ptr, num)
static SCIP_DECL_CONSPROP(consPropSymresack)
SCIP_RETCODE SCIPcacheRowExtensions(SCIP *scip, SCIP_ROW *row)
SCIP_Bool SCIPconsIsDynamic(SCIP_CONS *cons)
SCIP_RETCODE SCIPsetConshdlrTrans(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSTRANS((*constrans)))
SCIP_RETCODE SCIPcreateSymbreakCons(SCIP *scip, SCIP_CONS **cons, const char *name, int *perm, SCIP_VAR **vars, int nvars, 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_Bool stickingatnode)
static SCIP_DECL_CONSFREE(consFreeSymresack)
SCIP_CONSHDLR * SCIPfindConshdlr(SCIP *scip, const char *name)
SCIP_RETCODE SCIPflushRowExtensions(SCIP *scip, SCIP_ROW *row)
int SCIPgetNVarsSetppc(SCIP *scip, SCIP_CONS *cons)
static SCIP_RETCODE consdataFree(SCIP *scip, SCIP_CONSDATA **consdata)
SCIP_RETCODE SCIPsetConshdlrGetVars(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSGETVARS((*consgetvars)))
SCIP_RETCODE SCIPsetConshdlrEnforelax(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSENFORELAX((*consenforelax)))
SCIP_RETCODE SCIPdelCons(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPaddVarToRow(SCIP *scip, SCIP_ROW *row, SCIP_VAR *var, SCIP_Real val)
SCIP_Real SCIPvarGetLbLocal(SCIP_VAR *var)
static SCIP_DECL_CONSENFORELAX(consEnforelaxSymresack)
SCIP_RETCODE SCIPaddConflictBinvar(SCIP *scip, SCIP_VAR *var)
SCIP_RETCODE SCIPgetTransformedVar(SCIP *scip, SCIP_VAR *var, SCIP_VAR **transvar)
SCIP_RETCODE SCIPreleaseVar(SCIP *scip, SCIP_VAR **var)
SCIP_Bool SCIPvarIsBinary(SCIP_VAR *var)
SCIP_CONS ** SCIPconshdlrGetConss(SCIP_CONSHDLR *conshdlr)
#define CONSHDLR_PROPFREQ
SCIP_RETCODE SCIPincludeConshdlrBasic(SCIP *scip, SCIP_CONSHDLR **conshdlrptr, const char *name, const char *desc, int enfopriority, int chckpriority, int eagerfreq, SCIP_Bool needscons, SCIP_DECL_CONSENFOLP((*consenfolp)), SCIP_DECL_CONSENFOPS((*consenfops)), SCIP_DECL_CONSCHECK((*conscheck)), SCIP_DECL_CONSLOCK((*conslock)), SCIP_CONSHDLRDATA *conshdlrdata)
constraint handler for orbisack constraints
SCIP_Real SCIPinfinity(SCIP *scip)
int SCIPsnprintf(char *t, int len, const char *s,...)
enum SCIP_Retcode SCIP_RETCODE
SCIP_RETCODE SCIPaddConflictUb(SCIP *scip, SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx)
SCIP_RETCODE SCIPaddVarLocks(SCIP *scip, SCIP_VAR *var, int nlocksdown, int nlocksup)
SCIP_Bool SCIPconsIsStickingAtNode(SCIP_CONS *cons)
static SCIP_RETCODE checkSymresackSolution(SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol, SCIP_RESULT *result, SCIP_Bool printreason)
int SCIPvarGetProbindex(SCIP_VAR *var)
#define CONSHDLR_MAXPREROUNDS
SCIP_RETCODE SCIPinitConflictAnalysis(SCIP *scip, SCIP_CONFTYPE conftype, SCIP_Bool iscutoffinvolved)
#define SCIPfreeBlockMemory(scip, ptr)
SCIP_RETCODE SCIPsetConshdlrSepa(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSSEPALP((*conssepalp)), SCIP_DECL_CONSSEPASOL((*conssepasol)), int sepafreq, int sepapriority, SCIP_Bool delaysepa)
#define SCIPfreeBufferArray(scip, ptr)
static SCIP_DECL_CONSPRESOL(consPresolSymresack)
Constraint handler for the set partitioning / packing / covering constraints .
#define SCIPallocBlockMemory(scip, ptr)
SCIP_Bool SCIPisTransformed(SCIP *scip)
int SCIPgetNLPBranchCands(SCIP *scip)
#define DEFAULT_CHECKALWAYSFEAS
static SCIP_DECL_CONSGETNVARS(consGetNVarsSymresack)
SCIP_Bool SCIPconsIsRemovable(SCIP_CONS *cons)
SCIP_RETCODE SCIPsetConshdlrInitlp(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSINITLP((*consinitlp)))
SCIP_RETCODE SCIPgetTransformedVars(SCIP *scip, int nvars, SCIP_VAR **vars, SCIP_VAR **transvars)
static SCIP_RETCODE separateSymresackCovers(SCIP *scip, SCIP_CONS *cons, const SCIP_CONSDATA *consdata, SCIP_Real *vals, int *ngen, SCIP_Bool *infeasible)
static SCIP_DECL_CONSINITLP(consInitlpSymresack)
void SCIPinfoMessage(SCIP *scip, FILE *file, const char *formatstr,...)
SCIP_RETCODE SCIPcreateCons(SCIP *scip, SCIP_CONS **cons, const char *name, SCIP_CONSHDLR *conshdlr, SCIP_CONSDATA *consdata, 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_Bool stickingatnode)
SCIP_RETCODE SCIPaddConflictLb(SCIP *scip, SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx)
SCIP_RETCODE SCIPcreateConsOrbisack(SCIP *scip, SCIP_CONS **cons, const char *name, SCIP_VAR *const *vars1, SCIP_VAR *const *vars2, int nrows, SCIP_Bool ispporbisack, SCIP_Bool isparttype, 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_Bool stickingatnode)
static SCIP_DECL_CONSPRINT(consPrintSymresack)
#define CONSHDLR_NEEDSCONS
SCIP_RETCODE SCIPcreateConsSymresack(SCIP *scip, SCIP_CONS **cons, const char *name, int *perm, SCIP_VAR **vars, int nvars, 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_Bool stickingatnode)
SCIP_Bool SCIPisConflictAnalysisApplicable(SCIP *scip)
constraint handler for symresack constraints
#define SCIPduplicateBlockMemoryArray(scip, ptr, source, num)
static SCIP_RETCODE addSymresackInequality(SCIP *scip, SCIP_CONS *cons, int nvars, SCIP_VAR **vars, int *coeffs, SCIP_Real rhs, SCIP_Bool *infeasible)
static SCIP_DECL_CONSSEPALP(consSepalpSymresack)
#define CONSHDLR_EAGERFREQ
SCIP_RETCODE SCIPincludeConshdlrSymresack(SCIP *scip)
const char * SCIPconshdlrGetName(SCIP_CONSHDLR *conshdlr)
SCIP_RETCODE SCIPgetSolVals(SCIP *scip, SCIP_SOL *sol, int nvars, SCIP_VAR **vars, SCIP_Real *vals)
static SCIP_DECL_CONSENFOLP(consEnfolpSymresack)
#define SCIPfreeBufferArrayNull(scip, ptr)
SCIP_Bool SCIPisEfficacious(SCIP *scip, SCIP_Real efficacy)
SCIP_Real SCIPvarGetUbAtIndex(SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx, SCIP_Bool after)
const char * SCIPconsGetName(SCIP_CONS *cons)
static SCIP_DECL_CONSLOCK(consLockSymresack)
SCIP_RETCODE SCIPmarkDoNotMultaggrVar(SCIP *scip, SCIP_VAR *var)
SCIP_Bool SCIPconsIsPropagated(SCIP_CONS *cons)
const char * SCIPvarGetName(SCIP_VAR *var)
SCIP_RETCODE SCIPsetConshdlrFree(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSFREE((*consfree)))
SCIP_CONSHDLRDATA * SCIPconshdlrGetData(SCIP_CONSHDLR *conshdlr)
static SCIP_DECL_CONSDELETE(consDeleteSymresack)
#define CONSHDLR_SEPAFREQ
SCIP_RETCODE SCIPanalyzeConflictCons(SCIP *scip, SCIP_CONS *cons, SCIP_Bool *success)
SCIP_Bool SCIPconsIsLocal(SCIP_CONS *cons)
static SCIP_DECL_CONSSEPASOL(consSepasolSymresack)
SCIP_RETCODE SCIPaddRow(SCIP *scip, SCIP_ROW *row, SCIP_Bool forcecut, SCIP_Bool *infeasible)
SCIP_RETCODE SCIPsetConshdlrResprop(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSRESPROP((*consresprop)))
struct SCIP_ConsData SCIP_CONSDATA
int SCIPconshdlrGetNConss(SCIP_CONSHDLR *conshdlr)
static SCIP_RETCODE packingUpgrade(SCIP *scip, SCIP_CONSDATA **consdata, int *perm, SCIP_VAR **vars, int nvars, SCIP_Bool *upgrade)
#define SCIPallocBufferArray(scip, ptr, num)
SCIP_RETCODE SCIPcreateEmptyRowCons(SCIP *scip, SCIP_ROW **row, SCIP_CONSHDLR *conshdlr, const char *name, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool removable)
SCIP_SETPPCTYPE SCIPgetTypeSetppc(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPvarGetLbAtIndex(SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx, SCIP_Bool after)
SCIP_CONSHDLR * SCIPconsGetHdlr(SCIP_CONS *cons)
static SCIP_DECL_CONSRESPROP(consRespropSymresack)
SCIP_Bool SCIPconsIsChecked(SCIP_CONS *cons)
SCIP_Bool SCIPconsIsInitial(SCIP_CONS *cons)
static SCIP_DECL_CONSCHECK(consCheckSymresack)
static SCIP_RETCODE initLP(SCIP *scip, SCIP_CONS *cons, SCIP_Bool *infeasible)
SCIP_RETCODE SCIPsetConshdlrPrint(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPRINT((*consprint)))
SCIP_RETCODE SCIPinferVarLbCons(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound, SCIP_CONS *infercons, int inferinfo, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened)
static SCIP_RETCODE consdataCreate(SCIP *scip, SCIP_CONSDATA **consdata, SCIP_VAR *const *inputvars, int inputnvars, int *inputperm)
SCIP_VAR ** SCIPgetVarsSetppc(SCIP *scip, SCIP_CONS *cons)
int SCIPgetNVars(SCIP *scip)
#define CONSHDLR_DELAYSEPA
SCIP_RETCODE SCIPreleaseRow(SCIP *scip, SCIP_ROW **row)
SCIP_Bool SCIPisGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
#define CONSHDLR_PROP_TIMING
SCIP_CONSDATA * SCIPconsGetData(SCIP_CONS *cons)
SCIP_RETCODE SCIPinferVarUbCons(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound, SCIP_CONS *infercons, int inferinfo, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened)
static SCIP_RETCODE orbisackUpgrade(SCIP *scip, SCIP_CONS **cons, const char *name, int *perm, SCIP_VAR **inputvars, int nvars, SCIP_Bool *upgrade, 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_Bool stickingatnode)
static SCIP_DECL_CONSGETVARS(consGetVarsSymresack)
#define DEFAULT_PPSYMRESACK
SCIP_RETCODE SCIPsetConshdlrPresol(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPRESOL((*conspresol)), int maxprerounds, SCIP_PRESOLTIMING presoltiming)
SCIP_RETCODE SCIPcaptureVar(SCIP *scip, SCIP_VAR *var)
SCIP_Bool SCIPconsIsModifiable(SCIP_CONS *cons)
SCIP_RETCODE SCIPaddVarsToRow(SCIP *scip, SCIP_ROW *row, int nvars, SCIP_VAR **vars, SCIP_Real *vals)
#define CONSHDLR_CHECKPRIORITY
SCIP_RETCODE SCIPsetConshdlrGetNVars(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSGETNVARS((*consgetnvars)))
SCIP_Bool SCIPconsIsEnforced(SCIP_CONS *cons)
SCIP_Bool SCIPconsIsSeparated(SCIP_CONS *cons)
static SCIP_DECL_CONSENFOPS(consEnfopsSymresack)
#define CONSHDLR_SEPAPRIORITY
struct SCIP_ConshdlrData SCIP_CONSHDLRDATA
SCIP_Real SCIPvarGetUbLocal(SCIP_VAR *var)
#define SCIPfreeBlockMemoryArrayNull(scip, ptr, num)
SCIP_Bool SCIPisFeasIntegral(SCIP *scip, SCIP_Real val)
#define CONSHDLR_DELAYPROP
static SCIP_RETCODE propVariables(SCIP *scip, SCIP_CONS *cons, SCIP_Bool *infeasible, int *ngen)
static SCIP_DECL_CONSTRANS(consTransSymresack)
SCIP_Real SCIPgetSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var)
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)
SCIP_Bool SCIPvarIsNegated(SCIP_VAR *var)
SCIP_RETCODE SCIPsetConshdlrProp(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPROP((*consprop)), int propfreq, SCIP_Bool delayprop, SCIP_PROPTIMING proptiming)