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 );
109 assert(eventhdlr !=
NULL);
135 assert(eventhdlr !=
NULL);
170 assert(runidx <= reopt->runsize);
179 assert(num <= reopt->soltree->solssize[runidx]);
204 for(s = reopt->
runsize; s < newsize; s++)
216 assert(num < reopt->runsize);
229 assert(reopttree !=
NULL);
230 assert(blkmem !=
NULL);
242 for(
id = reopttree->
reoptnodessize;
id < (
unsigned int)newsize;
id++ )
267 assert(reoptnode !=
NULL);
268 assert(blkmem !=
NULL);
269 assert(var_mem >= 0);
270 assert(child_mem >= 0);
271 assert(conss_mem >= 0);
283 else if( reoptnode->
varssize < var_mem )
319 else if( reoptnode->
consssize < conss_mem )
343 assert(solnode !=
NULL);
351 sibling = solnode->
child;
354 while( sibling !=
NULL )
379 assert(reopt !=
NULL);
380 assert(vars !=
NULL);
388 for( v = 0; v < nvars; v++ )
415 assert(transvar !=
NULL);
425 assert(0 <= probidx && probidx < reopt->nobjvars);
427 c1 = reopt->
objs[obj1_id][probidx];
428 c2 = reopt->
objs[obj2_id][probidx];
432 norm_obj1 += SQR(c1);
433 norm_obj2 += SQR(c2);
438 norm_obj1 = SQRT(norm_obj1);
439 norm_obj2 = SQRT(norm_obj2);
442 similarity /= (norm_obj1 * norm_obj2);
445 similarity =
MAX(similarity, -1.0);
446 similarity =
MIN(similarity, 1.0);
458 assert((*reoptnode) !=
NULL );
459 assert(blkmem !=
NULL );
462 if( (*reoptnode)->consssize > 0 )
466 assert((*reoptnode)->conss !=
NULL);
468 for( c = 0; c < (*reoptnode)->nconss; c++ )
470 assert((*reoptnode)->conss[c] !=
NULL);
471 assert((*reoptnode)->conss[c]->vals !=
NULL);
472 assert((*reoptnode)->conss[c]->vars !=
NULL);
480 (*reoptnode)->nconss = 0;
481 (*reoptnode)->consssize = 0;
482 (*reoptnode)->conss =
NULL;
486 if( (*reoptnode)->childids !=
NULL )
489 (*reoptnode)->nchilds = 0;
490 (*reoptnode)->allocchildmem = 0;
491 (*reoptnode)->childids =
NULL;
495 if( (*reoptnode)->dualredscur !=
NULL )
497 assert((*reoptnode)->dualredscur->varssize > 0);
502 (*reoptnode)->dualredscur =
NULL;
506 if( (*reoptnode)->dualredsnex !=
NULL )
508 assert((*reoptnode)->dualredsnex->varssize > 0);
513 (*reoptnode)->dualredsnex =
NULL;
517 if ((*reoptnode)->varboundtypes !=
NULL )
519 assert((*reoptnode)->varssize > 0);
521 (*reoptnode)->varboundtypes =
NULL;
525 if ((*reoptnode)->varbounds !=
NULL )
527 assert((*reoptnode)->varssize > 0);
529 (*reoptnode)->varbounds =
NULL;
533 if ((*reoptnode)->vars !=
NULL )
535 assert((*reoptnode)->varssize > 0);
537 (*reoptnode)->vars =
NULL;
540 (*reoptnode)->varssize = 0;
543 if ((*reoptnode)->afterdualvarboundtypes !=
NULL )
545 assert((*reoptnode)->afterdualvarssize > 0);
547 (*reoptnode)->afterdualvarboundtypes =
NULL;
551 if ((*reoptnode)->afterdualvarbounds !=
NULL )
553 assert((*reoptnode)->afterdualvarssize > 0);
555 (*reoptnode)->afterdualvarbounds =
NULL;
559 if ((*reoptnode)->afterdualvars !=
NULL )
561 assert((*reoptnode)->afterdualvarssize > 0);
563 (*reoptnode)->afterdualvars =
NULL;
566 (*reoptnode)->afterdualvarssize = 0;
582 assert(reoptnode !=
NULL);
584 assert(blkmem !=
NULL);
587 if( reoptnode->
nconss > 0 )
594 for( c = 0; c < reoptnode->
nconss; c++ )
596 if( !reoptnode->
conss[c]->linear )
598 assert(reoptnode->
conss[c]->boundtypes !=
NULL);
643 reoptnode->
nvars = 0;
662 assert(reopttree !=
NULL );
663 assert(id < reopttree->reoptnodessize);
693 assert(soltree !=
NULL);
701 soltree->
nsols[s] = 0;
731 assert(reopt !=
NULL);
734 assert(solnode !=
NULL);
735 assert(blkmem !=
NULL);
737 child = (*solnode)->
child;
740 while( child !=
NULL )
743 assert(child !=
NULL);
750 if( (*solnode)->sol !=
NULL )
769 assert(reopt !=
NULL);
773 assert(blkmem !=
NULL);
803 assert(blkmem !=
NULL);
804 assert(curnode !=
NULL);
805 assert(child !=
NULL && *child ==
NULL);
809 *child = curnode->
child;
819 solnode->
father = curnode;
822 solnode->
value = val;
831 curnode->
child = *child;
833 #ifdef SCIP_MORE_DEBUG 834 SCIPsetDebugMsg(
set,
"-> create new node %p: value=%g, sibling=%p\n", (
void*) solnode, solnode->
value,
835 (
void*) solnode->sibling);
841 while( *child !=
NULL )
843 #ifdef SCIP_MORE_DEBUG 844 SCIPsetDebugMsg(
set,
"-> check %p: father=%p, value=%g, sibling=%p\n", (
void*) *child, (
void*) (*child)->
father,
845 (*child)->
value, (
void*) (*child)->sibling);
852 if( (*child)->sibling ==
NULL )
858 solnode->
father = curnode;
860 solnode->
value = val;
872 (*child)->sibling = solnode;
874 #ifdef SCIP_MORE_DEBUG 875 SCIPsetDebugMsg(
set,
"-> create new node %p: value=%g, sibling=%p\n", (
void*) solnode, solnode->
value,
876 (
void*) solnode->sibling);
883 #ifdef SCIP_MORE_DEBUG 885 SCIPsetDebugMsg(
set,
" before switching: node %p witch child=%p, sibling=%p, sol=%p, value=%g\n",
886 (
void*) (*child), (
void*) (*child)->child, (
void*) (*child)->sibling, (
void*) (*child)->sol,
888 SCIPsetDebugMsg(
set,
" node %p witch child=%p, sibling=%p, sol=%p, value=%g\n",
889 (
void*) solnode, (
void*) solnode->child, (
void*) solnode->sibling, (
void*) solnode->sol,
893 solnode->child = (*child)->child;
894 (*child)->child =
NULL;
897 solnode->value = (*child)->value;
898 (*child)->value = val;
899 assert(
SCIPsetIsLT(
set, (*child)->value, solnode->value));
902 solnode->sol = (*child)->sol;
903 (*child)->sol =
NULL;
904 #ifdef SCIP_MORE_DEBUG 905 SCIPsetDebugMsg(
set,
" after switching: node %p witch child=%p, sibling=%p, sol=%p, value=%g\n",
906 (
void*) (*child), (
void*) (*child)->child, (
void*) (*child)->sibling, (
void*) (*child)->sol,
908 SCIPsetDebugMsg(
set,
" node %p witch child=%p, sibling=%p, sol=%p, value=%g\n",
909 (
void*) solnode, (
void*) solnode->child, (
void*) solnode->sibling, (
void*) solnode->sol,
923 if(
SCIPsetIsLT(
set, val, (*child)->sibling->value) )
929 solnode->
father = curnode;
932 solnode->
value = val;
940 (*child)->sibling = solnode;
943 #ifdef SCIP_MORE_DEBUG 944 SCIPsetDebugMsg(
set,
"-> create new node %p: value=%g, sibling=%p\n", (
void*) solnode, solnode->
value,
945 (
void*) solnode->sibling);
951 *child = (*child)->sibling;
956 solnode = curnode->
child;
957 assert(solnode !=
NULL);
989 assert(reopt !=
NULL);
991 assert(stat !=
NULL);
992 assert(origprimal !=
NULL);
993 assert(blkmem !=
NULL);
994 assert(vars !=
NULL);
996 assert(solnode !=
NULL);
1002 if( set->reopt_savesols > 0 )
1009 for( varid = 0; varid < nvars; varid++ )
1019 assert(child !=
NULL);
1025 if( (*added || bestsol) && !purelp )
1034 cursolnode->
sol = copysol;
1045 assert(cursolnode->
sol !=
NULL);
1050 (*solnode) = cursolnode;
1063 assert(node !=
NULL);
1073 child = node->
child;
1076 while( child !=
NULL )
1100 assert(reopttree !=
NULL );
1101 assert(id < reopttree->reoptnodessize);
1158 assert(reopttree !=
NULL);
1159 assert(
set !=
NULL);
1160 assert(blkmem !=
NULL);
1205 assert(reopttree !=
NULL );
1240 assert(reopttree !=
NULL);
1241 assert(blkmem !=
NULL);
1265 assert(reopt !=
NULL);
1266 assert(blkmem !=
NULL);
1278 else if( reopt->
dualreds->varssize < size )
1284 reopt->
dualreds->varssize = newsize;
1301 assert(reopt !=
NULL);
1302 assert(blkmem !=
NULL);
1350 assert(reopt !=
NULL);
1351 assert(blkmem !=
NULL);
1352 assert(node !=
NULL);
1353 assert(0 <
id && id < reopt->reopttree->reoptnodessize);
1360 if( nconsprops > 0 )
1372 assert(nvars + naddedbndchgs <= reopt->reopttree->reoptnodes[
id]->varssize);
1376 *transintoorig =
TRUE;
1404 assert(reopt !=
NULL);
1405 assert(blkmem !=
NULL);
1406 assert(node !=
NULL);
1407 assert(0 <
id && id < reopt->reopttree->reoptnodessize);
1461 if( nbranchvars > 0 )
1462 *transintoorig =
TRUE;
1464 SCIPsetDebugMsg(
set,
" -> save %d bound changes after dual reductions\n", nbranchvars);
1466 assert(nbranchvars <= reopt->reopttree->reoptnodes[
id]->afterdualvarssize);
1487 assert(reopt !=
NULL);
1488 assert(
set !=
NULL);
1490 assert(blkmem !=
NULL);
1495 for( r = 0; r < nlprows; r++ )
1527 for( c = 0; c < ncutvars; c++ )
1533 assert(cutvars[c] !=
NULL);
1539 assert(cutvars[c] !=
NULL);
1548 cutvals[c] = cutvals[c]/scalar;
1571 assert(reopt !=
NULL );
1572 assert(0 <
id && id < reopt->reopttree->reoptnodessize);
1614 unsigned int* parentid,
1618 assert(reopt !=
NULL);
1628 int nbranchings = 0;
1631 if( set->reopt_saveconsprop )
1636 (*nbndchgs) = (*nbndchgs) + nbranchings + nconsprop;
1674 unsigned int parentid,
1675 unsigned int childid
1680 assert(reopttree !=
NULL);
1681 assert(blkmem !=
NULL);
1696 SCIPsetDebugMsg(
set,
"add ID %u as a child of ID %u.\n", childid, parentid);
1707 unsigned int nodeid,
1708 unsigned int parentid
1711 unsigned int childid;
1715 assert(reopt !=
NULL);
1716 assert(blkmem !=
NULL);
1717 assert(0 < nodeid && nodeid < reopt->reopttree->reoptnodessize);
1718 assert(parentid < reopt->reopttree->reoptnodessize);
1731 assert(0 < childid && childid < reopt->reopttree->reoptnodessize);
1773 assert(reopttree !=
NULL );
1774 assert(blkmem !=
NULL);
1775 assert(id < reopttree->reoptnodessize);
1781 SCIPsetDebugMsg(
set,
"-> delete subtree induced by ID %u (hard remove = %u)\n",
id, exitsolve);
1786 unsigned int childid;
1790 assert(0 < childid && childid < reopttree->reoptnodessize);
1821 assert(reopt !=
NULL);
1822 assert(node !=
NULL);
1823 assert(id < reopt->reopttree->reoptnodessize);
1826 assert(reoptnodes !=
NULL);
1827 assert(reoptnodes[
id] !=
NULL);
1829 if( reoptnodes[
id]->childids !=
NULL && reoptnodes[
id]->nchilds > 0 )
1832 unsigned int parentid = 0;
1837 assert(parentid !=
id);
1838 assert(reoptnodes[parentid] !=
NULL );
1839 assert(reoptnodes[parentid]->childids !=
NULL && reoptnodes[parentid]->nchilds);
1849 if( ndomchgs <= set->reopt_maxdiffofnodes )
1854 id, reoptnodes[
id]->nchilds);
1861 while( reoptnodes[parentid]->childids[c] !=
id )
1864 assert(c < reoptnodes[parentid]->nchilds);
1867 assert(reoptnodes[parentid]->childids[c] ==
id);
1871 --reoptnodes[parentid]->
nchilds;
1894 assert(reopttree !=
NULL);
1895 assert(id < reopttree->reoptnodessize);
1900 unsigned int childid;
1906 while( seenids < nchildids )
1910 assert(childid < reopttree->reoptnodessize);
1939 assert(reoptnode !=
NULL);
1940 assert(blkmem !=
NULL);
1979 assert(reopt !=
NULL);
1981 assert(
set !=
NULL);
1982 assert(blkmem !=
NULL);
1983 assert(node !=
NULL);
1984 assert(transvars !=
NULL);
1987 assert(node !=
NULL);
1989 *localrestart =
FALSE;
1992 assert(id < reopt->reopttree->reoptnodessize);
1998 if( set->reopt_objsimdelay > -1 )
2012 for( v = 0; v < ntransvars; v++ )
2021 assert(0 <= idx && idx < ntransvars);
2026 sim += (oldcoef * newcoef);
2032 if(
SCIPsetIsLT(
set, sim, set->reopt_objsimdelay) )
2035 *localrestart =
TRUE;
2048 SCIPsetDebugMsg(
set,
" -> local similarity: %.4f%s\n", sim, *localrestart ?
" (solve subproblem from scratch)" :
"");
2063 unsigned int parentid
2068 assert(reopttree !=
NULL );
2069 assert(node !=
NULL );
2070 assert(parent !=
NULL );
2071 assert(1 <=
id && id < reopttree->reoptnodessize);
2073 assert(parentid < reopttree->reoptnodessize);
2074 assert(parentid == 0 || reopttree->
reoptnodes[parentid] !=
NULL );
2112 assert(nbranchvars <= reopttree->reoptnodes[
id]->varssize);
2116 assert(nbranchvars <= reopttree->reoptnodes[
id]->varssize);
2138 assert(reoptconsdata !=
NULL);
2139 assert(cons !=
NULL);
2142 allocbuffervals =
FALSE;
2143 reoptconsdata->linear =
TRUE;
2153 reoptconsdata->varssize = reoptconsdata->nvars;
2156 reoptconsdata->boundtypes =
NULL;
2159 assert(conshdlr !=
NULL);
2175 allocbuffervals =
TRUE;
2177 for( v = 0; v < reoptconsdata->nvars; v++ )
2180 reoptconsdata->lhs = 1.0;
2189 allocbuffervals =
TRUE;
2191 for( v = 0; v < reoptconsdata->nvars; v++ )
2196 reoptconsdata->lhs = 1.0;
2197 reoptconsdata->rhs = 1.0;
2201 reoptconsdata->rhs = 1.0;
2204 reoptconsdata->lhs = 1.0;
2220 assert(vars !=
NULL);
2221 assert(vals !=
NULL);
2224 for( v = 0; v < reoptconsdata->nvars; v++ )
2229 assert(vars[v] !=
NULL);
2231 reoptconsdata->vars[v] = vars[v];
2232 reoptconsdata->vals[v] = vals[v];
2238 reoptconsdata->vals[v] *= scalar;
2241 reoptconsdata->lhs -= constant;
2243 reoptconsdata->rhs -= constant;
2247 if( allocbuffervals )
2268 assert(reoptconsdata !=
NULL);
2269 assert(cons !=
NULL);
2272 reoptconsdata->linear =
FALSE;
2275 assert(conshdlr !=
NULL);
2280 SCIPerrorMessage(
"Cannot handle constraints of type <%s> in saveConsBounddisjuction.\n",
2295 reoptconsdata->varssize = reoptconsdata->nvars;
2300 for( v = 0; v < reoptconsdata->nvars; v++ )
2305 assert(reoptconsdata->vars[v] !=
NULL);
2311 reoptconsdata->vals[v] -= constant;
2312 reoptconsdata->vals[v] *= scalar;
2338 assert(node !=
NULL );
2339 assert(reopttree !=
NULL);
2340 assert(id < reopttree->reoptnodessize);
2347 SCIPsetDebugMsg(
set,
" -> save %d locally added constraints\n", addedconsssize);
2359 for( c = nconss; c < naddedconss; c++ )
2432 assert(reopt !=
NULL);
2434 assert(id < reopt->reopttree->reoptnodessize);
2436 assert(node !=
NULL);
2437 assert(blkmem !=
NULL);
2456 &nbndchgs, reopt->
dualreds->varssize);
2457 assert(nbndchgs <= reopt->dualreds->varssize);
2463 for( v = 0; v < nbndchgs; v++ )
2475 assert(nbndchgs > 0);
2487 cons_is_next =
FALSE;
2498 reopt->
dualreds->vars, nbndchgs) );
2500 reopt->
dualreds->vals, nbndchgs) );
2502 reopt->
dualreds->boundtypes, nbndchgs) );
2512 SCIPsetDebugMsg(
set,
" -> save dual information of type 1: node %lld, nvars %d, constype %d\n",
2524 reopt->
dualreds->vars, nbndchgs) );
2526 reopt->
dualreds->vals, nbndchgs) );
2528 reopt->
dualreds->boundtypes, nbndchgs) );
2536 SCIPsetDebugMsg(
set,
" -> save dual information of type 2: node %lld, nvars %d, constype %d\n",
2561 unsigned int parentid = 0;
2563 assert(reopt !=
NULL);
2564 assert(
set !=
NULL);
2565 assert(blkmem !=
NULL);
2566 assert(node !=
NULL);
2568 if( set->reopt_maxsavednodes == 0 )
2589 assert(!isrootnode);
2592 assert(id < reopt->reopttree->reoptnodessize);
2602 assert(parent !=
NULL);
2614 assert(parent !=
NULL);
2623 assert(parentid == 0
2641 transintoorig =
FALSE;
2644 if( set->reopt_usecuts )
2657 if( set->reopt_saveconsprop )
2673 #ifdef SCIP_MORE_DEBUG 2707 if( set->reopt_shrinkinner )
2727 if( set->reopt_reducetofrontier )
2741 if( set->reopt_reducetofrontier )
2791 if( set->reopt_usecuts )
2825 SCIPsetDebugMsg(
set,
" -> nvars: 0, ncons: 0, parentID: -, reopttype: %u, lowerbound: %g\n", reopttype,
2839 if( set->reopt_reducetofrontier )
2858 SCIPsetDebugMsg(
set,
" -> nvars: 0, ncons: 0, parentID: -, reopttype: %u, lowerbound: %g\n", reopttype,
2872 if( set->reopt_reducetofrontier )
2891 SCIPsetDebugMsg(
set,
" -> nvars: 0, ncons: 0, parentID: -, reopttype: %u, lowerbound:%g \n", reopttype,
2952 assert(
id >= 1 && id < reopt->reopttree->reoptnodessize);
2953 assert(!isrootnode);
2960 assert(parent !=
NULL );
2985 SCIPsetDebugMsg(
set,
" -> skip saving bound changes after dual reductions.\n");
3003 if( set->reopt_usecuts )
3019 SCIPsetDebugMsg(
set,
" -> nvars: %d, ncons: %d, parentID: %u, reopttype: %d, lowerbound: %g\n",
3023 #ifdef SCIP_MORE_DEBUG 3122 assert(reopt !=
NULL);
3140 assert(reoptnode !=
NULL);
3141 assert(blkmem !=
NULL);
3202 assert(reopt !=
NULL);
3203 assert(blkmem !=
NULL);
3204 assert(
set !=
NULL);
3205 assert(vars !=
NULL);
3206 assert(vals !=
NULL);
3207 assert(nbinvars + nintvars == nvars);
3214 reoptconsdata =
NULL;
3219 reoptconsdata = reopt->
glbconss[nglbconss];
3224 reoptconsdata->varssize = (int)(nbinvars+2*nintvars);
3225 reoptconsdata->nvars = 0;
3229 assert(reopt->
glbconss[nglbconss]->nvars == 0);
3230 assert(reopt->
glbconss[nglbconss]->varssize > 0);
3232 reoptconsdata = reopt->
glbconss[nglbconss];
3234 if( reoptconsdata->varssize < nbinvars+2*nintvars )
3237 (
int)(nbinvars+2*nintvars)) );
3239 (
int)(nbinvars+2*nintvars)) );
3241 (
int)(nbinvars+2*nintvars)) );
3242 reoptconsdata->varssize = (int)(nbinvars+2*nintvars);
3245 assert(reoptconsdata !=
NULL);
3247 reoptconsdata->lhs = 1.0;
3249 reoptconsdata->linear =
FALSE;
3252 for( v = 0; v < nvars; v++ )
3254 assert(nvarsadded < reoptconsdata->varssize);
3255 assert(vars[v] !=
NULL);
3269 reoptconsdata->vars[nvarsadded] = vars[v];
3274 reoptconsdata->vals[nvarsadded] = 0.0;
3281 reoptconsdata->vals[nvarsadded] = 1.0;
3288 assert(boundtypes !=
NULL);
3290 reoptconsdata->vals[nvarsadded] = vals[v];
3302 reoptconsdata->vars[nvarsadded] = vars[v];
3318 reoptconsdata->vals[nvarsadded] = ubglb - 1.0;
3326 reoptconsdata->vals[nvarsadded] = lbglb + 1.0;
3330 else if( boundtypes !=
NULL )
3339 reoptconsdata->vals[nvarsadded] = roundedval + 1.0;
3347 reoptconsdata->vals[nvarsadded] = roundedval - 1.0;
3360 reoptconsdata->vals[nvarsadded] = roundedval - 1.0;
3365 reoptconsdata->vars[nvarsadded] = vars[v];
3366 reoptconsdata->vals[nvarsadded] = roundedval + 1.0;
3372 assert(nvars <= nvarsadded);
3373 assert(nvarsadded == nbinvars + 2 * nintvars);
3375 reoptconsdata->nvars = nvarsadded;
3391 assert(reopt !=
NULL);
3392 assert(node !=
NULL);
3414 if( allocmem < nbranchvars )
3419 allocmem = nbranchvars;
3427 for( v = 0; v < nbranchvars; v++ )
3434 assert(nbinvars + nintvars == nbranchvars);
3436 SCIP_CALL(
addGlobalCut(reopt, blkmem,
set, vars, vals, boundtypes, nbranchvars, nbinvars, nintvars) );
3463 assert(reopttree !=
NULL);
3464 assert(blkmem !=
NULL);
3465 assert(id1 < reopttree->reoptnodessize);
3466 assert(id2 < reopttree->reoptnodessize);
3477 SCIPsetDebugMsg(
set,
"move %d IDs: %u -> %u\n", nchilds_id1, id1, id2);
3480 for( c = 0; c < nchilds_id1; c++ )
3486 for( k = 0; k < nchilds_id2; k++ )
3526 assert(reopt !=
NULL);
3527 assert(
set !=
NULL);
3528 assert(stat !=
NULL);
3529 assert(transprob !=
NULL);
3530 assert(tree !=
NULL);
3532 assert(branchcand !=
NULL);
3533 assert(eventqueue !=
NULL);
3534 assert(cliquetable !=
NULL);
3535 assert(node !=
NULL);
3536 assert(blkmem !=
NULL);
3539 assert(reopttree !=
NULL);
3540 assert(id < reopttree->reoptnodessize);
3543 assert(reoptnode !=
NULL);
3550 for( v = 0; v < reoptnode->
nvars; v++ )
3559 var = reoptnode->
vars[v];
3588 #ifdef SCIP_MORE_DEBUG 3644 #ifdef SCIP_MORE_DEBUG 3651 nvars = reoptnode->
nvars;
3699 assert(reopt !=
NULL);
3701 assert(id < reopt->reopttree->reoptnodessize);
3705 assert(scip !=
NULL);
3706 assert(
set !=
NULL);
3707 assert(stat !=
NULL);
3708 assert(blkmem !=
NULL);
3709 assert(transprob !=
NULL);
3710 assert(origprob !=
NULL);
3711 assert(tree !=
NULL);
3713 assert(branchcand !=
NULL);
3714 assert(eventqueue !=
NULL);
3715 assert(node !=
NULL);
3739 assert(!reoptconsdata->linear);
3740 assert(reoptconsdata->vars !=
NULL);
3741 assert(reoptconsdata->vals !=
NULL);
3742 assert(reoptconsdata->boundtypes !=
NULL);
3744 var = reoptconsdata->vars[0];
3745 newbound = reoptconsdata->vals[0];
3746 boundtype = reoptconsdata->boundtypes[0];
3757 newbound = reoptconsdata->vals[0] - 1.0;
3758 assert(
SCIPisLE(scip, newbound, oldub));
3762 newbound = reoptconsdata->vals[0] + 1.0;
3763 assert(
SCIPisGE(scip, newbound, oldlb));
3795 assert(!reoptconsdata->linear);
3796 assert(reoptconsdata->vars !=
NULL);
3797 assert(reoptconsdata->vals !=
NULL);
3798 assert(reoptconsdata->boundtypes !=
NULL);
3804 for( v = 0; v < reoptconsdata->nvars; v++ )
3822 SCIPerrorMessage(
"Variable <%s> has to be either binary, (implied) integer, or continuous.\n",
3837 if( reoptconsdata->nvars == nbinvars )
3839 for( v = 0; v < reoptconsdata->nvars; v++ )
3841 consvars[v] = reoptconsdata->vars[v];
3842 consval = reoptconsdata->vals[v];
3866 assert(nintvars > 0 || ncontvars > 0);
3873 for( v = 0; v < reoptconsdata->nvars; v++ )
3875 consvars[v] = reoptconsdata->vars[v];
3876 consvals[v] = reoptconsdata->vals[v];
3877 consboundtypes[v] = reoptconsdata->boundtypes[v];
3911 consvals,
FALSE,
FALSE,
TRUE,
FALSE,
TRUE,
TRUE,
FALSE,
FALSE,
FALSE,
TRUE) );
3919 #ifdef SCIP_DEBUG_CONSS 3956 assert(reopt !=
NULL);
3957 assert(
set !=
NULL);
3958 assert(stat !=
NULL);
3959 assert(transprob !=
NULL);
3960 assert(origprob !=
NULL);
3961 assert(tree !=
NULL);
3963 assert(branchcand !=
NULL);
3964 assert(eventqueue !=
NULL);
3965 assert(cliquetable !=
NULL);
3966 assert(node !=
NULL);
3967 assert(blkmem !=
NULL);
3970 assert(reopttree !=
NULL);
3971 assert(0 <
id && id < reopttree->reoptnodessize);
3974 assert(reoptnode !=
NULL);
3981 for( v = 0; v < reoptnode->
dualredscur->nvars; v++ )
3990 boundtype = reoptnode->
dualredscur->boundtypes[v];
4020 #ifdef SCIP_MORE_DEBUG 4030 pos = reoptnode->
nvars;
4032 reoptnode->
vars[pos] = var;
4044 if( updatedualconss )
4085 assert(reopt !=
NULL);
4086 assert(
set !=
NULL);
4087 assert(stat !=
NULL);
4088 assert(transprob !=
NULL);
4089 assert(origprob !=
NULL);
4090 assert(tree !=
NULL);
4092 assert(branchcand !=
NULL);
4093 assert(eventqueue !=
NULL);
4094 assert(cliquetable !=
NULL);
4095 assert(node !=
NULL);
4096 assert(perm !=
NULL);
4097 assert(vars !=
NULL);
4098 assert(vals !=
NULL);
4099 assert(boundtypes !=
NULL);
4101 assert(blkmem !=
NULL);
4102 assert(0 <
id && id < reopt->reopttree->reoptnodessize);
4110 assert(reopttree !=
NULL);
4113 assert(reoptnode !=
NULL);
4118 nbndchgs =
MIN(negbndchg, nvars);
4121 for( v = 0; v < nbndchgs; v++ )
4123 var = vars[perm[v]];
4124 val = vals[perm[v]];
4125 boundtype = boundtypes[perm[v]];
4131 if( v == nbndchgs-1 )
4159 #ifdef SCIP_MORE_DEBUG 4182 assert(scip !=
NULL);
4183 assert(reopt !=
NULL);
4185 assert(
set !=
NULL);
4186 assert(stat !=
NULL);
4187 assert(blkmem !=
NULL);
4188 assert(node !=
NULL);
4189 assert(0 <
id && id < reopt->reopttree->reoptnodessize);
4203 assert(reoptconsdata !=
NULL);
4204 assert(reoptconsdata->nvars > 0);
4205 assert(reoptconsdata->varssize >= reoptconsdata->nvars);
4217 if( reoptconsdata->linear )
4220 reoptconsdata->lhs, reoptconsdata->rhs,
FALSE,
FALSE,
TRUE,
TRUE,
TRUE,
TRUE,
FALSE,
FALSE,
FALSE,
TRUE) );
4224 assert(reoptconsdata->boundtypes !=
NULL);
4226 reoptconsdata->vals,
FALSE,
FALSE,
TRUE,
TRUE,
TRUE,
TRUE,
FALSE,
FALSE,
FALSE,
TRUE) );
4228 #ifdef SCIP_DEBUG_CONSS 4244 assert(reopt !=
NULL);
4271 unsigned int* cutoffchilds;
4272 int ncutoffchilds = 0;
4273 unsigned int* redchilds;
4277 assert(reopt !=
NULL);
4279 assert(id < reopt->reopttree->reoptnodessize);
4295 for( c = 0; c < reoptnode->
nchilds; c++ )
4303 unsigned int childid;
4310 assert(childid < reopt->reopttree->reoptnodessize);
4312 assert(child !=
NULL);
4313 #ifdef SCIP_MORE_DEBUG 4316 if( child->
nvars > 0 )
4321 for( v = 0; v < child->
nvars && !cutoff; v++ )
4329 transvar = child->
vars[v];
4342 SCIPsetDebugMsg(
set,
" -> <%s> is fixed to %g, can not change bound to %g -> cutoff\n",
4352 SCIPsetDebugMsg(
set,
" -> <%s> is already fixed to %g -> redundant bound change\n",
4355 redundantvars[nredundantvars] = v;
4360 if( !cutoff && nredundantvars > 0 )
4362 for( v = 0; v < nredundantvars; v++ )
4365 child->
vars[redundantvars[v]] = child->
vars[child->
nvars-1];
4375 else if( child->
nconss == 0 )
4383 cutoffchilds[ncutoffchilds] = childid;
4386 else if( redundant )
4388 redchilds[nredchilds] = childid;
4393 SCIPsetDebugMsg(
set,
"-> found %d redundant and %d infeasible nodes\n", nredchilds, ncutoffchilds);
4396 while( ncutoffchilds > 0 )
4403 while( reoptnode->
childids[c] != cutoffchilds[ncutoffchilds-1] && c < reoptnode->nchilds )
4405 assert(reoptnode->
childids[c] == cutoffchilds[ncutoffchilds-1]);
4416 while( nredchilds > 0 )
4420 while( reoptnode->
childids[c] != redchilds[nredchilds-1] && c < reoptnode->nchilds )
4422 assert(reoptnode->
childids[c] == redchilds[nredchilds-1]);
4452 for( cc = 0; cc < ncc; cc++ )
4487 assert(reopttree !=
NULL);
4488 assert(id < reopttree->reoptnodessize);
4506 assert(reopt !=
NULL);
4507 assert(id < reopt->reopttree->reoptnodessize);
4513 unsigned int childid;
4516 assert(childid < reopt->reopttree->reoptnodessize);
4532 unsigned int* leaves,
4540 assert(reopt !=
NULL);
4541 assert(leavessize > 0 && leaves !=
NULL);
4542 assert((*nleaves) >= 0);
4543 assert(id < reopt->reopttree->reoptnodessize);
4548 unsigned int childid;
4550 assert(*nleaves <= leavessize);
4553 assert(childid < reopt->reopttree->reoptnodessize);
4567 (*nleaves) += nleaves2;
4583 assert(reopt !=
NULL);
4584 assert(
set !=
NULL);
4585 assert(blkmem !=
NULL);
4608 assert(reopt !=
NULL);
4610 assert(
set !=
NULL);
4611 assert(blkmem !=
NULL);
4643 assert(reopt !=
NULL);
4644 assert(
set !=
NULL);
4645 assert(blkmem !=
NULL);
4646 assert(origvars !=
NULL);
4647 assert(norigvars >= 0);
4656 for( i = 0; i < reopt->
run-1; i++ )
4659 for( v = reopt->
nobjvars-1; v < norigvars; v++ )
4660 reopt->
objs[i][v] = 0.0;
4667 for( v = 0; v < norigvars; v++ )
4681 for( i = 0; i < reopt->
run; i++ )
4684 for( j = reopt->
nobjvars; j < newsize; j++ )
4685 reopt->
objs[i][j] = 0.0;
4689 assert(0 <= probidx && probidx < reopt->nobjvars);
4699 if( reopt->
firstobj == -1 && reopt->
objs[reopt->
run-1][probidx] != 0 )
4704 if( reopt->
run-1 >= 1 )
4736 assert(
set !=
NULL);
4737 assert(perm !=
NULL);
4738 assert(vars !=
NULL);
4739 assert(bounds !=
NULL);
4740 assert(boundtypes !=
NULL);
4746 for( v = 0; v < nvars; v++ )
4788 assert(reopt !=
NULL);
4789 assert(sol !=
NULL);
4790 assert(blkmem !=
NULL);
4791 assert(
set !=
NULL);
4792 assert(stat !=
NULL);
4793 assert(vars !=
NULL);
4805 for( v = 0, w = 0; v < nvars; v++ )
4808 assert(nbinvars + nintvars == w);
4819 origvars[v] = vars[v];
4820 assert(origvars[v] !=
NULL);
4848 #undef SCIPreoptGetNRestartsGlobal 4849 #undef SCIPreoptGetNRestartsLocal 4850 #undef SCIPreoptGetNTotalRestartsLocal 4851 #undef SCIPreoptGetFirstRestarts 4852 #undef SCIPreoptGetLastRestarts 4853 #undef SCIPreoptGetNFeasNodes 4854 #undef SCIPreoptGetNTotalFeasNodes 4855 #undef SCIPreoptGetNPrunedNodes 4856 #undef SCIPreoptGetNTotalPrunedNodes 4857 #undef SCIPreoptGetNCutoffReoptnodes 4858 #undef SCIPreoptGetNTotalCutoffReoptnodes 4859 #undef SCIPreoptGetNInfNodes 4860 #undef SCIPreoptGetNTotalInfNodes 4861 #undef SCIPreoptGetNInfSubtrees 4869 assert(reopt !=
NULL);
4879 assert(reopt !=
NULL);
4889 assert(reopt !=
NULL);
4899 assert(reopt !=
NULL);
4909 assert(reopt !=
NULL);
4919 assert(reopt !=
NULL);
4929 assert(reopt !=
NULL);
4939 assert(reopt !=
NULL);
4949 assert(reopt !=
NULL);
4959 assert(reopt !=
NULL);
4969 assert(reopt !=
NULL);
4979 assert(reopt !=
NULL);
4989 assert(reopt !=
NULL);
5004 assert(reopt !=
NULL);
5009 (*reopt)->simtolastobj = -2.0;
5010 (*reopt)->simtofirstobj = -2.0;
5011 (*reopt)->firstobj = -1;
5012 (*reopt)->currentnode = -1;
5013 (*reopt)->lastbranched = -1;
5014 (*reopt)->dualreds =
NULL;
5015 (*reopt)->glbconss =
NULL;
5016 (*reopt)->nglbconss = 0;
5017 (*reopt)->allocmemglbconss = 0;
5018 (*reopt)->ncheckedsols = 0;
5019 (*reopt)->nimprovingsols = 0;
5020 (*reopt)->noptsolsbyreoptsol = 0;
5021 (*reopt)->nglbrestarts = 0;
5022 (*reopt)->nlocrestarts = 0;
5023 (*reopt)->ntotallocrestarts = 0;
5024 (*reopt)->firstrestart = -1;
5025 (*reopt)->lastrestart = 0;
5026 (*reopt)->nobjvars = 0;
5027 (*reopt)->objhaschanged =
FALSE;
5028 (*reopt)->consadded =
FALSE;
5029 (*reopt)->addedconss =
NULL;
5030 (*reopt)->naddedconss = 0;
5031 (*reopt)->addedconsssize = 0;
5032 (*reopt)->glblb =
NULL;
5033 (*reopt)->glbub =
NULL;
5034 (*reopt)->activeconss =
NULL;
5040 for( i = 0; i < (*reopt)->runsize; i++ )
5042 (*reopt)->objs[i] =
NULL;
5043 (*reopt)->prevbestsols[i] =
NULL;
5044 (*reopt)->varhistory[i] =
NULL;
5066 eventExitsolReopt,
NULL, eventExecReopt,
NULL) );
5068 assert(eventhdlr !=
NULL);
5081 assert(reopt !=
NULL);
5082 assert(*reopt !=
NULL);
5083 assert(
set !=
NULL);
5085 assert(blkmem !=
NULL);
5097 for( p = (*reopt)->run-1; p >= 0; p-- )
5099 if( (*reopt)->soltree->sols[p] !=
NULL )
5102 (*reopt)->soltree->sols[p] =
NULL;
5108 if( set->reopt_sepabestsol && (*reopt)->prevbestsols[p] !=
NULL )
5113 if( (*reopt)->objs[p] !=
NULL )
5123 if( (*reopt)->dualreds !=
NULL )
5125 if( (*reopt)->dualreds->varssize > 0 )
5127 assert(!(*reopt)->dualreds->linear);
5133 (*reopt)->dualreds =
NULL;
5137 if( (*reopt)->glbconss !=
NULL && (*reopt)->allocmemglbconss > 0 )
5142 for( c = 0; c < (*reopt)->allocmemglbconss; c++ )
5144 if( (*reopt)->glbconss[c] !=
NULL )
5146 if( (*reopt)->glbconss[c]->varssize > 0 )
5151 (*reopt)->glbconss[c]->varssize = 0;
5154 --(*reopt)->nglbconss;
5158 assert((*reopt)->nglbconss == 0);
5161 (*reopt)->allocmemglbconss = 0;
5168 if( (*reopt)->addedconss !=
NULL )
5171 for( c = 0; c < (*reopt)->naddedconss; c++)
5173 assert((*reopt)->addedconss[c] !=
NULL);
5181 if( (*reopt)->glblb !=
NULL )
5186 (*reopt)->glblb =
NULL;
5187 (*reopt)->glbub =
NULL;
5188 (*reopt)->activeconss =
NULL;
5192 assert((*reopt)->glbub ==
NULL);
5193 assert((*reopt)->activeconss ==
NULL);
5212 assert(reopt !=
NULL);
5213 assert(node !=
NULL);
5216 assert(id < reopt->reopttree->reoptnodessize);
5247 assert(reopt !=
NULL);
5248 assert(
set !=
NULL);
5249 assert(sol !=
NULL);
5265 SCIP_CALL(
soltreeAddSol(reopt,
set, stat, origprimal, blkmem, vars, sol, &solnode, nvars, bestsol, added) );
5269 assert(solnode !=
NULL);
5275 assert(reopt->
soltree->
nsols[run-1] <= set->reopt_savesols);
5296 assert(reopt !=
NULL);
5297 assert(reopt->
run-1 >= 0);
5298 assert(sol !=
NULL);
5299 assert(blkmem !=
NULL);
5300 assert(
set !=
NULL);
5301 assert(stat !=
NULL);
5302 assert(origprimal !=
NULL);
5308 if( set->reopt_sepabestsol )
5326 assert(reopt !=
NULL);
5327 assert(
set !=
NULL);
5328 assert(blkmem !=
NULL);
5329 assert(origvars !=
NULL);
5357 assert(reopt !=
NULL);
5368 assert(reopt !=
NULL);
5378 assert(reopt !=
NULL);
5389 assert(reopt !=
NULL);
5400 assert(reopt !=
NULL);
5401 assert(0 < run && run <= reopt->runsize);
5417 assert(reopt !=
NULL);
5419 for( r = 0; r < reopt->
run; r++)
5436 assert(reopt !=
NULL);
5437 assert(run > 0 && run <= reopt->run);
5438 assert(sols !=
NULL);
5440 assert(solssize > 0);
5441 assert(nsols !=
NULL);
5450 if( solssize < (*nsols) )
5474 assert(reopt !=
NULL);
5507 assert(reopt !=
NULL);
5508 assert(
set !=
NULL);
5509 assert(blkmem !=
NULL);
5510 assert(transvars !=
NULL);
5511 assert(ntransvars >= 0);
5512 assert(restart !=
NULL);
5520 if( reopt->
run > 1 && set->reopt_objsimdelay > -1.0 )
5531 SCIPsetDebugMsg(
set,
"-> restart reoptimization (objective functions are not similar enough)\n");
5537 SCIPsetDebugMsg(
set,
"-> restart reoptimization (node limit reached)\n");
5543 SCIPsetDebugMsg(
set,
"-> restart reoptimization (found last %d optimal solutions by <reoptsols>)\n",
5568 assert(reopt !=
NULL);
5577 assert(reopt !=
NULL);
5591 assert(reopt !=
NULL);
5592 assert(run1 > 0 && run1 <= reopt->run);
5593 assert(run2 > 0 && run2 <= reopt->run);
5594 assert(origvars !=
NULL);
5595 assert(norigvars >= 0);
5597 return reoptSimilarity(reopt,
set, run1-1, run2-1, origvars, norigvars);
5605 assert(reopt !=
NULL);
5608 if( reopt->
run-2 < 0 )
5620 assert(reopt !=
NULL);
5622 assert(id < reopt->reopttree->reoptnodessize);
5635 assert(reopt !=
NULL);
5636 assert(0 < run && run <= reopt->runsize);
5638 return reopt->
objs[run-1][idx];
5650 assert(reopt !=
NULL);
5651 assert(0 < run && run <= reopt->run);
5665 assert(reopt !=
NULL);
5666 assert(
set !=
NULL);
5667 assert(blkmem !=
NULL);
5675 assert(cons !=
NULL);
5695 assert(reopt !=
NULL);
5702 while( child !=
NULL )
5717 assert(reopt !=
NULL);
5723 assert(id < reopt->reopttree->reoptnodessize);
5729 assert(0 <
id && id < reopt->reopttree->reoptnodessize);
5742 #undef SCIPreoptnodeGetNVars 5743 #undef SCIPreoptnodeGetNConss 5744 #undef SCIPreoptnodeGetNDualBoundChgs 5745 #undef SCIPreoptnodeGetNChildren 5746 #undef SCIPreoptnodeGetLowerbound 5747 #undef SCIPreoptnodeGetType 5754 assert(reoptnode !=
NULL);
5764 assert(reoptnode !=
NULL);
5766 return reoptnode->
nconss;
5774 assert(reoptnode !=
NULL);
5787 assert(reoptnode !=
NULL);
5797 assert(reoptnode !=
NULL);
5807 assert(reoptnode !=
NULL);
5825 assert(reoptnode !=
NULL);
5826 assert(vars !=
NULL);
5827 assert(bounds !=
NULL);
5828 assert(boundtypes !=
NULL);
5829 assert(nvars !=
NULL);
5830 assert(nconss !=
NULL);
5832 (*nconss) = reoptnode->
nconss;
5837 for( c = 0; c < *nconss; c++ )
5839 assert(vars[c] !=
NULL);
5840 assert(bounds[c] !=
NULL);
5842 vars[c] = reoptnode->
conss[c]->vars;
5843 bounds[c] = reoptnode->
conss[c]->vals;
5844 boundtypes[c] = reoptnode->
conss[c]->boundtypes;
5845 nvars[c] = reoptnode->
conss[c]->nvars;
5852 unsigned int parentid
5855 assert(reoptnode !=
NULL);
5856 assert(parentid <= 536870911);
5871 assert(reopt !=
NULL);
5874 assert(id < reopt->reopttree->reoptnodessize);
5882 unsigned int childid;
5885 assert(childid < reopt->reopttree->reoptnodessize);
5904 assert(reopt !=
NULL);
5905 assert(
set !=
NULL);
5906 assert(blkmem !=
NULL);
5907 assert(node !=
NULL);
5909 if( set->reopt_sepaglbinfsubtrees )
5932 int effectiverootdepth
5937 assert(reopt !=
NULL);
5938 assert(
set !=
NULL);
5939 assert(blkmem !=
NULL);
5941 assert(node !=
NULL);
5989 lowerbound =
MIN(lowerbound, cutoffbound);
5994 isrootnode, lowerbound) );
6011 SCIPsetDebugMsg(
set,
" -> focusnode : %s\n", isfocusnode ?
"yes" :
"no");
6013 SCIPsetDebugMsg(
set,
" -> strong branched : %s\n", strongbranched ?
"yes" :
"no");
6020 assert(isfocusnode);
6049 if( strongbranched )
6121 assert(isfocusnode);
6133 if( strongbranched )
6159 if( strongbranched )
6203 assert(reopt !=
NULL);
6204 assert(node !=
NULL);
6227 allocmem = reopt->
dualreds->nvars + resizelength;
6232 assert(reopt->
dualreds->varssize > 0);
6233 assert(reopt->
dualreds->nvars >= 0);
6242 newval = (newval - constant) / scalar;
6243 oldval = (oldval - constant) / scalar;
6249 SCIPerrorMessage(
"cannot store equal bounds: old = %g, new = %g\n", oldval, newval);
6285 int ndualbndchgs = 0;
6287 assert(reopt !=
NULL);
6288 assert(node !=
NULL);
6293 ndualbndchgs = reopt->
dualreds->nvars;
6296 return ndualbndchgs;
6305 unsigned int* childs,
6313 assert(reopt !=
NULL);
6314 assert(childssize > 0 && childs !=
NULL);
6315 assert(nchilds !=
NULL);
6325 assert(id < reopt->reopttree->reoptnodessize);
6342 if( childssize < *nchilds )
6345 for( c = 0; c < *nchilds; c++ )
6356 unsigned int* leaves,
6364 assert(reopt !=
NULL);
6365 assert(leavessize > 0 && leaves !=
NULL);
6366 assert((*nleaves) >= 0);
6375 if(
id == 0 && node !=
NULL )
6381 assert(id < reopt->reopttree->reoptnodessize);
6384 for( i = 0; i < leavessize; i++ )
6390 unsigned int childid;
6392 assert(*nleaves + 1 <= leavessize);
6395 assert(childid < reopt->reopttree->reoptnodessize);
6409 (*nleaves) += nleaves2;
6432 assert(reopt !=
NULL);
6433 assert(
set !=
NULL);
6434 assert(blkmem !=
NULL);
6435 assert(nleaves >= 0);
6436 assert(nleaves == 0 || leaves !=
NULL);
6437 assert(nchilds >= 0);
6438 assert(nchilds == 0 || childs !=
NULL);
6439 assert(nsiblings >= 0);
6440 assert(nsiblings == 0 || siblings !=
NULL);
6442 SCIPsetDebugMsg(
set,
"save unprocessed nodes (%d leaves, %d children, %d siblings)\n", nleaves, nchilds, nsiblings);
6445 for( n = 0; n < nleaves; n++ )
6452 for( n = 0; n < nchilds; n++ )
6459 for( n = 0; n < nsiblings; n++ )
6487 assert(reopt !=
NULL);
6488 assert(stat !=
NULL);
6491 if( !set->reopt_storevarhistory )
6496 bestrun = reopt->
run-2;
6500 for( r = reopt->
run-3; r >= 0 && reopt->
objhaschanged && set->reopt_usepscost; r-- )
6517 for( v = 0; v < nvars; v++ )
6522 assert(transvar !=
NULL);
6529 assert(0 <= idx && idx <= nvars);
6532 for( d = 0; d <= 1; d++ )
6556 (d == 0 ?
"down" :
"up"), avginference[d], avgcutoff[d]);
6575 assert(reopt !=
NULL);
6576 assert(stat !=
NULL);
6577 assert(blkmem !=
NULL);
6580 if( !set->reopt_storevarhistory )
6590 for( v = 0; v < nvars; v++ )
6597 for( v = 0; v < nvars; v++ )
6604 assert(idx >= 0 && idx < nvars);
6607 assert(transvar !=
NULL);
6626 int nrepresentatives,
6634 assert(reopt !=
NULL);
6635 assert(
set !=
NULL);
6636 assert(blkmem !=
NULL);
6637 assert(representatives !=
NULL);
6638 assert(nrepresentatives > 0);
6654 for( r = 0; r < nrepresentatives; r++ )
6658 assert(1 <=
id && id < reopttree->reoptnodessize);
6669 if( representatives[r]->nvars > 0 )
6673 assert(representatives[r]->nvars <= representatives[r]->varssize);
6675 for( v = 0; v < representatives[r]->
nvars; v++ )
6682 if( representatives[r]->nconss > 0 )
6686 assert(representatives[r]->nconss <= representatives[r]->consssize);
6688 for( c = 0; c < representatives[r]->
nconss; c++ )
6691 representatives[r]->
conss[c]->vals, representatives[r]->
conss[c]->boundtypes,
6692 representatives[r]->
conss[c]->lhs, representatives[r]->
conss[c]->rhs,
6693 representatives[r]->
conss[c]->nvars, representatives[r]->
conss[c]->constype,
6694 representatives[r]->
conss[c]->linear) );
6715 SCIPsetDebugMsg(
set,
"-> new tree consists of %d nodes, the root has %d child nodes.\n",
6737 assert(reopt !=
NULL);
6738 assert(
set !=
NULL);
6739 assert(blkmem !=
NULL);
6740 assert(consdata !=
NULL);
6741 assert(dualreds !=
NULL);
6746 consdata->boundtypes =
NULL;
6748 consdata->varssize = dualreds->nvars;
6749 consdata->nvars = dualreds->nvars;
6751 consdata->linear =
TRUE;
6754 consdata->lhs = 1.0;
6757 for( v = 0; v < consdata->nvars; v++ )
6759 assert(consdata->vars[v] !=
NULL);
6765 consdata->vals[v] = 1.0;
6777 consdata->vals[v] = -1.0;
6778 consdata->lhs -= 1.0;
6800 assert(reopt !=
NULL);
6801 assert(
set !=
NULL);
6802 assert(blkmem !=
NULL);
6803 assert(consdata !=
NULL);
6804 assert(dualreds !=
NULL);
6811 consdata->varssize = dualreds->nvars;
6812 consdata->nvars = dualreds->nvars;
6814 consdata->linear =
FALSE;
6820 for( v = 0; v < consdata->nvars; v++ )
6824 assert(consdata->vars[v] !=
NULL);
6833 consdata->vals[v] =
MIN(consdata->vals[v]+1.0, glbbd);
6839 consdata->vals[v] =
MAX(glbbd, consdata->vals[v]-1.0);
6854 int* ncreatedchilds,
6871 assert(reopt !=
NULL);
6872 assert(
set !=
NULL);
6873 assert(stat !=
NULL);
6874 assert(blkmem !=
NULL);
6877 assert(reopttree !=
NULL);
6880 assert(reoptnodes !=
NULL);
6881 assert(reoptnodes[0] !=
NULL);
6882 assert(reoptnodes[0]->dualreds);
6885 nchilds = reoptnodes[0]->
nchilds;
6887 assert(reoptnodes[0]->dualredscur !=
NULL);
6890 (*ncreatedchilds) = 0;
6900 assert(reoptnodes[
id] ==
NULL || reoptnodes[
id]->nvars == 0);
6913 assert(reoptnodes[
id]->varssize >= nbndchgs);
6914 assert(reoptnodes[
id]->nvars == 0);
6915 assert(reoptnodes[
id]->vars !=
NULL);
6916 assert(reoptnodes[
id]->varbounds !=
NULL);
6917 assert(reoptnodes[
id]->varboundtypes !=
NULL);
6920 if( !set->reopt_usesplitcons )
6922 assert(perm ==
NULL);
6927 for( v = 0; v < nbndchgs; v++ )
6932 ++reoptnodes[id]->
nvars;
6935 if( !set->reopt_usesplitcons )
6938 assert(reoptnodes[
id]->nvars == reoptnodes[0]->dualredscur->
nvars);
6942 assert(reoptnodes[0]->nchilds == 0);
6947 ++(*ncreatedchilds);
6949 if( set->reopt_usesplitcons )
6955 assert(*ncreatedchilds == 1);
6976 consdata = reoptnodes[id]->
conss[0];
6979 for( v = 0; v < nbndchgs; v++ )
6999 if( nbinvars == nbndchgs )
7006 assert(nintvars > 0 || ncontvars > 0);
7009 ++reoptnodes[id]->
nconss;
7013 ++(*ncreatedchilds);
7021 assert(*ncreatedchilds == 1);
7022 assert(perm !=
NULL);
7026 boundtypes = reoptnodes[0]->
dualredscur->boundtypes;
7028 assert(perm[0] == 0 && perm[nvars-1] == nvars-1);
7031 switch (set->reopt_varorderinterdiction)
7052 for( c = 0; c < nvars; c++ )
7059 assert(reoptnodes[
id] ==
NULL || reoptnodes[
id]->nvars == 0);
7071 assert(reoptnodes[
id]->varssize >= perm[c]+1);
7072 assert(reoptnodes[
id]->nvars == 0);
7073 assert(reoptnodes[
id]->vars !=
NULL);
7074 assert(reoptnodes[
id]->varbounds !=
NULL);
7075 assert(reoptnodes[
id]->varboundtypes !=
NULL);
7078 if( set->reopt_varorderinterdiction ==
'd' )
7081 for( v = 0; v < c; v++ )
7083 reoptnodes[id]->
vars[v] = vars[v];
7084 reoptnodes[id]->
varbounds[v] = bounds[v];
7091 for( v = 0; v < c; v++ )
7093 reoptnodes[id]->
vars[v] = vars[perm[v]];
7094 reoptnodes[id]->
varbounds[v] = bounds[perm[v]];
7098 reoptnodes[id]->
nvars += c;
7102 reoptnodes[id]->
vars[c] = vars[perm[c]];
7103 reoptnodes[id]->
varbounds[c] = bounds[perm[c]];
7112 ++reoptnodes[id]->
nvars;
7117 ++(*ncreatedchilds);
7120 assert(*ncreatedchilds == nvars+1);
7125 assert(perm ==
NULL);
7128 assert(reoptnodes[0]->dualredscur->
vars !=
NULL);
7129 assert(reoptnodes[0]->dualredscur->vals !=
NULL);
7130 assert(reoptnodes[0]->dualredscur->boundtypes !=
NULL);
7150 assert(reopt !=
NULL);
7151 assert(node !=
NULL);
7154 assert(id < reopt->reopttree->reoptnodessize);
7175 int* nbndchgsafterdual
7181 int nafterdualvars2;
7183 assert(reopt !=
NULL);
7184 assert(reoptnode !=
NULL);
7185 assert(vars !=
NULL);
7186 assert(vals !=
NULL);
7187 assert(boundtypes !=
NULL);
7189 (*nbndchgs) = reoptnode->
nvars;
7193 if( varssize == 0 || varssize < *nbndchgs + *nbndchgsafterdual )
7197 for( v = 0; v < *nbndchgs; v++ )
7199 vars[v] = reoptnode->
vars[v];
7205 for( ; v < *nbndchgs + *nbndchgsafterdual; v++ )
7218 SCIPreoptnodeGetPath(reopt, parent, &vars[v], &vals[v], &boundtypes[v], varssize, &nvars2, &nafterdualvars2);
7220 (*nbndchgs) += nvars2;
7221 (*nbndchgsafterdual) += nafterdualvars2;
7233 assert(reopt !=
NULL);
7235 assert(id < reopt->reopttree->reoptnodessize);
7237 assert(blkmem !=
NULL);
7263 int* ncreatedchilds,
7269 assert(reopt !=
NULL);
7270 assert(scip !=
NULL);
7271 assert(
set !=
NULL);
7272 assert(stat !=
NULL);
7273 assert(transprob !=
NULL);
7274 assert(origprob !=
NULL);
7275 assert(tree !=
NULL);
7277 assert(branchcand !=
NULL);
7278 assert(eventqueue !=
NULL);
7279 assert(cliquetable !=
NULL);
7280 assert(blkmem !=
NULL);
7281 assert(reoptnode !=
NULL);
7282 assert(childnodes !=
NULL);
7284 assert(id < reopt->reopttree->reoptnodessize);
7285 assert(success !=
NULL);
7300 if( set->reopt_usesplitcons )
7302 if( reoptnode->
reopttype == (
unsigned int)SCIP_REOPTTYPE_INFSUBTREE )
7306 (*ncreatedchilds) = 1;
7312 (*ncreatedchilds) = 2;
7318 if( childnodessize < *ncreatedchilds )
7322 for( c = 0; c < *ncreatedchilds; c++ )
7332 cliquetable, blkmem, childnodes[c],
id, c == 1) );
7348 SCIP_CALL(
addSplitcons(reopt, scip,
set, stat, blkmem, transprob, origprob, tree, lp, branchcand,
7349 eventqueue, cliquetable, childnodes[c],
id) );
7373 if( reoptnode->
nconss == 0 )
7380 SCIP_CALL(
fixBounds(reopt,
set, stat, transprob, origprob, tree, lp, branchcand, eventqueue, cliquetable,
7381 blkmem, childnodes[c],
id,
TRUE) );
7412 *ncreatedchilds = nvars+1;
7416 if( childnodessize < *ncreatedchilds )
7421 for( c = 0; c < nvars; c++ )
7425 switch (set->reopt_varorderinterdiction)
7455 for( c = nvars; c >= 0; c-- )
7460 #ifdef SCIP_MORE_DEBUG 7466 cliquetable, blkmem, childnodes[c],
id,
FALSE) );
7472 SCIP_CALL(
fixBounds(reopt,
set, stat, transprob, origprob, tree, lp, branchcand, eventqueue, cliquetable,
7473 blkmem, childnodes[c],
id,
TRUE) );
7484 SCIP_CALL(
fixInterdiction(reopt,
set, stat, transprob, origprob, tree, lp, branchcand, eventqueue, cliquetable,
7485 blkmem, childnodes[c],
id, perm, vars, bounds, boundtypes, nvars, c) );
7514 (*ncreatedchilds) = 1;
7517 if( childnodessize < *ncreatedchilds )
7526 cliquetable, blkmem, childnodes[0],
id,
FALSE) );
7536 assert(reoptnode->
reopttype != (
unsigned int)SCIP_REOPTTYPE_INFSUBTREE
7554 assert(reopt !=
NULL);
7571 assert(scip !=
NULL);
7572 assert(reopt !=
NULL);
7573 assert(
set !=
NULL);
7574 assert(stat !=
NULL);
7575 assert(blkmem !=
NULL);
7580 for( c = reopt->
nglbconss-1; c >= 0; c-- )
7588 assert(reopt->
glbconss[c]->nvars > 0);
7596 for( v = 0; v < reopt->
glbconss[c]->nvars; v++ )
7605 SCIPerrorMessage(
"Expected variable type binary or (impl.) integer for variable <%s> in global constraint at pos. %d.\n",
7616 if( nbinvars == reopt->
glbconss[c]->nvars )
7618 SCIPsetDebugMsg(
set,
"-> add logic-or constraints with %d binvars\n", nbinvars);
7623 for( v = 0; v < reopt->
glbconss[c]->nvars; v++ )
7625 consvars[v] = reopt->
glbconss[c]->vars[v];
7638 consvars,
FALSE,
TRUE,
TRUE,
TRUE,
TRUE,
FALSE,
FALSE,
FALSE,
FALSE,
FALSE) );
7646 assert(reopt->
glbconss[c]->nvars == nbinvars + 2*nintvars);
7648 SCIPsetDebugMsg(
set,
"-> add bounddisjuction constraints with %d binvars, %d intvars\n", nbinvars, (
int) (2*nintvars));
7655 #ifdef SCIP_DEBUG_CONSS 7700 assert(reopt !=
NULL);
7701 assert(node !=
NULL);
7702 assert(sepastore !=
NULL);
7703 assert(blkmem !=
NULL);
7704 assert(
set !=
NULL);
7705 assert(stat !=
NULL);
7706 assert(eventqueue !=
NULL);
7707 assert(eventfilter !=
NULL);
7711 assert(id < reopt->reopttree->reoptnodessize);
7718 assert(reoptnode !=
NULL);
7721 for( c = reoptnode->
nconss-1; c >= 0; c-- )
7725 cons = reoptnode->
conss[c];
7726 assert(cons !=
NULL);
7741 for( v = 0; v < cons->nvars; v++ )
7748 assert(transvar !=
NULL);
7751 vals[ncols] = cons->vals[v];
7753 assert(cols[ncols] !=
NULL);
7757 assert(ncols == cons->nvars);
7764 SCIP_CALL(
SCIProwCreate(&cut, blkmem,
set, stat, lp, cutname, ncols, cols, vals, cons->lhs, cons->rhs,
7768 SCIPsetDebugMsg(
set,
"add cut <%s> of size %d to cutpool, [lhs, rhs] = [%g,%g] to node %lld\n", cutname,
7773 SCIP_CALL(
SCIProwCreate(&cut, blkmem,
set, stat, lp, cutname, ncols, cols, vals, cons->lhs, cons->rhs,
7775 SCIP_CALL(
SCIPsepastoreAddCut(sepastore, blkmem,
set, stat, eventqueue, eventfilter, lp,
NULL, cut,
FALSE, root,
7778 SCIPsetDebugMsg(
set,
"add cut <%s> of size %d to sepastore, [lhs, rhs] = [%g,%g] to node %lld\n", cutname,
7802 for( i = c-1; i >= 0; i-- )
7821 assert(reopt !=
NULL);
7822 assert(node !=
NULL);
7826 assert(id < reopt->reopttree->reoptnodessize);
7833 if(
SCIPsetIsGE(
set, set->reopt_objsimrootlp, 1.0) )
7865 assert(reoptnode !=
NULL);
7866 assert(
set !=
NULL);
7874 reoptnode->
nvars = 0;
7900 assert(reopt !=
NULL);
7901 assert(
set !=
NULL);
7902 assert(blkmem !=
NULL);
7903 assert(reoptnode !=
NULL);
7916 assert(reoptnode !=
NULL);
7917 assert(blkmem !=
NULL);
7936 assert(reoptnode !=
NULL);
7937 assert(var !=
NULL);
7938 assert(blkmem !=
NULL);
7940 nvars = reoptnode->
nvars;
7944 reoptnode->
vars[nvars] = var;
7969 assert(reoptnode !=
NULL);
7970 assert(
set !=
NULL);
7971 assert(vars !=
NULL);
7972 assert(bounds !=
NULL);
7975 assert(blkmem !=
NULL);
7982 SCIPsetDebugMsg(
set,
"-> constraint has size 1 -> save as normal bound change.\n");
7998 newbound = bounds[0] + 1.0;
8005 newbound = bounds[0] - 1.0;
8016 nconss = reoptnode->
nconss;
8024 if( boundtypes !=
NULL )
8030 reoptnode->
conss[nconss]->boundtypes =
NULL;
8032 reoptnode->
conss[nconss]->varssize = nvars;
8033 reoptnode->
conss[nconss]->nvars = nvars;
8034 reoptnode->
conss[nconss]->lhs = lhs;
8035 reoptnode->
conss[nconss]->rhs = rhs;
8036 reoptnode->
conss[nconss]->constype = constype;
8037 reoptnode->
conss[nconss]->linear = linear;
8051 assert(reopt !=
NULL);
8052 assert(
set !=
NULL);
8053 assert(blkmem !=
NULL);
8054 assert(cons !=
NULL);
8101 assert(reopt !=
NULL);
8102 assert(transprob !=
NULL);
8113 for( i = 0; i < nvars; i++ )
8139 assert(reopt !=
NULL);
8140 assert(transprob !=
NULL);
8143 conss = transprob->
conss;
8144 nconss = transprob->
nconss;
8149 for( i = 0; i < nconss; i++ )
8177 assert(reopt !=
NULL);
8178 assert(transprob !=
NULL);
8186 for( i = 0; i < nvars; i++ )
8220 assert(reopt !=
NULL);
8226 for( i = 0; i < nentries; i++ )
8235 assert(cons !=
NULL);
8257 assert(reopt !=
NULL);
8258 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
SCIP_RETCODE SCIPrandomCreate(SCIP_RANDNUMGEN **randnumgen, BMS_BLKMEM *blkmem, unsigned int initialseed)
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)
void SCIPrandomFree(SCIP_RANDNUMGEN **randnumgen)
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)
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 SCIPcutpoolAddRow(SCIP_CUTPOOL *cutpool, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_ROW *row)
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_RETCODE SCIPsepastoreAddCut(SCIP_SEPASTORE *sepastore, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_EVENTQUEUE *eventqueue, SCIP_EVENTFILTER *eventfilter, SCIP_LP *lp, SCIP_SOL *sol, SCIP_ROW *cut, SCIP_Bool forcecut, SCIP_Bool root, SCIP_Bool *infeasible)
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_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)
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)
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