44 #define CONSHDLR_NAME "superindicator" 45 #define CONSHDLR_DESC "constraint handler for indicator constraints over arbitrary constraint types" 46 #define CONSHDLR_SEPAPRIORITY 0 47 #define CONSHDLR_ENFOPRIORITY -5000000 48 #define CONSHDLR_CHECKPRIORITY -5000000 49 #define CONSHDLR_SEPAFREQ -1 50 #define CONSHDLR_PROPFREQ 1 51 #define CONSHDLR_EAGERFREQ 100 53 #define CONSHDLR_MAXPREROUNDS -1 55 #define CONSHDLR_DELAYSEPA FALSE 56 #define CONSHDLR_DELAYPROP FALSE 57 #define CONSHDLR_NEEDSCONS TRUE 59 #define CONSHDLR_PROP_TIMING SCIP_PROPTIMING_BEFORELP 60 #define CONSHDLR_PRESOLTIMING SCIP_PRESOLTIMING_MEDIUM 62 #define DEFAULT_CHECKSLACKTYPE TRUE 63 #define DEFAULT_UPGDPRIOINDICATOR 1 64 #define DEFAULT_UPGDPRIOLINEAR 2 65 #define DEFAULT_MAXUPGDCOEFLINEAR 1e4 81 struct SCIP_ConshdlrData
86 int upgdprioindicator;
104 assert(scip !=
NULL);
108 (*consdata)->binvar = binvar;
109 (*consdata)->slackcons = slackcons;
129 assert((*consdata)->slackcons !=
NULL);
164 else if( binval > 0.5 )
168 SCIP_CALL(
SCIPcheckCons(scip, consdata->slackcons, sol, checkintegrality, checklprows, printreason, result) );
172 SCIPinfoMessage(scip,
NULL,
"violation: SCIPcheckCons() for slack constraint <%s> returns infeasible while binvar <%s> == 1\n",
185 assert(*result == testresultnotintegrality);
186 assert(*result == testresultnotlprows);
190 SCIPdebugMsg(scip,
"binvar <%s> == 1, sol=%p --> SCIPcheckCons() on constraint <%s> --> %s\n",
222 assert(scip !=
NULL);
223 assert(cons !=
NULL);
224 assert(minactivity !=
NULL);
225 assert(maxactivity !=
NULL);
226 assert(minabscoef !=
NULL);
238 ismininfinity =
FALSE;
239 ismaxinfinity =
FALSE;
244 for( i = nvars-1; i >= 0; i-- )
263 *minactivity += (val > 0.0) ? val * lb : val * ub;
266 *maxactivity += (val > 0.0) ? val * ub : val * lb;
269 if( val > 0.0 && val < *minabscoef )
271 else if( val < 0.0 && -val < *minabscoef )
272 *minabscoef = -vals[i];
306 assert(scip !=
NULL);
307 assert(cons !=
NULL);
308 assert(success !=
NULL);
309 assert(deleted !=
NULL);
318 assert(consdata !=
NULL);
326 if( conshdlr ==
NULL )
373 for( i = nvars-1; i >= 0; i-- )
374 negvals[i] = -vals[i];
431 assert(scip !=
NULL);
432 assert(cons !=
NULL);
433 assert(success !=
NULL);
434 assert(deleted !=
NULL);
443 assert(consdata !=
NULL);
445 slackcons = consdata->slackcons;
446 assert(slackcons !=
NULL);
456 if( conshdlr ==
NULL )
494 maxact - rhs > maxcoef)) ||
496 lhs - minact > maxcoef)) )
498 SCIPdebugMsg(scip,
"constraint <%s> not upgraded to a linear constraint due to large big-M coefficient\n",
512 assert(slackvars !=
NULL);
513 assert(slackvals !=
NULL);
515 for( i = nvars-1; i >= 0; i-- )
517 newvars[i] = slackvars[i];
518 newvals[i] = slackvals[i];
522 newvars[nvars] = consdata->binvar;
523 assert(newvars[nvars] !=
NULL);
539 newvals[nvars] = maxact - rhs;
570 newvals[nvars] = minact - lhs;
614 assert(scip !=
NULL);
615 assert(cons !=
NULL);
616 assert(success !=
NULL);
617 assert(deleted !=
NULL);
625 if( conshdlrdata->upgdprioindicator > conshdlrdata->upgdpriolinear )
627 assert(conshdlrdata->upgdprioindicator >= 0);
631 if( !*deleted && !*success && conshdlrdata->upgdpriolinear >= 0 )
637 else if( conshdlrdata->upgdpriolinear >= 0 )
641 if( !*deleted && !*success && conshdlrdata->upgdprioindicator >= 0 )
666 assert(scip !=
NULL);
667 assert(conshdlr !=
NULL);
668 assert(result !=
NULL);
677 SCIPdebugMsg(scip,
"executing enforcement callback for %s solution\n", sol ==
NULL ?
"LP" :
"relaxation");
687 for( i = nconss-1; i >= 0 && cont; i-- )
693 assert(consdata !=
NULL);
704 SCIPdebugMsg(scip,
"binvar <%s> == 1 locally --> SCIPenfolpCons() on constraint <%s>\n",
711 SCIPdebugMsg(scip,
"binvar <%s> == 1 locally --> SCIPenforelaxCons() on constraint <%s>\n",
788 assert(scip !=
NULL);
806 assert(conshdlr !=
NULL);
808 assert(scip !=
NULL);
810 SCIPdebugMsg(scip,
"freeing superindicator constraint handler data\n");
814 assert(conshdlrdata !=
NULL);
832 for( i = nconss-1; i >= 0; i-- )
835 assert(consdata !=
NULL);
848 assert(conshdlr !=
NULL);
850 assert(consdata !=
NULL);
851 assert(*consdata !=
NULL);
852 assert((*consdata)->slackcons !=
NULL);
879 assert(sourcedata !=
NULL);
900 assert(scip !=
NULL);
902 assert(infeasible !=
NULL);
908 for( c = nconss-1; c >= 0 && !(*infeasible); c-- )
914 assert(consdata !=
NULL);
921 SCIPdebugMsg(scip,
"binvar <%s> == 1 --> SCIPinitlpCons() on constraint <%s>\n",
937 assert(conshdlr !=
NULL);
939 assert(conss !=
NULL);
940 assert(result !=
NULL);
951 for( c = nusefulconss-1; c >= 0 && *result !=
SCIP_CUTOFF; c-- )
957 assert(consdata !=
NULL);
966 SCIPdebugMsg(scip,
"binvar <%s> == 1 --> SCIPsepalpCons() on constraint <%s>\n",
1006 *result = locresult;
1015 *result = locresult;
1025 *result = locresult;
1046 assert(conshdlr !=
NULL);
1048 assert(conss !=
NULL);
1049 assert(result !=
NULL);
1061 for( c = 0; c < nusefulconss && *result !=
SCIP_CUTOFF; ++c )
1067 assert(consdata !=
NULL);
1076 SCIPdebugMsg(scip,
"binvar <%s> == 0 --> SCIPsepasolCons() on constraint <%s>\n",
1090 *result = locresult;
1095 *result = locresult;
1101 *result = locresult;
1108 *result = locresult;
1116 *result = locresult;
1125 *result = locresult;
1135 *result = locresult;
1175 assert(scip !=
NULL);
1176 assert(conshdlr !=
NULL);
1177 assert(result !=
NULL);
1185 else if( objinfeasible )
1197 for( i = nconss-1; i >= 0 && cont; i-- )
1203 assert(consdata !=
NULL);
1212 SCIPdebugMsg(scip,
"binvar <%s> == 1 locally --> SCIPenfopsCons() on constraint <%s>\n",
1233 *result = locresult;
1240 *result = locresult;
1247 *result = locresult;
1256 *result = locresult;
1266 *result = locresult;
1277 *result = locresult;
1289 *result = locresult;
1308 assert(scip !=
NULL);
1309 assert(conshdlr !=
NULL);
1310 assert(result !=
NULL);
1311 assert(sol !=
NULL);
1315 for( i = nconss-1; i >= 0 && (*result ==
SCIP_FEASIBLE || completely); i-- )
1323 SCIPdebugMsg(scip,
"checked solution from <%s> (checkintegrality=%u, checklprows=%u) --> result=%d (%sfeasible)\n",
1336 assert(scip !=
NULL);
1337 assert(conshdlr !=
NULL);
1338 assert(result !=
NULL);
1345 for( i = nusefulconss-1; i >= 0 && *result !=
SCIP_CUTOFF; i-- )
1351 assert(consdata !=
NULL);
1360 SCIPdebugMsg(scip,
"binvar <%s> == 1 globally --> deleting superindicator and adding slack constraint <%s>\n",
1373 SCIPdebugMsg(scip,
"binvar <%s> == 1 locally --> propagating slack constraint <%s>\n",
1392 *result = locresult;
1397 *result = locresult;
1403 *result = locresult;
1410 *result = locresult;
1429 assert(scip !=
NULL);
1430 assert(conss !=
NULL);
1431 assert(conshdlr !=
NULL);
1437 for( i = nconss-1; i >= 0 && *result !=
SCIP_CUTOFF; i-- )
1443 assert(consdata !=
NULL);
1456 SCIPdebugMsg(scip,
"binvar <%s> == 1 globally --> deleting superindicator and adding slack constraint <%s>\n",
1483 if( deleted || success )
1496 *result = locresult;
1503 *result = locresult;
1522 assert(scip !=
NULL);
1523 assert(cons !=
NULL);
1524 assert(infervar !=
NULL);
1525 assert(bdchgidx !=
NULL);
1526 assert(result !=
NULL);
1531 assert(consdata !=
NULL);
1542 SCIP_CALL(
SCIPrespropCons(scip, consdata->slackcons, infervar, inferinfo, boundtype, bdchgidx, relaxedbd, result) );
1555 assert(scip !=
NULL);
1560 assert(consdata !=
NULL);
1580 assert(scip !=
NULL);
1581 assert(conshdlr !=
NULL);
1582 assert(cons !=
NULL);
1586 assert(consdata !=
NULL);
1589 binvar = consdata->binvar;
1590 assert(binvar !=
NULL);
1598 assert(binvar !=
NULL);
1608 assert(consdata->slackcons !=
NULL);
1623 const char* consname;
1625 assert(scip !=
NULL);
1626 assert(sourcescip !=
NULL);
1627 assert(sourcecons !=
NULL);
1641 SCIPwarningMessage(scip,
"cannot create modifiable superindicator constraint when trying to copy constraint <%s>\n",
1648 assert(sourceconsdata !=
NULL);
1651 sourceslackcons = sourceconsdata->slackcons;
1652 assert(sourceslackcons !=
NULL);
1657 SCIPdebugMsg(scip,
"slack constraint <%s> deleted; creating empty linear constraint\n",
1669 assert(conshdlrslack !=
NULL);
1680 assert(transslackcons !=
NULL);
1684 sourceconsdata->slackcons = transslackcons;
1685 sourceslackcons = transslackcons;
1700 sourcebinvar = sourceconsdata->binvar;
1701 assert(sourcebinvar !=
NULL);
1706 targetbinvar =
NULL;
1711 assert(targetslackcons !=
NULL);
1712 assert(targetbinvar !=
NULL);
1713 assert(!modifiable);
1716 initial, separate, enforce, check, propagate, local, dynamic, removable, stickingatnode) );
1720 if( targetslackcons !=
NULL )
1739 char binvarname[1024];
1740 const char* slackstr;
1744 assert(cons !=
NULL);
1745 assert(scip !=
NULL);
1746 assert(success !=
NULL);
1747 assert(str !=
NULL);
1748 assert(name !=
NULL);
1753 nargs = sscanf(str,
" <%1023[^>]>[B] = %d", binvarname, &zeroone);
1755 if( nargs != 2 || (zeroone != 0 && zeroone != 1) )
1763 slackstr = strstr(str,
"->");
1765 if( slackstr ==
NULL )
1772 slackstr = strstr(slackstr,
"[");
1774 if( slackstr ==
NULL )
1781 SCIPdebugMsg(scip,
"binvarname=%s, zeroone=%d, slackstr=%s\n", binvarname, zeroone, slackstr);
1785 if( binvar ==
NULL )
1805 SCIP_CALL(
SCIPparseCons(scip, &slackcons, slackstr, initial, separate, enforce, check, propagate, local, modifiable,
1806 dynamic, removable, stickingatnode, success) );
1810 assert(binvar !=
NULL);
1811 assert(slackcons !=
NULL);
1815 initial, separate, enforce, check, propagate, local, dynamic, removable, stickingatnode) );
1831 assert(consdata !=
NULL);
1839 vars[0] = consdata->binvar;
1855 assert(consdata !=
NULL);
1886 conshdlrdata->nrejects = 0;
1891 consEnfolpSuperindicator, consEnfopsSuperindicator, consCheckSuperindicator, consLockSuperindicator,
1894 assert(conshdlr !=
NULL);
1917 assert(root !=
NULL);
1925 "change",
"change the problem",
TRUE,
NULL) );
1941 SCIPdialogExecChangeMinUC,
NULL,
NULL,
1942 "minuc",
"transforms the current problem into a MinUC problem minimizing the number of unsatisfied constraints",
1951 "should type of slack constraint be checked when creating superindicator constraint?",
1956 "maximum big-M coefficient of binary variable in upgrade to a linear constraint (relative to smallest coefficient)",
1961 "priority for upgrading to an indicator constraint (-1: never)",
1966 "priority for upgrading to an indicator constraint (-1: never)",
2009 assert(scip !=
NULL);
2010 assert(cons !=
NULL);
2011 assert(name !=
NULL);
2012 assert(binvar !=
NULL);
2013 assert(slackcons !=
NULL);
2019 if( conshdlr ==
NULL )
2026 assert(conshdlrdata !=
NULL);
2029 if( conshdlrdata->checkslacktype &&
2051 if( conshdlrdata->nrejects < 5 )
2053 SCIPwarningMessage(scip,
"rejected creation of superindicator with slack constraint <%s> of type <%s> " 2054 "(use parameter <checkslacktype> to disable check)\n",
2056 conshdlrdata->nrejects++;
2059 if( conshdlrdata->nrejects == 5 )
2062 conshdlrdata->nrejects++;
2070 assert(consdata !=
NULL);
2073 SCIP_CALL(
SCIPcreateCons(scip, cons, name, conshdlr, consdata, initial, separate, enforce, check, propagate,
2074 local, modifiable, dynamic, removable, stickingatnode) );
2095 assert(scip !=
NULL);
2096 assert(cons !=
NULL);
2097 assert(name !=
NULL);
2098 assert(binvar !=
NULL);
2099 assert(slackcons !=
NULL);
2113 assert(cons !=
NULL);
2125 assert(cons !=
NULL);
2155 assert(scip !=
NULL);
2156 assert(success !=
NULL);
2162 SCIPerrorMessage(
"method <SCIPtransformMinUC> can only be called in problem stage\n");
2175 for( i = nvars-1; i >= 0; i-- )
2189 for( i = 0; i < nconss; ++i )
2198 assert(cons !=
NULL);
2237 SCIPdebugMsg(scip,
"constraint <%s> of type <%s> could not be transformed to superindicator and was removed\n",
2256 if( ntransconss == nconss )
2294 SCIPdialogMessage(scip,
NULL,
"some constraints could not be transformed to superindicator constraints and were removed\n");
2298 SCIPdialogMessage(scip,
NULL,
"changed problem has %d variables (%d bin, %d int, %d impl, %d cont) and %d constraints\n",
SCIP_RETCODE SCIPrespropCons(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *infervar, int inferinfo, SCIP_BOUNDTYPE boundtype, SCIP_BDCHGIDX *bdchgidx, SCIP_Real relaxedbd, SCIP_RESULT *result)
enum SCIP_Result SCIP_RESULT
int SCIPgetNIntVars(SCIP *scip)
void SCIPconshdlrSetData(SCIP_CONSHDLR *conshdlr, SCIP_CONSHDLRDATA *conshdlrdata)
#define DEFAULT_UPGDPRIOLINEAR
SCIP_RETCODE SCIPsetConshdlrDelete(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSDELETE((*consdelete)))
static SCIP_RETCODE upgradeIndicatorSuperindicator(SCIP *scip, SCIP_CONS *cons, SCIP_Bool *success, SCIP_Bool *deleted)
SCIP_RETCODE SCIPincludeDialogDefault(SCIP *scip)
#define DEFAULT_CHECKSLACKTYPE
SCIP_Real SCIPgetVarUbAtIndex(SCIP *scip, SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx, SCIP_Bool after)
static SCIP_DECL_CONSENFOPS(consEnfopsSuperindicator)
SCIP_Bool SCIPisFeasEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_STAGE SCIPgetStage(SCIP *scip)
SCIP_Bool SCIPconsIsDynamic(SCIP_CONS *cons)
SCIP_RETCODE SCIPsetConshdlrTrans(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSTRANS((*constrans)))
void SCIPdialogMessage(SCIP *scip, FILE *file, const char *formatstr,...)
SCIP_RETCODE SCIPaddDialogEntry(SCIP *scip, SCIP_DIALOG *dialog, SCIP_DIALOG *subdialog)
SCIP_CONSHDLR * SCIPfindConshdlr(SCIP *scip, const char *name)
#define CONSHDLR_SEPAPRIORITY
SCIP_Real SCIPvarGetLbGlobal(SCIP_VAR *var)
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)
static SCIP_DECL_CONSGETVARS(consGetVarsSuperindicator)
SCIP_Bool SCIPisPositive(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPvarGetLbLocal(SCIP_VAR *var)
SCIP_Bool SCIPisGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
static SCIP_RETCODE upgradeSuperindicator(SCIP *scip, SCIP_CONS *cons, SCIP_Bool *success, SCIP_Bool *deleted)
SCIP_RETCODE SCIPgetTransformedVar(SCIP *scip, SCIP_VAR *var, SCIP_VAR **transvar)
static SCIP_RETCODE extractLinearValues(SCIP *scip, SCIP_CONS *cons, SCIP_Real *minactivity, SCIP_Real *maxactivity, SCIP_Real *minabscoef)
SCIP_RETCODE SCIPreleaseVar(SCIP *scip, SCIP_VAR **var)
#define CONSHDLR_MAXPREROUNDS
SCIP_RETCODE SCIPsetConshdlrInitpre(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSINITPRE((*consinitpre)))
constraint handler for indicator constraints
SCIP_RETCODE SCIPgetVarsData(SCIP *scip, SCIP_VAR ***vars, int *nvars, int *nbinvars, int *nintvars, int *nimplvars, int *ncontvars)
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)
SCIP_RETCODE SCIPparseCons(SCIP *scip, SCIP_CONS **cons, const char *str, 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 *success)
SCIP_Real SCIPinfinity(SCIP *scip)
int SCIPsnprintf(char *t, int len, const char *s,...)
SCIP_Bool SCIPisNegative(SCIP *scip, SCIP_Real val)
#define CONSHDLR_EAGERFREQ
#define CONSHDLR_CHECKPRIORITY
enum SCIP_Retcode SCIP_RETCODE
SCIP_RETCODE SCIPaddVarLocks(SCIP *scip, SCIP_VAR *var, int nlocksdown, int nlocksup)
SCIP_Bool SCIPconsIsStickingAtNode(SCIP_CONS *cons)
int SCIPdialogFindEntry(SCIP_DIALOG *dialog, const char *entryname, SCIP_DIALOG **subdialog)
SCIP_Bool SCIPconsIsTransformed(SCIP_CONS *cons)
#define SCIPfreeBlockMemory(scip, ptr)
SCIP_RETCODE SCIPtransformMinUC(SCIP *scip, SCIP_Bool *success)
constraint handler for indicator constraints over arbitrary constraint types
static SCIP_DECL_CONSSEPASOL(consSepasolSuperindicator)
SCIP_RETCODE SCIPsetConshdlrSepa(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSSEPALP((*conssepalp)), SCIP_DECL_CONSSEPASOL((*conssepasol)), int sepafreq, int sepapriority, SCIP_Bool delaysepa)
#define SCIPduplicateBufferArray(scip, ptr, source, num)
SCIP_CONS ** SCIPgetConss(SCIP *scip)
#define SCIPfreeBufferArray(scip, ptr)
#define SCIPallocBlockMemory(scip, ptr)
SCIP_Bool SCIPisTransformed(SCIP *scip)
SCIP_Bool SCIPconsIsRemovable(SCIP_CONS *cons)
SCIP_RETCODE SCIPsetConshdlrInitlp(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSINITLP((*consinitlp)))
void SCIPwarningMessage(SCIP *scip, const char *formatstr,...)
#define SCIPdebugMsgPrint
SCIP_RETCODE SCIPaddIntParam(SCIP *scip, const char *name, const char *desc, int *valueptr, SCIP_Bool isadvanced, int defaultvalue, int minvalue, int maxvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
SCIP_Real SCIPgetRhsLinear(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPsetConshdlrParse(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPARSE((*consparse)))
void SCIPinfoMessage(SCIP *scip, FILE *file, const char *formatstr,...)
int SCIPgetNContVars(SCIP *scip)
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)
static SCIP_DECL_CONSTRANS(consTransSuperindicator)
SCIP_VAR * SCIPvarGetNegatedVar(SCIP_VAR *var)
SCIP_RETCODE SCIPcreateConsSuperindicator(SCIP *scip, SCIP_CONS **cons, const char *name, SCIP_VAR *binvar, SCIP_CONS *slackcons, SCIP_Bool initial, SCIP_Bool separate, SCIP_Bool enforce, SCIP_Bool check, SCIP_Bool propagate, SCIP_Bool local, SCIP_Bool dynamic, SCIP_Bool removable, SCIP_Bool stickingatnode)
static SCIP_DECL_CONSHDLRCOPY(conshdlrCopySuperindicator)
static SCIP_DECL_CONSRESPROP(consRespropSuperindicator)
#define DEFAULT_MAXUPGDCOEFLINEAR
SCIP_VAR * SCIPfindVar(SCIP *scip, const char *name)
SCIP_DIALOG * SCIPgetRootDialog(SCIP *scip)
SCIP_Real SCIPvarGetUbGlobal(SCIP_VAR *var)
SCIP_RETCODE SCIPincludeDialog(SCIP *scip, SCIP_DIALOG **dialog, SCIP_DECL_DIALOGCOPY((*dialogcopy)), SCIP_DECL_DIALOGEXEC((*dialogexec)), SCIP_DECL_DIALOGDESC((*dialogdesc)), SCIP_DECL_DIALOGFREE((*dialogfree)), const char *name, const char *desc, SCIP_Bool issubmenu, SCIP_DIALOGDATA *dialogdata)
SCIP_RETCODE SCIPsetObjsense(SCIP *scip, SCIP_OBJSENSE objsense)
static SCIP_DECL_CONSCHECK(consCheckSuperindicator)
SCIP_RETCODE SCIPsetConshdlrCopy(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSHDLRCOPY((*conshdlrcopy)), SCIP_DECL_CONSCOPY((*conscopy)))
#define CONSHDLR_SEPAFREQ
const char * SCIPheurGetName(SCIP_HEUR *heur)
const char * SCIPconshdlrGetName(SCIP_CONSHDLR *conshdlr)
static SCIP_DECL_CONSGETNVARS(consGetNVarsSuperindicator)
SCIP_RETCODE SCIPgetConsNVars(SCIP *scip, SCIP_CONS *cons, int *nvars, SCIP_Bool *success)
SCIP_RETCODE SCIPaddCons(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPcheckCons(SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol, SCIP_Bool checkintegrality, SCIP_Bool checklprows, SCIP_Bool printreason, SCIP_RESULT *result)
const char * SCIPconsGetName(SCIP_CONS *cons)
SCIP_Bool SCIPconsIsPropagated(SCIP_CONS *cons)
const char * SCIPvarGetName(SCIP_VAR *var)
SCIP_RETCODE SCIPsetConshdlrFree(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSFREE((*consfree)))
#define CONSHDLR_ENFOPRIORITY
SCIP_CONSHDLRDATA * SCIPconshdlrGetData(SCIP_CONSHDLR *conshdlr)
SCIP_RETCODE SCIPenforelaxCons(SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol, SCIP_Bool solinfeasible, SCIP_RESULT *result)
SCIP_HEUR * SCIPsolGetHeur(SCIP_SOL *sol)
SCIP_DECL_DIALOGEXEC(SCIPdialogExecChangeMinUC)
SCIP_RETCODE SCIPtransformCons(SCIP *scip, SCIP_CONS *cons, SCIP_CONS **transcons)
void SCIPverbMessage(SCIP *scip, SCIP_VERBLEVEL msgverblevel, FILE *file, const char *formatstr,...)
SCIP_Bool SCIPconsIsLocal(SCIP_CONS *cons)
SCIP_RETCODE SCIPcreateConsBasicSuperindicator(SCIP *scip, SCIP_CONS **cons, const char *name, SCIP_VAR *binvar, SCIP_CONS *slackcons)
SCIP_RETCODE SCIPgetTransformedCons(SCIP *scip, SCIP_CONS *cons, SCIP_CONS **transcons)
SCIP_RETCODE SCIPcaptureCons(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPsetConshdlrResprop(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSRESPROP((*consresprop)))
struct SCIP_ConsData SCIP_CONSDATA
SCIP_RETCODE SCIPgetConsVars(SCIP *scip, SCIP_CONS *cons, SCIP_VAR **vars, int varssize, SCIP_Bool *success)
SCIP_RETCODE SCIPgetConsCopy(SCIP *sourcescip, SCIP *targetscip, SCIP_CONS *sourcecons, SCIP_CONS **targetcons, SCIP_CONSHDLR *sourceconshdlr, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, const char *name, 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 global, SCIP_Bool *valid)
SCIP_RETCODE SCIPchgVarObj(SCIP *scip, SCIP_VAR *var, SCIP_Real newobj)
static SCIP_DECL_CONSENFOLP(consEnfolpSuperindicator)
static SCIP_DECL_CONSINITLP(consInitlpSuperindicator)
SCIP_RETCODE SCIPpropCons(SCIP *scip, SCIP_CONS *cons, SCIP_PROPTIMING proptiming, SCIP_RESULT *result)
#define SCIPallocBufferArray(scip, ptr, num)
#define DEFAULT_UPGDPRIOINDICATOR
SCIP_RETCODE SCIPsetConsLocal(SCIP *scip, SCIP_CONS *cons, SCIP_Bool local)
int SCIPgetNImplVars(SCIP *scip)
static SCIP_DECL_CONSPARSE(consParseSuperindicator)
static SCIP_RETCODE consdataCheckSuperindicator(SCIP *scip, SCIP_CONSDATA *consdata, SCIP_SOL *sol, SCIP_Bool checkintegrality, SCIP_Bool checklprows, SCIP_Bool printreason, SCIP_RESULT *result)
int SCIPvarGetBranchPriority(SCIP_VAR *var)
SCIP_Bool SCIPdialogHasEntry(SCIP_DIALOG *dialog, const char *entryname)
static SCIP_DECL_CONSPROP(consPropSuperindicator)
SCIP_RETCODE SCIPprintCons(SCIP *scip, SCIP_CONS *cons, FILE *file)
SCIP_CONSHDLR * SCIPconsGetHdlr(SCIP_CONS *cons)
static SCIP_DECL_CONSCOPY(consCopySuperindicator)
SCIP_Bool SCIPconsIsDeleted(SCIP_CONS *cons)
SCIP_Bool SCIPconsIsChecked(SCIP_CONS *cons)
SCIP_Bool SCIPconsIsInitial(SCIP_CONS *cons)
#define CONSHDLR_PROPFREQ
SCIP_RETCODE SCIPcreateVar(SCIP *scip, SCIP_VAR **var, const char *name, SCIP_Real lb, SCIP_Real ub, SCIP_Real obj, SCIP_VARTYPE vartype, SCIP_Bool initial, SCIP_Bool removable, SCIP_DECL_VARDELORIG((*vardelorig)), SCIP_DECL_VARTRANS((*vartrans)), SCIP_DECL_VARDELTRANS((*vardeltrans)), SCIP_DECL_VARCOPY((*varcopy)), SCIP_VARDATA *vardata)
SCIP_RETCODE SCIPsepasolCons(SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol, SCIP_RESULT *result)
SCIP_RETCODE SCIPchgVarBranchPriority(SCIP *scip, SCIP_VAR *var, int branchpriority)
#define CONSHDLR_DELAYPROP
SCIP_RETCODE SCIPenfolpCons(SCIP *scip, SCIP_CONS *cons, SCIP_Bool solinfeasible, SCIP_RESULT *result)
SCIP_RETCODE SCIPsetConshdlrPrint(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPRINT((*consprint)))
Constraint handler for linear constraints in their most general form, .
static SCIP_DECL_CONSPRESOL(consPresolSuperindicator)
SCIP_Bool SCIPisInfinity(SCIP *scip, SCIP_Real val)
SCIP_RETCODE SCIPdialoghdlrAddHistory(SCIP_DIALOGHDLR *dialoghdlr, SCIP_DIALOG *dialog, const char *command, SCIP_Bool escapecommand)
int SCIPgetNBinVars(SCIP *scip)
int SCIPgetNVars(SCIP *scip)
static SCIP_DECL_CONSINITPRE(consInitpreSuperindicator)
static SCIP_DECL_CONSFREE(consFreeSuperindicator)
SCIP_RETCODE SCIPcreateConsIndicator(SCIP *scip, SCIP_CONS **cons, const char *name, SCIP_VAR *binvar, int nvars, SCIP_VAR **vars, SCIP_Real *vals, SCIP_Real rhs, SCIP_Bool initial, SCIP_Bool separate, SCIP_Bool enforce, SCIP_Bool check, SCIP_Bool propagate, SCIP_Bool local, SCIP_Bool dynamic, SCIP_Bool removable, SCIP_Bool stickingatnode)
SCIP_RETCODE SCIPcreateConsLinear(SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars, SCIP_Real *vals, 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_Bool stickingatnode)
static SCIP_DECL_CONSLOCK(consLockSuperindicator)
SCIP_DIALOG * SCIPdialoghdlrGetRoot(SCIP_DIALOGHDLR *dialoghdlr)
static SCIP_DECL_CONSENFORELAX(consEnforelaxSuperindicator)
SCIP_Bool SCIPisIntegral(SCIP *scip, SCIP_Real val)
SCIP_RETCODE SCIPenfopsCons(SCIP *scip, SCIP_CONS *cons, SCIP_Bool solinfeasible, SCIP_Bool objinfeasible, SCIP_RESULT *result)
SCIP_RETCODE SCIPsepalpCons(SCIP *scip, SCIP_CONS *cons, SCIP_RESULT *result)
SCIP_RETCODE SCIPgetVarCopy(SCIP *sourcescip, SCIP *targetscip, SCIP_VAR *sourcevar, SCIP_VAR **targetvar, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, SCIP_Bool global, SCIP_Bool *success)
SCIP_RETCODE SCIPaddVar(SCIP *scip, SCIP_VAR *var)
SCIP_VAR ** SCIPgetVarsLinear(SCIP *scip, SCIP_CONS *cons)
SCIP_CONSDATA * SCIPconsGetData(SCIP_CONS *cons)
static SCIP_DECL_CONSDELETE(consDeleteSuperindicator)
int SCIPgetNConss(SCIP *scip)
static SCIP_RETCODE consdataCreateSuperindicator(SCIP *scip, SCIP_CONSDATA **consdata, SCIP_VAR *binvar, SCIP_CONS *slackcons)
SCIP_RETCODE SCIPreleaseCons(SCIP *scip, SCIP_CONS **cons)
#define CONSHDLR_DELAYSEPA
SCIP_RETCODE SCIPsetConshdlrPresol(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPRESOL((*conspresol)), int maxprerounds, SCIP_PRESOLTIMING presoltiming)
SCIP_CONS * SCIPgetSlackConsSuperindicator(SCIP_CONS *cons)
#define CONSHDLR_PROP_TIMING
SCIP_VARSTATUS SCIPvarGetStatus(SCIP_VAR *var)
default user interface dialog
SCIP_Bool SCIPconsIsModifiable(SCIP_CONS *cons)
static SCIP_RETCODE enforceConstraint(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS **conss, int nconss, int nusefulconss, SCIP_SOL *sol, SCIP_Bool solinfeasible, SCIP_RESULT *result)
SCIP_RETCODE SCIPsetConshdlrGetNVars(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSGETNVARS((*consgetnvars)))
static SCIP_DECL_CONSPRINT(consPrintSuperindicator)
SCIP_Bool SCIPconsIsEnforced(SCIP_CONS *cons)
SCIP_Bool SCIPconsIsSeparated(SCIP_CONS *cons)
SCIP_RETCODE SCIPaddConsLocks(SCIP *scip, SCIP_CONS *cons, int nlockspos, int nlocksneg)
static SCIP_RETCODE upgradeLinearSuperindicator(SCIP *scip, SCIP_CONS *cons, SCIP_Bool *success, SCIP_Bool *deleted)
SCIP_RETCODE SCIPreleaseDialog(SCIP *scip, SCIP_DIALOG **dialog)
SCIP_Real * SCIPgetValsLinear(SCIP *scip, SCIP_CONS *cons)
SCIP_Bool SCIPisLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
struct SCIP_ConshdlrData SCIP_CONSHDLRDATA
SCIP_RETCODE SCIPwriteVarName(SCIP *scip, FILE *file, SCIP_VAR *var, SCIP_Bool type)
SCIP_Real SCIPgetSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var)
int SCIPgetNVarsLinear(SCIP *scip, SCIP_CONS *cons)
#define CONSHDLR_NEEDSCONS
SCIP_Real SCIPgetLhsLinear(SCIP *scip, SCIP_CONS *cons)
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 SCIPincludeConshdlrSuperindicator(SCIP *scip)
SCIP_RETCODE SCIPgetNegatedVar(SCIP *scip, SCIP_VAR *var, SCIP_VAR **negvar)
#define CONSHDLR_PRESOLTIMING
SCIP_RETCODE SCIPinitlpCons(SCIP *scip, SCIP_CONS *cons, SCIP_Bool *infeasible)
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)
static SCIP_DECL_CONSSEPALP(consSepalpSuperindicator)
SCIP_VAR * SCIPgetBinaryVarSuperindicator(SCIP_CONS *cons)
SCIP_RETCODE SCIPsetConshdlrProp(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPROP((*consprop)), int propfreq, SCIP_Bool delayprop, SCIP_PROPTIMING proptiming)
SCIP_RETCODE SCIPprintSol(SCIP *scip, SCIP_SOL *sol, FILE *file, SCIP_Bool printzeros)