/** creates the node selector for best first search and includes it in SCIP */ SCIP_RETCODE SCIPincludeNodeselBfs( SCIP* scip /**< SCIP data structure */ ) { SCIP_NODESELDATA* nodeseldata; SCIP_NODESEL* nodesel; /* allocate and initialize node selector data; this has to be freed in the destructor */ SCIP_CALL( SCIPallocMemory(scip, &nodeseldata) ); /* include node selector */ SCIP_CALL( SCIPincludeNodeselBasic(scip, &nodesel, NODESEL_NAME, NODESEL_DESC, NODESEL_STDPRIORITY, NODESEL_MEMSAVEPRIORITY, nodeselSelectBfs, nodeselCompBfs, nodeseldata) ); assert(nodesel != NULL); SCIP_CALL( SCIPsetNodeselCopy(scip, nodesel, nodeselCopyBfs) ); SCIP_CALL( SCIPsetNodeselFree(scip, nodesel, nodeselFreeBfs) ); /* add node selector parameters */ SCIP_CALL( SCIPaddIntParam(scip, "nodeselection/bfs/minplungedepth", "minimal plunging depth, before new best node may be selected (-1 for dynamic setting)", &nodeseldata->minplungedepth, TRUE, MINPLUNGEDEPTH, -1, INT_MAX, NULL, NULL) ); SCIP_CALL( SCIPaddIntParam(scip, "nodeselection/bfs/maxplungedepth", "maximal plunging depth, before new best node is forced to be selected (-1 for dynamic setting)", &nodeseldata->maxplungedepth, TRUE, MAXPLUNGEDEPTH, -1, INT_MAX, NULL, NULL) ); SCIP_CALL( SCIPaddRealParam(scip, "nodeselection/bfs/maxplungequot", "maximal quotient (curlowerbound - lowerbound)/(cutoffbound - lowerbound) where plunging is performed", &nodeseldata->maxplungequot, TRUE, MAXPLUNGEQUOT, 0.0, SCIP_REAL_MAX, NULL, NULL) ); return SCIP_OKAY; }
/** creates the node selector for hybrid best estimate / best bound search and includes it in SCIP */ SCIP_RETCODE SCIPincludeNodeselHybridestim( SCIP* scip /**< SCIP data structure */ ) { SCIP_NODESELDATA* nodeseldata; SCIP_NODESEL* nodesel; /* allocate and initialize node selector data; this has to be freed in the destructor */ SCIP_CALL( SCIPallocMemory(scip, &nodeseldata) ); /* include node selector */ SCIP_CALL( SCIPincludeNodeselBasic(scip, &nodesel, NODESEL_NAME, NODESEL_DESC, NODESEL_STDPRIORITY, NODESEL_MEMSAVEPRIORITY, nodeselSelectHybridestim, nodeselCompHybridestim, nodeseldata) ); assert(nodesel != NULL); SCIP_CALL( SCIPsetNodeselCopy(scip, nodesel, nodeselCopyHybridestim) ); SCIP_CALL( SCIPsetNodeselFree(scip, nodesel, nodeselFreeHybridestim) ); /* add node selector parameters */ SCIP_CALL( SCIPaddIntParam(scip, "nodeselection/hybridestim/minplungedepth", "minimal plunging depth, before new best node may be selected (-1 for dynamic setting)", &nodeseldata->minplungedepth, TRUE, MINPLUNGEDEPTH, -1, INT_MAX, NULL, NULL) ); SCIP_CALL( SCIPaddIntParam(scip, "nodeselection/hybridestim/maxplungedepth", "maximal plunging depth, before new best node is forced to be selected (-1 for dynamic setting)", &nodeseldata->maxplungedepth, TRUE, MAXPLUNGEDEPTH, -1, INT_MAX, NULL, NULL) ); SCIP_CALL( SCIPaddRealParam(scip, "nodeselection/hybridestim/maxplungequot", "maximal quotient (estimate - lowerbound)/(cutoffbound - lowerbound) where plunging is performed", &nodeseldata->maxplungequot, TRUE, MAXPLUNGEQUOT, 0.0, SCIP_REAL_MAX, NULL, NULL) ); SCIP_CALL( SCIPaddIntParam(scip, "nodeselection/hybridestim/bestnodefreq", "frequency at which the best node instead of the hybrid best estimate / best bound is selected (0: never)", &nodeseldata->bestnodefreq, FALSE, BESTNODEFREQ, 0, INT_MAX, NULL, NULL) ); SCIP_CALL( SCIPaddRealParam(scip, "nodeselection/hybridestim/estimweight", "weight of estimate value in node selection score (0: pure best bound search, 1: pure best estimate search)", &nodeseldata->estimweight, TRUE, ESTIMWEIGHT, 0.0, 1.0, NULL, NULL) ); return SCIP_OKAY; }
/** creates the node selector for best estimate search and includes it in SCIP */ SCIP_RETCODE SCIPincludeNodeselEstimate( SCIP* scip /**< SCIP data structure */ ) { SCIP_NODESELDATA* nodeseldata; SCIP_NODESEL* nodesel; /* allocate and initialize node selector data; this has to be freed in the destructor */ SCIP_CALL( SCIPallocMemory(scip, &nodeseldata) ); /* include node selector */ SCIP_CALL( SCIPincludeNodeselBasic(scip, &nodesel, NODESEL_NAME, NODESEL_DESC, NODESEL_STDPRIORITY, NODESEL_MEMSAVEPRIORITY, nodeselSelectEstimate, nodeselCompEstimate, nodeseldata) ); assert(nodesel != NULL); SCIP_CALL( SCIPsetNodeselCopy(scip, nodesel, nodeselCopyEstimate) ); SCIP_CALL( SCIPsetNodeselFree(scip, nodesel, nodeselFreeEstimate) ); /* add node selector parameters */ SCIP_CALL( SCIPaddIntParam(scip, "nodeselection/estimate/minplungedepth", "minimal plunging depth, before new best node may be selected (-1 for dynamic setting)", &nodeseldata->minplungedepth, TRUE, DEFAULT_MINPLUNGEDEPTH, -1, INT_MAX, NULL, NULL) ); SCIP_CALL( SCIPaddIntParam(scip, "nodeselection/estimate/maxplungedepth", "maximal plunging depth, before new best node is forced to be selected (-1 for dynamic setting)", &nodeseldata->maxplungedepth, TRUE, DEFAULT_MAXPLUNGEDEPTH, -1, INT_MAX, NULL, NULL) ); SCIP_CALL( SCIPaddRealParam(scip, "nodeselection/estimate/maxplungequot", "maximal quotient (estimate - lowerbound)/(cutoffbound - lowerbound) where plunging is performed", &nodeseldata->maxplungequot, TRUE, DEFAULT_MAXPLUNGEQUOT, 0.0, SCIP_REAL_MAX, NULL, NULL) ); SCIP_CALL( SCIPaddIntParam(scip, "nodeselection/estimate/bestnodefreq", "frequency at which the best node instead of the best estimate is selected (0: never)", &nodeseldata->bestnodefreq, FALSE, DEFAULT_BESTNODEFREQ, 0, INT_MAX, NULL, NULL) ); SCIP_CALL( SCIPaddIntParam(scip, "nodeselection/estimate/breadthfirstdepth", "depth until breadth-fisrt search is applied", &nodeseldata->breadthfirstdepth, FALSE, DEFAULT_BREADTHFIRSTDEPTH, -1, INT_MAX, NULL, NULL) ); return SCIP_OKAY; }
/** creates the node selector for depth first search and includes it in SCIP */ SCIP_RETCODE SCIPincludeNodeselDfs( SCIP* scip /**< SCIP data structure */ ) { SCIP_NODESELDATA* nodeseldata; SCIP_NODESEL* nodesel; /* create dfs node selector data */ nodeseldata = NULL; /* include node selector */ SCIP_CALL( SCIPincludeNodeselBasic(scip, &nodesel, NODESEL_NAME, NODESEL_DESC, NODESEL_STDPRIORITY, NODESEL_MEMSAVEPRIORITY, nodeselSelectDfs, nodeselCompDfs, nodeseldata) ); assert(nodesel != NULL); SCIP_CALL( SCIPsetNodeselCopy(scip, nodesel, nodeselCopyDfs) ); return SCIP_OKAY; }
/** creates the node selector for breadth first search and includes it in SCIP */ SCIP_RETCODE SCIPincludeNodeselBreadthfirst( SCIP* scip /**< SCIP data structure */ ) { SCIP_NODESELDATA* nodeseldata; SCIP_NODESEL* nodesel; /* create breadthfirst node selector data */ nodeseldata = NULL; /* include node selector */ SCIP_CALL( SCIPincludeNodeselBasic(scip, &nodesel, NODESEL_NAME, NODESEL_DESC, NODESEL_STDPRIORITY, NODESEL_MEMSAVEPRIORITY, nodeselSelectBreadthfirst, nodeselCompBreadthfirst, nodeseldata) ); assert(nodesel != NULL); /* set non-fundamental callback functions via setter functions */ SCIP_CALL ( SCIPsetNodeselCopy(scip, nodesel, nodeselCopyBreadthfirst) ); return SCIP_OKAY; }