81 #define BRANCHRULE_NAME "RyanFoster" 82 #define BRANCHRULE_DESC "Ryan/Foster branching rule" 83 #define BRANCHRULE_PRIORITY 50000 84 #define BRANCHRULE_MAXDEPTH -1 85 #define BRANCHRULE_MAXBOUNDDIST 1.0 126 assert(branchrule !=
NULL);
128 assert(result !=
NULL);
135 assert(probdata !=
NULL);
141 for( i = 0; i < nitems; ++i )
145 for( j = 0; j < nitems; ++j )
146 pairweights[i][j] = 0.0;
151 assert(nlpcands > 0);
154 for( v = 0; v < nlpcands; ++v )
156 assert(lpcands[v] !=
NULL);
163 assert(nconsids > 0);
166 for( i = 0; i < nconsids; ++i )
169 for( j = i+1; j < nconsids; ++j )
174 pairweights[id2][id1] += lpcandsfrac[v];
187 for( i = 0; i < nitems; ++i )
189 for( j = 0; j < i+1; ++j )
191 value =
MIN(pairweights[i][j], 1-pairweights[i][j]);
193 if( bestvalue < value )
202 assert( bestvalue > 0.0 );
203 assert( id1 >= 0 && id1 < nitems);
204 assert( id2 >= 0 && id2 < nitems);
207 for( i = 0; i < nitems; ++i )
253 branchruledata =
NULL;
258 assert(branchrule !=
NULL);
SCIP_RETCODE SCIPgetLPBranchCands(SCIP *scip, SCIP_VAR ***lpcands, SCIP_Real **lpcandssol, SCIP_Real **lpcandsfrac, int *nlpcands, int *npriolpcands, int *nfracimplvars)
Ryan/Foster branching rule.
#define BRANCHRULE_MAXDEPTH
SCIP_Real SCIPgetLocalTransEstimate(SCIP *scip)
struct SCIP_BranchruleData SCIP_BRANCHRULEDATA
SCIP_RETCODE SCIPincludeBranchruleRyanFoster(SCIP *scip)
Constraint handler stores the local branching decision data.
SCIP_RETCODE SCIPcreateConsSamediff(SCIP *scip, SCIP_CONS **cons, const char *name, int itemid1, int itemid2, CONSTYPE type, SCIP_NODE *node, SCIP_Bool local)
SCIP_Bool SCIPisFeasGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
struct SCIP_VarData SCIP_VARDATA
enum SCIP_Retcode SCIP_RETCODE
Variable data containing the ids of constraints in which the variable appears.
SCIP_RETCODE SCIPincludeBranchruleBasic(SCIP *scip, SCIP_BRANCHRULE **branchruleptr, const char *name, const char *desc, int priority, int maxdepth, SCIP_Real maxbounddist, SCIP_BRANCHRULEDATA *branchruledata)
#define SCIPfreeBufferArray(scip, ptr)
int * SCIPvardataGetConsids(SCIP_VARDATA *vardata)
SCIP_RETCODE SCIPsetBranchruleExecLp(SCIP *scip, SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHEXECLP((*branchexeclp)))
#define BRANCHRULE_PRIORITY
SCIP_RETCODE SCIPcreateChild(SCIP *scip, SCIP_NODE **node, SCIP_Real nodeselprio, SCIP_Real estimate)
SCIP_Bool SCIPisFeasLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_RETCODE SCIPaddConsNode(SCIP *scip, SCIP_NODE *node, SCIP_CONS *cons, SCIP_NODE *validnode)
int * SCIPprobdataGetIds(SCIP_PROBDATA *probdata)
#define SCIPallocBufferArray(scip, ptr, num)
Problem data for binpacking problem.
int SCIPprobdataGetNItems(SCIP_PROBDATA *probdata)
int SCIPgetDepth(SCIP *scip)
SCIP_VARDATA * SCIPvarGetData(SCIP_VAR *var)
struct SCIP_ProbData SCIP_PROBDATA
SCIP_PROBDATA * SCIPgetProbData(SCIP *scip)
SCIP_RETCODE SCIPreleaseCons(SCIP *scip, SCIP_CONS **cons)
#define BRANCHRULE_MAXBOUNDDIST
int SCIPvardataGetNConsids(SCIP_VARDATA *vardata)
const char * SCIPbranchruleGetName(SCIP_BRANCHRULE *branchrule)
static SCIP_DECL_BRANCHEXECLP(branchExeclpRyanFoster)
SCIP_Longint SCIPgetNNodes(SCIP *scip)