68#define CONSHDLR_NAME "components"
69#define CONSHDLR_DESC "independent components constraint handler"
70#define CONSHDLR_ENFOPRIORITY 0
71#define CONSHDLR_CHECKPRIORITY -9999999
72#define CONSHDLR_EAGERFREQ -1
74#define CONSHDLR_NEEDSCONS FALSE
76#define CONSHDLR_PROPFREQ 1
77#define CONSHDLR_MAXPREROUNDS -1
78#define CONSHDLR_DELAYPROP TRUE
80#define CONSHDLR_PRESOLTIMING SCIP_PRESOLTIMING_FINAL
81#define CONSHDLR_PROP_TIMING SCIP_PROPTIMING_BEFORELP
83#define DEFAULT_MAXDEPTH -1
84#define DEFAULT_MAXINTVARS 500
85#define DEFAULT_MINSIZE 50
86#define DEFAULT_MINRELSIZE 0.1
87#define DEFAULT_NODELIMIT 10000LL
88#define DEFAULT_INTFACTOR 1.0
89#define DEFAULT_FEASTOLFACTOR 1.0
134 SCIP_Real fixedvarsobjsum;
135 SCIP_Real lowerbound;
145struct SCIP_ConshdlrData
147 SCIP_Longint nodelimit;
149 SCIP_Real feastolfactor;
156 SCIP_Real minrelsize;
184 else if( comp2->
ncalls == 0 )
221 minsize =
MAX(minsize, conshdlrdata->minsize);
236 assert(problem->ncomponents < problem->componentssize);
238 scip = problem->scip;
241 component = &problem->components[problem->ncomponents];
258 component->
nvars = 0;
261 component->
number = problem->ncomponents;
263 ++problem->ncomponents;
282 scip = problem->scip;
351 scip = problem->scip;
363 for( v = 0; v < nsourcevars; ++v )
380 component->
fixedvars[idx] = sourcevars[v];
400 SCIPdebugMsg(
scip,
"%d locally fixed variables have been copied, objective contribution: %g\n",
405#ifdef WITH_DEBUG_SOLUTION
410 SCIP_Bool isvalid =
FALSE;
415 scip = problem->scip;
427 for(
i = 0;
i < component->
nvars; ++
i )
466#ifdef SCIP_MORE_DEBUG
468 TRUE,
TRUE,
TRUE,
TRUE,
TRUE,
TRUE,
TRUE,
FALSE,
TRUE,
TRUE,
TRUE,
TRUE, &success) );
471 TRUE,
TRUE,
TRUE,
TRUE,
TRUE,
TRUE,
TRUE,
FALSE,
FALSE,
TRUE,
TRUE,
TRUE, &success) );
479#ifdef WITH_DEBUG_SOLUTION
480 SCIP_Bool isvalid =
FALSE;
505#ifdef WITH_DEBUG_SOLUTION
527 newconshdlrdata->subscipdepth = conshdlrdata->subscipdepth +
SCIPgetDepth(
scip);
530#ifndef SCIP_MORE_DEBUG
587 for(
i = 0;
i < nconss; ++
i )
634 scip = problem->scip;
652 conss, varmap, consmap, component->
nvars, nconss, success) );
671 SCIP_Longint nodelimit,
676 SCIP_Real memorylimit;
677 SCIP_Bool avoidmemout;
704 if( avoidmemout && memorylimit <= 0.0 )
709 else if( timelimit <= 0.0 )
726 SCIP_Real softtimelimit;
730 if( softtimelimit > -0.5 )
734 softtimelimit =
MAX(softtimelimit, 0.0);
749#ifdef SCIP_MORE_DEBUG
770 int* ntightenedbounds,
798 SCIP_Bool infeasible;
843 SCIPdebugMsg(
scip,
"variable <%s> fixval: %f violates global upperbound: %f\n",
850 SCIPdebugMsg(
scip,
"variable <%s> fixval: %f violates global lowerbound: %f\n",
870 fixvals[
i] =
MIN(fixvals[
i], gub);
871 fixvals[
i] =
MAX(fixvals[
i], glb);
884 SCIPdebugMsg(
scip,
"solution violates bounds by more than epsilon, check the corrected solution...\n");
895 if( subvars[
i] !=
NULL )
913 SCIPdebugMsg(
scip,
"--> corrected solution is%s feasible\n", feasible ?
"" :
" not");
917 SCIPdebugMsg(
scip,
"--> corrected solution has a different objective value (old = %.9g, corrected = %.9g)\n",
945 for(
i = 0;
i < nconss; ++
i )
979 SCIP_Bool infeasible;
987 if( subvars[
i] ==
NULL )
991 &infeasible, &tightened) );
997 &infeasible, &tightened) );
1005 *ntightenedbounds += ntightened;
1007 SCIPdebugMsg(
scip,
"--> tightened %d bounds of variables due to global bounds in the sub-SCIP\n", ntightened);
1018 SCIP_Bool lastcomponent,
1026 SCIP_Longint nodelimit;
1027 SCIP_Longint lastnnodes;
1036 scip = problem->scip;
1061 for( v = 0; v <
nvars; ++v )
1063 if( subvars[v] !=
NULL )
1082 SCIPdebugMsg(
scip,
"checking new solution in component <%s> inherited from problem <%s>: primal bound %.9g --> %.9g\n",
1100 if( problem->nlowerboundinf == 0 || (problem->nlowerboundinf == 1
1105 assert(problem->nlowerboundinf > 0 ||
SCIPisGE(
scip, newcutoffbound, problem->lowerbound));
1107 newcutoffbound = newcutoffbound - problem->lowerbound + component->
fixedvarsobjsum;
1109 if( problem->nlowerboundinf == 0 )
1124 SCIPdebugMsg(
scip,
"solve sub-SCIP for component <%s> (ncalls = %d, absgap = %.9g)\n",
1127 if( component->
ncalls == 0 )
1136 SCIP_Longint mainnodelimit;
1142 nodelimit = 2 * lastnnodes;
1143 nodelimit =
MAX(nodelimit, 10LL);
1145 if( mainnodelimit != -1 )
1147 assert(mainnodelimit >= lastnnodes);
1148 nodelimit =
MIN(nodelimit, mainnodelimit - lastnnodes);
1172 SCIPdebugMsg(
scip,
"--> (status = %d, nodes = %lld, time = %.2f): gap = %.5g%%, absgap = %.9g\n",
1231 SCIP_Real newdualbound;
1245 --problem->nlowerboundinf;
1246 problem->lowerbound += newdualbound;
1251 problem->lowerbound += (newdualbound - component->
lastdualbound);
1255 if( problem->nlowerboundinf == 0 )
1257 SCIPdebugMsg(
scip,
"component <%s>: dual bound increased from %.9g to %.9g, new dual bound of problem <%s>: %.9g (gap = %.9g, absgap = %.9g)\n",
1260 problem->nfeascomps == problem->ncomponents ?
1264 problem->nfeascomps == problem->ncomponents ?
1285 ++(problem->nfeascomps);
1288 for( v = 0; v < component->
nvars; ++v )
1291 subvar = component->
subvars[v];
1295 if( subvar ==
NULL )
1302 if( problem->nfeascomps == problem->ncomponents )
1305#ifdef SCIP_MORE_DEBUG
1311 SCIPdebugMsg(
scip,
"component <%s>: primal bound decreased from %.9g to %.9g, new primal bound of problem <%s>: %.9g (gap = %.9g, absgap = %.9g)\n",
1314 problem->nfeascomps == problem->ncomponents ?
1318 problem->nfeascomps == problem->ncomponents ?
1330 ++(problem->nsolvedcomps);
1349 SCIP_Real fixedvarsobjsum,
1374 (*problem)->scip =
scip;
1375 (*problem)->lowerbound = fixedvarsobjsum;
1376 (*problem)->fixedvarsobjsum = fixedvarsobjsum;
1377 (*problem)->ncomponents = 0;
1378 (*problem)->componentssize = ncomponents;
1379 (*problem)->nlowerboundinf = ncomponents;
1380 (*problem)->nfeascomps = 0;
1381 (*problem)->nsolvedcomps = 0;
1392 for( v = 0; v <
nvars; v++ )
1418 scip = (*problem)->scip;
1422 if( (*problem)->bestsol !=
NULL )
1428 for(
c = (*problem)->ncomponents - 1;
c >= 0; --
c )
1432 if( (*problem)->components !=
NULL )
1463 if( conshdlr ==
NULL )
1490 int* firstvaridxpercons,
1495 SCIP_Real* compsize;
1530 for(
c = 0;
c < ncomponents; ++
c )
1540 for( v = 0; v < ncvars; ++v )
1550 compsize[
c] = ((1000.0 * ndiscvars + (950.0 * ncontvars)/
nvars));
1553 if( ndiscvars <= conshdlrdata->maxintvars )
1557 if( ncvars >= minsize )
1567 for(
c = 0;
c < ncomponents; ++
c )
1568 conscomponent[permu[
c]] =
c;
1572 varcomponent[
c] = conscomponent[varcomponent[
c]];
1581 for(
c = 0;
c < nconss;
c++ )
1582 conscomponent[
c] = (firstvaridxpercons[
c] == -1 ? -1 : varcomponent[firstvaridxpercons[
c]]);
1597 SCIP_Real fixedvarsobjsum,
1600 int* compstartsvars,
1601 int* compstartsconss,
1611 SCIP_Bool success =
TRUE;
1624 for( comp = 0; comp < ncomponents; comp++ )
1627 assert((*problem)->ncomponents == comp+1);
1629 component = &(*problem)->components[comp];
1632 compvars = &(sortedvars[compstartsvars[comp]]);
1633 component->
nvars = compstartsvars[comp + 1 ] - compstartsvars[comp];
1639 compconss = &(sortedconss[compstartsconss[comp]]);
1640 ncompconss = compstartsconss[comp + 1] - compstartsconss[comp];
1642#ifdef DETAILED_OUTPUT
1644 if( component->
nvars > 1 && ncompconss > 1 )
1651 for(
i = 0;
i < component->
nvars; ++
i )
1660 SCIPdebugMsg(
scip,
"component %d at node %lld, depth %d (%d): %d vars (%d bin, %d int, %d cont), %d conss\n",
1667 SCIPdebugMsg(
scip,
"build sub-SCIP for component %d of problem <%s>: %d vars, %d conss\n",
1668 component->
number, (*problem)->name, component->
nvars, ncompconss);
1673 for(
i = 0;
i < component->
nvars; ++
i )
1731 else if( !component->
solved )
1759 int* firstvaridxpercons,
1788 for(
c = 0;
c < nconss; ++
c )
1804 if( nconsvars >
nvars )
1812 if( nconsvars ==
nvars )
1837 for( v = nconsvars - 1; v >= 0; --v )
1839 if( nconsvars <
nvars )
1847 firstvaridxpercons[
c] = -1;
1856 while( idx1 == -1 && v < nconsvars )
1860 idx1 = unfixedvarpos[idx1];
1861 assert(idx1 < nunfixedvars);
1868 firstvaridxpercons[
c] = idx1;
1873 for(; v < nconsvars; ++v )
1877 idx2 = unfixedvarpos[idx2];
1878 assert(idx2 < nunfixedvars);
1901 SCIP_Real* fixedvarsobjsum,
1907 int* compstartsvars,
1908 int* compstartsconss,
1939 if( fixedvarsobjsum !=
NULL )
1940 *fixedvarsobjsum = 0.0;
1949 (*nsortedconss) = 0;
1950 for(
c = 0;
c < ntmpconss;
c++ )
1952 sortedconss[(*nsortedconss)] = tmpconss[
c];
1956 if(
nvars > 1 && *nsortedconss > 1 )
1959 int* firstvaridxpercons;
1961 int nunfixedvars = 0;
1975 for( v = 0; v <
nvars; ++v )
1980 assert(nunfixedvars <= v);
1981 sortedvars[nunfixedvars] =
vars[v];
1984 unfixedvarpos[v] = nunfixedvars;
1990 unfixedvarpos[v] = -1;
1994 *nsortedvars = nunfixedvars;
1996 if( nunfixedvars > 0 )
2003 SCIP_CALL(
fillDigraph(
scip, digraph, sortedconss, *nsortedconss, unfixedvarpos, nunfixedvars, firstvaridxpercons, &success) );
2016 if( *ncomponents > 1 )
2018 int nconss = *nsortedconss;
2021 nvars = *nsortedvars;
2024 "cons components found %d undirected components at node %lld, depth %d (%d)\n",
2028 SCIP_CALL(
sortComponents(
scip, conshdlrdata, digraph, sortedconss, sortedvars, varcomponent, conscomponent, nconss, *nsortedvars,
2029 firstvaridxpercons, ncompsminsize, ncompsmaxsize) );
2034 while(
i < nconss && conscomponent[
i] == -1 )
2037 for(
c = 0;
c < *ncomponents + 1; ++
c )
2039 assert(
i == nconss || conscomponent[
i] >=
c);
2041 compstartsconss[
c] =
i;
2043 while(
i < nconss && conscomponent[
i] ==
c )
2047 for(
c = 0,
i = 0;
c < *ncomponents + 1; ++
c )
2051 compstartsvars[
c] =
i;
2053 while(
i <
nvars && varcomponent[
i] ==
c )
2058 for(
c = 0;
c < *ncomponents; ++
c )
2060 for(
i = compstartsconss[
c];
i < compstartsconss[
c+1]; ++
i )
2062 for(
i = compstartsvars[
c];
i < compstartsvars[
c+1]; ++
i )
2126 SCIP_Longint nodelimit;
2140 if(
SCIPgetDepth(
scip) + conshdlrdata->subscipdepth > conshdlrdata->maxdepth
2177 SCIP_Real fixedvarsobjsum;
2180 int* compstartsvars;
2181 int* compstartsconss;
2198 compstartsconss, &nsortedvars, &nsortedconss, &ncomponents, &ncompsminsize, &ncompsmaxsize) );
2200 if( ncompsminsize > 1 )
2204 SCIPdebugMsg(
scip,
"found %d components (%d fulfilling the minsize requirement) at node %lld at depth %d (%d)\n",
2209 if( ncomponents > ncompsminsize )
2219 for(
c = 0;
c < ncomponents; ++
c )
2221 size = compstartsvars[
c+1] - compstartsvars[
c];
2223 if( size >= minsize )
2226 compstartsvars[m] = compstartsvars[
c+1];
2227 compstartsconss[m] = compstartsconss[
c+1];
2230 else if(
c == ncomponents - 1 )
2232 assert(m == ncompsminsize);
2233 compstartsvars[m] = compstartsvars[
c+1];
2234 compstartsconss[m] = compstartsconss[
c+1];
2237 assert(m == ncompsminsize);
2238 assert(compstartsvars[m] == nsortedvars);
2239 assert(compstartsconss[m] == nsortedconss);
2245 compstartsconss, ncomponents, &problem) );
2248 if( problem !=
NULL )
2272 if( nodelimit == -1 )
2277 if( problem !=
NULL )
2293 int* compstartsvars;
2294 int* compstartsconss;
2350 compstartsconss, &nsortedvars, &nsortedconss, &ncomponents, &ncompsminsize, &ncompsmaxsize) );
2352 if( ncompsmaxsize > 0 )
2368 SCIPdebugMsg(
scip,
"found %d components (%d with small size) during presolving; overall problem size: %d vars (%d int, %d bin, %d cont), %d conss\n",
2374 if( subscip ==
NULL )
2388#ifdef WITH_DEBUG_SOLUTION
2396 compvars = &(sortedvars[compstartsvars[comp]]);
2397 ncompvars = compstartsvars[comp + 1 ] - compstartsvars[comp];
2400 compconss = &(sortedconss[compstartsconss[comp]]);
2401 ncompconss = compstartsconss[comp + 1] - compstartsconss[comp];
2404 if( ncompconss == 0 )
2411#ifdef DETAILED_OUTPUT
2418 for(
i = 0;
i < ncompvars; ++
i )
2427 SCIPdebugMsg(
scip,
"solve component %d: %d vars (%d bin, %d int, %d cont), %d conss\n",
2434 for(
i = 0;
i < ncompvars; ++
i )
2443 compconss, varmap, consmap, ncompvars, ncompconss, &success) );
2452#ifdef WITH_DEBUG_SOLUTION
2462 if( debugsol !=
NULL )
2466 for(
i = 0;
i < ncompvars; ++
i )
2468 if( subvars[
i] !=
NULL )
2480 ncompvars, ncompconss, ndelconss, nfixedvars, nchgbds,
result, &solved) );
2492 else if( nsolved == ncomponents - 1 )
2555#define consEnfolpComponents NULL
2556#define consEnfopsComponents NULL
2557#define consCheckComponents NULL
2569 conshdlrdata->subscipdepth = 0;
2593 "maximum depth of a node to run components detection (-1: disable component detection during solving)",
2597 "maximum number of integer (or binary) variables to solve a subproblem during presolving (-1: unlimited)",
2601 "minimum absolute size (in terms of variables) to solve a component individually during branch-and-bound",
2605 "minimum relative size (in terms of variables) to solve a component individually during branch-and-bound",
2609 "maximum number of nodes to be solved in subproblems during presolving",
2613 "the weight of an integer variable compared to binary variables",
2617 "factor to increase the feasibility tolerance of the main SCIP in all sub-SCIPs, default value 1.0",
static SCIP_RETCODE copyToSubscip(SCIP *scip, SCIP *subscip, const char *name, SCIP_VAR **vars, SCIP_VAR **subvars, SCIP_CONS **conss, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, int nvars, int nconss, SCIP_Bool *success)
#define CONSHDLR_NEEDSCONS
#define CONSHDLR_CHECKPRIORITY
#define DEFAULT_MINRELSIZE
static SCIP_RETCODE createConsComponents(SCIP *scip, SCIP_CONS **cons, const char *name, PROBLEM *problem)
static SCIP_RETCODE createAndSplitProblem(SCIP *scip, SCIP_CONSHDLRDATA *conshdlrdata, SCIP_Real fixedvarsobjsum, SCIP_VAR **sortedvars, SCIP_CONS **sortedconss, int *compstartsvars, int *compstartsconss, int ncomponents, PROBLEM **problem)
static SCIP_RETCODE initComponent(PROBLEM *problem)
static SCIP_RETCODE fillDigraph(SCIP *scip, SCIP_DIGRAPH *digraph, SCIP_CONS **conss, int nconss, int *unfixedvarpos, int nunfixedvars, int *firstvaridxpercons, SCIP_Bool *success)
static int getMinsize(SCIP *scip, SCIP_CONSHDLRDATA *conshdlrdata)
#define CONSHDLR_PROP_TIMING
#define DEFAULT_FEASTOLFACTOR
#define consEnfolpComponents
#define CONSHDLR_MAXPREROUNDS
#define consEnfopsComponents
#define DEFAULT_MAXINTVARS
static SCIP_RETCODE componentSetupWorkingSol(COMPONENT *component, SCIP_HASHMAP *varmap)
static SCIP_RETCODE freeProblem(PROBLEM **problem)
static SCIP_RETCODE componentCreateSubscip(COMPONENT *component, SCIP_CONSHDLRDATA *conshdlrdata, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, SCIP_CONS **conss, int nconss, SCIP_Bool *success)
static SCIP_RETCODE createSubscip(SCIP *scip, SCIP_CONSHDLRDATA *conshdlrdata, SCIP **subscip)
#define DEFAULT_INTFACTOR
#define DEFAULT_NODELIMIT
static SCIP_RETCODE sortComponents(SCIP *scip, SCIP_CONSHDLRDATA *conshdlrdata, SCIP_DIGRAPH *digraph, SCIP_CONS **conss, SCIP_VAR **vars, int *varcomponent, int *conscomponent, int nconss, int nvars, int *firstvaridxpercons, int *ncompsminsize, int *ncompsmaxsize)
#define consCheckComponents
static SCIP_RETCODE solveProblem(PROBLEM *problem, SCIP_RESULT *result)
#define CONSHDLR_PROPFREQ
static SCIP_RETCODE solveSubscip(SCIP *scip, SCIP *subscip, SCIP_Longint nodelimit, SCIP_Real gaplimit)
static SCIP_RETCODE solveComponent(COMPONENT *component, SCIP_Bool lastcomponent, SCIP_RESULT *result)
#define CONSHDLR_PRESOLTIMING
static SCIP_RETCODE freeComponent(COMPONENT *component)
#define CONSHDLR_EAGERFREQ
#define CONSHDLR_ENFOPRIORITY
static SCIP_RETCODE solveAndEvalSubscip(SCIP *scip, SCIP_CONSHDLRDATA *conshdlrdata, SCIP *subscip, SCIP_VAR **vars, SCIP_VAR **subvars, SCIP_CONS **conss, int nvars, int nconss, int *ndeletedconss, int *nfixedvars, int *ntightenedbounds, SCIP_RESULT *result, SCIP_Bool *solved)
static SCIP_RETCODE findComponents(SCIP *scip, SCIP_CONSHDLRDATA *conshdlrdata, SCIP_Real *fixedvarsobjsum, SCIP_VAR **sortedvars, SCIP_CONS **sortedconss, int *compstartsvars, int *compstartsconss, int *nsortedvars, int *nsortedconss, int *ncomponents, int *ncompsminsize, int *ncompsmaxsize)
static SCIP_RETCODE initProblem(SCIP *scip, PROBLEM **problem, SCIP_Real fixedvarsobjsum, int ncomponents)
struct Component COMPONENT
#define CONSHDLR_DELAYPROP
constraint handler for handling independent components
#define SCIPdebugGetSolVal(scip, var, val)
#define SCIPdebugSolEnable(scip)
#define SCIPdebugAddSolVal(scip, var, val)
#define SCIPdebugSolIsEnabled(scip)
#define SCIPdebugSolIsValidInSubtree(scip, isvalidinsubtree)
#define SCIP_LONGINT_FORMAT
SCIP_RETCODE SCIPincludeConshdlrComponents(SCIP *scip)
SCIP_RETCODE SCIPcopyPlugins(SCIP *sourcescip, SCIP *targetscip, SCIP_Bool copyreaders, SCIP_Bool copypricers, SCIP_Bool copyconshdlrs, SCIP_Bool copyconflicthdlrs, SCIP_Bool copypresolvers, SCIP_Bool copyrelaxators, SCIP_Bool copyseparators, SCIP_Bool copycutselectors, SCIP_Bool copypropagators, SCIP_Bool copyheuristics, SCIP_Bool copyeventhdlrs, SCIP_Bool copynodeselectors, SCIP_Bool copybranchrules, SCIP_Bool copydisplays, SCIP_Bool copydialogs, SCIP_Bool copytables, SCIP_Bool copyexprhdlrs, SCIP_Bool copynlpis, SCIP_Bool passmessagehdlr, SCIP_Bool *valid)
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 SCIPcopyProb(SCIP *sourcescip, SCIP *targetscip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, SCIP_Bool global, const char *name)
SCIP_RETCODE SCIPcopyParamSettings(SCIP *sourcescip, SCIP *targetscip)
SCIP_RETCODE SCIPcopyLimits(SCIP *sourcescip, SCIP *targetscip)
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 SCIPdigraphComputeUndirectedComponents(SCIP_DIGRAPH *digraph, int minsize, int *components, int *ncomponents)
void SCIPdigraphGetComponent(SCIP_DIGRAPH *digraph, int compidx, int **nodes, int *nnodes)
SCIP_RETCODE SCIPdigraphAddArc(SCIP_DIGRAPH *digraph, int startnode, int endnode, void *data)
SCIP_RETCODE SCIPdigraphSetSizes(SCIP_DIGRAPH *digraph, int *sizes)
void SCIPdigraphFree(SCIP_DIGRAPH **digraph)
int SCIPdigraphGetNComponents(SCIP_DIGRAPH *digraph)
SCIP_RETCODE SCIPcreateDigraph(SCIP *scip, SCIP_DIGRAPH **digraph, int nnodes)
SCIP_Bool SCIPisPresolveFinished(SCIP *scip)
SCIP_Bool SCIPisStopped(SCIP *scip)
SCIP_RETCODE SCIPfree(SCIP **scip)
SCIP_RETCODE SCIPcreate(SCIP **scip)
SCIP_STATUS SCIPgetStatus(SCIP *scip)
SCIP_STAGE SCIPgetStage(SCIP *scip)
int SCIPgetNIntVars(SCIP *scip)
int SCIPgetNImplVars(SCIP *scip)
const char * SCIPgetProbName(SCIP *scip)
int SCIPgetNContVars(SCIP *scip)
SCIP_CONS ** SCIPgetConss(SCIP *scip)
int SCIPgetNVars(SCIP *scip)
SCIP_RETCODE SCIPaddCons(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPdelCons(SCIP *scip, SCIP_CONS *cons)
int SCIPgetNConss(SCIP *scip)
SCIP_VAR ** SCIPgetVars(SCIP *scip)
int SCIPgetNOrigVars(SCIP *scip)
int SCIPgetNBinVars(SCIP *scip)
void SCIPhashmapFree(SCIP_HASHMAP **hashmap)
void * SCIPhashmapGetImage(SCIP_HASHMAP *hashmap, void *origin)
SCIP_RETCODE SCIPhashmapCreate(SCIP_HASHMAP **hashmap, BMS_BLKMEM *blkmem, int mapsize)
SCIP_RETCODE SCIPupdateLocalLowerbound(SCIP *scip, SCIP_Real newbound)
SCIP_RETCODE SCIPaddConsNode(SCIP *scip, SCIP_NODE *node, SCIP_CONS *cons, SCIP_NODE *validnode)
void SCIPverbMessage(SCIP *scip, SCIP_VERBLEVEL msgverblevel, FILE *file, const char *formatstr,...)
void SCIPwarningMessage(SCIP *scip, const char *formatstr,...)
SCIP_RETCODE SCIPgetBoolParam(SCIP *scip, const char *name, SCIP_Bool *value)
SCIP_RETCODE SCIPaddLongintParam(SCIP *scip, const char *name, const char *desc, SCIP_Longint *valueptr, SCIP_Bool isadvanced, SCIP_Longint defaultvalue, SCIP_Longint minvalue, SCIP_Longint maxvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
SCIP_Bool SCIPisParamFixed(SCIP *scip, const char *name)
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_PARAM * SCIPgetParam(SCIP *scip, const char *name)
SCIP_RETCODE SCIPsetLongintParam(SCIP *scip, const char *name, SCIP_Longint value)
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 SCIPsetIntParam(SCIP *scip, const char *name, int value)
SCIP_RETCODE SCIPgetRealParam(SCIP *scip, const char *name, SCIP_Real *value)
SCIP_RETCODE SCIPsetPresolving(SCIP *scip, SCIP_PARAMSETTING paramsetting, SCIP_Bool quiet)
SCIP_RETCODE SCIPgetLongintParam(SCIP *scip, const char *name, SCIP_Longint *value)
SCIP_RETCODE SCIPsetBoolParam(SCIP *scip, const char *name, SCIP_Bool value)
SCIP_RETCODE SCIPfixParam(SCIP *scip, const char *name)
SCIP_RETCODE SCIPsetRealParam(SCIP *scip, const char *name, SCIP_Real value)
SCIP_RETCODE SCIPpqueueCreate(SCIP_PQUEUE **pqueue, int initsize, SCIP_Real sizefac, SCIP_DECL_SORTPTRCOMP((*ptrcomp)),)
void SCIPpqueueFree(SCIP_PQUEUE **pqueue)
SCIP_RETCODE SCIPpqueueInsert(SCIP_PQUEUE *pqueue, void *elem)
int SCIPpqueueNElems(SCIP_PQUEUE *pqueue)
void * SCIPpqueueRemove(SCIP_PQUEUE *pqueue)
void SCIPconshdlrSetData(SCIP_CONSHDLR *conshdlr, SCIP_CONSHDLRDATA *conshdlrdata)
SCIP_RETCODE SCIPsetConshdlrFree(SCIP *scip, SCIP_CONSHDLR *conshdlr,)
SCIP_RETCODE SCIPsetConshdlrPresol(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPRESOL((*conspresol)), int maxprerounds, SCIP_PRESOLTIMING presoltiming)
SCIP_RETCODE SCIPsetConshdlrProp(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPROP((*consprop)), int propfreq, SCIP_Bool delayprop, SCIP_PROPTIMING proptiming)
SCIP_RETCODE SCIPsetConshdlrEnforelax(SCIP *scip, SCIP_CONSHDLR *conshdlr,)
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)
const char * SCIPconshdlrGetName(SCIP_CONSHDLR *conshdlr)
SCIP_RETCODE SCIPsetConshdlrCopy(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSHDLRCOPY((*conshdlrcopy)),)
SCIP_CONSHDLR * SCIPfindConshdlr(SCIP *scip, const char *name)
SCIP_RETCODE SCIPsetConshdlrDelete(SCIP *scip, SCIP_CONSHDLR *conshdlr,)
SCIP_RETCODE SCIPsetConshdlrInitsol(SCIP *scip, SCIP_CONSHDLR *conshdlr,)
SCIP_CONSHDLRDATA * SCIPconshdlrGetData(SCIP_CONSHDLR *conshdlr)
int SCIPconshdlrGetNActiveConss(SCIP_CONSHDLR *conshdlr)
SCIP_CONS ** SCIPconshdlrGetConss(SCIP_CONSHDLR *conshdlr)
SCIP_RETCODE SCIPgetConsNVars(SCIP *scip, SCIP_CONS *cons, int *nvars, SCIP_Bool *success)
SCIP_CONSDATA * SCIPconsGetData(SCIP_CONS *cons)
SCIP_Bool SCIPconsIsDynamic(SCIP_CONS *cons)
SCIP_CONSHDLR * SCIPconsGetHdlr(SCIP_CONS *cons)
SCIP_Bool SCIPconsIsInitial(SCIP_CONS *cons)
SCIP_Bool SCIPconsIsChecked(SCIP_CONS *cons)
SCIP_RETCODE SCIPgetConsVars(SCIP *scip, SCIP_CONS *cons, SCIP_VAR **vars, int varssize, SCIP_Bool *success)
SCIP_Bool SCIPconsIsEnforced(SCIP_CONS *cons)
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_Bool SCIPconsIsPropagated(SCIP_CONS *cons)
const char * SCIPconsGetName(SCIP_CONS *cons)
SCIP_Bool SCIPconsIsModifiable(SCIP_CONS *cons)
SCIP_RETCODE SCIPreleaseCons(SCIP *scip, SCIP_CONS **cons)
SCIP_Bool SCIPconsIsSeparated(SCIP_CONS *cons)
SCIP_Bool SCIPconsIsRemovable(SCIP_CONS *cons)
SCIP_HEUR * SCIPfindHeur(SCIP *scip, const char *name)
const char * SCIPheurGetName(SCIP_HEUR *heur)
SCIP_Longint SCIPgetMemExternEstim(SCIP *scip)
#define SCIPfreeBlockMemoryArray(scip, ptr, num)
SCIP_Longint SCIPgetMemUsed(SCIP *scip)
#define SCIPallocBufferArray(scip, ptr, num)
#define SCIPreallocBufferArray(scip, ptr, num)
#define SCIPfreeBufferArray(scip, ptr)
#define SCIPduplicateMemoryArray(scip, ptr, source, num)
#define SCIPfreeMemoryArray(scip, ptr)
#define SCIPallocBlockMemoryArray(scip, ptr, num)
#define SCIPfreeBlockMemory(scip, ptr)
#define SCIPallocBlockMemory(scip, ptr)
#define SCIPduplicateBlockMemoryArray(scip, ptr, source, num)
SCIP_Longint SCIPnodeGetNumber(SCIP_NODE *node)
int SCIPgetNActivePricers(SCIP *scip)
SCIP_Bool SCIPinProbing(SCIP *scip)
SCIP_RETCODE SCIPcheckSolOrig(SCIP *scip, SCIP_SOL *sol, SCIP_Bool *feasible, SCIP_Bool printreason, SCIP_Bool completely)
SCIP_SOL * SCIPgetBestSol(SCIP *scip)
SCIP_Real SCIPsolGetOrigObj(SCIP_SOL *sol)
SCIP_RETCODE SCIPprintBestSol(SCIP *scip, FILE *file, SCIP_Bool printzeros)
int SCIPgetNSols(SCIP *scip)
SCIP_HEUR * SCIPsolGetHeur(SCIP_SOL *sol)
SCIP_RETCODE SCIPcreateOrigSol(SCIP *scip, SCIP_SOL **sol, SCIP_HEUR *heur)
SCIP_RETCODE SCIPaddSol(SCIP *scip, SCIP_SOL *sol, SCIP_Bool *stored)
int SCIPsolGetIndex(SCIP_SOL *sol)
SCIP_RETCODE SCIPcheckSol(SCIP *scip, SCIP_SOL *sol, SCIP_Bool printreason, SCIP_Bool completely, SCIP_Bool checkbounds, SCIP_Bool checkintegrality, SCIP_Bool checklprows, SCIP_Bool *feasible)
SCIP_Real SCIPgetSolOrigObj(SCIP *scip, SCIP_SOL *sol)
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)
SCIP_Real SCIPgetSolTransObj(SCIP *scip, SCIP_SOL *sol)
SCIP_Real SCIPretransformObj(SCIP *scip, SCIP_Real obj)
void SCIPsolSetHeur(SCIP_SOL *sol, SCIP_HEUR *heur)
SCIP_RETCODE SCIPtransformProb(SCIP *scip)
SCIP_RETCODE SCIPfreeTransform(SCIP *scip)
SCIP_RETCODE SCIPinterruptSolve(SCIP *scip)
SCIP_RETCODE SCIPsolve(SCIP *scip)
void SCIPaddNNodes(SCIP *scip, SCIP_Longint nnodes)
SCIP_Real SCIPgetPrimalbound(SCIP *scip)
SCIP_RETCODE SCIPupdateCutoffbound(SCIP *scip, SCIP_Real cutoffbound)
SCIP_Real SCIPgetGap(SCIP *scip)
SCIP_Longint SCIPgetNNodes(SCIP *scip)
SCIP_Real SCIPgetDualbound(SCIP *scip)
SCIP_RETCODE SCIPprintStatistics(SCIP *scip, FILE *file)
SCIP_Real SCIPgetCutoffbound(SCIP *scip)
SCIP_RETCODE SCIPprintDisplayLine(SCIP *scip, FILE *file, SCIP_VERBLEVEL verblevel, SCIP_Bool endline)
SCIP_Real SCIPgetSolvingTime(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_Bool SCIPisFeasEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisPositive(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisInfinity(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisSumLT(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_Bool SCIPisNegative(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisFeasGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
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_Bool SCIPinRepropagation(SCIP *scip)
int SCIPgetDepth(SCIP *scip)
SCIP_NODE * SCIPgetCurrentNode(SCIP *scip)
SCIP_RETCODE SCIPtightenVarLb(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened)
SCIP_Bool SCIPvarIsActive(SCIP_VAR *var)
int SCIPvarGetNLocksUpType(SCIP_VAR *var, SCIP_LOCKTYPE locktype)
SCIP_Real SCIPvarGetUbLocal(SCIP_VAR *var)
SCIP_Real SCIPvarGetObj(SCIP_VAR *var)
SCIP_RETCODE SCIPtightenVarUb(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened)
SCIP_VARTYPE SCIPvarGetType(SCIP_VAR *var)
SCIP_Real SCIPvarGetUbGlobal(SCIP_VAR *var)
int SCIPvarGetIndex(SCIP_VAR *var)
int SCIPvarGetProbindex(SCIP_VAR *var)
const char * SCIPvarGetName(SCIP_VAR *var)
void SCIPvarMarkDeleteGlobalStructures(SCIP_VAR *var)
SCIP_Real SCIPvarGetLbLocal(SCIP_VAR *var)
SCIP_Real SCIPvarGetLbGlobal(SCIP_VAR *var)
SCIP_RETCODE SCIPfixVar(SCIP *scip, SCIP_VAR *var, SCIP_Real fixedval, SCIP_Bool *infeasible, SCIP_Bool *fixed)
SCIP_RETCODE SCIPgetActiveVars(SCIP *scip, SCIP_VAR **vars, int *nvars, int varssize, int *requiredsize)
int SCIPvarGetNLocksDownType(SCIP_VAR *var, SCIP_LOCKTYPE locktype)
SCIP_Bool SCIPallowWeakDualReds(SCIP *scip)
SCIP_Bool SCIPallowStrongDualReds(SCIP *scip)
void SCIPsortIntPtr(int *intarray, void **ptrarray, int len)
void SCIPsortRealInt(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))
assert(minobj< SCIPgetCutoffbound(scip))
memory allocation routines
#define BMSclearMemoryArray(ptr, num)
BMS_BLKMEM * SCIPblkmem(SCIP *scip)
public methods for managing constraints
public methods for primal heuristics
public methods for message output
public data structures and miscellaneous methods
methods for sorting joint arrays of various types
public methods for primal CIP solutions
public methods for branch and bound tree
public methods for problem variables
public methods for constraint handler plugins and constraints
public methods for problem copies
public methods for data structures
public methods for primal heuristic plugins and divesets
public methods for memory management
public methods for message handling
public methods for numerical tolerances
public methods for SCIP parameter handling
public methods for variable pricer plugins
public methods for global and local (sub)problems
public methods for the probing mode
public methods for solutions
public methods for querying solving statistics
public methods for timing
public methods for the branch-and-bound tree
public methods for SCIP variables
SCIP_Real fixedvarsobjsum
SCIP_Real lastprimalbound
#define SCIP_DECL_CONSDELETE(x)
#define SCIP_DECL_CONSINITSOL(x)
struct SCIP_ConshdlrData SCIP_CONSHDLRDATA
#define SCIP_DECL_CONSENFORELAX(x)
#define SCIP_DECL_CONSPROP(x)
#define SCIP_DECL_CONSPRESOL(x)
#define SCIP_DECL_CONSLOCK(x)
struct SCIP_ConsData SCIP_CONSDATA
#define SCIP_DECL_CONSHDLRCOPY(x)
#define SCIP_DECL_CONSFREE(x)
#define SCIP_DECL_SORTPTRCOMP(x)
enum SCIP_Result SCIP_RESULT
enum SCIP_Retcode SCIP_RETCODE
@ SCIP_STATUS_TOTALNODELIMIT
@ SCIP_STATUS_BESTSOLLIMIT
@ SCIP_STATUS_PRIMALLIMIT
@ SCIP_STATUS_USERINTERRUPT
@ SCIP_STATUS_STALLNODELIMIT
@ SCIP_STATUS_RESTARTLIMIT
enum SCIP_Status SCIP_STATUS