51 #define DEFAULT_MEM_VARAFTERDUAL 10 52 #define DEFAULT_MEM_VAR 10 53 #define DEFAULT_MEM_NODES 1000 54 #define DEFAULT_MEM_RUN 200 55 #define DEFAULT_MEM_DUALCONS 10 57 #define DEFAULT_RANDSEED 67 60 #define EVENTHDLR_NAME "Reopt" 61 #define EVENTHDLR_DESC "node event handler for reoptimization" 74 assert(eventhdlr != NULL);
85 assert( eventnode != NULL );
108 assert(
scip != NULL);
109 assert(eventhdlr != NULL);
133 assert(
scip != NULL);
135 assert(eventhdlr != NULL);
170 assert(runidx <= reopt->runsize);
181 assert(num <= reopt->soltree->solssize[runidx]);
206 for(s = reopt->
runsize; s < newsize; s++)
210 reopt->
objs[s] = NULL;
218 assert(num < reopt->runsize);
231 assert(reopttree != NULL);
232 assert(blkmem != NULL);
244 for(
id = reopttree->
reoptnodessize;
id < (
unsigned int)newsize;
id++ )
269 assert(reoptnode != NULL);
270 assert(blkmem != NULL);
271 assert(var_mem >= 0);
272 assert(child_mem >= 0);
273 assert(conss_mem >= 0);
285 else if( reoptnode->
varssize < var_mem )
321 else if( reoptnode->
consssize < conss_mem )
345 assert(solnode != NULL);
347 if( solnode->
child == NULL && solnode->
sol == NULL )
349 if( solnode->
child == NULL && solnode->
sol != NULL )
353 sibling = solnode->
child;
356 while( sibling != NULL )
381 assert(reopt != NULL);
382 assert(vars != NULL);
390 for( v = 0; v < nvars; v++ )
417 assert(transvar != NULL);
427 assert(0 <= probidx && probidx < reopt->nobjvars);
429 c1 = reopt->
objs[obj1_id][probidx];
430 c2 = reopt->
objs[obj2_id][probidx];
434 norm_obj1 += SQR(c1);
435 norm_obj2 += SQR(c2);
440 norm_obj1 = SQRT(norm_obj1);
441 norm_obj2 = SQRT(norm_obj2);
444 similarity /= (norm_obj1 * norm_obj2);
447 similarity =
MAX(similarity, -1.0);
448 similarity = MIN(similarity, 1.0);
460 assert((*reoptnode) != NULL );
461 assert(blkmem != NULL );
464 if( (*reoptnode)->consssize > 0 )
468 assert((*reoptnode)->conss != NULL);
470 for( c = 0; c < (*reoptnode)->nconss; c++ )
472 assert((*reoptnode)->conss[c] != NULL);
473 assert((*reoptnode)->conss[c]->vals != NULL);
474 assert((*reoptnode)->conss[c]->vars != NULL);
482 (*reoptnode)->nconss = 0;
483 (*reoptnode)->consssize = 0;
484 (*reoptnode)->conss = NULL;
488 if( (*reoptnode)->childids != NULL )
491 (*reoptnode)->nchilds = 0;
492 (*reoptnode)->allocchildmem = 0;
493 (*reoptnode)->childids = NULL;
497 if( (*reoptnode)->dualredscur != NULL )
499 assert((*reoptnode)->dualredscur->varssize > 0);
504 (*reoptnode)->dualredscur = NULL;
508 if( (*reoptnode)->dualredsnex != NULL )
510 assert((*reoptnode)->dualredsnex->varssize > 0);
515 (*reoptnode)->dualredsnex = NULL;
519 if ((*reoptnode)->varboundtypes != NULL )
521 assert((*reoptnode)->varssize > 0);
523 (*reoptnode)->varboundtypes = NULL;
527 if ((*reoptnode)->varbounds != NULL )
529 assert((*reoptnode)->varssize > 0);
531 (*reoptnode)->varbounds = NULL;
535 if ((*reoptnode)->vars != NULL )
537 assert((*reoptnode)->varssize > 0);
539 (*reoptnode)->vars = NULL;
542 (*reoptnode)->varssize = 0;
545 if ((*reoptnode)->afterdualvarboundtypes != NULL )
547 assert((*reoptnode)->afterdualvarssize > 0);
549 (*reoptnode)->afterdualvarboundtypes = NULL;
553 if ((*reoptnode)->afterdualvarbounds != NULL )
555 assert((*reoptnode)->afterdualvarssize > 0);
557 (*reoptnode)->afterdualvarbounds = NULL;
561 if ((*reoptnode)->afterdualvars != NULL )
563 assert((*reoptnode)->afterdualvarssize > 0);
565 (*reoptnode)->afterdualvars = NULL;
568 (*reoptnode)->afterdualvarssize = 0;
584 assert(reoptnode != NULL);
586 assert(blkmem != NULL);
589 if( reoptnode->
nconss > 0 )
593 assert(reoptnode->
conss != NULL);
596 for( c = 0; c < reoptnode->
nconss; c++ )
598 if( !reoptnode->
conss[c]->linear )
600 assert(reoptnode->
conss[c]->boundtypes != NULL);
620 assert(reoptnode->
dualredscur->boundtypes != NULL);
635 assert(reoptnode->
dualredsnex->boundtypes != NULL);
645 reoptnode->
nvars = 0;
664 assert(reopttree != NULL );
665 assert(id < reopttree->reoptnodessize);
677 assert(softreset || reopttree->
reoptnodes[
id] == NULL);
695 assert(soltree != NULL);
703 soltree->
nsols[s] = 0;
705 soltree->
sols[s] = NULL;
733 assert(reopt != NULL);
736 assert(solnode != NULL);
737 assert(blkmem != NULL);
739 child = (*solnode)->
child;
742 while( child != NULL )
745 assert(child != NULL);
752 if( (*solnode)->sol != NULL )
771 assert(reopt != NULL);
772 assert(reopt->
soltree != NULL);
775 assert(blkmem != NULL);
805 assert(blkmem != NULL);
806 assert(curnode != NULL);
807 assert(child != NULL && *child == NULL);
811 *child = curnode->
child;
821 solnode->
father = curnode;
822 solnode->
child = NULL;
824 solnode->
value = val;
833 curnode->
child = *child;
835 #ifdef SCIP_MORE_DEBUG 836 SCIPsetDebugMsg(
set,
"-> create new node %p: value=%g, sibling=%p\n", (
void*) solnode, solnode->
value,
837 (
void*) solnode->sibling);
843 while( *child != NULL )
845 #ifdef SCIP_MORE_DEBUG 846 SCIPsetDebugMsg(
set,
"-> check %p: father=%p, value=%g, sibling=%p\n", (
void*) *child, (
void*) (*child)->
father,
847 (*child)->
value, (
void*) (*child)->sibling);
854 if( (*child)->sibling == NULL )
860 solnode->
father = curnode;
861 solnode->
child = NULL;
862 solnode->
value = val;
876 #ifdef SCIP_MORE_DEBUG 877 SCIPsetDebugMsg(
set,
"-> create new node %p: value=%g, sibling=%p\n", (
void*) solnode, solnode->
value,
878 (
void*) solnode->sibling);
885 #ifdef SCIP_MORE_DEBUG 887 SCIPsetDebugMsg(
set,
" before switching: node %p witch child=%p, sibling=%p, sol=%p, value=%g\n",
888 (
void*) (*child), (
void*) (*child)->child, (
void*) (*child)->sibling, (
void*) (*child)->sol,
890 SCIPsetDebugMsg(
set,
" node %p witch child=%p, sibling=%p, sol=%p, value=%g\n",
891 (
void*) solnode, (
void*) solnode->child, (
void*) solnode->sibling, (
void*) solnode->sol,
895 solnode->child = (*child)->child;
896 (*child)->child = NULL;
899 solnode->value = (*child)->value;
900 (*child)->value = val;
901 assert(
SCIPsetIsLT(
set, (*child)->value, solnode->value));
904 solnode->sol = (*child)->sol;
905 (*child)->sol = NULL;
906 #ifdef SCIP_MORE_DEBUG 907 SCIPsetDebugMsg(
set,
" after switching: node %p witch child=%p, sibling=%p, sol=%p, value=%g\n",
908 (
void*) (*child), (
void*) (*child)->child, (
void*) (*child)->sibling, (
void*) (*child)->sol,
910 SCIPsetDebugMsg(
set,
" node %p witch child=%p, sibling=%p, sol=%p, value=%g\n",
911 (
void*) solnode, (
void*) solnode->child, (
void*) solnode->sibling, (
void*) solnode->sol,
925 if(
SCIPsetIsLT(
set, val, (*child)->sibling->value) )
931 solnode->
father = curnode;
932 solnode->
child = NULL;
934 solnode->
value = val;
942 (*child)->sibling = solnode;
945 #ifdef SCIP_MORE_DEBUG 946 SCIPsetDebugMsg(
set,
"-> create new node %p: value=%g, sibling=%p\n", (
void*) solnode, solnode->
value,
947 (
void*) solnode->sibling);
953 *child = (*child)->sibling;
958 solnode = curnode->
child;
959 assert(solnode != NULL);
961 while( solnode->
sibling != NULL )
991 assert(reopt != NULL);
993 assert(stat != NULL);
994 assert(origprimal != NULL);
995 assert(blkmem != NULL);
996 assert(vars != NULL);
998 assert(solnode != NULL);
1004 if( set->reopt_savesols > 0 )
1011 for( varid = 0; varid < nvars; varid++ )
1021 assert(child != NULL);
1027 if( (*added || bestsol) && !purelp )
1031 assert(cursolnode->
child == NULL);
1036 cursolnode->
sol = copysol;
1047 assert(cursolnode->
sol != NULL);
1052 (*solnode) = cursolnode;
1065 assert(node != NULL);
1067 if( node->
child != NULL )
1072 assert(node->
sol == NULL);
1075 child = node->
child;
1078 while( child != NULL )
1087 assert(node->
father != NULL);
1088 assert(node->
sol != NULL);
1102 assert(reopttree != NULL );
1103 assert(id < reopttree->reoptnodessize);
1160 assert(reopttree != NULL);
1161 assert(
set != NULL);
1162 assert(blkmem != NULL);
1207 assert(reopttree != NULL );
1242 assert(reopttree != NULL);
1243 assert(blkmem != NULL);
1267 assert(reopt != NULL);
1268 assert(blkmem != NULL);
1280 else if( reopt->
dualreds->varssize < size )
1286 reopt->
dualreds->varssize = newsize;
1303 assert(reopt != NULL);
1304 assert(blkmem != NULL);
1352 assert(reopt != NULL);
1353 assert(blkmem != NULL);
1354 assert(node != NULL);
1355 assert(0 <
id && id < reopt->reopttree->reoptnodessize);
1362 if( nconsprops > 0 )
1374 assert(nvars + naddedbndchgs <= reopt->reopttree->reoptnodes[
id]->varssize);
1378 *transintoorig =
TRUE;
1406 assert(reopt != NULL);
1407 assert(blkmem != NULL);
1408 assert(node != NULL);
1409 assert(0 <
id && id < reopt->reopttree->reoptnodessize);
1463 if( nbranchvars > 0 )
1464 *transintoorig =
TRUE;
1466 SCIPsetDebugMsg(
set,
" -> save %d bound changes after dual reductions\n", nbranchvars);
1468 assert(nbranchvars <= reopt->reopttree->reoptnodes[
id]->afterdualvarssize);
1489 assert(reopt != NULL);
1490 assert(
set != NULL);
1492 assert(blkmem != NULL);
1497 for( r = 0; r < nlprows; r++ )
1529 for( c = 0; c < ncutvars; c++ )
1535 assert(cutvars[c] != NULL);
1541 assert(cutvars[c] != NULL);
1550 cutvals[c] = cutvals[c]/scalar;
1573 assert(reopt != NULL );
1574 assert(0 <
id && id < reopt->reopttree->reoptnodessize);
1616 unsigned int* parentid,
1620 assert(reopt != NULL);
1630 int nbranchings = 0;
1633 if( set->reopt_saveconsprop )
1638 (*nbndchgs) = (*nbndchgs) + nbranchings + nconsprop;
1676 unsigned int parentid,
1677 unsigned int childid
1682 assert(reopttree != NULL);
1683 assert(blkmem != NULL);
1686 assert(reopttree->
reoptnodes[parentid] != NULL);
1698 SCIPsetDebugMsg(
set,
"add ID %u as a child of ID %u.\n", childid, parentid);
1709 unsigned int nodeid,
1710 unsigned int parentid
1713 unsigned int childid;
1717 assert(reopt != NULL);
1718 assert(blkmem != NULL);
1719 assert(0 < nodeid && nodeid < reopt->reopttree->reoptnodessize);
1720 assert(parentid < reopt->reopttree->reoptnodessize);
1733 assert(0 < childid && childid < reopt->reopttree->reoptnodessize);
1775 assert(reopttree != NULL );
1776 assert(blkmem != NULL);
1777 assert(id < reopttree->reoptnodessize);
1783 SCIPsetDebugMsg(
set,
"-> delete subtree induced by ID %u (hard remove = %u)\n",
id, exitsolve);
1788 unsigned int childid;
1792 assert(0 < childid && childid < reopttree->reoptnodessize);
1823 assert(reopt != NULL);
1824 assert(node != NULL);
1825 assert(id < reopt->reopttree->reoptnodessize);
1828 assert(reoptnodes != NULL);
1829 assert(reoptnodes[
id] != NULL);
1831 if( reoptnodes[
id]->childids != NULL && reoptnodes[
id]->nchilds > 0 )
1834 unsigned int parentid = 0;
1839 assert(parentid !=
id);
1840 assert(reoptnodes[parentid] != NULL );
1841 assert(reoptnodes[parentid]->childids != NULL && reoptnodes[parentid]->nchilds);
1851 if( ndomchgs <= set->reopt_maxdiffofnodes )
1856 id, reoptnodes[
id]->nchilds);
1863 while( reoptnodes[parentid]->childids[c] !=
id )
1866 assert(c < reoptnodes[parentid]->nchilds);
1869 assert(reoptnodes[parentid]->childids[c] ==
id);
1873 --reoptnodes[parentid]->
nchilds;
1896 assert(reopttree != NULL);
1897 assert(id < reopttree->reoptnodessize);
1902 unsigned int childid;
1908 while( seenids < nchildids )
1912 assert(childid < reopttree->reoptnodessize);
1913 assert(reopttree->
reoptnodes[childid] != NULL);
1941 assert(reoptnode != NULL);
1942 assert(blkmem != NULL);
1981 assert(reopt != NULL);
1983 assert(
set != NULL);
1984 assert(blkmem != NULL);
1985 assert(node != NULL);
1986 assert(transvars != NULL);
1989 assert(node != NULL);
1991 *localrestart =
FALSE;
1994 assert(id < reopt->reopttree->reoptnodessize);
2000 if( set->reopt_objsimdelay > -1 )
2014 for( v = 0; v < ntransvars; v++ )
2023 assert(0 <= idx && idx < ntransvars);
2028 sim += (oldcoef * newcoef);
2034 if(
SCIPsetIsLT(
set, sim, set->reopt_objsimdelay) )
2037 *localrestart =
TRUE;
2050 SCIPsetDebugMsg(
set,
" -> local similarity: %.4f%s\n", sim, *localrestart ?
" (solve subproblem from scratch)" :
"");
2065 unsigned int parentid
2070 assert(reopttree != NULL );
2071 assert(node != NULL );
2072 assert(parent != NULL );
2073 assert(1 <=
id && id < reopttree->reoptnodessize);
2075 assert(parentid < reopttree->reoptnodessize);
2076 assert(parentid == 0 || reopttree->
reoptnodes[parentid] != NULL );
2114 assert(nbranchvars <= reopttree->reoptnodes[
id]->varssize);
2118 assert(nbranchvars <= reopttree->reoptnodes[
id]->varssize);
2140 assert(reoptconsdata != NULL);
2141 assert(cons != NULL);
2144 allocbuffervals =
FALSE;
2145 reoptconsdata->linear =
TRUE;
2155 reoptconsdata->varssize = reoptconsdata->nvars;
2158 reoptconsdata->boundtypes = NULL;
2161 assert(conshdlr != NULL);
2177 allocbuffervals =
TRUE;
2179 for( v = 0; v < reoptconsdata->nvars; v++ )
2182 reoptconsdata->lhs = 1.0;
2191 allocbuffervals =
TRUE;
2193 for( v = 0; v < reoptconsdata->nvars; v++ )
2198 reoptconsdata->lhs = 1.0;
2199 reoptconsdata->rhs = 1.0;
2203 reoptconsdata->rhs = 1.0;
2206 reoptconsdata->lhs = 1.0;
2222 assert(vars != NULL);
2223 assert(vals != NULL);
2226 for( v = 0; v < reoptconsdata->nvars; v++ )
2231 assert(vars[v] != NULL);
2233 reoptconsdata->vars[v] = vars[v];
2234 reoptconsdata->vals[v] = vals[v];
2240 reoptconsdata->vals[v] *= scalar;
2243 reoptconsdata->lhs -= constant;
2245 reoptconsdata->rhs -= constant;
2249 if( allocbuffervals )
2273 assert(reoptconsdata != NULL);
2274 assert(cons != NULL);
2277 reoptconsdata->linear =
FALSE;
2280 assert(conshdlr != NULL);
2285 SCIPerrorMessage(
"Cannot handle constraints of type <%s> in saveConsBounddisjuction.\n",
2300 reoptconsdata->varssize = reoptconsdata->nvars;
2305 for( v = 0; v < reoptconsdata->nvars; v++ )
2310 assert(reoptconsdata->vars[v] != NULL);
2316 reoptconsdata->vals[v] -= constant;
2317 reoptconsdata->vals[v] *= scalar;
2343 assert(node != NULL );
2344 assert(reopttree != NULL);
2345 assert(id < reopttree->reoptnodessize);
2352 SCIPsetDebugMsg(
set,
" -> save %d locally added constraints\n", addedconsssize);
2364 for( c = nconss; c < naddedconss; c++ )
2437 assert(reopt != NULL);
2439 assert(id < reopt->reopttree->reoptnodessize);
2441 assert(node != NULL);
2442 assert(blkmem != NULL);
2461 &nbndchgs, reopt->
dualreds->varssize);
2462 assert(nbndchgs <= reopt->dualreds->varssize);
2468 for( v = 0; v < nbndchgs; v++ )
2480 assert(nbndchgs > 0);
2492 cons_is_next =
FALSE;
2503 reopt->
dualreds->vars, nbndchgs) );
2505 reopt->
dualreds->vals, nbndchgs) );
2507 reopt->
dualreds->boundtypes, nbndchgs) );
2517 SCIPsetDebugMsg(
set,
" -> save dual information of type 1: node %lld, nvars %d, constype %d\n",
2529 reopt->
dualreds->vars, nbndchgs) );
2531 reopt->
dualreds->vals, nbndchgs) );
2533 reopt->
dualreds->boundtypes, nbndchgs) );
2541 SCIPsetDebugMsg(
set,
" -> save dual information of type 2: node %lld, nvars %d, constype %d\n",
2566 unsigned int parentid = 0;
2568 assert(reopt != NULL);
2569 assert(
set != NULL);
2570 assert(blkmem != NULL);
2571 assert(node != NULL);
2573 if( set->reopt_maxsavednodes == 0 )
2594 assert(!isrootnode);
2597 assert(id < reopt->reopttree->reoptnodessize);
2607 assert(parent != NULL);
2619 assert(parent != NULL);
2628 assert(parentid == 0
2646 transintoorig =
FALSE;
2649 if( set->reopt_usecuts )
2662 if( set->reopt_saveconsprop )
2678 #ifdef SCIP_MORE_DEBUG 2712 if( set->reopt_shrinkinner )
2732 if( set->reopt_reducetofrontier )
2746 if( set->reopt_reducetofrontier )
2796 if( set->reopt_usecuts )
2830 SCIPsetDebugMsg(
set,
" -> nvars: 0, ncons: 0, parentID: -, reopttype: %u, lowerbound: %g\n", reopttype,
2844 if( set->reopt_reducetofrontier )
2863 SCIPsetDebugMsg(
set,
" -> nvars: 0, ncons: 0, parentID: -, reopttype: %u, lowerbound: %g\n", reopttype,
2877 if( set->reopt_reducetofrontier )
2896 SCIPsetDebugMsg(
set,
" -> nvars: 0, ncons: 0, parentID: -, reopttype: %u, lowerbound:%g \n", reopttype,
2957 assert(
id >= 1 && id < reopt->reopttree->reoptnodessize);
2958 assert(!isrootnode);
2965 assert(parent != NULL );
2990 SCIPsetDebugMsg(
set,
" -> skip saving bound changes after dual reductions.\n");
3008 if( set->reopt_usecuts )
3024 SCIPsetDebugMsg(
set,
" -> nvars: %d, ncons: %d, parentID: %u, reopttype: %d, lowerbound: %g\n",
3028 #ifdef SCIP_MORE_DEBUG 3127 assert(reopt != NULL);
3145 assert(reoptnode != NULL);
3146 assert(blkmem != NULL);
3207 assert(reopt != NULL);
3208 assert(blkmem != NULL);
3209 assert(
set != NULL);
3210 assert(vars != NULL);
3211 assert(vals != NULL);
3212 assert(nbinvars + nintvars == nvars);
3219 reoptconsdata = NULL;
3221 if( reopt->
glbconss[nglbconss] == NULL )
3224 reoptconsdata = reopt->
glbconss[nglbconss];
3229 reoptconsdata->varssize = (int)(nbinvars+2*nintvars);
3230 reoptconsdata->nvars = 0;
3234 assert(reopt->
glbconss[nglbconss]->nvars == 0);
3235 assert(reopt->
glbconss[nglbconss]->varssize > 0);
3237 reoptconsdata = reopt->
glbconss[nglbconss];
3239 if( reoptconsdata->varssize < nbinvars+2*nintvars )
3242 (
int)(nbinvars+2*nintvars)) );
3244 (
int)(nbinvars+2*nintvars)) );
3246 (
int)(nbinvars+2*nintvars)) );
3247 reoptconsdata->varssize = (int)(nbinvars+2*nintvars);
3250 assert(reoptconsdata != NULL);
3252 reoptconsdata->lhs = 1.0;
3254 reoptconsdata->linear =
FALSE;
3257 for( v = 0; v < nvars; v++ )
3259 assert(nvarsadded < reoptconsdata->varssize);
3260 assert(vars[v] != NULL);
3274 reoptconsdata->vars[nvarsadded] = vars[v];
3279 reoptconsdata->vals[nvarsadded] = 0.0;
3286 reoptconsdata->vals[nvarsadded] = 1.0;
3293 assert(boundtypes != NULL);
3295 reoptconsdata->vals[nvarsadded] = vals[v];
3307 reoptconsdata->vars[nvarsadded] = vars[v];
3323 reoptconsdata->vals[nvarsadded] = ubglb - 1.0;
3331 reoptconsdata->vals[nvarsadded] = lbglb + 1.0;
3335 else if( boundtypes != NULL )
3344 reoptconsdata->vals[nvarsadded] = roundedval + 1.0;
3352 reoptconsdata->vals[nvarsadded] = roundedval - 1.0;
3365 reoptconsdata->vals[nvarsadded] = roundedval - 1.0;
3370 reoptconsdata->vars[nvarsadded] = vars[v];
3371 reoptconsdata->vals[nvarsadded] = roundedval + 1.0;
3377 assert(nvars <= nvarsadded);
3378 assert(nvarsadded == nbinvars + 2 * nintvars);
3380 reoptconsdata->nvars = nvarsadded;
3396 assert(reopt != NULL);
3397 assert(node != NULL);
3419 if( allocmem < nbranchvars )
3424 allocmem = nbranchvars;
3432 for( v = 0; v < nbranchvars; v++ )
3439 assert(nbinvars + nintvars == nbranchvars);
3441 SCIP_CALL(
addGlobalCut(reopt, blkmem,
set, vars, vals, boundtypes, nbranchvars, nbinvars, nintvars) );
3468 assert(reopttree != NULL);
3469 assert(blkmem != NULL);
3470 assert(id1 < reopttree->reoptnodessize);
3471 assert(id2 < reopttree->reoptnodessize);
3482 SCIPsetDebugMsg(
set,
"move %d IDs: %u -> %u\n", nchilds_id1, id1, id2);
3485 for( c = 0; c < nchilds_id1; c++ )
3491 for( k = 0; k < nchilds_id2; k++ )
3531 assert(reopt != NULL);
3532 assert(
set != NULL);
3533 assert(stat != NULL);
3534 assert(transprob != NULL);
3535 assert(tree != NULL);
3537 assert(branchcand != NULL);
3538 assert(eventqueue != NULL);
3539 assert(cliquetable != NULL);
3540 assert(node != NULL);
3541 assert(blkmem != NULL);
3544 assert(reopttree != NULL);
3545 assert(id < reopttree->reoptnodessize);
3548 assert(reoptnode != NULL);
3555 for( v = 0; v < reoptnode->
nvars; v++ )
3564 var = reoptnode->
vars[v];
3593 #ifdef SCIP_MORE_DEBUG 3649 #ifdef SCIP_MORE_DEBUG 3656 nvars = reoptnode->
nvars;
3704 assert(reopt != NULL);
3706 assert(id < reopt->reopttree->reoptnodessize);
3710 assert(scip != NULL);
3711 assert(
set != NULL);
3712 assert(stat != NULL);
3713 assert(blkmem != NULL);
3714 assert(transprob != NULL);
3715 assert(origprob != NULL);
3716 assert(tree != NULL);
3718 assert(branchcand != NULL);
3719 assert(eventqueue != NULL);
3720 assert(node != NULL);
3744 assert(!reoptconsdata->linear);
3745 assert(reoptconsdata->vars != NULL);
3746 assert(reoptconsdata->vals != NULL);
3747 assert(reoptconsdata->boundtypes != NULL);
3749 var = reoptconsdata->vars[0];
3750 newbound = reoptconsdata->vals[0];
3751 boundtype = reoptconsdata->boundtypes[0];
3762 newbound = reoptconsdata->vals[0] - 1.0;
3763 assert(
SCIPisLE(scip, newbound, oldub));
3767 newbound = reoptconsdata->vals[0] + 1.0;
3768 assert(
SCIPisGE(scip, newbound, oldlb));
3800 assert(!reoptconsdata->linear);
3801 assert(reoptconsdata->vars != NULL);
3802 assert(reoptconsdata->vals != NULL);
3803 assert(reoptconsdata->boundtypes != NULL);
3809 for( v = 0; v < reoptconsdata->nvars; v++ )
3827 SCIPerrorMessage(
"Variable <%s> has to be either binary, (implied) integer, or continuous.\n",
3842 if( reoptconsdata->nvars == nbinvars )
3844 for( v = 0; v < reoptconsdata->nvars; v++ )
3846 consvars[v] = reoptconsdata->vars[v];
3847 consval = reoptconsdata->vals[v];
3871 assert(nintvars > 0 || ncontvars > 0);
3878 for( v = 0; v < reoptconsdata->nvars; v++ )
3880 consvars[v] = reoptconsdata->vars[v];
3881 consvals[v] = reoptconsdata->vals[v];
3882 consboundtypes[v] = reoptconsdata->boundtypes[v];
3916 consvals,
FALSE,
FALSE,
TRUE,
FALSE,
TRUE,
TRUE,
FALSE,
FALSE,
FALSE,
TRUE) );
3924 #ifdef SCIP_DEBUG_CONSS 3961 assert(reopt != NULL);
3962 assert(
set != NULL);
3963 assert(stat != NULL);
3964 assert(transprob != NULL);
3965 assert(origprob != NULL);
3966 assert(tree != NULL);
3968 assert(branchcand != NULL);
3969 assert(eventqueue != NULL);
3970 assert(cliquetable != NULL);
3971 assert(node != NULL);
3972 assert(blkmem != NULL);
3975 assert(reopttree != NULL);
3976 assert(0 <
id && id < reopttree->reoptnodessize);
3979 assert(reoptnode != NULL);
3986 for( v = 0; v < reoptnode->
dualredscur->nvars; v++ )
3995 boundtype = reoptnode->
dualredscur->boundtypes[v];
4025 #ifdef SCIP_MORE_DEBUG 4035 pos = reoptnode->
nvars;
4037 reoptnode->
vars[pos] = var;
4049 if( updatedualconss )
4090 assert(reopt != NULL);
4091 assert(
set != NULL);
4092 assert(stat != NULL);
4093 assert(transprob != NULL);
4094 assert(origprob != NULL);
4095 assert(tree != NULL);
4097 assert(branchcand != NULL);
4098 assert(eventqueue != NULL);
4099 assert(cliquetable != NULL);
4100 assert(node != NULL);
4101 assert(perm != NULL);
4102 assert(vars != NULL);
4103 assert(vals != NULL);
4104 assert(boundtypes != NULL);
4106 assert(blkmem != NULL);
4107 assert(0 <
id && id < reopt->reopttree->reoptnodessize);
4115 assert(reopttree != NULL);
4118 assert(reoptnode != NULL);
4123 nbndchgs = MIN(negbndchg, nvars);
4126 for( v = 0; v < nbndchgs; v++ )
4128 var = vars[perm[v]];
4129 val = vals[perm[v]];
4130 boundtype = boundtypes[perm[v]];
4136 if( v == nbndchgs-1 )
4164 #ifdef SCIP_MORE_DEBUG 4187 assert(scip != NULL);
4188 assert(reopt != NULL);
4190 assert(
set != NULL);
4191 assert(stat != NULL);
4192 assert(blkmem != NULL);
4193 assert(node != NULL);
4194 assert(0 <
id && id < reopt->reopttree->reoptnodessize);
4208 assert(reoptconsdata != NULL);
4209 assert(reoptconsdata->nvars > 0);
4210 assert(reoptconsdata->varssize >= reoptconsdata->nvars);
4222 if( reoptconsdata->linear )
4225 reoptconsdata->lhs, reoptconsdata->rhs,
FALSE,
FALSE,
TRUE,
TRUE,
TRUE,
TRUE,
FALSE,
FALSE,
FALSE,
TRUE) );
4229 assert(reoptconsdata->boundtypes != NULL);
4231 reoptconsdata->vals,
FALSE,
FALSE,
TRUE,
TRUE,
TRUE,
TRUE,
FALSE,
FALSE,
FALSE,
TRUE) );
4233 #ifdef SCIP_DEBUG_CONSS 4249 assert(reopt != NULL);
4276 unsigned int* cutoffchilds;
4277 int ncutoffchilds = 0;
4278 unsigned int* redchilds;
4282 assert(reopt != NULL);
4284 assert(id < reopt->reopttree->reoptnodessize);
4300 for( c = 0; c < reoptnode->
nchilds; c++ )
4308 unsigned int childid;
4315 assert(childid < reopt->reopttree->reoptnodessize);
4317 assert(child != NULL);
4318 #ifdef SCIP_MORE_DEBUG 4321 if( child->
nvars > 0 )
4326 for( v = 0; v < child->
nvars && !cutoff; v++ )
4334 transvar = child->
vars[v];
4347 SCIPsetDebugMsg(
set,
" -> <%s> is fixed to %g, can not change bound to %g -> cutoff\n",
4357 SCIPsetDebugMsg(
set,
" -> <%s> is already fixed to %g -> redundant bound change\n",
4360 redundantvars[nredundantvars] = v;
4365 if( !cutoff && nredundantvars > 0 )
4367 for( v = 0; v < nredundantvars; v++ )
4370 child->
vars[redundantvars[v]] = child->
vars[child->
nvars-1];
4380 else if( child->
nconss == 0 )
4388 cutoffchilds[ncutoffchilds] = childid;
4391 else if( redundant )
4393 redchilds[nredchilds] = childid;
4398 SCIPsetDebugMsg(
set,
"-> found %d redundant and %d infeasible nodes\n", nredchilds, ncutoffchilds);
4401 while( ncutoffchilds > 0 )
4408 while( reoptnode->
childids[c] != cutoffchilds[ncutoffchilds-1] && c < reoptnode->nchilds )
4410 assert(reoptnode->
childids[c] == cutoffchilds[ncutoffchilds-1]);
4421 while( nredchilds > 0 )
4425 while( reoptnode->
childids[c] != redchilds[nredchilds-1] && c < reoptnode->nchilds )
4427 assert(reoptnode->
childids[c] == redchilds[nredchilds-1]);
4457 for( cc = 0; cc < ncc; cc++ )
4492 assert(reopttree != NULL);
4493 assert(id < reopttree->reoptnodessize);
4511 assert(reopt != NULL);
4512 assert(id < reopt->reopttree->reoptnodessize);
4518 unsigned int childid;
4521 assert(childid < reopt->reopttree->reoptnodessize);
4537 unsigned int* leaves,
4545 assert(reopt != NULL);
4546 assert(leavessize > 0 && leaves != NULL);
4547 assert((*nleaves) >= 0);
4548 assert(id < reopt->reopttree->reoptnodessize);
4553 unsigned int childid;
4555 assert(*nleaves <= leavessize);
4558 assert(childid < reopt->reopttree->reoptnodessize);
4572 (*nleaves) += nleaves2;
4588 assert(reopt != NULL);
4589 assert(
set != NULL);
4590 assert(blkmem != NULL);
4613 assert(reopt != NULL);
4615 assert(
set != NULL);
4616 assert(blkmem != NULL);
4648 assert(reopt != NULL);
4649 assert(
set != NULL);
4650 assert(blkmem != NULL);
4651 assert(origvars != NULL);
4652 assert(norigvars >= 0);
4661 for( i = 0; i < reopt->
run-1; i++ )
4664 for( v = reopt->
nobjvars-1; v < norigvars; v++ )
4665 reopt->
objs[i][v] = 0.0;
4672 for( v = 0; v < norigvars; v++ )
4686 for( i = 0; i < reopt->
run; i++ )
4689 for( j = reopt->
nobjvars; j < newsize; j++ )
4690 reopt->
objs[i][j] = 0.0;
4694 assert(0 <= probidx && probidx < reopt->nobjvars);
4704 if( reopt->
firstobj == -1 && reopt->
objs[reopt->
run-1][probidx] != 0 )
4709 if( reopt->
run-1 >= 1 )
4741 assert(
set != NULL);
4742 assert(perm != NULL);
4743 assert(vars != NULL);
4744 assert(bounds != NULL);
4745 assert(boundtypes != NULL);
4751 for( v = 0; v < nvars; v++ )
4793 assert(reopt != NULL);
4794 assert(sol != NULL);
4795 assert(blkmem != NULL);
4796 assert(
set != NULL);
4797 assert(stat != NULL);
4798 assert(vars != NULL);
4810 for( v = 0, w = 0; v < nvars; v++ )
4813 assert(nbinvars + nintvars == w);
4824 origvars[v] = vars[v];
4825 assert(origvars[v] != NULL);
4853 #undef SCIPreoptGetNRestartsGlobal 4854 #undef SCIPreoptGetNRestartsLocal 4855 #undef SCIPreoptGetNTotalRestartsLocal 4856 #undef SCIPreoptGetFirstRestarts 4857 #undef SCIPreoptGetLastRestarts 4858 #undef SCIPreoptGetNFeasNodes 4859 #undef SCIPreoptGetNTotalFeasNodes 4860 #undef SCIPreoptGetNPrunedNodes 4861 #undef SCIPreoptGetNTotalPrunedNodes 4862 #undef SCIPreoptGetNCutoffReoptnodes 4863 #undef SCIPreoptGetNTotalCutoffReoptnodes 4864 #undef SCIPreoptGetNInfNodes 4865 #undef SCIPreoptGetNTotalInfNodes 4866 #undef SCIPreoptGetNInfSubtrees 4874 assert(reopt != NULL);
4884 assert(reopt != NULL);
4894 assert(reopt != NULL);
4904 assert(reopt != NULL);
4914 assert(reopt != NULL);
4924 assert(reopt != NULL);
4934 assert(reopt != NULL);
4944 assert(reopt != NULL);
4954 assert(reopt != NULL);
4964 assert(reopt != NULL);
4974 assert(reopt != NULL);
4984 assert(reopt != NULL);
4994 assert(reopt != NULL);
5009 assert(reopt != NULL);
5014 (*reopt)->simtolastobj = -2.0;
5015 (*reopt)->simtofirstobj = -2.0;
5016 (*reopt)->firstobj = -1;
5017 (*reopt)->currentnode = -1;
5018 (*reopt)->lastbranched = -1;
5019 (*reopt)->dualreds = NULL;
5020 (*reopt)->glbconss = NULL;
5021 (*reopt)->nglbconss = 0;
5022 (*reopt)->allocmemglbconss = 0;
5023 (*reopt)->ncheckedsols = 0;
5024 (*reopt)->nimprovingsols = 0;
5025 (*reopt)->noptsolsbyreoptsol = 0;
5026 (*reopt)->nglbrestarts = 0;
5027 (*reopt)->nlocrestarts = 0;
5028 (*reopt)->ntotallocrestarts = 0;
5029 (*reopt)->firstrestart = -1;
5030 (*reopt)->lastrestart = 0;
5031 (*reopt)->nobjvars = 0;
5032 (*reopt)->objhaschanged =
FALSE;
5033 (*reopt)->consadded =
FALSE;
5034 (*reopt)->addedconss = NULL;
5035 (*reopt)->naddedconss = 0;
5036 (*reopt)->addedconsssize = 0;
5037 (*reopt)->glblb = NULL;
5038 (*reopt)->glbub = NULL;
5039 (*reopt)->activeconss = NULL;
5045 for( i = 0; i < (*reopt)->runsize; i++ )
5047 (*reopt)->objs[i] = NULL;
5048 (*reopt)->prevbestsols[i] = NULL;
5049 (*reopt)->varhistory[i] = NULL;
5071 eventExitsolReopt, NULL, eventExecReopt, NULL) );
5073 assert(eventhdlr != NULL);
5086 assert(reopt != NULL);
5087 assert(*reopt != NULL);
5088 assert(
set != NULL);
5090 assert(blkmem != NULL);
5102 for( p = (*reopt)->run-1; p >= 0; p-- )
5104 if( (*reopt)->soltree->sols[p] != NULL )
5107 (*reopt)->soltree->sols[p] = NULL;
5113 if( set->reopt_sepabestsol && (*reopt)->prevbestsols[p] != NULL )
5118 if( (*reopt)->objs[p] != NULL )
5128 if( (*reopt)->dualreds != NULL )
5130 if( (*reopt)->dualreds->varssize > 0 )
5132 assert(!(*reopt)->dualreds->linear);
5138 (*reopt)->dualreds = NULL;
5142 if( (*reopt)->glbconss != NULL && (*reopt)->allocmemglbconss > 0 )
5147 for( c = 0; c < (*reopt)->allocmemglbconss; c++ )
5149 if( (*reopt)->glbconss[c] != NULL )
5151 if( (*reopt)->glbconss[c]->varssize > 0 )
5156 (*reopt)->glbconss[c]->varssize = 0;
5159 --(*reopt)->nglbconss;
5163 assert((*reopt)->nglbconss == 0);
5166 (*reopt)->allocmemglbconss = 0;
5173 if( (*reopt)->addedconss != NULL )
5176 for( c = 0; c < (*reopt)->naddedconss; c++)
5178 assert((*reopt)->addedconss[c] != NULL);
5186 if( (*reopt)->glblb != NULL )
5191 (*reopt)->glblb = NULL;
5192 (*reopt)->glbub = NULL;
5193 (*reopt)->activeconss = NULL;
5197 assert((*reopt)->glbub == NULL);
5198 assert((*reopt)->activeconss == NULL);
5217 assert(reopt != NULL);
5218 assert(node != NULL);
5221 assert(id < reopt->reopttree->reoptnodessize);
5252 assert(reopt != NULL);
5253 assert(
set != NULL);
5254 assert(sol != NULL);
5261 if( heur != NULL && strcmp(
SCIPheurGetName(heur),
"reoptsols") == 0 && bestsol )
5270 SCIP_CALL(
soltreeAddSol(reopt,
set, stat, origprimal, blkmem, vars, sol, &solnode, nvars, bestsol, added) );
5274 assert(solnode != NULL);
5280 assert(reopt->
soltree->
nsols[run-1] <= set->reopt_savesols);
5301 assert(reopt != NULL);
5302 assert(reopt->
run-1 >= 0);
5303 assert(sol != NULL);
5304 assert(blkmem != NULL);
5305 assert(
set != NULL);
5306 assert(stat != NULL);
5307 assert(origprimal != NULL);
5313 if( set->reopt_sepabestsol )
5331 assert(reopt != NULL);
5332 assert(
set != NULL);
5333 assert(blkmem != NULL);
5334 assert(origvars != NULL);
5362 assert(reopt != NULL);
5373 assert(reopt != NULL);
5383 assert(reopt != NULL);
5394 assert(reopt != NULL);
5405 assert(reopt != NULL);
5406 assert(0 < run && run <= reopt->runsize);
5422 assert(reopt != NULL);
5424 for( r = 0; r < reopt->
run; r++)
5441 assert(reopt != NULL);
5442 assert(run > 0 && run <= reopt->run);
5443 assert(sols != NULL);
5445 assert(solssize > 0);
5446 assert(nsols != NULL);
5455 if( solssize < (*nsols) )
5479 assert(reopt != NULL);
5512 assert(reopt != NULL);
5513 assert(
set != NULL);
5514 assert(blkmem != NULL);
5515 assert(transvars != NULL);
5516 assert(ntransvars >= 0);
5517 assert(restart != NULL);
5525 if( reopt->
run > 1 && set->reopt_objsimdelay > -1.0 )
5536 SCIPsetDebugMsg(
set,
"-> restart reoptimization (objective functions are not similar enough)\n");
5542 SCIPsetDebugMsg(
set,
"-> restart reoptimization (node limit reached)\n");
5548 SCIPsetDebugMsg(
set,
"-> restart reoptimization (found last %d optimal solutions by <reoptsols>)\n",
5573 assert(reopt != NULL);
5582 assert(reopt != NULL);
5596 assert(reopt != NULL);
5597 assert(run1 > 0 && run1 <= reopt->run);
5598 assert(run2 > 0 && run2 <= reopt->run);
5599 assert(origvars != NULL);
5600 assert(norigvars >= 0);
5602 return reoptSimilarity(reopt,
set, run1-1, run2-1, origvars, norigvars);
5610 assert(reopt != NULL);
5613 if( reopt->
run-2 < 0 )
5625 assert(reopt != NULL);
5627 assert(id < reopt->reopttree->reoptnodessize);
5640 assert(reopt != NULL);
5641 assert(0 < run && run <= reopt->runsize);
5643 return reopt->
objs[run-1][idx];
5655 assert(reopt != NULL);
5656 assert(0 < run && run <= reopt->run);
5670 assert(reopt != NULL);
5671 assert(
set != NULL);
5672 assert(blkmem != NULL);
5680 assert(cons != NULL);
5700 assert(reopt != NULL);
5701 assert(reopt->
soltree != NULL);
5707 while( child != NULL )
5722 assert(reopt != NULL);
5728 assert(id < reopt->reopttree->reoptnodessize);
5734 assert(0 <
id && id < reopt->reopttree->reoptnodessize);
5747 #undef SCIPreoptnodeGetNVars 5748 #undef SCIPreoptnodeGetNConss 5749 #undef SCIPreoptnodeGetNDualBoundChgs 5750 #undef SCIPreoptnodeGetNChildren 5751 #undef SCIPreoptnodeGetLowerbound 5752 #undef SCIPreoptnodeGetType 5759 assert(reoptnode != NULL);
5769 assert(reoptnode != NULL);
5771 return reoptnode->
nconss;
5779 assert(reoptnode != NULL);
5792 assert(reoptnode != NULL);
5802 assert(reoptnode != NULL);
5812 assert(reoptnode != NULL);
5830 assert(reoptnode != NULL);
5831 assert(vars != NULL);
5832 assert(bounds != NULL);
5833 assert(boundtypes != NULL);
5834 assert(nvars != NULL);
5835 assert(nconss != NULL);
5837 (*nconss) = reoptnode->
nconss;
5842 for( c = 0; c < *nconss; c++ )
5844 assert(vars[c] != NULL);
5845 assert(bounds[c] != NULL);
5847 vars[c] = reoptnode->
conss[c]->vars;
5848 bounds[c] = reoptnode->
conss[c]->vals;
5849 boundtypes[c] = reoptnode->
conss[c]->boundtypes;
5850 nvars[c] = reoptnode->
conss[c]->nvars;
5857 unsigned int parentid
5860 assert(reoptnode != NULL);
5861 assert(parentid <= 536870911);
5876 assert(reopt != NULL);
5879 assert(id < reopt->reopttree->reoptnodessize);
5887 unsigned int childid;
5890 assert(childid < reopt->reopttree->reoptnodessize);
5909 assert(reopt != NULL);
5910 assert(
set != NULL);
5911 assert(blkmem != NULL);
5912 assert(node != NULL);
5914 if( set->reopt_sepaglbinfsubtrees )
5937 int effectiverootdepth
5942 assert(reopt != NULL);
5943 assert(
set != NULL);
5944 assert(blkmem != NULL);
5946 assert(node != NULL);
5994 lowerbound = MIN(lowerbound, cutoffbound);
5999 isrootnode, lowerbound) );
6016 SCIPsetDebugMsg(
set,
" -> focusnode : %s\n", isfocusnode ?
"yes" :
"no");
6018 SCIPsetDebugMsg(
set,
" -> strong branched : %s\n", strongbranched ?
"yes" :
"no");
6025 assert(isfocusnode);
6054 if( strongbranched )
6126 assert(isfocusnode);
6138 if( strongbranched )
6164 if( strongbranched )
6208 assert(reopt != NULL);
6209 assert(node != NULL);
6232 allocmem = reopt->
dualreds->nvars + resizelength;
6237 assert(reopt->
dualreds->varssize > 0);
6238 assert(reopt->
dualreds->nvars >= 0);
6247 newval = (newval - constant) / scalar;
6248 oldval = (oldval - constant) / scalar;
6254 SCIPerrorMessage(
"cannot store equal bounds: old = %g, new = %g\n", oldval, newval);
6290 int ndualbndchgs = 0;
6292 assert(reopt != NULL);
6293 assert(node != NULL);
6298 ndualbndchgs = reopt->
dualreds->nvars;
6301 return ndualbndchgs;
6310 unsigned int* childs,
6318 assert(reopt != NULL);
6319 assert(childssize > 0 && childs != NULL);
6320 assert(nchilds != NULL);
6330 assert(id < reopt->reopttree->reoptnodessize);
6347 if( childssize < *nchilds )
6350 for( c = 0; c < *nchilds; c++ )
6361 unsigned int* leaves,
6369 assert(reopt != NULL);
6370 assert(leavessize > 0 && leaves != NULL);
6371 assert((*nleaves) >= 0);
6380 if(
id == 0 && node != NULL )
6386 assert(id < reopt->reopttree->reoptnodessize);
6389 for( i = 0; i < leavessize; i++ )
6395 unsigned int childid;
6397 assert(*nleaves + 1 <= leavessize);
6400 assert(childid < reopt->reopttree->reoptnodessize);
6414 (*nleaves) += nleaves2;
6437 assert(reopt != NULL);
6438 assert(
set != NULL);
6439 assert(blkmem != NULL);
6440 assert(nleaves >= 0);
6441 assert(nleaves == 0 || leaves != NULL);
6442 assert(nchilds >= 0);
6443 assert(nchilds == 0 || childs != NULL);
6444 assert(nsiblings >= 0);
6445 assert(nsiblings == 0 || siblings != NULL);
6447 SCIPsetDebugMsg(
set,
"save unprocessed nodes (%d leaves, %d children, %d siblings)\n", nleaves, nchilds, nsiblings);
6450 for( n = 0; n < nleaves; n++ )
6457 for( n = 0; n < nchilds; n++ )
6464 for( n = 0; n < nsiblings; n++ )
6492 assert(reopt != NULL);
6493 assert(stat != NULL);
6496 if( !set->reopt_storevarhistory )
6501 bestrun = reopt->
run-2;
6505 for( r = reopt->
run-3; r >= 0 && reopt->
objhaschanged && set->reopt_usepscost; r-- )
6522 for( v = 0; v < nvars; v++ )
6527 assert(transvar != NULL);
6534 assert(0 <= idx && idx <= nvars);
6537 for( d = 0; d <= 1; d++ )
6561 (d == 0 ?
"down" :
"up"), avginference[d], avgcutoff[d]);
6580 assert(reopt != NULL);
6581 assert(stat != NULL);
6582 assert(blkmem != NULL);
6585 if( !set->reopt_storevarhistory )
6595 for( v = 0; v < nvars; v++ )
6602 for( v = 0; v < nvars; v++ )
6609 assert(idx >= 0 && idx < nvars);
6612 assert(transvar != NULL);
6631 int nrepresentatives,
6639 assert(reopt != NULL);
6640 assert(
set != NULL);
6641 assert(blkmem != NULL);
6642 assert(representatives != NULL);
6643 assert(nrepresentatives > 0);
6659 for( r = 0; r < nrepresentatives; r++ )
6663 assert(1 <=
id && id < reopttree->reoptnodessize);
6674 if( representatives[r]->nvars > 0 )
6678 assert(representatives[r]->nvars <= representatives[r]->varssize);
6680 for( v = 0; v < representatives[r]->
nvars; v++ )
6687 if( representatives[r]->nconss > 0 )
6691 assert(representatives[r]->nconss <= representatives[r]->consssize);
6693 for( c = 0; c < representatives[r]->
nconss; c++ )
6696 representatives[r]->
conss[c]->vals, representatives[r]->
conss[c]->boundtypes,
6697 representatives[r]->
conss[c]->lhs, representatives[r]->
conss[c]->rhs,
6698 representatives[r]->
conss[c]->nvars, representatives[r]->
conss[c]->constype,
6699 representatives[r]->
conss[c]->linear) );
6720 SCIPsetDebugMsg(
set,
"-> new tree consists of %d nodes, the root has %d child nodes.\n",
6742 assert(reopt != NULL);
6743 assert(
set != NULL);
6744 assert(blkmem != NULL);
6745 assert(consdata != NULL);
6746 assert(dualreds != NULL);
6751 consdata->boundtypes = NULL;
6753 consdata->varssize = dualreds->nvars;
6754 consdata->nvars = dualreds->nvars;
6756 consdata->linear =
TRUE;
6759 consdata->lhs = 1.0;
6762 for( v = 0; v < consdata->nvars; v++ )
6764 assert(consdata->vars[v] != NULL);
6770 consdata->vals[v] = 1.0;
6782 consdata->vals[v] = -1.0;
6783 consdata->lhs -= 1.0;
6805 assert(reopt != NULL);
6806 assert(
set != NULL);
6807 assert(blkmem != NULL);
6808 assert(consdata != NULL);
6809 assert(dualreds != NULL);
6816 consdata->varssize = dualreds->nvars;
6817 consdata->nvars = dualreds->nvars;
6819 consdata->linear =
FALSE;
6825 for( v = 0; v < consdata->nvars; v++ )
6829 assert(consdata->vars[v] != NULL);
6838 consdata->vals[v] = MIN(consdata->vals[v]+1.0, glbbd);
6844 consdata->vals[v] =
MAX(glbbd, consdata->vals[v]-1.0);
6859 int* ncreatedchilds,
6876 assert(reopt != NULL);
6877 assert(
set != NULL);
6878 assert(stat != NULL);
6879 assert(blkmem != NULL);
6882 assert(reopttree != NULL);
6885 assert(reoptnodes != NULL);
6886 assert(reoptnodes[0] != NULL);
6887 assert(reoptnodes[0]->dualreds);
6890 nchilds = reoptnodes[0]->
nchilds;
6892 assert(reoptnodes[0]->dualredscur != NULL);
6895 (*ncreatedchilds) = 0;
6905 assert(reoptnodes[
id] == NULL || reoptnodes[
id]->nvars == 0);
6918 assert(reoptnodes[
id]->varssize >= nbndchgs);
6919 assert(reoptnodes[
id]->nvars == 0);
6920 assert(reoptnodes[
id]->vars != NULL);
6921 assert(reoptnodes[
id]->varbounds != NULL);
6922 assert(reoptnodes[
id]->varboundtypes != NULL);
6925 if( !set->reopt_usesplitcons )
6927 assert(perm == NULL);
6932 for( v = 0; v < nbndchgs; v++ )
6937 ++reoptnodes[id]->
nvars;
6940 if( !set->reopt_usesplitcons )
6943 assert(reoptnodes[
id]->nvars == reoptnodes[0]->dualredscur->
nvars);
6947 assert(reoptnodes[0]->nchilds == 0);
6952 ++(*ncreatedchilds);
6954 if( set->reopt_usesplitcons )
6960 assert(*ncreatedchilds == 1);
6981 consdata = reoptnodes[id]->
conss[0];
6984 for( v = 0; v < nbndchgs; v++ )
7004 if( nbinvars == nbndchgs )
7011 assert(nintvars > 0 || ncontvars > 0);
7014 ++reoptnodes[id]->
nconss;
7018 ++(*ncreatedchilds);
7026 assert(*ncreatedchilds == 1);
7027 assert(perm != NULL);
7031 boundtypes = reoptnodes[0]->
dualredscur->boundtypes;
7033 assert(perm[0] == 0 && perm[nvars-1] == nvars-1);
7036 switch (set->reopt_varorderinterdiction)
7057 for( c = 0; c < nvars; c++ )
7064 assert(reoptnodes[
id] == NULL || reoptnodes[
id]->nvars == 0);
7076 assert(reoptnodes[
id]->varssize >= perm[c]+1);
7077 assert(reoptnodes[
id]->nvars == 0);
7078 assert(reoptnodes[
id]->vars != NULL);
7079 assert(reoptnodes[
id]->varbounds != NULL);
7080 assert(reoptnodes[
id]->varboundtypes != NULL);
7083 if( set->reopt_varorderinterdiction ==
'd' )
7086 for( v = 0; v < c; v++ )
7088 reoptnodes[id]->
vars[v] = vars[v];
7089 reoptnodes[id]->
varbounds[v] = bounds[v];
7096 for( v = 0; v < c; v++ )
7098 reoptnodes[id]->
vars[v] = vars[perm[v]];
7099 reoptnodes[id]->
varbounds[v] = bounds[perm[v]];
7103 reoptnodes[id]->
nvars += c;
7107 reoptnodes[id]->
vars[c] = vars[perm[c]];
7108 reoptnodes[id]->
varbounds[c] = bounds[perm[c]];
7117 ++reoptnodes[id]->
nvars;
7122 ++(*ncreatedchilds);
7125 assert(*ncreatedchilds == nvars+1);
7130 assert(perm == NULL);
7133 assert(reoptnodes[0]->dualredscur->
vars != NULL);
7134 assert(reoptnodes[0]->dualredscur->vals != NULL);
7135 assert(reoptnodes[0]->dualredscur->boundtypes != NULL);
7155 assert(reopt != NULL);
7156 assert(node != NULL);
7159 assert(id < reopt->reopttree->reoptnodessize);
7180 int* nbndchgsafterdual
7186 int nafterdualvars2;
7188 assert(reopt != NULL);
7189 assert(reoptnode != NULL);
7190 assert(vars != NULL);
7191 assert(vals != NULL);
7192 assert(boundtypes != NULL);
7194 (*nbndchgs) = reoptnode->
nvars;
7198 if( varssize == 0 || varssize < *nbndchgs + *nbndchgsafterdual )
7202 for( v = 0; v < *nbndchgs; v++ )
7204 vars[v] = reoptnode->
vars[v];
7210 for( ; v < *nbndchgs + *nbndchgsafterdual; v++ )
7223 SCIPreoptnodeGetPath(reopt, parent, &vars[v], &vals[v], &boundtypes[v], varssize, &nvars2, &nafterdualvars2);
7225 (*nbndchgs) += nvars2;
7226 (*nbndchgsafterdual) += nafterdualvars2;
7238 assert(reopt != NULL);
7240 assert(id < reopt->reopttree->reoptnodessize);
7242 assert(blkmem != NULL);
7268 int* ncreatedchilds,
7274 assert(reopt != NULL);
7275 assert(scip != NULL);
7276 assert(
set != NULL);
7277 assert(stat != NULL);
7278 assert(transprob != NULL);
7279 assert(origprob != NULL);
7280 assert(tree != NULL);
7282 assert(branchcand != NULL);
7283 assert(eventqueue != NULL);
7284 assert(cliquetable != NULL);
7285 assert(blkmem != NULL);
7286 assert(reoptnode != NULL);
7287 assert(childnodes != NULL);
7289 assert(id < reopt->reopttree->reoptnodessize);
7290 assert(success != NULL);
7305 if( set->reopt_usesplitcons )
7307 if( reoptnode->
reopttype == (
unsigned int)SCIP_REOPTTYPE_INFSUBTREE )
7311 (*ncreatedchilds) = 1;
7317 (*ncreatedchilds) = 2;
7323 if( childnodessize < *ncreatedchilds )
7327 for( c = 0; c < *ncreatedchilds; c++ )
7337 cliquetable, blkmem, childnodes[c],
id, c == 1) );
7353 SCIP_CALL(
addSplitcons(reopt, scip,
set, stat, blkmem, transprob, origprob, tree, lp, branchcand,
7354 eventqueue, cliquetable, childnodes[c],
id) );
7378 if( reoptnode->
nconss == 0 )
7385 SCIP_CALL(
fixBounds(reopt,
set, stat, transprob, origprob, tree, lp, branchcand, eventqueue, cliquetable,
7386 blkmem, childnodes[c],
id,
TRUE) );
7417 *ncreatedchilds = nvars+1;
7421 if( childnodessize < *ncreatedchilds )
7426 for( c = 0; c < nvars; c++ )
7430 switch (set->reopt_varorderinterdiction)
7460 for( c = nvars; c >= 0; c-- )
7465 #ifdef SCIP_MORE_DEBUG 7471 cliquetable, blkmem, childnodes[c],
id,
FALSE) );
7477 SCIP_CALL(
fixBounds(reopt,
set, stat, transprob, origprob, tree, lp, branchcand, eventqueue, cliquetable,
7478 blkmem, childnodes[c],
id,
TRUE) );
7489 SCIP_CALL(
fixInterdiction(reopt,
set, stat, transprob, origprob, tree, lp, branchcand, eventqueue, cliquetable,
7490 blkmem, childnodes[c],
id, perm, vars, bounds, boundtypes, nvars, c) );
7519 (*ncreatedchilds) = 1;
7522 if( childnodessize < *ncreatedchilds )
7531 cliquetable, blkmem, childnodes[0],
id,
FALSE) );
7541 assert(reoptnode->
reopttype != (
unsigned int)SCIP_REOPTTYPE_INFSUBTREE
7559 assert(reopt != NULL);
7576 assert(scip != NULL);
7577 assert(reopt != NULL);
7578 assert(
set != NULL);
7579 assert(stat != NULL);
7580 assert(blkmem != NULL);
7585 for( c = reopt->
nglbconss-1; c >= 0; c-- )
7593 assert(reopt->
glbconss[c] != NULL);
7594 assert(reopt->
glbconss[c]->nvars > 0);
7602 for( v = 0; v < reopt->
glbconss[c]->nvars; v++ )
7611 SCIPerrorMessage(
"Expected variable type binary or (impl.) integer for variable <%s> in global constraint at pos. %d.\n",
7622 if( nbinvars == reopt->
glbconss[c]->nvars )
7624 SCIPsetDebugMsg(
set,
"-> add logic-or constraints with %d binvars\n", nbinvars);
7629 for( v = 0; v < reopt->
glbconss[c]->nvars; v++ )
7631 consvars[v] = reopt->
glbconss[c]->vars[v];
7644 consvars,
FALSE,
TRUE,
TRUE,
TRUE,
TRUE,
FALSE,
FALSE,
FALSE,
FALSE,
FALSE) );
7652 assert(reopt->
glbconss[c]->nvars == nbinvars + 2*nintvars);
7654 SCIPsetDebugMsg(
set,
"-> add bounddisjuction constraints with %d binvars, %d intvars\n", nbinvars, (
int) (2*nintvars));
7661 #ifdef SCIP_DEBUG_CONSS 7706 assert(reopt != NULL);
7707 assert(node != NULL);
7708 assert(sepastore != NULL);
7709 assert(blkmem != NULL);
7710 assert(
set != NULL);
7711 assert(stat != NULL);
7712 assert(eventqueue != NULL);
7713 assert(eventfilter != NULL);
7717 assert(id < reopt->reopttree->reoptnodessize);
7724 assert(reoptnode != NULL);
7727 for( c = reoptnode->
nconss-1; c >= 0; c-- )
7731 cons = reoptnode->
conss[c];
7732 assert(cons != NULL);
7747 for( v = 0; v < cons->nvars; v++ )
7754 assert(transvar != NULL);
7757 vals[ncols] = cons->vals[v];
7759 assert(cols[ncols] != NULL);
7763 assert(ncols == cons->nvars);
7770 SCIP_CALL(
SCIProwCreate(&cut, blkmem,
set, stat, lp, cutname, ncols, cols, vals, cons->lhs, cons->rhs,
7774 SCIPsetDebugMsg(
set,
"add cut <%s> of size %d to cutpool, [lhs, rhs] = [%g,%g] to node %lld\n", cutname,
7779 SCIP_CALL(
SCIProwCreate(&cut, blkmem,
set, stat, lp, cutname, ncols, cols, vals, cons->lhs, cons->rhs,
7781 SCIP_CALL(
SCIPsepastoreAddCut(sepastore, blkmem,
set, stat, eventqueue, eventfilter, lp, cut,
FALSE, root,
7784 SCIPsetDebugMsg(
set,
"add cut <%s> of size %d to sepastore, [lhs, rhs] = [%g,%g] to node %lld\n", cutname,
7808 for( i = c-1; i >= 0; i-- )
7827 assert(reopt != NULL);
7828 assert(node != NULL);
7832 assert(id < reopt->reopttree->reoptnodessize);
7839 if(
SCIPsetIsGE(
set, set->reopt_objsimrootlp, 1.0) )
7871 assert(reoptnode != NULL);
7872 assert(
set != NULL);
7874 reoptnode->
conss = NULL;
7880 reoptnode->
nvars = 0;
7887 reoptnode->
vars = NULL;
7906 assert(reopt != NULL);
7907 assert(
set != NULL);
7908 assert(blkmem != NULL);
7909 assert(reoptnode != NULL);
7922 assert(reoptnode != NULL);
7923 assert(blkmem != NULL);
7942 assert(reoptnode != NULL);
7943 assert(var != NULL);
7944 assert(blkmem != NULL);
7946 nvars = reoptnode->
nvars;
7950 reoptnode->
vars[nvars] = var;
7975 assert(reoptnode != NULL);
7976 assert(
set != NULL);
7977 assert(vars != NULL);
7978 assert(bounds != NULL);
7981 assert(blkmem != NULL);
7988 SCIPsetDebugMsg(
set,
"-> constraint has size 1 -> save as normal bound change.\n");
8004 newbound = bounds[0] + 1.0;
8011 newbound = bounds[0] - 1.0;
8022 nconss = reoptnode->
nconss;
8030 if( boundtypes != NULL )
8036 reoptnode->
conss[nconss]->boundtypes = NULL;
8038 reoptnode->
conss[nconss]->varssize = nvars;
8039 reoptnode->
conss[nconss]->nvars = nvars;
8040 reoptnode->
conss[nconss]->lhs = lhs;
8041 reoptnode->
conss[nconss]->rhs = rhs;
8042 reoptnode->
conss[nconss]->constype = constype;
8043 reoptnode->
conss[nconss]->linear = linear;
8057 assert(reopt != NULL);
8058 assert(
set != NULL);
8059 assert(blkmem != NULL);
8060 assert(cons != NULL);
8107 assert(reopt != NULL);
8108 assert(transprob != NULL);
8109 assert(reopt->
glblb == NULL && reopt->
glbub == NULL);
8119 for( i = 0; i < nvars; i++ )
8145 assert(reopt != NULL);
8146 assert(transprob != NULL);
8149 conss = transprob->
conss;
8150 nconss = transprob->
nconss;
8155 for( i = 0; i < nconss; i++ )
8183 assert(reopt != NULL);
8184 assert(transprob != NULL);
8185 assert(reopt->
glblb != NULL && reopt->
glbub != NULL);
8192 for( i = 0; i < nvars; i++ )
8226 assert(reopt != NULL);
8232 for( i = 0; i < nentries; i++ )
8241 assert(cons != NULL);
8263 assert(reopt != NULL);
8264 assert(cons != NULL);
SCIP_Bool SCIPsolIsOriginal(SCIP_SOL *sol)
static int soltreeNInducedSols(SCIP_SOLNODE *solnode)
SCIP_RETCODE SCIPreoptSplitRoot(SCIP_REOPT *reopt, SCIP_TREE *tree, SCIP_SET *set, SCIP_STAT *stat, BMS_BLKMEM *blkmem, int *ncreatedchilds, int *naddedconss)
enum SCIP_BoundType SCIP_BOUNDTYPE
void SCIPnodeGetDualBoundchgs(SCIP_NODE *node, SCIP_VAR **vars, SCIP_Real *bounds, SCIP_BOUNDTYPE *boundtypes, int *nvars, int varssize)
SCIP_RETCODE SCIPreoptApplyGlbConss(SCIP *scip, SCIP_REOPT *reopt, SCIP_SET *set, SCIP_STAT *stat, BMS_BLKMEM *blkmem)
#define DEFAULT_MEM_NODES
SCIP_RETCODE SCIPsetIncludeEventhdlr(SCIP_SET *set, SCIP_EVENTHDLR *eventhdlr)
void * SCIPhashmapEntryGetImage(SCIP_HASHMAPENTRY *entry)
SCIP_Real SCIPreoptGetSimToPrevious(SCIP_REOPT *reopt)
SCIP_Bool SCIPsetIsInfinity(SCIP_SET *set, SCIP_Real val)
SCIP_RETCODE SCIPreoptAddDualBndchg(SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_NODE *node, SCIP_VAR *var, SCIP_Real newval, SCIP_Real oldval)
#define BMSfreeBlockMemoryArrayNull(mem, ptr, num)
internal methods for managing events
int SCIPreoptGetNLeaves(SCIP_REOPT *reopt, SCIP_NODE *node)
SCIP_RETCODE SCIPreoptApply(SCIP_REOPT *reopt, SCIP *scip, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_TREE *tree, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_CLIQUETABLE *cliquetable, BMS_BLKMEM *blkmem, SCIP_REOPTNODE *reoptnode, unsigned int id, SCIP_Real estimate, SCIP_NODE **childnodes, int *ncreatedchilds, int *naddedconss, int childnodessize, SCIP_Bool *success)
SCIP_RETCODE SCIPnodeCreateChild(SCIP_NODE **node, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_TREE *tree, SCIP_Real nodeselprio, SCIP_Real estimate)
void SCIPhistoryIncNBranchings(SCIP_HISTORY *history, SCIP_BRANCHDIR dir, int depth)
SCIP_Bool SCIPsetIsLE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
internal methods for storing primal CIP solutions
static void resetStats(SCIP_REOPT *reopt)
SCIP_RETCODE SCIPeventhdlrCreate(SCIP_EVENTHDLR **eventhdlr, const char *name, const char *desc, SCIP_DECL_EVENTCOPY((*eventcopy)), SCIP_DECL_EVENTFREE((*eventfree)), SCIP_DECL_EVENTINIT((*eventinit)), SCIP_DECL_EVENTEXIT((*eventexit)), SCIP_DECL_EVENTINITSOL((*eventinitsol)), SCIP_DECL_EVENTEXITSOL((*eventexitsol)), SCIP_DECL_EVENTDELETE((*eventdelete)), SCIP_DECL_EVENTEXEC((*eventexec)), SCIP_EVENTHDLRDATA *eventhdlrdata)
SCIP_NODE * SCIPgetCurrentNode(SCIP *scip)
SCIP_STAGE SCIPgetStage(SCIP *scip)
struct SCIP_ReoptConsData SCIP_REOPTCONSDATA
SCIP_RETCODE SCIPconsActivate(SCIP_CONS *cons, SCIP_SET *set, SCIP_STAT *stat, int depth, SCIP_Bool focusnode)
SCIP_RETCODE SCIPreoptApplyCuts(SCIP_REOPT *reopt, SCIP_NODE *node, SCIP_SEPASTORE *sepastore, SCIP_CUTPOOL *cutpool, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_EVENTQUEUE *eventqueue, SCIP_EVENTFILTER *eventfilter, SCIP_LP *lp, SCIP_Bool root)
SCIP_REOPTCONSDATA ** conss
static SCIP_DECL_EVENTEXEC(eventExecReopt)
internal methods for branch and bound tree
void SCIPhistoryIncCutoffSum(SCIP_HISTORY *history, SCIP_BRANCHDIR dir, SCIP_Real weight)
SCIP_Bool SCIPisFeasLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
int SCIProwGetAge(SCIP_ROW *row)
static SCIP_RETCODE soltreeAddSol(SCIP_REOPT *reopt, SCIP_SET *set, SCIP_STAT *stat, SCIP_PRIMAL *origprimal, BMS_BLKMEM *blkmem, SCIP_VAR **vars, SCIP_SOL *sol, SCIP_SOLNODE **solnode, int nvars, SCIP_Bool bestsol, SCIP_Bool *added)
SCIP_Real pscostvariance[2]
SCIP_RETCODE SCIPcatchVarEvent(SCIP *scip, SCIP_VAR *var, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int *filterpos)
SCIP_Bool SCIPsetIsFeasEQ(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
SCIP_RETCODE SCIPvarChgLbGlobal(SCIP_VAR *var, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_CLIQUETABLE *cliquetable, SCIP_Real newbound)
SCIP_REOPTNODE * SCIPreoptGetReoptnode(SCIP_REOPT *reopt, unsigned int id)
int SCIPreoptGetNImprovingSols(SCIP_REOPT *reopt)
SCIP_Real SCIPnodeGetLowerbound(SCIP_NODE *node)
SCIP_Real SCIPvarGetLbGlobal(SCIP_VAR *var)
static SCIP_RETCODE reoptResetTree(SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_Bool softreset)
internal methods for clocks and timing issues
static SCIP_RETCODE reoptMoveIDs(SCIP_REOPTTREE *reopttree, SCIP_SET *set, BMS_BLKMEM *blkmem, unsigned int id1, unsigned int id2)
void SCIPhistoryIncInferenceSum(SCIP_HISTORY *history, SCIP_BRANCHDIR dir, SCIP_Real weight)
int SCIPreoptGetNInfNodes(SCIP_REOPT *reopt)
SCIP_Real * SCIPgetBoundsBounddisjunction(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPvarGetLbLocal(SCIP_VAR *var)
SCIP_RETCODE SCIPreoptGetLeaves(SCIP_REOPT *reopt, SCIP_NODE *node, unsigned int *leaves, int leavessize, int *nleaves)
SCIP_Bool SCIPisGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_RETCODE SCIPqueueInsert(SCIP_QUEUE *queue, void *elem)
int SCIPreoptGetNCutoffReoptnodes(SCIP_REOPT *reopt)
SCIP_NODE * SCIPnodeGetParent(SCIP_NODE *node)
void SCIPnodeGetAddedConss(SCIP_NODE *node, SCIP_CONS **addedconss, int *naddedconss, int addedconsssize)
SCIP_RETCODE SCIPreoptAddSol(SCIP_REOPT *reopt, SCIP_SET *set, SCIP_STAT *stat, SCIP_PRIMAL *origprimal, BMS_BLKMEM *blkmem, SCIP_SOL *sol, SCIP_Bool bestsol, SCIP_Bool *added, SCIP_VAR **vars, int nvars, int run)
void SCIPnodeSetReoptID(SCIP_NODE *node, unsigned int id)
SCIP_RETCODE SCIPreoptAddOptSol(SCIP_REOPT *reopt, SCIP_SOL *sol, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PRIMAL *origprimal, SCIP_VAR **vars, int nvars)
SCIP_Real SCIPsetInfinity(SCIP_SET *set)
SCIP_RETCODE SCIPreoptAddCons(SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_CONS *cons)
SCIP_BOUNDTYPE * afterdualvarboundtypes
int SCIPprobGetNVars(SCIP_PROB *prob)
int SCIProwGetNLPNonz(SCIP_ROW *row)
int SCIPreoptGetNFeasNodes(SCIP_REOPT *reopt)
static SCIP_RETCODE saveConsLinear(SCIP_REOPTCONSDATA *reoptconsdata, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_CONS *cons, SCIP_Bool *success)
SCIP_RETCODE SCIPreoptnodeDelete(SCIP_REOPTNODE **reoptnode, BMS_BLKMEM *blkmem)
static SCIP_RETCODE separateSolution(SCIP_REOPT *reopt, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_SOL *sol, SCIP_VAR **vars, int nvars)
SCIP_RETCODE SCIPhistoryCreate(SCIP_HISTORY **history, BMS_BLKMEM *blkmem)
void SCIPclockStop(SCIP_CLOCK *clck, SCIP_SET *set)
int SCIPreoptnodeGetNVars(SCIP_REOPTNODE *reoptnode)
SCIP_Longint lastseennode
SCIP_Real SCIProwGetLhs(SCIP_ROW *row)
static SCIP_DECL_EVENTEXITSOL(eventExitsolReopt)
SCIP_RETCODE SCIPhashmapCreate(SCIP_HASHMAP **hashmap, BMS_BLKMEM *blkmem, int mapsize)
const char * SCIPeventhdlrGetName(SCIP_EVENTHDLR *eventhdlr)
SCIP_HASHMAP * activeconss
void SCIPclockStart(SCIP_CLOCK *clck, SCIP_SET *set)
SCIP_RETCODE SCIPreoptApplyCompression(SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_REOPTNODE **representatives, int nrepresentatives, SCIP_Bool *success)
SCIP_Bool SCIPreoptGetSolveLP(SCIP_REOPT *reopt, SCIP_SET *set, SCIP_NODE *node)
void SCIPhistoryReset(SCIP_HISTORY *history)
SCIP_RETCODE SCIPsolCopy(SCIP_SOL **sol, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PRIMAL *primal, SCIP_SOL *sourcesol)
int SCIPsnprintf(char *t, int len, const char *s,...)
SCIP_Bool SCIPsetIsZero(SCIP_SET *set, SCIP_Real val)
enum SCIP_Retcode SCIP_RETCODE
#define SCIPsetAllocBufferArray(set, ptr, num)
#define BMSfreeBlockMemoryNull(mem, ptr)
int SCIPvarGetProbindex(SCIP_VAR *var)
SCIP_RETCODE SCIPreoptFree(SCIP_REOPT **reopt, SCIP_SET *set, SCIP_PRIMAL *origprimal, BMS_BLKMEM *blkmem)
SCIP_RETCODE SCIPreoptnodeAddCons(SCIP_REOPTNODE *reoptnode, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_VAR **vars, SCIP_Real *bounds, SCIP_BOUNDTYPE *boundtypes, SCIP_Real lhs, SCIP_Real rhs, int nvars, REOPT_CONSTYPE constype, SCIP_Bool linear)
int SCIPsetCalcMemGrowSize(SCIP_SET *set, int num)
SCIP_Real SCIPsetRound(SCIP_SET *set, SCIP_Real val)
void SCIPreoptResetSolMarks(SCIP_REOPT *reopt)
SCIP_RETCODE SCIPvarChgUbGlobal(SCIP_VAR *var, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_CLIQUETABLE *cliquetable, SCIP_Real newbound)
#define BMSallocMemoryArray(ptr, num)
SCIP_REOPTNODE ** reoptnodes
SCIP_Real SCIPvarGetAvgInferences(SCIP_VAR *var, SCIP_STAT *stat, SCIP_BRANCHDIR dir)
SCIP_Real SCIPreoptGetOldObjCoef(SCIP_REOPT *reopt, int run, int idx)
SCIP_ROW ** SCIPlpGetRows(SCIP_LP *lp)
int SCIPreoptGetNDualBndchgs(SCIP_REOPT *reopt, SCIP_NODE *node)
static SCIP_RETCODE dryBranch(SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_Bool *runagain, unsigned int id)
#define DEFAULT_MEM_DUALCONS
static SCIP_RETCODE checkMemDualCons(SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, int size)
static SCIP_RETCODE soltreefreeNode(SCIP_REOPT *reopt, SCIP_SET *set, SCIP_PRIMAL *primal, BMS_BLKMEM *blkmem, SCIP_SOLNODE **solnode)
SCIP_Real SCIPlpGetCutoffbound(SCIP_LP *lp)
SCIP_Bool SCIPreoptConsCanBeDeleted(SCIP_REOPT *reopt, SCIP_CONS *cons)
SCIP_RETCODE SCIProwCreate(SCIP_ROW **row, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_LP *lp, const char *name, int len, SCIP_COL **cols, SCIP_Real *vals, SCIP_Real lhs, SCIP_Real rhs, SCIP_ROWORIGINTYPE origintype, void *origin, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool removable)
static void soltreeResetMarks(SCIP_SOLNODE *node)
static SCIP_RETCODE reopttreeCheckMemory(SCIP_REOPTTREE *reopttree, SCIP_SET *set, BMS_BLKMEM *blkmem)
void SCIPsortDownRealInt(SCIP_Real *realarray, int *intarray, int len)
static SCIP_RETCODE reoptGetLeaves(SCIP_REOPT *reopt, unsigned int id, unsigned int *leaves, int leavessize, int *nleaves)
SCIP_Bool SCIPisEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPsetIsNegative(SCIP_SET *set, SCIP_Real val)
int SCIPnodeGetDepth(SCIP_NODE *node)
SCIP_ROWORIGINTYPE SCIProwGetOrigintype(SCIP_ROW *row)
static void deleteLastDualBndchgs(SCIP_REOPT *reopt)
#define SCIPfreeBufferArray(scip, ptr)
#define SCIPsetFreeBufferArray(set, ptr)
SCIP_Bool SCIPqueueIsEmpty(SCIP_QUEUE *queue)
enum SCIP_LPSolStat SCIP_LPSOLSTAT
#define BMSfreeMemory(ptr)
Constraint handler for the set partitioning / packing / covering constraints .
void SCIPvarAdjustLb(SCIP_VAR *var, SCIP_SET *set, SCIP_Real *lb)
#define SCIPdebugPrintCons(x, y, z)
SCIP_Real SCIPhistoryGetAvgCutoffs(SCIP_HISTORY *history, SCIP_BRANCHDIR dir)
int SCIPreoptGetLastRestarts(SCIP_REOPT *reopt)
SCIP_LPSOLSTAT SCIPlpGetSolstat(SCIP_LP *lp)
SCIP_Real SCIPhashmapGetImageReal(SCIP_HASHMAP *hashmap, void *origin)
SCIP_Real SCIPgetRhsLinear(SCIP *scip, SCIP_CONS *cons)
internal methods for LP management
SCIP_Bool SCIPconsIsActive(SCIP_CONS *cons)
SCIP_Real pscostweightedmean[2]
static SCIP_RETCODE updateConstraintPropagation(SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_NODE *node, unsigned int id, SCIP_Bool *transintoorig)
void SCIPnodeGetAncestorBranchings(SCIP_NODE *node, SCIP_VAR **branchvars, SCIP_Real *branchbounds, SCIP_BOUNDTYPE *boundtypes, int *nbranchvars, int branchvarssize)
internal methods for branching and inference history
internal methods for collecting primal CIP solutions and primal informations
SCIP_Real SCIPsolGetVal(SCIP_SOL *sol, SCIP_SET *set, SCIP_STAT *stat, SCIP_VAR *var)
static SCIP_RETCODE storeCuts(SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_LP *lp, unsigned int id)
static SCIP_RETCODE reoptnodeDelete(SCIP_REOPTNODE **reoptnode, BMS_BLKMEM *blkmem)
SCIP_RETCODE SCIPreoptResetActiveConss(SCIP_REOPT *reopt, SCIP_SET *set, SCIP_STAT *stat)
static SCIP_RETCODE freeReoptTree(SCIP_REOPTTREE *reopttree, SCIP_SET *set, BMS_BLKMEM *blkmem)
void SCIPreoptnodeGetConss(SCIP_REOPTNODE *reoptnode, SCIP_VAR ***vars, SCIP_Real **bounds, SCIP_BOUNDTYPE **boundtypes, int mem, int *nconss, int *nvars)
SCIP_Bool SCIPsetIsGE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
int SCIPreoptGetNNodes(SCIP_REOPT *reopt, SCIP_NODE *node)
#define SCIP_EVENTTYPE_NODEFEASIBLE
SCIP_Bool SCIPhashmapExists(SCIP_HASHMAP *hashmap, void *origin)
#define SCIP_EVENTTYPE_NODEBRANCHED
void SCIPqueueClear(SCIP_QUEUE *queue)
SCIP_RETCODE SCIPcreateConsBasicBounddisjunction(SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars, SCIP_BOUNDTYPE *boundtypes, SCIP_Real *bounds)
SCIP_Real SCIPreoptGetSimilarity(SCIP_REOPT *reopt, SCIP_SET *set, int run1, int run2, SCIP_VAR **origvars, int norigvars)
static SCIP_RETCODE ensureSolsSize(SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, int num, int runidx)
enum SCIP_BranchDir SCIP_BRANCHDIR
SCIP_Longint SCIPnodeGetNumber(SCIP_NODE *node)
SCIP_BOUNDTYPE * varboundtypes
SCIP_RETCODE SCIPvarChgLbLocal(SCIP_VAR *var, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_Real newbound)
SCIP_Real SCIPvarGetUbGlobal(SCIP_VAR *var)
static SCIP_RETCODE freeSolTree(SCIP_REOPT *reopt, SCIP_SET *set, SCIP_PRIMAL *origprimal, BMS_BLKMEM *blkmem)
SCIP_Bool SCIPsetIsLT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
SCIP_REOPTTYPE SCIPnodeGetReopttype(SCIP_NODE *node)
SCIP_RETCODE SCIPreoptGetSolsRun(SCIP_REOPT *reopt, int run, SCIP_SOL **sols, int solssize, int *nsols)
SCIP_RETCODE SCIPaddReoptDualBndchg(SCIP *scip, SCIP_NODE *node, SCIP_VAR *var, SCIP_Real newbound, SCIP_Real oldbound)
int SCIPreoptGetNRestartsGlobal(SCIP_REOPT *reopt)
SCIP_Real SCIPeventGetNewbound(SCIP_EVENT *event)
int SCIPreoptGetFirstRestarts(SCIP_REOPT *reopt)
#define BMSduplicateBlockMemoryArray(mem, ptr, source, num)
const char * SCIPheurGetName(SCIP_HEUR *heur)
int SCIPqueueNElems(SCIP_QUEUE *queue)
int SCIPreoptGetNTotalCutoffReoptnodes(SCIP_REOPT *reopt)
int SCIPreoptnodeGetNChildren(SCIP_REOPTNODE *reoptnode)
#define BMSfreeMemoryArray(ptr)
SCIP_VAR ** SCIPgetVarsBounddisjunction(SCIP *scip, SCIP_CONS *cons)
internal methods for storing and manipulating the main problem
static SCIP_RETCODE reoptRestart(SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem)
const char * SCIPconshdlrGetName(SCIP_CONSHDLR *conshdlr)
SCIP_RETCODE SCIPaddCons(SCIP *scip, SCIP_CONS *cons)
int SCIPreoptGetNSols(SCIP_REOPT *reopt)
int SCIPhashmapGetNEntries(SCIP_HASHMAP *hashmap)
static SCIP_RETCODE addNode(SCIP_REOPT *reopt, SCIP_SET *set, SCIP_LP *lp, BMS_BLKMEM *blkmem, SCIP_NODE *node, SCIP_REOPTTYPE reopttype, SCIP_Bool saveafterdual, SCIP_Bool isrootnode, SCIP_Real lowerbound)
SCIP_HASHMAPENTRY * SCIPhashmapGetEntry(SCIP_HASHMAP *hashmap, int entryidx)
static SCIP_RETCODE clearReoptnodes(SCIP_REOPTTREE *reopttree, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_Bool softreset)
void SCIPnodeGetNDomchg(SCIP_NODE *node, int *nbranchings, int *nconsprop, int *nprop)
methods for block memory pools and memory buffers
static SCIP_RETCODE saveAncestorBranchings(SCIP_REOPTTREE *reopttree, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_NODE *node, SCIP_NODE *parent, unsigned int id, unsigned int parentid)
Constraint handler for logicor constraints (equivalent to set covering, but algorithms are suited fo...
static SCIP_RETCODE deleteChildrenBelow(SCIP_REOPTTREE *reopttree, SCIP_SET *set, BMS_BLKMEM *blkmem, unsigned int id, SCIP_Bool delnodeitself, SCIP_Bool exitsolve)
static SCIP_RETCODE createReoptnode(SCIP_REOPTTREE *reopttree, SCIP_SET *set, BMS_BLKMEM *blkmem, unsigned int id)
SCIP_Bool SCIPvarIsTransformedOrigvar(SCIP_VAR *var)
static SCIP_RETCODE transformDualredsToBounddisjunction(SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_REOPTCONSDATA *consdata, SCIP_REOPTCONSDATA *dualreds)
SCIP_Bool SCIPisReoptEnabled(SCIP *scip)
static int reoptGetNLeaves(SCIP_REOPT *reopt, unsigned int id)
const char * SCIPconsGetName(SCIP_CONS *cons)
SCIP_RETCODE SCIPreoptCreate(SCIP_REOPT **reopt, SCIP_SET *set, BMS_BLKMEM *blkmem)
SCIP_VAR ** SCIPgetVarsLogicor(SCIP *scip, SCIP_CONS *cons)
const char * SCIPvarGetName(SCIP_VAR *var)
SCIP_Real SCIPclockGetTime(SCIP_CLOCK *clck)
void SCIPhashmapFree(SCIP_HASHMAP **hashmap)
int SCIPreoptGetNTotalInfNodes(SCIP_REOPT *reopt)
void SCIPnodeGetAncestorBranchingsPart(SCIP_NODE *node, SCIP_NODE *parent, SCIP_VAR **branchvars, SCIP_Real *branchbounds, SCIP_BOUNDTYPE *boundtypes, int *nbranchvars, int branchvarssize)
void SCIPhistoryUnite(SCIP_HISTORY *history, SCIP_HISTORY *addhistory, SCIP_Bool switcheddirs)
#define SCIPsetReallocBufferArray(set, ptr, num)
#define BMSallocClearBlockMemoryArray(mem, ptr, num)
internal miscellaneous methods
enum SCIP_ReoptType SCIP_REOPTTYPE
SCIP_HEUR * SCIPsolGetHeur(SCIP_SOL *sol)
void SCIPrandomFree(SCIP_RANDNUMGEN **randnumgen, BMS_BLKMEM *blkmem)
static SCIP_RETCODE saveAfterDualBranchings(SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_NODE *node, unsigned int id, SCIP_Bool *transintoorig)
SCIP_REOPTCONSDATA * dualreds
static SCIP_RETCODE fixBounds(SCIP_REOPT *reopt, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_TREE *tree, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_CLIQUETABLE *cliquetable, BMS_BLKMEM *blkmem, SCIP_NODE *node, unsigned int id, SCIP_Bool updatedualconss)
static SCIP_RETCODE changeAncestorBranchings(SCIP_REOPT *reopt, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_TREE *tree, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_CLIQUETABLE *cliquetable, BMS_BLKMEM *blkmem, SCIP_NODE *node, unsigned int id, SCIP_Bool afterdualintobranching)
int SCIPgetEffectiveRootDepth(SCIP *scip)
void SCIPreoptnodeInit(SCIP_REOPTNODE *reoptnode, SCIP_SET *set)
static SCIP_RETCODE changeReopttypeOfSubtree(SCIP_REOPTTREE *reopttree, unsigned int id, SCIP_REOPTTYPE reopttype)
internal methods for global SCIP settings
static SCIP_RETCODE transformIntoOrig(SCIP_REOPT *reopt, unsigned int id)
SCIP_Bool SCIPsetIsFeasGE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisFeasGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
int SCIPlpGetNRows(SCIP_LP *lp)
SCIP_RETCODE SCIPreoptResetDualBndchgs(SCIP_REOPT *reopt, SCIP_NODE *node, BMS_BLKMEM *blkmem)
static SCIP_RETCODE reoptnodeReset(SCIP_REOPTNODE *reoptnode, SCIP_SET *set, BMS_BLKMEM *blkmem)
void SCIPreoptnodeGetPath(SCIP_REOPT *reopt, SCIP_REOPTNODE *reoptnode, SCIP_VAR **vars, SCIP_Real *vals, SCIP_BOUNDTYPE *boundtypes, int varssize, int *nbndchgs, int *nbndchgsafterdual)
SCIP_Real SCIProwGetRhs(SCIP_ROW *row)
void SCIPverbMessage(SCIP *scip, SCIP_VERBLEVEL msgverblevel, FILE *file, const char *formatstr,...)
static SCIP_RETCODE saveLocalConssData(SCIP_REOPTTREE *reopttree, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_NODE *node, unsigned int id)
SCIP_Bool SCIPsetIsEQ(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
void SCIPqueueFree(SCIP_QUEUE **queue)
SCIP_RETCODE SCIPvarChgUbLocal(SCIP_VAR *var, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_Real newbound)
internal methods for storing separated cuts
#define DEFAULT_MEM_VARAFTERDUAL
SCIP_BOUNDTYPE * SCIPgetBoundtypesBounddisjunction(SCIP *scip, SCIP_CONS *cons)
SCIP_Bool SCIPsetIsFeasLE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
SCIP_COL ** SCIProwGetCols(SCIP_ROW *row)
SCIP_RETCODE SCIPhashmapInsertReal(SCIP_HASHMAP *hashmap, void *origin, SCIP_Real image)
SCIP_RETCODE SCIProwRelease(SCIP_ROW **row, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_LP *lp)
SCIP_RETCODE SCIPclockCreate(SCIP_CLOCK **clck, SCIP_CLOCKTYPE clocktype)
SCIP_RETCODE SCIPaddConsNode(SCIP *scip, SCIP_NODE *node, SCIP_CONS *cons, SCIP_NODE *validnode)
#define BMSfreeBlockMemory(mem, ptr)
int SCIPreoptGetNAddedConss(SCIP_REOPT *reopt, SCIP_NODE *node)
data structures and methods for collecting reoptimization information
internal methods for problem variables
SCIP_Bool SCIPvarIsOriginal(SCIP_VAR *var)
void SCIPnodeSetEstimate(SCIP_NODE *node, SCIP_SET *set, SCIP_Real newestimate)
int SCIPnodeGetNDualBndchgs(SCIP_NODE *node)
SCIP_RETCODE SCIPreoptInstallBounds(SCIP_REOPT *reopt, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_CLIQUETABLE *cliquetable, BMS_BLKMEM *blkmem)
SCIP_RETCODE SCIPreoptSaveOpenNodes(SCIP_REOPT *reopt, SCIP_SET *set, SCIP_LP *lp, BMS_BLKMEM *blkmem, SCIP_NODE **leaves, int nleaves, SCIP_NODE **childs, int nchilds, SCIP_NODE **siblings, int nsiblings)
#define SCIPallocBufferArray(scip, ptr, num)
SCIP_Bool SCIPsetIsIntegral(SCIP_SET *set, SCIP_Real val)
SCIP_Real * SCIProwGetVals(SCIP_ROW *row)
SCIP_REOPTCONSDATA * dualredscur
static SCIP_RETCODE reoptCheckLocalRestart(SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_NODE *node, SCIP_VAR **transvars, int ntransvars, SCIP_Bool *localrestart)
SCIP_RETCODE SCIPconsGetNVars(SCIP_CONS *cons, SCIP_SET *set, int *nvars, SCIP_Bool *success)
static SCIP_RETCODE fixInterdiction(SCIP_REOPT *reopt, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_TREE *tree, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_CLIQUETABLE *cliquetable, BMS_BLKMEM *blkmem, SCIP_NODE *node, unsigned int id, int *perm, SCIP_VAR **vars, SCIP_Real *vals, SCIP_BOUNDTYPE *boundtypes, int nvars, int negbndchg)
SCIP_VAR * SCIPeventGetVar(SCIP_EVENT *event)
SCIP_REOPTTREE * reopttree
SCIP_SOL * SCIPreoptGetLastBestSol(SCIP_REOPT *reopt)
SCIP_RETCODE SCIPreoptGetChildIDs(SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_NODE *node, unsigned int *childs, int childssize, int *nchilds)
void SCIPreoptAddNImprovingSols(SCIP_REOPT *reopt, int nimprovingsols)
SCIP_RETCODE SCIPreoptCheckCutoff(SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_NODE *node, SCIP_EVENTTYPE eventtype, SCIP_LP *lp, SCIP_LPSOLSTAT lpsolstat, SCIP_Bool isrootnode, SCIP_Bool isfocusnode, SCIP_Real lowerbound, int effectiverootdepth)
#define BMSallocBlockMemoryArray(mem, ptr, num)
static SCIP_RETCODE getLastSavedNode(SCIP_REOPT *reopt, SCIP_SET *set, SCIP_NODE *node, SCIP_NODE **parent, unsigned int *parentid, int *nbndchgs)
SCIP_RETCODE SCIPreoptCheckRestart(SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_NODE *node, SCIP_VAR **transvars, int ntransvars, SCIP_Bool *restart)
static SCIP_RETCODE addLocalConss(SCIP *scip, SCIP_REOPT *reopt, SCIP_SET *set, SCIP_STAT *stat, BMS_BLKMEM *blkmem, SCIP_NODE *node, unsigned int id)
SCIP_VAR ** afterdualvars
SCIP_RETCODE SCIPconsRelease(SCIP_CONS **cons, BMS_BLKMEM *blkmem, SCIP_SET *set)
SCIP_SETPPCTYPE SCIPgetTypeSetppc(SCIP *scip, SCIP_CONS *cons)
void SCIPclockFree(SCIP_CLOCK **clck)
static SCIP_RETCODE solnodeAddChild(SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_SOLNODE *curnode, SCIP_SOLNODE **child, SCIP_VAR *var, SCIP_Real val, SCIP_Bool *added)
static SCIP_RETCODE getInferenceOrder(SCIP_SET *set, SCIP_STAT *stat, int *perm, SCIP_VAR **vars, SCIP_Real *bounds, SCIP_BOUNDTYPE *boundtypes, int nvars)
SCIP_RETCODE SCIPsetGetIntParam(SCIP_SET *set, const char *name, int *value)
#define BMSfreeBlockMemoryArray(mem, ptr, num)
void SCIPreoptnodeSetParentID(SCIP_REOPTNODE *reoptnode, unsigned int parentid)
void SCIPrandomPermuteIntArray(SCIP_RANDNUMGEN *randnumgen, int *array, int begin, int end)
static SCIP_RETCODE createReopttree(SCIP_REOPTTREE *reopttree, SCIP_SET *set, BMS_BLKMEM *blkmem)
static SCIP_RETCODE createSolTree(SCIP_SOLTREE *soltree, BMS_BLKMEM *blkmem)
SCIP_CONSHDLR * SCIPconsGetHdlr(SCIP_CONS *cons)
SCIP_Bool SCIPconsIsDeleted(SCIP_CONS *cons)
#define SCIP_EVENTTYPE_NODEINFEASIBLE
static SCIP_RETCODE reoptnodeCheckMemory(SCIP_REOPTNODE *reoptnode, SCIP_SET *set, BMS_BLKMEM *blkmem, int var_mem, int child_mem, int conss_mem)
SCIP_Real SCIPvarGetObj(SCIP_VAR *var)
SCIP_RETCODE SCIPdropVarEvent(SCIP *scip, SCIP_VAR *var, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int filterpos)
static SCIP_RETCODE ensureRunSize(SCIP_REOPT *reopt, SCIP_SET *set, int num, BMS_BLKMEM *blkmem)
static SCIP_RETCODE addSplitcons(SCIP_REOPT *reopt, SCIP *scip, SCIP_SET *set, SCIP_STAT *stat, BMS_BLKMEM *blkmem, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_TREE *tree, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_CLIQUETABLE *cliquetable, SCIP_NODE *node, unsigned int id)
int SCIPreoptGetNSolsRun(SCIP_REOPT *reopt, int run)
unsigned int reoptnodessize
SCIP_REOPTTYPE SCIPreoptnodeGetType(SCIP_REOPTNODE *reoptnode)
SCIP_COL * SCIPvarGetCol(SCIP_VAR *var)
void SCIPnodeGetBdChgsAfterDual(SCIP_NODE *node, SCIP_VAR **vars, SCIP_Real *varbounds, SCIP_BOUNDTYPE *varboundtypes, int start, int *nbranchvars, int branchvarssize)
SCIP_RETCODE SCIPreoptnodeAddBndchg(SCIP_REOPTNODE *reoptnode, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_VAR *var, SCIP_Real val, SCIP_BOUNDTYPE boundtype)
reoptsols primal heuristic
internal methods for storing cuts in a cut pool
Constraint handler for linear constraints in their most general form, .
SCIP_RETCODE SCIPcreateConsLogicor(SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars, 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)
#define SCIP_EVENTTYPE_GBDCHANGED
SCIP_RETCODE SCIPvarGetOrigvarSum(SCIP_VAR **var, SCIP_Real *scalar, SCIP_Real *constant)
SCIP_Bool SCIPsetIsFeasLT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
SCIP_RANDNUMGEN * randnumgen
int ntotalcutoffreoptnodes
SCIP_REOPTCONSDATA ** glbconss
SCIP_Bool SCIPprobIsTransformed(SCIP_PROB *prob)
SCIP_RETCODE SCIPreoptDeleteNode(SCIP_REOPT *reopt, SCIP_SET *set, unsigned int id, BMS_BLKMEM *blkmem)
#define BMSallocClearMemoryArray(ptr, num)
SCIP_VAR ** SCIPgetVarsSetppc(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPvarGetProbvarBound(SCIP_VAR **var, SCIP_Real *bound, SCIP_BOUNDTYPE *boundtype)
static SCIP_RETCODE moveChildrenUp(SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, unsigned int nodeid, unsigned int parentid)
int SCIPgetNVars(SCIP *scip)
int SCIPreoptGetNRestartsLocal(SCIP_REOPT *reopt)
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_RETCODE saveGlobalCons(SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_NODE *node, REOPT_CONSTYPE consttype)
static int reopttreeGetNNodes(SCIP_REOPTTREE *reopttree, unsigned int id)
SCIP_Real SCIProwGetConstant(SCIP_ROW *row)
int SCIPnodeGetNAddedConss(SCIP_NODE *node)
static SCIP_RETCODE saveConsBounddisjuction(SCIP_REOPTCONSDATA *reoptconsdata, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_CONS *cons, SCIP_Bool *success)
SCIP_Real SCIPreoptnodeGetLowerbound(SCIP_REOPTNODE *reoptnode)
static SCIP_RETCODE reoptAddChild(SCIP_REOPTTREE *reopttree, SCIP_SET *set, BMS_BLKMEM *blkmem, unsigned int parentid, unsigned int childid)
void SCIPconsCapture(SCIP_CONS *cons)
SCIP_RETCODE SCIPqueueCreate(SCIP_QUEUE **queue, int initsize, SCIP_Real sizefac)
SCIP_VAR * SCIPcolGetVar(SCIP_COL *col)
void SCIPreoptAddNCheckedSols(SCIP_REOPT *reopt, int ncheckedsols)
static SCIP_RETCODE reoptnodeResetDualConss(SCIP_REOPTNODE *reoptnode, BMS_BLKMEM *blkmem)
SCIP_VAR ** SCIPgetVarsLinear(SCIP *scip, SCIP_CONS *cons)
SCIP_NODE * SCIPtreeGetRootNode(SCIP_TREE *tree)
SCIP_RETCODE SCIPreoptAddInfNode(SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_NODE *node)
static SCIP_RETCODE transformDualredsToLinear(SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_REOPTCONSDATA *consdata, SCIP_REOPTCONSDATA *dualreds)
unsigned int SCIPnodeGetReoptID(SCIP_NODE *node)
SCIP_RETCODE SCIPnodeAddBoundchg(SCIP_NODE *node, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_TREE *tree, SCIP_REOPT *reopt, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_CLIQUETABLE *cliquetable, SCIP_VAR *var, SCIP_Real newbound, SCIP_BOUNDTYPE boundtype, SCIP_Bool probingchange)
static SCIP_Real reoptSimilarity(SCIP_REOPT *reopt, SCIP_SET *set, int obj1_id, int obj2_id, SCIP_VAR **vars, int nvars)
static SCIP_RETCODE reopttreeDeleteNode(SCIP_REOPTTREE *reopttree, SCIP_SET *set, BMS_BLKMEM *blkmem, unsigned int id, SCIP_Bool softreset)
#define SCIP_EVENTTYPE_FORMAT
SCIP_RETCODE SCIPreoptUpdateVarHistory(SCIP_REOPT *reopt, SCIP_SET *set, SCIP_STAT *stat, BMS_BLKMEM *blkmem, SCIP_VAR **vars, int nvars)
SCIP_RETCODE SCIPreleaseCons(SCIP *scip, SCIP_CONS **cons)
static SCIP_RETCODE reoptSaveNewObj(SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_VAR **origvars, int norigvars)
SCIP_RETCODE SCIPreoptnodeReset(SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_REOPTNODE *reoptnode)
SCIP_Real SCIPeventGetOldbound(SCIP_EVENT *event)
static SCIP_DECL_EVENTINITSOL(eventInitsolReopt)
SCIP_Bool SCIPsetIsGT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
SCIP_VAR ** SCIPgetVars(SCIP *scip)
SCIP_VARSTATUS SCIPvarGetStatus(SCIP_VAR *var)
int SCIProwGetLPPos(SCIP_ROW *row)
static SCIP_RETCODE addGlobalCut(SCIP_REOPT *reopt, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_VAR **vars, SCIP_Real *vals, SCIP_BOUNDTYPE *boundtypes, int nvars, int nbinvars, int nintvars)
SCIP_NODETYPE SCIPnodeGetType(SCIP_NODE *node)
static SCIP_RETCODE collectDualInformation(SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_NODE *node, unsigned int id, SCIP_REOPTTYPE reopttype)
SCIP_BRANCHRULE * SCIPsetFindBranchrule(SCIP_SET *set, const char *name)
int SCIPreoptnodeGetNDualBoundChgs(SCIP_REOPTNODE *reoptnode)
SCIP_RETCODE SCIPrandomCreate(SCIP_RANDNUMGEN **randnumgen, BMS_BLKMEM *blkmem, unsigned int initialseed)
SCIP_VAR ** SCIPprobGetVars(SCIP_PROB *prob)
#define BMSallocMemory(ptr)
SCIP_Real * afterdualvarbounds
#define BMSreallocMemoryArray(ptr, num)
internal methods for constraints and constraint handlers
int SCIPreoptGetNTotalPrunedNodes(SCIP_REOPT *reopt)
SCIP_RETCODE SCIPcutpoolAddRow(SCIP_CUTPOOL *cutpool, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_LP *lp, SCIP_ROW *row)
int SCIPreoptGetNTotalFeasNodes(SCIP_REOPT *reopt)
int SCIPvarGetIndex(SCIP_VAR *var)
SCIP_RETCODE SCIPreoptSaveActiveConss(SCIP_REOPT *reopt, SCIP_PROB *transprob, BMS_BLKMEM *blkmem)
SCIP_VARTYPE SCIPvarGetType(SCIP_VAR *var)
void * SCIPqueueRemove(SCIP_QUEUE *queue)
void SCIPnodeSetReopttype(SCIP_NODE *node, SCIP_REOPTTYPE reopttype)
int SCIPsetInitializeRandomSeed(SCIP_SET *set, int initialseedvalue)
SCIP_Real SCIPreoptGetSimToFirst(SCIP_REOPT *reopt)
SCIP_RETCODE SCIPcreateConsBounddisjunction(SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars, SCIP_BOUNDTYPE *boundtypes, SCIP_Real *bounds, 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_Real SCIPhistoryGetAvgInferences(SCIP_HISTORY *history, SCIP_BRANCHDIR dir)
SCIP_Real * SCIPgetValsLinear(SCIP *scip, SCIP_CONS *cons)
SCIP_Bool SCIPisLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
int SCIPreoptGetNPrunedNodes(SCIP_REOPT *reopt)
enum Reopt_ConsType REOPT_CONSTYPE
int SCIPreoptGetNSavedSols(SCIP_REOPT *reopt)
SCIP_Real SCIPvarGetUbLocal(SCIP_VAR *var)
void SCIPvarAdjustUb(SCIP_VAR *var, SCIP_SET *set, SCIP_Real *ub)
SCIP_HISTORY *** varhistory
SCIP_Bool SCIPvarIsTransformed(SCIP_VAR *var)
SCIP_RETCODE SCIPreoptReset(SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem)
#define BMSallocBlockMemory(mem, ptr)
SCIP_RETCODE SCIPconsDeactivate(SCIP_CONS *cons, SCIP_SET *set, SCIP_STAT *stat)
SCIP_REOPTCONSDATA * dualredsnex
SCIP_RETCODE SCIPhashmapInsert(SCIP_HASHMAP *hashmap, void *origin, void *image)
#define BMSclearMemoryArray(ptr, num)
common defines and data types used in all packages of SCIP
SCIP_RETCODE SCIPreoptSaveGlobalBounds(SCIP_REOPT *reopt, SCIP_PROB *transprob, BMS_BLKMEM *blkmem)
int SCIPreoptGetNTotalRestartsLocal(SCIP_REOPT *reopt)
struct BMS_BlkMem BMS_BLKMEM
static SCIP_RETCODE shrinkNode(SCIP_REOPT *reopt, SCIP_SET *set, SCIP_NODE *node, unsigned int id, SCIP_Bool *shrank, BMS_BLKMEM *blkmem)
constraint handler for bound disjunction constraints
SCIP_VAR * SCIPvarGetTransVar(SCIP_VAR *var)
SCIP_Real SCIPreoptGetSavingtime(SCIP_REOPT *reopt)
SCIP_Longint lastbranched
static SCIP_RETCODE reoptnodeUpdateDualConss(SCIP_REOPTNODE *reoptnode, BMS_BLKMEM *blkmem)
SCIP_SOL * SCIPreoptGetBestSolRun(SCIP_REOPT *reopt, int run)
void SCIPnodeGetConsProps(SCIP_NODE *node, SCIP_VAR **vars, SCIP_Real *varbounds, SCIP_BOUNDTYPE *varboundtypes, int *nconspropvars, int conspropvarssize)
#define BMSreallocBlockMemoryArray(mem, ptr, oldnum, newnum)
SCIP_RETCODE SCIPreoptMergeVarHistory(SCIP_REOPT *reopt, SCIP_SET *set, SCIP_STAT *stat, SCIP_VAR **vars, int nvars)
SCIP_Real SCIPgetLhsLinear(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPvarNegate(SCIP_VAR *var, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_VAR **negvar)
SCIP_RETCODE SCIPsepastoreAddCut(SCIP_SEPASTORE *sepastore, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_EVENTQUEUE *eventqueue, SCIP_EVENTFILTER *eventfilter, SCIP_LP *lp, SCIP_ROW *cut, SCIP_Bool forcecut, SCIP_Bool root, SCIP_Bool *infeasible)
int SCIPreoptGetNCheckedSols(SCIP_REOPT *reopt)
SCIP_Bool SCIPvarIsActive(SCIP_VAR *var)
static SCIP_RETCODE checkMemGlbCons(SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, int mem)
SCIP_Bool SCIPvarIsNegated(SCIP_VAR *var)
SCIP_RETCODE SCIPsolFree(SCIP_SOL **sol, BMS_BLKMEM *blkmem, SCIP_PRIMAL *primal)
int SCIPreoptnodeGetNConss(SCIP_REOPTNODE *reoptnode)
SCIP_RETCODE SCIPreoptAddRun(SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_VAR **origvars, int norigvars, int size)
memory allocation routines