30 #define NODESEL_NAME "restartdfs" 31 #define NODESEL_DESC "depth first search with periodical selection of the best node" 32 #define NODESEL_STDPRIORITY 10000 33 #define NODESEL_MEMSAVEPRIORITY 50000 40 #define SELECTBESTFREQ 100 41 #define COUNTONLYLEAVES TRUE 45 struct SCIP_NodeselData
63 assert(nodesel !=
NULL);
82 assert(nodeseldata !=
NULL);
99 assert(nodeseldata !=
NULL);
102 nodeseldata->lastrestart = 0;
103 nodeseldata->nprocessedleaves = 0;
114 assert(selnode !=
NULL);
118 if( *selnode ==
NULL )
125 assert(nodeseldata !=
NULL);
128 nodeseldata->nprocessedleaves++;
135 if( (nodeseldata->countonlyleaves && nodeseldata->nprocessedleaves >= nodeseldata->selectbestfreq)
136 || (!nodeseldata->countonlyleaves && nnodes - nodeseldata->lastrestart >= nodeseldata->selectbestfreq ) )
138 nodeseldata->lastrestart =
nnodes;
139 nodeseldata->nprocessedleaves = 0;
145 if( *selnode ==
NULL )
176 nodeseldata->lastrestart = 0;
177 nodeseldata->nprocessedleaves = 0;
183 nodeselSelectRestartdfs, nodeselCompRestartdfs, nodeseldata) );
185 assert(nodesel !=
NULL);
193 "nodeselection/restartdfs/selectbestfreq",
194 "frequency for selecting the best node instead of the deepest one",
199 "nodeselection/restartdfs/countonlyleaves",
200 "count only leaf nodes (otherwise all nodes)?",
SCIP_RETCODE SCIPsetNodeselCopy(SCIP *scip, SCIP_NODESEL *nodesel, SCIP_DECL_NODESELCOPY((*nodeselcopy)))
#define NODESEL_MEMSAVEPRIORITY
SCIP_RETCODE SCIPincludeNodeselBasic(SCIP *scip, SCIP_NODESEL **nodesel, const char *name, const char *desc, int stdpriority, int memsavepriority, SCIP_DECL_NODESELSELECT((*nodeselselect)), SCIP_DECL_NODESELCOMP((*nodeselcomp)), SCIP_NODESELDATA *nodeseldata)
node selector for depth first search with periodical selection of the best node
enum SCIP_Retcode SCIP_RETCODE
#define SCIPfreeBlockMemory(scip, ptr)
#define SCIPallocBlockMemory(scip, ptr)
SCIP_RETCODE SCIPaddIntParam(SCIP *scip, const char *name, const char *desc, int *valueptr, SCIP_Bool isadvanced, int defaultvalue, int minvalue, int maxvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
static SCIP_DECL_NODESELINITSOL(nodeselInitsolRestartdfs)
SCIP_Longint SCIPnodeGetNumber(SCIP_NODE *node)
struct SCIP_NodeselData SCIP_NODESELDATA
#define NODESEL_STDPRIORITY
SCIP_NODESELDATA * SCIPnodeselGetData(SCIP_NODESEL *nodesel)
static SCIP_DECL_NODESELCOPY(nodeselCopyRestartdfs)
SCIP_NODE * SCIPgetBestboundNode(SCIP *scip)
static SCIP_DECL_NODESELCOMP(nodeselCompRestartdfs)
const char * SCIPnodeselGetName(SCIP_NODESEL *nodesel)
SCIP_RETCODE SCIPsetNodeselInitsol(SCIP *scip, SCIP_NODESEL *nodesel, SCIP_DECL_NODESELINITSOL((*nodeselinitsol)))
SCIP_NODE * SCIPgetPrioSibling(SCIP *scip)
SCIP_RETCODE SCIPsetNodeselFree(SCIP *scip, SCIP_NODESEL *nodesel, SCIP_DECL_NODESELFREE((*nodeselfree)))
static SCIP_DECL_NODESELFREE(nodeselFreeRestartdfs)
SCIP_NODE * SCIPgetPrioChild(SCIP *scip)
static SCIP_DECL_NODESELSELECT(nodeselSelectRestartdfs)
SCIP_NODE * SCIPgetBestLeaf(SCIP *scip)
SCIP_RETCODE SCIPincludeNodeselRestartdfs(SCIP *scip)
SCIP_Longint SCIPgetNNodes(SCIP *scip)
void SCIPnodeselSetData(SCIP_NODESEL *nodesel, SCIP_NODESELDATA *nodeseldata)
SCIP_RETCODE SCIPaddBoolParam(SCIP *scip, const char *name, const char *desc, SCIP_Bool *valueptr, SCIP_Bool isadvanced, SCIP_Bool defaultvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)