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);
1345 assert(reopt != NULL);
1351 for( i = 0; i < nentries; i++ )
1360 assert(cons != NULL);
1385 assert(reopt != NULL);
1386 assert(blkmem != NULL);
1387 assert(node != NULL);
1388 assert(0 <
id && id < reopt->reopttree->reoptnodessize);
1395 if( nconsprops > 0 )
1407 assert(nvars + naddedbndchgs <= reopt->reopttree->reoptnodes[
id]->varssize);
1411 *transintoorig =
TRUE;
1439 assert(reopt != NULL);
1440 assert(blkmem != NULL);
1441 assert(node != NULL);
1442 assert(0 <
id && id < reopt->reopttree->reoptnodessize);
1496 if( nbranchvars > 0 )
1497 *transintoorig =
TRUE;
1499 SCIPsetDebugMsg(
set,
" -> save %d bound changes after dual reductions\n", nbranchvars);
1501 assert(nbranchvars <= reopt->reopttree->reoptnodes[
id]->afterdualvarssize);
1522 assert(reopt != NULL);
1523 assert(
set != NULL);
1525 assert(blkmem != NULL);
1530 for( r = 0; r < nlprows; r++ )
1562 for( c = 0; c < ncutvars; c++ )
1568 assert(cutvars[c] != NULL);
1574 assert(cutvars[c] != NULL);
1583 cutvals[c] = cutvals[c]/scalar;
1606 assert(reopt != NULL );
1607 assert(0 <
id && id < reopt->reopttree->reoptnodessize);
1649 unsigned int* parentid,
1653 assert(reopt != NULL);
1663 int nbranchings = 0;
1666 if( set->reopt_saveconsprop )
1671 (*nbndchgs) = (*nbndchgs) + nbranchings + nconsprop;
1709 unsigned int parentid,
1710 unsigned int childid
1715 assert(reopttree != NULL);
1716 assert(blkmem != NULL);
1719 assert(reopttree->
reoptnodes[parentid] != NULL);
1731 SCIPsetDebugMsg(
set,
"add ID %u as a child of ID %u.\n", childid, parentid);
1742 unsigned int nodeid,
1743 unsigned int parentid
1746 unsigned int childid;
1750 assert(reopt != NULL);
1751 assert(blkmem != NULL);
1752 assert(0 < nodeid && nodeid < reopt->reopttree->reoptnodessize);
1753 assert(parentid < reopt->reopttree->reoptnodessize);
1766 assert(0 < childid && childid < reopt->reopttree->reoptnodessize);
1808 assert(reopttree != NULL );
1809 assert(blkmem != NULL);
1810 assert(id < reopttree->reoptnodessize);
1816 SCIPsetDebugMsg(
set,
"-> delete subtree induced by ID %u (hard remove = %u)\n",
id, exitsolve);
1821 unsigned int childid;
1825 assert(0 < childid && childid < reopttree->reoptnodessize);
1856 assert(reopt != NULL);
1857 assert(node != NULL);
1858 assert(id < reopt->reopttree->reoptnodessize);
1861 assert(reoptnodes != NULL);
1862 assert(reoptnodes[
id] != NULL);
1864 if( reoptnodes[
id]->childids != NULL && reoptnodes[
id]->nchilds > 0 )
1867 unsigned int parentid = 0;
1872 assert(parentid !=
id);
1873 assert(reoptnodes[parentid] != NULL );
1874 assert(reoptnodes[parentid]->childids != NULL && reoptnodes[parentid]->nchilds);
1884 if( ndomchgs <= set->reopt_maxdiffofnodes )
1889 id, reoptnodes[
id]->nchilds);
1896 while( reoptnodes[parentid]->childids[c] !=
id )
1899 assert(c < reoptnodes[parentid]->nchilds);
1902 assert(reoptnodes[parentid]->childids[c] ==
id);
1906 --reoptnodes[parentid]->
nchilds;
1929 assert(reopttree != NULL);
1930 assert(id < reopttree->reoptnodessize);
1935 unsigned int childid;
1941 while( seenids < nchildids )
1945 assert(childid < reopttree->reoptnodessize);
1946 assert(reopttree->
reoptnodes[childid] != NULL);
1974 assert(reoptnode != NULL);
1975 assert(blkmem != NULL);
2014 assert(reopt != NULL);
2016 assert(
set != NULL);
2017 assert(blkmem != NULL);
2018 assert(node != NULL);
2019 assert(transvars != NULL);
2022 assert(node != NULL);
2024 *localrestart =
FALSE;
2027 assert(id < reopt->reopttree->reoptnodessize);
2033 if( set->reopt_objsimdelay > -1 )
2047 for( v = 0; v < ntransvars; v++ )
2056 assert(0 <= idx && idx < ntransvars);
2061 sim += (oldcoef * newcoef);
2067 if(
SCIPsetIsLT(
set, sim, set->reopt_objsimdelay) )
2070 *localrestart =
TRUE;
2083 SCIPsetDebugMsg(
set,
" -> local similarity: %.4f%s\n", sim, *localrestart ?
" (solve subproblem from scratch)" :
"");
2098 unsigned int parentid
2103 assert(reopttree != NULL );
2104 assert(node != NULL );
2105 assert(parent != NULL );
2106 assert(1 <=
id && id < reopttree->reoptnodessize);
2108 assert(parentid < reopttree->reoptnodessize);
2109 assert(parentid == 0 || reopttree->
reoptnodes[parentid] != NULL );
2147 assert(nbranchvars <= reopttree->reoptnodes[
id]->varssize);
2151 assert(nbranchvars <= reopttree->reoptnodes[
id]->varssize);
2173 assert(reoptconsdata != NULL);
2174 assert(cons != NULL);
2177 allocbuffervals =
FALSE;
2178 reoptconsdata->linear =
TRUE;
2188 reoptconsdata->varssize = reoptconsdata->nvars;
2191 reoptconsdata->boundtypes = NULL;
2194 assert(conshdlr != NULL);
2210 allocbuffervals =
TRUE;
2212 for( v = 0; v < reoptconsdata->nvars; v++ )
2215 reoptconsdata->lhs = 1.0;
2224 allocbuffervals =
TRUE;
2226 for( v = 0; v < reoptconsdata->nvars; v++ )
2231 reoptconsdata->lhs = 1.0;
2232 reoptconsdata->rhs = 1.0;
2236 reoptconsdata->rhs = 1.0;
2239 reoptconsdata->lhs = 1.0;
2255 assert(vars != NULL);
2256 assert(vals != NULL);
2259 for( v = 0; v < reoptconsdata->nvars; v++ )
2264 assert(vars[v] != NULL);
2266 reoptconsdata->vars[v] = vars[v];
2267 reoptconsdata->vals[v] = vals[v];
2273 reoptconsdata->vals[v] *= scalar;
2276 reoptconsdata->lhs -= constant;
2278 reoptconsdata->rhs -= constant;
2282 if( allocbuffervals )
2306 assert(reoptconsdata != NULL);
2307 assert(cons != NULL);
2310 reoptconsdata->linear =
FALSE;
2313 assert(conshdlr != NULL);
2318 SCIPerrorMessage(
"Cannot handle constraints of type <%s> in saveConsBounddisjuction.\n",
2333 reoptconsdata->varssize = reoptconsdata->nvars;
2338 for( v = 0; v < reoptconsdata->nvars; v++ )
2343 assert(reoptconsdata->vars[v] != NULL);
2349 reoptconsdata->vals[v] -= constant;
2350 reoptconsdata->vals[v] *= scalar;
2376 assert(node != NULL );
2377 assert(reopttree != NULL);
2378 assert(id < reopttree->reoptnodessize);
2385 SCIPsetDebugMsg(
set,
" -> save %d locally added constraints\n", addedconsssize);
2397 for( c = nconss; c < naddedconss; c++ )
2470 assert(reopt != NULL);
2472 assert(id < reopt->reopttree->reoptnodessize);
2474 assert(node != NULL);
2475 assert(blkmem != NULL);
2494 &nbndchgs, reopt->
dualreds->varssize);
2495 assert(nbndchgs <= reopt->dualreds->varssize);
2501 for( v = 0; v < nbndchgs; v++ )
2513 assert(nbndchgs > 0);
2525 cons_is_next =
FALSE;
2536 reopt->
dualreds->vars, nbndchgs) );
2538 reopt->
dualreds->vals, nbndchgs) );
2540 reopt->
dualreds->boundtypes, nbndchgs) );
2550 SCIPsetDebugMsg(
set,
" -> save dual information of type 1: node %lld, nvars %d, constype %d\n",
2562 reopt->
dualreds->vars, nbndchgs) );
2564 reopt->
dualreds->vals, nbndchgs) );
2566 reopt->
dualreds->boundtypes, nbndchgs) );
2574 SCIPsetDebugMsg(
set,
" -> save dual information of type 2: node %lld, nvars %d, constype %d\n",
2599 unsigned int parentid = 0;
2601 assert(reopt != NULL);
2602 assert(
set != NULL);
2603 assert(blkmem != NULL);
2604 assert(node != NULL);
2606 if( set->reopt_maxsavednodes == 0 )
2627 assert(!isrootnode);
2630 assert(id < reopt->reopttree->reoptnodessize);
2640 assert(parent != NULL);
2652 assert(parent != NULL);
2661 assert(parentid == 0
2679 transintoorig =
FALSE;
2682 if( set->reopt_usecuts )
2695 if( set->reopt_saveconsprop )
2711 #ifdef SCIP_MORE_DEBUG 2745 if( set->reopt_shrinkinner )
2765 if( set->reopt_reducetofrontier )
2779 if( set->reopt_reducetofrontier )
2829 if( set->reopt_usecuts )
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,
2910 if( set->reopt_reducetofrontier )
2929 SCIPsetDebugMsg(
set,
" -> nvars: 0, ncons: 0, parentID: -, reopttype: %u, lowerbound:%g \n", reopttype,
2990 assert(
id >= 1 && id < reopt->reopttree->reoptnodessize);
2991 assert(!isrootnode);
2998 assert(parent != NULL );
3023 SCIPsetDebugMsg(
set,
" -> skip saving bound changes after dual reductions.\n");
3041 if( set->reopt_usecuts )
3057 SCIPsetDebugMsg(
set,
" -> nvars: %d, ncons: %d, parentID: %u, reopttype: %d, lowerbound: %g\n",
3061 #ifdef SCIP_MORE_DEBUG 3160 assert(reopt != NULL);
3178 assert(reoptnode != NULL);
3179 assert(blkmem != NULL);
3240 assert(reopt != NULL);
3241 assert(blkmem != NULL);
3242 assert(
set != NULL);
3243 assert(vars != NULL);
3244 assert(vals != NULL);
3245 assert(nbinvars + nintvars == nvars);
3252 reoptconsdata = NULL;
3254 if( reopt->
glbconss[nglbconss] == NULL )
3257 reoptconsdata = reopt->
glbconss[nglbconss];
3262 reoptconsdata->varssize = (int)(nbinvars+2*nintvars);
3263 reoptconsdata->nvars = 0;
3267 assert(reopt->
glbconss[nglbconss]->nvars == 0);
3268 assert(reopt->
glbconss[nglbconss]->varssize > 0);
3270 reoptconsdata = reopt->
glbconss[nglbconss];
3272 if( reoptconsdata->varssize < nbinvars+2*nintvars )
3275 (
int)(nbinvars+2*nintvars)) );
3277 (
int)(nbinvars+2*nintvars)) );
3279 (
int)(nbinvars+2*nintvars)) );
3280 reoptconsdata->varssize = (int)(nbinvars+2*nintvars);
3283 assert(reoptconsdata != NULL);
3285 reoptconsdata->lhs = 1.0;
3287 reoptconsdata->linear =
FALSE;
3290 for( v = 0; v < nvars; v++ )
3292 assert(nvarsadded < reoptconsdata->varssize);
3293 assert(vars[v] != NULL);
3307 reoptconsdata->vars[nvarsadded] = vars[v];
3312 reoptconsdata->vals[nvarsadded] = 0.0;
3319 reoptconsdata->vals[nvarsadded] = 1.0;
3326 assert(boundtypes != NULL);
3328 reoptconsdata->vals[nvarsadded] = vals[v];
3340 reoptconsdata->vars[nvarsadded] = vars[v];
3356 reoptconsdata->vals[nvarsadded] = ubglb - 1.0;
3364 reoptconsdata->vals[nvarsadded] = lbglb + 1.0;
3368 else if( boundtypes != NULL )
3377 reoptconsdata->vals[nvarsadded] = roundedval + 1.0;
3385 reoptconsdata->vals[nvarsadded] = roundedval - 1.0;
3398 reoptconsdata->vals[nvarsadded] = roundedval - 1.0;
3403 reoptconsdata->vars[nvarsadded] = vars[v];
3404 reoptconsdata->vals[nvarsadded] = roundedval + 1.0;
3410 assert(nvars <= nvarsadded);
3411 assert(nvarsadded == nbinvars + 2 * nintvars);
3413 reoptconsdata->nvars = nvarsadded;
3429 assert(reopt != NULL);
3430 assert(node != NULL);
3452 if( allocmem < nbranchvars )
3457 allocmem = nbranchvars;
3465 for( v = 0; v < nbranchvars; v++ )
3472 assert(nbinvars + nintvars == nbranchvars);
3474 SCIP_CALL(
addGlobalCut(reopt, blkmem,
set, vars, vals, boundtypes, nbranchvars, nbinvars, nintvars) );
3501 assert(reopttree != NULL);
3502 assert(blkmem != NULL);
3503 assert(id1 < reopttree->reoptnodessize);
3504 assert(id2 < reopttree->reoptnodessize);
3515 SCIPsetDebugMsg(
set,
"move %d IDs: %u -> %u\n", nchilds_id1, id1, id2);
3518 for( c = 0; c < nchilds_id1; c++ )
3524 for( k = 0; k < nchilds_id2; k++ )
3564 assert(reopt != NULL);
3565 assert(
set != NULL);
3566 assert(stat != NULL);
3567 assert(transprob != NULL);
3568 assert(tree != NULL);
3570 assert(branchcand != NULL);
3571 assert(eventqueue != NULL);
3572 assert(cliquetable != NULL);
3573 assert(node != NULL);
3574 assert(blkmem != NULL);
3577 assert(reopttree != NULL);
3578 assert(id < reopttree->reoptnodessize);
3581 assert(reoptnode != NULL);
3588 for( v = 0; v < reoptnode->
nvars; v++ )
3597 var = reoptnode->
vars[v];
3626 #ifdef SCIP_MORE_DEBUG 3682 #ifdef SCIP_MORE_DEBUG 3689 nvars = reoptnode->
nvars;
3737 assert(reopt != NULL);
3739 assert(id < reopt->reopttree->reoptnodessize);
3743 assert(scip != NULL);
3744 assert(
set != NULL);
3745 assert(stat != NULL);
3746 assert(blkmem != NULL);
3747 assert(transprob != NULL);
3748 assert(origprob != NULL);
3749 assert(tree != NULL);
3751 assert(branchcand != NULL);
3752 assert(eventqueue != NULL);
3753 assert(node != NULL);
3777 assert(!reoptconsdata->linear);
3778 assert(reoptconsdata->vars != NULL);
3779 assert(reoptconsdata->vals != NULL);
3780 assert(reoptconsdata->boundtypes != NULL);
3782 var = reoptconsdata->vars[0];
3783 newbound = reoptconsdata->vals[0];
3784 boundtype = reoptconsdata->boundtypes[0];
3795 newbound = reoptconsdata->vals[0] - 1.0;
3796 assert(
SCIPisLE(scip, newbound, oldub));
3800 newbound = reoptconsdata->vals[0] + 1.0;
3801 assert(
SCIPisGE(scip, newbound, oldlb));
3833 assert(!reoptconsdata->linear);
3834 assert(reoptconsdata->vars != NULL);
3835 assert(reoptconsdata->vals != NULL);
3836 assert(reoptconsdata->boundtypes != NULL);
3842 for( v = 0; v < reoptconsdata->nvars; v++ )
3860 SCIPerrorMessage(
"Variable <%s> has to be either binary, (implied) integer, or continuous.\n",
3875 if( reoptconsdata->nvars == nbinvars )
3877 for( v = 0; v < reoptconsdata->nvars; v++ )
3879 consvars[v] = reoptconsdata->vars[v];
3880 consval = reoptconsdata->vals[v];
3904 assert(nintvars > 0 || ncontvars > 0);
3911 for( v = 0; v < reoptconsdata->nvars; v++ )
3913 consvars[v] = reoptconsdata->vars[v];
3914 consvals[v] = reoptconsdata->vals[v];
3915 consboundtypes[v] = reoptconsdata->boundtypes[v];
3949 consvals,
FALSE,
FALSE,
TRUE,
FALSE,
TRUE,
TRUE,
FALSE,
FALSE,
FALSE,
TRUE) );
3957 #ifdef SCIP_DEBUG_CONSS 3994 assert(reopt != NULL);
3995 assert(
set != NULL);
3996 assert(stat != NULL);
3997 assert(transprob != NULL);
3998 assert(origprob != NULL);
3999 assert(tree != NULL);
4001 assert(branchcand != NULL);
4002 assert(eventqueue != NULL);
4003 assert(cliquetable != NULL);
4004 assert(node != NULL);
4005 assert(blkmem != NULL);
4008 assert(reopttree != NULL);
4009 assert(0 <
id && id < reopttree->reoptnodessize);
4012 assert(reoptnode != NULL);
4019 for( v = 0; v < reoptnode->
dualredscur->nvars; v++ )
4028 boundtype = reoptnode->
dualredscur->boundtypes[v];
4058 #ifdef SCIP_MORE_DEBUG 4068 pos = reoptnode->
nvars;
4070 reoptnode->
vars[pos] = var;
4082 if( updatedualconss )
4123 assert(reopt != NULL);
4124 assert(
set != NULL);
4125 assert(stat != NULL);
4126 assert(transprob != NULL);
4127 assert(origprob != NULL);
4128 assert(tree != NULL);
4130 assert(branchcand != NULL);
4131 assert(eventqueue != NULL);
4132 assert(cliquetable != NULL);
4133 assert(node != NULL);
4134 assert(perm != NULL);
4135 assert(vars != NULL);
4136 assert(vals != NULL);
4137 assert(boundtypes != NULL);
4139 assert(blkmem != NULL);
4140 assert(0 <
id && id < reopt->reopttree->reoptnodessize);
4148 assert(reopttree != NULL);
4151 assert(reoptnode != NULL);
4156 nbndchgs = MIN(negbndchg, nvars);
4159 for( v = 0; v < nbndchgs; v++ )
4161 var = vars[perm[v]];
4162 val = vals[perm[v]];
4163 boundtype = boundtypes[perm[v]];
4169 if( v == nbndchgs-1 )
4197 #ifdef SCIP_MORE_DEBUG 4220 assert(scip != NULL);
4221 assert(reopt != NULL);
4223 assert(
set != NULL);
4224 assert(stat != NULL);
4225 assert(blkmem != NULL);
4226 assert(node != NULL);
4227 assert(0 <
id && id < reopt->reopttree->reoptnodessize);
4241 assert(reoptconsdata != NULL);
4242 assert(reoptconsdata->nvars > 0);
4243 assert(reoptconsdata->varssize >= reoptconsdata->nvars);
4255 if( reoptconsdata->linear )
4258 reoptconsdata->lhs, reoptconsdata->rhs,
FALSE,
FALSE,
TRUE,
TRUE,
TRUE,
TRUE,
FALSE,
FALSE,
FALSE,
TRUE) );
4262 assert(reoptconsdata->boundtypes != NULL);
4264 reoptconsdata->vals,
FALSE,
FALSE,
TRUE,
TRUE,
TRUE,
TRUE,
FALSE,
FALSE,
FALSE,
TRUE) );
4266 #ifdef SCIP_DEBUG_CONSS 4282 assert(reopt != NULL);
4309 unsigned int* cutoffchilds;
4310 int ncutoffchilds = 0;
4311 unsigned int* redchilds;
4315 assert(reopt != NULL);
4317 assert(id < reopt->reopttree->reoptnodessize);
4333 for( c = 0; c < reoptnode->
nchilds; c++ )
4341 unsigned int childid;
4348 assert(childid < reopt->reopttree->reoptnodessize);
4350 assert(child != NULL);
4351 #ifdef SCIP_MORE_DEBUG 4354 if( child->
nvars > 0 )
4359 for( v = 0; v < child->
nvars && !cutoff; v++ )
4367 transvar = child->
vars[v];
4380 SCIPsetDebugMsg(
set,
" -> <%s> is fixed to %g, can not change bound to %g -> cutoff\n",
4390 SCIPsetDebugMsg(
set,
" -> <%s> is already fixed to %g -> redundant bound change\n",
4393 redundantvars[nredundantvars] = v;
4398 if( !cutoff && nredundantvars > 0 )
4400 for( v = 0; v < nredundantvars; v++ )
4403 child->
vars[redundantvars[v]] = child->
vars[child->
nvars-1];
4413 else if( child->
nconss == 0 )
4421 cutoffchilds[ncutoffchilds] = childid;
4424 else if( redundant )
4426 redchilds[nredchilds] = childid;
4431 SCIPsetDebugMsg(
set,
"-> found %d redundant and %d infeasible nodes\n", nredchilds, ncutoffchilds);
4434 while( ncutoffchilds > 0 )
4441 while( reoptnode->
childids[c] != cutoffchilds[ncutoffchilds-1] && c < reoptnode->nchilds )
4443 assert(reoptnode->
childids[c] == cutoffchilds[ncutoffchilds-1]);
4454 while( nredchilds > 0 )
4458 while( reoptnode->
childids[c] != redchilds[nredchilds-1] && c < reoptnode->nchilds )
4460 assert(reoptnode->
childids[c] == redchilds[nredchilds-1]);
4490 for( cc = 0; cc < ncc; cc++ )
4525 assert(reopttree != NULL);
4526 assert(id < reopttree->reoptnodessize);
4544 assert(reopt != NULL);
4545 assert(id < reopt->reopttree->reoptnodessize);
4551 unsigned int childid;
4554 assert(childid < reopt->reopttree->reoptnodessize);
4570 unsigned int* leaves,
4578 assert(reopt != NULL);
4579 assert(leavessize > 0 && leaves != NULL);
4580 assert((*nleaves) >= 0);
4581 assert(id < reopt->reopttree->reoptnodessize);
4586 unsigned int childid;
4588 assert(*nleaves <= leavessize);
4591 assert(childid < reopt->reopttree->reoptnodessize);
4605 (*nleaves) += nleaves2;
4621 assert(reopt != NULL);
4622 assert(
set != NULL);
4623 assert(blkmem != NULL);
4646 assert(reopt != NULL);
4648 assert(
set != NULL);
4649 assert(blkmem != NULL);
4681 assert(reopt != NULL);
4682 assert(
set != NULL);
4683 assert(blkmem != NULL);
4684 assert(origvars != NULL);
4685 assert(norigvars >= 0);
4694 for( i = 0; i < reopt->
run-1; i++ )
4697 for( v = reopt->
nobjvars-1; v < norigvars; v++ )
4698 reopt->
objs[i][v] = 0.0;
4705 for( v = 0; v < norigvars; v++ )
4719 for( i = 0; i < reopt->
run; i++ )
4722 for( j = reopt->
nobjvars; j < newsize; j++ )
4723 reopt->
objs[i][j] = 0.0;
4727 assert(0 <= probidx && probidx < reopt->nobjvars);
4737 if( reopt->
firstobj == -1 && reopt->
objs[reopt->
run-1][probidx] != 0 )
4742 if( reopt->
run-1 >= 1 )
4774 assert(
set != NULL);
4775 assert(perm != NULL);
4776 assert(vars != NULL);
4777 assert(bounds != NULL);
4778 assert(boundtypes != NULL);
4784 for( v = 0; v < nvars; v++ )
4826 assert(reopt != NULL);
4827 assert(sol != NULL);
4828 assert(blkmem != NULL);
4829 assert(
set != NULL);
4830 assert(stat != NULL);
4831 assert(vars != NULL);
4843 for( v = 0, w = 0; v < nvars; v++ )
4846 assert(nbinvars + nintvars == w);
4857 origvars[v] = vars[v];
4858 assert(origvars[v] != NULL);
4886 #undef SCIPreoptGetNRestartsGlobal 4887 #undef SCIPreoptGetNRestartsLocal 4888 #undef SCIPreoptGetNTotalRestartsLocal 4889 #undef SCIPreoptGetFirstRestarts 4890 #undef SCIPreoptGetLastRestarts 4891 #undef SCIPreoptGetNFeasNodes 4892 #undef SCIPreoptGetNTotalFeasNodes 4893 #undef SCIPreoptGetNPrunedNodes 4894 #undef SCIPreoptGetNTotalPrunedNodes 4895 #undef SCIPreoptGetNCutoffReoptnodes 4896 #undef SCIPreoptGetNTotalCutoffReoptnodes 4897 #undef SCIPreoptGetNInfNodes 4898 #undef SCIPreoptGetNTotalInfNodes 4899 #undef SCIPreoptGetNInfSubtrees 4907 assert(reopt != NULL);
4917 assert(reopt != NULL);
4927 assert(reopt != NULL);
4937 assert(reopt != NULL);
4947 assert(reopt != NULL);
4957 assert(reopt != NULL);
4967 assert(reopt != NULL);
4977 assert(reopt != NULL);
4987 assert(reopt != NULL);
4997 assert(reopt != NULL);
5007 assert(reopt != NULL);
5017 assert(reopt != NULL);
5027 assert(reopt != NULL);
5042 assert(reopt != NULL);
5047 (*reopt)->simtolastobj = -2.0;
5048 (*reopt)->simtofirstobj = -2.0;
5049 (*reopt)->firstobj = -1;
5050 (*reopt)->currentnode = -1;
5051 (*reopt)->lastbranched = -1;
5052 (*reopt)->dualreds = NULL;
5053 (*reopt)->glbconss = NULL;
5054 (*reopt)->nglbconss = 0;
5055 (*reopt)->allocmemglbconss = 0;
5056 (*reopt)->ncheckedsols = 0;
5057 (*reopt)->nimprovingsols = 0;
5058 (*reopt)->noptsolsbyreoptsol = 0;
5059 (*reopt)->nglbrestarts = 0;
5060 (*reopt)->nlocrestarts = 0;
5061 (*reopt)->ntotallocrestarts = 0;
5062 (*reopt)->firstrestart = -1;
5063 (*reopt)->lastrestart = 0;
5064 (*reopt)->nobjvars = 0;
5065 (*reopt)->objhaschanged =
FALSE;
5066 (*reopt)->consadded =
FALSE;
5067 (*reopt)->addedconss = NULL;
5068 (*reopt)->naddedconss = 0;
5069 (*reopt)->addedconsssize = 0;
5070 (*reopt)->glblb = NULL;
5071 (*reopt)->glbub = NULL;
5072 (*reopt)->activeconss = NULL;
5078 for( i = 0; i < (*reopt)->runsize; i++ )
5080 (*reopt)->objs[i] = NULL;
5081 (*reopt)->prevbestsols[i] = NULL;
5082 (*reopt)->varhistory[i] = NULL;
5104 eventExitsolReopt, NULL, eventExecReopt, NULL) );
5106 assert(eventhdlr != NULL);
5145 assert(reopt != NULL);
5146 assert(*reopt != NULL);
5147 assert(
set != NULL);
5149 assert(blkmem != NULL);
5161 for( p = (*reopt)->run-1; p >= 0; p-- )
5163 if( (*reopt)->soltree->sols[p] != NULL )
5166 (*reopt)->soltree->sols[p] = NULL;
5172 if( set->reopt_sepabestsol && (*reopt)->prevbestsols[p] != NULL )
5177 if( (*reopt)->objs[p] != NULL )
5187 if( (*reopt)->dualreds != NULL )
5189 if( (*reopt)->dualreds->varssize > 0 )
5191 assert(!(*reopt)->dualreds->linear);
5197 (*reopt)->dualreds = NULL;
5201 if( (*reopt)->glbconss != NULL && (*reopt)->allocmemglbconss > 0 )
5206 for( c = 0; c < (*reopt)->allocmemglbconss; c++ )
5208 if( (*reopt)->glbconss[c] != NULL )
5210 if( (*reopt)->glbconss[c]->varssize > 0 )
5215 (*reopt)->glbconss[c]->varssize = 0;
5218 --(*reopt)->nglbconss;
5222 assert((*reopt)->nglbconss == 0);
5225 (*reopt)->allocmemglbconss = 0;
5232 (*reopt)->activeconss = NULL;
5234 if( (*reopt)->glblb != NULL )
5238 (*reopt)->glblb = NULL;
5239 (*reopt)->glbub = NULL;
5242 assert((*reopt)->glbub == NULL);
5260 assert(reopt != NULL);
5261 assert(node != NULL);
5264 assert(id < reopt->reopttree->reoptnodessize);
5295 assert(reopt != NULL);
5296 assert(
set != NULL);
5297 assert(sol != NULL);
5304 if( heur != NULL && strcmp(
SCIPheurGetName(heur),
"reoptsols") == 0 && bestsol )
5313 SCIP_CALL(
soltreeAddSol(reopt,
set, stat, origprimal, blkmem, vars, sol, &solnode, nvars, bestsol, added) );
5317 assert(solnode != NULL);
5323 assert(reopt->
soltree->
nsols[run-1] <= set->reopt_savesols);
5344 assert(reopt != NULL);
5345 assert(reopt->
run-1 >= 0);
5346 assert(sol != NULL);
5347 assert(blkmem != NULL);
5348 assert(
set != NULL);
5349 assert(stat != NULL);
5350 assert(origprimal != NULL);
5356 if( set->reopt_sepabestsol )
5374 assert(reopt != NULL);
5375 assert(
set != NULL);
5376 assert(blkmem != NULL);
5377 assert(origvars != NULL);
5405 assert(reopt != NULL);
5416 assert(reopt != NULL);
5426 assert(reopt != NULL);
5437 assert(reopt != NULL);
5448 assert(reopt != NULL);
5449 assert(0 < run && run <= reopt->runsize);
5465 assert(reopt != NULL);
5467 for( r = 0; r < reopt->
run; r++)
5484 assert(reopt != NULL);
5485 assert(run > 0 && run <= reopt->run);
5486 assert(sols != NULL);
5488 assert(solssize > 0);
5489 assert(nsols != NULL);
5498 if( solssize < (*nsols) )
5522 assert(reopt != NULL);
5555 assert(reopt != NULL);
5556 assert(
set != NULL);
5557 assert(blkmem != NULL);
5558 assert(transvars != NULL);
5559 assert(ntransvars >= 0);
5560 assert(restart != NULL);
5568 if( reopt->
run > 1 && set->reopt_objsimdelay > -1.0 )
5579 SCIPsetDebugMsg(
set,
"-> restart reoptimization (objective functions are not similar enough)\n");
5585 SCIPsetDebugMsg(
set,
"-> restart reoptimization (node limit reached)\n");
5591 SCIPsetDebugMsg(
set,
"-> restart reoptimization (found last %d optimal solutions by <reoptsols>)\n",
5616 assert(reopt != NULL);
5625 assert(reopt != NULL);
5639 assert(reopt != NULL);
5640 assert(run1 > 0 && run1 <= reopt->run);
5641 assert(run2 > 0 && run2 <= reopt->run);
5642 assert(origvars != NULL);
5643 assert(norigvars >= 0);
5645 return reoptSimilarity(reopt,
set, run1-1, run2-1, origvars, norigvars);
5653 assert(reopt != NULL);
5656 if( reopt->
run-2 < 0 )
5668 assert(reopt != NULL);
5670 assert(id < reopt->reopttree->reoptnodessize);
5683 assert(reopt != NULL);
5684 assert(0 < run && run <= reopt->runsize);
5686 return reopt->
objs[run-1][idx];
5698 assert(reopt != NULL);
5699 assert(0 < run && run <= reopt->run);
5713 assert(reopt != NULL);
5714 assert(
set != NULL);
5715 assert(blkmem != NULL);
5723 assert(cons != NULL);
5743 assert(reopt != NULL);
5744 assert(reopt->
soltree != NULL);
5750 while( child != NULL )
5765 assert(reopt != NULL);
5771 assert(id < reopt->reopttree->reoptnodessize);
5777 assert(0 <
id && id < reopt->reopttree->reoptnodessize);
5790 #undef SCIPreoptnodeGetNVars 5791 #undef SCIPreoptnodeGetNConss 5792 #undef SCIPreoptnodeGetNDualBoundChgs 5793 #undef SCIPreoptnodeGetNChildren 5794 #undef SCIPreoptnodeGetLowerbound 5795 #undef SCIPreoptnodeGetType 5802 assert(reoptnode != NULL);
5812 assert(reoptnode != NULL);
5814 return reoptnode->
nconss;
5822 assert(reoptnode != NULL);
5835 assert(reoptnode != NULL);
5845 assert(reoptnode != NULL);
5855 assert(reoptnode != NULL);
5873 assert(reoptnode != NULL);
5874 assert(vars != NULL);
5875 assert(bounds != NULL);
5876 assert(boundtypes != NULL);
5877 assert(nvars != NULL);
5878 assert(nconss != NULL);
5880 (*nconss) = reoptnode->
nconss;
5885 for( c = 0; c < *nconss; c++ )
5887 assert(vars[c] != NULL);
5888 assert(bounds[c] != NULL);
5890 vars[c] = reoptnode->
conss[c]->vars;
5891 bounds[c] = reoptnode->
conss[c]->vals;
5892 boundtypes[c] = reoptnode->
conss[c]->boundtypes;
5893 nvars[c] = reoptnode->
conss[c]->nvars;
5900 unsigned int parentid
5903 assert(reoptnode != NULL);
5904 assert(parentid <= 536870911);
5919 assert(reopt != NULL);
5922 assert(id < reopt->reopttree->reoptnodessize);
5930 unsigned int childid;
5933 assert(childid < reopt->reopttree->reoptnodessize);
5952 assert(reopt != NULL);
5953 assert(
set != NULL);
5954 assert(blkmem != NULL);
5955 assert(node != NULL);
5957 if( set->reopt_sepaglbinfsubtrees )
5980 int effectiverootdepth
5985 assert(reopt != NULL);
5986 assert(
set != NULL);
5987 assert(blkmem != NULL);
5989 assert(node != NULL);
6037 lowerbound = MIN(lowerbound, cutoffbound);
6042 isrootnode, lowerbound) );
6059 SCIPsetDebugMsg(
set,
" -> focusnode : %s\n", isfocusnode ?
"yes" :
"no");
6061 SCIPsetDebugMsg(
set,
" -> strong branched : %s\n", strongbranched ?
"yes" :
"no");
6068 assert(isfocusnode);
6097 if( strongbranched )
6169 assert(isfocusnode);
6181 if( strongbranched )
6207 if( strongbranched )
6251 assert(reopt != NULL);
6252 assert(node != NULL);
6275 allocmem = reopt->
dualreds->nvars + resizelength;
6280 assert(reopt->
dualreds->varssize > 0);
6281 assert(reopt->
dualreds->nvars >= 0);
6290 newval = (newval - constant) / scalar;
6291 oldval = (oldval - constant) / scalar;
6297 SCIPerrorMessage(
"cannot store equal bounds: old = %g, new = %g\n", oldval, newval);
6333 int ndualbndchgs = 0;
6335 assert(reopt != NULL);
6336 assert(node != NULL);
6341 ndualbndchgs = reopt->
dualreds->nvars;
6344 return ndualbndchgs;
6353 unsigned int* childs,
6361 assert(reopt != NULL);
6362 assert(childssize > 0 && childs != NULL);
6363 assert(nchilds != NULL);
6373 assert(id < reopt->reopttree->reoptnodessize);
6390 if( childssize < *nchilds )
6393 for( c = 0; c < *nchilds; c++ )
6404 unsigned int* leaves,
6412 assert(reopt != NULL);
6413 assert(leavessize > 0 && leaves != NULL);
6414 assert((*nleaves) >= 0);
6423 if(
id == 0 && node != NULL )
6429 assert(id < reopt->reopttree->reoptnodessize);
6432 for( i = 0; i < leavessize; i++ )
6438 unsigned int childid;
6440 assert(*nleaves + 1 <= leavessize);
6443 assert(childid < reopt->reopttree->reoptnodessize);
6457 (*nleaves) += nleaves2;
6480 assert(reopt != NULL);
6481 assert(
set != NULL);
6482 assert(blkmem != NULL);
6483 assert(nleaves >= 0);
6484 assert(nleaves == 0 || leaves != NULL);
6485 assert(nchilds >= 0);
6486 assert(nchilds == 0 || childs != NULL);
6487 assert(nsiblings >= 0);
6488 assert(nsiblings == 0 || siblings != NULL);
6490 SCIPsetDebugMsg(
set,
"save unprocessed nodes (%d leaves, %d children, %d siblings)\n", nleaves, nchilds, nsiblings);
6493 for( n = 0; n < nleaves; n++ )
6500 for( n = 0; n < nchilds; n++ )
6507 for( n = 0; n < nsiblings; n++ )
6535 assert(reopt != NULL);
6536 assert(stat != NULL);
6539 if( !set->reopt_storevarhistory )
6544 bestrun = reopt->
run-2;
6548 for( r = reopt->
run-3; r >= 0 && reopt->
objhaschanged && set->reopt_usepscost; r-- )
6565 for( v = 0; v < nvars; v++ )
6570 assert(transvar != NULL);
6577 assert(0 <= idx && idx <= nvars);
6580 for( d = 0; d <= 1; d++ )
6604 (d == 0 ?
"down" :
"up"), avginference[d], avgcutoff[d]);
6623 assert(reopt != NULL);
6624 assert(stat != NULL);
6625 assert(blkmem != NULL);
6628 if( !set->reopt_storevarhistory )
6638 for( v = 0; v < nvars; v++ )
6645 for( v = 0; v < nvars; v++ )
6652 assert(idx >= 0 && idx < nvars);
6655 assert(transvar != NULL);
6674 int nrepresentatives,
6682 assert(reopt != NULL);
6683 assert(
set != NULL);
6684 assert(blkmem != NULL);
6685 assert(representatives != NULL);
6686 assert(nrepresentatives > 0);
6702 for( r = 0; r < nrepresentatives; r++ )
6706 assert(1 <=
id && id < reopttree->reoptnodessize);
6717 if( representatives[r]->nvars > 0 )
6721 assert(representatives[r]->nvars <= representatives[r]->varssize);
6723 for( v = 0; v < representatives[r]->
nvars; v++ )
6730 if( representatives[r]->nconss > 0 )
6734 assert(representatives[r]->nconss <= representatives[r]->consssize);
6736 for( c = 0; c < representatives[r]->
nconss; c++ )
6739 representatives[r]->
conss[c]->vals, representatives[r]->
conss[c]->boundtypes,
6740 representatives[r]->
conss[c]->lhs, representatives[r]->
conss[c]->rhs,
6741 representatives[r]->
conss[c]->nvars, representatives[r]->
conss[c]->constype,
6742 representatives[r]->
conss[c]->linear) );
6763 SCIPsetDebugMsg(
set,
"-> new tree consists of %d nodes, the root has %d child nodes.\n",
6785 assert(reopt != NULL);
6786 assert(
set != NULL);
6787 assert(blkmem != NULL);
6788 assert(consdata != NULL);
6789 assert(dualreds != NULL);
6794 consdata->boundtypes = NULL;
6796 consdata->varssize = dualreds->nvars;
6797 consdata->nvars = dualreds->nvars;
6799 consdata->linear =
TRUE;
6802 consdata->lhs = 1.0;
6805 for( v = 0; v < consdata->nvars; v++ )
6807 assert(consdata->vars[v] != NULL);
6813 consdata->vals[v] = 1.0;
6825 consdata->vals[v] = -1.0;
6826 consdata->lhs -= 1.0;
6848 assert(reopt != NULL);
6849 assert(
set != NULL);
6850 assert(blkmem != NULL);
6851 assert(consdata != NULL);
6852 assert(dualreds != NULL);
6859 consdata->varssize = dualreds->nvars;
6860 consdata->nvars = dualreds->nvars;
6862 consdata->linear =
FALSE;
6868 for( v = 0; v < consdata->nvars; v++ )
6872 assert(consdata->vars[v] != NULL);
6881 consdata->vals[v] = MIN(consdata->vals[v]+1.0, glbbd);
6887 consdata->vals[v] =
MAX(glbbd, consdata->vals[v]-1.0);
6902 int* ncreatedchilds,
6919 assert(reopt != NULL);
6920 assert(
set != NULL);
6921 assert(stat != NULL);
6922 assert(blkmem != NULL);
6925 assert(reopttree != NULL);
6928 assert(reoptnodes != NULL);
6929 assert(reoptnodes[0] != NULL);
6930 assert(reoptnodes[0]->dualreds);
6933 nchilds = reoptnodes[0]->
nchilds;
6935 assert(reoptnodes[0]->dualredscur != NULL);
6938 (*ncreatedchilds) = 0;
6948 assert(reoptnodes[
id] == NULL || reoptnodes[
id]->nvars == 0);
6961 assert(reoptnodes[
id]->varssize >= nbndchgs);
6962 assert(reoptnodes[
id]->nvars == 0);
6963 assert(reoptnodes[
id]->vars != NULL);
6964 assert(reoptnodes[
id]->varbounds != NULL);
6965 assert(reoptnodes[
id]->varboundtypes != NULL);
6968 if( !set->reopt_usesplitcons )
6970 assert(perm == NULL);
6975 for( v = 0; v < nbndchgs; v++ )
6980 ++reoptnodes[id]->
nvars;
6983 if( !set->reopt_usesplitcons )
6986 assert(reoptnodes[
id]->nvars == reoptnodes[0]->dualredscur->
nvars);
6990 assert(reoptnodes[0]->nchilds == 0);
6995 ++(*ncreatedchilds);
6997 if( set->reopt_usesplitcons )
7003 assert(*ncreatedchilds == 1);
7024 consdata = reoptnodes[id]->
conss[0];
7027 for( v = 0; v < nbndchgs; v++ )
7047 if( nbinvars == nbndchgs )
7054 assert(nintvars > 0 || ncontvars > 0);
7057 ++reoptnodes[id]->
nconss;
7061 ++(*ncreatedchilds);
7069 assert(*ncreatedchilds == 1);
7070 assert(perm != NULL);
7074 boundtypes = reoptnodes[0]->
dualredscur->boundtypes;
7076 assert(perm[0] == 0 && perm[nvars-1] == nvars-1);
7079 switch (set->reopt_varorderinterdiction)
7100 for( c = 0; c < nvars; c++ )
7107 assert(reoptnodes[
id] == NULL || reoptnodes[
id]->nvars == 0);
7119 assert(reoptnodes[
id]->varssize >= perm[c]+1);
7120 assert(reoptnodes[
id]->nvars == 0);
7121 assert(reoptnodes[
id]->vars != NULL);
7122 assert(reoptnodes[
id]->varbounds != NULL);
7123 assert(reoptnodes[
id]->varboundtypes != NULL);
7126 if( set->reopt_varorderinterdiction ==
'd' )
7129 for( v = 0; v < c; v++ )
7131 reoptnodes[id]->
vars[v] = vars[v];
7132 reoptnodes[id]->
varbounds[v] = bounds[v];
7139 for( v = 0; v < c; v++ )
7141 reoptnodes[id]->
vars[v] = vars[perm[v]];
7142 reoptnodes[id]->
varbounds[v] = bounds[perm[v]];
7146 reoptnodes[id]->
nvars += c;
7150 reoptnodes[id]->
vars[c] = vars[perm[c]];
7151 reoptnodes[id]->
varbounds[c] = bounds[perm[c]];
7160 ++reoptnodes[id]->
nvars;
7165 ++(*ncreatedchilds);
7168 assert(*ncreatedchilds == nvars+1);
7173 assert(perm == NULL);
7176 assert(reoptnodes[0]->dualredscur->
vars != NULL);
7177 assert(reoptnodes[0]->dualredscur->vals != NULL);
7178 assert(reoptnodes[0]->dualredscur->boundtypes != NULL);
7198 assert(reopt != NULL);
7199 assert(node != NULL);
7202 assert(id < reopt->reopttree->reoptnodessize);
7223 int* nbndchgsafterdual
7229 int nafterdualvars2;
7231 assert(reopt != NULL);
7232 assert(reoptnode != NULL);
7233 assert(vars != NULL);
7234 assert(vals != NULL);
7235 assert(boundtypes != NULL);
7237 (*nbndchgs) = reoptnode->
nvars;
7241 if( varssize == 0 || varssize < *nbndchgs + *nbndchgsafterdual )
7245 for( v = 0; v < *nbndchgs; v++ )
7247 vars[v] = reoptnode->
vars[v];
7253 for( ; v < *nbndchgs + *nbndchgsafterdual; v++ )
7266 SCIPreoptnodeGetPath(reopt, parent, &vars[v], &vals[v], &boundtypes[v], varssize, &nvars2, &nafterdualvars2);
7268 (*nbndchgs) += nvars2;
7269 (*nbndchgsafterdual) += nafterdualvars2;
7281 assert(reopt != NULL);
7283 assert(id < reopt->reopttree->reoptnodessize);
7285 assert(blkmem != NULL);
7311 int* ncreatedchilds,
7317 assert(reopt != NULL);
7318 assert(scip != NULL);
7319 assert(
set != NULL);
7320 assert(stat != NULL);
7321 assert(transprob != NULL);
7322 assert(origprob != NULL);
7323 assert(tree != NULL);
7325 assert(branchcand != NULL);
7326 assert(eventqueue != NULL);
7327 assert(cliquetable != NULL);
7328 assert(blkmem != NULL);
7329 assert(reoptnode != NULL);
7330 assert(childnodes != NULL);
7332 assert(id < reopt->reopttree->reoptnodessize);
7333 assert(success != NULL);
7348 if( set->reopt_usesplitcons )
7350 if( reoptnode->
reopttype == (
unsigned int)SCIP_REOPTTYPE_INFSUBTREE )
7354 (*ncreatedchilds) = 1;
7360 (*ncreatedchilds) = 2;
7366 if( childnodessize < *ncreatedchilds )
7370 for( c = 0; c < *ncreatedchilds; c++ )
7380 cliquetable, blkmem, childnodes[c],
id, c == 1) );
7396 SCIP_CALL(
addSplitcons(reopt, scip,
set, stat, blkmem, transprob, origprob, tree, lp, branchcand,
7397 eventqueue, cliquetable, childnodes[c],
id) );
7421 if( reoptnode->
nconss == 0 )
7428 SCIP_CALL(
fixBounds(reopt,
set, stat, transprob, origprob, tree, lp, branchcand, eventqueue, cliquetable,
7429 blkmem, childnodes[c],
id,
TRUE) );
7460 *ncreatedchilds = nvars+1;
7464 if( childnodessize < *ncreatedchilds )
7469 for( c = 0; c < nvars; c++ )
7473 switch (set->reopt_varorderinterdiction)
7503 for( c = nvars; c >= 0; c-- )
7508 #ifdef SCIP_MORE_DEBUG 7514 cliquetable, blkmem, childnodes[c],
id,
FALSE) );
7520 SCIP_CALL(
fixBounds(reopt,
set, stat, transprob, origprob, tree, lp, branchcand, eventqueue, cliquetable,
7521 blkmem, childnodes[c],
id,
TRUE) );
7532 SCIP_CALL(
fixInterdiction(reopt,
set, stat, transprob, origprob, tree, lp, branchcand, eventqueue, cliquetable,
7533 blkmem, childnodes[c],
id, perm, vars, bounds, boundtypes, nvars, c) );
7562 (*ncreatedchilds) = 1;
7565 if( childnodessize < *ncreatedchilds )
7574 cliquetable, blkmem, childnodes[0],
id,
FALSE) );
7584 assert(reoptnode->
reopttype != (
unsigned int)SCIP_REOPTTYPE_INFSUBTREE
7602 assert(reopt != NULL);
7619 assert(scip != NULL);
7620 assert(reopt != NULL);
7621 assert(
set != NULL);
7622 assert(stat != NULL);
7623 assert(blkmem != NULL);
7628 for( c = reopt->
nglbconss-1; c >= 0; c-- )
7636 assert(reopt->
glbconss[c] != NULL);
7637 assert(reopt->
glbconss[c]->nvars > 0);
7645 for( v = 0; v < reopt->
glbconss[c]->nvars; v++ )
7654 SCIPerrorMessage(
"Expected variable type binary or (impl.) integer for variable <%s> in global constraint at pos. %d.\n",
7665 if( nbinvars == reopt->
glbconss[c]->nvars )
7667 SCIPsetDebugMsg(
set,
"-> add logic-or constraints with %d binvars\n", nbinvars);
7672 for( v = 0; v < reopt->
glbconss[c]->nvars; v++ )
7674 consvars[v] = reopt->
glbconss[c]->vars[v];
7687 consvars,
FALSE,
TRUE,
TRUE,
TRUE,
TRUE,
FALSE,
FALSE,
FALSE,
FALSE,
FALSE) );
7695 assert(reopt->
glbconss[c]->nvars == nbinvars + 2*nintvars);
7697 SCIPsetDebugMsg(
set,
"-> add bounddisjuction constraints with %d binvars, %d intvars\n", nbinvars, (
int) (2*nintvars));
7704 #ifdef SCIP_DEBUG_CONSS 7749 assert(reopt != NULL);
7750 assert(node != NULL);
7751 assert(sepastore != NULL);
7752 assert(blkmem != NULL);
7753 assert(
set != NULL);
7754 assert(stat != NULL);
7755 assert(eventqueue != NULL);
7756 assert(eventfilter != NULL);
7760 assert(id < reopt->reopttree->reoptnodessize);
7767 assert(reoptnode != NULL);
7770 for( c = reoptnode->
nconss-1; c >= 0; c-- )
7774 cons = reoptnode->
conss[c];
7775 assert(cons != NULL);
7790 for( v = 0; v < cons->nvars; v++ )
7797 assert(transvar != NULL);
7800 vals[ncols] = cons->vals[v];
7802 assert(cols[ncols] != NULL);
7806 assert(ncols == cons->nvars);
7813 SCIP_CALL(
SCIProwCreate(&cut, blkmem,
set, stat, lp, cutname, ncols, cols, vals, cons->lhs, cons->rhs,
7817 SCIPsetDebugMsg(
set,
"add cut <%s> of size %d to cutpool, [lhs, rhs] = [%g,%g] to node %lld\n", cutname,
7822 SCIP_CALL(
SCIProwCreate(&cut, blkmem,
set, stat, lp, cutname, ncols, cols, vals, cons->lhs, cons->rhs,
7824 SCIP_CALL(
SCIPsepastoreAddCut(sepastore, blkmem,
set, stat, eventqueue, eventfilter, lp, cut,
FALSE, root,
7827 SCIPsetDebugMsg(
set,
"add cut <%s> of size %d to sepastore, [lhs, rhs] = [%g,%g] to node %lld\n", cutname,
7851 for( i = c-1; i >= 0; i-- )
7870 assert(reopt != NULL);
7871 assert(node != NULL);
7875 assert(id < reopt->reopttree->reoptnodessize);
7882 if(
SCIPsetIsGE(
set, set->reopt_objsimrootlp, 1.0) )
7914 assert(reoptnode != NULL);
7915 assert(
set != NULL);
7917 reoptnode->
conss = NULL;
7923 reoptnode->
nvars = 0;
7930 reoptnode->
vars = NULL;
7949 assert(reopt != NULL);
7950 assert(
set != NULL);
7951 assert(blkmem != NULL);
7952 assert(reoptnode != NULL);
7965 assert(reoptnode != NULL);
7966 assert(blkmem != NULL);
7985 assert(reoptnode != NULL);
7986 assert(var != NULL);
7987 assert(blkmem != NULL);
7989 nvars = reoptnode->
nvars;
7993 reoptnode->
vars[nvars] = var;
8018 assert(reoptnode != NULL);
8019 assert(
set != NULL);
8020 assert(vars != NULL);
8021 assert(bounds != NULL);
8024 assert(blkmem != NULL);
8031 SCIPsetDebugMsg(
set,
"-> constraint has size 1 -> save as normal bound change.\n");
8047 newbound = bounds[0] + 1.0;
8054 newbound = bounds[0] - 1.0;
8065 nconss = reoptnode->
nconss;
8073 if( boundtypes != NULL )
8079 reoptnode->
conss[nconss]->boundtypes = NULL;
8081 reoptnode->
conss[nconss]->varssize = nvars;
8082 reoptnode->
conss[nconss]->nvars = nvars;
8083 reoptnode->
conss[nconss]->lhs = lhs;
8084 reoptnode->
conss[nconss]->rhs = rhs;
8085 reoptnode->
conss[nconss]->constype = constype;
8086 reoptnode->
conss[nconss]->linear = linear;
8100 assert(reopt != NULL);
8101 assert(
set != NULL);
8102 assert(blkmem != NULL);
8103 assert(cons != NULL);
8150 assert(reopt != NULL);
8151 assert(transprob != NULL);
8152 assert(reopt->
glblb == NULL && reopt->
glbub == NULL);
8162 for( i = 0; i < nvars; i++ )
8188 assert(reopt != NULL);
8189 assert(transprob != NULL);
8192 conss = transprob->
conss;
8193 nconss = transprob->
nconss;
8198 for( i = 0; i < nconss; i++ )
8227 assert(reopt != NULL);
8228 assert(transprob != NULL);
8229 assert(reopt->
glblb != NULL && reopt->
glbub != NULL);
8236 for( i = 0; i < nvars; i++ )
8270 assert(reopt != NULL);
8276 for( i = 0; i < nentries; i++ )
8285 assert(cons != NULL);
8310 assert(reopt != NULL);
8311 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 SCIPreoptReleaseData(SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem)
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 cleanActiveConss(SCIP_REOPT *reopt, SCIP_SET *set)
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